C12Adapter Opensource C++ Interface
|
Provides static methods for string manipulation. More...
Public Types | |
enum | Masks { StrNone = 0x00, StrXML = 0x01, StrInternational = 0x02, StrQuote = 0x04, StrKeepSideBlanks = 0x08, StrNoBackslashEscape = 0x10, StrShortEscapes = 0x20 } |
Enumeration type that defines string transformation. More... | |
enum | WordWrappingConstants { MinimumLineWidth = 20, DefaultLineWidth = 100 } |
Constants used in word wrapping algorithm. More... | |
Static Public Member Functions | |
static MStdString | Decode (const MStdString &encoding, const MByteString &str, const MStdString &badChar=MVariant::s_emptyString) |
Decode a byte string in a specific encoding into a UTF-8 string. More... | |
static MWideString | Decode (const MStdString &encoding, const MByteString &str, const MWideString &badChar) |
Decode a byte string in a specific encoding into a Unicode string. More... | |
static MStdStringVector | GetAllSupportedEncodings () |
Return all encodings supported. More... | |
static MStdString | ToString (const MStdString &str, unsigned mask) |
static MWideString | ToString (const MWideString &str, unsigned mask) |
static MStdString | FromString (const MStdString &str, unsigned mask) |
static MWideString | FromString (const MWideString &str, unsigned mask) |
static MStdString | ToXMLString (const MStdString &str) |
static MWideString | ToXMLString (const MWideString &str) |
static MStdString | FromXMLString (const MStdString &str) |
static MWideString | FromXMLString (const MWideString &str) |
static char | EscapeToChar (const char *str, const char **strEnd=NULL) |
static wchar_t | EscapeToChar (const wchar_t *str, const wchar_t **strEnd=NULL) |
static char | XMLEscapeToChar (const char *str, const char **strEnd=NULL) |
static wchar_t | XMLEscapeToChar (const wchar_t *str, const wchar_t **strEnd=NULL) |
static MStdString | ToQuotedEscapedString (const MStdString &str) |
static MWideString | ToQuotedEscapedString (const MWideString &str) |
static MStdString | ToEscapedString (const MStdString &str) |
static MWideString | ToEscapedString (const MWideString &str) |
static MStdString | ToEscapedXmlString (const MStdString &str) |
static MWideString | ToEscapedXmlString (const MWideString &str) |
static MStdString | CharToEscapedString (char ch) |
static MWideString | CharToEscapedString (wchar_t ch) |
static MStdString | CharToQuotedEscapedString (char ch) |
static MWideString | CharToQuotedEscapedString (wchar_t ch) |
static MStdString | FromEscapedString (const MStdString &str) |
static MWideString | FromEscapedString (const MWideString &str) |
static MStdString | ToUpper (const MStdString &par) |
static char | ToUpper (char par) |
static MWideString | ToUpper (const MWideString &par) |
static wchar_t | ToUpper (wchar_t par) |
static MStdString | ToLower (const MStdString &par) |
static char | ToLower (char par) |
static MWideString | ToLower (const MWideString &par) |
static wchar_t | ToLower (wchar_t par) |
static MStdString | WordWrap (const MStdString &str, unsigned indentCount=0, unsigned lineWidth=DefaultLineWidth) |
static MWideString | WordWrap (const MWideString &str, unsigned indentCount=0, unsigned lineWidth=DefaultLineWidth) |
static int | Compare (const MStdString &s1, const MStdString &s2, bool ignoreCase=false) |
static int | Compare (const MWideString &s1, const MWideString &s2, bool ignoreCase=false) |
static MByteString | Encode (const MStdString &encoding, const MStdString &str, const MByteString &badChar=MVariant::s_emptyString) |
static MByteString | Encode (const MStdString &encoding, const MWideString &str, const MByteString &badChar) |
![]() | |
static const MClass * | GetStaticClass () |
Get the declared class of this particular object. More... | |
static bool | IsClassPresent (const MStdString &name) |
Tells if the given class name is available. More... | |
Additional Inherited Members | |
![]() | |
virtual | ~MObject () |
Object destructor. | |
virtual const MClass * | GetClass () const =0 |
Get the final class of the object. More... | |
virtual unsigned | GetEmbeddedSizeof () const |
For embedded object types, return the size of the class. More... | |
bool | IsEmbeddedObject () const |
Tell if the object is of embedded kind. More... | |
SHOW_INTERNAL MVariant | Call (const MStdString &name, const MVariant ¶ms) |
Call the object service with parameters, given as variant. More... | |
MVariant | Call0 (const MStdString &name) |
Call the object service with no parameters. More... | |
MVariant | Call1 (const MStdString &name, const MVariant &p1) |
Call the object service with one parameter. More... | |
MVariant | Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2) |
Call the object service with two parameter. More... | |
MVariant | Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3) |
Call the object service with three parameter. More... | |
MVariant | Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4) |
Call the object service with four parameter. More... | |
MVariant | Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5) |
Call the object service with five parameter. More... | |
MVariant | Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6) |
Call the object service with six parameter. More... | |
virtual MVariant | CallV (const MStdString &name, const MVariant::VariantVector ¶ms) |
Call the object service with parameters, given as variant vector. More... | |
virtual bool | IsPropertyPresent (const MStdString &name) const |
Tell if the property with the given name exists. | |
virtual bool | IsServicePresent (const MStdString &name) const |
Tell if the service with the given name exists. | |
virtual MVariant | GetProperty (const MStdString &name) const |
Get the property value using name of the property. More... | |
virtual void | SetProperty (const MStdString &name, const MVariant &value) |
Set the property using name of the property, and value. More... | |
virtual MStdStringVector | GetAllPropertyNames () const |
Return the list of publicly available properties, persistent or not. More... | |
virtual MStdStringVector | GetAllPersistentPropertyNames () const |
Return the list of persistent properties. More... | |
virtual void | SetPersistentPropertiesToDefault () |
Set the persistent properties of the object to their default values. More... | |
virtual MVariant | GetPersistentPropertyDefaultValue (const MStdString &name) const |
Get the default value of persistent property with the name given. More... | |
virtual void | SetPersistentPropertyToDefault (const MStdString &name) |
Set the persistent property with the name given to default value. More... | |
virtual const char * | GetType () const |
Get the name of the type for the object (could be the same as class name). | |
virtual void | SetType (const MStdString &) |
Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More... | |
virtual void | Validate () |
Validate internal structures of the object. More... | |
![]() | |
static const MClass | s_class |
Class of MObject. | |
![]() | |
MObject () | |
Object constructor, protected as the class is abstract. | |
void | DoSetPersistentPropertiesToDefault (const MClass *staticClass) |
Set the persistent properties to their default values for one object provided the class for that object. More... | |
Provides static methods for string manipulation.
enum MStr::Masks |
Enumeration type that defines string transformation.
|
static |
Convert any character to a printable string, possibly a C-like escape character.
If the character is a blank, it is represented as "\\x20".
ch | Character to represent. |
|
static |
Convert any character to a printable string, possibly a C-like escape character.
If the character is a blank, it is represented as "\\x20".
ch | Character to represent. |
|
static |
Convert any character to a quoted printable string, possibly a C-like escape character.
If the character is a blank, it is represented as "'\\x20'". Apostrophe is used for quoting a character.
ch | Character to represent. |
|
static |
Convert any character to a quoted printable string, possibly a C-like escape character.
If the character is a blank, it is represented as "'\\x20'". Apostrophe is used for quoting a character.
ch | Character to represent. |
|
static |
Compare two given strings.
s1 | First string to compare. |
s2 | Second string to compare. |
ignoreCase | When true, ignore the character case, default value is false. |
|
static |
Compare two given strings.
s1 | First string to compare. |
s2 | Second string to compare. |
ignoreCase | When true, ignore the character case, default value is false. |
|
static |
Decode a byte string in a specific encoding into a UTF-8 string.
The list of all encodings supported by the library is available in GetAllSupportedEncodings property. Currently, only one-byte encodings are supported plus UTF-8. When UTF-8 is specified the method does nothing.
encoding | Encoding of the given byte string, see encodingNames for supported names. |
str | Byte string in an encoding given as first parameter. |
badChar | Which character to use in case the character cannot be represented. If it is an empty string an error will be thrown if a character that cannot be represented is seen. |
|
static |
Decode a byte string in a specific encoding into a Unicode string.
The list of all encodings supported by the library is available in GetAllSupportedEncodings property. Currently, only one-byte encodings are supported plus UTF-8. When UTF-8 is specified the method does nothing.
encoding | Encoding of the given byte string, see encodingNames for supported names. |
str | Byte string in an encoding given as first parameter. |
badChar | Which character to use in case the character cannot be represented. If it is an empty string an error will be thrown if a character that cannot be represented is seen. |
|
static |
Encode a string to a byte string that represents a specific encoding.
encoding | Desired encoding of the result byte string, see encodingNames for supported names. |
str | String in UTF-8. |
badChar | Which character to use in case the character cannot be represented. If it is an empty string an error will be thrown if a character that cannot be represented is seen. |
|
static |
Encode a string to a byte string that represents a specific encoding.
encoding | Desired encoding of the result byte string, see encodingNames for supported names. |
str | String in UTF-8. |
badChar | Which character to use in case the character cannot be represented. If it is an empty string an error will be thrown if a character that cannot be represented is seen. |
|
static |
Convert the string that can contain a C-style string escape sequence into a character.
str | Pointer to string, text that contains a C escape. |
strEnd | Output, result pointer to the end of C escape. |
|
static |
Convert the string that can contain a C-style string escape sequence into a character.
str | Pointer to string, text that contains a C escape. |
strEnd | Output, result pointer to the end of C escape. |
|
static |
Convert the text string with possible C-like escapes to binary string.
str | String with possible C escapes. |
|
static |
Convert the text string with possible C-like escapes to binary string.
str | String with possible C escapes. |
|
static |
General FromString method that takes a mask that specifies what exactly needs to be done to a string.
Converts a general purpose escaped string back to value string.
str | Text string with escapes to convert into binary form using mask transformations. |
mask | Mask conversion flags, such as StrNone or StrXML. |
|
static |
General FromString method that takes a mask that specifies what exactly needs to be done to a string.
Converts a general purpose escaped string back to value string.
str | Text string with escapes to convert into binary form using mask transformations. |
mask | Mask conversion flags, such as StrNone or StrXML. |
|
static |
Convert the XML string with C escapes back into binary.
str | Text string with possible C and XML escapes to convert into binary. |
|
static |
Convert the XML string with C escapes back into binary.
str | Text string with possible C and XML escapes to convert into binary. |
|
static |
Return all encodings supported.
Names consist of case insensitive English letters, digits and dash ('-'). The names returned by this method are always uppercase:
|
static |
Converts the string that can contain any character to a string with possible C-like escapes.
The starting and trailing blanks are substituted to their escape sequences, so they can be seen by the interfaces which do not have them exposed in quotes. The blanks which are surrounded by the other characters are presented as just blanks.
str | Binary string to represent as a text. |
|
static |
Converts the string that can contain any character to a string with possible C-like escapes.
The starting and trailing blanks are substituted to their escape sequences, so they can be seen by the interfaces which do not have them exposed in quotes. The blanks which are surrounded by the other characters are presented as just blanks.
str | Binary string to represent as a text. |
|
static |
Acts as ToEscapedString function, plus converts XML service symbols to escape sequences.
str | Binary string to represent as a text. |
|
static |
Acts as ToEscapedString function, plus converts XML service symbols to escape sequences.
str | Binary string to represent as a text. |
|
static |
Converts the given string to lower case depending on current system locale.
par | String or character to convert. |
|
static |
Converts the given string to lower case depending on current system locale.
par | String or character to convert. |
|
static |
Converts the given string to lower case depending on current system locale.
par | String or character to convert. |
|
static |
Converts the given string to lower case depending on current system locale.
par | String or character to convert. |
|
static |
Acts as ToEscapedString function, plus it puts the result string into quotes.
str | Binary string to represent as a quoted text. |
|
static |
Acts as ToEscapedString function, plus it puts the result string into quotes.
str | Binary string to represent as a quoted text. |
|
static |
General ToString method that takes a mask that specifies what exactly needs to be done to a string.
C-like escapes are used for nonprintables in any case. Converts the standard string that can contain any character to a string that is printable, and possibly containing C-like escape characters in places of non-printable characters.
str | Binary string to convert from using mask transformations. |
mask | Mask conversion flags, such as StrNone or StrXML. |
|
static |
General ToString method that takes a mask that specifies what exactly needs to be done to a string.
C-like escapes are used for nonprintables in any case. Converts the standard string that can contain any character to a string that is printable, and possibly containing C-like escape characters in places of non-printable characters.
str | Binary string to convert from using mask transformations. |
mask | Mask conversion flags, such as StrNone or StrXML. |
|
static |
Converts the given string to upper case depending on current system locale.
par | String or character to convert. |
|
static |
Converts the given string to upper case depending on current system locale.
par | String or character to convert. |
|
static |
Converts the given string to upper case depending on current system locale.
par | String or character to convert. |
|
static |
Converts the given string to upper case depending on current system locale.
par | String or character to convert. |
|
static |
Translate the contents of the string to C escaped string for XML representation.
This converts '<', '>', '&' and '"' to appropriate XML escape sequences.
str | Binary string with escapes to convert into binary. |
|
static |
Translate the contents of the string to C escaped string for XML representation.
This converts '<', '>', '&' and '"' to appropriate XML escape sequences.
str | Binary string with escapes to convert into binary. |
|
static |
Make a multiline word wrapped representation of a given string.
str | String, which has to be word wrapped. |
indentCount | How many blanks to use for indentation of the whole string when word wrapping. |
lineWidth | Line width around which the text has to be wrapped, default is 100. |
|
static |
Make a multiline word wrapped representation of a given string.
str | String, which has to be word wrapped. |
indentCount | How many blanks to use for indentation of the whole string when word wrapping. |
lineWidth | Line width around which the text has to be wrapped, default is 100. |
|
static |
Convert the string that can contains a XML-style string escape sequence into a character.
str | Pointer to string, text that contains an XML escape. |
strEnd | Output, result pointer to the end of XML escape. |
|
static |
Convert the string that can contains a XML-style string escape sequence into a character.
str | Pointer to string, text that contains an XML escape. |
strEnd | Output, result pointer to the end of XML escape. |