ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

StringClassSub.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel */
40 /* */
41 /* substring oriented REXX string methods */
42 /* */
43 /******************************************************************************/
44 
45 #include <ctype.h>
46 #include <stdlib.h>
47 #include <string.h>
48 #include <math.h>
49 #include "RexxCore.h"
50 #include "StringClass.hpp"
51 #include "ActivityManager.hpp"
52 #include "StringUtil.hpp"
53 
54 
55 /* the CENTER function (and the CENTRE function) */
56 /******************************************************************************/
57 /* Arguments: String len, string pad character */
58 /* */
59 /* Returned: string */
60 /******************************************************************************/
62  RexxString *pad)
63 {
64  char PadChar; /* pad character */
65  size_t LeftPad; /* required left pads */
66  size_t RightPad; /* required right pads */
67  size_t Space; /* result string size */
68  size_t Width; /* centering width */
69  size_t Len; /* string length */
70  RexxString *Retval; /* return string */
71 
72  /* see how long result should be */
73  Width = lengthArgument(_length, ARG_ONE);
74 
75  /* Get pad character (optional) blank*/
76  /* is used if omitted. */
77  PadChar = optionalPadArgument(pad, ' ', ARG_TWO);
78  Len = this->getLength(); /* get length of input to center */
79  if (Width == Len) /* if input length and */
80  {
81  /* requested are the same */
82  Retval = this; /* then copy input */
83  }
84  else if (!Width) /* centered in zero? */
85  {
86  Retval = OREF_NULLSTRING; /* return a null string */
87  }
88  else
89  {
90  if (Width > Len)
91  { /* otherwise */
92  /* if requested larger */
93  LeftPad = (Width - Len) / 2; /* get left pad count */
94  RightPad = (Width - Len)-LeftPad;/* and right pad count */
95  Space = RightPad + LeftPad + Len;/* total space required */
96  /* allocate space */
97  Retval = (RexxString *)raw_string(Space);
98  /* set left pad characters */
99  memset(Retval->getWritableData(), PadChar, LeftPad);
100  if (Len) /* something to copy? */
101  {
102  /* copy the string */
103  memcpy(Retval->getWritableData() + LeftPad, this->getStringData(), Len);
104  }
105  /* now the trailing pad chars */
106  memset(Retval->getWritableData() + LeftPad + Len, PadChar, RightPad);
107  }
108  else
109  { /* requested smaller than */
110  /* input */
111  LeftPad = (Len - Width) / 2; /* get left truncate count */
112  /* copy the data */
113  Retval = (RexxString *)new_string(this->getStringData() + LeftPad, Width);
114  }
115  }
116  return Retval; /* done, return output buffer */
117 }
118 
119 /* the DELSTR function */
120 /******************************************************************************/
121 /* Arguments: Starting position of string to be deleted */
122 /* length of string to be deleted */
123 /* Returned: string */
124 /******************************************************************************/
126  RexxInteger *_length)
127 {
128  RexxString *Retval; /* return value: */
129  size_t BackLen; /* end string section */
130  size_t StringLen; /* original string length */
131  size_t DeleteLen; /* deleted length */
132  size_t DeletePos; /* delete position */
133  char *Current; /* current copy position */
134 
135  StringLen = this->getLength(); /* get string length */
136  /* get start string position */
137  DeletePos = positionArgument(position, ARG_ONE);
138  /* get the length to delete */
139  DeleteLen = optionalLengthArgument(_length, StringLen - DeletePos + 1, ARG_TWO);
140 
141  if (DeletePos > StringLen) /* beyond string bounds? */
142  {
143  Retval = this; /* return string unchanged */
144  }
145  else
146  { /* need to actually delete */
147  DeletePos--; /* make position origin zero */
148  /* deleting more than string? */
149  if (DeleteLen >= (StringLen - DeletePos))
150  {
151  BackLen = 0; /* no back part */
152  }
153  else /* find length to delete */
154  {
155  BackLen = StringLen - (DeletePos + DeleteLen);
156  }
157  /* allocate result string */
158  Retval = (RexxString *)raw_string(DeletePos + BackLen);
159  /* point to string part */
160  Current = Retval->getWritableData();
161  if (DeletePos)
162  { /* have a front part? */
163  /* copy it */
164  memcpy(Current, this->getStringData(), DeletePos);
165  Current += DeletePos; /* step past the front */
166  }
167 
168  if (BackLen)
169  { /* have a trailing part */
170  /* copy that over */
171  memcpy(Current, this->getStringData() + DeletePos + DeleteLen, BackLen);
172  }
173  }
174  return Retval; /* return the new string */
175 }
176 
177 /* the INSERT function */
178 /******************************************************************************/
179 /* Arguments: string to be inserted */
180 /* position in self to place new string */
181 /* length of new string to insert, padded if necessary */
182 /* pad character to use. */
183 /* Returned: string */
184 /******************************************************************************/
186  RexxInteger *position,
187  RexxInteger *_length,
188  RexxString *pad)
189 {
190  RexxString *Retval; /* return string */
191  RexxString *newStr; /* return string */
192  char PadChar; /* HugeString for Padding char */
193  size_t ReqLenChar; /* Actual req char len of new. */
194  size_t ReqPadChar; /* Actual req char len of new. */
195  size_t ReqLeadPad; /* Actual req char len of new. */
196  size_t TargetSize; /* byte size of target string */
197  size_t NCharLen; /* Char len of new HugeString. */
198  size_t TCharLen; /* Char len of target HugeStr. */
199  size_t FCharLen; /* Char len of front portion. */
200  size_t BCharLen; /* Char len of back portion. */
201  size_t BuffSiz; /* Estimated result area size. */
202  size_t NChar; /* Character position. */
203  char * Current; /* current copy location */
204 
205  TCharLen = this->getLength(); /* get the target string length */
206  /* get the needle string (and length)*/
207  newStr = stringArgument(newStrObj, ARG_ONE);
208  NCharLen = newStr->getLength();
209  /* use optionalLengthArgument for starting */
210  /* position becase a value of 0 IS */
211  /* valid for INSERT */
212  NChar = optionalLengthArgument(position, 0, ARG_TWO);
213  /* get the optional length, using the*/
214  /* needle length as the defaul */
215  ReqLenChar = optionalLengthArgument(_length, NCharLen, ARG_THREE);
216 
217  /* is used if omitted. */
218  PadChar = optionalPadArgument(pad, ' ', ARG_FOUR);
219  ReqLeadPad = 0; /* set lead pad to zero */
220  TargetSize = TCharLen; /* copy the target size */
221 
222  if (NChar == 0)
223  { /* inserting at the front? */
224  ReqLeadPad = 0; /* no leading pads */
225  FCharLen = 0; /* no front part */
226  BCharLen = TCharLen; /* trailer is entire target */
227  }
228  else if (NChar >= TCharLen)
229  { /* need leading pads? */
230  ReqLeadPad = (NChar - TCharLen); /* calculate needed */
231  FCharLen = TCharLen; /* front part is all */
232  BCharLen = 0; /* trailer is nothing */
233  }
234  else
235  { /* have a split */
236  ReqLeadPad = 0; /* no leading pad */
237  FCharLen = NChar; /* NChar front chars */
238  BCharLen = TCharLen - NChar; /* and some trailer too */
239  }
240  NCharLen = Numerics::minVal(NCharLen, ReqLenChar);/* truncate new, if needed */
241  ReqPadChar = ReqLenChar - NCharLen; /* calculate pad chars */
242  /* calculate result size */
243  BuffSiz = NCharLen + TargetSize + ReqPadChar + ReqLeadPad;
244  Retval = raw_string(BuffSiz); /* allocate the result */
245  Current = Retval->getWritableData(); /* point to start */
246 
247  if (FCharLen)
248  { /* have leading chars */
249  /* copy the leading part */
250  memcpy(Current, this->getStringData(), FCharLen);
251  Current += FCharLen; /* step copy location */
252  }
253  if (ReqLeadPad)
254  { /* if required leading pads */
255  /* add the pads now */
256  memset(Current, PadChar, ReqLeadPad);
257  Current += ReqLeadPad; /* step the output pointer */
258  }
259 
260  if (NCharLen)
261  { /* new string to copy? */
262  /* copy the inserted part */
263  memcpy(Current, newStr->getStringData(), NCharLen);
264  Current += NCharLen; /* step copy location */
265  }
266 
267  if (ReqPadChar)
268  { /* if required trailing pads */
269  /* add the pads now */
270  memset(Current, PadChar, ReqPadChar);
271  Current += ReqPadChar; /* step the output pointer */
272  }
273 
274  if (BCharLen)
275  { /* have trailing chars */
276  /* copy the leading part */
277  memcpy(Current, this->getStringData() + FCharLen, BCharLen);
278  }
279  return Retval; /* Return the new string */
280 }
281 
282 /* the LEFT function */
283 /******************************************************************************/
284 /* Arguments: String len, string pad character */
285 /* */
286 /* Returned: string */
287 /******************************************************************************/
289  RexxString *pad)
290 {
291  char PadChar; /* pad character */
292  size_t Size; /* requested size */
293  size_t Length; /* string length */
294  RexxString *Retval; /* returned result */
295  char * Current; /* current copy location */
296  size_t CopyLength; /* length to copy */
297 
298  /* get the target length */
299  Size = lengthArgument(_length, ARG_ONE);
300 
301  /* is used if omitted. */
302  PadChar = optionalPadArgument(pad, ' ', ARG_TWO);
303  Length = this->getLength(); /* get input length */
304 
305  if (!Size) /* requesting zero bytes? */
306  {
307  Retval = OREF_NULLSTRING; /* return a null string */
308  }
309  else
310  {
311  Retval = raw_string(Size); /* allocate a result string */
312  CopyLength = Numerics::minVal(Length, Size); /* adjust the length */
313  /* point to data part */
314  Current = Retval->getWritableData();
315  if (CopyLength)
316  { /* have real data? */
317  /* copy it */
318  memcpy(Current, this->getStringData(), CopyLength);
319  Current += CopyLength; /* bump the pointer */
320  }
321  if (Size > Length) /* need to pad? */
322  {
323  /* pad the string */
324  memset(Current, PadChar, Size - Length);
325  }
326  }
327  return Retval; /* return string piece */
328 }
329 
330 /******************************************************************************/
331 /* Function: Process the OVERLAY function/method */
332 /******************************************************************************/
334  RexxString *newStrObj, /* overlayed string */
335  RexxInteger *position, /* overlay position */
336  RexxInteger *_length, /* overlay length */
337  RexxString *pad) /* pad character to use. */
338 {
339  RexxString *Retval; /* return string */
340  RexxString *newStr; /* return string */
341  size_t OverlayPos; /* overlay position */
342  size_t OverlayLen; /* overlay length */
343  size_t NewLen; /* length of overlay string */
344  size_t TargetLen; /* target length */
345  size_t FrontLen; /* front length */
346  size_t BackLen; /* back length */
347  size_t FrontPad; /* front pad length */
348  size_t BackPad; /* back pad length */
349  char PadChar; /* pad character */
350  char *Current; /* current copy location */
351 
352  TargetLen = this->getLength(); /* get the haystack length */
353  /* get the overlay string value */
354  newStr = stringArgument(newStrObj, ARG_ONE);
355  NewLen = newStr->getLength();
356  /* get the overlay position */
357  OverlayPos = optionalPositionArgument(position, 1, ARG_TWO);
358  /* get final overlay length */
359  OverlayLen = optionalLengthArgument(_length, NewLen, ARG_THREE);
360  /* is used if omitted. */
361  PadChar = optionalPadArgument(pad, ' ', ARG_FOUR);
362 
363  if (OverlayLen > NewLen) /* need to pad? */
364  BackPad = OverlayLen - NewLen; /* get the pad size */
365  else
366  { /* need to truncate */
367  NewLen = OverlayLen; /* used specified length */
368  BackPad = 0; /* no back padding */
369  }
370 
371  if (OverlayPos > TargetLen)
372  { /* overlaying past the end? */
373  /* get front padding */
374  FrontPad = OverlayPos - TargetLen - 1;
375  FrontLen = TargetLen; /* copy entire string */
376  }
377  else
378  { /* overlay is within bounds */
379  FrontPad = 0; /* no padding here */
380  FrontLen = OverlayPos - 1; /* just copy the front part */
381  }
382  /* fall off the back side? */
383  if (OverlayPos + OverlayLen > TargetLen)
384  {
385  BackLen = 0; /* no back part */
386  }
387  else
388  {
389  /* calculate the back part */
390  BackLen = TargetLen - (OverlayPos + OverlayLen - 1);
391  }
392  /* allocate result string */
393  Retval = raw_string(FrontLen + BackLen + FrontPad + OverlayLen);
394 
395  Current = Retval->getWritableData(); /* get copy location */
396 
397  if (FrontLen)
398  { /* something in front? */
399  /* copy the front part */
400  memcpy(Current, this->getStringData(), FrontLen);
401  Current += FrontLen; /* step the pointer */
402  }
403 
404  if (FrontPad)
405  { /* padded in front? */
406  memset(Current, PadChar, FrontPad);/* set the pad characters */
407  Current += FrontPad; /* step the pointer */
408  }
409 
410  if (NewLen)
411  { /* non-null new string? */
412  /* copy the string */
413  memcpy(Current, newStr->getStringData(), NewLen);
414  Current += NewLen; /* step the pointer */
415  }
416 
417  if (BackPad)
418  { /* padded in back? */
419  /* set the pad characters */
420  memset(Current, PadChar, BackPad);
421  Current += BackPad; /* step the pointer */
422  }
423 
424  if (BackLen)
425  { /* trailing part? */
426  /* copy the string */
427  memcpy(Current, this->getStringData() + OverlayPos + OverlayLen - 1, BackLen);
428  }
429  return Retval; /* return new string */
430 }
431 
432 
449 {
450  size_t targetLen = this->getLength(); // get the length of the replacement target
451  // the replacement value is required and must be a string
452  RexxString *newStr = stringArgument(newStrObj, ARG_ONE);
453  // the length of the replacement string is the default replacement length
454  size_t newLen = newStr->getLength();
455  // the overlay position is required
456  size_t replacePos = positionArgument(position, ARG_TWO);
457  // the replacement length is optional, and defaults to the length of the replacement string
458  size_t replaceLen = optionalLengthArgument(_length, newLen, ARG_THREE);
459  // we only pad if the start position is past the end of the string
460  char padChar = optionalPadArgument(pad, ' ', ARG_FOUR);
461  size_t padding = 0;
462  size_t frontLen = 0;
463  size_t backLen = 0;
464  // the only time we need to pad is if the replacement position is past the
465  // end of the string
466  if (replacePos > targetLen)
467  {
468  padding = replacePos - targetLen - 1;
469  frontLen = targetLen;
470  }
471  else
472  {
473  // this is within bounds, so we copy up to that position
474  frontLen = replacePos - 1;
475  }
476  // is this within the bounds of the string?
477  if (replacePos + replaceLen - 1 < targetLen)
478  {
479  // calculate the back part we need to copy
480  backLen = targetLen - (replacePos + replaceLen - 1);
481  }
482  // allocate a result string
483  RexxString *retval = raw_string(frontLen + backLen + padding + newLen);
484  // and get a copy location
485  char *current = retval->getWritableData();
486 
487  if (frontLen > 0)
488  { /* something in front? */
489  /* copy the front part */
490  memcpy(current, this->getStringData(), frontLen);
491  current += frontLen; /* step the pointer */
492  }
493  // padding only happens if we've copy the entire front portion
494  if (padding > 0)
495  {
496  memset(current, padChar, padding);
497  current += padding;
498  }
499  // replace with a non-null string? copy into the current position
500  if (newLen > 0)
501  {
502  memcpy(current, newStr->getStringData(), newLen);
503  current += newLen;
504  }
505  // the remainder, if there is any, get's copied after the
506  // replacement string with no padding
507  if (backLen > 0)
508  {
509  memcpy(current, this->getStringData() + replacePos + replaceLen - 1, backLen);
510  }
511  return retval;
512 }
513 
514 /* the REVERSE function */
515 /******************************************************************************/
516 /* Arguments: none */
517 /* */
518 /* Returned: string reversed. */
519 /******************************************************************************/
521 {
522  RexxString *Retval; /* temp pointer for reversal */
523  size_t Length; /* string length */
524  char *String; /* current location */
525  const char *End; /* string end position */
526 
527  Length = this->getLength(); /* get first argument */
528  if (Length)
529  { /* if really data */
530  Retval = raw_string(Length); /* get result storage */
531  /* get new string pointer */
532  String = Retval->getWritableData();
533  /* point to end of original */
534  End = this->getStringData() + Length - 1;
535 
536  while (Length--) /* reverse entire string */
537  {
538  *String++ = *End--; /* copy a single char */
539  }
540  /* done building the string */
541  }
542  else /* if null input */
543  {
544  Retval = OREF_NULLSTRING; /* return null output */
545  }
546  return Retval; /* return the reversed string */
547 }
548 
549 /* the RIGHT function */
550 /******************************************************************************/
551 /* Arguments: length of result */
552 /* pad character to use if needed. */
553 /* */
554 /* Returned: string right justified. */
555 /******************************************************************************/
557  RexxString *pad)
558 {
559  char PadChar; /* pad character */
560  size_t Size; /* requested size */
561  size_t Length; /* string length */
562  RexxString *Retval; /* returned result */
563  char * Current; /* current copy location */
564  size_t CopyLength; /* length to copy */
565 
566  /* get the target length */
567  Size = lengthArgument(_length, ARG_ONE);
568 
569  /* is used if omitted. */
570  PadChar = optionalPadArgument(pad, ' ', ARG_TWO);
571  Length = this->getLength(); /* get input length */
572 
573  if (!Size) /* requesting zero bytes? */
574  {
575  /* return a null string */
576  Retval = OREF_NULLSTRING;
577  }
578  else
579  {
580  Retval = raw_string(Size); /* allocate a result string */
581  CopyLength = Numerics::minVal(Length, Size); /* adjust the length */
582  /* point to data part */
583  Current = Retval->getWritableData();
584  if (Size > Length)
585  { /* need to pad? */
586  /* pad the string */
587  memset(Current, PadChar, Size - Length);
588  Current += Size - Length; /* bump the pointer */
589  }
590  if (CopyLength) /* have real data? */
591  {
592  /* copy it */
593  memcpy(Current, this->getStringData() + Length - CopyLength, CopyLength);
594  }
595  }
596  return Retval; /* return string piece */
597 }
598 
609 {
610  // get the option character
611  char option = optionalOptionArgument(optionString, STRIP_BOTH, ARG_ONE);
612  if (option != STRIP_TRAILING && /* must be a valid option */
613  option != STRIP_LEADING &&
614  option != STRIP_BOTH )
615  {
617  }
618  // get the strip character set. The default is to remove spaces and
619  // horizontal tabs
620  stripchar = optionalStringArgument(stripchar, OREF_NULL, ARG_TWO);
621 
622  // the default is to strip whitespace characters
623  const char *chars = stripchar == OREF_NULL ? " \t" : stripchar->getStringData();
624  size_t charsLen = stripchar == OREF_NULL ? strlen(" \t") : stripchar->getLength();
625 
626  const char *front = this->getStringData(); /* point to string start */
627  size_t length = this->getLength(); /* get the length */
628 
629  /* need to strip leading? */
630  if (option == STRIP_LEADING || option == STRIP_BOTH)
631  {
632  // loop while more string or we don't find one of the stripped characters
633  while (length > 0)
634  {
635  if (!StringUtil::matchCharacter(*front, chars, charsLen))
636  {
637  break;
638  }
639  front++; /* step the pointer */
640  length--; /* reduce the length */
641  }
642  }
643 
644  // need to strip trailing?
645  if (option == STRIP_TRAILING || option == STRIP_BOTH)
646  {
647  // point to the end and scan backwards now
648  const char *back = front + length - 1;
649  while (length > 0)
650  {
651  if (!StringUtil::matchCharacter(*back, chars, charsLen))
652  {
653  break;
654  }
655  back--; /* step the pointer back */
656  length--; /* reduce the length */
657  }
658  }
659 
660  // if there is anything left, extract the remaining part
661  if (length > 0)
662  {
663  return new_string(front, length);
664  }
665  else
666  {
667  // null string, everything stripped away
668  return OREF_NULLSTRING;
669  }
670 }
671 
672 /* the SUBSTR function */
673 /******************************************************************************/
674 /* Arguments: String position for substr */
675 /* requested length of new string */
676 /* pad character to use, if necessary */
677 /* */
678 /* Returned: string, sub string of original. */
679 /******************************************************************************/
681  RexxInteger *_length,
682  RexxString *pad)
683 {
684  return StringUtil::substr(getStringData(), getLength(), position, _length, pad);
685 }
686 
687 
702 {
703  return StringUtil::subchar(getStringData(), getLength(), positionArg);
704 }
705 
RexxString::left
RexxString * left(RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:288
StringUtil.hpp
optionalLengthArgument
size_t optionalLengthArgument(RexxObject *o, size_t d, size_t p)
Definition: RexxCore.h:336
ActivityManager.hpp
RexxString::insert
RexxString * insert(RexxString *, RexxInteger *, RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:185
RexxString::getLength
size_t getLength()
Definition: StringClass.hpp:330
STRIP_TRAILING
#define STRIP_TRAILING
Definition: StringClass.hpp:70
RexxString::delstr
RexxString * delstr(RexxInteger *, RexxInteger *)
Definition: StringClassSub.cpp:125
ARG_TWO
const int ARG_TWO
Definition: RexxCore.h:81
reportException
void reportException(wholenumber_t error)
Definition: ActivityManager.hpp:136
RexxString::getWritableData
char * getWritableData()
Definition: StringClass.hpp:334
RexxString::getStringData
const char * getStringData()
Definition: StringClass.hpp:333
raw_string
RexxString * raw_string(stringsize_t l)
Definition: StringClass.hpp:529
StringUtil::subchar
static RexxString * subchar(const char *stringData, size_t stringLength, RexxInteger *positionArg)
Definition: StringUtil.cpp:440
RexxString::reverse
RexxString * reverse()
Definition: StringClassSub.cpp:520
optionalPositionArgument
size_t optionalPositionArgument(RexxObject *o, size_t d, size_t p)
Definition: RexxCore.h:344
lengthArgument
stringsize_t lengthArgument(RexxObject *argument, size_t position)
Definition: StringClassUtil.cpp:58
new_string
RexxString * new_string(const char *s, stringsize_t l)
Definition: StringClass.hpp:524
STRIP_LEADING
#define STRIP_LEADING
Definition: StringClass.hpp:69
ARG_ONE
const int ARG_ONE
Definition: RexxCore.h:80
optionalStringArgument
RexxString * optionalStringArgument(RexxObject *o, RexxString *d, size_t p)
Definition: RexxCore.h:321
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
RexxString::strip
RexxString * strip(RexxString *, RexxString *)
Definition: StringClassSub.cpp:608
ARG_THREE
const int ARG_THREE
Definition: RexxCore.h:82
StringUtil::substr
static RexxString * substr(const char *, size_t, RexxInteger *, RexxInteger *, RexxString *)
Definition: StringUtil.cpp:66
StringClass.hpp
optionalPadArgument
char optionalPadArgument(RexxObject *o, char d, size_t p)
Definition: RexxCore.h:351
Numerics::minVal
static wholenumber_t minVal(wholenumber_t n1, wholenumber_t n2)
Definition: Numerics.hpp:116
RexxString::center
RexxString * center(RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:61
RexxString::right
RexxString * right(RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:556
optionalOptionArgument
char optionalOptionArgument(RexxObject *o, char d, size_t p)
Definition: RexxCore.h:358
ARG_FOUR
const int ARG_FOUR
Definition: RexxCore.h:83
StringUtil::matchCharacter
static bool matchCharacter(char ch, const char *charSet, size_t len)
Definition: StringUtil.hpp:94
RexxString::length
size_t length
Definition: StringClass.hpp:487
positionArgument
stringsize_t positionArgument(RexxObject *argument, size_t position)
Definition: StringClassUtil.cpp:82
Error_Incorrect_method_option
#define Error_Incorrect_method_option
Definition: RexxErrorCodes.h:468
stringArgument
RexxString * stringArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:296
STRIP_BOTH
#define STRIP_BOTH
Definition: StringClass.hpp:68
RexxCore.h
RexxInteger
Definition: IntegerClass.hpp:56
RexxString::overlay
RexxString * overlay(RexxString *, RexxInteger *, RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:333
RexxString::substr
RexxString * substr(RexxInteger *, RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:680
RexxString
Definition: StringClass.hpp:119
RexxString::subchar
RexxString * subchar(RexxInteger *)
Definition: StringClassSub.cpp:701
RexxString::replaceAt
RexxString * replaceAt(RexxString *, RexxInteger *, RexxInteger *, RexxString *)
Definition: StringClassSub.cpp:448