OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 inline string StripSuffixString(const string& str, const string& suffix) { | 141 inline string StripSuffixString(const string& str, const string& suffix) { |
142 if (HasSuffixString(str, suffix)) { | 142 if (HasSuffixString(str, suffix)) { |
143 return str.substr(0, str.size() - suffix.size()); | 143 return str.substr(0, str.size() - suffix.size()); |
144 } else { | 144 } else { |
145 return str; | 145 return str; |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 // ---------------------------------------------------------------------- | 149 // ---------------------------------------------------------------------- |
150 // ReplaceCharacters | 150 // StripString |
151 // Replaces any occurrence of the character 'remove' (or the characters | 151 // Replaces any occurrence of the character 'remove' (or the characters |
152 // in 'remove') with the character 'replacewith'. | 152 // in 'remove') with the character 'replacewith'. |
153 // Good for keeping html characters or protocol characters (\t) out | 153 // Good for keeping html characters or protocol characters (\t) out |
154 // of places where they might cause a problem. | 154 // of places where they might cause a problem. |
155 // StripWhitespace | 155 // StripWhitespace |
156 // Removes whitespaces from both ends of the given string. | 156 // Removes whitespaces from both ends of the given string. |
157 // ---------------------------------------------------------------------- | 157 // ---------------------------------------------------------------------- |
158 LIBPROTOBUF_EXPORT void ReplaceCharacters(string* s, const char* remove, | |
159 char replacewith); | |
160 LIBPROTOBUF_EXPORT void StripString(string* s, const char* remove, | 158 LIBPROTOBUF_EXPORT void StripString(string* s, const char* remove, |
161 char replacewith); | 159 char replacewith); |
162 | 160 |
163 LIBPROTOBUF_EXPORT void StripWhitespace(string* s); | 161 LIBPROTOBUF_EXPORT void StripWhitespace(string* s); |
164 | 162 |
165 | 163 |
166 // ---------------------------------------------------------------------- | 164 // ---------------------------------------------------------------------- |
167 // LowerString() | 165 // LowerString() |
168 // UpperString() | 166 // UpperString() |
169 // ToUpper() | 167 // ToUpper() |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 // ---------------------------------------------------------------------- | 867 // ---------------------------------------------------------------------- |
870 // UTF8FirstLetterNumBytes() | 868 // UTF8FirstLetterNumBytes() |
871 // Length of the first UTF-8 character. | 869 // Length of the first UTF-8 character. |
872 // ---------------------------------------------------------------------- | 870 // ---------------------------------------------------------------------- |
873 LIBPROTOBUF_EXPORT int UTF8FirstLetterNumBytes(const char* src, int len); | 871 LIBPROTOBUF_EXPORT int UTF8FirstLetterNumBytes(const char* src, int len); |
874 | 872 |
875 } // namespace protobuf | 873 } // namespace protobuf |
876 } // namespace google | 874 } // namespace google |
877 | 875 |
878 #endif // GOOGLE_PROTOBUF_STUBS_STRUTIL_H__ | 876 #endif // GOOGLE_PROTOBUF_STUBS_STRUTIL_H__ |
OLD | NEW |