Changeset 54789 in webkit for trunk/JavaScriptCore/runtime/UString.h
- Timestamp:
- Feb 15, 2010, 1:03:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/UString.h
r54788 r54789 83 83 UString(); 84 84 UString(const char*); // Constructor for null-terminated string. 85 UString(const char*, intlength);86 UString(const UChar*, intlength);85 UString(const char*, unsigned length); 86 UString(const UChar*, unsigned length); 87 87 UString(const Vector<UChar>& buffer); 88 88 … … 137 137 bool is8Bit() const; 138 138 139 intsize() const { return m_rep->size(); }140 141 UChar operator[]( intpos) const;139 unsigned size() const { return m_rep->size(); } 140 141 UChar operator[](unsigned pos) const; 142 142 143 143 double toDouble(bool tolerateTrailingJunk, bool tolerateEmptyString) const; … … 151 151 unsigned toArrayIndex(bool* ok = 0) const; 152 152 153 int find(const UString& f, int pos = 0) const; 154 int find(UChar, int pos = 0) const; 155 int rfind(const UString& f, int pos) const; 156 int rfind(UChar, int pos) const; 157 158 UString substr(int pos = 0, int len = -1) const; 153 static const unsigned NotFound = 0xFFFFFFFFu; 154 unsigned find(const UString& f, unsigned pos = 0) const; 155 unsigned find(UChar, unsigned pos = 0) const; 156 unsigned rfind(const UString& f, unsigned pos) const; 157 unsigned rfind(UChar, unsigned pos) const; 158 159 UString substr(unsigned pos = 0, unsigned len = 0xFFFFFFFF) const; 159 160 160 161 static const UString& null() { return *s_nullUString; } … … 182 183 ALWAYS_INLINE bool operator==(const UString& s1, const UString& s2) 183 184 { 184 intsize = s1.size();185 unsigned size = s1.size(); 185 186 switch (size) { 186 187 case 0: … … 246 247 // this runs too much risk of a tiny initial string holding down a 247 248 // huge buffer. 248 // FIXME: this should be size_t but that would cause warnings until we 249 // fix UString sizes to be size_t instead of int 250 static const int minShareSize = Heap::minExtraCost / sizeof(UChar); 249 static const unsigned minShareSize = Heap::minExtraCost / sizeof(UChar); 251 250 252 251 struct IdentifierRepHash : PtrHash<RefPtr<JSC::UString::Rep> > {
Note:
See TracChangeset
for help on using the changeset viewer.