-
首页
-
C4D R23.110 C++ SDK
#include <c4d_file.h>
详细描述
Manages file and path names.
构造函数 & 析构函数文档编制
◆
Filename()
[1/4]
Default constructor.
◆
Filename()
[2/4]
Constructs the filename from a character array.
-
参数
-
[in]
|
string
|
The filename character array.
|
◆
Filename()
[3/4]
Constructs the filename from a string.
-
参数
-
[in]
|
string
|
The filename string.
|
◆
Filename()
[4/4]
Copy constructor. Creates a filename from another filename.
-
参数
-
[in]
|
src
|
The source filename.
|
◆
~Filename()
Default destructor.
成员函数文档编制
◆
IsPopulated()
Bool
IsPopulated
|
(
|
|
)
|
const
|
Checks if the filename has been set.
-
返回
-
true
if filename was set, otherwise
false
.
◆
GetString()
String
GetString
|
(
|
void
|
|
)
|
const
|
Gets the
String
of the filename.
-
返回
-
The string with the full filename.
◆
SetString()
Sets the filename to the passed string.
-
参数
-
[in]
|
str
|
The string to use to set the filename.
|
◆
GetDirectory()
const
Filename
GetDirectory
|
(
|
void
|
|
)
|
const
|
Gets the directory that the file is located.
-
返回
-
The directory part for the filename.
◆
SetDirectory()
void SetDirectory
|
(
|
const
Filename
&
|
str
|
)
|
|
Sets the directory for the filename. The file part remains unchanged.
-
参数
-
[in]
|
str
|
The directory to set for the filename.
|
◆
GetFile()
Gets the file part of the filename only, without the path.
-
返回
-
The file part of the filename.
◆
SetFile()
Sets the file part for the filename. The directory part remains unchanged.
-
参数
-
[in]
|
str
|
The file part to set for the filename.
|
◆
GetFileString()
String
GetFileString
|
(
|
void
|
|
)
|
const
|
Convenience function to directly get the file part string. Identical to
GetFile()
.
GetString()
.
-
返回
-
The file part of the filename as a string.
◆
GetSuffix()
String
GetSuffix
|
(
|
void
|
|
)
|
const
|
Gets the suffix of the filename.
-
注意
-
Suffix strings do not contain the dot character
'
.'.
-
返回
-
The suffix. Only contains the suffix part without dot (e.g.
"TIF"
).
◆
SetSuffix()
Sets the suffix part of the filename.
-
注意
-
Suffix strings do not contain the dot character
'
.'.
-
参数
-
[in]
|
str
|
A string with the suffix for the file. Only contains the suffix part and no dot (e.g.
"TIF"
).
|
◆
ClearSuffix()
void ClearSuffix
|
(
|
void
|
|
)
|
|
Clears the suffix part of the filename.
◆
ClearSuffixComplete()
void ClearSuffixComplete
|
(
|
void
|
|
)
|
|
如同
ClearSuffix()
only that it also clears suffixes longer than seven characters.
◆
CheckSuffix()
Checks if the suffix of the filename is the same as its string.
-
参数
-
[in]
|
str
|
The suffix to check against.
|
-
返回
-
true
if the suffix was checked successfully, otherwise
false
.
◆
SetMemoryReadMode()
void SetMemoryReadMode
|
(
|
void *
|
adr
,
|
|
|
Int
|
size
=
-1
,
|
|
|
Bool
|
transferOwnership
=
false
|
|
)
|
|
|
Sets the filename to read from a memory block instead of from a file.
-
参数
-
[in]
|
adr
|
The memory to read from. The caller owns the pointed memory block.
|
[in]
|
size
|
The size of memory block starting at
adr
,或
-1
if the buffer is "big enough".
|
[in]
|
transferOwnership
|
若
true
the ownership of the memory block is transfered to the caller, who then needs to free the memory with
DeleteMem()
.
Otherwise (
false
by default) the memory block will be freed when the
MemoryFileStruct
is destructed.
|
◆
SetMemoryWriteMode()
Sets the filename to write to a memory block instead of to a file.
-
参数
-
[in]
|
mfs
|
The memory file to write to. The caller owns the pointed memory file.
|
◆
operator=()
Assignment operator. Assigns the right-operand filename to the left-operand filename.
-
参数
-
[in]
|
fname
|
The right-operand filename.
|
-
返回
-
The left-operand filename.
◆
operator+=()
Concatenates the filenames and set the left-hand operand to the result.
-
参数
-
[in]
|
fname
|
The right-operand filename.
|
-
返回
-
The left-operand filename.
◆
operator==()
Checks if two filenames are equal.
-
参数
-
[in]
|
fname
|
The right-operand filename.
|
-
返回
-
true
if filenames are equal, otherwise
false
.
◆
operator!=()
Check if two filenames are different.
-
参数
-
[in]
|
fname
|
The right-operand filename.
|
-
返回
-
true
if filenames are different, otherwise
false
.
◆
CopyTo()
Copies the filename to
dst
.
-
参数
-
[out]
|
dst
|
The destination filename. The caller owns the pointed filename.
|
◆
IsBrowserUrl()
Bool
IsBrowserUrl
|
(
|
|
)
|
const
|
Checks if the filename is a content browser url.
-
返回
-
true
if the filename is a browser url, otherwise
false
.
◆
FileSelect()
Opens a file selector dialog.
范例:
To load a file:
Bool
ok = fn.
FileSelect
(
FILESELECTTYPE::ANYTHING
,
FILESELECT::LOAD
,
"Load"
);
To save a
bmp
文件:
Bool
ok = fn.
FileSelect
(
FILESELECTTYPE::IMAGES
,
FILESELECT::SAVE
,
"Save"
,
"bmp"
);
-
参数
-
[in]
|
type
|
The type of file to show in the file selector:
FILESELECTTYPE
|
[in]
|
flags
|
The file selector flags:
FILESELECT
|
[in]
|
title
|
The title for the file selector dialog.
|
[in]
|
force_suffix
|
Set this to suffix to force a filename suffix when in save mode.
|
-
返回
-
true
if the user selected a file, otherwise
false
.
Friends And Related Function Documentation
◆
operator+
Concatenates the two filenames. It will join directories and files parts.
-
参数
-
[in]
|
fname1
|
The left-operand filename.
|
[in]
|
fname2
|
The right-operand filename.
|
-
返回
-
The result of the concatenation of the 2 filenames.
Member Data Documentation
◆
dummy1
maxon::Bool Bool
定义:
ge_sys_math.h:53
Bool FileSelect(FILESELECTTYPE type, FILESELECT flags, const maxon::String &title, const maxon::String &force_suffix=maxon::String())