WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
WXP::GridFile Class Reference

This class opens and reads grid file data. More...

#include "../include/GridFile.h"

Public Types

enum  Type {
  UNK , WXP , WXPB , NETCDF ,
  GRIB
}
 

Public Member Functions

 GridFile ()
 
 GridFile (const char *filename, int access, int type)
 
 GridFile (const char *filename)
 
 GridFile (Filename &filename, int access, int type)
 
 GridFile (Filename &filename)
 
 ~GridFile ()
 
int initClass ()
 
int init ()
 
int setVer (int v)
 
int setParam (const char *str)
 
int useHdrFile (bool val)
 
int setMaxBad (int val)
 
int setMissValue (float rmiss)
 
int setValueBits (int val)
 
int setFormat (const char *rform)
 
int open (const char *filename, int access, int type)
 
int open (const char *filename)
 
int open (Filename &filename, int access, int type)
 
int open (Filename &filename)
 
bool isOpen ()
 
int getType ()
 
int close ()
 
int rewind ()
 
int peek (Grid &grid)
 
int read (Grid &grid)
 
int read (const char *filename, int type, Grid &grid)
 
int read (const char *filename, Grid &grid)
 
int readHdr (Grid &grid)
 
int readData (Grid &grid)
 
int read (Grid &grid, const char *spec)
 
int read (GridSpec &spec, Grid &grid)
 
int read (Grids &grids)
 
int write (Grid &grid)
 
int write (const char *filename, int type, Grid &grid)
 
int write (const char *filename, Grid &grid)
 

Static Public Member Functions

static int checkType (const char *filename)
 

Detailed Description

This class opens and reads grid file data.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ GridFile() [1/5]

GridFile::GridFile ( )

Constructor. Initializes class data

References init().

◆ GridFile() [2/5]

GridFile::GridFile ( const char *  filename,
int  access,
int  type 
)

Constructor. Initializes and opens files for read or write.

Parameters
filenameName of file to open
accessRead or write access
typeType of file to create

References open().

◆ GridFile() [3/5]

GridFile::GridFile ( const char *  filename)

Constructor. Initializes and opens specific file

Parameters
filenameName of file to open

References open(), and WXP::FileAttr::READ.

◆ GridFile() [4/5]

GridFile::GridFile ( Filename filename,
int  access,
int  type 
)

Constructor. Initializes and opens files for read or write.

Parameters
filenameName of file to open
accessRead or write access
typeType of file to create

References open().

◆ GridFile() [5/5]

GridFile::GridFile ( Filename filename)

Constructor. Initializes and opens specific file

Parameters
filenameName of file to open

References open(), and WXP::FileAttr::READ.

◆ ~GridFile()

GridFile::~GridFile ( )

Destructor. Closes file

References WXP::GribFile::close(), and WXP::GridWxpFile::close().

Member Function Documentation

◆ checkType()

int GridFile::checkType ( const char *  filename)
static

Checks the type of input file

Parameters
filenameThe file to check

References WXP::File::close(), WXP::StrLib::equal(), WXP::File::isOpen(), WXP::FileTool::isStdio(), and WXP::File::read().

Referenced by open(), and open().

◆ close()

int GridFile::close ( )

Closes the file

References WXP::GribFile::close(), and WXP::GridWxpFile::close().

◆ getType()

int GridFile::getType ( )

Gets the type of file

Returns
File type

◆ init()

int GridFile::init ( )

Initializes class parameters

Referenced by GridFile(), open(), and open().

◆ isOpen()

bool GridFile::isOpen ( )

Returns true if file opened

Returns
True if file open

Referenced by WXP::GridCont::getDomain(), WXP::GridPlot::getDomain(), WXP::GridVect::getDomain(), and WXP::ImagePlot::getDomain().

◆ open() [1/4]

int GridFile::open ( const char *  filename)

opens specific file

Parameters
filenameName of file to open

References open(), and WXP::FileAttr::READ.

◆ open() [2/4]

int GridFile::open ( const char *  filename,
int  raccess,
int  rtype 
)

Opens the grid file

Parameters
filenameFilename to open
raccessFile access to use (FileAttr::READ, FileAttr::WRITE)
rtypeType of file to open (GridFile::WXP, GridFile::GRIB)

References checkType(), init(), WXP::GribFile::isOpen(), WXP::GridWxpFile::isOpen(), WXP::GridWxpFile::open(), and WXP::FileAttr::READ.

Referenced by GridFile(), GridFile(), GridFile(), GridFile(), open(), and open().

◆ open() [3/4]

int GridFile::open ( Filename filename)

opens specific file

Parameters
filenameName of file to open

References open(), and WXP::FileAttr::READ.

◆ open() [4/4]

int GridFile::open ( Filename filename,
int  raccess,
int  rtype 
)

Opens the grid file

Parameters
filenameFilename to open
raccessFile access to use (FileAttr::READ, FileAttr::WRITE)
rtypeType of file to open (GridFile::WXP, GridFile::GRIB)

References checkType(), WXP::Filename::getName(), init(), WXP::GribFile::isOpen(), WXP::GridWxpFile::isOpen(), WXP::GridWxpFile::open(), WXP::FileAttr::READ, and WXP::GribFile::useHdrFile().

◆ peek()

int GridFile::peek ( Grid grid)

Queries information from the current grid

Return values
gridGrid class to put grid data
Returns
1=successful read, 0=unsuccessful

References WXP::FileAttr::READ, and WXP::GridWxpFile::read().

◆ read()

int GridFile::read ( Grid grid)

Reads a grid from the grid file

Return values
gridGrid class to put grid data
Returns
1=successful read, 0=unsuccessful

References WXP::FileAttr::READ, WXP::GribFile::read(), and WXP::GridWxpFile::read().

Referenced by WXP::GridPlot::getDomain(), and WXP::ImagePlot::getDomain().

◆ rewind()

int GridFile::rewind ( )

Rewinds the file

◆ useHdrFile()

int GridFile::useHdrFile ( bool  val)

Sets whether the use the header file or not

Parameters
valtrue=use header file, false=don't use header file

References WXP::GribFile::useHdrFile().


The documentation for this class was generated from the following files: