PageRenderTime 86ms CodeModel.GetById 40ms app.highlight 16ms RepoModel.GetById 24ms app.codeStats 0ms

/indra/newview/llurl.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 95 lines | 29 code | 16 blank | 50 comment | 0 complexity | 1b1121f64e7de1d4a1cf6ab034b0b3eb MD5 | raw file
 1/** 
 2 * @file llurl.h
 3 * @brief Text url class
 4 *
 5 * $LicenseInfo:firstyear=2001&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#ifndef LL_LLURL_H
28#define LL_LLURL_H
29
30// splits a URL into its parts, which are:
31//
32//  [URI][AUTHORITY][PATH][FILENAME][EXTENSION][TAG]
33//
34//  e.g. http://www.lindenlab.com/early/bite_me.html#where
35//
36//  URI=       "http"
37//  AUTHORITY= "www.lindenlab.com"
38//  PATH=      "/early/"
39//  FILENAME=  "bite_me"
40//  EXTENSION= "html"
41//  TAG=       "where"
42//
43//
44// test cases:
45//
46// http://www.lindenlab.com/early/bite_me.html#where
47// http://www.lindenlab.com/
48// http://www.lindenlab.com
49// www.lindenlab.com             ?
50// early/bite_me.html#where
51// mailto://test@lindenlab.com
52// mailto:test@lindenlab.com
53//
54//
55
56
57class LLURL
58{
59public:
60	LLURL();
61	LLURL(const LLURL &url);
62	LLURL(const char * url);
63
64	LLURL &operator=(const LLURL &rhs);
65
66	virtual ~LLURL();
67
68	virtual void init (const char * url);
69	virtual void cleanup ();
70
71	bool operator==(const LLURL &rhs) const;
72	bool operator!=(const LLURL &rhs) const;
73
74	virtual const char *getFQURL() const;
75	virtual const char *getFullPath();
76	virtual const char *getAuthority();
77
78	virtual const char *updateRelativePath(const LLURL &url);
79
80	virtual BOOL  isExtension(const char *compare) {return (!strcmp(mExtension,compare));};
81
82public:	
83	
84	char        mURI[LL_MAX_PATH];		/* Flawfinder: ignore */
85	char        mAuthority[LL_MAX_PATH];		/* Flawfinder: ignore */
86	char        mPath[LL_MAX_PATH];		/* Flawfinder: ignore */
87	char        mFilename[LL_MAX_PATH];		/* Flawfinder: ignore */
88	char        mExtension[LL_MAX_PATH];		/* Flawfinder: ignore */
89	char        mTag[LL_MAX_PATH];		/* Flawfinder: ignore */
90
91	static char sReturnString[LL_MAX_PATH];		/* Flawfinder: ignore */
92};
93
94#endif  // LL_LLURL_H
95