comparison Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 2268:ce5c13b95dac

New function: OrthancPluginRegisterIncomingHttpRequestFilter2()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 Feb 2017 21:49:16 +0100
parents f915aff7a866
children 878b59270859
comparison
equal deleted inserted replaced
2267:f915aff7a866 2268:ce5c13b95dac
1124 ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(error); 1124 ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(error);
1125 } 1125 }
1126 } 1126 }
1127 1127
1128 1128
1129 static void ReportIncompatibleVersion(OrthancPluginContext* context, 1129 void ReportMinimalOrthancVersion(OrthancPluginContext* context,
1130 unsigned int major, 1130 unsigned int major,
1131 unsigned int minor, 1131 unsigned int minor,
1132 unsigned int revision) 1132 unsigned int revision)
1133 { 1133 {
1134 std::string s = ("Your version of the Orthanc core (" + 1134 std::string s = ("Your version of the Orthanc core (" +
1135 std::string(context->orthancVersion) + 1135 std::string(context->orthancVersion) +
1136 ") is too old to run this plugin (" + 1136 ") is too old to run this plugin (version " +
1137 boost::lexical_cast<std::string>(major) + "." + 1137 boost::lexical_cast<std::string>(major) + "." +
1138 boost::lexical_cast<std::string>(minor) + "." + 1138 boost::lexical_cast<std::string>(minor) + "." +
1139 boost::lexical_cast<std::string>(revision) + 1139 boost::lexical_cast<std::string>(revision) +
1140 " is required)"); 1140 " is required)");
1141 1141
1187 return true; 1187 return true;
1188 } 1188 }
1189 1189
1190 if (a < major) 1190 if (a < major)
1191 { 1191 {
1192 ReportIncompatibleVersion(context, major, minor, revision);
1193 return false; 1192 return false;
1194 } 1193 }
1195 1194
1196 1195
1197 // Check the minor version number 1196 // Check the minor version number
1202 return true; 1201 return true;
1203 } 1202 }
1204 1203
1205 if (b < minor) 1204 if (b < minor)
1206 { 1205 {
1207 ReportIncompatibleVersion(context, major, minor, revision);
1208 return false; 1206 return false;
1209 } 1207 }
1210 1208
1211 // Check the patch level version number 1209 // Check the patch level version number
1212 assert(a == major && b == minor); 1210 assert(a == major && b == minor);
1215 { 1213 {
1216 return true; 1214 return true;
1217 } 1215 }
1218 else 1216 else
1219 { 1217 {
1220 ReportIncompatibleVersion(context, major, minor, revision);
1221 return false; 1218 return false;
1222 } 1219 }
1223 } 1220 }
1224 } 1221 }
1225 1222