32 #ifndef GTEST_SAMPLES_SAMPLE2_H_ 33 #define GTEST_SAMPLES_SAMPLE2_H_ 41 const char* c_string_;
56 explicit MyString(
const char* a_c_string) : c_string_(nullptr) {
62 Set(
string.c_string_);
72 const char*
c_string()
const {
return c_string_; }
74 size_t Length()
const {
return c_string_ ==
nullptr ? 0 : strlen(c_string_); }
81 #endif // GTEST_SAMPLES_SAMPLE2_H_ MyString()
Definition: sample2.h:53
static const char * CloneCString(const char *a_c_string)
Definition: sample2.cc:37
MyString(const MyString &string)
Definition: sample2.h:61
void Set(const char *c_string)
Definition: sample2.cc:49
~MyString()
Definition: sample2.h:69
MyString(const char *a_c_string)
Definition: sample2.h:56
size_t Length() const
Definition: sample2.h:74
const char * c_string() const
Definition: sample2.h:72