32#include <wx/filename.h>
85wxString
TitleCaps(
const wxString& aString );
126wxString
EscapeHTML(
const wxString& aString );
133char*
GetLine( FILE* aFile,
char* Line,
int* LineNum =
nullptr,
int SizeLine = 255 );
172int StrNumCmp(
const wxString& aString1,
const wxString& aString2,
bool aIgnoreCase =
false );
180 const wxString& string_to_tst,
181 bool case_sensitive =
true );
199 wxString* strBeginning,
235extern "C" char*
strtok_r(
char* str,
const char* delim,
char** nextp );
246 bool operator() (
const wxString& strA,
const wxString& strB )
const
248 wxString::const_reverse_iterator sA = strA.rbegin();
249 wxString::const_reverse_iterator eA = strA.rend();
251 wxString::const_reverse_iterator sB = strB.rbegin();
252 wxString::const_reverse_iterator eB = strB.rend();
266 while( sA != eA && sB != eB )
268 if( ( *sA ) == ( *sB ) )
275 if( ( *sA ) < ( *sB ) )
297static inline std::vector<std::string>
split(
const std::string& aStr,
const std::string& aDelim )
303 std::vector<std::string> tokens;
305 while( pos < aStr.size() )
307 pos = aStr.find_first_of( aDelim, last_pos );
309 if( pos == std::string::npos )
312 len = pos - last_pos;
314 tokens.push_back( aStr.substr( last_pos, len ) );
325 if( !aDesc.IsEmpty() )
326 aDesc << wxT(
", " );
338void wxStringSplit(
const wxString& aText, wxArrayString& aStrings, wxChar aSplitter );
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
wxString ConvertToNewOverbarNotation(const wxString &aOldStr)
Convert the old ~...~ overbar notation to the new ~{...} one.
int GetTrailingInt(const wxString &aStr)
Gets the trailing int, if any, from a string.
wxString UnescapeString(const wxString &aSource)
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive=true)
Compare a string against wild card (* and ?) pattern using the usual rules.
wxString GetIllegalFileNameWxChars()
bool ConvertSmartQuotesAndDashes(wxString *aString)
Convert curly quotes and em/en dashes to straight quotes and dashes.
char * GetLine(FILE *aFile, char *Line, int *LineNum=nullptr, int SizeLine=255)
Read one line line from aFile.
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase=false)
Compare two strings with alphanumerical content.
char * strtok_r(char *str, const char *delim, char **nextp)
int ReadDelimitedText(char *aDest, const char *aSource, int aDestSize)
Copy bytes from aSource delimited string segment to aDest buffer.
wxString TitleCaps(const wxString &aString)
Capitalize the first letter in each word.
void StripTrailingZeros(wxString &aStringValue, unsigned aTrailingZeroAllowed=1)
Remove trailing zeros from a string containing a converted float number.
std::string UIDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 We want to avoid scientific ...
ESCAPE_CONTEXT
Escape/Unescape routines to safely encode reserved-characters in various contexts.
static std::vector< std::string > split(const std::string &aStr, const std::string &aDelim)
Split the input string into a vector of output strings.
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...
int PrintableCharCount(const wxString &aString)
Return the number of printable (ie: non-formatting) chars.
std::string EscapedUTF8(const wxString &aString)
Return an 8 bit UTF8 string given aString in Unicode form.
wxString PrettyPrintForMenu(const wxString &aString)
Remove markup (such as overbar or subscript) that we can't render to menu items.
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
void AccumulateDescription(wxString &aDesc, const wxString &aItem)
Utility to build comma separated lists in messages.
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
int ValueStringCompare(const wxString &strFWord, const wxString &strSWord)
Compare strings like the strcmp function but handle numbers and modifiers within the string text corr...
int SplitString(const wxString &strToSplit, wxString *strBeginning, wxString *strDigits, wxString *strEnd)
Break a string into three parts: he alphabetic preamble, the numeric part, and any alphabetic ending.
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
bool NoPrintableChars(const wxString &aString)
Return true if the string is empty or contains only whitespace.
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar=0)
Checks aName for illegal file name characters.
A helper for sorting strings from the rear.
bool operator()(const wxString &strA, const wxString &strB) const