MrSID Decode SDK for Raster Reference Manual
9.0.0.3864
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
lt_fileSpec.h
Go to the documentation of this file.
1
/* $Id$ */
2
/* //////////////////////////////////////////////////////////////////////////
3
// //
4
// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
5
// Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
6
// prohibited. Access to and use of this code is permitted only under //
7
// license from LizardTech, Inc. Portions of the code are protected by //
8
// US and foreign patents and other filings. All Rights Reserved. //
9
// //
11
/* PUBLIC */
12
13
#ifndef LT_FILESPEC_H
14
#define LT_FILESPEC_H
15
16
// lt_lib_base
17
#include "
lt_base.h
"
18
#include "
lt_system.h
"
19
20
LT_BEGIN_NAMESPACE
(LizardTech)
24
#ifdef LT_OS_WIN
25
#define LT_UTIL_MAX_PATH _MAX_PATH
26
#else
27
#define LT_UTIL_MAX_PATH 2048
28
#endif
29
33
class
LTFileSpec
34
{
35
public
:
36
enum
37
{
38
fSlash
=
'/'
,
39
bSlash
=
'\\'
,
40
#ifdef LT_OS_WIN
41
platformSlash
=
'\\'
42
#else
43
platformSlash
=
'/'
44
#endif
45
};
46
47
48
public
:
52
LTFileSpec
(
void
);
53
57
~LTFileSpec
(
void
);
58
67
enum
EncodingType
{
NATIVE
,
UTF8
};
68
LTFileSpec
(
const
char
*p1,
69
EncodingType
encoding =
NATIVE
);
70
LTFileSpec
(
const
char
*p1,
const
char
*p2,
71
EncodingType
encoding =
NATIVE
);
72
LTFileSpec
(
const
char
*p1,
const
char
*p2,
const
char
*p3,
73
EncodingType
encoding =
NATIVE
);
74
75
81
explicit
LTFileSpec
(
const
wchar_t
*p1);
82
LTFileSpec
(
const
wchar_t
*p1,
const
wchar_t
*p2);
83
LTFileSpec
(
const
wchar_t
*p1,
const
wchar_t
*p2,
const
wchar_t
*p3);
84
85
#ifndef LT_OS_WIN
86
90
explicit
LTFileSpec
(
const
lt_uint16
*path);
91
LTFileSpec
(
const
lt_uint16
*p1,
const
lt_uint16
*p2);
92
LTFileSpec
(
const
lt_uint16
*p1,
const
lt_uint16
*p2,
const
lt_uint16
*p3);
93
#endif
94
95
LTFileSpec
(
const
LTFileSpec
&p1);
96
LTFileSpec
(
const
LTFileSpec
&p1,
const
LTFileSpec
&p2);
97
LTFileSpec
(
const
LTFileSpec
&p1,
const
LTFileSpec
&p2,
const
LTFileSpec
&p3);
98
99
LTFileSpec
(
const
LTFileSpec
&p1,
const
char
*p2,
100
EncodingType
encoding);
101
LTFileSpec
(
const
LTFileSpec
&p1,
const
char
*p2,
const
char
*p3,
102
EncodingType
encoding);
103
LTFileSpec
(
const
LTFileSpec
&p1,
const
LTFileSpec
&p2,
const
char
*p3,
104
EncodingType
encoding);
105
106
LTFileSpec
(
const
LTFileSpec
&p1,
const
wchar_t
*p2);
107
LTFileSpec
(
const
LTFileSpec
&p1,
const
wchar_t
*p2,
const
wchar_t
*p3);
108
LTFileSpec
(
const
LTFileSpec
&p1,
const
LTFileSpec
&p2,
const
wchar_t
*p3);
109
110
#ifndef LT_OS_WIN
111
LTFileSpec
(
const
LTFileSpec
&p1,
const
lt_uint16
*p2);
112
LTFileSpec
(
const
LTFileSpec
&p1,
const
lt_uint16
*p2,
const
lt_uint16
*p3);
113
LTFileSpec
(
const
LTFileSpec
&p1,
const
LTFileSpec
&p2,
const
lt_uint16
*p3);
114
#endif
115
121
LTFileSpec
&
operator=
(
const
LTFileSpec
&that);
122
126
bool
operator!=
(
const
LTFileSpec
& fs)
const
;
127
131
bool
operator==
(
const
LTFileSpec
& fs)
const
;
132
133
// is the fileSpec empty
134
bool
empty
(
void
)
const
;
135
139
const
char
*
utf8
(
void
)
const
;
140
147
const
char
*
n_str
(
void
)
const
;
148
155
const
wchar_t
*
w_str
(
void
)
const
;
170
LTFileSpec
dirname
(
void
)
const
;
171
186
const
char
*
basename
(
void
)
const
;
187
196
const
char
*
getSuffix
()
const
;
197
210
LTFileSpec
replaceSuffix
(
const
char
* ext)
const
;
211
222
LTFileSpec
removeSuffix
()
const
;
223
227
bool
absolute
()
const
;
228
229
protected
:
230
235
void
init
(
const
char
*p1,
const
char
*p2,
const
char
*p3);
236
237
size_t
getPrefixLength
(
void
)
const
;
238
private
:
239
// using a utf8 string to hold the path because it is the easiest
240
// to play with (we can look for bSlashs and not have to worry
241
// about lead btyes.
242
char
*m_path8;
243
mutable
char
*m_pathA;
// this will be updated in n_str()
244
mutable
wchar_t
*m_pathW;
// this will be updated in w_str()
245
246
};
247
248
LT_END_NAMESPACE
(LizardTech)
249
250
#endif // LT_FILESPEC_H
LizardTech