+/*****************************************************************************\r
+** FILE IDENTIFICATION\r
+**\r
+** Name: fnetorderstream.h\r
+** Purpose: Network-order file stream header\r
+** Programmer: Kevin Rosenberg\r
+** Date Started: Sep 2000\r
+**\r
+** This is part of the CTSim program\r
+** Copyright (C) 1983-2000 Kevin Rosenberg\r
+**\r
+** $Id: fnetorderstream.h,v 1.6 2000/12/16 06:12:47 kevin Exp $\r
+**\r
+** This program is free software; you can redistribute it and/or modify\r
+** it under the terms of the GNU General Public License (version 2) as\r
+** published by the Free Software Foundation.\r
+**\r
+** This program is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+** GNU General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU General Public License\r
+** along with this program; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+******************************************************************************/\r
+\r
+\r
#ifndef NETORDER_H
#define NETORDER_H
#include <fstream>
#include <iostream>
#include <string>
-using namespace std;
inline bool NativeBigEndian (void)
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 fnetorderstream& writeInt16 (kuint16 n);
- virtual fnetorderstream& writeInt32 (kuint32 n);
- virtual fnetorderstream& writeFloat32 (kfloat32 n);
- virtual fnetorderstream& writeFloat64 (kfloat64 n);
+ virtual void writeInt16 (kuint16 n);
+ virtual void writeInt32 (kuint32 n);
+ virtual void writeFloat32 (kfloat32 n);
+ virtual void writeFloat64 (kfloat64 n);
- virtual fnetorderstream& readInt16 (kuint16& n);
- virtual fnetorderstream& readInt32 (kuint32& n);
- virtual fnetorderstream& readFloat32 (kfloat32& n);
- virtual fnetorderstream& readFloat64 (kfloat64& n);
+ virtual void readInt16 (kuint16& n);
+ virtual void readInt32 (kuint32& n);
+ virtual void readFloat32 (kfloat32& n);
+ virtual void readFloat64 (kfloat64& n);
};
frnetorderstream (const char* filename, int mode)
: fnetorderstream (filename, mode) {}
- virtual frnetorderstream& writeInt16 (kuint16 n);
- virtual frnetorderstream& writeInt32 (kuint32 n);
- virtual frnetorderstream& writeFloat32 (kfloat32 n);
- virtual frnetorderstream& writeFloat64 (kfloat64 n);
+ virtual void writeInt16 (kuint16 n);
+ virtual void writeInt32 (kuint32 n);
+ virtual void writeFloat32 (kfloat32 n);
+ virtual void writeFloat64 (kfloat64 n);
- virtual frnetorderstream& readInt16 (kuint16& n);
- virtual frnetorderstream& readInt32 (kuint32& n);
- virtual frnetorderstream& readFloat32 (kfloat32& n);
- virtual frnetorderstream& readFloat64 (kfloat64& n);
+ virtual void readInt16 (kuint16& n);
+ virtual void readInt32 (kuint32& n);
+ virtual void readFloat32 (kfloat32& n);
+ virtual void readFloat64 (kfloat64& n);
};
#endif