Current Version: 1.0.33
Project Name: csspp
position.cpp
Go to the documentation of this file.
1// Copyright (c) 2015-2025 Made to Order Software Corp. All Rights Reserved
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation; either version 2 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License along
14// with this program; if not, write to the Free Software Foundation, Inc.,
15// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16
17#include "csspp/position.h"
18
19namespace csspp
20{
21
22position::position(std::string const & filename, line_t page, line_t line)
23 : f_filename(filename)
24 , f_page(page)
25 , f_line(line)
26 , f_total_line(line)
27{
28}
29
31{
32 ++f_line;
34}
35
37{
38 ++f_page;
39 f_line = 1;
40}
41
42std::string const & position::get_filename() const
43{
44 return f_filename;
45}
46
48{
49 return f_page;
50}
51
53{
54 return f_line;
55}
56
58{
59 return f_total_line;
60}
61
62} // namespace csspp
63
64// Local Variables:
65// mode: cpp
66// indent-tabs-mode: nil
67// c-basic-offset: 4
68// tab-width: 4
69// End:
70
71// vim: ts=4 sw=4 et
line_t get_page() const
Definition position.cpp:47
position(std::string const &filename, line_t page=1, line_t line=1)
Definition position.cpp:22
line_t f_page
Definition position.h:50
line_t get_total_line() const
Definition position.cpp:57
line_t f_line
Definition position.h:51
std::string const & get_filename() const
Definition position.cpp:42
line_t get_line() const
Definition position.cpp:52
line_t f_total_line
Definition position.h:52
std::string f_filename
Definition position.h:49
The namespace of all the classes in the CSS Preprocessor.
Definition csspp.h:48
int line_t
Definition csspp.h:57

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.