to_string.hpp 638 B

1234567891011121314151617181920212223242526272829303132
  1. #define SASS_TO_STRING
  2. #include <string>
  3. #ifndef SASS_OPERATION
  4. #include "operation.hpp"
  5. #endif
  6. namespace Sass {
  7. using namespace std;
  8. struct Context;
  9. class Null;
  10. class To_String : public Operation_CRTP<string, To_String> {
  11. // import all the class-specific methods and override as desired
  12. using Operation<string>::operator();
  13. // override this to define a catch-all
  14. string fallback_impl(AST_Node* n);
  15. Context* ctx;
  16. public:
  17. To_String(Context* ctx = 0);
  18. virtual ~To_String();
  19. string operator()(Null* n);
  20. template <typename U>
  21. string fallback(U n) { return fallback_impl(n); }
  22. };
  23. }