class::fs::DataFile

class fs::DataFile
  : public fs::File

The DataFile class is a class that uses a var::Data object to allow fs::File operations. This allows for an easy way to have a valid fs::File object that can be passed to methods that read/write data from the file.

Summary

[DataFile](#classfs_1_1_data_file_1a9f3e71705406b5ee86e425b3b94bb33a)(  

const OpenFlags & flags
)

virtual int close()

const var::Data & data() const

var::Data & data()

OpenFlags & flags()

const OpenFlags & flags() const

virtual int ioctl(

const arg::IoRequest request,
const arg::IoArgument argument
) const

virtual int open(

const arg::FilePath & path,
const OpenFlags & flags
)

virtual int read(

arg::DestinationBuffer buf,
const arg::Size nbyte
) const

int read()

int read()

int read()

int read()

int read()

int read()

int seek(

const arg::Location location,
enum whence whence
) const

virtual u32 size() const

virtual int write(

const arg::SourceBuffer buf,
const arg::Size nbyte
) const

int write()

int write()

int write()

int write()

int write()

int write()

int write()

int write()

int write()

int write()

int write()

int write()

int write()

Members

DataFile(

const OpenFlags & flags
)

Constructs a data file.


virtual int close()

Reimplements fs::File::close() to have no functionality.


const var::Data & data() const

Accesses (read-only) the member data object.


var::Data & data()

Accesses the member data object.


OpenFlags & flags()

const OpenFlags & flags() const

virtual int ioctl(

const arg::IoRequest request,
const arg::IoArgument argument
) const

Reimplements fs::File::ioctl() to have no functionality.


virtual int open(

const arg::FilePath & path,
const OpenFlags & flags
)

Reimplements fs::File::open() to have no functionality.


virtual int read(

arg::DestinationBuffer buf,
const arg::Size nbyte
) const

Reimplements fs::File::read() to simply read from the var::Data object contained herein rather than from the filesystem.


int read()

Reads the file using a var::Data object.


int read()

int read()

int read()

Reads the file.

Parameters

  • buf A pointer to the destination buffer

  • nbyte The number of bytes to read

Returns

The number of bytes read or less than zero on an error


int read()

Reads the file into a var::Data object.

Parameters

  • data The destination data object

Returns

The number of bytes read

This method will read up to data.size() bytes.


int read()

Reads the file.

Parameters

  • loc The location of the file to read

  • buf A pointer to the destination buffer

  • nbyte The number of bytes to read

Returns

The number of bytes read or less than zero on an error


int seek(

const arg::Location location,
enum whence whence
) const

Seeks to the specified location in the file.

Returns

Zero on success


virtual u32 size() const

Returns the size of the file (size of the data).


virtual int write(

const arg::SourceBuffer buf,
const arg::Size nbyte
) const

Reimplements fs::File::write() to simply write to the var::Data object contained herein rather than to the filesystem.

Returns

The number of bytes successfully written


int write()

int write()

int write()

Writes the file using a var::ConstString object at the location specified.


int write()

int write()

int write()

Writes the file at the location specified.

Parameters

  • loc Location to write (not application to character devices)

  • buf Pointer to the source data

  • nbyte Number of bytes to write

Returns

Number of bytes successfully written or less than zero with errno set


int write()

Writes a var::String to the file.

Parameters

  • str The string to write

Returns

The number of bytes written


int write()

Write the file.

Parameters

  • buf A pointer to the source buffer

  • nbyte The number of bytes to read

Returns

The number of bytes written or less than zero on an error


int write()

Writes the file using a var::String object at the location specified.


int write()

Writes the file using a var::Data object at the location specified.


int write()

Writes a var::ConstString to the file.

Parameters

  • str The string to write

Returns

The number of bytes written


int write()

int write()

Writes the file using a var::Data object.


X

Thanks for Coming!

Subscribe to news and updates