filetype.h
00001 00002 /*************************************************************************** 00003 * filetype.h - little utility to decide on filetype, this FireVision 00004 * version can also detect FvRaw images. 00005 * 00006 * Generated: Tue Feb 23 13:49:38 2005 00007 * Copyright 2005-2007 Tim Niemueller [www.niemueller.de] 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #ifndef __FIREVISION_FVUTILS_FILETYPE_H_ 00026 #define __FIREVISION_FVUTILS_FILETYPE_H_ 00027 00028 #include <utils/system/filetype.h> 00029 #include <fvutils/readers/fvraw.h> 00030 #include <fvutils/colormap/cmfile.h> 00031 #include <string> 00032 00033 inline std::string 00034 fv_filetype_file(const char *filename) 00035 { 00036 std::string rv = fawkes::filetype_file(filename); 00037 00038 if ( rv == "data" ) { 00039 if ( FvRawReader::is_FvRaw(filename) ) { 00040 rv = "FvRaw"; 00041 } else if ( ColormapFile::is_colormap_file(filename) ) { 00042 rv = "FvColormap"; 00043 } 00044 } 00045 00046 return rv; 00047 } 00048 00049 00050 #endif

