Unit msestrings

Description

 

Overview

Classes, Interfaces, Objects and Records

Name Description
Record doublestringty  
Record doublemsestringty  
Record lstringty  
Record lmsestringty  
Packed Record stringheaderty  
Class tmemorystringstream  

Functions and Procedures

procedure trimright1(var s: string); overload;
procedure trimright1(var s: msestring); overload;
function removechar(const source: string; a: char): string; overload;
function removechar(const source: msestring; a: msechar): msestring; overload;
procedure removechar1(var dest: string; a: char); overload;
procedure removechar1(var dest: msestring; a: msechar); overload;
function printableascii(const source: string): string; overload;
function printableascii(const source: msestring): msestring; overload;
function replacechar(const source: string; old,new: char): string; overload;
function replacechar(const source: msestring; old,new: msechar): msestring; overload;
procedure replacechar1(var dest: string; old,new: char); overload;
procedure replacechar1(var dest: msestring; old,new: msechar); overload;
function stringfromchar(achar: char; count : integer): string; overload;
function stringfromchar(achar: msechar; count : integer): msestring; overload;
function replacetext(const source: string; index: integer; a: string): string; overload;
function replacetext(const source: msestring; index: integer; a: msestring): msestring; overload;
procedure replacetext1(var dest: string; index: integer; const a: string); overload;
procedure replacetext1(var dest: msestring; index: integer; const a: msestring); overload;
procedure addstringsegment(var dest: msestring; const a,b: pmsechar);
function stringsegment(a,b: pchar): string;
function stringsegment(a,b: pmsechar): msestring;
function lstringtostring(const value: lmsestringty): msestring; overload;
function lstringtostring(const value: pmsechar; const len: integer): msestring; overload;
function lstringtostring(const value: lstringty): string; overload;
function lstringtostring(const value: pchar; const len: integer): string; overload;
procedure stringtolstring(const value: string; var res: lstringty); inline;
procedure stringtolstring(const value: msestring; var res: lmsestringty); inline;
function stringtolstring(const value: string): lstringty; inline;
function stringtolstring(const value: msestring): lmsestringty; inline;
function lstringartostringar(const value: lstringarty): stringarty;
procedure nextword(const value: msestring; out res: lmsestringty); overload;
procedure nextword(const value: string; out res: lstringty); overload;
procedure nextword(var value: lmsestringty; out res: lmsestringty); overload;
procedure nextword(var value: lstringty; out res: lstringty); overload;
procedure nextword(var value: lstringty; out res: string); overload;
function nextword(var start: pchar): string; overload;
function nextword(var start: pmsechar): msestring; overload;
function nextquotedstring(var value: lstringty; out res: string): boolean;
procedure lstringgoback(var value: lstringty; const res: lstringty);
function issamelstring(const value: lmsestringty; const key: msestring; caseinsensitive: boolean = false): boolean; overload;
function issamelstring(const value: lstringty; const key: string; caseinsensitive: boolean = false): boolean; overload;
function lstringcomp(const a,b: lstringty): integer; overload;
function lstringcomp(const a: lstringty; const b: string): integer; overload;
function lstringicomp(const a,b: lstringty): integer; overload;
function lstringicomp(const a: lstringty; const b: string): integer; overload;
function lstringicompupper(const a,upper: lstringty): integer; overload;
function lstringicompupper(const a: lstringty; const upper: string): integer; overload;
function stringcomp(const a,b: string): integer;
function stringicomp(const a,b: string): integer;
function stringicompupper(const a,upstr: string): integer;
function msestringcomp(const a,b: msestring): integer;
function msestringicomp(const a,b: msestring): integer;
function msestringicompupper(const a,upstr: msestring): integer;
function comparestrlen(const S1,S2: string): integer;
function msecomparestrlen(const S1,S2: msestring): integer;
function msecomparestr(const S1, S2: msestring): Integer;
function msecomparetext(const S1, S2: msestring): Integer;
function msecomparestrnatural(const S1, S2: msestring): Integer;
function msecomparetextnatural(const S1, S2: msestring): Integer;
function mseCompareTextlen(const S1, S2: msestring): Integer;
function mseCompareTextlenupper(const S1, S2: msestring): Integer;
function msepartialcomparetext(const s1,s2: msestring): integer;
function msepartialcomparestr(const s1,s2: msestring): integer;
function mseissamestrlen(const apartstring,astring: msestring): boolean;
function mseissametextlen(const apartstring,astring: msestring): boolean;
function encodesearchoptions(const caseinsensitive: boolean = false; const wholeword: boolean = false; const wordstart: boolean = false; const backward: boolean = false): searchoptionsty;
function msestringsearch(const substring,s: msestring; start: integer; const options: searchoptionsty; const substringupcase: msestring = ''): integer; overload;
function stringsearch(const substring,s: string; start: integer; const options: searchoptionsty; const substringupcase: string = ''): integer; overload;
function replacestring(const s: msestring; oldsub: msestring; const newsub: msestring; const options: searchoptionsty = []): msestring; overload;
function replacestring(const s: string; oldsub: string; const newsub: string; const options: searchoptionsty = []): string; overload;
procedure addeditchars(const source: msestring; var buffer: msestring; var cursorpos: integer);
function processeditchars(var value: msestring; stripcontrolchars: boolean): integer;
function mseextractprintchars(const value: msestring): msestring;
function findchar(const str: string; achar: char): integer; overload;
function findchar(const str: string; const astart: integer; achar: char): integer; overload;
function findchar(const str: msestring; achar: msechar): integer; overload;
function findchar(const str: msestring; const astart: integer; achar: msechar): integer; overload;
function findchar(const str: pchar; achar: char): integer; overload;
function findchar(const str: pmsechar; achar: msechar): integer; overload;
function findchars(const str: string; const achars: string): integer; overload;
function findchars(const str: msestring; const achars: msestring): integer; overload;
function findlastchar(const str: string; achar: char): integer; overload;
function findlastchar(const str: msestring; achar: msechar): integer; overload;
function countchars(const str: string; achar: char): integer; overload;
function countchars(const str: msestring; achar: msechar): integer; overload;
function getcharpos(const str: msestring; achar: msechar): integerarty;
function strscan(const Str: PChar; Chr: Char): PChar; overload;
function strscan(const str: lmsestringty; const chr: msechar): pmsechar; overload;
function msestrscan(const Str: PmseChar; Chr: mseChar): PmseChar; overload;
procedure mseskipspace(var str: pmsechar);
procedure skipspace(var str: pchar);
function StrLScan(const Str: PChar; Chr: Char; len: integer): PChar;
function mseStrLScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
function StrNScan(const Str: PChar; Chr: Char): PChar;
function StrLNScan(const Str: PChar; Chr: Char; len: integer): PChar;
function mseStrNScan(const Str: PmseChar; Chr: mseChar): PmseChar;
function mseStrLNScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
function StrRScan(const Str: PChar; Chr: Char): PChar;
function StrLRScan(const Str: PChar; Chr: Char; len: integer): PChar;
function mseStrRScan(const Str: PmseChar; Chr: mseChar): PmseChar; overload;
function msestrrscan(const str: msestring; chr: msechar): integer; overload;
function mseStrLRScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
function mseStrLNRScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
function StrLComp(const Str1, Str2: PChar; len: integer): Integer;
function mseStrComp(const Str1, Str2: PmseChar): Integer;
function mseStrLComp(const Str1, Str2: PmseChar; len: integer): Integer;
function mseStrLIComp(const Str1, upstr: PmseChar; len: integer): Integer;
function StrLIComp(const Str1, upstr: PChar; len: integer): Integer;
function StrIComp(const Str1, upstr: PChar): Integer;
function startsstr(substring,s: pchar): boolean; overload;
function startsstr(const substring,s: string): boolean; overload;
function msestartsstr(substring,s: pmsechar): boolean; overload;
function msestartsstr(const substring,s: msestring): boolean; overload;
function msestartsstrcaseinsensitive(substring,s: pmsechar): boolean;
function isnullstring(const s: ansistring): boolean;
function isemptystring(const s: pchar): boolean; overload;
function isemptystring(const s: pmsechar): boolean; overload;
function isnamechar(achar: char): boolean; overload;
function isnamechar(achar: msechar): boolean; overload;
function isnumber(const s: string): boolean; overload;
function isnumber(const s: msestring): boolean; overload;
function strlcopy(const str: pchar; len: integer): ansistring;
function msestrlcopy(const str: pmsechar; len: integer): msestring;
function psubstr(const start,stop: pchar): string; overload;
function psubstr(const start,stop: pmsechar): msestring; overload;
function singleline(const start: pchar): string; overload;
function singleline(const start: pmsechar): msestring; overload;
function msePosEx(const SubStr, S: msestring; Offset: longword = 1): Integer;
function mselowercase(const s: msestring): msestring; overload;
function mselowercase(const s: msestringarty): msestringarty; overload;
function mseuppercase(const s: msestring): msestring; overload;
function mseuppercase(const s: msestringarty): msestringarty; overload;
function charuppercase(const c: char): char; overload;
function charuppercase(const c: msechar): msechar; overload;
function struppercase(const s: string): string; overload;
function struppercase(const s: msestring): msestring; overload;
function struppercase(const s: lmsestringty): msestring; overload;
function struppercase(const s: lstringty): string; overload;
procedure struppercase1(var s: msestring); overload;
function charlowercase(const c: char): char; overload;
function charlowercase(const c: msechar): msechar; overload;
function strlowercase(const s: string): string; overload;
function strlowercase(const s: msestring): msestring; overload;
function strlowercase(const s: lmsestringty): msestring; overload;
function strlowercase(const s: lstringty): string; overload;
procedure strlowercase1(var s: msestring); overload;
function mseremspace(const s: msestring): msestring;
function removelinebreaks(const s: msestring): msestring;
function removelineterminator(const s: msestring): msestring;
procedure removetabterminator(var s: msestring);
function stripescapesequences(avalue: msestring): msestring;
procedure stringaddref(var str: ansistring); overload;
procedure stringaddref(var str: msestring); overload;
procedure stringsafefree(var str: string; const onlyifunique: boolean);
procedure stringsafefree(var str: msestring; const onlyifunique: boolean);
procedure reallocstring(var value: ansistring); overload;
procedure reallocstring(var value: msestring); overload;
procedure reallocarray(var value; elementsize: integer); overload;
procedure resizearray(var value; newlength, elementsize: integer);
function lineatindex(const value: msestring; const index: int32): msestring;
procedure wordatindex(const value: msestring; const index: integer; out first,pastlast: pmsechar; const delimchars: msestring; const nodelimstrings: array of msestring); overload;
function wordatindex(const value: msestring; const index: integer; const delimchars: msestring; const nodelimstrings: array of msestring): msestring; overload;
function checkkeyword(const aname: string; const anames; const ahigh: integer): cardinal; overload;
function checkkeyword(const aname: msestring; const anames; const ahigh: integer): cardinal; overload;
function checkkeyword(const aname: pchar; const anames; const ahigh: integer): cardinal; overload;
function checkkeyword(const aname: pmsechar; const anames; const ahigh: integer): cardinal; overload;
function quotestring(value: string; quotechar: char; const force: boolean = true; const separator: char = ' '): string; overload;
function quotestring(value: msestring; quotechar: msechar; const force: boolean = true; const separator: msechar = ' '): msestring; overload;
function quoteescapedstring(value: string; quotechar: char; const force: boolean = true; const separator: char = ' '): string; overload;
function quoteescapedstring(value: msestring; quotechar: msechar; const force: boolean = true; const separator: msechar = ' '): msestring; overload;
function unquotestring(value: string; quotechar: char): string; overload;
function unquotestring(value: msestring; quotechar: msechar): msestring; overload;
function extractquotedstr(const value: msestring): msestring;
function checkfirstchar(const value: string; achar: char): pchar;
function firstline(const atext: msestring): msestring;
function lastline(const atext: msestring): msestring;
procedure textdim(const atext: msestring; out firstx,lastx,y: integer);
function shrinkpathellipse(var value: msestring): boolean;
function shrinkstring(const value: msestring; maxcharcount: integer): msestring;
procedure extendstring(var value: string; const mincharcount: integer);
procedure extendstring(var value: msestring; const mincharcount: integer);
function nullstring(const count: integer): string;
function charstring(ch: char; count: integer): string; overload;
function charstring(ch: msechar; count: integer): msestring; overload;
function countleadingchars(const str: msestring; char: msechar): integer; overload;
function countleadingchars(const str: string; char: char): integer; overload;
function fitstring(const source: msestring; const len: integer; const pos: stringposty = sp_left; const cutchar: msechar = #0; const padchar: msechar = ' '): msestring;
function breaklines(const source: string): stringarty; overload;
function breaklines(const source: msestring): msestringarty; overload;
function breaklines(const source: msestring; maxlength: integer): msestringarty; overload;
procedure splitstring(source: string; var dest: stringarty; separator: char = c_tab; trim: boolean = false); overload;
procedure splitstring(source: msestring; var dest: msestringarty; separator: msechar = c_tab; trim: boolean = false); overload;
function splitstring(source: string; separator: char = c_tab; trim: boolean = false): stringarty; overload;
function splitstring(source: msestring; separator: msechar = c_tab; trim: boolean = false): msestringarty; overload;
function splitstringquoted(source: string; separator: char = c_tab; quotechar: char = '"'; atrim: boolean = false): stringarty; overload;
function splitstringquoted(source: msestring; separator: msechar = c_tab; quotechar: msechar = '"'; atrim: boolean = false): msestringarty; overload;
procedure splitstringquoted(const source: string; out dest: stringarty; quotechar: char = '"'; separator: char = #0); overload;
procedure splitstringquoted(const source: msestring; out dest: msestringarty; quotechar: msechar = '"'; separator: msechar = #0); overload;
function concatstrings(const source: msestringarty; const separator: msestring = ' '; const quotechar: msechar = #0; const force: boolean = false): msestring; overload;
function concatstrings(const source: stringarty; const separator: string = ' '; const quotechar: char = #0; const force: boolean = false): string; overload;
function parsecommandline(const s: pchar): stringarty; overload;
function parsecommandline(const s: pmsechar): msestringarty; overload;
function parsecommandline(const s: string): stringarty; overload;
function parsecommandline(const s: msestring): msestringarty; overload;
function rs(const resstring: ansistring): msestring;
function stringtoutf8(const value: msestring; const options: utfoptionsty = []): utf8string;
function stringtoutf8ansi(const value: msestring; const options: utfoptionsty = []): ansistring;
function stringtoutf8(const value: pmsechar; const count: integer; const options: utfoptionsty = []): utf8string;
function stringtoutf8ansi(const value: pmsechar; const count: integer; const options: utfoptionsty = []): ansistring;
function utf8tostring(const value: pchar; const alength: integer; const options: utfoptionsty = []): msestring;
function utf8tostring(const value: pchar; const options: utfoptionsty = []): msestring;
function utf8tostring(const value: lstringty; const options: utfoptionsty = []): msestring;
function utf8tostring(const value: utf8string; const options: utfoptionsty = []): msestring;
function utf8tostringansi(const value: ansistring; const options: utfoptionsty = []): msestring;
function checkutf8(const value: utf8string): boolean;
function checkutf8ansi(const value: ansistring): boolean;
function stringtolatin1(const value: msestring): string;
function latin1tostring(const value: string): msestring;
function ucs4tostring(achar: dword): msestring;
function getucs4char(const value: msestring; const aindex: int32): ucs4char;
function getasciichar(const source: msechar; out dest: char): boolean;
function getansichar(const source: msechar; out dest: char): boolean;
function ansistringof(const value: tbytes): ansistring;
function locatestring(const afilter: msestring; const getkeystringfunc: getkeystringfuncty; const options: locatestringoptionsty; const count: integer; var aindex: integer): boolean;
function getmsestringprop(const ainstance: tobject; const apropinfo: ppropinfo): msestring;
procedure setmsestringprop(const ainstance: tobject; const apropinfo: ppropinfo; const avalue: msestring);
function treader_readmsestring(const areader: treader): msestring;
procedure twriter_writemsestring(awriter: twriter; const avalue: msestring);

Types

stringposty = (...);
utfoptionty = (...);
utfoptionsty = set of utfoptionty;
pdoublestringty = ˆdoublestringty;
doublestringarty = array of doublestringty;
pdoublemsestringty = ˆdoublemsestringty;
doublemsestringarty = array of doublemsestringty;
doublemsestringaty = array[0..0] of doublemsestringty;
pdoublemsestringaty = ˆdoublemsestringaty;
plstringty = ˆlstringty;
plmsestringty = ˆlmsestringty;
lstringarty = array of lstringty;
lmsestringarty = array of lmsestringty;
pstringheaderty = ˆstringheaderty;
searchoptionty = (...);
searchoptionsty = set of searchoptionty;
getkeystringfuncty = function (const index: integer): msestring of object;
locatestringoptionty = (...);
locatestringoptionsty = set of locatestringoptionty;

Constants

utf16privatebase = $f800;
utf16private = utf16privatebase + 0;
utf16invalid = utf16privatebase + 1;
utferrorchar = char('?');
msestringtypekind = tkwstring;
defaultdelimchars = ' '+c_tab+c_return+c_linefeed;
defaultmsedelimchars = msestring(defaultdelimchars);
upperchars: array[char] of char = ( #$00,#$01,#$02,#$03,#$04,#$05,#$06,#$07,#$08,#$09,#$0a,#$0b,#$0c,#$0d,#$0e,#$0f, #$10,#$11,#$12,#$13,#$14,#$15,#$16,#$17,#$18,#$19,#$1a,#$1b,#$1c,#$1d,#$1e,#$1f, #$20,#$21,#$22,#$23,#$24,#$25,#$26,#$27,#$28,#$29,#$2a,#$2b,#$2c,#$2d,#$2e,#$2f, #$30,#$31,#$32,#$33,#$34,#$35,#$36,#$37,#$38,#$39,#$3a,#$3b,#$3c,#$3d,#$3e,#$3f, #$40,#$41,#$42,#$43,#$44,#$45,#$46,#$47,#$48,#$49,#$4a,#$4b,#$4c,#$4d,#$4e,#$4f, #$50,#$51,#$52,#$53,#$54,#$55,#$56,#$57,#$58,#$59,#$5a,#$5b,#$5c,#$5d,#$5e,#$5f, #$60,'A' ,'B' ,'C' ,'D' ,'E' ,'F' ,'G' ,'H' ,'I' ,'J' ,'K' ,'L' ,'M' ,'N' ,'O' , 'P' ,'Q' ,'R' ,'S' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Y' ,'Z' ,#$7b,#$7c,#$7d,#$7e,#$7f, #$80,#$81,#$82,#$83,#$84,#$85,#$86,#$87,#$88,#$89,#$8a,#$8b,#$8c,#$8d,#$8e,#$8f, #$90,#$91,#$92,#$93,#$94,#$95,#$96,#$97,#$98,#$99,#$9a,#$9b,#$9c,#$9d,#$9e,#$9f, #$a0,#$a1,#$a2,#$a3,#$a4,#$a5,#$a6,#$a7,#$a8,#$a9,#$aa,#$ab,#$ac,#$ad,#$ae,#$af, #$b0,#$b1,#$b2,#$b3,#$b4,#$b5,#$b6,#$b7,#$b8,#$b9,#$ba,#$bb,#$bc,#$bd,#$be,#$bf, #$c0,#$c1,#$c2,#$c3,#$c4,#$c5,#$c6,#$c7,#$c8,#$c9,#$ca,#$cb,#$cc,#$cd,#$ce,#$cf, #$d0,#$d1,#$d2,#$d3,#$d4,#$d5,#$d6,#$d7,#$d8,#$d9,#$da,#$db,#$dc,#$dd,#$de,#$df, #$e0,#$e1,#$e2,#$e3,#$e4,#$e5,#$e6,#$e7,#$e8,#$e9,#$ea,#$eb,#$ec,#$ed,#$ee,#$ef, #$f0,#$f1,#$f2,#$f3,#$f4,#$f5,#$f6,#$f7,#$f8,#$f9,#$fa,#$fb,#$fc,#$fd,#$fe,#$ff);
lowerchars: array[char] of char = ( #$00,#$01,#$02,#$03,#$04,#$05,#$06,#$07,#$08,#$09,#$0a,#$0b,#$0c,#$0d,#$0e,#$0f, #$10,#$11,#$12,#$13,#$14,#$15,#$16,#$17,#$18,#$19,#$1a,#$1b,#$1c,#$1d,#$1e,#$1f, #$20,#$21,#$22,#$23,#$24,#$25,#$26,#$27,#$28,#$29,#$2a,#$2b,#$2c,#$2d,#$2e,#$2f, #$30,#$31,#$32,#$33,#$34,#$35,#$36,#$37,#$38,#$39,#$3a,#$3b,#$3c,#$3d,#$3e,#$3f, #$40,'a' ,'b' ,'c' ,'d' ,'e' ,'f' ,'g' ,'h' ,'i' ,'j' ,'k' ,'l' ,'m' ,'n' ,'o' , 'p' ,'q' ,'r' ,'s' ,'t' ,'u' ,'v' ,'w' ,'x' ,'y' ,'z' ,#$5b,#$5c,#$5d,#$5e,#$5f, #$60,#$61,#$62,#$63,#$64,#$65,#$66,#$67,#$68,#$69,#$6a,#$6b,#$6c,#$6d,#$6e,#$6f, #$70,#$71,#$72,#$73,#$74,#$75,#$76,#$77,#$78,#$79,#$7a,#$7b,#$7c,#$7d,#$7e,#$7f, #$80,#$81,#$82,#$83,#$84,#$85,#$86,#$87,#$88,#$89,#$8a,#$8b,#$8c,#$8d,#$8e,#$8f, #$90,#$91,#$92,#$93,#$94,#$95,#$96,#$97,#$98,#$99,#$9a,#$9b,#$9c,#$9d,#$9e,#$9f, #$a0,#$a1,#$a2,#$a3,#$a4,#$a5,#$a6,#$a7,#$a8,#$a9,#$aa,#$ab,#$ac,#$ad,#$ae,#$af, #$b0,#$b1,#$b2,#$b3,#$b4,#$b5,#$b6,#$b7,#$b8,#$b9,#$ba,#$bb,#$bc,#$bd,#$be,#$bf, #$c0,#$c1,#$c2,#$c3,#$c4,#$c5,#$c6,#$c7,#$c8,#$c9,#$ca,#$cb,#$cc,#$cd,#$ce,#$cf, #$d0,#$d1,#$d2,#$d3,#$d4,#$d5,#$d6,#$d7,#$d8,#$d9,#$da,#$db,#$dc,#$dd,#$de,#$df, #$e0,#$e1,#$e2,#$e3,#$e4,#$e5,#$e6,#$e7,#$e8,#$e9,#$ea,#$eb,#$ec,#$ed,#$ee,#$ef, #$f0,#$f1,#$f2,#$f3,#$f4,#$f5,#$f6,#$f7,#$f8,#$f9,#$fa,#$fb,#$fc,#$fd,#$fe,#$ff);
emptylstring: lstringty = (po: nil; len: 0);
emptywstring: lmsestringty = (po: nil; len: 0);

Description

Functions and Procedures

procedure trimright1(var s: string); overload;
 
procedure trimright1(var s: msestring); overload;
 
function removechar(const source: string; a: char): string; overload;
 
function removechar(const source: msestring; a: msechar): msestring; overload;
 
procedure removechar1(var dest: string; a: char); overload;
 
procedure removechar1(var dest: msestring; a: msechar); overload;
 
function printableascii(const source: string): string; overload;
 
function printableascii(const source: msestring): msestring; overload;
 
function replacechar(const source: string; old,new: char): string; overload;
 
function replacechar(const source: msestring; old,new: msechar): msestring; overload;
 
procedure replacechar1(var dest: string; old,new: char); overload;
 
procedure replacechar1(var dest: msestring; old,new: msechar); overload;
 
function stringfromchar(achar: char; count : integer): string; overload;
 
function stringfromchar(achar: msechar; count : integer): msestring; overload;
 
function replacetext(const source: string; index: integer; a: string): string; overload;
 
function replacetext(const source: msestring; index: integer; a: msestring): msestring; overload;
 
procedure replacetext1(var dest: string; index: integer; const a: string); overload;
 
procedure replacetext1(var dest: msestring; index: integer; const a: msestring); overload;
 
procedure addstringsegment(var dest: msestring; const a,b: pmsechar);
 
function stringsegment(a,b: pchar): string;
 
function stringsegment(a,b: pmsechar): msestring;
 
function lstringtostring(const value: lmsestringty): msestring; overload;
 
function lstringtostring(const value: pmsechar; const len: integer): msestring; overload;
 
function lstringtostring(const value: lstringty): string; overload;
 
function lstringtostring(const value: pchar; const len: integer): string; overload;
 
procedure stringtolstring(const value: string; var res: lstringty); inline;
 
procedure stringtolstring(const value: msestring; var res: lmsestringty); inline;
 
function stringtolstring(const value: string): lstringty; inline;
 
function stringtolstring(const value: msestring): lmsestringty; inline;
 
function lstringartostringar(const value: lstringarty): stringarty;
 
procedure nextword(const value: msestring; out res: lmsestringty); overload;
 
procedure nextword(const value: string; out res: lstringty); overload;
 
procedure nextword(var value: lmsestringty; out res: lmsestringty); overload;
 
procedure nextword(var value: lstringty; out res: lstringty); overload;
 
procedure nextword(var value: lstringty; out res: string); overload;
 
function nextword(var start: pchar): string; overload;
 
function nextword(var start: pmsechar): msestring; overload;
 
function nextquotedstring(var value: lstringty; out res: string): boolean;
 
procedure lstringgoback(var value: lstringty; const res: lstringty);
 
function issamelstring(const value: lmsestringty; const key: msestring; caseinsensitive: boolean = false): boolean; overload;
 
function issamelstring(const value: lstringty; const key: string; caseinsensitive: boolean = false): boolean; overload;
 
function lstringcomp(const a,b: lstringty): integer; overload;
 
function lstringcomp(const a: lstringty; const b: string): integer; overload;
 
function lstringicomp(const a,b: lstringty): integer; overload;
 
function lstringicomp(const a: lstringty; const b: string): integer; overload;
 
function lstringicompupper(const a,upper: lstringty): integer; overload;
 
function lstringicompupper(const a: lstringty; const upper: string): integer; overload;
 
function stringcomp(const a,b: string): integer;
 
function stringicomp(const a,b: string): integer;
 
function stringicompupper(const a,upstr: string): integer;
 
function msestringcomp(const a,b: msestring): integer;
 
function msestringicomp(const a,b: msestring): integer;
 
function msestringicompupper(const a,upstr: msestring): integer;
 
function comparestrlen(const S1,S2: string): integer;
 
function msecomparestrlen(const S1,S2: msestring): integer;
 
function msecomparestr(const S1, S2: msestring): Integer;
 
function msecomparetext(const S1, S2: msestring): Integer;
 
function msecomparestrnatural(const S1, S2: msestring): Integer;
 
function msecomparetextnatural(const S1, S2: msestring): Integer;
 
function mseCompareTextlen(const S1, S2: msestring): Integer;
 
function mseCompareTextlenupper(const S1, S2: msestring): Integer;
 
function msepartialcomparetext(const s1,s2: msestring): integer;
 
function msepartialcomparestr(const s1,s2: msestring): integer;
 
function mseissamestrlen(const apartstring,astring: msestring): boolean;
 
function mseissametextlen(const apartstring,astring: msestring): boolean;
 
function encodesearchoptions(const caseinsensitive: boolean = false; const wholeword: boolean = false; const wordstart: boolean = false; const backward: boolean = false): searchoptionsty;
 
function msestringsearch(const substring,s: msestring; start: integer; const options: searchoptionsty; const substringupcase: msestring = ''): integer; overload;
 
function stringsearch(const substring,s: string; start: integer; const options: searchoptionsty; const substringupcase: string = ''): integer; overload;
 
function replacestring(const s: msestring; oldsub: msestring; const newsub: msestring; const options: searchoptionsty = []): msestring; overload;
 
function replacestring(const s: string; oldsub: string; const newsub: string; const options: searchoptionsty = []): string; overload;
 
procedure addeditchars(const source: msestring; var buffer: msestring; var cursorpos: integer);
 
function processeditchars(var value: msestring; stripcontrolchars: boolean): integer;
 
function mseextractprintchars(const value: msestring): msestring;
 
function findchar(const str: string; achar: char): integer; overload;
 
function findchar(const str: string; const astart: integer; achar: char): integer; overload;
 
function findchar(const str: msestring; achar: msechar): integer; overload;
 
function findchar(const str: msestring; const astart: integer; achar: msechar): integer; overload;
 
function findchar(const str: pchar; achar: char): integer; overload;
 
function findchar(const str: pmsechar; achar: msechar): integer; overload;
 
function findchars(const str: string; const achars: string): integer; overload;
 
function findchars(const str: msestring; const achars: msestring): integer; overload;
 
function findlastchar(const str: string; achar: char): integer; overload;
 
function findlastchar(const str: msestring; achar: msechar): integer; overload;
 
function countchars(const str: string; achar: char): integer; overload;
 
function countchars(const str: msestring; achar: msechar): integer; overload;
 
function getcharpos(const str: msestring; achar: msechar): integerarty;
 
function strscan(const Str: PChar; Chr: Char): PChar; overload;
 
function strscan(const str: lmsestringty; const chr: msechar): pmsechar; overload;
 
function msestrscan(const Str: PmseChar; Chr: mseChar): PmseChar; overload;
 
procedure mseskipspace(var str: pmsechar);
 
procedure skipspace(var str: pchar);
 
function StrLScan(const Str: PChar; Chr: Char; len: integer): PChar;
 
function mseStrLScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
 
function StrNScan(const Str: PChar; Chr: Char): PChar;
 
function StrLNScan(const Str: PChar; Chr: Char; len: integer): PChar;
 
function mseStrNScan(const Str: PmseChar; Chr: mseChar): PmseChar;
 
function mseStrLNScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
 
function StrRScan(const Str: PChar; Chr: Char): PChar;
 
function StrLRScan(const Str: PChar; Chr: Char; len: integer): PChar;
 
function mseStrRScan(const Str: PmseChar; Chr: mseChar): PmseChar; overload;
 
function msestrrscan(const str: msestring; chr: msechar): integer; overload;
 
function mseStrLRScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
 
function mseStrLNRScan(const Str: PmseChar; Chr: mseChar; len: integer): PmseChar;
 
function StrLComp(const Str1, Str2: PChar; len: integer): Integer;
 
function mseStrComp(const Str1, Str2: PmseChar): Integer;
 
function mseStrLComp(const Str1, Str2: PmseChar; len: integer): Integer;
 
function mseStrLIComp(const Str1, upstr: PmseChar; len: integer): Integer;
 
function StrLIComp(const Str1, upstr: PChar; len: integer): Integer;
 
function StrIComp(const Str1, upstr: PChar): Integer;
 
function startsstr(substring,s: pchar): boolean; overload;
 
function startsstr(const substring,s: string): boolean; overload;
 
function msestartsstr(substring,s: pmsechar): boolean; overload;
 
function msestartsstr(const substring,s: msestring): boolean; overload;
 
function msestartsstrcaseinsensitive(substring,s: pmsechar): boolean;
 
function isnullstring(const s: ansistring): boolean;
 
function isemptystring(const s: pchar): boolean; overload;
 
function isemptystring(const s: pmsechar): boolean; overload;
 
function isnamechar(achar: char): boolean; overload;
 
function isnamechar(achar: msechar): boolean; overload;
 
function isnumber(const s: string): boolean; overload;
 
function isnumber(const s: msestring): boolean; overload;
 
function strlcopy(const str: pchar; len: integer): ansistring;
 
function msestrlcopy(const str: pmsechar; len: integer): msestring;
 
function psubstr(const start,stop: pchar): string; overload;
 
function psubstr(const start,stop: pmsechar): msestring; overload;
 
function singleline(const start: pchar): string; overload;
 
function singleline(const start: pmsechar): msestring; overload;
 
function msePosEx(const SubStr, S: msestring; Offset: longword = 1): Integer;
 
function mselowercase(const s: msestring): msestring; overload;
 
function mselowercase(const s: msestringarty): msestringarty; overload;
 
function mseuppercase(const s: msestring): msestring; overload;
 
function mseuppercase(const s: msestringarty): msestringarty; overload;
 
function charuppercase(const c: char): char; overload;
 
function charuppercase(const c: msechar): msechar; overload;
 
function struppercase(const s: string): string; overload;
 
function struppercase(const s: msestring): msestring; overload;
 
function struppercase(const s: lmsestringty): msestring; overload;
 
function struppercase(const s: lstringty): string; overload;
 
procedure struppercase1(var s: msestring); overload;
 
function charlowercase(const c: char): char; overload;
 
function charlowercase(const c: msechar): msechar; overload;
 
function strlowercase(const s: string): string; overload;
 
function strlowercase(const s: msestring): msestring; overload;
 
function strlowercase(const s: lmsestringty): msestring; overload;
 
function strlowercase(const s: lstringty): string; overload;
 
procedure strlowercase1(var s: msestring); overload;
 
function mseremspace(const s: msestring): msestring;
 
function removelinebreaks(const s: msestring): msestring;
 
function removelineterminator(const s: msestring): msestring;
 
procedure removetabterminator(var s: msestring);
 
function stripescapesequences(avalue: msestring): msestring;
 
procedure stringaddref(var str: ansistring); overload;
 
procedure stringaddref(var str: msestring); overload;
 
procedure stringsafefree(var str: string; const onlyifunique: boolean);
 
procedure stringsafefree(var str: msestring; const onlyifunique: boolean);
 
procedure reallocstring(var value: ansistring); overload;
 
procedure reallocstring(var value: msestring); overload;
 
procedure reallocarray(var value; elementsize: integer); overload;
 
procedure resizearray(var value; newlength, elementsize: integer);
 
function lineatindex(const value: msestring; const index: int32): msestring;
 
procedure wordatindex(const value: msestring; const index: integer; out first,pastlast: pmsechar; const delimchars: msestring; const nodelimstrings: array of msestring); overload;
 
function wordatindex(const value: msestring; const index: integer; const delimchars: msestring; const nodelimstrings: array of msestring): msestring; overload;
 
function checkkeyword(const aname: string; const anames; const ahigh: integer): cardinal; overload;
 
function checkkeyword(const aname: msestring; const anames; const ahigh: integer): cardinal; overload;
 
function checkkeyword(const aname: pchar; const anames; const ahigh: integer): cardinal; overload;
 
function checkkeyword(const aname: pmsechar; const anames; const ahigh: integer): cardinal; overload;
 
function quotestring(value: string; quotechar: char; const force: boolean = true; const separator: char = ' '): string; overload;
 
function quotestring(value: msestring; quotechar: msechar; const force: boolean = true; const separator: msechar = ' '): msestring; overload;
 
function quoteescapedstring(value: string; quotechar: char; const force: boolean = true; const separator: char = ' '): string; overload;
 
function quoteescapedstring(value: msestring; quotechar: msechar; const force: boolean = true; const separator: msechar = ' '): msestring; overload;
 
function unquotestring(value: string; quotechar: char): string; overload;
 
function unquotestring(value: msestring; quotechar: msechar): msestring; overload;
 
function extractquotedstr(const value: msestring): msestring;
 
function checkfirstchar(const value: string; achar: char): pchar;
 
function firstline(const atext: msestring): msestring;
 
function lastline(const atext: msestring): msestring;
 
procedure textdim(const atext: msestring; out firstx,lastx,y: integer);
 
function shrinkpathellipse(var value: msestring): boolean;
 
function shrinkstring(const value: msestring; maxcharcount: integer): msestring;
 
procedure extendstring(var value: string; const mincharcount: integer);
 
procedure extendstring(var value: msestring; const mincharcount: integer);
 
function nullstring(const count: integer): string;
 
function charstring(ch: char; count: integer): string; overload;
 
function charstring(ch: msechar; count: integer): msestring; overload;
 
function countleadingchars(const str: msestring; char: msechar): integer; overload;
 
function countleadingchars(const str: string; char: char): integer; overload;
 
function fitstring(const source: msestring; const len: integer; const pos: stringposty = sp_left; const cutchar: msechar = #0; const padchar: msechar = ' '): msestring;
 
function breaklines(const source: string): stringarty; overload;
 
function breaklines(const source: msestring): msestringarty; overload;
 
function breaklines(const source: msestring; maxlength: integer): msestringarty; overload;
 
procedure splitstring(source: string; var dest: stringarty; separator: char = c_tab; trim: boolean = false); overload;
 
procedure splitstring(source: msestring; var dest: msestringarty; separator: msechar = c_tab; trim: boolean = false); overload;
 
function splitstring(source: string; separator: char = c_tab; trim: boolean = false): stringarty; overload;
 
function splitstring(source: msestring; separator: msechar = c_tab; trim: boolean = false): msestringarty; overload;
 
function splitstringquoted(source: string; separator: char = c_tab; quotechar: char = '"'; atrim: boolean = false): stringarty; overload;
 
function splitstringquoted(source: msestring; separator: msechar = c_tab; quotechar: msechar = '"'; atrim: boolean = false): msestringarty; overload;
 
procedure splitstringquoted(const source: string; out dest: stringarty; quotechar: char = '"'; separator: char = #0); overload;
 
procedure splitstringquoted(const source: msestring; out dest: msestringarty; quotechar: msechar = '"'; separator: msechar = #0); overload;
 
function concatstrings(const source: msestringarty; const separator: msestring = ' '; const quotechar: msechar = #0; const force: boolean = false): msestring; overload;
 
function concatstrings(const source: stringarty; const separator: string = ' '; const quotechar: char = #0; const force: boolean = false): string; overload;
 
function parsecommandline(const s: pchar): stringarty; overload;
 
function parsecommandline(const s: pmsechar): msestringarty; overload;
 
function parsecommandline(const s: string): stringarty; overload;
 
function parsecommandline(const s: msestring): msestringarty; overload;
 
function rs(const resstring: ansistring): msestring;
 
function stringtoutf8(const value: msestring; const options: utfoptionsty = []): utf8string;
 
function stringtoutf8ansi(const value: msestring; const options: utfoptionsty = []): ansistring;
 
function stringtoutf8(const value: pmsechar; const count: integer; const options: utfoptionsty = []): utf8string;
 
function stringtoutf8ansi(const value: pmsechar; const count: integer; const options: utfoptionsty = []): ansistring;
 
function utf8tostring(const value: pchar; const alength: integer; const options: utfoptionsty = []): msestring;
 
function utf8tostring(const value: pchar; const options: utfoptionsty = []): msestring;
 
function utf8tostring(const value: lstringty; const options: utfoptionsty = []): msestring;
 
function utf8tostring(const value: utf8string; const options: utfoptionsty = []): msestring;
 
function utf8tostringansi(const value: ansistring; const options: utfoptionsty = []): msestring;
 
function checkutf8(const value: utf8string): boolean;
 
function checkutf8ansi(const value: ansistring): boolean;
 
function stringtolatin1(const value: msestring): string;
 
function latin1tostring(const value: string): msestring;
 
function ucs4tostring(achar: dword): msestring;
 
function getucs4char(const value: msestring; const aindex: int32): ucs4char;
 
function getasciichar(const source: msechar; out dest: char): boolean;
 
function getansichar(const source: msechar; out dest: char): boolean;
 
function ansistringof(const value: tbytes): ansistring;
 
function locatestring(const afilter: msestring; const getkeystringfunc: getkeystringfuncty; const options: locatestringoptionsty; const count: integer; var aindex: integer): boolean;
 
function getmsestringprop(const ainstance: tobject; const apropinfo: ppropinfo): msestring;
 
procedure setmsestringprop(const ainstance: tobject; const apropinfo: ppropinfo; const avalue: msestring);
 
function treader_readmsestring(const areader: treader): msestring;
 
procedure twriter_writemsestring(awriter: twriter; const avalue: msestring);
 

Types

stringposty = (...);
 
Values
  • sp_left
  • sp_center
  • sp_right
utfoptionty = (...);
 
Values
  • uto_storeinvalid
utfoptionsty = set of utfoptionty;
 
pdoublestringty = ˆdoublestringty;
 
doublestringarty = array of doublestringty;
 
pdoublemsestringty = ˆdoublemsestringty;
 
doublemsestringarty = array of doublemsestringty;
 
doublemsestringaty = array[0..0] of doublemsestringty;
 
pdoublemsestringaty = ˆdoublemsestringaty;
 
plstringty = ˆlstringty;
 
plmsestringty = ˆlmsestringty;
 
lstringarty = array of lstringty;
 
lmsestringarty = array of lmsestringty;
 
pstringheaderty = ˆstringheaderty;
 
searchoptionty = (...);
 
Values
  • so_caseinsensitive
  • so_wholeword
  • so_wordstart
  • so_backward
searchoptionsty = set of searchoptionty;
 
getkeystringfuncty = function (const index: integer): msestring of object;
 
locatestringoptionty = (...);
 
Values
  • lso_casesensitive
  • lso_posinsensitive
  • lso_exact
  • lso_nodown
  • lso_noup
  • lso_noexact
  • lso_filterisuppercase
locatestringoptionsty = set of locatestringoptionty;
 

Constants

utf16privatebase = $f800;
 
utf16private = utf16privatebase + 0;
 
utf16invalid = utf16privatebase + 1;
 
utferrorchar = char('?');
 
msestringtypekind = tkwstring;
 
defaultdelimchars = ' '+c_tab+c_return+c_linefeed;
 
defaultmsedelimchars = msestring(defaultdelimchars);
 
upperchars: array[char] of char = ( #$00,#$01,#$02,#$03,#$04,#$05,#$06,#$07,#$08,#$09,#$0a,#$0b,#$0c,#$0d,#$0e,#$0f, #$10,#$11,#$12,#$13,#$14,#$15,#$16,#$17,#$18,#$19,#$1a,#$1b,#$1c,#$1d,#$1e,#$1f, #$20,#$21,#$22,#$23,#$24,#$25,#$26,#$27,#$28,#$29,#$2a,#$2b,#$2c,#$2d,#$2e,#$2f, #$30,#$31,#$32,#$33,#$34,#$35,#$36,#$37,#$38,#$39,#$3a,#$3b,#$3c,#$3d,#$3e,#$3f, #$40,#$41,#$42,#$43,#$44,#$45,#$46,#$47,#$48,#$49,#$4a,#$4b,#$4c,#$4d,#$4e,#$4f, #$50,#$51,#$52,#$53,#$54,#$55,#$56,#$57,#$58,#$59,#$5a,#$5b,#$5c,#$5d,#$5e,#$5f, #$60,'A' ,'B' ,'C' ,'D' ,'E' ,'F' ,'G' ,'H' ,'I' ,'J' ,'K' ,'L' ,'M' ,'N' ,'O' , 'P' ,'Q' ,'R' ,'S' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Y' ,'Z' ,#$7b,#$7c,#$7d,#$7e,#$7f, #$80,#$81,#$82,#$83,#$84,#$85,#$86,#$87,#$88,#$89,#$8a,#$8b,#$8c,#$8d,#$8e,#$8f, #$90,#$91,#$92,#$93,#$94,#$95,#$96,#$97,#$98,#$99,#$9a,#$9b,#$9c,#$9d,#$9e,#$9f, #$a0,#$a1,#$a2,#$a3,#$a4,#$a5,#$a6,#$a7,#$a8,#$a9,#$aa,#$ab,#$ac,#$ad,#$ae,#$af, #$b0,#$b1,#$b2,#$b3,#$b4,#$b5,#$b6,#$b7,#$b8,#$b9,#$ba,#$bb,#$bc,#$bd,#$be,#$bf, #$c0,#$c1,#$c2,#$c3,#$c4,#$c5,#$c6,#$c7,#$c8,#$c9,#$ca,#$cb,#$cc,#$cd,#$ce,#$cf, #$d0,#$d1,#$d2,#$d3,#$d4,#$d5,#$d6,#$d7,#$d8,#$d9,#$da,#$db,#$dc,#$dd,#$de,#$df, #$e0,#$e1,#$e2,#$e3,#$e4,#$e5,#$e6,#$e7,#$e8,#$e9,#$ea,#$eb,#$ec,#$ed,#$ee,#$ef, #$f0,#$f1,#$f2,#$f3,#$f4,#$f5,#$f6,#$f7,#$f8,#$f9,#$fa,#$fb,#$fc,#$fd,#$fe,#$ff);
 
lowerchars: array[char] of char = ( #$00,#$01,#$02,#$03,#$04,#$05,#$06,#$07,#$08,#$09,#$0a,#$0b,#$0c,#$0d,#$0e,#$0f, #$10,#$11,#$12,#$13,#$14,#$15,#$16,#$17,#$18,#$19,#$1a,#$1b,#$1c,#$1d,#$1e,#$1f, #$20,#$21,#$22,#$23,#$24,#$25,#$26,#$27,#$28,#$29,#$2a,#$2b,#$2c,#$2d,#$2e,#$2f, #$30,#$31,#$32,#$33,#$34,#$35,#$36,#$37,#$38,#$39,#$3a,#$3b,#$3c,#$3d,#$3e,#$3f, #$40,'a' ,'b' ,'c' ,'d' ,'e' ,'f' ,'g' ,'h' ,'i' ,'j' ,'k' ,'l' ,'m' ,'n' ,'o' , 'p' ,'q' ,'r' ,'s' ,'t' ,'u' ,'v' ,'w' ,'x' ,'y' ,'z' ,#$5b,#$5c,#$5d,#$5e,#$5f, #$60,#$61,#$62,#$63,#$64,#$65,#$66,#$67,#$68,#$69,#$6a,#$6b,#$6c,#$6d,#$6e,#$6f, #$70,#$71,#$72,#$73,#$74,#$75,#$76,#$77,#$78,#$79,#$7a,#$7b,#$7c,#$7d,#$7e,#$7f, #$80,#$81,#$82,#$83,#$84,#$85,#$86,#$87,#$88,#$89,#$8a,#$8b,#$8c,#$8d,#$8e,#$8f, #$90,#$91,#$92,#$93,#$94,#$95,#$96,#$97,#$98,#$99,#$9a,#$9b,#$9c,#$9d,#$9e,#$9f, #$a0,#$a1,#$a2,#$a3,#$a4,#$a5,#$a6,#$a7,#$a8,#$a9,#$aa,#$ab,#$ac,#$ad,#$ae,#$af, #$b0,#$b1,#$b2,#$b3,#$b4,#$b5,#$b6,#$b7,#$b8,#$b9,#$ba,#$bb,#$bc,#$bd,#$be,#$bf, #$c0,#$c1,#$c2,#$c3,#$c4,#$c5,#$c6,#$c7,#$c8,#$c9,#$ca,#$cb,#$cc,#$cd,#$ce,#$cf, #$d0,#$d1,#$d2,#$d3,#$d4,#$d5,#$d6,#$d7,#$d8,#$d9,#$da,#$db,#$dc,#$dd,#$de,#$df, #$e0,#$e1,#$e2,#$e3,#$e4,#$e5,#$e6,#$e7,#$e8,#$e9,#$ea,#$eb,#$ec,#$ed,#$ee,#$ef, #$f0,#$f1,#$f2,#$f3,#$f4,#$f5,#$f6,#$f7,#$f8,#$f9,#$fa,#$fb,#$fc,#$fd,#$fe,#$ff);
 
emptylstring: lstringty = (po: nil; len: 0);
 
emptywstring: lmsestringty = (po: nil; len: 0);
 

Generated by PasDoc 0.16.0.