39#include <Inventor/system/inttypes.h>
40#include <Inventor/C/base/string.h>
43 #define COIN_ALLOW_SBINTLIST
44 #include <Inventor/lists/SbIntList.h>
45 #undef COIN_ALLOW_SBINTLIST
47 #include <Inventor/lists/SbIntList.h>
54 SbString(
void) { cc_string_construct(&this->str); }
57 { cc_string_construct(&this->str); cc_string_set_text(&this->str, s); }
60 { cc_string_construct(&this->str); cc_string_set_wtext(&this->str, s); }
63 { cc_string_construct(&this->str); cc_string_set_subtext(&this->str, s, start,
end); }
66 { cc_string_construct(&this->str); cc_string_set_string(&this->str, &s.str); }
69 { cc_string_construct(&this->str); cc_string_set_integer(&this->str,
digits); }
73 uint32_t
hash(
void)
const {
return cc_string_hash(&this->str); }
74 static uint32_t
hash(
const char * s) {
return cc_string_hash_text(s); }
76 int getLength(
void)
const {
return cc_string_length(&this->str); }
80 if (
freeold ) cc_string_clear(&this->str);
81 else cc_string_clear_no_free(&this->str);
84 const char *
getString(
void)
const {
return cc_string_get_text(&this->str); }
89 cc_string_set_subtext(&s.str, cc_string_get_text(&this->str),
startidx,
endidx);
97 void addIntString(
const int value) { cc_string_append_integer(&this->str, value); }
99 char operator[](
int index)
const {
return this->str.pointer[index]; }
102 { cc_string_set_text(&this->str, s);
return *
this; }
104 { cc_string_set_text(&this->str, s.str.pointer);
return *
this; }
107 { cc_string_append_text(&this->str, s);
return *
this; }
109 { cc_string_append_string(&this->str, &s.str);
return *
this; }
111 { cc_string_append_char(&this->str, c);
return *
this; }
113 int operator!(
void)
const {
return ! cc_string_is(&this->str); }
116 {
return cc_string_compare_subtext(&this->str, text, offset); }
125 { cc_string_vsprintf(&this->str,
formatstr,
args);
return *
this; }
127 void apply(
char (*func)(
char input)) {
128 cc_string_apply(&this->str,
reinterpret_cast<cc_apply_f
>(func));
137 void print(std::FILE * fp)
const;
148 friend int operator>(
const SbString &
sbstr,
const char * s);
149 friend int operator>(
const char * s,
const SbString &
sbstr);
160{
return (cc_string_compare_text(
sbstr.str.pointer, s) == 0); }
162{
return (cc_string_compare_text(s,
sbstr.str.pointer) == 0); }
164{
return (cc_string_compare_text(
str1.str.pointer,
str2.str.pointer) == 0); }
167{
return (cc_string_compare_text(
sbstr.str.pointer, s) != 0); }
169{
return (cc_string_compare_text(s,
sbstr.str.pointer) != 0); }
171{
return (cc_string_compare_text(
str1.str.pointer,
str2.str.pointer) != 0); }
174{
return (cc_string_compare_text(
sbstr.str.pointer, s) < 0); }
176{
return (cc_string_compare_text(s,
sbstr.str.pointer) < 0); }
178{
return (cc_string_compare_text(
str1.str.pointer,
str2.str.pointer) < 0); }
181{
return (cc_string_compare_text(
sbstr.str.pointer, s) > 0); }
183{
return (cc_string_compare_text(s,
sbstr.str.pointer) > 0); }
185{
return (cc_string_compare_text(
str1.str.pointer,
str2.str.pointer) > 0); }
208#include <Inventor/SbName.h>
The SbIntList class is a container for integer numbers.
Definition SbIntList.h:40
The SbList class is a template container class for lists.
Definition SbList.h:70
int find(const Type item) const
Definition SbList.h:126
int operator!=(const SbList< Type > &l) const
Definition SbList.h:217
SbList(const int sizehint=DEFAULTSIZE)
Definition SbList.h:78
int operator==(const SbList< Type > &l) const
Definition SbList.h:209
The SbString class is a string class with convenience functions for string operations.
Definition SbString.h:52
int operator!(void) const
Definition SbString.h:113
int getLength(void) const
Definition SbString.h:76
SbString getSubString(int startidx, int endidx=-1) const
Definition SbString.h:86
char operator[](int index) const
Definition SbString.h:99
SbString(const char *s)
Definition SbString.h:56
~SbString()
Definition SbString.h:71
SbString(const int digits)
Definition SbString.h:68
void apply(char(*func)(char input))
Definition SbString.h:127
SbString & operator+=(const char c)
Definition SbString.h:110
SbString & operator=(const SbString &s)
Definition SbString.h:103
SbString(const SbString &s)
Definition SbString.h:65
SbString(const char *s, int start, int end)
Definition SbString.h:62
uint32_t hash(void) const
Definition SbString.h:73
SbString & sprintf(const char *formatstr,...)
Definition SbString.h:118
const char * getString(void) const
Definition SbString.h:84
SbString & operator+=(const char *s)
Definition SbString.h:106
void deleteSubString(int startidx, int endidx=-1)
Definition SbString.h:92
SbString(const wchar_t *s)
Definition SbString.h:59
SbString & operator+=(const SbString &s)
Definition SbString.h:108
void addIntString(const int value)
Definition SbString.h:97
int compareSubString(const char *text, int offset=0) const
Definition SbString.h:115
SbString(void)
Definition SbString.h:54
void makeEmpty(SbBool freeold=TRUE)
Definition SbString.h:78
static uint32_t hash(const char *s)
Definition SbString.h:74
SbString & vsprintf(const char *formatstr, va_list args)
Definition SbString.h:124
SbString & operator=(const char *s)
Definition SbString.h:101
The cc_string type is a C ADT for ASCII string management.
Definition string.h:51