Changeset 1430
- Timestamp:
- 07/07/05 12:30:45 (4 years ago)
- Files:
-
- hydranode/modules/ed2k/tag.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
hydranode/modules/ed2k/tag.cpp
r1428 r1430 152 152 153 153 std::string Tag::dump(bool data) const { 154 using Utils::hexDump; 155 using boost::any_cast; 156 154 157 boost::format fmt("type=%1% %2%=%3% valueType=%4% value=%5%"); 155 using Utils::hexDump; 158 156 159 fmt % hexDump(m_valueType) % (m_opcode ? "opcode" : "name"); 157 160 fmt % (m_opcode ? hexDump(m_opcode) : m_name) % hexDump(m_valueType); … … 160 163 case TT_UINT8: 161 164 case TT_UINT16: 162 case TT_UINT32: 163 fmt % getInt(); 165 case TT_UINT32: 166 try { 167 fmt % any_cast<uint32_t>(m_value); 168 } catch (boost::bad_any_cast&) { 169 fmt % "<unknown value>"; 170 } 164 171 break; 165 172 case TT_FLOAT: 166 fmt % getFloat(); 173 try { 174 fmt % any_cast<float>(m_value); 175 } catch (boost::bad_any_cast&) { 176 fmt % "<unknown value>"; 177 } 167 178 break; 168 179 case TT_STRING: 169 fmt % Utils::hexDump(getStr()); 180 try { 181 fmt % hexDump( 182 any_cast<std::string>(m_value) 183 ); 184 } catch (...) { 185 fmt % "<unknown value>"; 186 } 170 187 break; 171 188 default:
