Merge "libutils: String\d+ make std_string private"

am: 76850afa52

Change-Id: I1d8278c7545c67a916977983d38ea82756a17403
This commit is contained in:
Steven Moreland 2017-03-11 08:59:48 +00:00 committed by android-build-merger
commit 2ebb1e5404
3 changed files with 14 additions and 1 deletions

View File

@ -129,7 +129,7 @@ int BatteryMonitor::getBatteryHealth(const char* status) {
}
int BatteryMonitor::readFromFile(const String8& path, std::string* buf) {
if (android::base::ReadFileToString(String8::std_string(path), buf)) {
if (android::base::ReadFileToString(path.c_str(), buf)) {
*buf = android::base::Trim(*buf);
}
return buf->length();

View File

@ -67,7 +67,10 @@ public:
inline const char16_t* string() const;
//TODO(b/35363681): remove
private:
static inline std::string std_string(const String16& str);
public:
size_t size() const;
void setTo(const String16& other);
status_t setTo(const char16_t* other);

View File

@ -64,8 +64,14 @@ public:
static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2)));
static String8 formatV(const char* fmt, va_list args);
inline const char* c_str() const;
inline const char* string() const;
// TODO(b/35363681): remove
private:
static inline std::string std_string(const String8& str);
public:
inline size_t size() const;
inline size_t bytes() const;
inline bool isEmpty() const;
@ -259,6 +265,10 @@ inline const String8 String8::empty() {
return String8();
}
inline const char* String8::c_str() const
{
return mString;
}
inline const char* String8::string() const
{
return mString;