Path: blob/master/thirdparty/graphite/src/inc/CharInfo.h
9912 views
// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later1// Copyright 2010, SIL International, All rights reserved.23#pragma once4#include "inc/Main.h"567namespace graphite2 {89class CharInfo10{1112public:13CharInfo() : m_char(0), m_before(-1), m_after(-1), m_base(0), m_featureid(0), m_break(0), m_flags(0) {}14void init(int cid) { m_char = cid; }15unsigned int unicodeChar() const { return m_char; }16void feats(int offset) { m_featureid = offset; }17int fid() const { return m_featureid; }18int breakWeight() const { return m_break; }19void breakWeight(int val) { m_break = val; }20int after() const { return m_after; }21void after(int val) { m_after = val; }22int before() const { return m_before; }23void before(int val) { m_before = val; }24size_t base() const { return m_base; }25void base(size_t offset) { m_base = offset; }26void addflags(uint8 val) { m_flags |= val; }27uint8 flags() const { return m_flags; }2829CLASS_NEW_DELETE30private:31int m_char; // Unicode character from character stream32int m_before; // slot index before us, comes before33int m_after; // slot index after us, comes after34size_t m_base; // offset into input string corresponding to this charinfo35uint8 m_featureid; // index into features list in the segment36int8 m_break; // breakweight coming from lb table37uint8 m_flags; // 0,1 segment split.38};3940} // namespace graphite24142struct gr_char_info : public graphite2::CharInfo {};434445