# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CSheetId Class Reference

CSheetId. More...

#include <sheet_id.h>

List of all members.

Public Methods

 CSheetId (uint32 sheetRef=0)
 Constructor. More...

 CSheetId (const std::string &sheetName)
 Constructor. More...

bool build (const std::string &sheetName)
uint32 asInt () const
 Return the **whole** sheet id (id+type). More...

uint8 getType () const
 Return the sheet type (sub part of the sheetid). More...

uint8 getShortId () const
 Return the sheet sub id (sub part of the sheetid). More...

CSheetId & operator= (const CSheetId &sheetId)
 Operator=. More...

CSheetId & operator= (const std::string &sheetName)
 Operator=. More...

CSheetId & operator= (uint32 sheetRef)
 Operator=. More...

bool operator< (const CSheetId &sheetRef) const
 Operator<. More...

bool operator== (const CSheetId &sheetRef) const
 Operator==. More...

bool operator!= (const CSheetId &sheetRef) const
 Operator !=. More...

std::string toString () const
 Return the sheet id as a string If the sheet id is not found, the returned string is "<Sheet d not found in sheet_id.bin>" with the id in d. More...

void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 Serial. More...


Static Public Methods

void init (bool removeUnknownSheet=true)
 Load the association sheet ref / sheet name. More...

void display ()
 Display the list of valid sheet ids with their associated file names if (type != -1) then restrict list to given type. More...

void display (uint8 type)
void buildIdVector (std::vector< CSheetId > &result)
 Generate a vector of all the sheet ids of a given type This operation is non-destructive, the new entries are appended to the result vector note: fileExtension *not* include the '.' eg "bla" and *not* ".bla". More...

void buildIdVector (std::vector< CSheetId > &result, uint8 type)
void buildIdVector (std::vector< CSheetId > &result, std::vector< std::string > &resultFilenames, uint8 type)
void buildIdVector (std::vector< CSheetId > &result, const std::string &fileExtension)
void buildIdVector (std::vector< CSheetId > &result, std::vector< std::string > &resultFilenames, const std::string &fileExtension)
const std::string & fileExtensionFromType (uint8 type)
 Convert between file extensions and numeric sheet types note: fileExtension *not* include the '.' eg "bla" and *not* ".bla". More...

uint32 typeFromFileExtension (const std::string &fileExtension)

Static Public Attributes

const CSheetId Unknown
 Unknow CSheetId is similar as an NULL pointer. More...


Static Private Methods

void loadSheetId ()
void cbFileChange (const std::string &filename)

Private Attributes

TSheetId _Id

Static Private Attributes

std::map< uint32, std::string > _SheetIdToName
 associate sheet id and sheet name. More...

std::map< std::string, uint32_SheetNameToId
std::vector< std::string > _FileExtensions
bool _Initialised = false
bool _RemoveUnknownSheet = true


Detailed Description

CSheetId.

Author:
Stephane Coutelas , Nevrax France
Date:
2002

Definition at line 46 of file sheet_id.h.


Constructor & Destructor Documentation

NLMISC::CSheetId::CSheetId uint32    sheetRef = 0 [inline, explicit]
 

Constructor.

Definition at line 56 of file sheet_id.h.

References _Id, and NLMISC::CSheetId::TSheetId::Id.

Referenced by buildIdVector, operator!=, and operator==.

NLMISC::CSheetId::CSheetId const std::string &    sheetName [explicit]
 

Constructor.

Definition at line 61 of file sheet_id.cpp.

References build, nlwarning, and Unknown.


Member Function Documentation

uint32 NLMISC::CSheetId::asInt   const [inline]
 

Return the **whole** sheet id (id+type).

Definition at line 74 of file sheet_id.h.

References _Id, and NLMISC::CSheetId::TSheetId::Id.

bool NLMISC::CSheetId::build const std::string &    sheetName
 

Definition at line 76 of file sheet_id.cpp.

