Mercurial > hg > svcore
comparison base/PropertyContainer.cpp @ 843:e802e550a1f2
Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 13:35:08 +0000 |
parents | 1424aa29ae95 |
children | f5cd33909744 |
comparison
equal
deleted
inserted
replaced
842:23d3a6eca5c3 | 843:e802e550a1f2 |
---|---|
66 } | 66 } |
67 | 67 |
68 void | 68 void |
69 PropertyContainer::setProperty(const PropertyName &name, int) | 69 PropertyContainer::setProperty(const PropertyName &name, int) |
70 { | 70 { |
71 std::cerr << "WARNING: PropertyContainer[" << getPropertyContainerName() << "]::setProperty(" << name << "): no implementation in subclass!" << std::endl; | 71 cerr << "WARNING: PropertyContainer[" << getPropertyContainerName() << "]::setProperty(" << name << "): no implementation in subclass!" << endl; |
72 } | 72 } |
73 | 73 |
74 Command * | 74 Command * |
75 PropertyContainer::getSetPropertyCommand(const PropertyName &name, int value) | 75 PropertyContainer::getSetPropertyCommand(const PropertyName &name, int value) |
76 { | 76 { |
83 PropertyContainer::setPropertyFuzzy(QString nameString, QString valueString) | 83 PropertyContainer::setPropertyFuzzy(QString nameString, QString valueString) |
84 { | 84 { |
85 PropertyName name; | 85 PropertyName name; |
86 int value; | 86 int value; |
87 if (!convertPropertyStrings(nameString, valueString, name, value)) { | 87 if (!convertPropertyStrings(nameString, valueString, name, value)) { |
88 std::cerr << "WARNING: PropertyContainer::setProperty(\"" | 88 cerr << "WARNING: PropertyContainer::setProperty(\"" |
89 << nameString << "\", \"" | 89 << nameString << "\", \"" |
90 << valueString.toStdString() | 90 << valueString.toStdString() |
91 << "\"): Name and value conversion failed" << std::endl; | 91 << "\"): Name and value conversion failed" << endl; |
92 return; | 92 return; |
93 } | 93 } |
94 setProperty(name, value); | 94 setProperty(name, value); |
95 } | 95 } |
96 | 96 |
98 PropertyContainer::getSetPropertyCommand(QString nameString, QString valueString) | 98 PropertyContainer::getSetPropertyCommand(QString nameString, QString valueString) |
99 { | 99 { |
100 PropertyName name; | 100 PropertyName name; |
101 int value; | 101 int value; |
102 if (!convertPropertyStrings(nameString, valueString, name, value)) { | 102 if (!convertPropertyStrings(nameString, valueString, name, value)) { |
103 std::cerr << "WARNING: PropertyContainer::getSetPropertyCommand(\"" | 103 cerr << "WARNING: PropertyContainer::getSetPropertyCommand(\"" |
104 << nameString << "\", \"" | 104 << nameString << "\", \"" |
105 << valueString.toStdString() | 105 << valueString.toStdString() |
106 << "\"): Name and value conversion failed" << std::endl; | 106 << "\"): Name and value conversion failed" << endl; |
107 return 0; | 107 return 0; |
108 } | 108 } |
109 return getSetPropertyCommand(name, value); | 109 return getSetPropertyCommand(name, value); |
110 } | 110 } |
111 | 111 |
133 break; | 133 break; |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 if (name == "") { | 137 if (name == "") { |
138 std::cerr << "PropertyContainer::convertPropertyStrings: Unable to match name string \"" << nameString << "\"" << std::endl; | 138 cerr << "PropertyContainer::convertPropertyStrings: Unable to match name string \"" << nameString << "\"" << endl; |
139 return false; | 139 return false; |
140 } | 140 } |
141 | 141 |
142 value = 0; | 142 value = 0; |
143 bool success = false; | 143 bool success = false; |
202 getPropertyRangeAndValue(name, &min, &max, 0); | 202 getPropertyRangeAndValue(name, &min, &max, 0); |
203 | 203 |
204 bool ok = false; | 204 bool ok = false; |
205 int i = valueString.toInt(&ok); | 205 int i = valueString.toInt(&ok); |
206 if (!ok) { | 206 if (!ok) { |
207 std::cerr << "PropertyContainer::convertPropertyStrings: Unable to parse value string \"" << valueString << "\"" << std::endl; | 207 cerr << "PropertyContainer::convertPropertyStrings: Unable to parse value string \"" << valueString << "\"" << endl; |
208 return false; | 208 return false; |
209 } else if (i < min || i > max) { | 209 } else if (i < min || i > max) { |
210 SVDEBUG << "PropertyContainer::convertPropertyStrings: Property value \"" << i << "\" outside valid range " << min << " to " << max << endl; | 210 SVDEBUG << "PropertyContainer::convertPropertyStrings: Property value \"" << i << "\" outside valid range " << min << " to " << max << endl; |
211 return false; | 211 return false; |
212 } | 212 } |