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

filetype.cpp File Reference

#include <cctype>
#include <cstdlib>
#include "util.h"
#include "filetype.h"

Include dependency graph for filetype.cpp:

Go to the source code of this file.

Functions

static const string AVIExt (".avi")
static const string BMPExt (".bmp")
static const string CelestiaCatalogExt (".ssc")
static const string CelestiaDeepSkyCatalogExt (".dsc")
static const string CelestiaLegacyScriptExt (".cel")
static const string CelestiaMeshExt (".cms")
static const string CelestiaModelExt (".cmod")
static const string CelestiaScriptExt (".clx")
static const string CelestiaScriptExt2 (".celx")
static const string CelestiaStarCatalogExt (".stc")
static const string CelestiaTextureExt (".ctx")
static const string DDSExt (".dds")
ContentType DetermineFileType (const string &filename)
static const string JFIFExt (".jif")
static const string JPEGExt (".jpeg")
static const string JPGExt (".jpg")
static const string PNGExt (".png")
static const string TargaExt (".tga")
static const string ThreeDSExt (".3ds")


Function Documentation

static const string AVIExt ".avi"   )  [static]
 

Referenced by DetermineFileType().

static const string BMPExt ".bmp"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaCatalogExt ".ssc"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaDeepSkyCatalogExt ".dsc"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaLegacyScriptExt ".cel"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaMeshExt ".cms"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaModelExt ".cmod"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaScriptExt ".clx"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaScriptExt2 ".celx"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaStarCatalogExt ".stc"   )  [static]
 

Referenced by DetermineFileType().

static const string CelestiaTextureExt ".ctx"   )  [static]
 

Referenced by DetermineFileType().

static const string DDSExt ".dds"   )  [static]
 

Referenced by DetermineFileType().

ContentType DetermineFileType const string filename  ) 
 

Definition at line 38 of file filetype.cpp.

References AVIExt(), BMPExt(), CelestiaCatalogExt(), CelestiaDeepSkyCatalogExt(), CelestiaLegacyScriptExt(), CelestiaMeshExt(), CelestiaModelExt(), CelestiaScriptExt(), CelestiaScriptExt2(), CelestiaStarCatalogExt(), CelestiaTextureExt(), compareIgnoringCase(), Content_3DStudio, Content_AVI, Content_BMP, Content_CelestiaCatalog, Content_CelestiaDeepSkyCatalog, Content_CelestiaLegacyScript, Content_CelestiaMesh, Content_CelestiaModel, Content_CelestiaScript, Content_CelestiaStarCatalog, Content_CelestiaTexture, Content_DDS, Content_JPEG, Content_PNG, Content_Targa, Content_Unknown, DDSExt(), JFIFExt(), JPEGExt(), JPGExt(), PNGExt(), TargaExt(), and ThreeDSExt().

Referenced by captureImage(), HandleCaptureImage(), HandleCaptureMovie(), HandleOpenScript(), ModelInfo::load(), LoadImageFromFile(), LoadTextureFromFile(), MainWindowProc(), openScript(), CatalogLoader< OBJDB >::process(), SolarSystemLoader::process(), and CelestiaCore::runScript().

00039 {
00040     int extPos = filename.rfind('.');
00041     if (extPos == (int)string::npos)
00042         return Content_Unknown;
00043     string ext = string(filename, extPos, filename.length() - extPos + 1);
00044 
00045     if (compareIgnoringCase(JPEGExt, ext) == 0 ||
00046         compareIgnoringCase(JPGExt, ext) == 0 ||
00047         compareIgnoringCase(JFIFExt, ext) == 0)
00048         return Content_JPEG;
00049     else if (compareIgnoringCase(BMPExt, ext) == 0)
00050         return Content_BMP;
00051     else if (compareIgnoringCase(TargaExt, ext) == 0)
00052         return Content_Targa;
00053     else if (compareIgnoringCase(PNGExt, ext) == 0)
00054         return Content_PNG;
00055     else if (compareIgnoringCase(ThreeDSExt, ext) == 0)
00056         return Content_3DStudio;
00057     else if (compareIgnoringCase(CelestiaTextureExt, ext) == 0)
00058         return Content_CelestiaTexture;
00059     else if (compareIgnoringCase(CelestiaMeshExt, ext) == 0)
00060         return Content_CelestiaMesh;
00061     else if (compareIgnoringCase(CelestiaCatalogExt, ext) == 0)
00062         return Content_CelestiaCatalog;
00063     else if (compareIgnoringCase(CelestiaStarCatalogExt, ext) == 0)
00064         return Content_CelestiaStarCatalog;
00065     else if (compareIgnoringCase(CelestiaDeepSkyCatalogExt, ext) == 0)
00066         return Content_CelestiaDeepSkyCatalog;
00067     else if (compareIgnoringCase(AVIExt, ext) == 0)
00068         return Content_AVI;
00069     else if (compareIgnoringCase(DDSExt, ext) == 0)
00070         return Content_DDS;
00071     else if (compareIgnoringCase(CelestiaLegacyScriptExt, ext) == 0)
00072         return Content_CelestiaLegacyScript;
00073     else if (compareIgnoringCase(CelestiaScriptExt, ext) == 0 ||
00074              compareIgnoringCase(CelestiaScriptExt2, ext) == 0)
00075         return Content_CelestiaScript;
00076     else if (compareIgnoringCase(CelestiaModelExt, ext) == 0)
00077         return Content_CelestiaModel;
00078     else
00079         return Content_Unknown;
00080 }

static const string JFIFExt ".jif"   )  [static]
 

Referenced by DetermineFileType().

static const string JPEGExt ".jpeg"   )  [static]
 

Referenced by DetermineFileType().

static const string JPGExt ".jpg"   )  [static]
 

Referenced by DetermineFileType().

static const string PNGExt ".png"   )  [static]
 

Referenced by DetermineFileType().

static const string TargaExt ".tga"   )  [static]
 

Referenced by DetermineFileType().

static const string ThreeDSExt ".3ds"   )  [static]
 

Referenced by DetermineFileType().


Generated on Sat Jan 14 22:32:59 2006 for Celestia by  doxygen 1.4.1