diff options
Diffstat (limited to 'linden/indra/newview/llclassifiedinfo.cpp')
-rw-r--r-- | linden/indra/newview/llclassifiedinfo.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/linden/indra/newview/llclassifiedinfo.cpp b/linden/indra/newview/llclassifiedinfo.cpp new file mode 100644 index 0000000..3115e30 --- /dev/null +++ b/linden/indra/newview/llclassifiedinfo.cpp | |||
@@ -0,0 +1,68 @@ | |||
1 | /** | ||
2 | * @file llclassifiedinfo.cpp | ||
3 | * @brief LLClassifiedInfo class definition | ||
4 | * | ||
5 | * Copyright (c) 2005-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #include "llviewerprecompiledheaders.h" | ||
29 | #include "llclassifiedinfo.h" | ||
30 | |||
31 | #include "viewer.h" // for gPacificDaylightTime | ||
32 | #include "lluuid.h" | ||
33 | |||
34 | LLClassifiedInfo::cat_map LLClassifiedInfo::sCategories; | ||
35 | |||
36 | // static | ||
37 | void LLClassifiedInfo::loadCategories(LLUserAuth::options_t classified_options) | ||
38 | { | ||
39 | LLUserAuth::options_t::iterator resp_it; | ||
40 | for (resp_it = classified_options.begin(); | ||
41 | resp_it != classified_options.end(); | ||
42 | ++resp_it) | ||
43 | { | ||
44 | const LLUserAuth::response_t& response = *resp_it; | ||
45 | |||
46 | LLUserAuth::response_t::const_iterator option_it; | ||
47 | |||
48 | S32 cat_id = 0; | ||
49 | option_it = response.find("category_id"); | ||
50 | if (option_it != response.end()) | ||
51 | { | ||
52 | cat_id = atoi(option_it->second.c_str()); | ||
53 | } | ||
54 | else | ||
55 | { | ||
56 | continue; | ||
57 | } | ||
58 | |||
59 | // Add the category id/name pair | ||
60 | option_it = response.find("category_name"); | ||
61 | if (option_it != response.end()) | ||
62 | { | ||
63 | LLClassifiedInfo::sCategories[cat_id] = option_it->second; | ||
64 | } | ||
65 | |||
66 | } | ||
67 | |||
68 | } | ||