Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

ReadFile.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_ReadFile_h
00002 #define Impala_Core_Array_ReadFile_h
00003 
00004 #include "Basis/FileName.h"
00005 #include "Core/Array/ReadRaw.h"
00006 #include "Core/Array/ReadImage.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace Array
00013 {
00014 
00015 
00016 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00017 template<class ArrayT>
00018 inline void
00019 ReadFile(ArrayT*& dst, String fileName, Util::Database* db)
00020 {
00021     ILOG_VAR(Impala.Core.Array.ReadFile);
00022     String nameExt = FileNameExt(fileName, true);
00023     if (nameExt == "raw")
00024         return ReadRaw(dst, fileName, db);
00025     if ((nameExt == "jpg") || (nameExt == "jpeg"))
00026         return ReadJpg(dst, fileName, db);
00027     if (nameExt == "png")
00028         return ReadPng(dst, fileName, db);
00029     ILOG_ERROR("Don't know how to read " << fileName);
00030 }
00031 #endif // REPOSITORY_USED
00032 
00033 template<class ArrayT>
00034 inline void
00035 ReadFile(ArrayT*& dst, Persistency::File file)
00036 {
00037     ILOG_VAR(Impala.Core.Array.ReadFile);
00038     String nameExt = FileNameExt(file.GetPath(), true);
00039     if (nameExt == "raw")
00040         return ReadRaw(dst, file);
00041     if ((nameExt == "jpg") || (nameExt == "jpeg") || (nameExt == "png"))
00042         return ReadImage(dst, file);
00043     ILOG_ERROR("Don't know how to read " << file.GetPath());
00044 }
00045 
00046 } // namespace Array
00047 } // namespace Core
00048 } // namespace Impala
00049 
00050 #endif

Generated on Thu Jan 13 09:04:13 2011 for ImpalaSrc by  doxygen 1.5.1