| 139 | } |
| 140 | |
| 141 | const char * Look::getInterchangeAttribute(const char* attrName) const |
| 142 | { |
| 143 | std::string name = attrName ? attrName : ""; |
| 144 | |
| 145 | for (auto& key : knownInterchangeNames) |
| 146 | { |
| 147 | // do case-insensitive comparison. |
| 148 | if (StringUtils::Compare(key, name)) |
| 149 | { |
| 150 | auto it = m_impl->m_interchangeAttribs.find(key); |
| 151 | if (it != m_impl->m_interchangeAttribs.end()) |
| 152 | { |
| 153 | return it->second.c_str(); |
| 154 | } |
| 155 | return ""; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | std::ostringstream oss; |
| 160 | oss << "Unknown attribute name '" << name << "'."; |
| 161 | throw Exception(oss.str().c_str()); |
| 162 | } |
| 163 | |
| 164 | void Look::setInterchangeAttribute(const char* attrName, const char* value) |
| 165 | { |