PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llurlwhitelist.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 65 lines | 27 code | 12 blank | 26 comment | 0 complexity | 0439faec4f7612361bf21dd94763350b MD5 | raw file
 1/** 
 2 * @file llurlwhitelist.h
 3 * @author Callum Prentice
 4 * @brief maintains a "white list" of acceptable URLS that are stored on disk
 5 *
 6 * $LicenseInfo:firstyear=2005&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef LL_LLURLWHITELIST_H
29#define LL_LLURLWHITELIST_H
30
31#include <list>
32
33class LLUrlWhiteList
34{
35	public:
36		virtual ~LLUrlWhiteList ();
37
38		static void initClass();
39		static void cleanupClass();
40		static LLUrlWhiteList* getInstance ();
41
42		bool load ();
43		bool save ();
44
45		bool clear ();
46		bool addItem ( const std::string& itemIn, bool saveAfterAdd );
47
48		bool containsMatch ( const std::string& patternIn );
49
50		bool getFirst ( std::string& valueOut );
51		bool getNext ( std::string& valueOut );
52
53	private:
54		LLUrlWhiteList ();
55		static LLUrlWhiteList* sInstance;
56
57		typedef std::vector < std::string > string_list_t ;
58
59		bool mLoaded;
60		const std::string mFilename;
61		string_list_t mUrlList;
62		U32 mCurIndex;
63};
64
65#endif  // LL_LLURLWHITELIST_H