2 * Copyright (C) 2010 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <sys/types.h>
27 AString(const char *s);
28 AString(const char *s, size_t size);
29 AString(const AString &from);
30 AString(const AString &from, size_t offset, size_t n);
33 AString &operator=(const AString &from);
34 void setTo(const char *s);
35 void setTo(const char *s, size_t size);
36 void setTo(const AString &from, size_t offset, size_t n);
39 const char *c_str() const;
45 void erase(size_t start, size_t n);
47 void append(char c) { append(&c, 1); }
48 void append(const char *s);
49 void append(const char *s, size_t size);
50 void append(const AString &from);
51 void append(const AString &from, size_t offset, size_t n);
53 void append(unsigned x);
55 void append(unsigned long x);
56 void append(long long x);
57 void append(unsigned long long x);
59 void append(double x);
62 void insert(const AString &from, size_t insertionPos);
63 void insert(const char *from, size_t size, size_t insertionPos);
65 ssize_t find(const char *substring, size_t start = 0) const;
69 bool operator==(const AString &other) const;
70 bool operator<(const AString &other) const;
71 bool operator>(const AString &other) const;
73 int compare(const AString &other) const;
75 bool startsWith(const char *prefix) const;
80 static const char *kEmptyString;
89 AString StringPrintf(const char *format, ...);
91 } // namespace android