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