1 /* Copyright David Abrahams 2004. Distributed under the Boost */
2 /* Software License, Version 1.0. (See accompanying */
3 /* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */
4 #ifndef JAMH_KSTRINGS_H
5 #define JAMH_KSTRINGS_H
7 //#define KSTRINGS_DEBUG
21 extern void kStringNew (tKString
*s
);
22 extern void kStringNewCStr (tKString
*s
, char const *rhs
);
23 extern void kStringFree (tKString
*s
);
24 extern void kStringClear (tKString
*s
); // clear allocated string; will not free allocated memory though
25 extern void kStringReserve (tKString
*s
, int capacity
);
26 extern void kStringAppendCStr (tKString
*s
, char const *str
);
27 extern void kStringAppendBytes (tKString
*s
, char const *start
, int len
); // len<0: use strlen()
28 extern void kStringAppendRange (tKString
*s
, char const *start
, char const *finish
); // *finish will not be included
29 extern void kStringTruncate (tKString
*s
, int n
);
30 extern char kStringPopBack (tKString
*s
); // returns 'popped' char (0 if string is empty)
31 extern void kStringPushBack (tKString
*s
, char x
);
32 extern char kStringLastChar (tKString
*s
); // return last char (0 if string is empty)
33 extern char *kStringCStr (tKString
*s
);
34 extern int kStringLen (tKString
*s
);
37 extern void kStringUnitTest (void);