X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Ffnetorderstream.h;h=70b857e1d4748a5958659c7a799d8dd33b4193d2;hp=cf20869cf4f7222aff48fbd3d7f799b48313e6d6;hb=9f29c8b32c972db1178d6f8551d5cd57ceb67083;hpb=2debde82a721c0cf5bdf6642ace3290f83bb21a4 diff --git a/include/fnetorderstream.h b/include/fnetorderstream.h index cf20869..70b857e 100644 --- a/include/fnetorderstream.h +++ b/include/fnetorderstream.h @@ -1,3 +1,31 @@ +/***************************************************************************** +** FILE IDENTIFICATION +** +** Name: fnetorderstream.h +** Purpose: Network-order file stream header +** Programmer: Kevin Rosenberg +** Date Started: Sep 2000 +** +** This is part of the CTSim program +** Copyright (c) 1983-2001 Kevin Rosenberg +** +** $Id: fnetorderstream.h,v 1.8 2001/01/28 19:10:18 kevin Exp $ +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ + + #ifndef NETORDER_H #define NETORDER_H @@ -8,7 +36,6 @@ #include #include #include -using namespace std; inline bool NativeBigEndian (void) @@ -65,24 +92,24 @@ SwapBytes8 (void* buffer) void ConvertNetworkOrder (void* buffer, size_t bytes); void ConvertReverseNetworkOrder (void* buffer, size_t bytes); - +using std::fstream; class fnetorderstream : public fstream { public: fnetorderstream (const char* filename, int mode) - : fstream (filename, mode) {} + : fstream (filename, mode) {} ~fnetorderstream (void) {} - virtual writeInt16 (kuint16 n); - virtual writeInt32 (kuint32 n); - virtual writeFloat32 (kfloat32 n); - virtual writeFloat64 (kfloat64 n); + virtual void writeInt16 (kuint16 n); + virtual void writeInt32 (kuint32 n); + virtual void writeFloat32 (kfloat32 n); + virtual void writeFloat64 (kfloat64 n); - virtual readInt16 (kuint16& n); - virtual readInt32 (kuint32& n); - virtual readFloat32 (kfloat32& n); - virtual readFloat64 (kfloat64& n); + virtual void readInt16 (kuint16& n); + virtual void readInt32 (kuint32& n); + virtual void readFloat32 (kfloat32& n); + virtual void readFloat64 (kfloat64& n); }; @@ -91,15 +118,15 @@ class frnetorderstream : public fnetorderstream { frnetorderstream (const char* filename, int mode) : fnetorderstream (filename, mode) {} - writeInt16 (kuint16 n); - writeInt32 (kuint32 n); - writeFloat32 (kfloat32 n); - writeFloat64 (kfloat64 n); + virtual void writeInt16 (kuint16 n); + virtual void writeInt32 (kuint32 n); + virtual void writeFloat32 (kfloat32 n); + virtual void writeFloat64 (kfloat64 n); - readInt16 (kuint16& n); - readInt32 (kuint32& n); - readFloat32 (kfloat32& n); - readFloat64 (kfloat64& n); + virtual void readInt16 (kuint16& n); + virtual void readInt32 (kuint32& n); + virtual void readFloat32 (kfloat32& n); + virtual void readFloat64 (kfloat64& n); }; #endif