disable the unrecognized nls and x flags
[AROS-Contrib.git] / FryingPan / DTLib / WriterHook.h
blob3d400aa0de908a2a2ea45e1f9873c0c7d87e7a5a
1 /*
2 * FryingPan - Amiga CD/DVD Recording Software (User Interface and supporting Libraries only)
3 * Copyright (C) 2001-2011 Tomasz Wiszkowski Tomasz.Wiszkowski at gmail.com
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef _WRITERHOOK_H_
21 #define _WRITERHOOK_H_
23 #include <Generic/HookT.h>
24 #include <Generic/DynList.h>
25 #include "IFileWriter.h"
26 #include "IRegHook.h"
28 template<class T, signed char pri>
29 class WriterHook : public IRegHook
31 const char *className;
32 public:
33 WriterHook()
35 className = T::static_getName();
38 virtual ~WriterHook()
42 virtual const char *getName()
44 return className;
47 virtual bool isReader()
49 return false;
52 virtual bool isWriter()
54 return true;
57 virtual signed char getPriority()
59 return pri;
62 virtual bool checkFile(const char* sName, EDtError &rc)
64 return false;
67 virtual IFileWriter *openWrite(const char* sName, const IOptItem* item, EDtError &rc)
69 IFileWriter *w = T::openWrite(sName, item, rc);
70 if (rc != DT_OK)
72 w->dispose();
73 w = 0;
75 return w;
78 virtual IFileReader *openRead(const char* sName, EDtError &rc)
80 return 0;
83 virtual bool isAudio()
85 return T::static_isAudio();
88 virtual bool isData()
90 return T::static_isData();
93 virtual bool isSession()
95 return T::static_isSession();
99 #endif