11cb0ef41Sopenharmony_ci#ifndef SRC_STRING_DECODER_INL_H_ 21cb0ef41Sopenharmony_ci#define SRC_STRING_DECODER_INL_H_ 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ci#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci#include "string_decoder.h" 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_cinamespace node { 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_civoid StringDecoder::SetEncoding(enum encoding encoding) { 111cb0ef41Sopenharmony_ci state_[kBufferedBytes] = 0; 121cb0ef41Sopenharmony_ci state_[kMissingBytes] = 0; 131cb0ef41Sopenharmony_ci state_[kEncodingField] = encoding; 141cb0ef41Sopenharmony_ci} 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_cienum encoding StringDecoder::Encoding() const { 171cb0ef41Sopenharmony_ci return static_cast<enum encoding>(state_[kEncodingField]); 181cb0ef41Sopenharmony_ci} 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ciunsigned StringDecoder::BufferedBytes() const { 211cb0ef41Sopenharmony_ci return state_[kBufferedBytes]; 221cb0ef41Sopenharmony_ci} 231cb0ef41Sopenharmony_ci 241cb0ef41Sopenharmony_ciunsigned StringDecoder::MissingBytes() const { 251cb0ef41Sopenharmony_ci return state_[kMissingBytes]; 261cb0ef41Sopenharmony_ci} 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_cichar* StringDecoder::IncompleteCharacterBuffer() { 291cb0ef41Sopenharmony_ci return reinterpret_cast<char*>(state_ + kIncompleteCharactersStart); 301cb0ef41Sopenharmony_ci} 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ci} // namespace node 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ci#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci#endif // SRC_STRING_DECODER_INL_H_ 38