OpenWalnut  1.5.0dev
WDataModuleInputFile.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include <string>
26 
27 #include "WDataModuleInputFile.h"
28 
29 WDataModuleInputFile::WDataModuleInputFile( boost::filesystem::path fname ):
30  m_filename( fname )
31 {
32  // initialize members
33 }
34 
36  m_filename( fname )
37 {
38  // initialize members
39 }
40 
42 {
43  // cleanup
44 }
45 
46 boost::filesystem::path WDataModuleInputFile::getFilename() const
47 {
48  return m_filename;
49 }
50 
51 std::string WDataModuleInputFile::asString() const
52 {
53  return m_filename.filename().string();
54 }
55 
56 std::ostream& WDataModuleInputFile::serialize( std::ostream& out ) const // NOLINT: yes, it is an intended non-const ref
57 {
58  // just print filename
59  out << m_filename.string();
60  return out;
61 }
62 
63 std::string WDataModuleInputFile::getName() const
64 {
65  return "FILE";
66 }
67 
69 {
70  return m_filename.string();
71 }
72 
virtual std::ostream & serialize(std::ostream &out) const
Write a machine-readable string which allows to restore your specific input later.
virtual ~WDataModuleInputFile()
Destructor.
boost::filesystem::path getFilename() const
Get the filename to load.
WDataModuleInputFile(boost::filesystem::path fname)
Default constructor.
virtual std::string getName() const
Return a unique name for this input type.
virtual std::string getExtendedInfo() const
Return some extend information for the input, like complete path, server data (username,...
boost::filesystem::path m_filename
The filename to load.
virtual std::string asString() const
The file input as human readable string.