Sha256: 0c5678785b063b7ec04d5fc55ffa408539a24db5642c6b28e83f15d714e9ff01

Contents?: true

Size: 1.15 KB

Versions: 92

Compression:

Stored size: 1.15 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 std::string& str, size_t start, size_t end);
    size_t code_point_count(const std::string& str);

    // function that will return the byte offset of a code point in a
    size_t offset_at_position(const std::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 std::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
    std::string convert_from_utf16(const std::wstring& wstr);
    std::wstring convert_to_utf16(const std::string& str);
    #endif

  }
}

#endif

Version data entries

92 entries across 75 versions & 17 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/node-sass/src/libsass/src/utf8_string.hpp
optimacms-0.1.61 spec/dummy/node_modules/@rails/webpacker/node_modules/node-sass/src/libsass/src/utf8_string.hpp
disco_app-0.18.0 test/dummy/node_modules/node-sass/src/libsass/src/utf8_string.hpp
disco_app-0.18.2 test/dummy/node_modules/node-sass/src/libsass/src/utf8_string.hpp
tang-0.2.1 spec/tang_app/node_modules/node-sass/src/libsass/src/utf8_string.hpp
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/node-sass/src/libsass/src/utf8_string.hpp
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/node-sass/src/libsass/src/utf8_string.hpp
ruby2js-4.0.4 lib/tasks/testrails/node_modules/node-sass/src/libsass/src/utf8_string.hpp
ruby2js-4.0.3 lib/tasks/testrails/node_modules/node-sass/src/libsass/src/utf8_string.hpp
tang-0.2.0 spec/tang_app/node_modules/node-sass/src/libsass/src/utf8_string.hpp
tang-0.1.0 spec/tang_app/node_modules/node-sass/src/libsass/src/utf8_string.hpp
tang-0.0.9 spec/tang_app/node_modules/node-sass/src/libsass/src/utf8_string.hpp
enju_library-0.3.8 spec/dummy/node_modules/node-sass/src/libsass/src/utf8_string.hpp
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/sassc-2.0.0/ext/libsass/src/utf8_string.hpp
sassc-2.3.0 ext/libsass/src/utf8_string.hpp
ilog-0.4.1 node_modules/node-sass/src/libsass/src/utf8_string.hpp
ilog-0.4.0 node_modules/node-sass/src/libsass/src/utf8_string.hpp
ilog-0.3.3 node_modules/node-sass/src/libsass/src/utf8_string.hpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.0.1/ext/libsass/src/utf8_string.hpp
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sassc-2.1.0-x86_64-linux/ext/libsass/src/utf8_string.hpp