VAPoR  0.1
Classes | Functions | Variables
VetsUtil Namespace Reference

Classes

class  Base64
 
class  EasyThreads
 
class  MyBase
 VetsUtil base class. More...
 
class  OptionParser
 
class  Version
 

Functions

COMMON_API const char * Basename (const char *path)
 
COMMON_API string Basename (const string &path)
 
COMMON_API char * Dirname (const char *pathname, char *directory)
 
COMMON_API string Dirname (const string &path)
 
COMMON_API double GetTime ()
 
COMMON_API int MkDirHier (const string &dir)
 
COMMON_API void DirName (const string &path, string &dir)
 
COMMON_API std::string GetAppPath (const string &app, const string &name, const vector< string > &paths, bool forwardSeparator=true)
 
COMMON_API int IsOdd (int x)
 
COMMON_API int IsPowerOfTwo (unsigned int x)
 Return true if power of two. More...
 
COMMON_API int Min (int a, int b)
 
COMMON_API int Max (int a, int b)
 
COMMON_API size_t Min (size_t a, size_t b)
 
COMMON_API size_t Max (size_t a, size_t b)
 
COMMON_API float Min (float a, float b)
 
COMMON_API float Max (float a, float b)
 
COMMON_API double Min (double a, double b)
 
COMMON_API double Max (double a, double b)
 
COMMON_API double LogBaseN (double x, double n)
 
COMMON_API int ILog2 (int n)
 
COMMON_API int StrCmpNoCase (const string &s, const string &t)
 Case-insensitive string comparison. More...
 
COMMON_API void StrRmWhiteSpace (string &s)
 Remove white space from a string. More...
 
COMMON_API void StrToWordVec (const string &s, vector< string > &v)
 Parse a string, returning a vector of words. More...
 
std::vector< std::string > & SplitString (const std::string &s, char delim, std::vector< std::string > &elems)
 
std::vector< size_t > & SplitString (const std::string &s, char delim, std::vector< size_t > &elems)
 
std::vector< int > & SplitString (const std::string &s, char delim, std::vector< int > &elems)
 
std::vector< float > & SplitString (const std::string &s, char delim, std::vector< float > &elems)
 
COMMON_API unsigned long long GetBits64 (unsigned long long targ, int pos, int n)
 
COMMON_API unsigned long long SetBits64 (unsigned long long targ, int pos, int n, unsigned long long src)
 
COMMON_API double ran1 (long *)
 
COMMON_API int CvtToInt (const char *from, void *to)
 
COMMON_API int CvtToFloat (const char *from, void *to)
 
COMMON_API int CvtToDouble (const char *from, void *to)
 
COMMON_API int CvtToChar (const char *from, void *to)
 
COMMON_API int CvtToBoolean (const char *from, void *to)
 
COMMON_API int CvtToString (const char *from, void *to)
 
COMMON_API int CvtToCPPStr (const char *from, void *to)
 
COMMON_API int CvtToDimension2D (const char *from, void *to)
 
COMMON_API int CvtToDimension3D (const char *from, void *to)
 
COMMON_API int CvtToStrVec (const char *from, void *to)
 
COMMON_API int CvtToIntVec (const char *from, void *to)
 
COMMON_API int CvtToSize_tVec (const char *from, void *to)
 
COMMON_API int CvtToFloatVec (const char *from, void *to)
 
COMMON_API int CvtToIntRange (const char *from, void *to)
 
COMMON_API TIME64_T MkTime64 (struct tm *t)
 
COMMON_API struct tm * LocalTime64_r (const TIME64_T *t, struct tm *p)
 
COMMON_API struct tm * GmTime64_r (const TIME64_T *t, struct tm *p)
 
void Transpose (float *a, float *b, int p1, int m1, int s1, int p2, int m2, int s2)
 
void Transpose (float *a, float *b, int s1, int s2)
 

Variables

const float ABOVE_GRID = 0.f
 
const float BELOW_GRID = 0.f
 

Function Documentation

COMMON_API const char* VetsUtil::Basename ( const char *  path)
COMMON_API string VetsUtil::Basename ( const string &  path)
COMMON_API int VetsUtil::CvtToBoolean ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToChar ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToCPPStr ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToDimension2D ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToDimension3D ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToDouble ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToFloat ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToFloatVec ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToInt ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToIntRange ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToIntVec ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToSize_tVec ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToString ( const char *  from,
void *  to 
)
COMMON_API int VetsUtil::CvtToStrVec ( const char *  from,
void *  to 
)
COMMON_API char* VetsUtil::Dirname ( const char *  pathname,
char *  directory 
)

Return the directory component of a UNIX path name

Re-implements the UNIX 'dirname' function. However, in this version the original pathname is not modfied – the directory component of the path name is copied into caller-provided storage.

