aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llxml
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llxml')
-rw-r--r--linden/indra/llxml/CMakeLists.txt36
-rw-r--r--linden/indra/llxml/files.lst4
-rw-r--r--linden/indra/llxml/llcontrol.cpp158
-rw-r--r--linden/indra/llxml/llcontrol.h126
-rw-r--r--linden/indra/llxml/llxml.vcproj191
-rw-r--r--linden/indra/llxml/llxml_vc8.vcproj279
-rw-r--r--linden/indra/llxml/llxml_vc9.vcproj280
-rw-r--r--linden/indra/llxml/llxmlnode.cpp233
-rw-r--r--linden/indra/llxml/llxmlnode.h107
-rw-r--r--linden/indra/llxml/llxmlparser.cpp14
-rw-r--r--linden/indra/llxml/llxmlparser.h2
-rw-r--r--linden/indra/llxml/llxmltree.cpp94
-rw-r--r--linden/indra/llxml/llxmltree.h20
13 files changed, 419 insertions, 1125 deletions
diff --git a/linden/indra/llxml/CMakeLists.txt b/linden/indra/llxml/CMakeLists.txt
new file mode 100644
index 0000000..d86bc0d
--- /dev/null
+++ b/linden/indra/llxml/CMakeLists.txt
@@ -0,0 +1,36 @@
1# -*- cmake -*-
2
3project(llxml)
4
5include(00-Common)
6include(LLCommon)
7include(LLMath)
8include(LLXML)
9
10include_directories(
11 ${LLCOMMON_INCLUDE_DIRS}
12 ${LLMATH_INCLUDE_DIRS}
13 )
14
15set(llxml_SOURCE_FILES
16 llcontrol.cpp
17 llxmlnode.cpp
18 llxmlparser.cpp
19 llxmltree.cpp
20 )
21
22set(llxml_HEADER_FILES
23 CMakeLists.txt
24
25 llcontrol.h
26 llxmlnode.h
27 llxmlparser.h
28 llxmltree.h
29 )
30
31set_source_files_properties(${llxml_HEADER_FILES}
32 PROPERTIES HEADER_FILE_ONLY TRUE)
33
34list(APPEND llxml_SOURCE_FILES ${llxml_HEADER_FILES})
35
36add_library (llxml ${llxml_SOURCE_FILES})
diff --git a/linden/indra/llxml/files.lst b/linden/indra/llxml/files.lst
deleted file mode 100644
index 5fec309..0000000
--- a/linden/indra/llxml/files.lst
+++ /dev/null
@@ -1,4 +0,0 @@
1llxml/llcontrol.cpp
2llxml/llxmlnode.cpp
3llxml/llxmlparser.cpp
4llxml/llxmltree.cpp
diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp
index f88ac69..8fa58e8 100644
--- a/linden/indra/llxml/llcontrol.cpp
+++ b/linden/indra/llxml/llcontrol.cpp
@@ -49,7 +49,7 @@
49#include "llxmltree.h" 49#include "llxmltree.h"
50#include "llsdserialize.h" 50#include "llsdserialize.h"
51 51
52#if LL_RELEASE_FOR_DOWNLOAD 52#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG
53#define CONTROL_ERRS LL_WARNS("ControlErrors") 53#define CONTROL_ERRS LL_WARNS("ControlErrors")
54#else 54#else
55#define CONTROL_ERRS LL_ERRS("ControlErrors") 55#define CONTROL_ERRS LL_ERRS("ControlErrors")
@@ -99,8 +99,8 @@ bool LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b)
99 return result; 99 return result;
100} 100}
101 101
102LLControlVariable::LLControlVariable(const LLString& name, eControlType type, 102LLControlVariable::LLControlVariable(const std::string& name, eControlType type,
103 LLSD initial, const LLString& comment, 103 LLSD initial, const std::string& comment,
104 bool persist) 104 bool persist)
105 : mName(name), 105 : mName(name),
106 mComment(comment), 106 mComment(comment),
@@ -129,7 +129,7 @@ LLSD LLControlVariable::getComparableValue(const LLSD& value)
129 if(TYPE_BOOLEAN == type() && value.isString()) 129 if(TYPE_BOOLEAN == type() && value.isString())
130 { 130 {
131 BOOL temp; 131 BOOL temp;
132 if(LLString::convertToBOOL(value.asString(), temp)) 132 if(LLStringUtil::convertToBOOL(value.asString(), temp))
133 { 133 {
134 storable_value = (bool)temp; 134 storable_value = (bool)temp;
135 } 135 }
@@ -246,7 +246,7 @@ LLSD LLControlVariable::getSaveValue() const
246 return mValues[0]; 246 return mValues[0];
247} 247}
248 248
249LLPointer<LLControlVariable> LLControlGroup::getControl(const LLString& name) 249LLPointer<LLControlVariable> LLControlGroup::getControl(const std::string& name)
250{ 250{
251 ctrl_name_table_t::iterator iter = mNameTable.find(name); 251 ctrl_name_table_t::iterator iter = mNameTable.find(name);
252 return iter == mNameTable.end() ? LLPointer<LLControlVariable>() : iter->second; 252 return iter == mNameTable.end() ? LLPointer<LLControlVariable>() : iter->second;
@@ -281,7 +281,7 @@ void LLControlGroup::cleanup()
281 mNameTable.clear(); 281 mNameTable.clear();
282} 282}
283 283
284eControlType LLControlGroup::typeStringToEnum(const LLString& typestr) 284eControlType LLControlGroup::typeStringToEnum(const std::string& typestr)
285{ 285{
286 for(int i = 0; i < (int)TYPE_COUNT; ++i) 286 for(int i = 0; i < (int)TYPE_COUNT; ++i)
287 { 287 {
@@ -290,12 +290,12 @@ eControlType LLControlGroup::typeStringToEnum(const LLString& typestr)
290 return (eControlType)-1; 290 return (eControlType)-1;
291} 291}
292 292
293LLString LLControlGroup::typeEnumToString(eControlType typeenum) 293std::string LLControlGroup::typeEnumToString(eControlType typeenum)
294{ 294{
295 return mTypeString[typeenum]; 295 return mTypeString[typeenum];
296} 296}
297 297
298BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist) 298BOOL LLControlGroup::declareControl(const std::string& name, eControlType type, const LLSD initial_val, const std::string& comment, BOOL persist)
299{ 299{
300 if(mNameTable.find(name) != mNameTable.end()) 300 if(mNameTable.find(name) != mNameTable.end())
301 { 301 {
@@ -310,67 +310,67 @@ BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, con
310 return TRUE; 310 return TRUE;
311} 311}
312 312
313BOOL LLControlGroup::declareU32(const LLString& name, const U32 initial_val, const LLString& comment, BOOL persist) 313BOOL LLControlGroup::declareU32(const std::string& name, const U32 initial_val, const std::string& comment, BOOL persist)
314{ 314{
315 return declareControl(name, TYPE_U32, (LLSD::Integer) initial_val, comment, persist); 315 return declareControl(name, TYPE_U32, (LLSD::Integer) initial_val, comment, persist);
316} 316}
317 317
318BOOL LLControlGroup::declareS32(const LLString& name, const S32 initial_val, const LLString& comment, BOOL persist) 318BOOL LLControlGroup::declareS32(const std::string& name, const S32 initial_val, const std::string& comment, BOOL persist)
319{ 319{
320 return declareControl(name, TYPE_S32, initial_val, comment, persist); 320 return declareControl(name, TYPE_S32, initial_val, comment, persist);
321} 321}
322 322
323BOOL LLControlGroup::declareF32(const LLString& name, const F32 initial_val, const LLString& comment, BOOL persist) 323BOOL LLControlGroup::declareF32(const std::string& name, const F32 initial_val, const std::string& comment, BOOL persist)
324{ 324{
325 return declareControl(name, TYPE_F32, initial_val, comment, persist); 325 return declareControl(name, TYPE_F32, initial_val, comment, persist);
326} 326}
327 327
328BOOL LLControlGroup::declareBOOL(const LLString& name, const BOOL initial_val, const LLString& comment, BOOL persist) 328BOOL LLControlGroup::declareBOOL(const std::string& name, const BOOL initial_val, const std::string& comment, BOOL persist)
329{ 329{
330 return declareControl(name, TYPE_BOOLEAN, initial_val, comment, persist); 330 return declareControl(name, TYPE_BOOLEAN, initial_val, comment, persist);
331} 331}
332 332
333BOOL LLControlGroup::declareString(const LLString& name, const LLString& initial_val, const LLString& comment, BOOL persist) 333BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, BOOL persist)
334{ 334{
335 return declareControl(name, TYPE_STRING, initial_val, comment, persist); 335 return declareControl(name, TYPE_STRING, initial_val, comment, persist);
336} 336}
337 337
338BOOL LLControlGroup::declareVec3(const LLString& name, const LLVector3 &initial_val, const LLString& comment, BOOL persist) 338BOOL LLControlGroup::declareVec3(const std::string& name, const LLVector3 &initial_val, const std::string& comment, BOOL persist)
339{ 339{
340 return declareControl(name, TYPE_VEC3, initial_val.getValue(), comment, persist); 340 return declareControl(name, TYPE_VEC3, initial_val.getValue(), comment, persist);
341} 341}
342 342
343BOOL LLControlGroup::declareVec3d(const LLString& name, const LLVector3d &initial_val, const LLString& comment, BOOL persist) 343BOOL LLControlGroup::declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, BOOL persist)
344{ 344{
345 return declareControl(name, TYPE_VEC3D, initial_val.getValue(), comment, persist); 345 return declareControl(name, TYPE_VEC3D, initial_val.getValue(), comment, persist);
346} 346}
347 347
348BOOL LLControlGroup::declareRect(const LLString& name, const LLRect &initial_val, const LLString& comment, BOOL persist) 348BOOL LLControlGroup::declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, BOOL persist)
349{ 349{
350 return declareControl(name, TYPE_RECT, initial_val.getValue(), comment, persist); 350 return declareControl(name, TYPE_RECT, initial_val.getValue(), comment, persist);
351} 351}
352 352
353BOOL LLControlGroup::declareColor4U(const LLString& name, const LLColor4U &initial_val, const LLString& comment, BOOL persist ) 353BOOL LLControlGroup::declareColor4U(const std::string& name, const LLColor4U &initial_val, const std::string& comment, BOOL persist )
354{ 354{
355 return declareControl(name, TYPE_COL4U, initial_val.getValue(), comment, persist); 355 return declareControl(name, TYPE_COL4U, initial_val.getValue(), comment, persist);
356} 356}
357 357
358BOOL LLControlGroup::declareColor4(const LLString& name, const LLColor4 &initial_val, const LLString& comment, BOOL persist ) 358BOOL LLControlGroup::declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist )
359{ 359{
360 return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, persist); 360 return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, persist);
361} 361}
362 362
363BOOL LLControlGroup::declareColor3(const LLString& name, const LLColor3 &initial_val, const LLString& comment, BOOL persist ) 363BOOL LLControlGroup::declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist )
364{ 364{
365 return declareControl(name, TYPE_COL3, initial_val.getValue(), comment, persist); 365 return declareControl(name, TYPE_COL3, initial_val.getValue(), comment, persist);
366} 366}
367 367
368BOOL LLControlGroup::declareLLSD(const LLString& name, const LLSD &initial_val, const LLString& comment, BOOL persist ) 368BOOL LLControlGroup::declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, BOOL persist )
369{ 369{
370 return declareControl(name, TYPE_LLSD, initial_val, comment, persist); 370 return declareControl(name, TYPE_LLSD, initial_val, comment, persist);
371} 371}
372 372
373BOOL LLControlGroup::getBOOL(const LLString& name) 373BOOL LLControlGroup::getBOOL(const std::string& name)
374{ 374{
375 LLControlVariable* control = getControl(name); 375 LLControlVariable* control = getControl(name);
376 376
@@ -383,7 +383,7 @@ BOOL LLControlGroup::getBOOL(const LLString& name)
383 } 383 }
384} 384}
385 385
386S32 LLControlGroup::getS32(const LLString& name) 386S32 LLControlGroup::getS32(const std::string& name)
387{ 387{
388 LLControlVariable* control = getControl(name); 388 LLControlVariable* control = getControl(name);
389 389
@@ -396,7 +396,7 @@ S32 LLControlGroup::getS32(const LLString& name)
396 } 396 }
397} 397}
398 398
399U32 LLControlGroup::getU32(const LLString& name) 399U32 LLControlGroup::getU32(const std::string& name)
400{ 400{
401 LLControlVariable* control = getControl(name); 401 LLControlVariable* control = getControl(name);
402 402
@@ -409,7 +409,7 @@ U32 LLControlGroup::getU32(const LLString& name)
409 } 409 }
410} 410}
411 411
412F32 LLControlGroup::getF32(const LLString& name) 412F32 LLControlGroup::getF32(const std::string& name)
413{ 413{
414 LLControlVariable* control = getControl(name); 414 LLControlVariable* control = getControl(name);
415 415
@@ -422,16 +422,16 @@ F32 LLControlGroup::getF32(const LLString& name)
422 } 422 }
423} 423}
424 424
425LLString LLControlGroup::findString(const LLString& name) 425std::string LLControlGroup::findString(const std::string& name)
426{ 426{
427 LLControlVariable* control = getControl(name); 427 LLControlVariable* control = getControl(name);
428 428
429 if (control && control->isType(TYPE_STRING)) 429 if (control && control->isType(TYPE_STRING))
430 return control->get().asString(); 430 return control->get().asString();
431 return LLString::null; 431 return LLStringUtil::null;
432} 432}
433 433
434LLString LLControlGroup::getString(const LLString& name) 434std::string LLControlGroup::getString(const std::string& name)
435{ 435{
436 LLControlVariable* control = getControl(name); 436 LLControlVariable* control = getControl(name);
437 437
@@ -440,24 +440,24 @@ LLString LLControlGroup::getString(const LLString& name)
440 else 440 else
441 { 441 {
442 CONTROL_ERRS << "Invalid string control " << name << llendl; 442 CONTROL_ERRS << "Invalid string control " << name << llendl;
443 return LLString::null; 443 return LLStringUtil::null;
444 } 444 }
445} 445}
446 446
447LLWString LLControlGroup::getWString(const LLString& name) 447LLWString LLControlGroup::getWString(const std::string& name)
448{ 448{
449 return utf8str_to_wstring(getString(name)); 449 return utf8str_to_wstring(getString(name));
450} 450}
451 451
452LLString LLControlGroup::getText(const LLString& name) 452std::string LLControlGroup::getText(const std::string& name)
453{ 453{
454 LLString utf8_string = getString(name); 454 std::string utf8_string = getString(name);
455 LLString::replaceChar(utf8_string, '^', '\n'); 455 LLStringUtil::replaceChar(utf8_string, '^', '\n');
456 LLString::replaceChar(utf8_string, '%', ' '); 456 LLStringUtil::replaceChar(utf8_string, '%', ' ');
457 return (utf8_string); 457 return (utf8_string);
458} 458}
459 459
460LLVector3 LLControlGroup::getVector3(const LLString& name) 460LLVector3 LLControlGroup::getVector3(const std::string& name)
461{ 461{
462 LLControlVariable* control = getControl(name); 462 LLControlVariable* control = getControl(name);
463 463
@@ -470,7 +470,7 @@ LLVector3 LLControlGroup::getVector3(const LLString& name)
470 } 470 }
471} 471}
472 472
473LLVector3d LLControlGroup::getVector3d(const LLString& name) 473LLVector3d LLControlGroup::getVector3d(const std::string& name)
474{ 474{
475 LLControlVariable* control = getControl(name); 475 LLControlVariable* control = getControl(name);
476 476
@@ -483,7 +483,7 @@ LLVector3d LLControlGroup::getVector3d(const LLString& name)
483 } 483 }
484} 484}
485 485
486LLRect LLControlGroup::getRect(const LLString& name) 486LLRect LLControlGroup::getRect(const std::string& name)
487{ 487{
488 LLControlVariable* control = getControl(name); 488 LLControlVariable* control = getControl(name);
489 489
@@ -497,7 +497,7 @@ LLRect LLControlGroup::getRect(const LLString& name)
497} 497}
498 498
499 499
500LLColor4 LLControlGroup::getColor(const LLString& name) 500LLColor4 LLControlGroup::getColor(const std::string& name)
501{ 501{
502 ctrl_name_table_t::const_iterator i = mNameTable.find(name); 502 ctrl_name_table_t::const_iterator i = mNameTable.find(name);
503 503
@@ -529,7 +529,7 @@ LLColor4 LLControlGroup::getColor(const LLString& name)
529 } 529 }
530} 530}
531 531
532LLColor4U LLControlGroup::getColor4U(const LLString& name) 532LLColor4U LLControlGroup::getColor4U(const std::string& name)
533{ 533{
534 LLControlVariable* control = getControl(name); 534 LLControlVariable* control = getControl(name);
535 535
@@ -542,7 +542,7 @@ LLColor4U LLControlGroup::getColor4U(const LLString& name)
542 } 542 }
543} 543}
544 544
545LLColor4 LLControlGroup::getColor4(const LLString& name) 545LLColor4 LLControlGroup::getColor4(const std::string& name)
546{ 546{
547 LLControlVariable* control = getControl(name); 547 LLControlVariable* control = getControl(name);
548 548
@@ -555,7 +555,7 @@ LLColor4 LLControlGroup::getColor4(const LLString& name)
555 } 555 }
556} 556}
557 557
558LLColor3 LLControlGroup::getColor3(const LLString& name) 558LLColor3 LLControlGroup::getColor3(const std::string& name)
559{ 559{
560 LLControlVariable* control = getControl(name); 560 LLControlVariable* control = getControl(name);
561 561
@@ -568,7 +568,7 @@ LLColor3 LLControlGroup::getColor3(const LLString& name)
568 } 568 }
569} 569}
570 570
571LLSD LLControlGroup::getLLSD(const LLString& name) 571LLSD LLControlGroup::getLLSD(const std::string& name)
572{ 572{
573 LLControlVariable* control = getControl(name); 573 LLControlVariable* control = getControl(name);
574 574
@@ -578,7 +578,7 @@ LLSD LLControlGroup::getLLSD(const LLString& name)
578 return LLSD(); 578 return LLSD();
579} 579}
580 580
581BOOL LLControlGroup::controlExists(const LLString& name) 581BOOL LLControlGroup::controlExists(const std::string& name)
582{ 582{
583 ctrl_name_table_t::iterator iter = mNameTable.find(name); 583 ctrl_name_table_t::iterator iter = mNameTable.find(name);
584 return iter != mNameTable.end(); 584 return iter != mNameTable.end();
@@ -588,7 +588,7 @@ BOOL LLControlGroup::controlExists(const LLString& name)
588// Set functions 588// Set functions
589//------------------------------------------------------------------- 589//-------------------------------------------------------------------
590 590
591void LLControlGroup::setBOOL(const LLString& name, BOOL val) 591void LLControlGroup::setBOOL(const std::string& name, BOOL val)
592{ 592{
593 LLControlVariable* control = getControl(name); 593 LLControlVariable* control = getControl(name);
594 594
@@ -603,7 +603,7 @@ void LLControlGroup::setBOOL(const LLString& name, BOOL val)
603} 603}
604 604
605 605
606void LLControlGroup::setS32(const LLString& name, S32 val) 606void LLControlGroup::setS32(const std::string& name, S32 val)
607{ 607{
608 LLControlVariable* control = getControl(name); 608 LLControlVariable* control = getControl(name);
609 609
@@ -618,7 +618,7 @@ void LLControlGroup::setS32(const LLString& name, S32 val)
618} 618}
619 619
620 620
621void LLControlGroup::setF32(const LLString& name, F32 val) 621void LLControlGroup::setF32(const std::string& name, F32 val)
622{ 622{
623 LLControlVariable* control = getControl(name); 623 LLControlVariable* control = getControl(name);
624 624
@@ -633,7 +633,7 @@ void LLControlGroup::setF32(const LLString& name, F32 val)
633} 633}
634 634
635 635
636void LLControlGroup::setU32(const LLString& name, U32 val) 636void LLControlGroup::setU32(const std::string& name, U32 val)
637{ 637{
638 LLControlVariable* control = getControl(name); 638 LLControlVariable* control = getControl(name);
639 639
@@ -648,7 +648,7 @@ void LLControlGroup::setU32(const LLString& name, U32 val)
648} 648}
649 649
650 650
651void LLControlGroup::setString(const LLString& name, const LLString &val) 651void LLControlGroup::setString(const std::string& name, const std::string &val)
652{ 652{
653 LLControlVariable* control = getControl(name); 653 LLControlVariable* control = getControl(name);
654 654
@@ -663,7 +663,7 @@ void LLControlGroup::setString(const LLString& name, const LLString &val)
663} 663}
664 664
665 665
666void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val) 666void LLControlGroup::setVector3(const std::string& name, const LLVector3 &val)
667{ 667{
668 LLControlVariable* control = getControl(name); 668 LLControlVariable* control = getControl(name);
669 669
@@ -677,7 +677,7 @@ void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val)
677 } 677 }
678} 678}
679 679
680void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val) 680void LLControlGroup::setVector3d(const std::string& name, const LLVector3d &val)
681{ 681{
682 LLControlVariable* control = getControl(name); 682 LLControlVariable* control = getControl(name);
683 683
@@ -691,7 +691,7 @@ void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val)
691 } 691 }
692} 692}
693 693
694void LLControlGroup::setRect(const LLString& name, const LLRect &val) 694void LLControlGroup::setRect(const std::string& name, const LLRect &val)
695{ 695{
696 LLControlVariable* control = getControl(name); 696 LLControlVariable* control = getControl(name);
697 697
@@ -705,7 +705,7 @@ void LLControlGroup::setRect(const LLString& name, const LLRect &val)
705 } 705 }
706} 706}
707 707
708void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val) 708void LLControlGroup::setColor4U(const std::string& name, const LLColor4U &val)
709{ 709{
710 LLControlVariable* control = getControl(name); 710 LLControlVariable* control = getControl(name);
711 711
@@ -719,7 +719,7 @@ void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val)
719 } 719 }
720} 720}
721 721
722void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val) 722void LLControlGroup::setColor4(const std::string& name, const LLColor4 &val)
723{ 723{
724 LLControlVariable* control = getControl(name); 724 LLControlVariable* control = getControl(name);
725 725
@@ -733,7 +733,7 @@ void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val)
733 } 733 }
734} 734}
735 735
736void LLControlGroup::setLLSD(const LLString& name, const LLSD& val) 736void LLControlGroup::setLLSD(const std::string& name, const LLSD& val)
737{ 737{
738 LLControlVariable* control = getControl(name); 738 LLControlVariable* control = getControl(name);
739 739
@@ -747,7 +747,7 @@ void LLControlGroup::setLLSD(const LLString& name, const LLSD& val)
747 } 747 }
748} 748}
749 749
750void LLControlGroup::setValue(const LLString& name, const LLSD& val) 750void LLControlGroup::setValue(const std::string& name, const LLSD& val)
751{ 751{
752 if (name.empty()) 752 if (name.empty())
753 { 753 {
@@ -771,9 +771,9 @@ void LLControlGroup::setValue(const LLString& name, const LLSD& val)
771//--------------------------------------------------------------- 771//---------------------------------------------------------------
772 772
773// Returns number of controls loaded, so 0 if failure 773// Returns number of controls loaded, so 0 if failure
774U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_declaration, eControlType declare_as) 774U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require_declaration, eControlType declare_as)
775{ 775{
776 LLString name; 776 std::string name;
777 777
778 LLXmlTree xml_controls; 778 LLXmlTree xml_controls;
779 779
@@ -832,14 +832,14 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
832 switch(declare_as) 832 switch(declare_as)
833 { 833 {
834 case TYPE_COL4: 834 case TYPE_COL4:
835 declareColor4(name, LLColor4::white, "", NO_PERSIST); 835 declareColor4(name, LLColor4::white, LLStringUtil::null, NO_PERSIST);
836 break; 836 break;
837 case TYPE_COL4U: 837 case TYPE_COL4U:
838 declareColor4U(name, LLColor4U::white, "", NO_PERSIST); 838 declareColor4U(name, LLColor4U::white, LLStringUtil::null, NO_PERSIST);
839 break; 839 break;
840 case TYPE_STRING: 840 case TYPE_STRING:
841 default: 841 default:
842 declareString(name, LLString::null, "", NO_PERSIST); 842 declareString(name, LLStringUtil::null, LLStringUtil::null, NO_PERSIST);
843 break; 843 break;
844 } 844 }
845 } 845 }
@@ -891,12 +891,8 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
891 break; 891 break;
892 case TYPE_STRING: 892 case TYPE_STRING:
893 { 893 {
894 LLString string; 894 std::string string;
895 child_nodep->getAttributeString("value", string); 895 child_nodep->getAttributeString("value", string);
896 if (string == LLString::null)
897 {
898 string = "";
899 }
900 control->set(string); 896 control->set(string);
901 validitems++; 897 validitems++;
902 } 898 }
@@ -923,7 +919,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
923 case TYPE_RECT: 919 case TYPE_RECT:
924 { 920 {
925 //RN: hack to support reading rectangles from a string 921 //RN: hack to support reading rectangles from a string
926 LLString rect_string; 922 std::string rect_string;
927 923
928 child_nodep->getAttributeString("value", rect_string); 924 child_nodep->getAttributeString("value", rect_string);
929 std::istringstream istream(rect_string); 925 std::istringstream istream(rect_string);
@@ -977,7 +973,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
977 return validitems; 973 return validitems;
978} 974}
979 975
980U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only) 976U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only)
981{ 977{
982 LLSD settings; 978 LLSD settings;
983 int num_saved = 0; 979 int num_saved = 0;
@@ -1007,7 +1003,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
1007 } 1003 }
1008 } 1004 }
1009 llofstream file; 1005 llofstream file;
1010 file.open(filename.c_str()); 1006 file.open(filename);
1011 if (file.is_open()) 1007 if (file.is_open())
1012 { 1008 {
1013 LLSDSerialize::toPrettyXML(settings, file); 1009 LLSDSerialize::toPrettyXML(settings, file);
@@ -1023,13 +1019,13 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
1023 return num_saved; 1019 return num_saved;
1024} 1020}
1025 1021
1026U32 LLControlGroup::loadFromFile(const LLString& filename, bool set_default_values) 1022U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_values)
1027{ 1023{
1028 LLString name; 1024 std::string name;
1029 LLSD settings; 1025 LLSD settings;
1030 LLSD control_map; 1026 LLSD control_map;
1031 llifstream infile; 1027 llifstream infile;
1032 infile.open(filename.c_str()); 1028 infile.open(filename);
1033 if(!infile.is_open()) 1029 if(!infile.is_open())
1034 { 1030 {
1035 llwarns << "Cannot find file " << filename << " to load." << llendl; 1031 llwarns << "Cannot find file " << filename << " to load." << llendl;
@@ -1127,10 +1123,10 @@ void LLControlGroup::applyToAll(ApplyFunctor* func)
1127//============================================================================ 1123//============================================================================
1128// First-use 1124// First-use
1129 1125
1130static LLString get_warn_name(const LLString& name) 1126static std::string get_warn_name(const std::string& name)
1131{ 1127{
1132 LLString warnname = "Warn" + name; 1128 std::string warnname = "Warn" + name;
1133 for (LLString::iterator iter = warnname.begin(); iter != warnname.end(); ++iter) 1129 for (std::string::iterator iter = warnname.begin(); iter != warnname.end(); ++iter)
1134 { 1130 {
1135 char c = *iter; 1131 char c = *iter;
1136 if (!isalnum(c)) 1132 if (!isalnum(c))
@@ -1141,32 +1137,32 @@ static LLString get_warn_name(const LLString& name)
1141 return warnname; 1137 return warnname;
1142} 1138}
1143 1139
1144void LLControlGroup::addWarning(const LLString& name) 1140void LLControlGroup::addWarning(const std::string& name)
1145{ 1141{
1146 LLString warnname = get_warn_name(name); 1142 std::string warnname = get_warn_name(name);
1147 if(mNameTable.find(warnname) == mNameTable.end()) 1143 if(mNameTable.find(warnname) == mNameTable.end())
1148 { 1144 {
1149 LLString comment = LLString("Enables ") + name + LLString(" warning dialog"); 1145 std::string comment = std::string("Enables ") + name + std::string(" warning dialog");
1150 declareBOOL(warnname, TRUE, comment); 1146 declareBOOL(warnname, TRUE, comment);
1151 mWarnings.insert(warnname); 1147 mWarnings.insert(warnname);
1152 } 1148 }
1153} 1149}
1154 1150
1155BOOL LLControlGroup::getWarning(const LLString& name) 1151BOOL LLControlGroup::getWarning(const std::string& name)
1156{ 1152{
1157 LLString warnname = get_warn_name(name); 1153 std::string warnname = get_warn_name(name);
1158 return getBOOL(warnname); 1154 return getBOOL(warnname);
1159} 1155}
1160 1156
1161void LLControlGroup::setWarning(const LLString& name, BOOL val) 1157void LLControlGroup::setWarning(const std::string& name, BOOL val)
1162{ 1158{
1163 LLString warnname = get_warn_name(name); 1159 std::string warnname = get_warn_name(name);
1164 setBOOL(warnname, val); 1160 setBOOL(warnname, val);
1165} 1161}
1166 1162
1167void LLControlGroup::resetWarnings() 1163void LLControlGroup::resetWarnings()
1168{ 1164{
1169 for (std::set<LLString>::iterator iter = mWarnings.begin(); 1165 for (std::set<std::string>::iterator iter = mWarnings.begin();
1170 iter != mWarnings.end(); ++iter) 1166 iter != mWarnings.end(); ++iter)
1171 { 1167 {
1172 setBOOL(*iter, TRUE); 1168 setBOOL(*iter, TRUE);
diff --git a/linden/indra/llxml/llcontrol.h b/linden/indra/llxml/llcontrol.h
index 2500ae0..6205964 100644
--- a/linden/indra/llxml/llcontrol.h
+++ b/linden/indra/llxml/llcontrol.h
@@ -89,8 +89,8 @@ class LLControlVariable : public LLRefCount
89 typedef boost::signal<void(const LLSD&)> signal_t; 89 typedef boost::signal<void(const LLSD&)> signal_t;
90 90
91private: 91private:
92 LLString mName; 92 std::string mName;
93 LLString mComment; 93 std::string mComment;
94 eControlType mType; 94 eControlType mType;
95 bool mPersist; 95 bool mPersist;
96 std::vector<LLSD> mValues; 96 std::vector<LLSD> mValues;
@@ -98,14 +98,14 @@ private:
98 signal_t mSignal; 98 signal_t mSignal;
99 99
100public: 100public:
101 LLControlVariable(const LLString& name, eControlType type, 101 LLControlVariable(const std::string& name, eControlType type,
102 LLSD initial, const LLString& comment, 102 LLSD initial, const std::string& comment,
103 bool persist = true); 103 bool persist = true);
104 104
105 virtual ~LLControlVariable(); 105 virtual ~LLControlVariable();
106 106
107 const LLString& getName() const { return mName; } 107 const std::string& getName() const { return mName; }
108 const LLString& getComment() const { return mComment; } 108 const std::string& getComment() const { return mComment; }
109 109
110 eControlType type() { return mType; } 110 eControlType type() { return mType; }
111 bool isType(eControlType tp) { return tp == mType; } 111 bool isType(eControlType tp) { return tp == mType; }
@@ -142,95 +142,95 @@ private:
142class LLControlGroup 142class LLControlGroup
143{ 143{
144protected: 144protected:
145 typedef std::map<LLString, LLPointer<LLControlVariable> > ctrl_name_table_t; 145 typedef std::map<std::string, LLPointer<LLControlVariable> > ctrl_name_table_t;
146 ctrl_name_table_t mNameTable; 146 ctrl_name_table_t mNameTable;
147 std::set<LLString> mWarnings; 147 std::set<std::string> mWarnings;
148 LLString mTypeString[TYPE_COUNT]; 148 std::string mTypeString[TYPE_COUNT];
149 149
150 eControlType typeStringToEnum(const LLString& typestr); 150 eControlType typeStringToEnum(const std::string& typestr);
151 LLString typeEnumToString(eControlType typeenum); 151 std::string typeEnumToString(eControlType typeenum);
152public: 152public:
153 LLControlGroup(); 153 LLControlGroup();
154 ~LLControlGroup(); 154 ~LLControlGroup();
155 void cleanup(); 155 void cleanup();
156 156
157 LLPointer<LLControlVariable> getControl(const LLString& name); 157 LLPointer<LLControlVariable> getControl(const std::string& name);
158 158
159 struct ApplyFunctor 159 struct ApplyFunctor
160 { 160 {
161 virtual ~ApplyFunctor() {}; 161 virtual ~ApplyFunctor() {};
162 virtual void apply(const LLString& name, LLControlVariable* control) = 0; 162 virtual void apply(const std::string& name, LLControlVariable* control) = 0;
163 }; 163 };
164 void applyToAll(ApplyFunctor* func); 164 void applyToAll(ApplyFunctor* func);
165 165
166 BOOL declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist); 166 BOOL declareControl(const std::string& name, eControlType type, const LLSD initial_val, const std::string& comment, BOOL persist);
167 BOOL declareU32(const LLString& name, U32 initial_val, const LLString& comment, BOOL persist = TRUE); 167 BOOL declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist = TRUE);
168 BOOL declareS32(const LLString& name, S32 initial_val, const LLString& comment, BOOL persist = TRUE); 168 BOOL declareS32(const std::string& name, S32 initial_val, const std::string& comment, BOOL persist = TRUE);
169 BOOL declareF32(const LLString& name, F32 initial_val, const LLString& comment, BOOL persist = TRUE); 169 BOOL declareF32(const std::string& name, F32 initial_val, const std::string& comment, BOOL persist = TRUE);
170 BOOL declareBOOL(const LLString& name, BOOL initial_val, const LLString& comment, BOOL persist = TRUE); 170 BOOL declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist = TRUE);
171 BOOL declareString(const LLString& name, const LLString &initial_val, const LLString& comment, BOOL persist = TRUE); 171 BOOL declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist = TRUE);
172 BOOL declareVec3(const LLString& name, const LLVector3 &initial_val,const LLString& comment, BOOL persist = TRUE); 172 BOOL declareVec3(const std::string& name, const LLVector3 &initial_val,const std::string& comment, BOOL persist = TRUE);
173 BOOL declareVec3d(const LLString& name, const LLVector3d &initial_val, const LLString& comment, BOOL persist = TRUE); 173 BOOL declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, BOOL persist = TRUE);
174 BOOL declareRect(const LLString& name, const LLRect &initial_val, const LLString& comment, BOOL persist = TRUE); 174 BOOL declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, BOOL persist = TRUE);
175 BOOL declareColor4U(const LLString& name, const LLColor4U &initial_val, const LLString& comment, BOOL persist = TRUE); 175 BOOL declareColor4U(const std::string& name, const LLColor4U &initial_val, const std::string& comment, BOOL persist = TRUE);
176 BOOL declareColor4(const LLString& name, const LLColor4 &initial_val, const LLString& comment, BOOL persist = TRUE); 176 BOOL declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist = TRUE);
177 BOOL declareColor3(const LLString& name, const LLColor3 &initial_val, const LLString& comment, BOOL persist = TRUE); 177 BOOL declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist = TRUE);
178 BOOL declareLLSD(const LLString& name, const LLSD &initial_val, const LLString& comment, BOOL persist = TRUE); 178 BOOL declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, BOOL persist = TRUE);
179 179
180 LLString findString(const LLString& name); 180 std::string findString(const std::string& name);
181 181
182 LLString getString(const LLString& name); 182 std::string getString(const std::string& name);
183 LLWString getWString(const LLString& name); 183 LLWString getWString(const std::string& name);
184 LLString getText(const LLString& name); 184 std::string getText(const std::string& name);
185 LLVector3 getVector3(const LLString& name); 185 LLVector3 getVector3(const std::string& name);
186 LLVector3d getVector3d(const LLString& name); 186 LLVector3d getVector3d(const std::string& name);
187 LLRect getRect(const LLString& name); 187 LLRect getRect(const std::string& name);
188 BOOL getBOOL(const LLString& name); 188 BOOL getBOOL(const std::string& name);
189 S32 getS32(const LLString& name); 189 S32 getS32(const std::string& name);
190 F32 getF32(const LLString& name); 190 F32 getF32(const std::string& name);
191 U32 getU32(const LLString& name); 191 U32 getU32(const std::string& name);
192 LLSD getLLSD(const LLString& name); 192 LLSD getLLSD(const std::string& name);
193 193
194 194
195 // Note: If an LLColor4U control exists, it will cast it to the correct 195 // Note: If an LLColor4U control exists, it will cast it to the correct
196 // LLColor4 for you. 196 // LLColor4 for you.
197 LLColor4 getColor(const LLString& name); 197 LLColor4 getColor(const std::string& name);
198 LLColor4U getColor4U(const LLString& name); 198 LLColor4U getColor4U(const std::string& name);
199 LLColor4 getColor4(const LLString& name); 199 LLColor4 getColor4(const std::string& name);
200 LLColor3 getColor3(const LLString& name); 200 LLColor3 getColor3(const std::string& name);
201 201
202 void setBOOL(const LLString& name, BOOL val); 202 void setBOOL(const std::string& name, BOOL val);
203 void setS32(const LLString& name, S32 val); 203 void setS32(const std::string& name, S32 val);
204 void setF32(const LLString& name, F32 val); 204 void setF32(const std::string& name, F32 val);
205 void setU32(const LLString& name, U32 val); 205 void setU32(const std::string& name, U32 val);
206 void setString(const LLString& name, const LLString& val); 206 void setString(const std::string& name, const std::string& val);
207 void setVector3(const LLString& name, const LLVector3 &val); 207 void setVector3(const std::string& name, const LLVector3 &val);
208 void setVector3d(const LLString& name, const LLVector3d &val); 208 void setVector3d(const std::string& name, const LLVector3d &val);
209 void setRect(const LLString& name, const LLRect &val); 209 void setRect(const std::string& name, const LLRect &val);
210 void setColor4U(const LLString& name, const LLColor4U &val); 210 void setColor4U(const std::string& name, const LLColor4U &val);
211 void setColor4(const LLString& name, const LLColor4 &val); 211 void setColor4(const std::string& name, const LLColor4 &val);
212 void setColor3(const LLString& name, const LLColor3 &val); 212 void setColor3(const std::string& name, const LLColor3 &val);
213 void setLLSD(const LLString& name, const LLSD& val); 213 void setLLSD(const std::string& name, const LLSD& val);
214 void setValue(const LLString& name, const LLSD& val); 214 void setValue(const std::string& name, const LLSD& val);
215 215
216 216
217 BOOL controlExists(const LLString& name); 217 BOOL controlExists(const std::string& name);
218 218
219 // Returns number of controls loaded, 0 if failed 219 // Returns number of controls loaded, 0 if failed
220 // If require_declaration is false, will auto-declare controls it finds 220 // If require_declaration is false, will auto-declare controls it finds
221 // as the given type. 221 // as the given type.
222 U32 loadFromFileLegacy(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); 222 U32 loadFromFileLegacy(const std::string& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING);
223 U32 saveToFile(const LLString& filename, BOOL nondefault_only); 223 U32 saveToFile(const std::string& filename, BOOL nondefault_only);
224 U32 loadFromFile(const LLString& filename, bool default_values = false); 224 U32 loadFromFile(const std::string& filename, bool default_values = false);
225 void resetToDefaults(); 225 void resetToDefaults();
226 226
227 227
228 // Ignorable Warnings 228 // Ignorable Warnings
229 229
230 // Add a config variable to be reset on resetWarnings() 230 // Add a config variable to be reset on resetWarnings()
231 void addWarning(const LLString& name); 231 void addWarning(const std::string& name);
232 BOOL getWarning(const LLString& name); 232 BOOL getWarning(const std::string& name);
233 void setWarning(const LLString& name, BOOL val); 233 void setWarning(const std::string& name, BOOL val);
234 234
235 // Resets all ignorables 235 // Resets all ignorables
236 void resetWarnings(); 236 void resetWarnings();
diff --git a/linden/indra/llxml/llxml.vcproj b/linden/indra/llxml/llxml.vcproj
deleted file mode 100644
index be4ff97..0000000
--- a/linden/indra/llxml/llxml.vcproj
+++ /dev/null
@@ -1,191 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="llxml"
6 ProjectGUID="{A5470DA6-0C3A-4602-B930-43DB25511A59}"
7 Keyword="Win32Proj">
8 <Platforms>
9 <Platform
10 Name="Win32"/>
11 </Platforms>
12 <Configurations>
13 <Configuration
14 Name="Debug|Win32"
15 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
16 IntermediateDirectory="Debug"
17 ConfigurationType="4"
18 CharacterSet="1">
19 <Tool
20 Name="VCCLCompilerTool"
21 Optimization="0"
22 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
23 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG"
24 MinimalRebuild="TRUE"
25 BasicRuntimeChecks="3"
26 RuntimeLibrary="1"
27 StructMemberAlignment="4"
28 ForceConformanceInForLoopScope="TRUE"
29 UsePrecompiledHeader="0"
30 WarningLevel="3"
31 WarnAsError="TRUE"
32 Detect64BitPortabilityProblems="FALSE"
33 DebugInformationFormat="4"/>
34 <Tool
35 Name="VCCustomBuildTool"/>
36 <Tool
37 Name="VCLibrarianTool"
38 OutputFile="$(OutDir)/llxml.lib"/>
39 <Tool
40 Name="VCMIDLTool"/>
41 <Tool
42 Name="VCPostBuildEventTool"/>
43 <Tool
44 Name="VCPreBuildEventTool"/>
45 <Tool
46 Name="VCPreLinkEventTool"/>
47 <Tool
48 Name="VCResourceCompilerTool"/>
49 <Tool
50 Name="VCWebServiceProxyGeneratorTool"/>
51 <Tool
52 Name="VCXMLDataGeneratorTool"/>
53 <Tool
54 Name="VCManagedWrapperGeneratorTool"/>
55 <Tool
56 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
57 </Configuration>
58 <Configuration
59 Name="Release|Win32"
60 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
61 IntermediateDirectory="Release"
62 ConfigurationType="4"
63 CharacterSet="1">
64 <Tool
65 Name="VCCLCompilerTool"
66 AdditionalOptions="/Oy-"
67 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
68 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE"
69 RuntimeLibrary="0"
70 StructMemberAlignment="0"
71 ForceConformanceInForLoopScope="TRUE"
72 UsePrecompiledHeader="0"
73 WarningLevel="3"
74 WarnAsError="TRUE"
75 Detect64BitPortabilityProblems="FALSE"
76 DebugInformationFormat="3"/>
77 <Tool
78 Name="VCCustomBuildTool"/>
79 <Tool
80 Name="VCLibrarianTool"
81 OutputFile="$(OutDir)/llxml.lib"/>
82 <Tool
83 Name="VCMIDLTool"/>
84 <Tool
85 Name="VCPostBuildEventTool"/>
86 <Tool
87 Name="VCPreBuildEventTool"/>
88 <Tool
89 Name="VCPreLinkEventTool"/>
90 <Tool
91 Name="VCResourceCompilerTool"/>
92 <Tool
93 Name="VCWebServiceProxyGeneratorTool"/>
94 <Tool
95 Name="VCXMLDataGeneratorTool"/>
96 <Tool
97 Name="VCManagedWrapperGeneratorTool"/>
98 <Tool
99 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
100 </Configuration>
101 <Configuration
102 Name="ReleaseNoOpt|Win32"
103 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
104 IntermediateDirectory="$(ConfigurationName)"
105 ConfigurationType="4"
106 CharacterSet="1">
107 <Tool
108 Name="VCCLCompilerTool"
109 AdditionalOptions="/Oy-"
110 Optimization="0"
111 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 ForceConformanceInForLoopScope="TRUE"
116 UsePrecompiledHeader="0"
117 WarningLevel="3"
118 WarnAsError="TRUE"
119 Detect64BitPortabilityProblems="FALSE"
120 DebugInformationFormat="3"/>
121 <Tool
122 Name="VCCustomBuildTool"/>
123 <Tool
124 Name="VCLibrarianTool"
125 OutputFile="$(OutDir)/llxml.lib"/>
126 <Tool
127 Name="VCMIDLTool"/>
128 <Tool
129 Name="VCPostBuildEventTool"/>
130 <Tool
131 Name="VCPreBuildEventTool"/>
132 <Tool
133 Name="VCPreLinkEventTool"/>
134 <Tool
135 Name="VCResourceCompilerTool"/>
136 <Tool
137 Name="VCWebServiceProxyGeneratorTool"/>
138 <Tool
139 Name="VCXMLDataGeneratorTool"/>
140 <Tool
141 Name="VCManagedWrapperGeneratorTool"/>
142 <Tool
143 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
144 </Configuration>
145 </Configurations>
146 <References>
147 </References>
148 <Files>
149 <Filter
150 Name="Source Files"
151 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
152 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
153 <File
154 RelativePath=".\llcontrol.cpp">
155 </File>
156 <File
157 RelativePath=".\llxmlnode.cpp">
158 </File>
159 <File
160 RelativePath=".\llxmlparser.cpp">
161 </File>
162 <File
163 RelativePath=".\llxmltree.cpp">
164 </File>
165 </Filter>
166 <Filter
167 Name="Header Files"
168 Filter="h;hpp;hxx;hm;inl;inc;xsd"
169 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
170 <File
171 RelativePath=".\llcontrol.h">
172 </File>
173 <File
174 RelativePath=".\llxmlnode.h">
175 </File>
176 <File
177 RelativePath=".\llxmlparser.h">
178 </File>
179 <File
180 RelativePath=".\llxmltree.h">
181 </File>
182 </Filter>
183 <Filter
184 Name="Resource Files"
185 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
186 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
187 </Filter>
188 </Files>
189 <Globals>
190 </Globals>
191</VisualStudioProject>
diff --git a/linden/indra/llxml/llxml_vc8.vcproj b/linden/indra/llxml/llxml_vc8.vcproj
deleted file mode 100644
index b39ae53..0000000
--- a/linden/indra/llxml/llxml_vc8.vcproj
+++ /dev/null
@@ -1,279 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llxml"
6 ProjectGUID="{A5470DA6-0C3A-4602-B930-43DB25511A59}"
7 RootNamespace="llxml"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="Debug"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 />
67 <Tool
68 Name="VCLibrarianTool"
69 OutputFile="$(OutDir)/llxml.lib"
70 />
71 <Tool
72 Name="VCALinkTool"
73 />
74 <Tool
75 Name="VCXDCMakeTool"
76 />
77 <Tool
78 Name="VCBscMakeTool"
79 />
80 <Tool
81 Name="VCFxCopTool"
82 />
83 <Tool
84 Name="VCPostBuildEventTool"
85 />
86 </Configuration>
87 <Configuration
88 Name="Release|Win32"
89 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
90 IntermediateDirectory="Release"
91 ConfigurationType="4"
92 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
93 CharacterSet="1"
94 >
95 <Tool
96 Name="VCPreBuildEventTool"
97 />
98 <Tool
99 Name="VCCustomBuildTool"
100 />
101 <Tool
102 Name="VCXMLDataGeneratorTool"
103 />
104 <Tool
105 Name="VCWebServiceProxyGeneratorTool"
106 />
107 <Tool
108 Name="VCMIDLTool"
109 />
110 <Tool
111 Name="VCCLCompilerTool"
112 AdditionalOptions="/Oy-"
113 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
114 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
115 RuntimeLibrary="0"
116 StructMemberAlignment="0"
117 TreatWChar_tAsBuiltInType="false"
118 ForceConformanceInForLoopScope="true"
119 UsePrecompiledHeader="0"
120 WarningLevel="3"
121 WarnAsError="true"
122 Detect64BitPortabilityProblems="false"
123 DebugInformationFormat="3"
124 />
125 <Tool
126 Name="VCManagedResourceCompilerTool"
127 />
128 <Tool
129 Name="VCResourceCompilerTool"
130 />
131 <Tool
132 Name="VCPreLinkEventTool"
133 />
134 <Tool
135 Name="VCLibrarianTool"
136 OutputFile="$(OutDir)/llxml.lib"
137 />
138 <Tool
139 Name="VCALinkTool"
140 />
141 <Tool
142 Name="VCXDCMakeTool"
143 />
144 <Tool
145 Name="VCBscMakeTool"
146 />
147 <Tool
148 Name="VCFxCopTool"
149 />
150 <Tool
151 Name="VCPostBuildEventTool"
152 />
153 </Configuration>
154 <Configuration
155 Name="ReleaseNoOpt|Win32"
156 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
157 IntermediateDirectory="$(ConfigurationName)"
158 ConfigurationType="4"
159 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
160 CharacterSet="1"
161 >
162 <Tool
163 Name="VCPreBuildEventTool"
164 />
165 <Tool
166 Name="VCCustomBuildTool"
167 />
168 <Tool
169 Name="VCXMLDataGeneratorTool"
170 />
171 <Tool
172 Name="VCWebServiceProxyGeneratorTool"
173 />
174 <Tool
175 Name="VCMIDLTool"
176 />
177 <Tool
178 Name="VCCLCompilerTool"
179 AdditionalOptions="/Oy-"
180 Optimization="0"
181 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
182 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
183 RuntimeLibrary="0"
184 StructMemberAlignment="0"
185 TreatWChar_tAsBuiltInType="false"
186 ForceConformanceInForLoopScope="true"
187 UsePrecompiledHeader="0"
188 WarningLevel="3"
189 WarnAsError="true"
190 Detect64BitPortabilityProblems="false"
191 DebugInformationFormat="3"
192 />
193 <Tool
194 Name="VCManagedResourceCompilerTool"
195 />
196 <Tool
197 Name="VCResourceCompilerTool"
198 />
199 <Tool
200 Name="VCPreLinkEventTool"
201 />
202 <Tool
203 Name="VCLibrarianTool"
204 OutputFile="$(OutDir)/llxml.lib"
205 />
206 <Tool
207 Name="VCALinkTool"
208 />
209 <Tool
210 Name="VCXDCMakeTool"
211 />
212 <Tool
213 Name="VCBscMakeTool"
214 />
215 <Tool
216 Name="VCFxCopTool"
217 />
218 <Tool
219 Name="VCPostBuildEventTool"
220 />
221 </Configuration>
222 </Configurations>
223 <References>
224 </References>
225 <Files>
226 <Filter
227 Name="Source Files"
228 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
229 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
230 >
231 <File
232 RelativePath=".\llcontrol.cpp"
233 >
234 </File>
235 <File
236 RelativePath=".\llxmlnode.cpp"
237 >
238 </File>
239 <File
240 RelativePath=".\llxmlparser.cpp"
241 >
242 </File>
243 <File
244 RelativePath=".\llxmltree.cpp"
245 >
246 </File>
247 </Filter>
248 <Filter
249 Name="Header Files"
250 Filter="h;hpp;hxx;hm;inl;inc;xsd"
251 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
252 >
253 <File
254 RelativePath=".\llcontrol.h"
255 >
256 </File>
257 <File
258 RelativePath=".\llxmlnode.h"
259 >
260 </File>
261 <File
262 RelativePath=".\llxmlparser.h"
263 >
264 </File>
265 <File
266 RelativePath=".\llxmltree.h"
267 >
268 </File>
269 </Filter>
270 <Filter
271 Name="Resource Files"
272 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
273 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
274 >
275 </Filter>
276 </Files>
277 <Globals>
278 </Globals>
279</VisualStudioProject>
diff --git a/linden/indra/llxml/llxml_vc9.vcproj b/linden/indra/llxml/llxml_vc9.vcproj
deleted file mode 100644
index eb719c9..0000000
--- a/linden/indra/llxml/llxml_vc9.vcproj
+++ /dev/null
@@ -1,280 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9.00"
5 Name="llxml"
6 ProjectGUID="{A5470DA6-0C3A-4602-B930-43DB25511A59}"
7 RootNamespace="llxml"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="131072"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 </Platforms>
16 <ToolFiles>
17 </ToolFiles>
18 <Configurations>
19 <Configuration
20 Name="Debug|Win32"
21 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
22 IntermediateDirectory="Debug"
23 ConfigurationType="4"
24 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
25 CharacterSet="1"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 />
42 <Tool
43 Name="VCCLCompilerTool"
44 Optimization="0"
45 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
46 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
47 MinimalRebuild="true"
48 BasicRuntimeChecks="3"
49 RuntimeLibrary="1"
50 StructMemberAlignment="4"
51 TreatWChar_tAsBuiltInType="false"
52 ForceConformanceInForLoopScope="true"
53 UsePrecompiledHeader="0"
54 WarningLevel="3"
55 WarnAsError="true"
56 Detect64BitPortabilityProblems="false"
57 DebugInformationFormat="4"
58 />
59 <Tool
60 Name="VCManagedResourceCompilerTool"
61 />
62 <Tool
63 Name="VCResourceCompilerTool"
64 />
65 <Tool
66 Name="VCPreLinkEventTool"
67 />
68 <Tool
69 Name="VCLibrarianTool"
70 OutputFile="$(OutDir)/llxml.lib"
71 />
72 <Tool
73 Name="VCALinkTool"
74 />
75 <Tool
76 Name="VCXDCMakeTool"
77 />
78 <Tool
79 Name="VCBscMakeTool"
80 />
81 <Tool
82 Name="VCFxCopTool"
83 />
84 <Tool
85 Name="VCPostBuildEventTool"
86 />
87 </Configuration>
88 <Configuration
89 Name="Release|Win32"
90 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
91 IntermediateDirectory="Release"
92 ConfigurationType="4"
93 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
94 CharacterSet="1"
95 >
96 <Tool
97 Name="VCPreBuildEventTool"
98 />
99 <Tool
100 Name="VCCustomBuildTool"
101 />
102 <Tool
103 Name="VCXMLDataGeneratorTool"
104 />
105 <Tool
106 Name="VCWebServiceProxyGeneratorTool"
107 />
108 <Tool
109 Name="VCMIDLTool"
110 />
111 <Tool
112 Name="VCCLCompilerTool"
113 AdditionalOptions="/Oy-"
114 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
115 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
116 RuntimeLibrary="0"
117 StructMemberAlignment="0"
118 TreatWChar_tAsBuiltInType="false"
119 ForceConformanceInForLoopScope="true"
120 UsePrecompiledHeader="0"
121 WarningLevel="3"
122 WarnAsError="true"
123 Detect64BitPortabilityProblems="false"
124 DebugInformationFormat="3"
125 />
126 <Tool
127 Name="VCManagedResourceCompilerTool"
128 />
129 <Tool
130 Name="VCResourceCompilerTool"
131 />
132 <Tool
133 Name="VCPreLinkEventTool"
134 />
135 <Tool
136 Name="VCLibrarianTool"
137 OutputFile="$(OutDir)/llxml.lib"
138 />
139 <Tool
140 Name="VCALinkTool"
141 />
142 <Tool
143 Name="VCXDCMakeTool"
144 />
145 <Tool
146 Name="VCBscMakeTool"
147 />
148 <Tool
149 Name="VCFxCopTool"
150 />
151 <Tool
152 Name="VCPostBuildEventTool"
153 />
154 </Configuration>
155 <Configuration
156 Name="ReleaseNoOpt|Win32"
157 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
158 IntermediateDirectory="$(ConfigurationName)"
159 ConfigurationType="4"
160 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
161 CharacterSet="1"
162 >
163 <Tool
164 Name="VCPreBuildEventTool"
165 />
166 <Tool
167 Name="VCCustomBuildTool"
168 />
169 <Tool
170 Name="VCXMLDataGeneratorTool"
171 />
172 <Tool
173 Name="VCWebServiceProxyGeneratorTool"
174 />
175 <Tool
176 Name="VCMIDLTool"
177 />
178 <Tool
179 Name="VCCLCompilerTool"
180 AdditionalOptions="/Oy-"
181 Optimization="0"
182 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\..\libraries\i686-win32\include;..\..\libraries\include\"
183 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
184 RuntimeLibrary="0"
185 StructMemberAlignment="0"
186 TreatWChar_tAsBuiltInType="false"
187 ForceConformanceInForLoopScope="true"
188 UsePrecompiledHeader="0"
189 WarningLevel="3"
190 WarnAsError="true"
191 Detect64BitPortabilityProblems="false"
192 DebugInformationFormat="3"
193 />
194 <Tool
195 Name="VCManagedResourceCompilerTool"
196 />
197 <Tool
198 Name="VCResourceCompilerTool"
199 />
200 <Tool
201 Name="VCPreLinkEventTool"
202 />
203 <Tool
204 Name="VCLibrarianTool"
205 OutputFile="$(OutDir)/llxml.lib"
206 />
207 <Tool
208 Name="VCALinkTool"
209 />
210 <Tool
211 Name="VCXDCMakeTool"
212 />
213 <Tool
214 Name="VCBscMakeTool"
215 />
216 <Tool
217 Name="VCFxCopTool"
218 />
219 <Tool
220 Name="VCPostBuildEventTool"
221 />
222 </Configuration>
223 </Configurations>
224 <References>
225 </References>
226 <Files>
227 <Filter
228 Name="Source Files"
229 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
230 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
231 >
232 <File
233 RelativePath=".\llcontrol.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\llxmlnode.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\llxmlparser.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\llxmltree.cpp"
246 >
247 </File>
248 </Filter>
249 <Filter
250 Name="Header Files"
251 Filter="h;hpp;hxx;hm;inl;inc;xsd"
252 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
253 >
254 <File
255 RelativePath=".\llcontrol.h"
256 >
257 </File>
258 <File
259 RelativePath=".\llxmlnode.h"
260 >
261 </File>
262 <File
263 RelativePath=".\llxmlparser.h"
264 >
265 </File>
266 <File
267 RelativePath=".\llxmltree.h"
268 >
269 </File>
270 </Filter>
271 <Filter
272 Name="Resource Files"
273 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
274 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
275 >
276 </Filter>
277 </Files>
278 <Globals>
279 </Globals>
280</VisualStudioProject>
diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp
index f9852d3..145e6e0 100644
--- a/linden/indra/llxml/llxmlnode.cpp
+++ b/linden/indra/llxml/llxmlnode.cpp
@@ -55,6 +55,7 @@ BOOL LLXMLNode::sStripWhitespaceValues = FALSE;
55 55
56LLXMLNode::LLXMLNode() : 56LLXMLNode::LLXMLNode() :
57 mID(""), 57 mID(""),
58 mParser(NULL),
58 mIsAttribute(FALSE), 59 mIsAttribute(FALSE),
59 mVersionMajor(0), 60 mVersionMajor(0),
60 mVersionMinor(0), 61 mVersionMinor(0),
@@ -70,8 +71,9 @@ LLXMLNode::LLXMLNode() :
70{ 71{
71} 72}
72 73
73LLXMLNode::LLXMLNode(const LLString& name, BOOL is_attribute) : 74LLXMLNode::LLXMLNode(const char* name, BOOL is_attribute) :
74 mID(""), 75 mID(""),
76 mParser(NULL),
75 mIsAttribute(is_attribute), 77 mIsAttribute(is_attribute),
76 mVersionMajor(0), 78 mVersionMajor(0),
77 mVersionMinor(0), 79 mVersionMinor(0),
@@ -89,6 +91,7 @@ LLXMLNode::LLXMLNode(const LLString& name, BOOL is_attribute) :
89 91
90LLXMLNode::LLXMLNode(LLStringTableEntry* name, BOOL is_attribute) : 92LLXMLNode::LLXMLNode(LLStringTableEntry* name, BOOL is_attribute) :
91 mID(""), 93 mID(""),
94 mParser(NULL),
92 mIsAttribute(is_attribute), 95 mIsAttribute(is_attribute),
93 mVersionMajor(0), 96 mVersionMajor(0),
94 mVersionMinor(0), 97 mVersionMinor(0),
@@ -212,7 +215,7 @@ void LLXMLNode::addChild(LLXMLNodePtr new_child)
212 new_child->mParent = this; 215 new_child->mParent = this;
213 if (new_child->mIsAttribute) 216 if (new_child->mIsAttribute)
214 { 217 {
215 mAttributes.insert(std::pair<LLStringTableEntry*, LLXMLNodePtr>(new_child->mName, new_child)); 218 mAttributes.insert(std::make_pair(new_child->mName, new_child));
216 } 219 }
217 else 220 else
218 { 221 {
@@ -222,7 +225,7 @@ void LLXMLNode::addChild(LLXMLNodePtr new_child)
222 mChildren->head = new_child; 225 mChildren->head = new_child;
223 mChildren->tail = new_child; 226 mChildren->tail = new_child;
224 } 227 }
225 mChildren->map.insert(std::pair<LLStringTableEntry*, LLXMLNodePtr>(new_child->mName, new_child)); 228 mChildren->map.insert(std::make_pair(new_child->mName, new_child));
226 229
227 if (mChildren->tail != new_child) 230 if (mChildren->tail != new_child)
228 { 231 {
@@ -236,7 +239,7 @@ void LLXMLNode::addChild(LLXMLNodePtr new_child)
236} 239}
237 240
238// virtual 241// virtual
239LLXMLNodePtr LLXMLNode::createChild(const LLString& name, BOOL is_attribute) 242LLXMLNodePtr LLXMLNode::createChild(const char* name, BOOL is_attribute)
240{ 243{
241 return createChild(gStringTable.addStringEntry(name), is_attribute); 244 return createChild(gStringTable.addStringEntry(name), is_attribute);
242} 245}
@@ -245,7 +248,7 @@ LLXMLNodePtr LLXMLNode::createChild(const LLString& name, BOOL is_attribute)
245LLXMLNodePtr LLXMLNode::createChild(LLStringTableEntry* name, BOOL is_attribute) 248LLXMLNodePtr LLXMLNode::createChild(LLStringTableEntry* name, BOOL is_attribute)
246{ 249{
247 LLXMLNode* ret = new LLXMLNode(name, is_attribute); 250 LLXMLNode* ret = new LLXMLNode(name, is_attribute);
248 ret->mID = ""; 251 ret->mID.clear();
249 addChild(ret); 252 addChild(ret);
250 return ret; 253 return ret;
251} 254}
@@ -309,7 +312,7 @@ void XMLCALL StartXMLNode(void *userData,
309 // Create a new node 312 // Create a new node
310 LLXMLNode *new_node_ptr = new LLXMLNode(name, FALSE); 313 LLXMLNode *new_node_ptr = new LLXMLNode(name, FALSE);
311 LLXMLNodePtr new_node = new_node_ptr; 314 LLXMLNodePtr new_node = new_node_ptr;
312 new_node->mID = ""; 315 new_node->mID.clear();
313 LLXMLNodePtr ptr_new_node = new_node; 316 LLXMLNodePtr ptr_new_node = new_node;
314 317
315 // Set the parent-child relationship with the current active node 318 // Set the parent-child relationship with the current active node
@@ -331,8 +334,8 @@ void XMLCALL StartXMLNode(void *userData,
331 U32 pos = 0; 334 U32 pos = 0;
332 while (atts[pos] != NULL) 335 while (atts[pos] != NULL)
333 { 336 {
334 LLString attr_name = atts[pos]; 337 std::string attr_name = atts[pos];
335 LLString attr_value = atts[pos+1]; 338 std::string attr_value = atts[pos+1];
336 339
337 // Special cases 340 // Special cases
338 if ('i' == attr_name[0] && "id" == attr_name) 341 if ('i' == attr_name[0] && "id" == attr_name)
@@ -410,9 +413,9 @@ void XMLCALL StartXMLNode(void *userData,
410 413
411 // only one attribute child per description 414 // only one attribute child per description
412 LLXMLNodePtr attr_node; 415 LLXMLNodePtr attr_node;
413 if (!new_node->getAttribute(attr_name, attr_node, FALSE)) 416 if (!new_node->getAttribute(attr_name.c_str(), attr_node, FALSE))
414 { 417 {
415 attr_node = new LLXMLNode(attr_name, TRUE); 418 attr_node = new LLXMLNode(attr_name.c_str(), TRUE);
416 } 419 }
417 attr_node->setValue(attr_value); 420 attr_node->setValue(attr_value);
418 new_node->addChild(attr_node); 421 new_node->addChild(attr_node);
@@ -436,7 +439,7 @@ void XMLCALL EndXMLNode(void *userData,
436 // SJB: total hack: 439 // SJB: total hack:
437 if (LLXMLNode::sStripWhitespaceValues) 440 if (LLXMLNode::sStripWhitespaceValues)
438 { 441 {
439 LLString value = node->getValue(); 442 std::string value = node->getValue();
440 BOOL is_empty = TRUE; 443 BOOL is_empty = TRUE;
441 for (std::string::size_type s = 0; s < value.length(); s++) 444 for (std::string::size_type s = 0; s < value.length(); s++)
442 { 445 {
@@ -460,13 +463,13 @@ void XMLCALL XMLData(void *userData,
460 int len) 463 int len)
461{ 464{
462 LLXMLNode* current_node = (LLXMLNode *)userData; 465 LLXMLNode* current_node = (LLXMLNode *)userData;
463 LLString value = current_node->getValue(); 466 std::string value = current_node->getValue();
464 if (LLXMLNode::sStripEscapedStrings) 467 if (LLXMLNode::sStripEscapedStrings)
465 { 468 {
466 if (s[0] == '\"' && s[len-1] == '\"') 469 if (s[0] == '\"' && s[len-1] == '\"')
467 { 470 {
468 // Special-case: Escaped string. 471 // Special-case: Escaped string.
469 LLString unescaped_string; 472 std::string unescaped_string;
470 for (S32 pos=1; pos<len-1; ++pos) 473 for (S32 pos=1; pos<len-1; ++pos)
471 { 474 {
472 if (s[pos] == '\\' && s[pos+1] == '\\') 475 if (s[pos] == '\\' && s[pos+1] == '\\')
@@ -489,7 +492,7 @@ void XMLCALL XMLData(void *userData,
489 return; 492 return;
490 } 493 }
491 } 494 }
492 value.append(LLString(s, 0, len)); 495 value.append(std::string(s, len));
493 current_node->setValue(value); 496 current_node->setValue(value);
494} 497}
495 498
@@ -537,8 +540,8 @@ bool LLXMLNode::updateNode(
537 { 540 {
538 for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) 541 for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
539 { 542 {
540 LLString nodeName; 543 std::string nodeName;
541 LLString updateName; 544 std::string updateName;
542 545
543 updateChild->getAttributeString("name", updateName); 546 updateChild->getAttributeString("name", updateName);
544 child->getAttributeString("name", nodeName); 547 child->getAttributeString("name", nodeName);
@@ -566,13 +569,11 @@ bool LLXMLNode::updateNode(
566 569
567 570
568// static 571// static
569bool LLXMLNode::parseFile( 572bool LLXMLNode::parseFile(const std::string& filename, LLXMLNodePtr& node, LLXMLNode* defaults_tree)
570 LLString filename,
571 LLXMLNodePtr& node,
572 LLXMLNode* defaults_tree)
573{ 573{
574 // Read file 574 // Read file
575 LLFILE* fp = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */ 575 LL_DEBUGS("XMLNode") << "parsing XML file: " << filename << LL_ENDL;
576 LLFILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
576 if (fp == NULL) 577 if (fp == NULL)
577 { 578 {
578 node = new LLXMLNode(); 579 node = new LLXMLNode();
@@ -746,7 +747,7 @@ void LLXMLNode::writeHeaderToFile(LLFILE *fOut)
746 fprintf(fOut, "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"); 747 fprintf(fOut, "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n");
747} 748}
748 749
749void LLXMLNode::writeToFile(LLFILE *fOut, LLString indent) 750void LLXMLNode::writeToFile(LLFILE *fOut, const std::string& indent)
750{ 751{
751 if (isFullyDefault()) 752 if (isFullyDefault())
752 { 753 {
@@ -756,14 +757,14 @@ void LLXMLNode::writeToFile(LLFILE *fOut, LLString indent)
756 757
757 std::ostringstream ostream; 758 std::ostringstream ostream;
758 writeToOstream(ostream, indent); 759 writeToOstream(ostream, indent);
759 LLString outstring = ostream.str(); 760 std::string outstring = ostream.str();
760 if (fwrite(outstring.c_str(), 1, outstring.length(), fOut) != outstring.length()) 761 if (fwrite(outstring.c_str(), 1, outstring.length(), fOut) != outstring.length())
761 { 762 {
762 llwarns << "Short write" << llendl; 763 llwarns << "Short write" << llendl;
763 } 764 }
764} 765}
765 766
766void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& indent) 767void LLXMLNode::writeToOstream(std::ostream& output_stream, const std::string& indent)
767{ 768{
768 if (isFullyDefault()) 769 if (isFullyDefault())
769 { 770 {
@@ -777,12 +778,12 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& inde
777 BOOL has_default_length = mDefault.isNull()?FALSE:(mLength == mDefault->mLength); 778 BOOL has_default_length = mDefault.isNull()?FALSE:(mLength == mDefault->mLength);
778 779
779 // stream the name 780 // stream the name
780 output_stream << indent.c_str() << "<" << mName->mString; 781 output_stream << indent << "<" << mName->mString;
781 782
782 // ID 783 // ID
783 if (mID != "") 784 if (mID != "")
784 { 785 {
785 output_stream << " id=\"" << mID.c_str() << "\""; 786 output_stream << " id=\"" << mID << "\"";
786 } 787 }
787 788
788 // Type 789 // Type
@@ -862,7 +863,7 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& inde
862 LLXMLNodePtr child = (*attr_itr).second; 863 LLXMLNodePtr child = (*attr_itr).second;
863 if (child->mDefault.isNull() || child->mDefault->mValue != child->mValue) 864 if (child->mDefault.isNull() || child->mDefault->mValue != child->mValue)
864 { 865 {
865 LLString attr = child->mName->mString; 866 std::string attr = child->mName->mString;
866 if (attr == "id" || 867 if (attr == "id" ||
867 attr == "type" || 868 attr == "type" ||
868 attr == "encoding" || 869 attr == "encoding" ||
@@ -873,7 +874,7 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& inde
873 continue; // skip built-in attributes 874 continue; // skip built-in attributes
874 } 875 }
875 876
876 LLString attr_str = llformat(" %s=\"%s\"", 877 std::string attr_str = llformat(" %s=\"%s\"",
877 attr.c_str(), 878 attr.c_str(),
878 escapeXML(child->mValue).c_str()); 879 escapeXML(child->mValue).c_str());
879 if (col_pos + (S32)attr_str.length() > MAX_COLUMN_WIDTH) 880 if (col_pos + (S32)attr_str.length() > MAX_COLUMN_WIDTH)
@@ -898,7 +899,7 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& inde
898 if (mChildren) 899 if (mChildren)
899 { 900 {
900 // stream non-attributes 901 // stream non-attributes
901 LLString next_indent = indent + "\t"; 902 std::string next_indent = indent + "\t";
902 for (LLXMLNode* child = getFirstChild(); child; child = child->getNextSibling()) 903 for (LLXMLNode* child = getFirstChild(); child; child = child->getNextSibling())
903 { 904 {
904 child->writeToOstream(output_stream, next_indent); 905 child->writeToOstream(output_stream, next_indent);
@@ -906,19 +907,19 @@ void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& inde
906 } 907 }
907 if (!mValue.empty()) 908 if (!mValue.empty())
908 { 909 {
909 LLString contents = getTextContents(); 910 std::string contents = getTextContents();
910 output_stream << indent.c_str() << "\t" << escapeXML(contents) << "\n"; 911 output_stream << indent << "\t" << escapeXML(contents) << "\n";
911 } 912 }
912 output_stream << indent.c_str() << "</" << mName->mString << ">\n"; 913 output_stream << indent << "</" << mName->mString << ">\n";
913 } 914 }
914} 915}
915 916
916void LLXMLNode::findName(const LLString& name, LLXMLNodeList &results) 917void LLXMLNode::findName(const std::string& name, LLXMLNodeList &results)
917{ 918{
918 LLStringTableEntry* name_entry = gStringTable.checkStringEntry(name); 919 LLStringTableEntry* name_entry = gStringTable.checkStringEntry(name);
919 if (name_entry == mName) 920 if (name_entry == mName)
920 { 921 {
921 results.insert(std::pair<LLString, LLXMLNode*>(this->mName->mString, this)); 922 results.insert(std::make_pair(this->mName->mString, this));
922 return; 923 return;
923 } 924 }
924 if (mChildren) 925 if (mChildren)
@@ -937,7 +938,7 @@ void LLXMLNode::findName(LLStringTableEntry* name, LLXMLNodeList &results)
937{ 938{
938 if (name == mName) 939 if (name == mName)
939 { 940 {
940 results.insert(std::pair<LLString, LLXMLNode*>(this->mName->mString, this)); 941 results.insert(std::make_pair(this->mName->mString, this));
941 return; 942 return;
942 } 943 }
943 if (mChildren) 944 if (mChildren)
@@ -952,11 +953,11 @@ void LLXMLNode::findName(LLStringTableEntry* name, LLXMLNodeList &results)
952 } 953 }
953} 954}
954 955
955void LLXMLNode::findID(const LLString& id, LLXMLNodeList &results) 956void LLXMLNode::findID(const std::string& id, LLXMLNodeList &results)
956{ 957{
957 if (id == mID) 958 if (id == mID)
958 { 959 {
959 results.insert(std::pair<LLString, LLXMLNode*>(this->mName->mString, this)); 960 results.insert(std::make_pair(this->mName->mString, this));
960 return; 961 return;
961 } 962 }
962 if (mChildren) 963 if (mChildren)
@@ -1015,7 +1016,7 @@ void LLXMLNode::scrubToTree(LLXMLNode *tree)
1015 } 1016 }
1016} 1017}
1017 1018
1018bool LLXMLNode::getChild(const LLString& name, LLXMLNodePtr& node, BOOL use_default_if_missing) 1019bool LLXMLNode::getChild(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing)
1019{ 1020{
1020 return getChild(gStringTable.checkStringEntry(name), node, use_default_if_missing); 1021 return getChild(gStringTable.checkStringEntry(name), node, use_default_if_missing);
1021} 1022}
@@ -1039,7 +1040,7 @@ bool LLXMLNode::getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOO
1039 return false; 1040 return false;
1040} 1041}
1041 1042
1042void LLXMLNode::getChildren(const LLString& name, LLXMLNodeList &children, BOOL use_default_if_missing) const 1043void LLXMLNode::getChildren(const char* name, LLXMLNodeList &children, BOOL use_default_if_missing) const
1043{ 1044{
1044 getChildren(gStringTable.checkStringEntry(name), children, use_default_if_missing); 1045 getChildren(gStringTable.checkStringEntry(name), children, use_default_if_missing);
1045} 1046}
@@ -1059,7 +1060,7 @@ void LLXMLNode::getChildren(const LLStringTableEntry* name, LLXMLNodeList &child
1059 { 1060 {
1060 break; 1061 break;
1061 } 1062 }
1062 children.insert(std::pair<LLString, LLXMLNodePtr>(child->mName->mString, child)); 1063 children.insert(std::make_pair(child->mName->mString, child));
1063 child_itr++; 1064 child_itr++;
1064 } 1065 }
1065 } 1066 }
@@ -1070,7 +1071,7 @@ void LLXMLNode::getChildren(const LLStringTableEntry* name, LLXMLNodeList &child
1070 } 1071 }
1071} 1072}
1072 1073
1073bool LLXMLNode::getAttribute(const LLString& name, LLXMLNodePtr& node, BOOL use_default_if_missing) 1074bool LLXMLNode::getAttribute(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing)
1074{ 1075{
1075 return getAttribute(gStringTable.checkStringEntry(name), node, use_default_if_missing); 1076 return getAttribute(gStringTable.checkStringEntry(name), node, use_default_if_missing);
1076} 1077}
@@ -1091,7 +1092,7 @@ bool LLXMLNode::getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node,
1091 return false; 1092 return false;
1092} 1093}
1093 1094
1094bool LLXMLNode::setAttributeString(const LLString& attr, const LLString& value) 1095bool LLXMLNode::setAttributeString(const char* attr, const std::string& value)
1095{ 1096{
1096 LLStringTableEntry* name = gStringTable.checkStringEntry(attr); 1097 LLStringTableEntry* name = gStringTable.checkStringEntry(attr);
1097 LLXMLAttribList::const_iterator child_itr = mAttributes.find(name); 1098 LLXMLAttribList::const_iterator child_itr = mAttributes.find(name);
@@ -1104,25 +1105,25 @@ bool LLXMLNode::setAttributeString(const LLString& attr, const LLString& value)
1104 return false; 1105 return false;
1105} 1106}
1106 1107
1107BOOL LLXMLNode::hasAttribute(const LLString& name ) 1108BOOL LLXMLNode::hasAttribute(const char* name )
1108{ 1109{
1109 LLXMLNodePtr node; 1110 LLXMLNodePtr node;
1110 return getAttribute(name, node); 1111 return getAttribute(name, node);
1111} 1112}
1112 1113
1113BOOL LLXMLNode::getAttributeBOOL(const LLString& name, BOOL& value ) 1114BOOL LLXMLNode::getAttributeBOOL(const char* name, BOOL& value )
1114{ 1115{
1115 LLXMLNodePtr node; 1116 LLXMLNodePtr node;
1116 return (getAttribute(name, node) && node->getBoolValue(1, &value)); 1117 return (getAttribute(name, node) && node->getBoolValue(1, &value));
1117} 1118}
1118 1119
1119BOOL LLXMLNode::getAttributeU8(const LLString& name, U8& value ) 1120BOOL LLXMLNode::getAttributeU8(const char* name, U8& value )
1120{ 1121{
1121 LLXMLNodePtr node; 1122 LLXMLNodePtr node;
1122 return (getAttribute(name, node) && node->getByteValue(1, &value)); 1123 return (getAttribute(name, node) && node->getByteValue(1, &value));
1123} 1124}
1124 1125
1125BOOL LLXMLNode::getAttributeS8(const LLString& name, S8& value ) 1126BOOL LLXMLNode::getAttributeS8(const char* name, S8& value )
1126{ 1127{
1127 LLXMLNodePtr node; 1128 LLXMLNodePtr node;
1128 S32 val; 1129 S32 val;
@@ -1134,7 +1135,7 @@ BOOL LLXMLNode::getAttributeS8(const LLString& name, S8& value )
1134 return true; 1135 return true;
1135} 1136}
1136 1137
1137BOOL LLXMLNode::getAttributeU16(const LLString& name, U16& value ) 1138BOOL LLXMLNode::getAttributeU16(const char* name, U16& value )
1138{ 1139{
1139 LLXMLNodePtr node; 1140 LLXMLNodePtr node;
1140 U32 val; 1141 U32 val;
@@ -1146,7 +1147,7 @@ BOOL LLXMLNode::getAttributeU16(const LLString& name, U16& value )
1146 return true; 1147 return true;
1147} 1148}
1148 1149
1149BOOL LLXMLNode::getAttributeS16(const LLString& name, S16& value ) 1150BOOL LLXMLNode::getAttributeS16(const char* name, S16& value )
1150{ 1151{
1151 LLXMLNodePtr node; 1152 LLXMLNodePtr node;
1152 S32 val; 1153 S32 val;
@@ -1158,73 +1159,73 @@ BOOL LLXMLNode::getAttributeS16(const LLString& name, S16& value )
1158 return true; 1159 return true;
1159} 1160}
1160 1161
1161BOOL LLXMLNode::getAttributeU32(const LLString& name, U32& value ) 1162BOOL LLXMLNode::getAttributeU32(const char* name, U32& value )
1162{ 1163{
1163 LLXMLNodePtr node; 1164 LLXMLNodePtr node;
1164 return (getAttribute(name, node) && node->getUnsignedValue(1, &value)); 1165 return (getAttribute(name, node) && node->getUnsignedValue(1, &value));
1165} 1166}
1166 1167
1167BOOL LLXMLNode::getAttributeS32(const LLString& name, S32& value ) 1168BOOL LLXMLNode::getAttributeS32(const char* name, S32& value )
1168{ 1169{
1169 LLXMLNodePtr node; 1170 LLXMLNodePtr node;
1170 return (getAttribute(name, node) && node->getIntValue(1, &value)); 1171 return (getAttribute(name, node) && node->getIntValue(1, &value));
1171} 1172}
1172 1173
1173BOOL LLXMLNode::getAttributeF32(const LLString& name, F32& value ) 1174BOOL LLXMLNode::getAttributeF32(const char* name, F32& value )
1174{ 1175{
1175 LLXMLNodePtr node; 1176 LLXMLNodePtr node;
1176 return (getAttribute(name, node) && node->getFloatValue(1, &value)); 1177 return (getAttribute(name, node) && node->getFloatValue(1, &value));
1177} 1178}
1178 1179
1179BOOL LLXMLNode::getAttributeF64(const LLString& name, F64& value ) 1180BOOL LLXMLNode::getAttributeF64(const char* name, F64& value )
1180{ 1181{
1181 LLXMLNodePtr node; 1182 LLXMLNodePtr node;
1182 return (getAttribute(name, node) && node->getDoubleValue(1, &value)); 1183 return (getAttribute(name, node) && node->getDoubleValue(1, &value));
1183} 1184}
1184 1185
1185BOOL LLXMLNode::getAttributeColor(const LLString& name, LLColor4& value ) 1186BOOL LLXMLNode::getAttributeColor(const char* name, LLColor4& value )
1186{ 1187{
1187 LLXMLNodePtr node; 1188 LLXMLNodePtr node;
1188 return (getAttribute(name, node) && node->getFloatValue(4, value.mV)); 1189 return (getAttribute(name, node) && node->getFloatValue(4, value.mV));
1189} 1190}
1190 1191
1191BOOL LLXMLNode::getAttributeColor4(const LLString& name, LLColor4& value ) 1192BOOL LLXMLNode::getAttributeColor4(const char* name, LLColor4& value )
1192{ 1193{
1193 LLXMLNodePtr node; 1194 LLXMLNodePtr node;
1194 return (getAttribute(name, node) && node->getFloatValue(4, value.mV)); 1195 return (getAttribute(name, node) && node->getFloatValue(4, value.mV));
1195} 1196}
1196 1197
1197BOOL LLXMLNode::getAttributeColor4U(const LLString& name, LLColor4U& value ) 1198BOOL LLXMLNode::getAttributeColor4U(const char* name, LLColor4U& value )
1198{ 1199{
1199 LLXMLNodePtr node; 1200 LLXMLNodePtr node;
1200 return (getAttribute(name, node) && node->getByteValue(4, value.mV)); 1201 return (getAttribute(name, node) && node->getByteValue(4, value.mV));
1201} 1202}
1202 1203
1203BOOL LLXMLNode::getAttributeVector3(const LLString& name, LLVector3& value ) 1204BOOL LLXMLNode::getAttributeVector3(const char* name, LLVector3& value )
1204{ 1205{
1205 LLXMLNodePtr node; 1206 LLXMLNodePtr node;
1206 return (getAttribute(name, node) && node->getFloatValue(3, value.mV)); 1207 return (getAttribute(name, node) && node->getFloatValue(3, value.mV));
1207} 1208}
1208 1209
1209BOOL LLXMLNode::getAttributeVector3d(const LLString& name, LLVector3d& value ) 1210BOOL LLXMLNode::getAttributeVector3d(const char* name, LLVector3d& value )
1210{ 1211{
1211 LLXMLNodePtr node; 1212 LLXMLNodePtr node;
1212 return (getAttribute(name, node) && node->getDoubleValue(3, value.mdV)); 1213 return (getAttribute(name, node) && node->getDoubleValue(3, value.mdV));
1213} 1214}
1214 1215
1215BOOL LLXMLNode::getAttributeQuat(const LLString& name, LLQuaternion& value ) 1216BOOL LLXMLNode::getAttributeQuat(const char* name, LLQuaternion& value )
1216{ 1217{
1217 LLXMLNodePtr node; 1218 LLXMLNodePtr node;
1218 return (getAttribute(name, node) && node->getFloatValue(4, value.mQ)); 1219 return (getAttribute(name, node) && node->getFloatValue(4, value.mQ));
1219} 1220}
1220 1221
1221BOOL LLXMLNode::getAttributeUUID(const LLString& name, LLUUID& value ) 1222BOOL LLXMLNode::getAttributeUUID(const char* name, LLUUID& value )
1222{ 1223{
1223 LLXMLNodePtr node; 1224 LLXMLNodePtr node;
1224 return (getAttribute(name, node) && node->getUUIDValue(1, &value)); 1225 return (getAttribute(name, node) && node->getUUIDValue(1, &value));
1225} 1226}
1226 1227
1227BOOL LLXMLNode::getAttributeString(const LLString& name, LLString& value ) 1228BOOL LLXMLNode::getAttributeString(const char* name, std::string& value )
1228{ 1229{
1229 LLXMLNodePtr node; 1230 LLXMLNodePtr node;
1230 if (!getAttribute(name, node)) 1231 if (!getAttribute(name, node))
@@ -1536,14 +1537,14 @@ U32 LLXMLNode::getBoolValue(U32 expected_length, BOOL *array)
1536 return 0; 1537 return 0;
1537 } 1538 }
1538 1539
1539 LLString *str_array = new LLString[expected_length]; 1540 std::string *str_array = new std::string[expected_length];
1540 1541
1541 U32 length = getStringValue(expected_length, str_array); 1542 U32 length = getStringValue(expected_length, str_array);
1542 1543
1543 U32 ret_length = 0; 1544 U32 ret_length = 0;
1544 for (U32 i=0; i<length; ++i) 1545 for (U32 i=0; i<length; ++i)
1545 { 1546 {
1546 LLString::toLower(str_array[i]); 1547 LLStringUtil::toLower(str_array[i]);
1547 if (str_array[i] == "false") 1548 if (str_array[i] == "false")
1548 { 1549 {
1549 array[ret_length++] = FALSE; 1550 array[ret_length++] = FALSE;
@@ -1872,7 +1873,7 @@ U32 LLXMLNode::getDoubleValue(U32 expected_length, F64 *array, Encoding encoding
1872 return i; 1873 return i;
1873} 1874}
1874 1875
1875U32 LLXMLNode::getStringValue(U32 expected_length, LLString *array) 1876U32 LLXMLNode::getStringValue(U32 expected_length, std::string *array)
1876{ 1877{
1877 llassert(array); 1878 llassert(array);
1878 1879
@@ -1947,7 +1948,7 @@ U32 LLXMLNode::getUUIDValue(U32 expected_length, LLUUID *array)
1947 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); /* Flawfinder: ignore */ 1948 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); /* Flawfinder: ignore */
1948 uuid_string[(UUID_STR_LENGTH-1)] = 0; 1949 uuid_string[(UUID_STR_LENGTH-1)] = 0;
1949 1950
1950 if (!LLUUID::parseUUID(uuid_string, &uuid_value)) 1951 if (!LLUUID::parseUUID(std::string(uuid_string), &uuid_value))
1951 { 1952 {
1952 break; 1953 break;
1953 } 1954 }
@@ -1975,7 +1976,7 @@ U32 LLXMLNode::getNodeRefValue(U32 expected_length, LLXMLNode **array)
1975 return 0; 1976 return 0;
1976 } 1977 }
1977 1978
1978 LLString *string_array = new LLString[expected_length]; 1979 std::string *string_array = new std::string[expected_length];
1979 1980
1980 U32 num_strings = getStringValue(expected_length, string_array); 1981 U32 num_strings = getStringValue(expected_length, string_array);
1981 1982
@@ -2015,7 +2016,7 @@ void LLXMLNode::setBoolValue(U32 length, const BOOL *array)
2015{ 2016{
2016 if (length == 0) return; 2017 if (length == 0) return;
2017 2018
2018 LLString new_value; 2019 std::string new_value;
2019 for (U32 pos=0; pos<length; ++pos) 2020 for (U32 pos=0; pos<length; ++pos)
2020 { 2021 {
2021 if (pos > 0) 2022 if (pos > 0)
@@ -2038,7 +2039,7 @@ void LLXMLNode::setByteValue(U32 length, const U8* const array, Encoding encodin
2038{ 2039{
2039 if (length == 0) return; 2040 if (length == 0) return;
2040 2041
2041 LLString new_value; 2042 std::string new_value;
2042 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2043 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2043 { 2044 {
2044 for (U32 pos=0; pos<length; ++pos) 2045 for (U32 pos=0; pos<length; ++pos)
@@ -2081,7 +2082,7 @@ void LLXMLNode::setIntValue(U32 length, const S32 *array, Encoding encoding)
2081{ 2082{
2082 if (length == 0) return; 2083 if (length == 0) return;
2083 2084
2084 LLString new_value; 2085 std::string new_value;
2085 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2086 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2086 { 2087 {
2087 for (U32 pos=0; pos<length; ++pos) 2088 for (U32 pos=0; pos<length; ++pos)
@@ -2128,7 +2129,7 @@ void LLXMLNode::setUnsignedValue(U32 length, const U32* array, Encoding encoding
2128{ 2129{
2129 if (length == 0) return; 2130 if (length == 0) return;
2130 2131
2131 LLString new_value; 2132 std::string new_value;
2132 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2133 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2133 { 2134 {
2134 for (U32 pos=0; pos<length; ++pos) 2135 for (U32 pos=0; pos<length; ++pos)
@@ -2177,7 +2178,7 @@ void LLXMLNode::setLongValue(U32 length, const U64* array, Encoding encoding)
2177{ 2178{
2178 if (length == 0) return; 2179 if (length == 0) return;
2179 2180
2180 LLString new_value; 2181 std::string new_value;
2181 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2182 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2182 { 2183 {
2183 for (U32 pos=0; pos<length; ++pos) 2184 for (U32 pos=0; pos<length; ++pos)
@@ -2226,21 +2227,21 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
2226{ 2227{
2227 if (length == 0) return; 2228 if (length == 0) return;
2228 2229
2229 LLString new_value; 2230 std::string new_value;
2230 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2231 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2231 { 2232 {
2232 char format_string[10]; /* Flawfinder: ignore */ 2233 std::string format_string;
2233 if (precision > 0) 2234 if (precision > 0)
2234 { 2235 {
2235 if (precision > 25) 2236 if (precision > 25)
2236 { 2237 {
2237 precision = 25; 2238 precision = 25;
2238 } 2239 }
2239 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */ 2240 format_string = llformat( "%%.%dg", precision);
2240 } 2241 }
2241 else 2242 else
2242 { 2243 {
2243 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */ 2244 format_string = llformat( "%%g");
2244 } 2245 }
2245 2246
2246 for (U32 pos=0; pos<length; ++pos) 2247 for (U32 pos=0; pos<length; ++pos)
@@ -2248,11 +2249,11 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
2248 if (pos > 0) 2249 if (pos > 0)
2249 { 2250 {
2250 new_value.append(" "); 2251 new_value.append(" ");
2251 new_value.append(llformat(format_string, array[pos])); 2252 new_value.append(llformat(format_string.c_str(), array[pos]));
2252 } 2253 }
2253 else 2254 else
2254 { 2255 {
2255 new_value.assign(llformat(format_string, array[pos])); 2256 new_value.assign(llformat(format_string.c_str(), array[pos]));
2256 } 2257 }
2257 } 2258 }
2258 mValue = new_value; 2259 mValue = new_value;
@@ -2277,32 +2278,32 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
2277{ 2278{
2278 if (length == 0) return; 2279 if (length == 0) return;
2279 2280
2280 LLString new_value; 2281 std::string new_value;
2281 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2282 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2282 { 2283 {
2283 char format_string[10]; /* Flawfinder: ignore */ 2284 std::string format_string;
2284 if (precision > 0) 2285 if (precision > 0)
2285 { 2286 {
2286 if (precision > 25) 2287 if (precision > 25)
2287 { 2288 {
2288 precision = 25; 2289 precision = 25;
2289 } 2290 }
2290 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */ 2291 format_string = llformat( "%%.%dg", precision);
2291 } 2292 }
2292 else 2293 else
2293 { 2294 {
2294 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */ 2295 format_string = llformat( "%%g");
2295 } 2296 }
2296 for (U32 pos=0; pos<length; ++pos) 2297 for (U32 pos=0; pos<length; ++pos)
2297 { 2298 {
2298 if (pos > 0) 2299 if (pos > 0)
2299 { 2300 {
2300 new_value.append(" "); 2301 new_value.append(" ");
2301 new_value.append(llformat(format_string, array[pos])); 2302 new_value.append(llformat(format_string.c_str(), array[pos]));
2302 } 2303 }
2303 else 2304 else
2304 { 2305 {
2305 new_value.assign(llformat(format_string, array[pos])); 2306 new_value.assign(llformat(format_string.c_str(), array[pos]));
2306 } 2307 }
2307 } 2308 }
2308 mValue = new_value; 2309 mValue = new_value;
@@ -2325,10 +2326,10 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
2325} 2326}
2326 2327
2327// static 2328// static
2328LLString LLXMLNode::escapeXML(const LLString& xml) 2329std::string LLXMLNode::escapeXML(const std::string& xml)
2329{ 2330{
2330 LLString out; 2331 std::string out;
2331 for (LLString::size_type i = 0; i < xml.size(); ++i) 2332 for (std::string::size_type i = 0; i < xml.size(); ++i)
2332 { 2333 {
2333 char c = xml[i]; 2334 char c = xml[i];
2334 switch(c) 2335 switch(c)
@@ -2344,11 +2345,11 @@ LLString LLXMLNode::escapeXML(const LLString& xml)
2344 return out; 2345 return out;
2345} 2346}
2346 2347
2347void LLXMLNode::setStringValue(U32 length, const LLString *array) 2348void LLXMLNode::setStringValue(U32 length, const std::string *array)
2348{ 2349{
2349 if (length == 0) return; 2350 if (length == 0) return;
2350 2351
2351 LLString new_value; 2352 std::string new_value;
2352 for (U32 pos=0; pos<length; ++pos) 2353 for (U32 pos=0; pos<length; ++pos)
2353 { 2354 {
2354 new_value.append(escapeXML(array[pos])); 2355 new_value.append(escapeXML(array[pos]));
@@ -2365,7 +2366,7 @@ void LLXMLNode::setUUIDValue(U32 length, const LLUUID *array)
2365{ 2366{
2366 if (length == 0) return; 2367 if (length == 0) return;
2367 2368
2368 LLString new_value; 2369 std::string new_value;
2369 for (U32 pos=0; pos<length; ++pos) 2370 for (U32 pos=0; pos<length; ++pos)
2370 { 2371 {
2371 new_value.append(array[pos].asString()); 2372 new_value.append(array[pos].asString());
@@ -2382,7 +2383,7 @@ void LLXMLNode::setNodeRefValue(U32 length, const LLXMLNode **array)
2382{ 2383{
2383 if (length == 0) return; 2384 if (length == 0) return;
2384 2385
2385 LLString new_value; 2386 std::string new_value;
2386 for (U32 pos=0; pos<length; ++pos) 2387 for (U32 pos=0; pos<length; ++pos)
2387 { 2388 {
2388 if (array[pos]->mID != "") 2389 if (array[pos]->mID != "")
@@ -2402,7 +2403,7 @@ void LLXMLNode::setNodeRefValue(U32 length, const LLXMLNode **array)
2402 mType = TYPE_NODEREF; 2403 mType = TYPE_NODEREF;
2403} 2404}
2404 2405
2405void LLXMLNode::setValue(const LLString& value) 2406void LLXMLNode::setValue(const std::string& value)
2406{ 2407{
2407 if (TYPE_CONTAINER == mType) 2408 if (TYPE_CONTAINER == mType)
2408 { 2409 {
@@ -2439,7 +2440,7 @@ void LLXMLNode::findDefault(LLXMLNode *defaults_list)
2439 mDefault = NULL; 2440 mDefault = NULL;
2440} 2441}
2441 2442
2442BOOL LLXMLNode::deleteChildren(const LLString& name) 2443BOOL LLXMLNode::deleteChildren(const std::string& name)
2443{ 2444{
2444 U32 removed_count = 0; 2445 U32 removed_count = 0;
2445 LLXMLNodeList node_list; 2446 LLXMLNodeList node_list;
@@ -2491,7 +2492,7 @@ void LLXMLNode::setAttributes(LLXMLNode::ValueType type, U32 precision, LLXMLNod
2491 mLength = length; 2492 mLength = length;
2492} 2493}
2493 2494
2494void LLXMLNode::setName(const LLString& name) 2495void LLXMLNode::setName(const std::string& name)
2495{ 2496{
2496 setName(gStringTable.addStringEntry(name)); 2497 setName(gStringTable.addStringEntry(name));
2497} 2498}
@@ -2512,10 +2513,11 @@ void LLXMLNode::setName(LLStringTableEntry* name)
2512 } 2513 }
2513} 2514}
2514 2515
2515void LLXMLNode::appendValue(const LLString& value) 2516// Unused
2516{ 2517// void LLXMLNode::appendValue(const std::string& value)
2517 mValue.append(value); 2518// {
2518} 2519// mValue.append(value);
2520// }
2519 2521
2520U32 LLXMLNode::getChildCount() const 2522U32 LLXMLNode::getChildCount() const
2521{ 2523{
@@ -2565,14 +2567,13 @@ LLXMLNode *get_rand_node(LLXMLNode *node)
2565void LLXMLNode::createUnitTest(S32 max_num_children) 2567void LLXMLNode::createUnitTest(S32 max_num_children)
2566{ 2568{
2567 // Random ID 2569 // Random ID
2568 char rand_id[20]; /* Flawfinder: ignore */ 2570 std::string rand_id;
2569 U32 rand_id_len = get_rand(10)+5; 2571 U32 rand_id_len = get_rand(10)+5;
2570 U32 pos = 0; 2572 for (U32 pos = 0; pos<rand_id_len; ++pos)
2571 for (; pos<rand_id_len; ++pos)
2572 { 2573 {
2573 rand_id[pos] = get_rand(26)+'a'; 2574 char c = 'a' + get_rand(26);
2575 rand_id.append(1, c);
2574 } 2576 }
2575 rand_id[pos] = 0;
2576 mID = rand_id; 2577 mID = rand_id;
2577 2578
2578 if (max_num_children < 2) 2579 if (max_num_children < 2)
@@ -2594,26 +2595,24 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2594 for (U32 child_num=0; child_num<num_children; ++child_num) 2595 for (U32 child_num=0; child_num<num_children; ++child_num)
2595 { 2596 {
2596 // Random Name 2597 // Random Name
2597 char child_name[20]; /* Flawfinder: ignore */ 2598 std::string child_name;
2598 U32 child_name_len = get_rand(10)+5; 2599 U32 child_name_len = get_rand(10)+5;
2599 pos = 0; 2600 for (U32 pos = 0; pos<child_name_len; ++pos)
2600 for (; pos<child_name_len; ++pos)
2601 { 2601 {
2602 child_name[pos] = get_rand(26)+'a'; 2602 char c = 'a' + get_rand(26);
2603 child_name.append(1, c);
2603 } 2604 }
2604 child_name[pos] = 0;
2605 2605
2606 LLXMLNode *new_child = createChild(child_name, FALSE); 2606 LLXMLNode *new_child = createChild(child_name.c_str(), FALSE);
2607 2607
2608 // Random ID 2608 // Random ID
2609 char child_id[20]; /* Flawfinder: ignore */ 2609 std::string child_id;
2610 U32 child_id_len = get_rand(10)+5; 2610 U32 child_id_len = get_rand(10)+5;
2611 pos = 0; 2611 for (U32 pos=0; pos<child_id_len; ++pos)
2612 for (; pos<child_id_len; ++pos)
2613 { 2612 {
2614 child_id[pos] = get_rand(26)+'a'; 2613 char c = 'a' + get_rand(26);
2614 child_id.append(1, c);
2615 } 2615 }
2616 child_id[pos] = 0;
2617 new_child->mID = child_id; 2616 new_child->mID = child_id;
2618 2617
2619 // Random Length 2618 // Random Length
@@ -2747,7 +2746,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2747 createChild("float_checksum", TRUE)->setUnsignedValue(1, &float_checksum, LLXMLNode::ENCODING_HEX); 2746 createChild("float_checksum", TRUE)->setUnsignedValue(1, &float_checksum, LLXMLNode::ENCODING_HEX);
2748} 2747}
2749 2748
2750BOOL LLXMLNode::performUnitTest(LLString &error_buffer) 2749BOOL LLXMLNode::performUnitTest(std::string &error_buffer)
2751{ 2750{
2752 if (!mChildren) 2751 if (!mChildren)
2753 { 2752 {
@@ -3021,10 +3020,10 @@ LLXMLNodePtr LLXMLNode::getNextSibling()
3021 return ret; 3020 return ret;
3022} 3021}
3023 3022
3024LLString LLXMLNode::getTextContents() const 3023std::string LLXMLNode::getTextContents() const
3025{ 3024{
3026 std::string msg; 3025 std::string msg;
3027 LLString contents = mValue; 3026 std::string contents = mValue;
3028 std::string::size_type n = contents.find_first_not_of(" \t\n"); 3027 std::string::size_type n = contents.find_first_not_of(" \t\n");
3029 if (n != std::string::npos && contents[n] == '\"') 3028 if (n != std::string::npos && contents[n] == '\"')
3030 { 3029 {
@@ -3068,10 +3067,10 @@ LLString LLXMLNode::getTextContents() const
3068 else 3067 else
3069 { 3068 {
3070 // Case 2: node has embedded text (beginning and trailing whitespace trimmed) 3069 // Case 2: node has embedded text (beginning and trailing whitespace trimmed)
3071 LLString::size_type start = mValue.find_first_not_of(" \t\n"); 3070 std::string::size_type start = mValue.find_first_not_of(" \t\n");
3072 if (start != mValue.npos) 3071 if (start != mValue.npos)
3073 { 3072 {
3074 LLString::size_type end = mValue.find_last_not_of(" \t\n"); 3073 std::string::size_type end = mValue.find_last_not_of(" \t\n");
3075 if (end != mValue.npos) 3074 if (end != mValue.npos)
3076 { 3075 {
3077 msg = mValue.substr(start, end+1-start); 3076 msg = mValue.substr(start, end+1-start);
diff --git a/linden/indra/llxml/llxmlnode.h b/linden/indra/llxml/llxmlnode.h
index 269108c..ed170f6 100644
--- a/linden/indra/llxml/llxmlnode.h
+++ b/linden/indra/llxml/llxmlnode.h
@@ -49,6 +49,13 @@
49#include "llstringtable.h" 49#include "llstringtable.h"
50 50
51 51
52class LLVector3;
53class LLVector3d;
54class LLQuaternion;
55class LLUUID;
56class LLColor4;
57class LLColor4U;
58
52 59
53struct CompareAttributes 60struct CompareAttributes
54{ 61{
@@ -68,10 +75,18 @@ struct CompareAttributes
68 75
69class LLXMLNode; 76class LLXMLNode;
70typedef LLPointer<LLXMLNode> LLXMLNodePtr; 77typedef LLPointer<LLXMLNode> LLXMLNodePtr;
71typedef std::multimap<LLString, LLXMLNodePtr > LLXMLNodeList; 78typedef std::multimap<std::string, LLXMLNodePtr > LLXMLNodeList;
72typedef std::multimap<const LLStringTableEntry *, LLXMLNodePtr > LLXMLChildList; 79typedef std::multimap<const LLStringTableEntry *, LLXMLNodePtr > LLXMLChildList;
73typedef std::map<const LLStringTableEntry *, LLXMLNodePtr, CompareAttributes> LLXMLAttribList; 80typedef std::map<const LLStringTableEntry *, LLXMLNodePtr, CompareAttributes> LLXMLAttribList;
74 81
82class LLColor4;
83class LLColor4U;
84class LLQuaternion;
85class LLVector3;
86class LLVector3d;
87class LLVector4;
88class LLVector4U;
89
75struct LLXMLChildren 90struct LLXMLChildren
76{ 91{
77 LLXMLChildList map; // Map of children names->pointers 92 LLXMLChildList map; // Map of children names->pointers
@@ -107,7 +122,7 @@ protected:
107 122
108public: 123public:
109 LLXMLNode(); 124 LLXMLNode();
110 LLXMLNode(const LLString& name, BOOL is_attribute); 125 LLXMLNode(const char* name, BOOL is_attribute);
111 LLXMLNode(LLStringTableEntry* name, BOOL is_attribute); 126 LLXMLNode(LLStringTableEntry* name, BOOL is_attribute);
112 127
113 BOOL isNull(); 128 BOOL isNull();
@@ -118,7 +133,7 @@ public:
118 133
119 // Serialization 134 // Serialization
120 static bool parseFile( 135 static bool parseFile(
121 LLString filename, 136 const std::string& filename,
122 LLXMLNodePtr& node, 137 LLXMLNodePtr& node,
123 LLXMLNode* defaults_tree); 138 LLXMLNode* defaults_tree);
124 static bool parseBuffer( 139 static bool parseBuffer(
@@ -134,16 +149,16 @@ public:
134 LLXMLNodePtr& node, 149 LLXMLNodePtr& node,
135 LLXMLNodePtr& update_node); 150 LLXMLNodePtr& update_node);
136 static void writeHeaderToFile(LLFILE *fOut); 151 static void writeHeaderToFile(LLFILE *fOut);
137 void writeToFile(LLFILE *fOut, LLString indent = LLString()); 152 void writeToFile(LLFILE *fOut, const std::string& indent = std::string());
138 void writeToOstream(std::ostream& output_stream, const LLString& indent = LLString()); 153 void writeToOstream(std::ostream& output_stream, const std::string& indent = std::string());
139 154
140 // Utility 155 // Utility
141 void findName(const LLString& name, LLXMLNodeList &results); 156 void findName(const std::string& name, LLXMLNodeList &results);
142 void findName(LLStringTableEntry* name, LLXMLNodeList &results); 157 void findName(LLStringTableEntry* name, LLXMLNodeList &results);
143 void findID(const LLString& id, LLXMLNodeList &results); 158 void findID(const std::string& id, LLXMLNodeList &results);
144 159
145 160
146 virtual LLXMLNodePtr createChild(const LLString& name, BOOL is_attribute); 161 virtual LLXMLNodePtr createChild(const char* name, BOOL is_attribute);
147 virtual LLXMLNodePtr createChild(LLStringTableEntry* name, BOOL is_attribute); 162 virtual LLXMLNodePtr createChild(LLStringTableEntry* name, BOOL is_attribute);
148 163
149 164
@@ -155,49 +170,49 @@ public:
155 U32 getLongValue(U32 expected_length, U64 *array, Encoding encoding = ENCODING_DEFAULT); 170 U32 getLongValue(U32 expected_length, U64 *array, Encoding encoding = ENCODING_DEFAULT);
156 U32 getFloatValue(U32 expected_length, F32 *array, Encoding encoding = ENCODING_DEFAULT); 171 U32 getFloatValue(U32 expected_length, F32 *array, Encoding encoding = ENCODING_DEFAULT);
157 U32 getDoubleValue(U32 expected_length, F64 *array, Encoding encoding = ENCODING_DEFAULT); 172 U32 getDoubleValue(U32 expected_length, F64 *array, Encoding encoding = ENCODING_DEFAULT);
158 U32 getStringValue(U32 expected_length, LLString *array); 173 U32 getStringValue(U32 expected_length, std::string *array);
159 U32 getUUIDValue(U32 expected_length, LLUUID *array); 174 U32 getUUIDValue(U32 expected_length, LLUUID *array);
160 U32 getNodeRefValue(U32 expected_length, LLXMLNode **array); 175 U32 getNodeRefValue(U32 expected_length, LLXMLNode **array);
161 176
162 BOOL hasAttribute(const LLString& name ); 177 BOOL hasAttribute(const char* name );
163 178
164 BOOL getAttributeBOOL(const LLString& name, BOOL& value ); 179 BOOL getAttributeBOOL(const char* name, BOOL& value );
165 BOOL getAttributeU8(const LLString& name, U8& value ); 180 BOOL getAttributeU8(const char* name, U8& value );
166 BOOL getAttributeS8(const LLString& name, S8& value ); 181 BOOL getAttributeS8(const char* name, S8& value );
167 BOOL getAttributeU16(const LLString& name, U16& value ); 182 BOOL getAttributeU16(const char* name, U16& value );
168 BOOL getAttributeS16(const LLString& name, S16& value ); 183 BOOL getAttributeS16(const char* name, S16& value );
169 BOOL getAttributeU32(const LLString& name, U32& value ); 184 BOOL getAttributeU32(const char* name, U32& value );
170 BOOL getAttributeS32(const LLString& name, S32& value ); 185 BOOL getAttributeS32(const char* name, S32& value );
171 BOOL getAttributeF32(const LLString& name, F32& value ); 186 BOOL getAttributeF32(const char* name, F32& value );
172 BOOL getAttributeF64(const LLString& name, F64& value ); 187 BOOL getAttributeF64(const char* name, F64& value );
173 BOOL getAttributeColor(const LLString& name, LLColor4& value ); 188 BOOL getAttributeColor(const char* name, LLColor4& value );
174 BOOL getAttributeColor4(const LLString& name, LLColor4& value ); 189 BOOL getAttributeColor4(const char* name, LLColor4& value );
175 BOOL getAttributeColor4U(const LLString& name, LLColor4U& value ); 190 BOOL getAttributeColor4U(const char* name, LLColor4U& value );
176 BOOL getAttributeVector3(const LLString& name, LLVector3& value ); 191 BOOL getAttributeVector3(const char* name, LLVector3& value );
177 BOOL getAttributeVector3d(const LLString& name, LLVector3d& value ); 192 BOOL getAttributeVector3d(const char* name, LLVector3d& value );
178 BOOL getAttributeQuat(const LLString& name, LLQuaternion& value ); 193 BOOL getAttributeQuat(const char* name, LLQuaternion& value );
179 BOOL getAttributeUUID(const LLString& name, LLUUID& value ); 194 BOOL getAttributeUUID(const char* name, LLUUID& value );
180 BOOL getAttributeString(const LLString& name, LLString& value ); 195 BOOL getAttributeString(const char* name, std::string& value );
181 196
182 const ValueType& getType() const { return mType; } 197 const ValueType& getType() const { return mType; }
183 U32 getLength() const { return mLength; } 198 U32 getLength() const { return mLength; }
184 U32 getPrecision() const { return mPrecision; } 199 U32 getPrecision() const { return mPrecision; }
185 const LLString& getValue() const { return mValue; } 200 const std::string& getValue() const { return mValue; }
186 LLString getTextContents() const; 201 std::string getTextContents() const;
187 const LLStringTableEntry* getName() const { return mName; } 202 const LLStringTableEntry* getName() const { return mName; }
188 BOOL hasName(const char* name) const { return mName == gStringTable.checkStringEntry(name); } 203 BOOL hasName(const char* name) const { return mName == gStringTable.checkStringEntry(name); }
189 BOOL hasName(LLString name) const { return mName == gStringTable.checkStringEntry(name.c_str()); } 204 BOOL hasName(const std::string& name) const { return mName == gStringTable.checkStringEntry(name.c_str()); }
190 const LLString& getID() const { return mID; } 205 const std::string& getID() const { return mID; }
191 206
192 U32 getChildCount() const; 207 U32 getChildCount() const;
193 // getChild returns a Null LLXMLNode (not a NULL pointer) if there is no such child. 208 // getChild returns a Null LLXMLNode (not a NULL pointer) if there is no such child.
194 // This child has no value so any getTYPEValue() calls on it will return 0. 209 // This child has no value so any getTYPEValue() calls on it will return 0.
195 bool getChild(const LLString& name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); 210 bool getChild(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE);
196 bool getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); 211 bool getChild(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE);
197 void getChildren(const LLString& name, LLXMLNodeList &children, BOOL use_default_if_missing = TRUE) const; 212 void getChildren(const char* name, LLXMLNodeList &children, BOOL use_default_if_missing = TRUE) const;
198 void getChildren(const LLStringTableEntry* name, LLXMLNodeList &children, BOOL use_default_if_missing = TRUE) const; 213 void getChildren(const LLStringTableEntry* name, LLXMLNodeList &children, BOOL use_default_if_missing = TRUE) const;
199 214
200 bool getAttribute(const LLString& name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); 215 bool getAttribute(const char* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE);
201 bool getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE); 216 bool getAttribute(const LLStringTableEntry* name, LLXMLNodePtr& node, BOOL use_default_if_missing = TRUE);
202 217
203 // The following skip over attributes 218 // The following skip over attributes
@@ -208,7 +223,7 @@ public:
208 223
209 // Setters 224 // Setters
210 225
211 bool setAttributeString(const LLString& attr, const LLString& value); 226 bool setAttributeString(const char* attr, const std::string& value);
212 227
213 void setBoolValue(const BOOL value) { setBoolValue(1, &value); } 228 void setBoolValue(const BOOL value) { setBoolValue(1, &value); }
214 void setByteValue(const U8 value, Encoding encoding = ENCODING_DEFAULT) { setByteValue(1, &value, encoding); } 229 void setByteValue(const U8 value, Encoding encoding = ENCODING_DEFAULT) { setByteValue(1, &value, encoding); }
@@ -217,7 +232,7 @@ public:
217 void setLongValue(const U64 value, Encoding encoding = ENCODING_DEFAULT) { setLongValue(1, &value, encoding); } 232 void setLongValue(const U64 value, Encoding encoding = ENCODING_DEFAULT) { setLongValue(1, &value, encoding); }
218 void setFloatValue(const F32 value, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0) { setFloatValue(1, &value, encoding); } 233 void setFloatValue(const F32 value, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0) { setFloatValue(1, &value, encoding); }
219 void setDoubleValue(const F64 value, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0) { setDoubleValue(1, &value, encoding); } 234 void setDoubleValue(const F64 value, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0) { setDoubleValue(1, &value, encoding); }
220 void setStringValue(const LLString value) { setStringValue(1, &value); } 235 void setStringValue(const std::string& value) { setStringValue(1, &value); }
221 void setUUIDValue(const LLUUID value) { setUUIDValue(1, &value); } 236 void setUUIDValue(const LLUUID value) { setUUIDValue(1, &value); }
222 void setNodeRefValue(const LLXMLNode *value) { setNodeRefValue(1, &value); } 237 void setNodeRefValue(const LLXMLNode *value) { setNodeRefValue(1, &value); }
223 238
@@ -228,16 +243,16 @@ public:
228 void setLongValue(U32 length, const U64 *array, Encoding encoding = ENCODING_DEFAULT); 243 void setLongValue(U32 length, const U64 *array, Encoding encoding = ENCODING_DEFAULT);
229 void setFloatValue(U32 length, const F32 *array, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0); 244 void setFloatValue(U32 length, const F32 *array, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0);
230 void setDoubleValue(U32 length, const F64 *array, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0); 245 void setDoubleValue(U32 length, const F64 *array, Encoding encoding = ENCODING_DEFAULT, U32 precision = 0);
231 void setStringValue(U32 length, const LLString *array); 246 void setStringValue(U32 length, const std::string *array);
232 void setUUIDValue(U32 length, const LLUUID *array); 247 void setUUIDValue(U32 length, const LLUUID *array);
233 void setNodeRefValue(U32 length, const LLXMLNode **array); 248 void setNodeRefValue(U32 length, const LLXMLNode **array);
234 void setValue(const LLString& value); 249 void setValue(const std::string& value);
235 void setName(const LLString& name); 250 void setName(const std::string& name);
236 void setName(LLStringTableEntry* name); 251 void setName(LLStringTableEntry* name);
237 252
238 // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt) 253 // Escapes " (quot) ' (apos) & (amp) < (lt) > (gt)
239 // TomY TODO: Make this private 254 // TomY TODO: Make this private
240 static LLString escapeXML(const LLString& xml); 255 static std::string escapeXML(const std::string& xml);
241 256
242 // Set the default node corresponding to this default node 257 // Set the default node corresponding to this default node
243 void setDefault(LLXMLNode *default_node); 258 void setDefault(LLXMLNode *default_node);
@@ -250,20 +265,20 @@ public:
250 // Delete any child nodes that aren't among the tree's children, recursive 265 // Delete any child nodes that aren't among the tree's children, recursive
251 void scrubToTree(LLXMLNode *tree); 266 void scrubToTree(LLXMLNode *tree);
252 267
253 BOOL deleteChildren(const LLString& name); 268 BOOL deleteChildren(const std::string& name);
254 BOOL deleteChildren(LLStringTableEntry* name); 269 BOOL deleteChildren(LLStringTableEntry* name);
255 void setAttributes(ValueType type, U32 precision, Encoding encoding, U32 length); 270 void setAttributes(ValueType type, U32 precision, Encoding encoding, U32 length);
256 void appendValue(const LLString& value); 271// void appendValue(const std::string& value); // Unused
257 272
258 // Unit Testing 273 // Unit Testing
259 void createUnitTest(S32 max_num_children); 274 void createUnitTest(S32 max_num_children);
260 BOOL performUnitTest(LLString &error_buffer); 275 BOOL performUnitTest(std::string &error_buffer);
261 276
262protected: 277protected:
263 BOOL removeChild(LLXMLNode* child); 278 BOOL removeChild(LLXMLNode* child);
264 279
265public: 280public:
266 LLString mID; // The ID attribute of this node 281 std::string mID; // The ID attribute of this node
267 282
268 XML_Parser *mParser; // Temporary pointer while loading 283 XML_Parser *mParser; // Temporary pointer while loading
269 284
@@ -286,7 +301,7 @@ public:
286 301
287protected: 302protected:
288 LLStringTableEntry *mName; // The name of this node 303 LLStringTableEntry *mName; // The name of this node
289 LLString mValue; // The value of this node (use getters/setters only) 304 std::string mValue; // The value of this node (use getters/setters only)
290 305
291 LLXMLNodePtr mDefault; // Mirror node in the default tree 306 LLXMLNodePtr mDefault; // Mirror node in the default tree
292 307
diff --git a/linden/indra/llxml/llxmlparser.cpp b/linden/indra/llxml/llxmlparser.cpp
index 3b4d944..b0a3a05 100644
--- a/linden/indra/llxml/llxmlparser.cpp
+++ b/linden/indra/llxml/llxmlparser.cpp
@@ -45,7 +45,7 @@ LLXmlParser::LLXmlParser()
45 mParser( NULL ), 45 mParser( NULL ),
46 mDepth( 0 ) 46 mDepth( 0 )
47{ 47{
48 strcpy( mAuxErrorString, "no error" ); /* Flawfinder: ignore */ 48 mAuxErrorString = "no error";
49 49
50 // Override the document's declared encoding. 50 // Override the document's declared encoding.
51 mParser = XML_ParserCreate(NULL); 51 mParser = XML_ParserCreate(NULL);
@@ -77,10 +77,10 @@ BOOL LLXmlParser::parseFile(const std::string &path)
77 77
78 BOOL success = TRUE; 78 BOOL success = TRUE;
79 79
80 LLFILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */ 80 LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */
81 if( !file ) 81 if( !file )
82 { 82 {
83 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */ 83 mAuxErrorString = llformat( "Couldn't open file %s", path.c_str());
84 success = FALSE; 84 success = FALSE;
85 } 85 }
86 else 86 else
@@ -94,7 +94,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
94 void* buffer = XML_GetBuffer(mParser, buffer_size); 94 void* buffer = XML_GetBuffer(mParser, buffer_size);
95 if( !buffer ) 95 if( !buffer )
96 { 96 {
97 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */ 97 mAuxErrorString = llformat( "Unable to allocate XML buffer while reading file %s", path.c_str() );
98 success = FALSE; 98 success = FALSE;
99 goto exit_label; 99 goto exit_label;
100 } 100 }
@@ -102,14 +102,14 @@ BOOL LLXmlParser::parseFile(const std::string &path)
102 bytes_read = (S32)fread(buffer, 1, buffer_size, file); 102 bytes_read = (S32)fread(buffer, 1, buffer_size, file);
103 if( bytes_read <= 0 ) 103 if( bytes_read <= 0 )
104 { 104 {
105 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */ 105 mAuxErrorString = llformat( "Error while reading file %s", path.c_str() );
106 success = FALSE; 106 success = FALSE;
107 goto exit_label; 107 goto exit_label;
108 } 108 }
109 109
110 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) ) 110 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
111 { 111 {
112 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */ 112 mAuxErrorString = llformat( "Error while parsing file %s", path.c_str() );
113 success = FALSE; 113 success = FALSE;
114 } 114 }
115 115
@@ -146,7 +146,7 @@ const char* LLXmlParser::getErrorString()
146 const char* error_string = XML_ErrorString(XML_GetErrorCode( mParser )); 146 const char* error_string = XML_ErrorString(XML_GetErrorCode( mParser ));
147 if( !error_string ) 147 if( !error_string )
148 { 148 {
149 error_string = mAuxErrorString; 149 error_string = mAuxErrorString.c_str();
150 } 150 }
151 return error_string; 151 return error_string;
152} 152}
diff --git a/linden/indra/llxml/llxmlparser.h b/linden/indra/llxml/llxmlparser.h
index 7ce5524..4717d5d 100644
--- a/linden/indra/llxml/llxmlparser.h
+++ b/linden/indra/llxml/llxmlparser.h
@@ -132,7 +132,7 @@ public:
132protected: 132protected:
133 XML_Parser mParser; 133 XML_Parser mParser;
134 int mDepth; 134 int mDepth;
135 char mAuxErrorString[1024]; /*Flawfinder: ignore*/ 135 std::string mAuxErrorString;
136}; 136};
137 137
138#endif // LL_LLXMLPARSER_H 138#endif // LL_LLXMLPARSER_H
diff --git a/linden/indra/llxml/llxmltree.cpp b/linden/indra/llxml/llxmltree.cpp
index 4ac05f9..0c24d9f 100644
--- a/linden/indra/llxml/llxmltree.cpp
+++ b/linden/indra/llxml/llxmltree.cpp
@@ -90,11 +90,11 @@ void LLXmlTree::dump()
90 } 90 }
91} 91}
92 92
93void LLXmlTree::dumpNode( LLXmlTreeNode* node, const LLString& prefix ) 93void LLXmlTree::dumpNode( LLXmlTreeNode* node, const std::string& prefix )
94{ 94{
95 node->dump( prefix ); 95 node->dump( prefix );
96 96
97 LLString new_prefix = prefix + " "; 97 std::string new_prefix = prefix + " ";
98 for( LLXmlTreeNode* child = node->getFirstChild(); child; child = node->getNextChild() ) 98 for( LLXmlTreeNode* child = node->getFirstChild(); child; child = node->getNextChild() )
99 { 99 {
100 dumpNode( child, new_prefix ); 100 dumpNode( child, new_prefix );
@@ -121,7 +121,7 @@ LLXmlTreeNode::~LLXmlTreeNode()
121 delete *child_iter; 121 delete *child_iter;
122} 122}
123 123
124void LLXmlTreeNode::dump( const LLString& prefix ) 124void LLXmlTreeNode::dump( const std::string& prefix )
125{ 125{
126 llinfos << prefix << mName ; 126 llinfos << prefix << mName ;
127 if( !mContents.empty() ) 127 if( !mContents.empty() )
@@ -132,7 +132,7 @@ void LLXmlTreeNode::dump( const LLString& prefix )
132 for (iter=mAttributes.begin(); iter != mAttributes.end(); iter++) 132 for (iter=mAttributes.begin(); iter != mAttributes.end(); iter++)
133 { 133 {
134 LLStdStringHandle key = iter->first; 134 LLStdStringHandle key = iter->first;
135 const LLString* value = iter->second; 135 const std::string* value = iter->second;
136 llcont << prefix << " " << key << "=" << (value->empty() ? "NULL" : *value); 136 llcont << prefix << " " << key << "=" << (value->empty() ? "NULL" : *value);
137 } 137 }
138 llcont << llendl; 138 llcont << llendl;
@@ -148,7 +148,7 @@ BOOL LLXmlTreeNode::hasAttribute(const std::string& name)
148void LLXmlTreeNode::addAttribute(const std::string& name, const std::string& value) 148void LLXmlTreeNode::addAttribute(const std::string& name, const std::string& value)
149{ 149{
150 LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); 150 LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name );
151 const LLString *newstr = new LLString(value); 151 const std::string *newstr = new std::string(value);
152 mAttributes[canonical_name] = newstr; // insert + copy 152 mAttributes[canonical_name] = newstr; // insert + copy
153} 153}
154 154
@@ -204,103 +204,103 @@ void LLXmlTreeNode::addChild(LLXmlTreeNode* child)
204 204
205BOOL LLXmlTreeNode::getFastAttributeBOOL(LLStdStringHandle canonical_name, BOOL& value) 205BOOL LLXmlTreeNode::getFastAttributeBOOL(LLStdStringHandle canonical_name, BOOL& value)
206{ 206{
207 const LLString *s = getAttribute( canonical_name ); 207 const std::string *s = getAttribute( canonical_name );
208 return s && LLString::convertToBOOL( *s, value ); 208 return s && LLStringUtil::convertToBOOL( *s, value );
209} 209}
210 210
211BOOL LLXmlTreeNode::getFastAttributeU8(LLStdStringHandle canonical_name, U8& value) 211BOOL LLXmlTreeNode::getFastAttributeU8(LLStdStringHandle canonical_name, U8& value)
212{ 212{
213 const LLString *s = getAttribute( canonical_name ); 213 const std::string *s = getAttribute( canonical_name );
214 return s && LLString::convertToU8( *s, value ); 214 return s && LLStringUtil::convertToU8( *s, value );
215} 215}
216 216
217BOOL LLXmlTreeNode::getFastAttributeS8(LLStdStringHandle canonical_name, S8& value) 217BOOL LLXmlTreeNode::getFastAttributeS8(LLStdStringHandle canonical_name, S8& value)
218{ 218{
219 const LLString *s = getAttribute( canonical_name ); 219 const std::string *s = getAttribute( canonical_name );
220 return s && LLString::convertToS8( *s, value ); 220 return s && LLStringUtil::convertToS8( *s, value );
221} 221}
222 222
223BOOL LLXmlTreeNode::getFastAttributeS16(LLStdStringHandle canonical_name, S16& value) 223BOOL LLXmlTreeNode::getFastAttributeS16(LLStdStringHandle canonical_name, S16& value)
224{ 224{
225 const LLString *s = getAttribute( canonical_name ); 225 const std::string *s = getAttribute( canonical_name );
226 return s && LLString::convertToS16( *s, value ); 226 return s && LLStringUtil::convertToS16( *s, value );
227} 227}
228 228
229BOOL LLXmlTreeNode::getFastAttributeU16(LLStdStringHandle canonical_name, U16& value) 229BOOL LLXmlTreeNode::getFastAttributeU16(LLStdStringHandle canonical_name, U16& value)
230{ 230{
231 const LLString *s = getAttribute( canonical_name ); 231 const std::string *s = getAttribute( canonical_name );
232 return s && LLString::convertToU16( *s, value ); 232 return s && LLStringUtil::convertToU16( *s, value );
233} 233}
234 234
235BOOL LLXmlTreeNode::getFastAttributeU32(LLStdStringHandle canonical_name, U32& value) 235BOOL LLXmlTreeNode::getFastAttributeU32(LLStdStringHandle canonical_name, U32& value)
236{ 236{
237 const LLString *s = getAttribute( canonical_name ); 237 const std::string *s = getAttribute( canonical_name );
238 return s && LLString::convertToU32( *s, value ); 238 return s && LLStringUtil::convertToU32( *s, value );
239} 239}
240 240
241BOOL LLXmlTreeNode::getFastAttributeS32(LLStdStringHandle canonical_name, S32& value) 241BOOL LLXmlTreeNode::getFastAttributeS32(LLStdStringHandle canonical_name, S32& value)
242{ 242{
243 const LLString *s = getAttribute( canonical_name ); 243 const std::string *s = getAttribute( canonical_name );
244 return s && LLString::convertToS32( *s, value ); 244 return s && LLStringUtil::convertToS32( *s, value );
245} 245}
246 246
247BOOL LLXmlTreeNode::getFastAttributeF32(LLStdStringHandle canonical_name, F32& value) 247BOOL LLXmlTreeNode::getFastAttributeF32(LLStdStringHandle canonical_name, F32& value)
248{ 248{
249 const LLString *s = getAttribute( canonical_name ); 249 const std::string *s = getAttribute( canonical_name );
250 return s && LLString::convertToF32( *s, value ); 250 return s && LLStringUtil::convertToF32( *s, value );
251} 251}
252 252
253BOOL LLXmlTreeNode::getFastAttributeF64(LLStdStringHandle canonical_name, F64& value) 253BOOL LLXmlTreeNode::getFastAttributeF64(LLStdStringHandle canonical_name, F64& value)
254{ 254{
255 const LLString *s = getAttribute( canonical_name ); 255 const std::string *s = getAttribute( canonical_name );
256 return s && LLString::convertToF64( *s, value ); 256 return s && LLStringUtil::convertToF64( *s, value );
257} 257}
258 258
259BOOL LLXmlTreeNode::getFastAttributeColor(LLStdStringHandle canonical_name, LLColor4& value) 259BOOL LLXmlTreeNode::getFastAttributeColor(LLStdStringHandle canonical_name, LLColor4& value)
260{ 260{
261 const LLString *s = getAttribute( canonical_name ); 261 const std::string *s = getAttribute( canonical_name );
262 return s ? LLColor4::parseColor(s->c_str(), &value) : FALSE; 262 return s ? LLColor4::parseColor(*s, &value) : FALSE;
263} 263}
264 264
265BOOL LLXmlTreeNode::getFastAttributeColor4(LLStdStringHandle canonical_name, LLColor4& value) 265BOOL LLXmlTreeNode::getFastAttributeColor4(LLStdStringHandle canonical_name, LLColor4& value)
266{ 266{
267 const LLString *s = getAttribute( canonical_name ); 267 const std::string *s = getAttribute( canonical_name );
268 return s ? LLColor4::parseColor4(s->c_str(), &value) : FALSE; 268 return s ? LLColor4::parseColor4(*s, &value) : FALSE;
269} 269}
270 270
271BOOL LLXmlTreeNode::getFastAttributeColor4U(LLStdStringHandle canonical_name, LLColor4U& value) 271BOOL LLXmlTreeNode::getFastAttributeColor4U(LLStdStringHandle canonical_name, LLColor4U& value)
272{ 272{
273 const LLString *s = getAttribute( canonical_name ); 273 const std::string *s = getAttribute( canonical_name );
274 return s ? LLColor4U::parseColor4U(s->c_str(), &value ) : FALSE; 274 return s ? LLColor4U::parseColor4U(*s, &value ) : FALSE;
275} 275}
276 276
277BOOL LLXmlTreeNode::getFastAttributeVector3(LLStdStringHandle canonical_name, LLVector3& value) 277BOOL LLXmlTreeNode::getFastAttributeVector3(LLStdStringHandle canonical_name, LLVector3& value)
278{ 278{
279 const LLString *s = getAttribute( canonical_name ); 279 const std::string *s = getAttribute( canonical_name );
280 return s ? LLVector3::parseVector3(s->c_str(), &value ) : FALSE; 280 return s ? LLVector3::parseVector3(*s, &value ) : FALSE;
281} 281}
282 282
283BOOL LLXmlTreeNode::getFastAttributeVector3d(LLStdStringHandle canonical_name, LLVector3d& value) 283BOOL LLXmlTreeNode::getFastAttributeVector3d(LLStdStringHandle canonical_name, LLVector3d& value)
284{ 284{
285 const LLString *s = getAttribute( canonical_name ); 285 const std::string *s = getAttribute( canonical_name );
286 return s ? LLVector3d::parseVector3d(s->c_str(), &value ) : FALSE; 286 return s ? LLVector3d::parseVector3d(*s, &value ) : FALSE;
287} 287}
288 288
289BOOL LLXmlTreeNode::getFastAttributeQuat(LLStdStringHandle canonical_name, LLQuaternion& value) 289BOOL LLXmlTreeNode::getFastAttributeQuat(LLStdStringHandle canonical_name, LLQuaternion& value)
290{ 290{
291 const LLString *s = getAttribute( canonical_name ); 291 const std::string *s = getAttribute( canonical_name );
292 return s ? LLQuaternion::parseQuat(s->c_str(), &value ) : FALSE; 292 return s ? LLQuaternion::parseQuat(*s, &value ) : FALSE;
293} 293}
294 294
295BOOL LLXmlTreeNode::getFastAttributeUUID(LLStdStringHandle canonical_name, LLUUID& value) 295BOOL LLXmlTreeNode::getFastAttributeUUID(LLStdStringHandle canonical_name, LLUUID& value)
296{ 296{
297 const LLString *s = getAttribute( canonical_name ); 297 const std::string *s = getAttribute( canonical_name );
298 return s ? LLUUID::parseUUID(s->c_str(), &value ) : FALSE; 298 return s ? LLUUID::parseUUID(*s, &value ) : FALSE;
299} 299}
300 300
301BOOL LLXmlTreeNode::getFastAttributeString(LLStdStringHandle canonical_name, LLString& value) 301BOOL LLXmlTreeNode::getFastAttributeString(LLStdStringHandle canonical_name, std::string& value)
302{ 302{
303 const LLString *s = getAttribute( canonical_name ); 303 const std::string *s = getAttribute( canonical_name );
304 if( !s ) 304 if( !s )
305 { 305 {
306 return FALSE; 306 return FALSE;
@@ -409,7 +409,7 @@ BOOL LLXmlTreeNode::getAttributeUUID(const std::string& name, LLUUID& value)
409 return getFastAttributeUUID(canonical_name, value); 409 return getFastAttributeUUID(canonical_name, value);
410} 410}
411 411
412BOOL LLXmlTreeNode::getAttributeString(const std::string& name, LLString& value) 412BOOL LLXmlTreeNode::getAttributeString(const std::string& name, std::string& value)
413{ 413{
414 LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name ); 414 LLStdStringHandle canonical_name = LLXmlTree::sAttributeKeys.addString( name );
415 return getFastAttributeString(canonical_name, value); 415 return getFastAttributeString(canonical_name, value);
@@ -437,7 +437,7 @@ The quick brown fox
437 437
438*/ 438*/
439 439
440LLString LLXmlTreeNode::getTextContents() 440std::string LLXmlTreeNode::getTextContents()
441{ 441{
442 std::string msg; 442 std::string msg;
443 LLXmlTreeNode* p = getChildByName("p"); 443 LLXmlTreeNode* p = getChildByName("p");
@@ -541,7 +541,7 @@ BOOL LLXmlTreeParser::parseFile(const std::string &path, LLXmlTreeNode** root, B
541 541
542const std::string& LLXmlTreeParser::tabs() 542const std::string& LLXmlTreeParser::tabs()
543{ 543{
544 static LLString s; 544 static std::string s;
545 s = ""; 545 s = "";
546 S32 num_tabs = getDepth() - 1; 546 S32 num_tabs = getDepth() - 1;
547 for( S32 i = 0; i < num_tabs; i++) 547 for( S32 i = 0; i < num_tabs; i++)
@@ -602,8 +602,8 @@ void LLXmlTreeParser::endElement(const char* name)
602 602
603 if( !mCurrent->mContents.empty() ) 603 if( !mCurrent->mContents.empty() )
604 { 604 {
605 LLString::trim(mCurrent->mContents); 605 LLStringUtil::trim(mCurrent->mContents);
606 LLString::removeCRLF(mCurrent->mContents); 606 LLStringUtil::removeCRLF(mCurrent->mContents);
607 } 607 }
608 608
609 mCurrent = mCurrent->getParent(); 609 mCurrent = mCurrent->getParent();
@@ -611,7 +611,8 @@ void LLXmlTreeParser::endElement(const char* name)
611 611
612void LLXmlTreeParser::characterData(const char *s, int len) 612void LLXmlTreeParser::characterData(const char *s, int len)
613{ 613{
614 LLString str(s, len); 614 std::string str;
615 if (s) str = std::string(s, len);
615 if( mDump ) 616 if( mDump )
616 { 617 {
617 llinfos << tabs() << "CharacterData " << str << llendl; 618 llinfos << tabs() << "CharacterData " << str << llendl;
@@ -659,7 +660,8 @@ void LLXmlTreeParser::defaultData(const char *s, int len)
659{ 660{
660 if( mDump ) 661 if( mDump )
661 { 662 {
662 LLString str(s, len); 663 std::string str;
664 if (s) str = std::string(s, len);
663 llinfos << tabs() << "defaultData " << str << llendl; 665 llinfos << tabs() << "defaultData " << str << llendl;
664 } 666 }
665} 667}
diff --git a/linden/indra/llxml/llxmltree.h b/linden/indra/llxml/llxmltree.h
index 87fe4f5..5d475d0 100644
--- a/linden/indra/llxml/llxmltree.h
+++ b/linden/indra/llxml/llxmltree.h
@@ -65,7 +65,7 @@ public:
65 LLXmlTreeNode* getRoot() { return mRoot; } 65 LLXmlTreeNode* getRoot() { return mRoot; }
66 66
67 void dump(); 67 void dump();
68 void dumpNode( LLXmlTreeNode* node, const LLString &prefix ); 68 void dumpNode( LLXmlTreeNode* node, const std::string& prefix );
69 69
70 static LLStdStringHandle addAttributeString( const std::string& name) 70 static LLStdStringHandle addAttributeString( const std::string& name)
71 { 71 {
@@ -126,7 +126,7 @@ public:
126 BOOL getFastAttributeVector3d( LLStdStringHandle cannonical_name, LLVector3d& value ); 126 BOOL getFastAttributeVector3d( LLStdStringHandle cannonical_name, LLVector3d& value );
127 BOOL getFastAttributeQuat( LLStdStringHandle cannonical_name, LLQuaternion& value ); 127 BOOL getFastAttributeQuat( LLStdStringHandle cannonical_name, LLQuaternion& value );
128 BOOL getFastAttributeUUID( LLStdStringHandle cannonical_name, LLUUID& value ); 128 BOOL getFastAttributeUUID( LLStdStringHandle cannonical_name, LLUUID& value );
129 BOOL getFastAttributeString( LLStdStringHandle cannonical_name, LLString& value ); 129 BOOL getFastAttributeString( LLStdStringHandle cannonical_name, std::string& value );
130 130
131 // Normal versions find 'name' in LLXmlTree::sAttributeKeys then call fast versions 131 // Normal versions find 'name' in LLXmlTree::sAttributeKeys then call fast versions
132 virtual BOOL getAttributeBOOL( const std::string& name, BOOL& value ); 132 virtual BOOL getAttributeBOOL( const std::string& name, BOOL& value );
@@ -145,13 +145,13 @@ public:
145 virtual BOOL getAttributeVector3d( const std::string& name, LLVector3d& value ); 145 virtual BOOL getAttributeVector3d( const std::string& name, LLVector3d& value );
146 virtual BOOL getAttributeQuat( const std::string& name, LLQuaternion& value ); 146 virtual BOOL getAttributeQuat( const std::string& name, LLQuaternion& value );
147 virtual BOOL getAttributeUUID( const std::string& name, LLUUID& value ); 147 virtual BOOL getAttributeUUID( const std::string& name, LLUUID& value );
148 virtual BOOL getAttributeString( const std::string& name, LLString& value ); 148 virtual BOOL getAttributeString( const std::string& name, std::string& value );
149 149
150 const LLString& getContents() 150 const std::string& getContents()
151 { 151 {
152 return mContents; 152 return mContents;
153 } 153 }
154 LLString getTextContents(); 154 std::string getTextContents();
155 155
156 LLXmlTreeNode* getParent() { return mParent; } 156 LLXmlTreeNode* getParent() { return mParent; }
157 LLXmlTreeNode* getFirstChild(); 157 LLXmlTreeNode* getFirstChild();
@@ -161,7 +161,7 @@ public:
161 LLXmlTreeNode* getNextNamedChild(); // returns next child with name, NULL if none 161 LLXmlTreeNode* getNextNamedChild(); // returns next child with name, NULL if none
162 162
163protected: 163protected:
164 const LLString* getAttribute( LLStdStringHandle name) 164 const std::string* getAttribute( LLStdStringHandle name)
165 { 165 {
166 attribute_map_t::iterator iter = mAttributes.find(name); 166 attribute_map_t::iterator iter = mAttributes.find(name);
167 return (iter == mAttributes.end()) ? 0 : iter->second; 167 return (iter == mAttributes.end()) ? 0 : iter->second;
@@ -172,15 +172,15 @@ private:
172 void appendContents( const std::string& str ); 172 void appendContents( const std::string& str );
173 void addChild( LLXmlTreeNode* child ); 173 void addChild( LLXmlTreeNode* child );
174 174
175 void dump( const LLString& prefix ); 175 void dump( const std::string& prefix );
176 176
177protected: 177protected:
178 typedef std::map<LLStdStringHandle, const LLString*> attribute_map_t; 178 typedef std::map<LLStdStringHandle, const std::string*> attribute_map_t;
179 attribute_map_t mAttributes; 179 attribute_map_t mAttributes;
180 180
181private: 181private:
182 LLString mName; 182 std::string mName;
183 LLString mContents; 183 std::string mContents;
184 184
185 typedef std::list<class LLXmlTreeNode *> child_list_t; 185 typedef std::list<class LLXmlTreeNode *> child_list_t;
186 child_list_t mChildList; 186 child_list_t mChildList;