3DCoatScripting  4.8.31β
С помощью скриптинга можно управлять возможностями Коута и расширять его функционал.
Класс coat::scripto::File

Class for working with file of... any format, including a text and just binary. Подробнее...

Открытые члены

 File ()
 Constructor for building an empty file-object. Подробнее...
 
Filebinary (const bool &v)
 Setter for binary mode of file. Подробнее...
 
bool binary () const
 Getter a binary mode of file. Подробнее...
 
Fileextension (const std::string &)
 Setter for extension of file. Подробнее...
 
std::string extension () const
 Getter for extension of file. Подробнее...
 
FilefullPathFile (const std::string &v)
 Setter for full path with file name. Подробнее...
 
std::string fullPathFile () const
 Getter for full path with file name. Подробнее...
 
Filepath (const std::string &)
 Setter for path of file. Подробнее...
 
std::string path () const
 Getter for path of file. Подробнее...
 
template<class T >
Fileoperator= (const T &)
 Write to file with erase it. Подробнее...
 
template<class T >
Fileappend (const T &)
 Write to file with append to it. Подробнее...
 
template<class T >
Fileoperator+= (const T &v)
 Write to file with append to it. Подробнее...
 
Fileremove ()
 Removes the file. Подробнее...
 
template<>
Fileoperator= (const FormatBinary &b)
 
template<>
Fileoperator= (const FormatDAE &b)
 
template<>
Fileoperator= (const FormatFBX &b)
 
template<>
Fileoperator= (const FormatOBJ &b)
 
template<>
Fileappend (const FormatBinary &b)
 
template<>
Fileappend (const unsigned char &d)
 

Подробное описание

Class for working with file of... any format, including a text and just binary.

file.jpg
Начиная с
4.5.32

Конструктор(ы)

coat::scripto::File::File ( )
inline

Constructor for building an empty file-object.

См. также
file( const string& )

Методы

File& coat::scripto::File::binary ( const bool &  v)
inline

Setter for binary mode of file.

File a( "a.data" );
a.binary( true );
См. также
File( const string&, bool )
bool coat::scripto::File::binary ( ) const
inline

Getter a binary mode of file.

File a( "a.dat", true );
bool r = a.binary();
File & coat::scripto::File::extension ( const std::string &  v)

Setter for extension of file.

File a( "a" );
a.extension( "json" );
std::string coat::scripto::File::extension ( ) const

Getter for extension of file.

File a( "a.obj" );
string r = a.extension();
File& coat::scripto::File::fullPathFile ( const std::string &  v)
inline

Setter for full path with file name.

File a( "3DCoat/examples/my/a.txt" );
a.fullPathFile( "3DCoat/examples/a1.txt" );
std::string coat::scripto::File::fullPathFile ( ) const
inline

Getter for full path with file name.

File a( "3DCoat/examples/my/a.txt" );
string r = a.fullPathFile();
File & coat::scripto::File::path ( const std::string &  v)

Setter for path of file.

Необходимо сделать:

name of file with extension

std::string name() const;

Необходимо сделать:
File& name( const std::string& );
File a( "any/path/a.fbx" );
a.path( "3DCoat/examples/my" );
std::string coat::scripto::File::path ( ) const

Getter for path of file.

File a( "3DCoat/examples/my/a.fbx" );
string r = a.path();
template<class T >
File& coat::scripto::File::operator= ( const T &  )

Write to file with erase it.

File a( "3DCoat/examples/my/a.txt" );
a = "Line for demo...\n"
"and yet one, yes!";
File a( "3DCoat/examples/my/a" );
FormatBinary bin = { 0x46, 0x4c, 0x49, 0x46 };
a = bin;
File a( "3DCoat/examples/my/a" );
FormatFBX fbx;
// export the scene like FBX-format
a = fbx;
template<class T >
File& coat::scripto::File::append ( const T &  )

Write to file with append to it.

File a( "3DCoat/examples/my/a.txt" );
a += "Line for demo...\n"
"and yet, yes!";
File a( "3DCoat/examples/my/a" );
FormatBinary bin = { '.', '\r', '\n' };
a += bin;
template<class T >
File& coat::scripto::File::operator+= ( const T &  v)
inline

Write to file with append to it.

File a( "3DCoat/examples/my/a.txt" );
a += "Line for demo...\n"
"and yet, yes!";
File a( "3DCoat/examples/my/a" );
FormatBinary bin = { '.', '\r', '\n' };
a += bin;
File & coat::scripto::File::remove ( )

Removes the file.

Необходимо сделать:

write to file with prepend

File& copy()

Необходимо сделать:
File& clear();
File a( "a.txt" );
a.remove();