diff options
Diffstat (limited to 'cpp/src/qpid/framing')
| -rw-r--r-- | cpp/src/qpid/framing/FieldTable.cpp | 12 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/FieldTable.h | 9 |
2 files changed, 11 insertions, 10 deletions
diff --git a/cpp/src/qpid/framing/FieldTable.cpp b/cpp/src/qpid/framing/FieldTable.cpp index 013bcd1797..cf0e03180c 100644 --- a/cpp/src/qpid/framing/FieldTable.cpp +++ b/cpp/src/qpid/framing/FieldTable.cpp @@ -127,18 +127,14 @@ T getValue(const FieldTable::ValuePtr value) return value->get<T>(); } -std::string FieldTable::getString(const std::string& name) const { +std::string FieldTable::getAsString(const std::string& name) const { return getValue<std::string>(get(name)); } -int FieldTable::getInt(const std::string& name) const { +int FieldTable::getAsInt(const std::string& name) const { return getValue<int>(get(name)); } -//uint64_t FieldTable::getTimestamp(const std::string& name) const { -// return getValue<uint64_t>(name); -//} - uint64_t FieldTable::getAsUInt64(const std::string& name) const { return static_cast<uint64_t>( getValue<int64_t>(get(name))); } @@ -176,6 +172,10 @@ bool FieldTable::getDouble(const std::string& name, double& value) const { return getRawFixedWidthValue<double, 8, 0x33>(get(name), value); } +//uint64_t FieldTable::getTimestamp(const std::string& name) const { +// return getValue<uint64_t>(name); +//} + void FieldTable::encode(Buffer& buffer) const{ buffer.putLong(encodedSize() - 4); buffer.putLong(values.size()); diff --git a/cpp/src/qpid/framing/FieldTable.h b/cpp/src/qpid/framing/FieldTable.h index f4f130743b..66103448a7 100644 --- a/cpp/src/qpid/framing/FieldTable.h +++ b/cpp/src/qpid/framing/FieldTable.h @@ -72,16 +72,17 @@ class FieldTable void setDouble(const std::string& name, double value); //void setDecimal(string& name, xxx& value); - std::string getString(const std::string& name) const; - int getInt(const std::string& name) const; -// uint64_t getTimestamp(const std::string& name) const; + int getAsInt(const std::string& name) const; uint64_t getAsUInt64(const std::string& name) const; int64_t getAsInt64(const std::string& name) const; + std::string getAsString(const std::string& name) const; + bool getTable(const std::string& name, FieldTable& value) const; bool getArray(const std::string& name, Array& value) const; bool getFloat(const std::string& name, float& value) const; bool getDouble(const std::string& name, double& value) const; -// void getDecimal(string& name, xxx& value); + //bool getTimestamp(const std::string& name, uint64_t& value) const; + //bool getDecimal(string& name, xxx& value); void erase(const std::string& name); |
