comparison OrthancServer/Sources/Search/DatabaseLookup.cpp @ 5244:72dfa0ac84eb db-protobuf

lookup for labels in orthanc explorer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 Apr 2023 16:55:55 +0200
parents df39c7583a49
children a7d95f951f8a
comparison
equal deleted inserted replaced
5243:f00811d14348 5244:72dfa0ac84eb
370 } 370 }
371 371
372 372
373 void DatabaseLookup::AddWithLabel(const std::string& label) 373 void DatabaseLookup::AddWithLabel(const std::string& label)
374 { 374 {
375 if (label.empty()) 375 if (!label.empty())
376 { 376 {
377 throw OrthancException(ErrorCode_ParameterOutOfRange); 377 ServerToolbox::CheckValidLabel(label);
378 }
379 else
380 {
381 withLabels_.insert(label); 378 withLabels_.insert(label);
382 } 379 }
383 } 380 }
384 381
385 382
386 void DatabaseLookup::AddWithoutLabel(const std::string& label) 383 void DatabaseLookup::AddWithoutLabel(const std::string& label)
387 { 384 {
388 if (label.empty()) 385 if (!label.empty())
389 { 386 {
390 throw OrthancException(ErrorCode_ParameterOutOfRange); 387 ServerToolbox::CheckValidLabel(label);
391 }
392 else
393 {
394 withoutLabels_.insert(label); 388 withoutLabels_.insert(label);
395 } 389 }
396 } 390 }
397 } 391 }