References _Id, _Initialised, _SheetNameToId, NLMISC::CSheetId::TSheetId::Id, nlassert, and NLMISC::strlwr.

Referenced by CSheetId.

void NLMISC::CSheetId::buildIdVector std::vector< CSheetId > &    result,
std::vector< std::string > &    resultFilenames,
const std::string &    fileExtension
[static]
 

Definition at line 419 of file sheet_id.cpp.

References buildIdVector, type, and typeFromFileExtension.

void NLMISC::CSheetId::buildIdVector std::vector< CSheetId > &    result,
const std::string &    fileExtension
[static]
 

Definition at line 407 of file sheet_id.cpp.

References buildIdVector, type, and typeFromFileExtension.

void NLMISC::CSheetId::buildIdVector std::vector< CSheetId > &    result,
std::vector< std::string > &    resultFilenames,
uint8    type
[static]
 

Definition at line 382 of file sheet_id.cpp.

References _Initialised, _SheetIdToName, CSheetId, nlassert, and type.

void NLMISC::CSheetId::buildIdVector std::vector< CSheetId > &    result,
uint8    type
[static]
 

Definition at line 358 of file sheet_id.cpp.

References _Initialised, _SheetIdToName, CSheetId, nlassert, and type.

void NLMISC::CSheetId::buildIdVector std::vector< CSheetId > &    result [static]
 

Generate a vector of all the sheet ids of a given type This operation is non-destructive, the new entries are appended to the result vector note: fileExtension *not* include the '.' eg "bla" and *not* ".bla".

Definition at line 341 of file sheet_id.cpp.

References _Initialised, _SheetIdToName, CSheetId, and nlassert.

Referenced by buildIdVector, and loadForm.

void NLMISC::CSheetId::cbFileChange const std::string &    filename [static, private]
 

Definition at line 50 of file sheet_id.cpp.

References loadSheetId, and nlinfo.

Referenced by init.

void NLMISC::CSheetId::display uint8    type [static]
 

Definition at line 314 of file sheet_id.cpp.

References _Initialised, _SheetIdToName, nlassert, nlinfo, and type.

void NLMISC::CSheetId::display   [static]
 

Display the list of valid sheet ids with their associated file names if (type != -1) then restrict list to given type.

Definition at line 295 of file sheet_id.cpp.

References _Initialised, _SheetIdToName, nlassert, and nlinfo.

const std::string & NLMISC::CSheetId::fileExtensionFromType uint8    type [static]
 

Convert between file extensions and numeric sheet types note: fileExtension *not* include the '.' eg "bla" and *not* ".bla".

Definition at line 449 of file sheet_id.cpp.

References _FileExtensions, _Initialised, nlassert, and type.

uint8 NLMISC::CSheetId::getShortId   const [inline]
 

Return the sheet sub id (sub part of the sheetid).

Definition at line 84 of file sheet_id.h.

References _Id, and NLMISC::CSheetId::TSheetId::IdInfos.

uint8 NLMISC::CSheetId::getType void    const [inline]
 

Return the sheet type (sub part of the sheetid).

Definition at line 79 of file sheet_id.h.

References _Id, and NLMISC::CSheetId::TSheetId::IdInfos.

void NLMISC::CSheetId::init bool    removeUnknownSheet = true [static]
 

Load the association sheet ref / sheet name.

Definition at line 168 of file sheet_id.cpp.

References _Initialised, _RemoveUnknownSheet, cbFileChange, and loadSheetId.

Referenced by loadForm.

void NLMISC::CSheetId::loadSheetId   [static, private]
 

Definition at line 92 of file sheet_id.cpp.

References _FileExtensions, _SheetIdToName, _SheetNameToId, file, nlerror, nlinfo, NLMISC::strlwr, and type.

Referenced by cbFileChange, and init.

bool NLMISC::CSheetId::operator!= const CSheetId &    sheetRef const [inline]
 

