PLearn 0.1
|
#include <iostream>
#include <plearn/base/plerror.h>
#include <plearn/base/byte_order.h>
#include <plearn/io/PStream.h>
Go to the source code of this file.
Namespaces | |
namespace | PLearn |
< for swap | |
Functions | |
void | PLearn::reverse_uint (const unsigned int *ptr, int n) |
Swap bytes between Big-Endian and Little-Endian representation in memory NOTE: these calls are deprecated, use directly endianswap from base/byte_order.h. | |
void | PLearn::reverse_int (const int *ptr, int n) |
void | PLearn::reverse_float (const float *ptr, int n) |
void | PLearn::reverse_double (const double *ptr, int n) |
void | PLearn::reverse_ushort (const unsigned short *ptr, int n) |
void | PLearn::reverse_short (const short *ptr, int n) |
void | PLearn::fwrite_int (FILE *f, const int *ptr, int n, bool is_file_bigendian=true) |
Writes binary data to the file in the specified representation (little or big endian) regardeless of the endianness used on the current architecture. | |
void | PLearn::fwrite_float (FILE *f, const float *ptr, int n, bool is_file_bigendian) |
void | PLearn::fwrite_float (FILE *f, const double *ptr, int n, bool is_file_bigendian=true) |
writes double array to float file | |
void | PLearn::fwrite_double (FILE *f, const double *ptr, int n, bool is_file_bigendian) |
void | PLearn::fwrite_double (FILE *f, const float *ptr, int n, bool is_file_bigendian=true) |
writes float array to double file | |
void | PLearn::fread_int (FILE *f, int *ptr, int n, bool is_file_bigendian=true) |
Reads binary data from a file assuming it is in the specified representation (either little or big endian) If necessary the representation is translated to the endianness on the current architecture. | |
void | PLearn::fread_float (FILE *f, float *ptr, int n, bool is_file_bigendian) |
void | PLearn::fread_float (FILE *f, double *ptr, int n, bool is_file_bigendian=true) |
reads disk floats into double array | |
void | PLearn::fread_double (FILE *f, double *ptr, int n, bool is_file_bigendian) |
void | PLearn::fread_double (FILE *f, float *ptr, int n, bool is_file_bigendian=true) |
reads disk doubles into float array | |
void | PLearn::fread_short (FILE *f, unsigned short *ptr, int n, bool is_file_bigendian) |
int | PLearn::fread_int (FILE *f, bool is_file_bigendian=true) |
float | PLearn::fread_float (FILE *f, bool is_file_bigendian=true) |
double | PLearn::fread_double (FILE *f, bool is_file_bigendian=true) |
void | PLearn::fwrite_int (FILE *f, int value, bool is_file_bigendian=true) |
The following calls write a single value to the file in the specified representation, regardeless of the endianness on the current architecture. | |
void | PLearn::fwrite_float (FILE *f, float value, bool is_file_bigendian=true) |
void | PLearn::fwrite_double (FILE *f, double value, bool is_file_bigendian=true) |
void | PLearn::write_int (ostream &out, const int *ptr, int n, bool is_file_bigendian) |
Writes binary data to the file in the specified representation (little or big endian) regardeless of the endianness used on the current architecture. | |
void | PLearn::write_short (ostream &out, const short *ptr, int n, bool is_file_bigendian) |
void | PLearn::write_double (ostream &out, const double *ptr, int n, bool is_file_bigendian) |
void | PLearn::write_float (ostream &out, const float *ptr, int n, bool is_file_bigendian) |
void | PLearn::write_uint (ostream &out, const unsigned int *ptr, int n, bool is_file_bigendian) |
void | PLearn::write_ushort (ostream &out, const unsigned short *ptr, int n, bool is_file_bigendian) |
void | PLearn::write_bool (ostream &out, const bool *ptr, int n, bool is_file_bigendian) |
void | PLearn::write_int (ostream &out, int value, bool is_file_bigendian=true) |
The following calls write a single value to the file in the specified representation, regardeless of the endianness on the current architecture. | |
void | PLearn::write_short (ostream &out, short value, bool is_file_bigendian=true) |
void | PLearn::write_float (ostream &out, float value, bool is_file_bigendian=true) |
void | PLearn::write_double (ostream &out, double value, bool is_file_bigendian=true) |
void | PLearn::write_uint (ostream &out, unsigned int value, bool is_file_bigendian=true) |
void | PLearn::write_ushort (ostream &out, unsigned short value, bool is_file_bigendian=true) |
void | PLearn::write_sbyte (ostream &out, signed char x) |
void | PLearn::write_ubyte (ostream &out, unsigned char x) |
void | PLearn::read_int (istream &in, int *ptr, int n, bool is_file_bigendian) |
Reads binary data from a file assuming it is in the specified representation (either little or big endian) If necessary the representation is translated to the endianness on the current architecture. | |
void | PLearn::read_short (istream &in, short *ptr, int n, bool is_file_bigendian) |
void | PLearn::read_float (istream &in, float *ptr, int n, bool is_file_bigendian) |
void | PLearn::read_double (istream &in, double *ptr, int n, bool is_file_bigendian) |
void | PLearn::read_uint (istream &in, unsigned int *ptr, int n, bool is_file_bigendian) |
void | PLearn::read_ushort (istream &in, unsigned short *ptr, int n, bool is_file_bigendian) |
void | PLearn::read_bool (istream &in, bool *ptr, int n, bool is_file_bigendian) |
int | PLearn::read_int (istream &in, bool is_file_bigendian=true) |
short | PLearn::read_short (istream &in, bool is_file_bigendian=true) |
float | PLearn::read_float (istream &in, bool is_file_bigendian=true) |
double | PLearn::read_double (istream &in, bool is_file_bigendian=true) |
unsigned int | PLearn::read_uint (istream &in, bool is_file_bigendian=true) |
unsigned short | PLearn::read_ushort (istream &in, bool is_file_bigendian=true) |
signed char | PLearn::read_sbyte (istream &in) |
unsigned char | PLearn::read_ubyte (istream &in) |
void | PLearn::writeHeader (ostream &out, const string &classname, int version=0) |
These functions are there to help you write and read object headers and footers for the persistance mechanism. | |
void | PLearn::writeFooter (ostream &out, const string &classname) |
writes "</ClassName>\n" | |
int | PLearn::readHeader (PStream &in, const string &classname) |
consumes "<ClassName:version>\n and returns version" | |
void | PLearn::readFooter (PStream &in, const string &classname) |
consumes "</ClassName>\n" | |
void | PLearn::writeNewline (ostream &out) |
Writes a single newline character. | |
void | PLearn::readNewline (istream &in) |
Reads next character and issues an error if it's not a newline. | |
void | PLearn::writeFieldName (ostream &out, const string &fieldname) |
writes "fieldname: " | |
bool | PLearn::readFieldName (istream &in, const string &fieldname, bool force=false) |
consumes "fieldname: " if possible, and return true if it does however if force=true and fieldname is not found then call error. | |
template<class T > | |
void | PLearn::writeField (ostream &out, const string &fieldname, const T &x) |
generic field writing and reading | |
template<class T > | |
void | PLearn::readField (istream &in, const string &fieldname, T &x) |
template<class T > | |
void | PLearn::binwriteField (ostream &out, const string &fieldname, const T &x) |
generic field BINARY writing and reading | |
template<class T > | |
void | PLearn::binreadField (istream &in, const string &fieldname, T &x) |
template<class T > | |
void | PLearn::binwriteField_double (ostream &out, const string &fieldname, const T &x) |
template<class T > | |
void | PLearn::binreadField_double (istream &in, const string &fieldname, T &x) |
template<class T > | |
void | PLearn::readField (istream &in, const string &fieldname, T &x, T default_value) |
readField with a default value when the field is not found |
Definition in file pl_io_deprecated.h.