TF++, Miscellaneous classes and modules in C++:
ioswap.cc File Reference

some functions supporting swapping after I/O (implementation) More...

#include <tfxx/bytesex.h>
#include <tfxx/error.h>
#include <iostream>
Include dependency graph for ioswap.cc:

Go to the source code of this file.

Namespaces

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

Macros

#define TF_IOSWAP_CC_VERSION   "TF_IOSWAP_CC V1.3"
 

Functions

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

some functions supporting swapping after I/O (implementation)


Author
Thomas Forbriger
Date
18/11/2002

some functions supporting swapping after I/O (implementation)

Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)


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

  • 18/11/2002 V1.0 Thomas Forbriger
  • 19/11/2002 V1.1 should have reached stbility
  • 24/06/2003 V1.2 don't specify default parameters twice
  • 19/07/2005 V1.3
    • use bytesex.h now
    • removed struct IOTsize; this is obsolete, since I learned that the sizeof function is a compile-time literal
    • removed check_assumed_size() and CHECK_MACRO() for the same reason

Definition in file ioswap.cc.