aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llinventory/llparcel.cpp
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/llinventory/llparcel.cpp
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/llinventory/llparcel.cpp')
-rw-r--r--linden/indra/llinventory/llparcel.cpp341
1 files changed, 166 insertions, 175 deletions
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp
index 1390f72..2b9c201 100644
--- a/linden/indra/llinventory/llparcel.cpp
+++ b/linden/indra/llinventory/llparcel.cpp
@@ -1,33 +1,33 @@
1/** 1/**
2* @file llparcel.cpp 2 * @file llparcel.cpp
3* @brief A land parcel. 3 * @brief A land parcel.
4* 4 *
5* $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6* 6 *
7* Copyright (c) 2002-2008, Linden Research, Inc. 7 * Copyright (c) 2002-2008, Linden Research, Inc.
8* 8 *
9* Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0 11 * to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16* 16 *
17* There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21* 21 *
22* By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23* that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
24* and agree to abide by those obligations. 24 * and agree to abide by those obligations.
25* 25 *
26* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28* COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29* $/LicenseInfo$ 29 * $/LicenseInfo$
30*/ 30 */
31 31
32#include "linden_common.h" 32#include "linden_common.h"
33 33
@@ -48,17 +48,18 @@
48 48
49static const F32 SOME_BIG_NUMBER = 1000.0f; 49static const F32 SOME_BIG_NUMBER = 1000.0f;
50static const F32 SOME_BIG_NEG_NUMBER = -1000.0f; 50static const F32 SOME_BIG_NEG_NUMBER = -1000.0f;
51static const char* PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT] = 51static const std::string PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT+1] =
52{ 52{
53 "leased", 53 "leased",
54 "lease_pending", 54 "lease_pending",
55 "abandoned" 55 "abandoned",
56 "none"
56}; 57};
57 58
58// NOTE: Adding parcel categories also requires updating: 59// NOTE: Adding parcel categories also requires updating:
59// * newview/app_settings/floater_directory.xml category combobox 60// * newview/app_settings/floater_directory.xml category combobox
60// * Web site "create event" tools 61// * Web site "create event" tools
61static const char* PARCEL_CATEGORY_STRING[LLParcel::C_COUNT] = 62static const std::string PARCEL_CATEGORY_STRING[LLParcel::C_COUNT] =
62{ 63{
63 "none", 64 "none",
64 "linden", 65 "linden",
@@ -75,7 +76,7 @@ static const char* PARCEL_CATEGORY_STRING[LLParcel::C_COUNT] =
75 "stage", 76 "stage",
76 "other", 77 "other",
77}; 78};
78static const char* PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] = 79static const std::string PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] =
79{ 80{
80 "None", 81 "None",
81 "Linden Location", 82 "Linden Location",
@@ -94,7 +95,7 @@ static const char* PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] =
94 "Any", // valid string for parcel searches 95 "Any", // valid string for parcel searches
95}; 96};
96 97
97static const char* PARCEL_ACTION_STRING[LLParcel::A_COUNT + 1] = 98static const std::string PARCEL_ACTION_STRING[LLParcel::A_COUNT + 1] =
98{ 99{
99 "create", 100 "create",
100 "release", 101 "release",
@@ -132,14 +133,14 @@ const U64 SEVEN_DAYS_IN_USEC = U64L(604800000000);
132const S32 EXTEND_GRACE_IF_MORE_THAN_SEC = 100000; 133const S32 EXTEND_GRACE_IF_MORE_THAN_SEC = 100000;
133 134
134 135
135const char* ownership_status_to_string(LLParcel::EOwnershipStatus status); 136const std::string& ownership_status_to_string(LLParcel::EOwnershipStatus status);
136LLParcel::EOwnershipStatus ownership_string_to_status(const char* s); 137LLParcel::EOwnershipStatus ownership_string_to_status(const std::string& s);
137//const char* revert_action_to_string(LLParcel::ESaleTimerExpireAction action); 138//const char* revert_action_to_string(LLParcel::ESaleTimerExpireAction action);
138//LLParcel::ESaleTimerExpireAction revert_string_to_action(const char* s); 139//LLParcel::ESaleTimerExpireAction revert_string_to_action(const char* s);
139const char* category_to_string(LLParcel::ECategory category); 140const std::string& category_to_string(LLParcel::ECategory category);
140const char* category_to_ui_string(LLParcel::ECategory category); 141const std::string& category_to_ui_string(LLParcel::ECategory category);
141LLParcel::ECategory category_string_to_category(const char* s); 142LLParcel::ECategory category_string_to_category(const std::string& s);
142LLParcel::ECategory category_ui_string_to_category(const char* s); 143LLParcel::ECategory category_ui_string_to_category(const std::string& s);
143 144
144LLParcel::LLParcel() 145LLParcel::LLParcel()
145{ 146{
@@ -207,12 +208,12 @@ void LLParcel::init(const LLUUID &owner_id,
207 setParcelFlag(PF_ALLOW_DAMAGE, damage); 208 setParcelFlag(PF_ALLOW_DAMAGE, damage);
208 209
209 mSalePrice = 10000; 210 mSalePrice = 10000;
210 setName(NULL); 211 setName(LLStringUtil::null);
211 setDesc(NULL); 212 setDesc(LLStringUtil::null);
212 setMusicURL(NULL); 213 setMusicURL(LLStringUtil::null);
213 setMediaURL(NULL); 214 setMediaURL(LLStringUtil::null);
214 setMediaDesc(NULL); 215 setMediaDesc(LLStringUtil::null);
215 setMediaType(NULL); 216 setMediaType(LLStringUtil::null);
216 mMediaID.setNull(); 217 mMediaID.setNull();
217 mMediaAutoScale = 0; 218 mMediaAutoScale = 0;
218 mMediaLoop = TRUE; 219 mMediaLoop = TRUE;
@@ -241,6 +242,9 @@ void LLParcel::init(const LLUUID &owner_id,
241 setSelectedPrimCount(0); 242 setSelectedPrimCount(0);
242 setTempPrimCount(0); 243 setTempPrimCount(0);
243 setCleanOtherTime(0); 244 setCleanOtherTime(0);
245 setRegionPushOverride(FALSE);
246 setRegionDenyAnonymousOverride(FALSE);
247 setRegionDenyAgeUnverifiedOverride(FALSE);
244 setParcelPrimBonus(parcel_object_bonus); 248 setParcelPrimBonus(parcel_object_bonus);
245 249
246 setPreviousOwnerID(LLUUID::null); 250 setPreviousOwnerID(LLUUID::null);
@@ -268,22 +272,7 @@ void LLParcel::overrideParcelFlags(U32 flags)
268{ 272{
269 mParcelFlags = flags; 273 mParcelFlags = flags;
270} 274}
271void set_std_string(const char* src, std::string& dest) 275void LLParcel::setName(const std::string& name)
272{
273 if(src)
274 {
275 dest.assign(src);
276 }
277 else
278 {
279#if (LL_LINUX && __GNUC__ < 3)
280 dest.assign(std::string(""));
281#else
282 dest.clear();
283#endif
284 }
285}
286void LLParcel::setName(const LLString& name)
287{ 276{
288 // The escaping here must match the escaping in the database 277 // The escaping here must match the escaping in the database
289 // abstraction layer. 278 // abstraction layer.
@@ -291,7 +280,7 @@ void LLParcel::setName(const LLString& name)
291 LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); 280 LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR);
292} 281}
293 282
294void LLParcel::setDesc(const LLString& desc) 283void LLParcel::setDesc(const std::string& desc)
295{ 284{
296 // The escaping here must match the escaping in the database 285 // The escaping here must match the escaping in the database
297 // abstraction layer. 286 // abstraction layer.
@@ -299,7 +288,7 @@ void LLParcel::setDesc(const LLString& desc)
299 mDesc = rawstr_to_utf8(mDesc); 288 mDesc = rawstr_to_utf8(mDesc);
300} 289}
301 290
302void LLParcel::setMusicURL(const LLString& url) 291void LLParcel::setMusicURL(const std::string& url)
303{ 292{
304 mMusicURL = url; 293 mMusicURL = url;
305 // The escaping here must match the escaping in the database 294 // The escaping here must match the escaping in the database
@@ -309,7 +298,7 @@ void LLParcel::setMusicURL(const LLString& url)
309 LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); 298 LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR);
310} 299}
311 300
312void LLParcel::setMediaURL(const LLString& url) 301void LLParcel::setMediaURL(const std::string& url)
313{ 302{
314 mMediaURL = url; 303 mMediaURL = url;
315 // The escaping here must match the escaping in the database 304 // The escaping here must match the escaping in the database
@@ -319,24 +308,24 @@ void LLParcel::setMediaURL(const LLString& url)
319 LLStringFn::replace_nonprintable(mMediaURL, LL_UNKNOWN_CHAR); 308 LLStringFn::replace_nonprintable(mMediaURL, LL_UNKNOWN_CHAR);
320} 309}
321 310
322void LLParcel::setMediaDesc(const char* desc) 311void LLParcel::setMediaDesc(const std::string& desc)
323{ 312{
324 // The escaping here must match the escaping in the database 313 // The escaping here must match the escaping in the database
325 // abstraction layer. 314 // abstraction layer.
326 set_std_string(desc, mMediaDesc); 315 mMediaDesc = desc;
327 mMediaDesc = rawstr_to_utf8(mMediaDesc); 316 mMediaDesc = rawstr_to_utf8(mMediaDesc);
328} 317}
329void LLParcel::setMediaType(const char* type) 318void LLParcel::setMediaType(const std::string& type)
330{ 319{
331 // The escaping here must match the escaping in the database 320 // The escaping here must match the escaping in the database
332 // abstraction layer. 321 // abstraction layer.
333 set_std_string(type, mMediaType); 322 mMediaType = type;
334 mMediaType = rawstr_to_utf8(mMediaType); 323 mMediaType = rawstr_to_utf8(mMediaType);
335 324
336 // This code attempts to preserve legacy movie functioning 325 // This code attempts to preserve legacy movie functioning
337 if(mMediaType.empty() && ! mMediaURL.empty()) 326 if(mMediaType.empty() && ! mMediaURL.empty())
338 { 327 {
339 setMediaType("video/vnd.secondlife.qt.legacy"); 328 setMediaType(std::string("video/vnd.secondlife.qt.legacy"));
340 } 329 }
341} 330}
342void LLParcel::setMediaWidth(S32 width) 331void LLParcel::setMediaWidth(S32 width)
@@ -575,7 +564,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
575 while (input_stream.good()) 564 while (input_stream.good())
576 { 565 {
577 skip_comments_and_emptyspace(input_stream); 566 skip_comments_and_emptyspace(input_stream);
578 LLString line, keyword, value; 567 std::string line, keyword, value;
579 get_line(line, input_stream, MAX_STRING); 568 get_line(line, input_stream, MAX_STRING);
580 get_keyword_and_value(keyword, value, line); 569 get_keyword_and_value(keyword, value, line);
581 570
@@ -585,19 +574,19 @@ BOOL LLParcel::importStream(std::istream& input_stream)
585 } 574 }
586 else if ("parcel_id" == keyword) 575 else if ("parcel_id" == keyword)
587 { 576 {
588 mID.set(value.c_str()); 577 mID.set(value);
589 } 578 }
590 else if ("status" == keyword) 579 else if ("status" == keyword)
591 { 580 {
592 mStatus = ownership_string_to_status(value.c_str()); 581 mStatus = ownership_string_to_status(value);
593 } 582 }
594 else if ("category" == keyword) 583 else if ("category" == keyword)
595 { 584 {
596 mCategory = category_string_to_category(value.c_str()); 585 mCategory = category_string_to_category(value);
597 } 586 }
598 else if ("local_id" == keyword) 587 else if ("local_id" == keyword)
599 { 588 {
600 LLString::convertToS32(value, mLocalID); 589 LLStringUtil::convertToS32(value, mLocalID);
601 } 590 }
602 else if ("name" == keyword) 591 else if ("name" == keyword)
603 { 592 {
@@ -617,65 +606,65 @@ BOOL LLParcel::importStream(std::istream& input_stream)
617 } 606 }
618 else if ("media_desc" == keyword) 607 else if ("media_desc" == keyword)
619 { 608 {
620 setMediaDesc( value.c_str() ); 609 setMediaDesc( value );
621 } 610 }
622 else if ("media_type" == keyword) 611 else if ("media_type" == keyword)
623 { 612 {
624 setMediaType( value.c_str() ); 613 setMediaType( value );
625 } 614 }
626 else if ("media_width" == keyword) 615 else if ("media_width" == keyword)
627 { 616 {
628 S32 width; 617 S32 width;
629 LLString::convertToS32(value, width); 618 LLStringUtil::convertToS32(value, width);
630 setMediaWidth( width ); 619 setMediaWidth( width );
631 } 620 }
632 else if ("media_height" == keyword) 621 else if ("media_height" == keyword)
633 { 622 {
634 S32 height; 623 S32 height;
635 LLString::convertToS32(value, height); 624 LLStringUtil::convertToS32(value, height);
636 setMediaHeight( height ); 625 setMediaHeight( height );
637 } 626 }
638 else if ("media_id" == keyword) 627 else if ("media_id" == keyword)
639 { 628 {
640 mMediaID.set( value.c_str() ); 629 mMediaID.set( value );
641 } 630 }
642 else if ("media_auto_scale" == keyword) 631 else if ("media_auto_scale" == keyword)
643 { 632 {
644 LLString::convertToU8(value, mMediaAutoScale); 633 LLStringUtil::convertToU8(value, mMediaAutoScale);
645 } 634 }
646 else if ("media_loop" == keyword) 635 else if ("media_loop" == keyword)
647 { 636 {
648 LLString::convertToU8(value, mMediaLoop); 637 LLStringUtil::convertToU8(value, mMediaLoop);
649 } 638 }
650 else if ("obscure_media" == keyword) 639 else if ("obscure_media" == keyword)
651 { 640 {
652 LLString::convertToU8(value, mObscureMedia); 641 LLStringUtil::convertToU8(value, mObscureMedia);
653 } 642 }
654 else if ("obscure_music" == keyword) 643 else if ("obscure_music" == keyword)
655 { 644 {
656 LLString::convertToU8(value, mObscureMusic); 645 LLStringUtil::convertToU8(value, mObscureMusic);
657 } 646 }
658 else if ("owner_id" == keyword) 647 else if ("owner_id" == keyword)
659 { 648 {
660 mOwnerID.set( value.c_str() ); 649 mOwnerID.set( value );
661 } 650 }
662 else if ("group_owned" == keyword) 651 else if ("group_owned" == keyword)
663 { 652 {
664 LLString::convertToBOOL(value, mGroupOwned); 653 LLStringUtil::convertToBOOL(value, mGroupOwned);
665 } 654 }
666 else if ("clean_other_time" == keyword) 655 else if ("clean_other_time" == keyword)
667 { 656 {
668 S32 time; 657 S32 time;
669 LLString::convertToS32(value, time); 658 LLStringUtil::convertToS32(value, time);
670 setCleanOtherTime(time); 659 setCleanOtherTime(time);
671 } 660 }
672 else if ("auth_buyer_id" == keyword) 661 else if ("auth_buyer_id" == keyword)
673 { 662 {
674 mAuthBuyerID.set(value.c_str()); 663 mAuthBuyerID.set(value);
675 } 664 }
676 else if ("snapshot_id" == keyword) 665 else if ("snapshot_id" == keyword)
677 { 666 {
678 mSnapshotID.set(value.c_str()); 667 mSnapshotID.set(value);
679 } 668 }
680 else if ("user_location" == keyword) 669 else if ("user_location" == keyword)
681 { 670 {
@@ -694,7 +683,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
694 else if ("landing_type" == keyword) 683 else if ("landing_type" == keyword)
695 { 684 {
696 S32 landing_type = 0; 685 S32 landing_type = 0;
697 LLString::convertToS32(value, landing_type); 686 LLStringUtil::convertToS32(value, landing_type);
698 mLandingType = (ELandingType) landing_type; 687 mLandingType = (ELandingType) landing_type;
699 } 688 }
700 else if ("join_neighbors" == keyword) 689 else if ("join_neighbors" == keyword)
@@ -703,7 +692,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
703 } 692 }
704 else if ("revert_sale" == keyword) 693 else if ("revert_sale" == keyword)
705 { 694 {
706 LLString::convertToS32(value, secs_until_revert); 695 LLStringUtil::convertToS32(value, secs_until_revert);
707 if (secs_until_revert > 0) 696 if (secs_until_revert > 0)
708 { 697 {
709 mSaleTimerExpires.start(); 698 mSaleTimerExpires.start();
@@ -712,7 +701,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
712 } 701 }
713 else if("extended_grace" == keyword) 702 else if("extended_grace" == keyword)
714 { 703 {
715 LLString::convertToS32(value, mGraceExtension); 704 LLStringUtil::convertToS32(value, mGraceExtension);
716 } 705 }
717 else if ("user_list_type" == keyword) 706 else if ("user_list_type" == keyword)
718 { 707 {
@@ -720,147 +709,147 @@ BOOL LLParcel::importStream(std::istream& input_stream)
720 } 709 }
721 else if("auction_id" == keyword) 710 else if("auction_id" == keyword)
722 { 711 {
723 LLString::convertToU32(value, mAuctionID); 712 LLStringUtil::convertToU32(value, mAuctionID);
724 } 713 }
725 else if ("allow_modify" == keyword) 714 else if ("allow_modify" == keyword)
726 { 715 {
727 LLString::convertToU32(value, setting); 716 LLStringUtil::convertToU32(value, setting);
728 setParcelFlag(PF_CREATE_OBJECTS, setting); 717 setParcelFlag(PF_CREATE_OBJECTS, setting);
729 } 718 }
730 else if ("allow_group_modify" == keyword) 719 else if ("allow_group_modify" == keyword)
731 { 720 {
732 LLString::convertToU32(value, setting); 721 LLStringUtil::convertToU32(value, setting);
733 setParcelFlag(PF_CREATE_GROUP_OBJECTS, setting); 722 setParcelFlag(PF_CREATE_GROUP_OBJECTS, setting);
734 } 723 }
735 else if ("allow_all_object_entry" == keyword) 724 else if ("allow_all_object_entry" == keyword)
736 { 725 {
737 LLString::convertToU32(value, setting); 726 LLStringUtil::convertToU32(value, setting);
738 setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, setting); 727 setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, setting);
739 } 728 }
740 else if ("allow_group_object_entry" == keyword) 729 else if ("allow_group_object_entry" == keyword)
741 { 730 {
742 LLString::convertToU32(value, setting); 731 LLStringUtil::convertToU32(value, setting);
743 setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, setting); 732 setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, setting);
744 } 733 }
745 else if ("allow_deed_to_group" == keyword) 734 else if ("allow_deed_to_group" == keyword)
746 { 735 {
747 LLString::convertToU32(value, setting); 736 LLStringUtil::convertToU32(value, setting);
748 setParcelFlag(PF_ALLOW_DEED_TO_GROUP, setting); 737 setParcelFlag(PF_ALLOW_DEED_TO_GROUP, setting);
749 } 738 }
750 else if("contribute_with_deed" == keyword) 739 else if("contribute_with_deed" == keyword)
751 { 740 {
752 LLString::convertToU32(value, setting); 741 LLStringUtil::convertToU32(value, setting);
753 setParcelFlag(PF_CONTRIBUTE_WITH_DEED, setting); 742 setParcelFlag(PF_CONTRIBUTE_WITH_DEED, setting);
754 } 743 }
755 else if ("allow_terraform" == keyword) 744 else if ("allow_terraform" == keyword)
756 { 745 {
757 LLString::convertToU32(value, setting); 746 LLStringUtil::convertToU32(value, setting);
758 setParcelFlag(PF_ALLOW_TERRAFORM, setting); 747 setParcelFlag(PF_ALLOW_TERRAFORM, setting);
759 } 748 }
760 else if ("allow_damage" == keyword) 749 else if ("allow_damage" == keyword)
761 { 750 {
762 LLString::convertToU32(value, setting); 751 LLStringUtil::convertToU32(value, setting);
763 setParcelFlag(PF_ALLOW_DAMAGE, setting); 752 setParcelFlag(PF_ALLOW_DAMAGE, setting);
764 } 753 }
765 else if ("allow_fly" == keyword) 754 else if ("allow_fly" == keyword)
766 { 755 {
767 LLString::convertToU32(value, setting); 756 LLStringUtil::convertToU32(value, setting);
768 setParcelFlag(PF_ALLOW_FLY, setting); 757 setParcelFlag(PF_ALLOW_FLY, setting);
769 } 758 }
770 else if ("allow_landmark" == keyword) 759 else if ("allow_landmark" == keyword)
771 { 760 {
772 LLString::convertToU32(value, setting); 761 LLStringUtil::convertToU32(value, setting);
773 setParcelFlag(PF_ALLOW_LANDMARK, setting); 762 setParcelFlag(PF_ALLOW_LANDMARK, setting);
774 } 763 }
775 else if ("sound_local" == keyword) 764 else if ("sound_local" == keyword)
776 { 765 {
777 LLString::convertToU32(value, setting); 766 LLStringUtil::convertToU32(value, setting);
778 setParcelFlag(PF_SOUND_LOCAL, setting); 767 setParcelFlag(PF_SOUND_LOCAL, setting);
779 } 768 }
780 else if ("allow_group_scripts" == keyword) 769 else if ("allow_group_scripts" == keyword)
781 { 770 {
782 LLString::convertToU32(value, setting); 771 LLStringUtil::convertToU32(value, setting);
783 setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting); 772 setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting);
784 } 773 }
785 else if ("allow_voice_chat" == keyword) 774 else if ("allow_voice_chat" == keyword)
786 { 775 {
787 LLString::convertToU32(value, setting); 776 LLStringUtil::convertToU32(value, setting);
788 setParcelFlag(PF_ALLOW_VOICE_CHAT, setting); 777 setParcelFlag(PF_ALLOW_VOICE_CHAT, setting);
789 } 778 }
790 else if ("use_estate_voice_chan" == keyword) 779 else if ("use_estate_voice_chan" == keyword)
791 { 780 {
792 LLString::convertToU32(value, setting); 781 LLStringUtil::convertToU32(value, setting);
793 setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting); 782 setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting);
794 } 783 }
795 else if ("allow_scripts" == keyword) 784 else if ("allow_scripts" == keyword)
796 { 785 {
797 LLString::convertToU32(value, setting); 786 LLStringUtil::convertToU32(value, setting);
798 setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, setting); 787 setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, setting);
799 } 788 }
800 else if ("for_sale" == keyword) 789 else if ("for_sale" == keyword)
801 { 790 {
802 LLString::convertToU32(value, setting); 791 LLStringUtil::convertToU32(value, setting);
803 setParcelFlag(PF_FOR_SALE, setting); 792 setParcelFlag(PF_FOR_SALE, setting);
804 } 793 }
805 else if ("sell_w_objects" == keyword) 794 else if ("sell_w_objects" == keyword)
806 { 795 {
807 LLString::convertToU32(value, setting); 796 LLStringUtil::convertToU32(value, setting);
808 setParcelFlag(PF_SELL_PARCEL_OBJECTS, setting); 797 setParcelFlag(PF_SELL_PARCEL_OBJECTS, setting);
809 } 798 }
810 else if ("use_pass_list" == keyword) 799 else if ("use_pass_list" == keyword)
811 { 800 {
812 LLString::convertToU32(value, setting); 801 LLStringUtil::convertToU32(value, setting);
813 setParcelFlag(PF_USE_PASS_LIST, setting); 802 setParcelFlag(PF_USE_PASS_LIST, setting);
814 } 803 }
815 else if ("show_directory" == keyword) 804 else if ("show_directory" == keyword)
816 { 805 {
817 LLString::convertToU32(value, setting); 806 LLStringUtil::convertToU32(value, setting);
818 setParcelFlag(PF_SHOW_DIRECTORY, setting); 807 setParcelFlag(PF_SHOW_DIRECTORY, setting);
819 } 808 }
820 else if ("allow_publish" == keyword) 809 else if ("allow_publish" == keyword)
821 { 810 {
822 LLString::convertToU32(value, setting); 811 LLStringUtil::convertToU32(value, setting);
823 setParcelFlag(PF_ALLOW_PUBLISH, setting); 812 setParcelFlag(PF_ALLOW_PUBLISH, setting);
824 } 813 }
825 else if ("mature_publish" == keyword) 814 else if ("mature_publish" == keyword)
826 { 815 {
827 LLString::convertToU32(value, setting); 816 LLStringUtil::convertToU32(value, setting);
828 setParcelFlag(PF_MATURE_PUBLISH, setting); 817 setParcelFlag(PF_MATURE_PUBLISH, setting);
829 } 818 }
830 else if ("claim_date" == keyword) 819 else if ("claim_date" == keyword)
831 { 820 {
832 // BUG: This will fail when time rolls over in 2038. 821 // BUG: This will fail when time rolls over in 2038.
833 S32 time; 822 S32 time;
834 LLString::convertToS32(value, time); 823 LLStringUtil::convertToS32(value, time);
835 mClaimDate = time; 824 mClaimDate = time;
836 } 825 }
837 else if ("claim_price" == keyword) 826 else if ("claim_price" == keyword)
838 { 827 {
839 LLString::convertToS32(value, mClaimPricePerMeter); 828 LLStringUtil::convertToS32(value, mClaimPricePerMeter);
840 } 829 }
841 else if ("rent_price" == keyword) 830 else if ("rent_price" == keyword)
842 { 831 {
843 LLString::convertToS32(value, mRentPricePerMeter); 832 LLStringUtil::convertToS32(value, mRentPricePerMeter);
844 } 833 }
845 else if ("discount_rate" == keyword) 834 else if ("discount_rate" == keyword)
846 { 835 {
847 LLString::convertToF32(value, mDiscountRate); 836 LLStringUtil::convertToF32(value, mDiscountRate);
848 } 837 }
849 else if ("draw_distance" == keyword) 838 else if ("draw_distance" == keyword)
850 { 839 {
851 LLString::convertToF32(value, mDrawDistance); 840 LLStringUtil::convertToF32(value, mDrawDistance);
852 } 841 }
853 else if ("sale_price" == keyword) 842 else if ("sale_price" == keyword)
854 { 843 {
855 LLString::convertToS32(value, mSalePrice); 844 LLStringUtil::convertToS32(value, mSalePrice);
856 } 845 }
857 else if ("pass_price" == keyword) 846 else if ("pass_price" == keyword)
858 { 847 {
859 LLString::convertToS32(value, mPassPrice); 848 LLStringUtil::convertToS32(value, mPassPrice);
860 } 849 }
861 else if ("pass_hours" == keyword) 850 else if ("pass_hours" == keyword)
862 { 851 {
863 LLString::convertToF32(value, mPassHours); 852 LLStringUtil::convertToF32(value, mPassHours);
864 } 853 }
865 else if ("box" == keyword) 854 else if ("box" == keyword)
866 { 855 {
@@ -873,17 +862,17 @@ BOOL LLParcel::importStream(std::istream& input_stream)
873 } 862 }
874 else if ("use_access_group" == keyword) 863 else if ("use_access_group" == keyword)
875 { 864 {
876 LLString::convertToU32(value, setting); 865 LLStringUtil::convertToU32(value, setting);
877 setParcelFlag(PF_USE_ACCESS_GROUP, setting); 866 setParcelFlag(PF_USE_ACCESS_GROUP, setting);
878 } 867 }
879 else if ("use_access_list" == keyword) 868 else if ("use_access_list" == keyword)
880 { 869 {
881 LLString::convertToU32(value, setting); 870 LLStringUtil::convertToU32(value, setting);
882 setParcelFlag(PF_USE_ACCESS_LIST, setting); 871 setParcelFlag(PF_USE_ACCESS_LIST, setting);
883 } 872 }
884 else if ("use_ban_list" == keyword) 873 else if ("use_ban_list" == keyword)
885 { 874 {
886 LLString::convertToU32(value, setting); 875 LLStringUtil::convertToU32(value, setting);
887 setParcelFlag(PF_USE_BAN_LIST, setting); 876 setParcelFlag(PF_USE_BAN_LIST, setting);
888 } 877 }
889 else if ("group_name" == keyword) 878 else if ("group_name" == keyword)
@@ -892,7 +881,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
892 } 881 }
893 else if ("group_id" == keyword) 882 else if ("group_id" == keyword)
894 { 883 {
895 mGroupID.set( value.c_str() ); 884 mGroupID.set( value );
896 } 885 }
897 // TODO: DEPRECATED FLAG 886 // TODO: DEPRECATED FLAG
898 // Flag removed from simstate files in 1.11.1 887 // Flag removed from simstate files in 1.11.1
@@ -900,7 +889,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
900 // no longer exists anywhere in simstate files. 889 // no longer exists anywhere in simstate files.
901 else if ("require_identified" == keyword) 890 else if ("require_identified" == keyword)
902 { 891 {
903 // LLString::convertToU32(value, setting); 892 // LLStringUtil::convertToU32(value, setting);
904 // setParcelFlag(PF_DENY_ANONYMOUS, setting); 893 // setParcelFlag(PF_DENY_ANONYMOUS, setting);
905 } 894 }
906 // TODO: DEPRECATED FLAG 895 // TODO: DEPRECATED FLAG
@@ -909,39 +898,39 @@ BOOL LLParcel::importStream(std::istream& input_stream)
909 // no longer exists anywhere in simstate files. 898 // no longer exists anywhere in simstate files.
910 else if ("require_transacted" == keyword) 899 else if ("require_transacted" == keyword)
911 { 900 {
912 // LLString::convertToU32(value, setting); 901 // LLStringUtil::convertToU32(value, setting);
913 // setParcelFlag(PF_DENY_ANONYMOUS, setting); 902 // setParcelFlag(PF_DENY_ANONYMOUS, setting);
914 // setParcelFlag(PF_DENY_IDENTIFIED, setting); 903 // setParcelFlag(PF_DENY_IDENTIFIED, setting);
915 } 904 }
916 else if ("restrict_pushobject" == keyword) 905 else if ("restrict_pushobject" == keyword)
917 { 906 {
918 LLString::convertToU32(value, setting); 907 LLStringUtil::convertToU32(value, setting);
919 setParcelFlag(PF_RESTRICT_PUSHOBJECT, setting); 908 setParcelFlag(PF_RESTRICT_PUSHOBJECT, setting);
920 } 909 }
921 else if ("deny_anonymous" == keyword) 910 else if ("deny_anonymous" == keyword)
922 { 911 {
923 LLString::convertToU32(value, setting); 912 LLStringUtil::convertToU32(value, setting);
924 setParcelFlag(PF_DENY_ANONYMOUS, setting); 913 setParcelFlag(PF_DENY_ANONYMOUS, setting);
925 } 914 }
926 else if ("deny_identified" == keyword) 915 else if ("deny_identified" == keyword)
927 { 916 {
928// LLString::convertToU32(value, setting); 917// LLStringUtil::convertToU32(value, setting);
929// setParcelFlag(PF_DENY_IDENTIFIED, setting); 918// setParcelFlag(PF_DENY_IDENTIFIED, setting);
930 } 919 }
931 else if ("deny_transacted" == keyword) 920 else if ("deny_transacted" == keyword)
932 { 921 {
933// LLString::convertToU32(value, setting); 922// LLStringUtil::convertToU32(value, setting);
934// setParcelFlag(PF_DENY_TRANSACTED, setting); 923// setParcelFlag(PF_DENY_TRANSACTED, setting);
935 } 924 }
936 else if ("deny_age_unverified" == keyword) 925 else if ("deny_age_unverified" == keyword)
937 { 926 {
938 LLString::convertToU32(value, setting); 927 LLStringUtil::convertToU32(value, setting);
939 setParcelFlag(PF_DENY_AGEUNVERIFIED, setting); 928 setParcelFlag(PF_DENY_AGEUNVERIFIED, setting);
940 } 929 }
941 else if ("access_list" == keyword) 930 else if ("access_list" == keyword)
942 { 931 {
943 S32 entry_count = 0; 932 S32 entry_count = 0;
944 LLString::convertToS32(value, entry_count); 933 LLStringUtil::convertToS32(value, entry_count);
945 for (S32 i = 0; i < entry_count; i++) 934 for (S32 i = 0; i < entry_count; i++)
946 { 935 {
947 LLAccessEntry entry; 936 LLAccessEntry entry;
@@ -954,7 +943,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
954 else if ("ban_list" == keyword) 943 else if ("ban_list" == keyword)
955 { 944 {
956 S32 entry_count = 0; 945 S32 entry_count = 0;
957 LLString::convertToS32(value, entry_count); 946 LLStringUtil::convertToS32(value, entry_count);
958 for (S32 i = 0; i < entry_count; i++) 947 for (S32 i = 0; i < entry_count; i++)
959 { 948 {
960 LLAccessEntry entry; 949 LLAccessEntry entry;
@@ -968,7 +957,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
968 { 957 {
969 /* 958 /*
970 S32 entry_count = 0; 959 S32 entry_count = 0;
971 LLString::convertToS32(value, entry_count); 960 LLStringUtil::convertToS32(value, entry_count);
972 for (S32 i = 0; i < entry_count; i++) 961 for (S32 i = 0; i < entry_count; i++)
973 { 962 {
974 LLAccessEntry entry; 963 LLAccessEntry entry;
@@ -982,7 +971,7 @@ BOOL LLParcel::importStream(std::istream& input_stream)
982 { 971 {
983 // legacy - put into access list 972 // legacy - put into access list
984 S32 entry_count = 0; 973 S32 entry_count = 0;
985 LLString::convertToS32(value, entry_count); 974 LLStringUtil::convertToS32(value, entry_count);
986 for (S32 i = 0; i < entry_count; i++) 975 for (S32 i = 0; i < entry_count; i++)
987 { 976 {
988 LLAccessEntry entry; 977 LLAccessEntry entry;
@@ -1058,7 +1047,7 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
1058 while (input_stream.good()) 1047 while (input_stream.good())
1059 { 1048 {
1060 skip_comments_and_emptyspace(input_stream); 1049 skip_comments_and_emptyspace(input_stream);
1061 LLString line, keyword, value; 1050 std::string line, keyword, value;
1062 get_line(line, input_stream, MAX_STRING); 1051 get_line(line, input_stream, MAX_STRING);
1063 get_keyword_and_value(keyword, value, line); 1052 get_keyword_and_value(keyword, value, line);
1064 1053
@@ -1068,7 +1057,7 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
1068 } 1057 }
1069 else if ("id" == keyword) 1058 else if ("id" == keyword)
1070 { 1059 {
1071 entry->mID.set( value.c_str() ); 1060 entry->mID.set( value );
1072 } 1061 }
1073 else if ("name" == keyword) 1062 else if ("name" == keyword)
1074 { 1063 {
@@ -1077,13 +1066,13 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
1077 else if ("time" == keyword) 1066 else if ("time" == keyword)
1078 { 1067 {
1079 S32 when; 1068 S32 when;
1080 LLString::convertToS32(value, when); 1069 LLStringUtil::convertToS32(value, when);
1081 entry->mTime = when; 1070 entry->mTime = when;
1082 } 1071 }
1083 else if ("flags" == keyword) 1072 else if ("flags" == keyword)
1084 { 1073 {
1085 U32 setting; 1074 U32 setting;
1086 LLString::convertToU32(value, setting); 1075 LLStringUtil::convertToU32(value, setting);
1087 entry->mFlags = setting; 1076 entry->mFlags = setting;
1088 } 1077 }
1089 else 1078 else
@@ -1098,7 +1087,7 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
1098BOOL LLParcel::exportStream(std::ostream& output_stream) 1087BOOL LLParcel::exportStream(std::ostream& output_stream)
1099{ 1088{
1100 S32 setting; 1089 S32 setting;
1101 char id_string[MAX_STRING]; /* Flawfinder: ignore */ 1090 std::string id_string;
1102 1091
1103 std::ios::fmtflags old_flags = output_stream.flags(); 1092 std::ios::fmtflags old_flags = output_stream.flags();
1104 output_stream.setf(std::ios::showpoint); 1093 output_stream.setf(std::ios::showpoint);
@@ -1201,8 +1190,10 @@ BOOL LLParcel::exportStream(std::ostream& output_stream)
1201 output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n"; 1190 output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n";
1202 output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n"; 1191 output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n";
1203 output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n"; 1192 output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n";
1204 output_stream << "\t\t allow_voice_chat " << (getVoiceEnabled() ? 1 : 0) << "\n"; 1193 output_stream << "\t\t use_estate_voice_chan " << (getParcelFlagUseEstateVoiceChannel() ? 1 : 0) << "\n";
1205 output_stream << "\t\t use_estate_voice_chan " << (getVoiceUseEstateChannel() ? 1 : 0) << "\n"; 1194
1195 output_stream << "\t\t allow_voice_chat " << (getParcelFlagAllowVoice() ? 1 : 0) << "\n";
1196 output_stream << "\t\t use_estate_voice_chan " << (getParcelFlagUseEstateVoiceChannel() ? 1 : 0) << "\n";
1206 output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n"; 1197 output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n";
1207 output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n"; 1198 output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n";
1208 output_stream << "\t\t draw_distance " << mDrawDistance << "\n"; 1199 output_stream << "\t\t draw_distance " << mDrawDistance << "\n";
@@ -1374,17 +1365,17 @@ void LLParcel::packMessage(LLSD& msg)
1374 1365
1375void LLParcel::unpackMessage(LLMessageSystem* msg) 1366void LLParcel::unpackMessage(LLMessageSystem* msg)
1376{ 1367{
1377 char buffer[256]; /* Flawfinder: ignore */ 1368 std::string buffer;
1378 1369
1379 msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags ); 1370 msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags );
1380 msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice ); 1371 msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice );
1381 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, 256, buffer ); 1372 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, buffer );
1382 setName(buffer); 1373 setName(buffer);
1383 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, 256, buffer ); 1374 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, buffer );
1384 setDesc(buffer); 1375 setDesc(buffer);
1385 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, 256, buffer ); 1376 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, buffer );
1386 setMusicURL(buffer); 1377 setMusicURL(buffer);
1387 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, 256, buffer ); 1378 msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
1388 setMediaURL(buffer); 1379 setMediaURL(buffer);
1389 1380
1390 // non-optimized version 1381 // non-optimized version
@@ -1409,9 +1400,9 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
1409 // Note: the message has been converted to TCP 1400 // Note: the message has been converted to TCP
1410 if(msg->getNumberOfBlocks("MediaData") > 0) 1401 if(msg->getNumberOfBlocks("MediaData") > 0)
1411 { 1402 {
1412 msg->getString("MediaData", "MediaDesc", 256, buffer); 1403 msg->getString("MediaData", "MediaDesc", buffer);
1413 setMediaDesc(buffer); 1404 setMediaDesc(buffer);
1414 msg->getString("MediaData", "MediaType", 256, buffer); 1405 msg->getString("MediaData", "MediaType", buffer);
1415 setMediaType(buffer); 1406 setMediaType(buffer);
1416 msg->getS32("MediaData", "MediaWidth", mMediaWidth); 1407 msg->getS32("MediaData", "MediaWidth", mMediaWidth);
1417 msg->getS32("MediaData", "MediaHeight", mMediaHeight); 1408 msg->getS32("MediaData", "MediaHeight", mMediaHeight);
@@ -1421,8 +1412,8 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
1421 } 1412 }
1422 else 1413 else
1423 { 1414 {
1424 setMediaType("video/vnd.secondlife.qt.legacy"); 1415 setMediaType(std::string("video/vnd.secondlife.qt.legacy"));
1425 setMediaDesc("No Description available without Server Upgrade"); 1416 setMediaDesc(std::string("No Description available without Server Upgrade"));
1426 mMediaLoop = true; 1417 mMediaLoop = true;
1427 mObscureMedia = true; 1418 mObscureMedia = true;
1428 mObscureMusic = true; 1419 mObscureMusic = true;
@@ -1685,37 +1676,37 @@ BOOL LLParcel::removeFromBanList(const LLUUID& agent_id)
1685} 1676}
1686 1677
1687// static 1678// static
1688const char* LLParcel::getOwnershipStatusString(EOwnershipStatus status) 1679const std::string& LLParcel::getOwnershipStatusString(EOwnershipStatus status)
1689{ 1680{
1690 return ownership_status_to_string(status); 1681 return ownership_status_to_string(status);
1691} 1682}
1692 1683
1693// static 1684// static
1694const char* LLParcel::getCategoryString(ECategory category) 1685const std::string& LLParcel::getCategoryString(ECategory category)
1695{ 1686{
1696 return category_to_string(category); 1687 return category_to_string(category);
1697} 1688}
1698 1689
1699// static 1690// static
1700const char* LLParcel::getCategoryUIString(ECategory category) 1691const std::string& LLParcel::getCategoryUIString(ECategory category)
1701{ 1692{
1702 return category_to_ui_string(category); 1693 return category_to_ui_string(category);
1703} 1694}
1704 1695
1705// static 1696// static
1706LLParcel::ECategory LLParcel::getCategoryFromString(const char* string) 1697LLParcel::ECategory LLParcel::getCategoryFromString(const std::string& string)
1707{ 1698{
1708 return category_string_to_category(string); 1699 return category_string_to_category(string);
1709} 1700}
1710 1701
1711// static 1702// static
1712LLParcel::ECategory LLParcel::getCategoryFromUIString(const char* string) 1703LLParcel::ECategory LLParcel::getCategoryFromUIString(const std::string& string)
1713{ 1704{
1714 return category_ui_string_to_category(string); 1705 return category_ui_string_to_category(string);
1715} 1706}
1716 1707
1717// static 1708// static
1718const char* LLParcel::getActionString(LLParcel::EAction action) 1709const std::string& LLParcel::getActionString(LLParcel::EAction action)
1719{ 1710{
1720 S32 index = 0; 1711 S32 index = 0;
1721 if((action >= 0) && (action < LLParcel::A_COUNT)) 1712 if((action >= 0) && (action < LLParcel::A_COUNT))
@@ -1848,19 +1839,19 @@ BOOL LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const
1848void LLParcel::clearParcel() 1839void LLParcel::clearParcel()
1849{ 1840{
1850 overrideParcelFlags(PF_DEFAULT); 1841 overrideParcelFlags(PF_DEFAULT);
1851 setName(NULL); 1842 setName(LLStringUtil::null);
1852 setDesc(NULL); 1843 setDesc(LLStringUtil::null);
1853 setMediaURL(NULL); 1844 setMediaURL(LLStringUtil::null);
1854 setMediaType(NULL); 1845 setMediaType(LLStringUtil::null);
1855 setMediaID(LLUUID::null); 1846 setMediaID(LLUUID::null);
1856 setMediaDesc(NULL); 1847 setMediaDesc(LLStringUtil::null);
1857 setMediaAutoScale(0); 1848 setMediaAutoScale(0);
1858 setMediaLoop(TRUE); 1849 setMediaLoop(TRUE);
1859 mObscureMedia = 1; 1850 mObscureMedia = 1;
1860 mObscureMusic = 1; 1851 mObscureMusic = 1;
1861 mMediaWidth = 0; 1852 mMediaWidth = 0;
1862 mMediaHeight = 0; 1853 mMediaHeight = 0;
1863 setMusicURL(NULL); 1854 setMusicURL(LLStringUtil::null);
1864 setInEscrow(FALSE); 1855 setInEscrow(FALSE);
1865 setAuthorizedBuyerID(LLUUID::null); 1856 setAuthorizedBuyerID(LLUUID::null);
1866 setCategory(C_NONE); 1857 setCategory(C_NONE);
@@ -1884,20 +1875,20 @@ void LLParcel::dump()
1884 llinfos << " desc <" << mDesc << ">" << llendl; 1875 llinfos << " desc <" << mDesc << ">" << llendl;
1885} 1876}
1886 1877
1887const char* ownership_status_to_string(LLParcel::EOwnershipStatus status) 1878const std::string& ownership_status_to_string(LLParcel::EOwnershipStatus status)
1888{ 1879{
1889 if(status >= 0 && status < LLParcel::OS_COUNT) 1880 if(status >= 0 && status < LLParcel::OS_COUNT)
1890 { 1881 {
1891 return PARCEL_OWNERSHIP_STATUS_STRING[status]; 1882 return PARCEL_OWNERSHIP_STATUS_STRING[status];
1892 } 1883 }
1893 return "none"; 1884 return PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT];
1894} 1885}
1895 1886
1896LLParcel::EOwnershipStatus ownership_string_to_status(const char* s) 1887LLParcel::EOwnershipStatus ownership_string_to_status(const std::string& s)
1897{ 1888{
1898 for(S32 i = 0; i < LLParcel::OS_COUNT; ++i) 1889 for(S32 i = 0; i < LLParcel::OS_COUNT; ++i)
1899 { 1890 {
1900 if(0 == strcmp(s, PARCEL_OWNERSHIP_STATUS_STRING[i])) 1891 if(s == PARCEL_OWNERSHIP_STATUS_STRING[i])
1901 { 1892 {
1902 return (LLParcel::EOwnershipStatus)i; 1893 return (LLParcel::EOwnershipStatus)i;
1903 } 1894 }
@@ -1927,7 +1918,7 @@ LLParcel::EOwnershipStatus ownership_string_to_status(const char* s)
1927// return LLParcel::STEA_REVERT; 1918// return LLParcel::STEA_REVERT;
1928//} 1919//}
1929 1920
1930const char* category_to_string(LLParcel::ECategory category) 1921const std::string& category_to_string(LLParcel::ECategory category)
1931{ 1922{
1932 S32 index = 0; 1923 S32 index = 0;
1933 if((category >= 0) && (category < LLParcel::C_COUNT)) 1924 if((category >= 0) && (category < LLParcel::C_COUNT))
@@ -1937,7 +1928,7 @@ const char* category_to_string(LLParcel::ECategory category)
1937 return PARCEL_CATEGORY_STRING[index]; 1928 return PARCEL_CATEGORY_STRING[index];
1938} 1929}
1939 1930
1940const char* category_to_ui_string(LLParcel::ECategory category) 1931const std::string& category_to_ui_string(LLParcel::ECategory category)
1941{ 1932{
1942 S32 index = 0; 1933 S32 index = 0;
1943 if((category >= 0) && (category < LLParcel::C_COUNT)) 1934 if((category >= 0) && (category < LLParcel::C_COUNT))
@@ -1952,11 +1943,11 @@ const char* category_to_ui_string(LLParcel::ECategory category)
1952 return PARCEL_CATEGORY_UI_STRING[index]; 1943 return PARCEL_CATEGORY_UI_STRING[index];
1953} 1944}
1954 1945
1955LLParcel::ECategory category_string_to_category(const char* s) 1946LLParcel::ECategory category_string_to_category(const std::string& s)
1956{ 1947{
1957 for(S32 i = 0; i < LLParcel::C_COUNT; ++i) 1948 for(S32 i = 0; i < LLParcel::C_COUNT; ++i)
1958 { 1949 {
1959 if(0 == strcmp(s, PARCEL_CATEGORY_STRING[i])) 1950 if(s == PARCEL_CATEGORY_STRING[i])
1960 { 1951 {
1961 return (LLParcel::ECategory)i; 1952 return (LLParcel::ECategory)i;
1962 } 1953 }
@@ -1965,11 +1956,11 @@ LLParcel::ECategory category_string_to_category(const char* s)
1965 return LLParcel::C_NONE; 1956 return LLParcel::C_NONE;
1966} 1957}
1967 1958
1968LLParcel::ECategory category_ui_string_to_category(const char* s) 1959LLParcel::ECategory category_ui_string_to_category(const std::string& s)
1969{ 1960{
1970 for(S32 i = 0; i < LLParcel::C_COUNT; ++i) 1961 for(S32 i = 0; i < LLParcel::C_COUNT; ++i)
1971 { 1962 {
1972 if(0 == strcmp(s, PARCEL_CATEGORY_UI_STRING[i])) 1963 if(s == PARCEL_CATEGORY_UI_STRING[i])
1973 { 1964 {
1974 return (LLParcel::ECategory)i; 1965 return (LLParcel::ECategory)i;
1975 } 1966 }