SNode.C
Loading...
Searching...
No Matches
web::http::decoder::Identity Class Reference

#include <Identity.h>

Inheritance diagram for web::http::decoder::Identity:
Collaboration diagram for web::http::decoder::Identity:

Public Member Functions

 Identity (const core::socket::stream::SocketContext *socketContext, std::size_t contentLengthExpected)
 
 Identity (const Identity &)=delete
 
 Identity (Identity &&) noexcept=default
 
Identityoperator= (const Identity &)=delete
 
Identityoperator= (Identity &&) noexcept=default
 
 ~Identity () override
 
- Public Member Functions inherited from web::http::ContentDecoder
 ContentDecoder ()=default
 
 ContentDecoder (const ContentDecoder &)=delete
 
 ContentDecoder (ContentDecoder &&) noexcept=default
 
ContentDecoderoperator= (const ContentDecoder &)=delete
 
ContentDecoderoperator= (ContentDecoder &&) noexcept=default
 
virtual ~ContentDecoder ()
 
bool isComplete () const
 
bool isError () const
 
std::vector< char > && getContent ()
 

Private Member Functions

std::size_t read () override
 

Private Attributes

const core::socket::stream::SocketContextsocketContext
 
std::size_t contentLengthExpected = 0
 
std::size_t contentLengthRead = 0
 
int state = 0
 

Additional Inherited Members

- Protected Attributes inherited from web::http::ContentDecoder
std::vector< char > content
 
bool completed = false
 
bool error = false
 

Detailed Description

Definition at line 37 of file Identity.h.

Constructor & Destructor Documentation

◆ Identity() [1/3]

web::http::decoder::Identity::Identity ( const core::socket::stream::SocketContext * socketContext,
std::size_t contentLengthExpected )

Definition at line 32 of file Identity.cpp.

36 }
std::vector< char > content
const core::socket::stream::SocketContext * socketContext
Definition Identity.h:51
std::size_t contentLengthExpected
Definition Identity.h:52

References contentLengthExpected, and socketContext.

◆ Identity() [2/3]

web::http::decoder::Identity::Identity ( const Identity & )
delete

◆ Identity() [3/3]

web::http::decoder::Identity::Identity ( Identity && )
defaultnoexcept

◆ ~Identity()

web::http::decoder::Identity::~Identity ( )
override

Definition at line 38 of file Identity.cpp.

38 {
39 }

Member Function Documentation

◆ operator=() [1/2]

Identity & web::http::decoder::Identity::operator= ( const Identity & )
delete

◆ operator=() [2/2]

Identity & web::http::decoder::Identity::operator= ( Identity && )
defaultnoexcept

◆ read()

std::size_t web::http::decoder::Identity::read ( )
overrideprivatevirtual

Implements web::http::ContentDecoder.

Definition at line 41 of file Identity.cpp.

41 {
42 std::size_t consumed = 0;
43
44 switch (state) {
45 case -1:
46 content.clear();
47 completed = false;
48 error = false;
49
50 state = 0;
51
52 [[fallthrough]];
53 case 0:
54 std::size_t ret = 0;
55 do {
57 contentLengthRead += ret;
58 consumed += ret;
60 } while (ret > 0 && !completed);
61
62 if (completed) {
63 state = -1;
64 }
65
66 break;
67 }
68 return consumed;
69 }
std::size_t readFromPeer(char *chunk, std::size_t chunklen) const final
std::size_t contentLengthRead
Definition Identity.h:53

References web::http::ContentDecoder::completed, contentLengthExpected, contentLengthRead, web::http::ContentDecoder::error, and state.

Member Data Documentation

◆ contentLengthExpected

std::size_t web::http::decoder::Identity::contentLengthExpected = 0
private

Definition at line 52 of file Identity.h.

Referenced by Identity(), and read().

◆ contentLengthRead

std::size_t web::http::decoder::Identity::contentLengthRead = 0
private

Definition at line 53 of file Identity.h.

Referenced by read().

◆ socketContext

const core::socket::stream::SocketContext* web::http::decoder::Identity::socketContext
private

Definition at line 51 of file Identity.h.

Referenced by Identity().

◆ state

int web::http::decoder::Identity::state = 0
private

Definition at line 55 of file Identity.h.

Referenced by read().


The documentation for this class was generated from the following files: