/*****************************************************************************
 * $LastChangedDate: 2010-03-26 15:04:03 -0400 (Fri, 26 Mar 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Misc functions.
 *//*
 * LEGAL:   COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef BASE_MISC_HH
#define BASE_MISC_HH 1

namespace base {

int
Argi( int idx, int argc_, char** argv_ );

float
Argf( int idx, int argc_, char** argv_ );

string
Argstr( int idx, int argc_, char** argv_ );

void
CmdargDone( int i, int n = 1 );

bool
IfCmdargDone( int i );

fp
FormatMegabyte( const long bytes );

void
LowerCase( string& s );

void
UpperCase( string& s );

#if OS_CYGWIN
char* STRCASESTR( const char *s, const char* find );
#else
#define STRCASESTR strcasestr
#endif

enum eNumberFormat
{
    eNumberFormat_DEFAULT       = 0,  // show base ("0x"), omit plus, pad spaces
    eNumberFormat_NO_SHOW_BASE  = (1 << 0),
    eNumberFormat_SHOW_PLUS     = (1 << 1),
    eNumberFormat_PAD_ZEROS     = (1 << 2),
};

string
SignedHexNumber2String( const long signedHexValue,
                        const uint minWidth = 0,
                        const eNumberFormat format = eNumberFormat_DEFAULT );

} // namespace base

#endif // BASE_MISC_HH
