/** returns true if the string has the prefix */ bool StringHasPrefix( const std::string & sString, const std::string & sPrefix ); bool StringHasPrefixCaseSensitive( const std::string & sString, const std::string & sPrefix );
/** returns if the string has the suffix */ bool StringHasSuffix( const std::string &sString, const std::string &sSuffix ); bool StringHasSuffixCaseSensitive( const std::string &sString, const std::string &sSuffix );
// Mozilla: see mozilla.patch for more details #ifdefined( _WIN32 ) /** converts a UTF-16 string to a UTF-8 string */
std::string UTF16to8( constwchar_t * in );
std::string UTF16to8( const std::wstring & in );
/** converts a UTF-8 string to a UTF-16 string */
std::wstring UTF8to16(constchar * in);
std::wstring UTF8to16( const std::string & in ); #define Utf16FromUtf8 UTF8to16 #endif
#ifdefined( LINUX ) // this implementation does not return whether or not the destination was // truncated, but that is straightforward to fix if anybody actually needs the // return code. #include"string.h" inlinevoid wcsncpy_s(wchar_t *strDest, size_t numberOfElements, constwchar_t *strSource, size_t count)
{
wcsncpy(strDest, strSource, numberOfElements);
strDest[numberOfElements-1] = '\0';
}
/* Handles copying a std::string into a buffer as would be provided in an API */
uint32_t ReturnStdString( const std::string & sValue, char *pchBuffer, uint32_t unBufferLen );
/** Returns a std::string from a uint64_t */ // Mozilla: see mozilla.patch for more details //std::string Uint64ToString( uint64_t ulValue );
/** returns a uint64_t from a string */
uint64_t StringToUint64( const std::string & sValue );
//----------------------------------------------------------------------------- // Purpose: Encodes a string (or binary data) from URL encoding format, see rfc1738 section 2.2. // This version of the call isn't a strict RFC implementation, but uses + for space as is // the standard in HTML form encoding, despite it not being part of the RFC. // // Dest buffer should be at least as large as source buffer to guarantee room for decode. //----------------------------------------------------------------------------- void V_URLEncode( char *pchDest, int nDestLen, constchar *pchSource, int nSourceLen );
/** Same as V_URLEncode, but without plus for space. */ void V_URLEncodeNoPlusForSpace( char *pchDest, int nDestLen, constchar *pchSource, int nSourceLen );
/** Same as V_URLEncodeNoPlusForSpace, but without escaping / and : */ void V_URLEncodeFullPath( char *pchDest, int nDestLen, constchar *pchSource, int nSourceLen );
//----------------------------------------------------------------------------- // Purpose: Decodes a string (or binary data) from URL encoding format, see rfc1738 section 2.2. // This version of the call isn't a strict RFC implementation, but uses + for space as is // the standard in HTML form encoding, despite it not being part of the RFC. // // Dest buffer should be at least as large as source buffer to guarantee room for decode. // Dest buffer being the same as the source buffer (decode in-place) is explicitly allowed. //-----------------------------------------------------------------------------
size_t V_URLDecode( char *pchDecodeDest, int nDecodeDestLen, constchar *pchEncodedSource, int nEncodedSourceLen );
/** Same as V_URLDecode, but without plus for space. */
size_t V_URLDecodeNoPlusForSpace( char *pchDecodeDest, int nDecodeDestLen, constchar *pchEncodedSource, int nEncodedSourceLen );
//----------------------------------------------------------------------------- // Purpose: strip extension from a path //----------------------------------------------------------------------------- void V_StripExtension( std::string &in );
/** Tokenizes a string into a vector of strings */
std::vector<std::string> TokenizeString( const std::string & sString, char cToken );
Messung V0.5
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.