Parameters
[in]pathnamePointer to a null-terminated file path name
[out]directoryContains parent directory of pathname
Return values
directoryReturns directory parameter
COMMON_API string VetsUtil::Dirname ( const string &  path)
COMMON_API void VetsUtil::DirName ( const string &  path,
string &  dir 
)
COMMON_API std::string VetsUtil::GetAppPath ( const string &  app,
const string &  name,
const vector< string > &  paths,
bool  forwardSeparator = true 
)
COMMON_API unsigned long long VetsUtil::GetBits64 ( unsigned long long  targ,
int  pos,
int  n 
)

Retrieve a sequence of bits

Extract n bits from targ starting at position pos counting from the left. E.g. GetBits64(I,4,3) will extract bits at bit position 4,3,2, right adjusted

Return values
returnsthe extracted bits
See also
GetBits64()
COMMON_API double VetsUtil::GetTime ( )
COMMON_API struct tm* VetsUtil::GmTime64_r ( const TIME64_T t,
struct tm *  p 
)
COMMON_API int VetsUtil::ILog2 ( int  n)
COMMON_API int VetsUtil::IsOdd ( int  x)
inline

Definition at line 272 of file MyBase.h.

Referenced by VAPoR::Lifting1D< Data_T >::Lifting1D().

COMMON_API int VetsUtil::IsPowerOfTwo ( unsigned int  x)

Return true if power of two.

Returns a non-zero value if the input parameter is a power of two

Parameters
[in]xAn integer
Return values
status
COMMON_API struct tm* VetsUtil::LocalTime64_r ( const TIME64_T t,
struct tm *  p 
)
COMMON_API double VetsUtil::LogBaseN ( double  x,
double  n 
)
inline

Definition at line 294 of file MyBase.h.

Referenced by VAPoR::Lifting1D< Data_T >::Lifting1D().

COMMON_API int VetsUtil::Max ( int  a,
int  b 
)
inline

Definition at line 282 of file MyBase.h.

COMMON_API size_t VetsUtil::Max ( size_t  a,
size_t  b 
)
inline

Definition at line 285 of file MyBase.h.

COMMON_API float VetsUtil::Max ( float  a,
float  b 
)
inline

Definition at line 288 of file MyBase.h.

COMMON_API double VetsUtil::Max ( double  a,
double  b 
)
inline

Definition at line 291 of file MyBase.h.

COMMON_API int VetsUtil::Min ( int  a,
int  b 
)
inline

Definition at line 281 of file MyBase.h.

COMMON_API size_t VetsUtil::Min ( size_t  a,
size_t  b 
)
inline

Definition at line 284 of file MyBase.h.

COMMON_API float VetsUtil::Min ( float  a,
float  b 
)
inline

Definition at line 287 of file MyBase.h.

COMMON_API double VetsUtil::Min ( double  a,
double  b 
)
inline

Definition at line 290 of file MyBase.h.

COMMON_API int VetsUtil::MkDirHier ( const string &  dir)
COMMON_API TIME64_T VetsUtil::MkTime64 ( struct tm *  t)
COMMON_API double VetsUtil::ran1 ( long *  )
COMMON_API unsigned long long VetsUtil::SetBits64 ( unsigned long long  targ,
int  pos,
int  n,
unsigned long long  src 
)

Set a sequence of bits

Set n bits in targ starting at position pos counting from the left. The bits are obtained from src

Return values
returnswith the indicated bits set
See also
GetBits64()
std::vector<std::string>& VetsUtil::SplitString ( const std::string &  s,
char  delim,
std::vector< std::string > &  elems 
)
std::vector<size_t>& VetsUtil::SplitString ( const std::string &  s,
char  delim,
std::vector< size_t > &  elems 
)
std::vector<int>& VetsUtil::SplitString ( const std::string &  s,
char  delim,
std::vector< int > &  elems 
)
std::vector<float>& VetsUtil::SplitString ( const std::string &  s,
char  delim,
std::vector< float > &  elems 
)
COMMON_API int VetsUtil::StrCmpNoCase ( const string &  s,
const string &  t 
)

Case-insensitive string comparison.

Performs a case-insensitive comparison of two C++ strings. Behaviour is otherwise identical to the C++ std::string.compare() method.

Referenced by VAPoR::MetadataVDC::IsValidCoordSystemType(), and VAPoR::MetadataVDC::IsValidGridType().

COMMON_API void VetsUtil::StrRmWhiteSpace ( string &  s)

Remove white space from a string.

Performs in-place removal of all white space from a string.

Parameters
[in,out]sThe string.
COMMON_API void VetsUtil::StrToWordVec ( const string &  s,
vector< string > &  v 
)

Parse a string, returning a vector of words.

Parses a string containing a white-space delimited collection of words. The words are in order of occurence and returned as a vector of strings with all white space removed.

Parameters
[in]sThe input string.
[out]vThe output vector.
void VetsUtil::Transpose ( float *  a,
float *  b,
int  p1,
int  m1,
int  s1,
int  p2,
int  m2,
int  s2 
)
void VetsUtil::Transpose ( float *  a,
float *  b,
int  s1,
int  s2 
)

Variable Documentation

const float VetsUtil::ABOVE_GRID = 0.f

Definition at line 60 of file MyBase.h.

const float VetsUtil::BELOW_GRID = 0.f

Definition at line 61 of file MyBase.h.