1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef VALUES_H_
- #define VALUES_H_
- #include <memory>
- #include <string>
- #include <vector>
- namespace base {
- class Value {
- public:
- using ListStorage = std::vector<Value>;
- ListStorage& GetList();
- const ListStorage& GetList() const;
- protected:
- ListStorage list_;
- };
- class ListValue : public Value {
- public:
- void Clear();
- size_t GetSize() const;
- bool empty() const;
- void Reserve(size_t);
- void AppendBoolean(bool);
- void AppendInteger(int);
- void AppendDouble(double);
- void AppendString(std::string);
- void Append(std::unique_ptr<Value> in_value);
- void AppendStrings(const std::vector<std::string>& in_values);
- bool AppendIfNotPresent(std::unique_ptr<Value> in_value);
- };
- }
- #endif
|