Lines Matching refs:DataPiece
57 // Just like StringPiece, the DataPiece class does not own the storage for
59 // that the underlying storage is still valid when the DataPiece is accessed.
60 class LIBPROTOBUF_EXPORT DataPiece {
63 // These are the types supported by DataPiece.
79 explicit DataPiece(const int32 value) : type_(TYPE_INT32), i32_(value) {}
80 explicit DataPiece(const int64 value) : type_(TYPE_INT64), i64_(value) {}
81 explicit DataPiece(const uint32 value) : type_(TYPE_UINT32), u32_(value) {}
82 explicit DataPiece(const uint64 value) : type_(TYPE_UINT64), u64_(value) {}
83 explicit DataPiece(const double value) : type_(TYPE_DOUBLE), double_(value) {}
84 explicit DataPiece(const float value) : type_(TYPE_FLOAT), float_(value) {}
85 explicit DataPiece(const bool value) : type_(TYPE_BOOL), bool_(value) {}
86 DataPiece(StringPiece value, bool use_strict_base64_decoding)
91 DataPiece(StringPiece value, bool dummy, bool use_strict_base64_decoding)
95 DataPiece(const DataPiece& r) : type_(r.type_), str_(r.str_) {}
96 DataPiece& operator=(const DataPiece& x) {
102 static DataPiece NullData() { return DataPiece(TYPE_NULL, 0); }
104 virtual ~DataPiece() {
116 // Parses, casts or converts the value stored in the DataPiece into an int32.
119 // Parses, casts or converts the value stored in the DataPiece into a uint32.
122 // Parses, casts or converts the value stored in the DataPiece into an int64.
125 // Parses, casts or converts the value stored in the DataPiece into a uint64.
128 // Parses, casts or converts the value stored in the DataPiece into a double.
131 // Parses, casts or converts the value stored in the DataPiece into a float.
134 // Parses, casts or converts the value stored in the DataPiece into a bool.
137 // Parses, casts or converts the value stored in the DataPiece into a string.
140 // Tries to convert the value contained in this datapiece to string. If the
156 DataPiece();
159 DataPiece(Type type, int32 val) : type_(type), i32_(val) {}