comparison OrthancCppClient/Instance.cpp @ 500:ec19da4a1fe7 laaw

fix api
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Jul 2013 22:31:22 +0200
parents 7f7a2d174acb
children 50d9660f960c
comparison
equal deleted inserted replaced
498:ddeae3c3a8c2 500:ec19da4a1fe7
94 { 94 {
95 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); 95 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
96 } 96 }
97 } 97 }
98 98
99 std::string Instance::GetTagAsString(const char* tag) 99 const char* Instance::GetTagAsString(const char* tag) const
100 { 100 {
101 if (tags_.isMember(tag)) 101 if (tags_.isMember(tag))
102 { 102 {
103 return tags_[tag].asString(); 103 return tags_[tag].asCString();
104 } 104 }
105 else 105 else
106 { 106 {
107 throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentItem); 107 throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentItem);
108 } 108 }
109 } 109 }
110 110
111 float Instance::GetTagAsFloat(const char* tag) 111 float Instance::GetTagAsFloat(const char* tag) const
112 { 112 {
113 std::string value = GetTagAsString(tag); 113 std::string value = GetTagAsString(tag);
114 114
115 try 115 try
116 { 116 {
120 { 120 {
121 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); 121 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
122 } 122 }
123 } 123 }
124 124
125 int Instance::GetTagAsInt(const char* tag) 125 int Instance::GetTagAsInt(const char* tag) const
126 { 126 {
127 std::string value = GetTagAsString(tag); 127 std::string value = GetTagAsString(tag);
128 128
129 try 129 try
130 { 130 {