comparison OrthancServer/OrthancInitialization.cpp @ 690:2e67366aab83

case-insensitive matching of Application Entity Titles
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Feb 2014 15:54:46 +0100
parents 2d0a347e8cfc
children 4c1860179cc5
comparison
equal deleted inserted replaced
689:2d0a347e8cfc 690:2e67366aab83
463 connection.SetDistantManufacturer(manufacturer); 463 connection.SetDistantManufacturer(manufacturer);
464 connection.Open(); 464 connection.Open();
465 } 465 }
466 466
467 467
468 bool IsSameAETitle(const std::string& aet1,
469 const std::string& aet2)
470 {
471 if (GetGlobalBoolParameter("StrictAetComparison", false))
472 {
473 // Case-sensitive matching
474 return aet1 == aet2;
475 }
476 else
477 {
478 // Case-insensitive matching (default)
479 std::string tmp1, tmp2;
480 Toolbox::ToLowerCase(tmp1, aet1);
481 Toolbox::ToLowerCase(tmp2, aet2);
482 return tmp1 == tmp2;
483 }
484 }
485
486
468 bool LookupDicomModalityUsingAETitle(const std::string& aet, 487 bool LookupDicomModalityUsingAETitle(const std::string& aet,
469 std::string& symbolicName, 488 std::string& symbolicName,
470 std::string& address, 489 std::string& address,
471 int& port, 490 int& port,
472 ModalityManufacturer& manufacturer) 491 ModalityManufacturer& manufacturer)
480 try 499 try
481 { 500 {
482 std::string thisAet; 501 std::string thisAet;
483 GetDicomModalityUsingSymbolicName(*it, thisAet, address, port, manufacturer); 502 GetDicomModalityUsingSymbolicName(*it, thisAet, address, port, manufacturer);
484 503
485 if (aet == thisAet) 504 if (IsSameAETitle(aet, thisAet))
486 { 505 {
487 return true; 506 return true;
488 } 507 }
489 } 508 }
490 catch (OrthancException&) 509 catch (OrthancException&)