| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#ifndef SASS2SCSS_H |
| 8 |
#define SASS2SCSS_H |
| 9 |
|
| 10 |
#ifdef _WIN32 |
| 11 |
|
| 12 |
|
| 13 |
#ifdef ADD_EXPORTS |
| 14 |
#define ADDAPI __declspec(dllexport) |
| 15 |
#define ADDCALL __cdecl |
| 16 |
#else |
| 17 |
#define ADDAPI |
| 18 |
#define ADDCALL |
| 19 |
#endif |
| 20 |
|
| 21 |
#else |
| 22 |
|
| 23 |
|
| 24 |
#define ADDAPI |
| 25 |
#define ADDCALL |
| 26 |
|
| 27 |
#endif |
| 28 |
|
| 29 |
#ifdef __cplusplus |
| 30 |
|
| 31 |
#include <stack> |
| 32 |
#include <string> |
| 33 |
#include <cstring> |
| 34 |
#include <sstream> |
| 35 |
#include <iostream> |
| 36 |
|
| 37 |
#ifndef SASS2SCSS_VERSION |
| 38 |
|
| 39 |
|
| 40 |
#define SASS2SCSS_VERSION "1.1.1" |
| 41 |
#endif |
| 42 |
|
| 43 |
|
| 44 |
namespace Sass |
| 45 |
{ |
| 46 |
|
| 47 |
|
| 48 |
const int SASS2SCSS_PRETTIFY_0 = 0; |
| 49 |
const int SASS2SCSS_PRETTIFY_1 = 1; |
| 50 |
const int SASS2SCSS_PRETTIFY_2 = 2; |
| 51 |
const int SASS2SCSS_PRETTIFY_3 = 3; |
| 52 |
|
| 53 |
|
| 54 |
const int SASS2SCSS_KEEP_COMMENT = 32; |
| 55 |
|
| 56 |
const int SASS2SCSS_STRIP_COMMENT = 64; |
| 57 |
|
| 58 |
const int SASS2SCSS_CONVERT_COMMENT = 128; |
| 59 |
|
| 60 |
|
| 61 |
const std::string SASS2SCSS_FIND_WHITESPACE = " \t\n\v\f\r"; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
struct converter |
| 66 |
{ |
| 67 |
|
| 68 |
int options; |
| 69 |
|
| 70 |
bool selector; |
| 71 |
|
| 72 |
bool comma; |
| 73 |
|
| 74 |
bool property; |
| 75 |
|
| 76 |
bool semicolon; |
| 77 |
|
| 78 |
std::string comment; |
| 79 |
|
| 80 |
bool end_of_file; |
| 81 |
|
| 82 |
std::string whitespace; |
| 83 |
|
| 84 |
std::stack<std::string> indents; |
| 85 |
}; |
| 86 |
|
| 87 |
|
| 88 |
char* sass2scss (const std::string& sass, const int options); |
| 89 |
|
| 90 |
} |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
extern "C" { |
| 95 |
#endif |
| 96 |
|
| 97 |
|
| 98 |
#define SASS2SCSS_PRETTIFY_0 0 |
| 99 |
#define SASS2SCSS_PRETTIFY_1 1 |
| 100 |
#define SASS2SCSS_PRETTIFY_2 2 |
| 101 |
#define SASS2SCSS_PRETTIFY_3 3 |
| 102 |
|
| 103 |
|
| 104 |
#define SASS2SCSS_KEEP_COMMENT 32 |
| 105 |
|
| 106 |
#define SASS2SCSS_STRIP_COMMENT 64 |
| 107 |
|
| 108 |
#define SASS2SCSS_CONVERT_COMMENT 128 |
| 109 |
|
| 110 |
|
| 111 |
ADDAPI char* ADDCALL sass2scss (const char* sass, const int options); |
| 112 |
|
| 113 |
|
| 114 |
ADDAPI const char* ADDCALL sass2scss_version(void); |
| 115 |
|
| 116 |
#ifdef __cplusplus |
| 117 |
} |
| 118 |
#endif |
| 119 |
|
| 120 |
#endif |