ext/libsass/src/file.hpp in sassc-1.11.4 vs ext/libsass/src/file.hpp in sassc-1.12.0

- old
+ new

@@ -2,10 +2,11 @@ #define SASS_FILE_H #include <string> #include <vector> +#include "sass/context.h" #include "ast_fwd_decl.hpp" namespace Sass { namespace File { @@ -45,14 +46,21 @@ // create a path that is relative to the given base directory // path and base will first be resolved against cwd to make them absolute std::string abs2rel(const std::string& path, const std::string& base = ".", const std::string& cwd = get_cwd()); // helper function to resolve a filename + // searching without variations in all paths + std::string find_file(const std::string& file, struct Sass_Compiler* options); std::string find_file(const std::string& file, const std::vector<std::string> paths); - // inc paths can be directly passed from C code - std::string find_file(const std::string& file, const char** paths); + // helper function to resolve a include filename + // this has the original resolve logic for sass include + std::string find_include(const std::string& file, const std::vector<std::string> paths); + + // split a path string delimited by semicolons or colons (OS dependent) + std::vector<std::string> split_path_list(const char* paths); + // try to load the given filename // returned memory must be freed // will auto convert .sass files char* read_file(const std::string& file); @@ -79,13 +87,18 @@ // a resolved include (final import) class Include : public Importer { public: // resolved absolute path std::string abs_path; + // is a deprecated file type + bool deprecated; public: + Include(const Importer& imp, std::string abs_path, bool deprecated) + : Importer(imp), abs_path(abs_path), deprecated(deprecated) + { } Include(const Importer& imp, std::string abs_path) - : Importer(imp), abs_path(abs_path) + : Importer(imp), abs_path(abs_path), deprecated(false) { } }; // a loaded resource class Resource { @@ -111,10 +124,14 @@ { } }; namespace File { - std::vector<Include> resolve_includes(const std::string& root, const std::string& file); + static std::vector<std::string> defaultExtensions = { ".scss", ".sass" }; + + std::vector<Include> resolve_includes(const std::string& root, const std::string& file, + const std::vector<std::string>& exts = defaultExtensions); + } }