Operator !=.

Definition at line 114 of file sheet_id.h.

References _Id, CSheetId, and NLMISC::CSheetId::TSheetId::Id.

bool NLMISC::CSheetId::operator< const CSheetId &    sheetRef const
 

Operator<.

Definition at line 251 of file sheet_id.cpp.

References _Id, _Initialised, NLMISC::CSheetId::TSheetId::Id, and nlassert.

CSheetId & NLMISC::CSheetId::operator= uint32    sheetRef
 

Operator=.

Definition at line 235 of file sheet_id.cpp.

References _Id, _Initialised, NLMISC::CSheetId::TSheetId::Id, and nlassert.

CSheetId & NLMISC::CSheetId::operator= const std::string &    sheetName
 

Operator=.

Definition at line 211 of file sheet_id.cpp.

References _Id, _Initialised, _SheetNameToId, NLMISC::CSheetId::TSheetId::Id, nlassert, nlwarning, NLMISC::strlwr, and Unknown.

CSheetId & NLMISC::CSheetId::operator= const CSheetId &    sheetId
 

Operator=.

Definition at line 190 of file sheet_id.cpp.

References _Id, _Initialised, NLMISC::CSheetId::TSheetId::Id, and nlassert.

bool NLMISC::CSheetId::operator== const CSheetId &    sheetRef const [inline]
 

Operator==.

Definition at line 109 of file sheet_id.h.

References _Id, CSheetId, and NLMISC::CSheetId::TSheetId::Id.

void NLMISC::CSheetId::serial NLMISC::IStream   f throw (NLMISC::EStream) [inline]
 

Serial.

Definition at line 128 of file sheet_id.h.

References _Id, and NLMISC::CSheetId::TSheetId::Id.

string NLMISC::CSheetId::toString   const
 

Return the sheet id as a string If the sheet id is not found, the returned string is "<Sheet d not found in sheet_id.bin>" with the id in d.

Definition at line 270 of file sheet_id.cpp.

References _Id, _Initialised, _SheetIdToName, NLMISC::CSheetId::TSheetId::Id, nlassert, and NLMISC::toString.

uint32 NLMISC::CSheetId::typeFromFileExtension const std::string &    fileExtension [static]
 

Definition at line 432 of file sheet_id.cpp.

References _FileExtensions, _Initialised, nlassert, and NLMISC::strlwr.

Referenced by buildIdVector.


Member Data Documentation

vector< std::string > NLMISC::CSheetId::_FileExtensions [static, private]
 

Definition at line 44 of file sheet_id.cpp.

Referenced by fileExtensionFromType, loadSheetId, and typeFromFileExtension.

TSheetId NLMISC::CSheetId::_Id [private]
 

Definition at line 172 of file sheet_id.h.

Referenced by asInt, build, CSheetId, getShortId, getType, operator!=, operator<, operator=, operator==, serial, and toString.

bool NLMISC::CSheetId::_Initialised = false [static, private]
 

Definition at line 45 of file sheet_id.cpp.

Referenced by build, buildIdVector, display, fileExtensionFromType, init, operator<, operator=, toString, and typeFromFileExtension.

bool NLMISC::CSheetId::_RemoveUnknownSheet = true [static, private]
 

Definition at line 46 of file sheet_id.cpp.

Referenced by init.

map< uint32, std::string > NLMISC::CSheetId::_SheetIdToName [static, private]
 

associate sheet id and sheet name.

Definition at line 42 of file sheet_id.cpp.

Referenced by buildIdVector, display, loadSheetId, and toString.

map< std::string, uint32 > NLMISC::CSheetId::_SheetNameToId [static, private]
 

Definition at line 43 of file sheet_id.cpp.

Referenced by build, loadSheetId, and operator=.

const CSheetId NLMISC::CSheetId::Unknown [static]
 

Unknow CSheetId is similar as an NULL pointer.

Referenced by CSheetId, and operator=.


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