Cgl 0.59.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
CoinFileOutput Class Referenceabstract

Abstract base class for file output classes. More...

`#include <CoinFileIO.hpp>`

Inheritance diagram for CoinFileOutput:
[legend]
Collaboration diagram for CoinFileOutput:
[legend]

## Public Types
enum | Compression { COMPRESS_NONE = 0, COMPRESS_GZIP = 1, COMPRESS_BZIP2 = 2 }
| The compression method. More...

## Public Member Functions
| CoinFileOutput (const std::string &fileName)
| Constructor (don't use this, use the create method instead). More...
virtual | ~CoinFileOutput ()
| Destructor. More...
virtual int | write (const void *buffer, int size)=0
| Write a block of data to the file, similar to fwrite. More...
virtual bool | puts (const char *s)
| Write a string to the file (like fputs). More...
bool | puts (const std::string &s)
| Convenience method: just a 'puts(s.c_str())'. More...
Public Member Functions inherited from CoinFileIOBase
| CoinFileIOBase (const std::string &fileName)
| Constructor. More...
| ~CoinFileIOBase ()
| Destructor. More...
const char * | getFileName () const
| Return the name of the file used by this object. More...
std::string | getReadType () const
| Return the method of reading being used. More...

## Static Public Member Functions
static bool | compressionSupported (Compression compression)
| Returns whether the specified compression method is supported (i.e. More...
static CoinFileOutput * | create (const std::string &fileName, Compression compression)
| Factory method, that creates a CoinFileOutput (more precisely a subclass of it) for the file specified. More...

## Additional Inherited Members
Protected Attributes inherited from CoinFileIOBase
std::string | readType_

## Detailed Description

Abstract base class for file output classes.

Definition at line 80 of file CoinFileIO.hpp.

## Member Enumeration Documentation

enum CoinFileOutput::Compression

The compression method.

Enumerator
COMPRESS_NONE | No compression.
COMPRESS_GZIP | gzip compression.
COMPRESS_BZIP2 | bzip2 compression.

Definition at line 85 of file CoinFileIO.hpp.

## Constructor & Destructor Documentation

CoinFileOutput::CoinFileOutput | ( | const std::string & | fileName | ) |

Constructor (don't use this, use the create method instead).

Parameters

  fileName | The name of the file used by this object.

virtual CoinFileOutput::~CoinFileOutput | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

static bool CoinFileOutput::compressionSupported | ( | Compression | compression | ) |
| static

Returns whether the specified compression method is supported (i.e.

was compiled into COIN).

static CoinFileOutput* CoinFileOutput::create | ( | const std::string & | fileName,
|  | Compression | compression
| ) |  |
| static

Factory method, that creates a CoinFileOutput (more precisely a subclass of it) for the file specified.

If the compression method is not supported an exception is thrown (so use compressionSupported first, if this is a problem). The reason for not providing direct access to the subclasses (and using such a method instead) is that depending on the build configuration some of the classes are not available (or functional). This way we can handle all required ifdefs here instead of polluting other files.

Parameters

  fileName | The file that should be read.
  compression | Compression method used.

virtual int CoinFileOutput::write | ( | const void * | buffer,
|  | int | size
| ) |  |
| pure virtual

Write a block of data to the file, similar to fwrite.

Parameters

  buffer | Address of a buffer containing the data to be written.
  size | Number of bytes to write.

Returns
  Number of bytes written.

virtual bool CoinFileOutput::puts | ( | const char * | s | ) |
| virtual

Write a string to the file (like fputs).

Just as with fputs no trailing newline is inserted! The terminating '\0' is not written to the file. The default implementation determines the length of the string and calls write on it.

Parameters

  s | The zero terminated string to be written.

Returns
  true on success, false on error.

bool CoinFileOutput::puts | ( | const std::string & | s | ) |
| inline

Convenience method: just a 'puts(s.c_str())'.

Definition at line 131 of file CoinFileIO.hpp.

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

- /home/coin/svn-release/Cgl-0.59.7/CoinUtils/src/CoinFileIO.hpp