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

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.