TF++, Miscellaneous classes and modules in C++:

handle different data bytesex (prototypes) More...

#include <fstream>
Include dependency graph for bytesex.h:

Go to the source code of this file.

Classes

union  tfxx::ioswap::IOUnion< T >
 

Namespaces

 tfxx
 Namespace containing all code of library libtfxx.
 
 tfxx::ioswap
 All facilities for checking bytesex and swapping input binary data. ,.
 

Macros

#define TF_BYTESEX_H_VERSION   "TF_BYTESEX_H V1.0"
 

Enumerations

enum  tfxx::ioswap::Ecpu_type { tfxx::ioswap::cpu_Intel = 1, tfxx::ioswap::cpu_Motorola = 2, tfxx::ioswap::cpu_unknown = 3 }
 Define different CPU type that are recognized. More...
 
enum  tfxx::ioswap::Emagic_type { tfxx::ioswap::magic_match = 1, tfxx::ioswap::magic_swap = 2, tfxx::ioswap::magic_nomatch = 3 }
 Define bytesex indicator for magic number test. More...
 

Functions

template<class T >
tfxx::ioswap::swap (const T &value)
 How to swap any generic type. More...
 
template<class T >
IOUnion< T > tfxx::ioswap::swap (const IOUnion< T > &value)
 Specialization in case we use use an IOUnion. i.e. overloading the function. More...
 
int tfxx::ioswap::magic (const char *const cmagic)
 Create a magic number from a character string. ,If $x_{i}=(\vec{x})_{i}$ represents the input character sequence cmagic and $N=4$ is the value of sizeof(int), then the return value will be

\[ \textrm{magic}(\vec{x}) =\sum\limits_{i=0}^{N-1} x_{i}\; 2^{8\; (N-1-i)} =x_{3}+256\; (x_{2}+256\; (x_{1}+256\; x_{0})). \]

. More...

 
Ecpu_type tfxx::ioswap::cpu ()
 Check CPU model. ,. More...
 
Emagic_type tfxx::ioswap::file_magic_test (std::istream &is, const char *const cmagic, const bool &fortranmode=false)
 Check for magic number in file. More...
 
void tfxx::ioswap::file_magic_write (std::ostream &os, const char *const cmagic, const bool &fortranmode=false)
 Write magic number to file. ,. More...
 

Detailed Description

handle different data bytesex (prototypes)


Author
Thomas Forbriger
Date
19/07/2005

handle different data bytesex (prototypes)

Copyright (c) 2005 by Thomas Forbriger (BFO Schiltach)


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software

Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

REVISIONS and CHANGES

  • 19/07/2005 V1.0 Thomas Forbriger
    • all contents are copied from misc.h
    • removed struct IOTsize; this is obsolete, since I learned that the sizeof function is a compile-time literal
    • removed check_assumed_size() for the same reason

Definition in file bytesex.h.