comparison OrthancServer/Search/ListConstraint.cpp @ 1754:3a4f7dc00f49 db-changes

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Oct 2015 11:31:58 +0100
parents 99f4a05f39fa
children 03b030680e3d
comparison
equal deleted inserted replaced
1753:faf2ecab3472 1754:3a4f7dc00f49
38 { 38 {
39 void ListConstraint::AddAllowedValue(const std::string& value) 39 void ListConstraint::AddAllowedValue(const std::string& value)
40 { 40 {
41 if (isCaseSensitive_) 41 if (isCaseSensitive_)
42 { 42 {
43 allowedValues_.insert(value);
44 }
45 else
46 {
43 std::string s = value; 47 std::string s = value;
44 Toolbox::ToUpperCase(s); 48 Toolbox::ToUpperCase(s);
45 allowedValues_.insert(s); 49 allowedValues_.insert(s);
46 }
47 else
48 {
49 allowedValues_.insert(value);
50 } 50 }
51 } 51 }
52 52
53 53
54 void ListConstraint::Setup(LookupIdentifierQuery& lookup) const 54 void ListConstraint::Setup(LookupIdentifierQuery& lookup) const
65 65
66 bool ListConstraint::Match(const std::string& value) const 66 bool ListConstraint::Match(const std::string& value) const
67 { 67 {
68 std::string v = value; 68 std::string v = value;
69 69
70 if (isCaseSensitive_) 70 if (!isCaseSensitive_)
71 { 71 {
72 Toolbox::ToUpperCase(v); 72 Toolbox::ToUpperCase(v);
73 } 73 }
74 74
75 return allowedValues_.find(v) != allowedValues_.end(); 75 return allowedValues_.find(v) != allowedValues_.end();