summaryrefslogtreecommitdiff
path: root/Editor/Document.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-12-05 01:59:36 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-12-05 01:59:36 +0100
commitae6c183475dbc3211b063ed72ad38961fe6e765e (patch)
treeb30051380da0a7a981d20593798b2e2372cb2934 /Editor/Document.h
parentd2bb139c46178af18ac927e242f75d748c298cac (diff)
downloadserenity-ae6c183475dbc3211b063ed72ad38961fe6e765e.zip
Add basic "write to file" support.
Diffstat (limited to 'Editor/Document.h')
-rw-r--r--Editor/Document.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Editor/Document.h b/Editor/Document.h
index ec67584516..7e474e484f 100644
--- a/Editor/Document.h
+++ b/Editor/Document.h
@@ -8,9 +8,11 @@
class Document {
public:
- Document() { }
+ explicit Document(const std::string& path) : m_path(path) { }
~Document() { }
+ std::string path() const { return m_path; }
+
Line& line(size_t index) { return *m_lines[index]; }
const Line& line(size_t index) const { return *m_lines[index]; }
size_t line_count() const { return m_lines.size(); }
@@ -25,4 +27,5 @@ public:
private:
std::deque<OwnPtr<Line>> m_lines;
+ std::string m_path;
};