| Server IP : 82.148.16.210 / Your IP : 216.73.216.19 Web Server : nginx/1.29.5 System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/748/root/usr/include/nodejs/src/ |
Upload File : |
#ifndef SRC_STRING_DECODER_H_
#define SRC_STRING_DECODER_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "node.h"
namespace node {
class StringDecoder {
public:
StringDecoder() { state_[kEncodingField] = BUFFER; }
inline void SetEncoding(enum encoding encoding);
inline enum encoding Encoding() const;
inline char* IncompleteCharacterBuffer();
inline unsigned MissingBytes() const;
inline unsigned BufferedBytes() const;
// Decode a string from the specified encoding.
// The value pointed to by `nread` will be modified to reflect that
// less data may have been read because it ended on an incomplete character
// and more data may have been read because a previously incomplete character
// was finished.
v8::MaybeLocal<v8::String> DecodeData(v8::Isolate* isolate,
const char* data,
size_t* nread);
// Flush an incomplete character. For character encodings like UTF8 this
// means printing replacement characters, buf for e.g. Base64 the returned
// string contains more data.
v8::MaybeLocal<v8::String> FlushData(v8::Isolate* isolate);
enum Fields {
kIncompleteCharactersStart = 0,
kIncompleteCharactersEnd = 4,
kMissingBytes = 4,
kBufferedBytes = 5,
kEncodingField = 6,
kNumFields = 7
};
private:
uint8_t state_[kNumFields] = {};
};
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_STRING_DECODER_H_