| Qore Programming Language Reference Manual 2.2.0

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