summaryrefslogtreecommitdiff
path: root/indra/newview/llurlwhitelist.h
blob: 43233eca3b44b5d2e826ef7261a9bd2e93168743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** 
 * @file llurlwhitelist.h
 * @author Callum Prentice
 * @brief maintains a "white list" of acceptable URLS that are stored on disk
 *
 * Copyright (c) 2005-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#ifndef LL_LLURLWHITELIST_H
#define LL_LLURLWHITELIST_H

#include <list>

class LLUrlWhiteList
{
	public:
		virtual ~LLUrlWhiteList ();

		static void initClass();
		static void cleanupClass();
		static LLUrlWhiteList* getInstance ();

		bool load ();
		bool save ();

		bool clear ();
		bool addItem ( const LLString& itemIn, bool saveAfterAdd );

		bool containsMatch ( const LLString& patternIn );

		bool getFirst ( LLString& valueOut );
		bool getNext ( LLString& valueOut );

	private:
		LLUrlWhiteList ();
		static LLUrlWhiteList* sInstance;

		typedef std::vector < LLString > string_list_t ;

		bool mLoaded;
		const LLString mFilename;
		string_list_t mUrlList;
		U32 mCurIndex;
};

#endif  // LL_LLURLWHITELIST_H