Sha256: 4c80d23573ec49a4696be4c5c3f286f7770d218133102f3c3c62be7bfe2f0db4

Contents?: true

Size: 1.11 KB

Versions: 17

Compression:

Stored size: 1.11 KB

Contents

#ifndef SASS_UTF8_STRING_H
#define SASS_UTF8_STRING_H

#include <string>
#include "utf8.h"

namespace Sass {
  namespace UTF_8 {

    // naming conventions:
    // offset: raw byte offset (0 based)
    // position: code point offset (0 based)
    // index: code point offset (1 based or negative)

    // function that will count the number of code points (utf-8 characters) from the beginning to the given end
    size_t code_point_count(const string& str, size_t start, size_t end);
    size_t code_point_count(const string& str);

    // function that will return the byte offset of a code point in a
    size_t offset_at_position(const string& str, size_t position);

    // function that returns number of bytes in a character in a string
    size_t code_point_size_at_offset(const string& str, size_t offset);

    // function that will return a normalized index, given a crazy one
    size_t normalize_index(int index, size_t len);

    #ifdef _WIN32
    // functions to handle unicode paths on windows
    string convert_from_utf16(const wstring& wstr);
    wstring convert_to_utf16(const string& str);
    #endif

  }
}

#endif

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-sass/node_modules/node-sass/src/libsass/utf8_string.hpp
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-sass/node_modules/node-sass/src/libsass/utf8_string.hpp
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-sass/node_modules/node-sass/src/libsass/utf8_string.hpp
sassc-1.7.1 ext/libsass/utf8_string.hpp
sassc-1.7.0 ext/libsass/utf8_string.hpp
sassc-1.6.0 ext/libsass/utf8_string.hpp
sassc-1.5.1 ext/libsass/utf8_string.hpp
sassc-1.5.0 ext/libsass/utf8_string.hpp
sassc-1.4.0 ext/libsass/utf8_string.hpp
sassc-1.3.0 ext/libsass/utf8_string.hpp
sassc-1.2.0 ext/libsass/utf8_string.hpp
sassc-1.1.2 ext/libsass/utf8_string.hpp
sassc-1.1.1 ext/libsass/utf8_string.hpp
sassc-1.1.0 ext/libsass/utf8_string.hpp
sassc-1.0.0 ext/libsass/utf8_string.hpp
sassc-0.0.11 ext/libsass/utf8_string.hpp
sassc-0.0.10 ext/libsass/utf8_string.hpp