| 235 | | /*********************************** Non-ptr code ********************************/ |
|---|
| 236 | | void StringAttributeMapBase::pushToKeys(const std::string& value) |
|---|
| 237 | | { |
|---|
| 238 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 239 | | _mfKeys.push_back(value); |
|---|
| 240 | | } |
|---|
| 241 | | |
|---|
| 242 | | void StringAttributeMapBase::insertIntoKeys(UInt32 uiIndex, |
|---|
| 243 | | const std::string& value ) |
|---|
| 244 | | { |
|---|
| 245 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 246 | | |
|---|
| 247 | | MFString::iterator fieldIt = _mfKeys.begin(); |
|---|
| 248 | | |
|---|
| 249 | | fieldIt += uiIndex; |
|---|
| 250 | | |
|---|
| 251 | | _mfKeys.insert(fieldIt, value); |
|---|
| 252 | | } |
|---|
| 253 | | |
|---|
| 254 | | void StringAttributeMapBase::replaceInKeys(UInt32 uiIndex, |
|---|
| 255 | | const std::string& value ) |
|---|
| 256 | | { |
|---|
| 257 | | if(uiIndex >= _mfKeys.size()) |
|---|
| 258 | | return; |
|---|
| 259 | | |
|---|
| 260 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 261 | | |
|---|
| 262 | | _mfKeys[uiIndex] = value; |
|---|
| 263 | | } |
|---|
| 264 | | |
|---|
| 265 | | void StringAttributeMapBase::replaceInKeys(const std::string& pOldElem, |
|---|
| 266 | | const std::string& pNewElem) |
|---|
| 267 | | { |
|---|
| 268 | | Int32 elemIdx = _mfKeys.findIndex(pOldElem); |
|---|
| 269 | | |
|---|
| 270 | | if(elemIdx != -1) |
|---|
| 271 | | { |
|---|
| 272 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 273 | | |
|---|
| 274 | | MFString::iterator fieldIt = _mfKeys.begin(); |
|---|
| 275 | | |
|---|
| 276 | | fieldIt += elemIdx; |
|---|
| 277 | | |
|---|
| 278 | | (*fieldIt) = pNewElem; |
|---|
| 279 | | } |
|---|
| 280 | | } |
|---|
| 281 | | |
|---|
| 282 | | void StringAttributeMapBase::removeFromKeys(UInt32 uiIndex) |
|---|
| 283 | | { |
|---|
| 284 | | if(uiIndex < _mfKeys.size()) |
|---|
| 285 | | { |
|---|
| 286 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 287 | | |
|---|
| 288 | | MFString::iterator fieldIt = _mfKeys.begin(); |
|---|
| 289 | | |
|---|
| 290 | | fieldIt += uiIndex; |
|---|
| 291 | | _mfKeys.erase(fieldIt); |
|---|
| 292 | | } |
|---|
| 293 | | } |
|---|
| 294 | | |
|---|
| 295 | | void StringAttributeMapBase::removeFromKeys(const std::string& value) |
|---|
| 296 | | { |
|---|
| 297 | | Int32 iElemIdx = _mfKeys.findIndex(value); |
|---|
| 298 | | |
|---|
| 299 | | if(iElemIdx != -1) |
|---|
| 300 | | { |
|---|
| 301 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 302 | | |
|---|
| 303 | | MFString::iterator fieldIt = _mfKeys.begin(); |
|---|
| 304 | | |
|---|
| 305 | | fieldIt += iElemIdx; |
|---|
| 306 | | |
|---|
| 307 | | _mfKeys.erase(fieldIt); |
|---|
| 308 | | } |
|---|
| 309 | | } |
|---|
| 310 | | |
|---|
| 311 | | void StringAttributeMapBase::clearKeys(void) |
|---|
| 312 | | { |
|---|
| 313 | | editMField(KeysFieldMask, _mfKeys); |
|---|
| 314 | | |
|---|
| 315 | | _mfKeys.clear(); |
|---|
| 316 | | } |
|---|
| 317 | | /*********************************** Non-ptr code ********************************/ |
|---|
| 318 | | void StringAttributeMapBase::pushToValues(const std::string& value) |
|---|
| 319 | | { |
|---|
| 320 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 321 | | _mfValues.push_back(value); |
|---|
| 322 | | } |
|---|
| 323 | | |
|---|
| 324 | | void StringAttributeMapBase::insertIntoValues(UInt32 uiIndex, |
|---|
| 325 | | const std::string& value ) |
|---|
| 326 | | { |
|---|
| 327 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 328 | | |
|---|
| 329 | | MFString::iterator fieldIt = _mfValues.begin(); |
|---|
| 330 | | |
|---|
| 331 | | fieldIt += uiIndex; |
|---|
| 332 | | |
|---|
| 333 | | _mfValues.insert(fieldIt, value); |
|---|
| 334 | | } |
|---|
| 335 | | |
|---|
| 336 | | void StringAttributeMapBase::replaceInValues(UInt32 uiIndex, |
|---|
| 337 | | const std::string& value ) |
|---|
| 338 | | { |
|---|
| 339 | | if(uiIndex >= _mfValues.size()) |
|---|
| 340 | | return; |
|---|
| 341 | | |
|---|
| 342 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 343 | | |
|---|
| 344 | | _mfValues[uiIndex] = value; |
|---|
| 345 | | } |
|---|
| 346 | | |
|---|
| 347 | | void StringAttributeMapBase::replaceInValues(const std::string& pOldElem, |
|---|
| 348 | | const std::string& pNewElem) |
|---|
| 349 | | { |
|---|
| 350 | | Int32 elemIdx = _mfValues.findIndex(pOldElem); |
|---|
| 351 | | |
|---|
| 352 | | if(elemIdx != -1) |
|---|
| 353 | | { |
|---|
| 354 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 355 | | |
|---|
| 356 | | MFString::iterator fieldIt = _mfValues.begin(); |
|---|
| 357 | | |
|---|
| 358 | | fieldIt += elemIdx; |
|---|
| 359 | | |
|---|
| 360 | | (*fieldIt) = pNewElem; |
|---|
| 361 | | } |
|---|
| 362 | | } |
|---|
| 363 | | |
|---|
| 364 | | void StringAttributeMapBase::removeFromValues(UInt32 uiIndex) |
|---|
| 365 | | { |
|---|
| 366 | | if(uiIndex < _mfValues.size()) |
|---|
| 367 | | { |
|---|
| 368 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 369 | | |
|---|
| 370 | | MFString::iterator fieldIt = _mfValues.begin(); |
|---|
| 371 | | |
|---|
| 372 | | fieldIt += uiIndex; |
|---|
| 373 | | _mfValues.erase(fieldIt); |
|---|
| 374 | | } |
|---|
| 375 | | } |
|---|
| 376 | | |
|---|
| 377 | | void StringAttributeMapBase::removeFromValues(const std::string& value) |
|---|
| 378 | | { |
|---|
| 379 | | Int32 iElemIdx = _mfValues.findIndex(value); |
|---|
| 380 | | |
|---|
| 381 | | if(iElemIdx != -1) |
|---|
| 382 | | { |
|---|
| 383 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 384 | | |
|---|
| 385 | | MFString::iterator fieldIt = _mfValues.begin(); |
|---|
| 386 | | |
|---|
| 387 | | fieldIt += iElemIdx; |
|---|
| 388 | | |
|---|
| 389 | | _mfValues.erase(fieldIt); |
|---|
| 390 | | } |
|---|
| 391 | | } |
|---|
| 392 | | |
|---|
| 393 | | void StringAttributeMapBase::clearValues(void) |
|---|
| 394 | | { |
|---|
| 395 | | editMField(ValuesFieldMask, _mfValues); |
|---|
| 396 | | |
|---|
| 397 | | _mfValues.clear(); |
|---|
| 398 | | } |
|---|