OpenCOVER
FileReference.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef FILE_REFERENCE
9#define FILE_REFERENCE
10
11#include <util/coExport.h>
12#include <osg/Referenced>
13#include <string>
14#include <map>
15#include <cstring>
16
17namespace opencover
18{
19class PLUGIN_UTILEXPORT FileReference : public osg::Referenced
20{
21public:
22 FileReference(const char *file);
23
24 void setFileStatus(bool status);
26 std::string getFilename(const char *filetype = NULL);
27
28 void addFilename(const char *file, const char *filetype);
29
30private:
31 class compare
32 {
33
34 public:
35 bool operator()(std::string s1, std::string s2) const
36 {
37#ifdef WIN32
38 return stricmp(s1.c_str(), s2.c_str()) < 0;
39#else
40 return strcasecmp(s1.c_str(), s2.c_str()) < 0;
41#endif
42 }
43 };
44
45 std::string filename;
46 bool status;
47 std::map<std::string, std::string, compare> filemap;
48};
49}
50#endif
Definition: ARToolKit.h:33
Definition: FileReference.h:20
void addFilename(const char *file, const char *filetype)
void setFileStatus(bool status)
FileReference(const char *file)
std::string getFilename(const char *filetype=NULL)