mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Node codebase has evolved a lot in the more than 10 years of its existence. As more features (and code) have been added, changed, removed, it's sometimes hard to keep track of what gets used and what not. This commits attempts to clean some of those potentially left-over headers using suggestions from include-what-you-use Refs: https://github.com/nodejs/node/issues/27531 PR-URL: https://github.com/nodejs/node/pull/30328 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
38 lines
858 B
C++
38 lines
858 B
C++
#ifndef SRC_STRING_DECODER_INL_H_
|
|
#define SRC_STRING_DECODER_INL_H_
|
|
|
|
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#include "string_decoder.h"
|
|
|
|
namespace node {
|
|
|
|
void StringDecoder::SetEncoding(enum encoding encoding) {
|
|
state_[kBufferedBytes] = 0;
|
|
state_[kMissingBytes] = 0;
|
|
state_[kEncodingField] = encoding;
|
|
}
|
|
|
|
enum encoding StringDecoder::Encoding() const {
|
|
return static_cast<enum encoding>(state_[kEncodingField]);
|
|
}
|
|
|
|
unsigned StringDecoder::BufferedBytes() const {
|
|
return state_[kBufferedBytes];
|
|
}
|
|
|
|
unsigned StringDecoder::MissingBytes() const {
|
|
return state_[kMissingBytes];
|
|
}
|
|
|
|
char* StringDecoder::IncompleteCharacterBuffer() {
|
|
return reinterpret_cast<char*>(state_ + kIncompleteCharactersStart);
|
|
}
|
|
|
|
|
|
} // namespace node
|
|
|
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#endif // SRC_STRING_DECODER_INL_H_
|