]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlShowFile.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlShowFile.C
1 /**
2  * \file ControlShowFile.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Herbert Voß
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlShowFile.h"
14 #include "support/filetools.h"
15
16 using std::string;
17
18 namespace lyx {
19
20 using support::GetFileContents;
21 using support::OnlyFilename;
22
23 namespace frontend {
24
25
26 ControlShowFile::ControlShowFile(Dialog & parent)
27         : Dialog::Controller(parent)
28 {}
29
30
31 bool ControlShowFile::initialiseParams(string const & data)
32 {
33         filename_ = data;
34         return true;
35 }
36
37
38 void ControlShowFile::clearParams()
39 {
40         filename_.erase();
41 }
42
43
44 string ControlShowFile::getFileContents()
45 {
46         return GetFileContents(filename_);
47 }
48
49
50 string ControlShowFile::getFileName()
51 {
52         return OnlyFilename(filename_);
53 }
54
55 } // namespace frontend
56 } // namespace lyx