PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/lldictionary.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 47 lines | 17 code | 4 blank | 26 comment | 5 complexity | 78e84d350ffdae5e48966d539c2c5f11 MD5 | raw file
 1/** 
 2 * @file lldictionary.cpp
 3 * @brief Lldictionary class header file
 4 *
 5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#include "linden_common.h"
28
29#include "lldictionary.h"
30
31#include "llstring.h"
32
33// Define in .cpp file to prevent header include of llstring.h
34LLDictionaryEntry::LLDictionaryEntry(const std::string &name)
35:	mName(name)
36{
37	mNameCapitalized = mName;
38	LLStringUtil::replaceChar(mNameCapitalized, '-', ' ');
39	LLStringUtil::replaceChar(mNameCapitalized, '_', ' ');
40	for (U32 i=0; i < mNameCapitalized.size(); i++)
41	{
42		if (i == 0 || mNameCapitalized[i-1] == ' ') // don't change ordering of this statement or crash
43		{
44			mNameCapitalized[i] = toupper(mNameCapitalized[i]);
45		}
46	}
47}