Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / src / output.hpp
1 #ifndef SASS_OUTPUT_H
2 #define SASS_OUTPUT_H
3
4 #include <string>
5 #include <vector>
6
7 #include "util.hpp"
8 #include "inspect.hpp"
9 #include "operation.hpp"
10
11 namespace Sass {
12   class Context;
13
14   // Refactor to make it generic to find linefeed (look behind)
15   inline bool ends_with(std::string const & value, std::string const & ending)
16   {
17     if (ending.size() > value.size()) return false;
18     return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
19   }
20
21   class Output : public Inspect {
22   protected:
23     using Inspect::operator();
24
25   public:
26     Output(Sass_Output_Options& opt);
27     virtual ~Output();
28
29   protected:
30     std::string charset;
31     std::vector<AST_Node_Ptr> top_nodes;
32
33   public:
34     OutputBuffer get_buffer(void);
35
36     virtual void operator()(Map_Ptr);
37     virtual void operator()(Ruleset_Ptr);
38     virtual void operator()(Supports_Block_Ptr);
39     virtual void operator()(Media_Block_Ptr);
40     virtual void operator()(Directive_Ptr);
41     virtual void operator()(Keyframe_Rule_Ptr);
42     virtual void operator()(Import_Ptr);
43     virtual void operator()(Comment_Ptr);
44     virtual void operator()(Number_Ptr);
45     virtual void operator()(String_Quoted_Ptr);
46     virtual void operator()(String_Constant_Ptr);
47
48     void fallback_impl(AST_Node_Ptr n);
49
50   };
51
52 }
53
54 #endif