Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CatalogLoader< OBJDB > Class Template Reference

Inheritance diagram for CatalogLoader< OBJDB >:

Inheritance graph
Collaboration diagram for CatalogLoader< OBJDB >:

Collaboration graph
List of all members.

Public Member Functions

 CatalogLoader (OBJDB *db, const std::string &typeDesc, const ContentType &contentType, ProgressNotifier *pn)
bool process (const string &filename)

Public Attributes

ContentType contentType
ProgressNotifiernotifier
OBJDB * objDB
string typeDesc

template<class OBJDB>
class CatalogLoader< OBJDB >


Constructor & Destructor Documentation

template<class OBJDB>
CatalogLoader< OBJDB >::CatalogLoader OBJDB *  db,
const std::string typeDesc,
const ContentType contentType,
ProgressNotifier pn
[inline]
 

Definition at line 3501 of file celestiacore.cpp.

References CatalogLoader< OBJDB >::contentType, CatalogLoader< OBJDB >::notifier, CatalogLoader< OBJDB >::objDB, and CatalogLoader< OBJDB >::typeDesc.

03504                                         :
03505         objDB      (db),
03506         typeDesc   (typeDesc),
03507         contentType(contentType),
03508         notifier(pn)
03509     {
03510     }


Member Function Documentation

template<class OBJDB>
bool CatalogLoader< OBJDB >::process const string filename  )  [inline]
 

Definition at line 3512 of file celestiacore.cpp.

References _, CatalogLoader< OBJDB >::contentType, DetermineFileType(), DPRINTF, EnumFilesHandler::getPath(), CatalogLoader< OBJDB >::notifier, CatalogLoader< OBJDB >::objDB, CatalogLoader< OBJDB >::typeDesc, and ProgressNotifier::update().

03513     {
03514         if (DetermineFileType(filename) == contentType)
03515         {
03516             string fullname = getPath() + '/' + filename;
03517             clog << _("Loading ") << typeDesc << " catalog: " << fullname << '\n';
03518             if (notifier)
03519                 notifier->update(filename);
03520                 
03521             ifstream catalogFile(fullname.c_str(), ios::in);
03522             if (catalogFile.good())
03523             {
03524                 bool success = objDB->load(catalogFile, getPath());
03525                 if (!success)
03526                 {
03527                     DPRINTF(0, _("Error reading star file: %s\n"),
03528                             fullname.c_str());
03529                 }
03530                     DPRINTF(0, "Error reading %s catalog file: %s\n", typeDesc.c_str(), fullname.c_str());
03531             }
03532         }
03533         return true;
03534     }


Member Data Documentation

template<class OBJDB>
ContentType CatalogLoader< OBJDB >::contentType
 

Definition at line 3498 of file celestiacore.cpp.

Referenced by CatalogLoader< OBJDB >::CatalogLoader(), and CatalogLoader< OBJDB >::process().

template<class OBJDB>
ProgressNotifier* CatalogLoader< OBJDB >::notifier
 

Definition at line 3499 of file celestiacore.cpp.

Referenced by CatalogLoader< OBJDB >::CatalogLoader(), and CatalogLoader< OBJDB >::process().

template<class OBJDB>
OBJDB* CatalogLoader< OBJDB >::objDB
 

Definition at line 3496 of file celestiacore.cpp.

Referenced by CatalogLoader< OBJDB >::CatalogLoader(), and CatalogLoader< OBJDB >::process().

template<class OBJDB>
string CatalogLoader< OBJDB >::typeDesc
 

Definition at line 3497 of file celestiacore.cpp.

Referenced by CatalogLoader< OBJDB >::CatalogLoader(), and CatalogLoader< OBJDB >::process().


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:08 2006 for Celestia by  doxygen 1.4.1