Qore Programming Language Reference Manual 2.0.0
Loading...
Searching...
No Matches
Pseudo_QC_String.dox.h
1
3namespace Qore {
5/***/
6class <string> : public <value> {
7
8public:
10
26int comparePartial(string ostr);
27
28public:
30
39bool contains(string chars);
40
41public:
43
55bool empty();
56
57public:
59
71string encoding();
72
73public:
75
84bool endsWith(string chars);
85
86public:
88
105bool equalPartial(string ostr);
106
107public:
109
125bool equalPartialPath(string ostr);
126
127public:
129
157int find(softstring substr, softint pos = 0);
158
159public:
161
172string getDecoded(int code = CD_ALL);
173
174public:
176
187string getEncoded(int code = CE_XHTML);
188
189public:
191
215*string getLine(int offset = 0, *string eol, bool trim = True, *reference<int> size);
216
217public:
219
233int getUnicode(int offset = 0);
234
235public:
237
248bool intp();
249
250public:
252
265
266public:
268
282
283public:
285
304int length();
305
306public:
308
331string lwr();
332
333public:
335
362bool regex(string regex, int options = 0);
363
364public:
366
398*list<*string> regexExtract(string regex, int options = 0);
399
400public:
402
430int rfind(softstring substr, softint pos = -1);
431
432public:
434
453int size();
454
455public:
457
466bool sizep();
467
468public:
470
490list<string> split(string sep, bool with_separator = False);
491
492public:
494
530list<string> split(string sep, string quote, bool trim_unquoted = False);
531
532public:
534
559list<string> splitRegex(string regex_sep, int options = 0, bool with_separator = False);
560
561public:
563
587list<string> splitRegex(string regex_sep, bool with_separator = False);
588
589public:
591
600bool startsWith(string chars);
601
602public:
604
623int strlen();
624
625public:
627
638bool strp();
639
640public:
642
661string substr(softint start);
662
663public:
665
687string substr(softint start, softint len);
688
689public:
691
713string toBase64(softint maxlinelen = -1);
714
715public:
717
735string toBase64Url(softint maxlinelen = -1);
736
737public:
739
754
755public:
757
773string toHex();
774
775public:
777
811int toInt(int base = 10);
812
813public:
815
840string toMD5();
841
842public:
844
866string toSHA1();
867
868public:
870
896string toSHA224();
897
898public:
900
926string toSHA256();
927
928public:
930
958string toSHA384();
959
960public:
962
990string toSHA512();
991
992public:
994
1009
1010public:
1012
1027string unaccent();
1028
1029public:
1031
1054string upr();
1055
1056public:
1058
1068bool val();
1069
1070public:
1072
1095int width();
1096};
1097}
Methods in this pseudo-class can be executed on strings.
Definition: Pseudo_QC_String.dox.h:6
bool contains(string chars)
Returns True if the given string contains the argument.
list< string > split(string sep, string quote, bool trim_unquoted=False)
Splits a string into a list of components based on a separator string and a quote character.
string getDecoded(int code=CD_ALL)
returns a string based on the string value, decoded as per the code argument
string toSHA512()
Returns the SHA-512 message digest (a variant of SHA-2) of the string as a hex string.
string upr()
Returns the string in upper case.
string toSHA256()
Returns the SHA-256 message digest (a variant of SHA-2) of the string as a hex string.
string toBase64(softint maxlinelen=-1)
Returns the base64-encoded representation of the string.
bool equalPartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument for equality...
string unaccent()
Returns a string with all accented characters removed.
int strlen()
Returns the number of bytes in the string (not including the terminating null character ('\0')
int width()
Returns the width of characters in the string; some unicode characters take up multiple spaces on out...
string toMD5()
Returns the MD5 message digest of the string as a hex string.
string toSHA224()
Returns the SHA-224 message digest (a variant of SHA-2) of the string as a hex string.
bool regex(string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False.
int typeCode()
Returns Qore::NT_STRING.
string getEncoded(int code=CE_XHTML)
returns a string based on the string value with encodings as per the code argument
int find(softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
int length()
Returns the number of characters in the string; may not be equal to the byte length (returned by Qore...
string toSHA1()
Returns the SHA1 message digest of the string as a hex string.
string encoding()
Returns the name of the string's character encoding.
bool empty()
Returns True if the string is empty, False if not.
bool val()
Returns False if the string is empty, True if not.
bool isDataAscii()
returns True if the string is empty or has no characters with the high bit set (ie all characters < 1...
bool strp()
Returns True by default.
binary toBinary()
Returns a binary value with the string's data.
bool equalPartialPath(string ostr)
Compares the beginning of the current string assumed to be a path with a shorter string passed as an ...
string toBase64Url(softint maxlinelen=-1)
Returns the base64-url-encoded representation of the string.
*list< *string > regexExtract(string regex, int options=0)
Returns a list of substrings in a string based on matching patterns defined by a regular expression.
string substr(softint start, softint len)
Returns a portion of a string starting from an integer offset, with a length parameter.
bool startsWith(string chars)
Returns True if the given string starts with the argument.
int comparePartial(string ostr)
Compares the beginning of the current string with a shorter string passed as an argument.
int size()
Returns the number of bytes in the string (not including the terminating null character ('\0')
*string getLine(int offset=0, *string eol, bool trim=True, *reference< int > size)
returns a string for the next line in the string buffer starting at the given offset (or at the begin...
string substr(softint start)
Returns a portion of a string starting from an integer offset.
list< string > splitRegex(string regex_sep, int options=0, bool with_separator=False)
Splits a string into a list of components based on a separator regular expression.
bool sizep()
Returns True since strings can return a non-zero size.
int getUnicode(int offset=0)
returns the Unicode code for the given character offset in the string
bool intp()
Returns True if the string can be converted to an integer, False if not, this depends on the first (o...
list< string > split(string sep, bool with_separator=False)
Splits a string into a list of components based on a separator string.
list< string > splitRegex(string regex_sep, bool with_separator=False)
Splits a string into a list of components based on a separator regular expression.
string lwr()
Returns the string in lower case.
bool isDataPrintableAscii()
returns True if the string is empty or only contains printable non-control ASCII characters (ie all c...
string toSHA384()
Returns the SHA-384 message digest (a variant of SHA-2) of the string as a hex string.
int toInt(int base=10)
Converts the string to an integer value with respect to the base
int rfind(softstring substr, softint pos=-1)
Retrieves the character position of a substring within a string, starting the search from the end of ...
bool endsWith(string chars)
Returns True if the given string ends with the argument.
string toHex()
returns a string of hexadecimal digits corresponding to the contents of the string
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:6
const CD_ALL
code for decoding everything
Definition: ql_misc.dox.h:2380
const CE_XHTML
code for encoding XHTML entities
Definition: ql_misc.dox.h:2350
const True
logical True
Definition: qc_qore.dox.h:98
const False
logical False
Definition: qc_qore.dox.h:96
nothing substr()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing regex()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing trim()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
binary binary()
Always returns an empty binary object (of zero length)
Qore namespace.
Definition: QC_AbstractSmartLock.dox.h:2