Blame src/util.hpp

Packit Service 7770af
#ifndef SASS_UTIL_H
Packit Service 7770af
#define SASS_UTIL_H
Packit Service 7770af
Packit Service 7770af
#include <vector>
Packit Service 7770af
#include <string>
Packit Service 7770af
#include <assert.h>
Packit Service 7770af
#include "sass.hpp"
Packit Service 7770af
#include "sass/base.h"
Packit Service 7770af
#include "ast_fwd_decl.hpp"
Packit Service 7770af
Packit Service 7770af
#define SASS_ASSERT(cond, msg) assert(cond && msg)
Packit Service 7770af
Packit Service 7770af
namespace Sass {
Packit Service 7770af
Packit Service 7770af
  #define out_of_memory() do {            \
Packit Service 7770af
      std::cerr << "Out of memory.\n";    \
Packit Service 7770af
      exit(EXIT_FAILURE);                 \
Packit Service 7770af
    } while (0)
Packit Service 7770af
Packit Service 7770af
  double round(double val, size_t precision = 0);
Packit Service 7770af
  double sass_atof(const char* str);
Packit Service 7770af
  const char* safe_str(const char *, const char* = "");
Packit Service 7770af
  void free_string_array(char **);
Packit Service 7770af
  char **copy_strings(const std::vector<std::string>&, char ***, int = 0);
Packit Service 7770af
  std::string read_css_string(const std::string& str);
Packit Service 7770af
  std::string evacuate_escapes(const std::string& str);
Packit Service 7770af
  std::string string_to_output(const std::string& str);
Packit Service 7770af
  std::string comment_to_string(const std::string& text);
Packit Service 7770af
  std::string read_hex_escapes(const std::string& str);
Packit Service 7770af
  void newline_to_space(std::string& str);
Packit Service 7770af
Packit Service 7770af
  std::string quote(const std::string&, char q = 0);
Packit Service 7770af
  std::string unquote(const std::string&, char* q = 0, bool keep_utf8_sequences = false, bool strict = true);
Packit Service 7770af
  char detect_best_quotemark(const char* s, char qm = '"');
Packit Service 7770af
Packit Service 7770af
  bool is_hex_doublet(double n);
Packit Service 7770af
  bool is_color_doublet(double r, double g, double b);
Packit Service 7770af
Packit Service 7770af
  bool peek_linefeed(const char* start);
Packit Service 7770af
Packit Service 7770af
  namespace Util {
Packit Service 7770af
Packit Service 7770af
    std::string rtrim(const std::string& str);
Packit Service 7770af
Packit Service 7770af
    std::string normalize_underscores(const std::string& str);
Packit Service 7770af
    std::string normalize_decimals(const std::string& str);
Packit Service 7770af
Packit Service 7770af
    bool isPrintable(Ruleset_Ptr r, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(Supports_Block_Ptr r, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(Media_Block_Ptr r, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(Comment_Ptr b, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(Block_Obj b, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(String_Constant_Ptr s, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(String_Quoted_Ptr s, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isPrintable(Declaration_Ptr d, Sass_Output_Style style = NESTED);
Packit Service 7770af
    bool isAscii(const char chr);
Packit Service 7770af
Packit Service 7770af
  }
Packit Service 7770af
}
Packit Service 7770af
#endif