class::sys::DataFile

class sys::DataFile
  : public sys::File

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

Methods

  • public inlineDataFile(int o_flags)
  • public inline virtual intclose()
  • public inline constvar::Data&data() const
  • public inlinevar::Data&data()
  • public inline intflags() const
  • public inline virtual intioctl(int req,void * arg) const
  • public virtual intopen(constvar::ConstString& name,int flags)
  • public virtual intread(void * buf,int nbyte) const
  • public intread()
  • public inline intread()
  • public inline intread()
  • public intread()
  • public inline intread()
  • public inline intread()
  • public virtual intseek(int loc,int whence) const
  • public inline voidset_flags(int o_flags)
  • public inline virtual u32size() const
  • public virtual intwrite(const void * buf,int nbyte) const
  • public inline intwrite()
  • public inline intwrite()
  • public inline intwrite()
  • public inline intwrite()
  • public intwrite()
  • public intwrite()
  • public intwrite()
  • public inline intwrite()
  • public inline intwrite()
  • public inline intwrite()
  • public inline intwrite()
  • public inline intwrite()
  • public intwrite()
  • public inline intwrite()

Details

public inlineDataFile(int o_flags)

Constructs a data file.


public inline virtual intclose()

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


public inline constvar::Data&data() const

Accesses (read-only) the member data object.


public inlinevar::Data&data()

Accesses the member data object.


public inline intflags() const

public inline virtual intioctl(int req,void * arg) const

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


public virtual intopen(constvar::ConstString& name,int flags)

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


public virtual intread(void * buf,int nbyte) const

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


public intread()

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


public inline intread()

Reads the file using a var::Data object.


public inline intread()

public intread()

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


public inline intread()

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.


public inline intread()

public virtual intseek(int loc,int whence) const

Seeks to the specified location in the file.

Parameters

  • loc The location to seek to

  • whence The location to seek from (e.g. sys::File::SET)

Returns

Zero on success


public inline voidset_flags(int o_flags)

public inline virtual u32size() const

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


public virtual intwrite(const void * buf,int nbyte) const

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

Parameters

  • buf source data pointer

  • nbyte number of bytes to write

Returns

The number of bytes successfully written


public inline intwrite()

Writes a var::String to the file.

Parameters

  • str The string to write

Returns

The number of bytes written


public inline intwrite()

public inline intwrite()

public inline intwrite()

public intwrite()

public intwrite()

public intwrite()

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


public inline intwrite()

public inline intwrite()

Writes a var::ConstString to the file.

Parameters

  • str The string to write

Returns

The number of bytes written


public inline intwrite()

Writes the file using a var::Data object.


public inline intwrite()

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


public inline intwrite()

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


public intwrite()

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


public inline intwrite()

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


X

Thanks for Coming!

Subscribe to news and updates