00001 /* 00002 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 #ifndef _FILENAME_H_ 00023 #define _FILENAME_H_ 00024 #include <exception> 00025 #include <iosfwd> 00026 #include "Text.hxx" 00027 #include "Assert.hxx" 00028 #include "Component.hxx" 00029 #include "TypeInfo.hxx" 00030 #include <string> 00031 00032 namespace CLAM { 00033 00044 class Filename : public Text 00045 { 00046 public: 00048 struct Filter { 00049 const char * description; 00050 const char * wildcard; 00051 }; 00052 Filename() {} 00053 Filename(const std::string & s) : Text(s) {} 00054 Filename(const char * s) : Text(s) {} 00055 virtual ~Filename() {} 00056 00060 virtual const char * TypeFamily() const { return ""; } 00064 virtual const Filter * Filters() const { 00065 static const Filter filters[] = { 00066 {0, 0} 00067 }; 00068 return filters; 00069 } 00070 }; 00071 00102 class InFilename : public Filename 00103 { 00104 public: 00105 InFilename(const std::string & s="") : Filename(s) {} 00106 InFilename(const char * s) : Filename(s) {} 00107 }; 00108 00138 class OutFilename : public Filename 00139 { 00140 public: 00141 OutFilename(const std::string & s="") : Filename(s) {} 00142 OutFilename(const char * s) : Filename(s) {} 00143 }; 00144 00145 CLAM_TYPEINFOGROUP(BasicCTypeInfo, Filename); 00146 CLAM_TYPEINFOGROUP(BasicCTypeInfo, InFilename); 00147 CLAM_TYPEINFOGROUP(BasicCTypeInfo, OutFilename); 00148 00149 } 00150 00151 #endif // _FILENAME_H_ 00152