3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
coat::scripto::File Class Reference

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

#include <SFile.h>

Public Member Functions

 File ()
 Constructor for building an empty file-object. More...
 
Filebinary (const bool &v)
 Setter for binary mode of file. More...
 
bool binary () const
 Getter a binary mode of file. More...
 
Fileextension (const std::string &)
 Setter for extension of file. More...
 
std::string extension () const
 Getter for extension of file. More...
 
FilefullPathFile (const std::string &v)
 Setter for full path with file name. More...
 
std::string fullPathFile () const
 Getter for full path with file name. More...
 
Filepath (const std::string &)
 Setter for path of file. More...
 
std::string path () const
 Getter for path of file. More...
 
bool operator== (const File &b) const
 File comparison in binary. More...
 
template<class T >
Fileoperator= (const T &)
 Write to file with erase it. More...
 
template<class T >
Fileappend (const T &)
 Write to file with append to it. More...
 
template<class T >
Fileoperator+= (const T &v)
 Write to file with append to it. More...
 
Fileremove ()
 Removes the file. More...
 

Detailed Description

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

file.jpg
Since
4.5.32

Constructor & Destructor Documentation

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

Constructor for building an empty file-object.

See Also
file( const string& )

Member Function Documentation

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;

Referenced by operator+=().

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

Setter for binary mode of file.

File a( "a.data" );
a.binary( true );
See Also
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" );

References fullPathFile().

std::string coat::scripto::File::extension ( ) const

Getter for extension of file.

File a( "a.obj" );
string r = a.extension();

References fullPathFile().

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" );

Referenced by operator==().

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();

Referenced by extension(), operator==(), path(), and remove().

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;

References append().

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;
bool coat::scripto::File::operator== ( const File b) const

File comparison in binary.

File a( "3DCoat/examples/my/a.data" );
File b( "3DCoat/examples/my/b.data" );
bool isEqual = (a==b);

References fullPathFile().

File & coat::scripto::File::path ( const std::string &  v)

Setter for path of file.

Todo:

name of file with extension

std::string name() const;

Todo:
File& name( const std::string& );
File a( "any/path/a.fbx" );
a.path( "3DCoat/examples/my" );

References fullPathFile().

std::string coat::scripto::File::path ( ) const

Getter for path of file.

File a( "3DCoat/examples/my/a.fbx" );
string r = a.path();

References fullPathFile().

File & coat::scripto::File::remove ( )

Removes the file.

Todo:

write to file with prepend

File& copy()

Todo:
File& clear();
File a( "a.txt" );
a.remove();

References fullPathFile().


The documentation for this class was generated from the following files: