|
Doxygen
|
Some helper functions for std::string. More...
Go to the source code of this file.
Functions | |
| void | substituteInplace (std::string &s, std::string_view toReplace, std::string_view replaceWith) |
| Replaces occurrences of substring toReplace in string s with string replaceWith. | |
| std::string | substituteStringView (std::string_view s, std::string_view toReplace, std::string_view replaceWith) |
| Returns a new string where occurrences of substring toReplace in string s are replaced by string replaceWith. | |
| std::string_view | stripWhiteSpace (std::string_view s) |
| Given a string view s, returns a new, narrower view on that string, skipping over any leading or trailing whitespace characters. | |
| void | addTerminalCharIfMissing (std::string &s, char c) |
| template<size_t N> | |
| bool | literal_at (const char *data, const char(&str)[N]) |
| returns true iff data points to a substring that matches string literal str | |
| template<size_t N> | |
| bool | literal_at (std::string_view data, const char(&str)[N]) |
| returns true iff data points to a substring that matches string literal str | |
| StringVector | split (const std::string &s, const std::string &delimiter) |
| split input string s by string delimiter delimiter. | |
| StringVector | split (const std::string &s, const reg::Ex &delimiter) |
| split input string s by regular expression delimiter delimiter. | |
| std::string | join (const StringVector &sv, const std::string &delimiter) |
| create a string where the string in the vector are joined by the given delimiter | |
| size_t | findIndex (const StringVector &sv, const std::string &s) |
| find the index of a string in a vector of strings, returns std::string::npos if the string could not be found | |
| size_t | findIndex (const std::string &s, const reg::Ex &re) |
| find the index of the first occurrence of pattern re in a string s returns std::string::npos if the pattern could not be found | |
| std::string | removeEmptyLines (const std::string &s) |
Some helper functions for std::string.
Definition in file stringutil.h.
|
inline |
Definition at line 87 of file stringutil.h.
Referenced by checkAndOpenFile(), fileToString(), parseFile(), and parseInput().
|
inline |
find the index of the first occurrence of pattern re in a string s returns std::string::npos if the pattern could not be found
Definition at line 175 of file stringutil.h.
References reg::search().
|
inline |
find the index of a string in a vector of strings, returns std::string::npos if the string could not be found
Definition at line 167 of file stringutil.h.
Referenced by initUCF(), VhdlDocGen::parseForBinding(), VhdlDocGen::parseUCF(), DotFilePatcher::run(), and VhdlDocGen::writeFormatString().
|
inline |
create a string where the string in the vector are joined by the given delimiter
Definition at line 153 of file stringutil.h.
Referenced by handleAnchor(), handleCite(), handleFormatBlock(), and handleImage().
| bool literal_at | ( | const char * | data, |
| const char(&) | str[N] ) |
returns true iff data points to a substring that matches string literal str
Definition at line 101 of file stringutil.h.
References dstrncmp().
Referenced by computeIndent(), convertMapFile(), detab(), extractCopyDocId(), getConvertLatexMacro(), isExplicitPage(), isNewline(), Markdown::Private::isSpecialCommand(), Markdown::process(), Markdown::Private::processNmdash(), readSVGSize(), removeIdsAndMarkers(), skipOverFileAndLineCommands(), stripIndentation(), stripLeadingAndTrailingEmptyLines(), stripTrailingWhiteSpace(), and PlantumlManager::writePlantUMLSource().
| bool literal_at | ( | std::string_view | data, |
| const char(&) | str[N] ) |
returns true iff data points to a substring that matches string literal str
Definition at line 109 of file stringutil.h.
References dstrncmp().
|
inline |
Definition at line 181 of file stringutil.h.
Referenced by substituteHtmlKeywords(), and substituteLatexKeywords().
|
inline |
split input string s by regular expression delimiter delimiter.
returns a vector of non-empty strings that are between the delimiters
Definition at line 134 of file stringutil.h.
References end().
|
inline |
split input string s by string delimiter delimiter.
returns a vector of non-empty strings that are between the delimiters
Definition at line 117 of file stringutil.h.
Referenced by VHDLOutlineParser::addProto(), VHDLOutlineParser::addVhdlType(), FlowChart::alignCommentNode(), anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), VHDLOutlineParser::checkInlineCode(), checkVhdlString(), VHDLOutlineParser::createFunction(), VhdlDocGen::findArchitecture(), CitationManager::generatePage(), getFilteredImageAttributes(), VhdlDocGen::getIndexWord(), DocParser::handleCite(), DocPara::handleCommand(), DocParser::handleImage(), DocPara::handleInclude(), Qhp::initialize(), VhdlDocGen::parseForBinding(), VhdlDocGen::parseForConfig(), parseIncludeOptions(), writeFuncProto(), VhdlDocGen::writeInlineClassLink(), and VhdlDocGen::writeRecUnitDocu().
|
inline |
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trailing whitespace characters.
Definition at line 75 of file stringutil.h.
References end().
Referenced by DefinitionImpl::_setDocumentation(), endBrief(), VhdlDocGen::getClass(), handleInheritanceGraph(), handleToc(), FileDefImpl::hasDetailedDescription(), DefinitionImpl::operator=(), parseIncludeOptions(), DefinitionImpl::setDocumentation(), DefinitionMixin< Base >::setDocumentation(), DefinitionMutable::setDocumentation(), MemberDefImpl::setDocumentation(), Markdown::Private::writeBlockQuote(), and FileDefImpl::writeBriefDescription().
|
inline |
Replaces occurrences of substring toReplace in string s with string replaceWith.
Modifies s in place.
Definition at line 32 of file stringutil.h.
Referenced by replaceAliasArguments().
|
inline |
Returns a new string where occurrences of substring toReplace in string s are replaced by string replaceWith.
Definition at line 53 of file stringutil.h.
Referenced by escapeAlias(), and replaceAliases().