Sha256: d07dfe2e2f846cdcfa9944c70c3a783b3b8fe1950d363c55a0e2113e57fea6ec

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

#ifndef SASS_UTF8_STRING_H
#define SASS_UTF8_STRING_H

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

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

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

  }
}

#endif

Version data entries

6 entries across 5 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/sassc-2.4.0/ext/libsass/src/utf8_string.hpp
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/sassc-2.4.0/ext/libsass/src/utf8_string.hpp
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/sassc-2.4.0/ext/libsass/src/utf8_string.hpp
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/ext/libsass/src/utf8_string.hpp
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/ext/libsass/src/utf8_string.hpp
sassc-2.4.0 ext/libsass/src/utf8_string.hpp