30 #ifndef GOOGLE_FITNESS_API_VALUE_H_ 31 #define GOOGLE_FITNESS_API_VALUE_H_ 34 #include "googleapis/base/integral_types.h" 35 #include "googleapis/base/macros.h" 36 #include "googleapis/client/data/jsoncpp_data.h" 37 #include "googleapis/strings/stringpiece.h" 39 #include "google/fitness_api/value_map_val_entry.h" 56 class Value :
public client::JsonCppData {
70 explicit Value(
const Json::Value& storage);
77 explicit Value(Json::Value* storage);
90 return StringPiece(
"google_fitness_api::Value");
99 return Storage().isMember(
"fpVal");
106 MutableStorage()->removeMember(
"fpVal");
114 const Json::Value& storage = Storage(
"fpVal");
115 return client::JsonValueToCppValueHelper<double >(storage);
126 client::SetJsonValueFromCppValueHelper<double >(
127 value, MutableStorage(
"fpVal"));
136 return Storage().isMember(
"intVal");
143 MutableStorage()->removeMember(
"intVal");
151 const Json::Value& storage = Storage(
"intVal");
152 return client::JsonValueToCppValueHelper<int32 >(storage);
163 client::SetJsonValueFromCppValueHelper<int32 >(
164 value, MutableStorage(
"intVal"));
173 return Storage().isMember(
"mapVal");
180 MutableStorage()->removeMember(
"mapVal");
187 const client::JsonCppArray<ValueMapValEntry > get_map_val()
const;
199 client::JsonCppArray<ValueMapValEntry > mutable_mapVal();
207 return Storage().isMember(
"stringVal");
214 MutableStorage()->removeMember(
"stringVal");
222 const Json::Value& v = Storage(
"stringVal");
223 if (v == Json::Value::null)
return StringPiece(
"");
224 return StringPiece(v.asCString());
237 *MutableStorage(
"stringVal") = value.data();
241 void operator=(
const Value&);
244 #endif // GOOGLE_FITNESS_API_VALUE_H_ bool has_string_val() const
Definition: value.h:206
double get_fp_val() const
Definition: value.h:113
bool has_int_val() const
Definition: value.h:135
void set_fp_val(double value)
Definition: value.h:125
void clear_fp_val()
Definition: value.h:105
void set_int_val(int32 value)
Definition: value.h:162
void set_string_val(const StringPiece &value)
Definition: value.h:236
bool has_map_val() const
Definition: value.h:172
void clear_string_val()
Definition: value.h:213
Definition: aggregate_bucket.h:42
bool has_fp_val() const
Definition: value.h:98
const StringPiece GetTypeName() const
Definition: value.h:89
Definition: aggregate_bucket.cc:44
const StringPiece get_string_val() const
Definition: value.h:221
int32 get_int_val() const
Definition: value.h:150
void clear_map_val()
Definition: value.h:179
void clear_int_val()
Definition: value.h:142