** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: array2dfile.h,v 1.5 2000/12/04 02:52:57 kevin Exp $
+** $Id: array2dfile.h,v 1.11 2000/12/16 03:29:02 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
#ifndef ARRAY2DFILE_H
#define ARRAY2DFILE_H
-#ifndef WIN32
+#ifndef MSVC
#include <unistd.h>
#endif
#include <sys/types.h>
-#include <string.h>
-#include <string>
-#include <fstream>
-#include <iostream>
+#include <cstring>
+#include <string>\r
+#include <iosfwd>
+#include <iomanip>\r
+#include <fstream>\r
+#include <iostream>\r
#include <vector>
#include "ctsupport.h"
#include "fnetorderstream.h"
class Array2dFileLabel
{
public:
- static const int L_EMPTY = 0;
- static const int L_HISTORY = 1;
- static const int L_USER = 2;
+ enum {
+ L_EMPTY = 0,
+ L_HISTORY = 1,
+ L_USER = 2,
+ };
Array2dFileLabel();
const string& getDateString () const;
- void print (ostream& os) const;
+ void print (std::ostream& os) const;
Array2dFileLabel (const Array2dFileLabel& rhs);
class Array2dFile
{
public:
- static const int PIXEL_INVALID = 0;
- static const int PIXEL_INT8 = 1;
- static const int PIXEL_UINT8 = 2;
- static const int PIXEL_INT16 = 3;
- static const int PIXEL_UINT16 = 4;
- static const int PIXEL_INT32 = 5;
- static const int PIXEL_UINT32 = 6;
- static const int PIXEL_FLOAT32 = 7;
- static const int PIXEL_FLOAT64 = 8;
+ enum {
+ PIXEL_INVALID = 0,
+ PIXEL_INT8 = 1,
+ PIXEL_UINT8 = 2,
+ PIXEL_INT16 = 3,
+ PIXEL_UINT16 = 4,
+ PIXEL_INT32 = 5,
+ PIXEL_UINT32 = 6,
+ PIXEL_FLOAT32 = 7,
+ PIXEL_FLOAT64 = 8,
+ };
Array2dFile (int nx, int ny, int pixelSize, int pixelFormat = PIXEL_INVALID);
Array2dFile (void);
const string& getFilename (void) const
{ return m_filename; }
- void printLabels (ostream& os) const;
+ void printLabels (std::ostream& os) const;
typedef vector<Array2dFileLabel*>::iterator labelIterator;
typedef vector<Array2dFileLabel*>::const_iterator constLabelIterator;
protected:
typedef vector<Array2dFileLabel*> labelContainer;
- static const kuint16 m_signature = ('I'*256+'F');
+ static const kuint16 m_signature;
kuint16 m_headersize;
string m_filename;