|
CURL * | GetEasyHandle () const noexcept |
| Returns a libcurl easy_handle . More...
|
|
CURLcode | GetCurlError () const noexcept |
| Returns the error code that occurs in a function that takes a libcurl easy_handle as the argument. More...
|
|
CURLMcode | GetCurlMultiError () const noexcept |
| Returns the error code that occurs in a function that takes a libcurl multi_handle as the argument. More...
|
|
CURLcode | SetUrl (const char *url) noexcept |
| Sets the URL to be read. More...
|
|
bool | StartDownload () noexcept |
|
|
constexpr | CurlInputStream () noexcept |
| Instantiates the object with default parameters (default constructor). Requires initialization with Init() after execution.
|
|
virtual | ~CurlInputStream () noexcept override |
| Destructor. More...
|
|
errno_t | Init (BufferSize buffer_size) noexcept |
| Initializes a stream. More...
|
|
errno_t | Init () noexcept |
| Executes Init(kBufferSize1x) .
|
|
errno_t | GetErrorValue () const noexcept |
| Gets the error value. More...
|
|
size_t | Pos () const noexcept |
| Returns the current position in the stream. More...
|
|
uint64_t | Pos64 () const noexcept |
| Returns the current position in the stream as a 64-bit value. More...
|
|
bool | IsEos () noexcept |
| Returns true if the stream is finished being read through to the end. If the stream has not been read through to the end, or if an error occurs, the function returns false . More...
|
|
int | Read () noexcept |
| Reads one byte of data from the stream. More...
|
|
int | Peek () noexcept |
| Reads the next byte without consuming the stream. More...
|
|
size_t | Skip (size_t nbytes) noexcept |
| Skips over the number of bytes specified by nbytes. More...
|
|
size_t | Read (void *ptr, size_t nbytes) noexcept |
| Reads the number of bytes of data specified by nbytes into the memory region specified by ptr. More...
|
|
template<size_t N> |
size_t | Read (nlib_byte_t(&buf)[N]) noexcept |
| A template overload of the above function.
|
|
bool | Close () noexcept |
| Closes the stream. Returns true if successful. More...
|
|
bool | Mark (size_t readlimit) noexcept |
| This function provides settings that allow you to return to the current load position using GoBackToMark() . More...
|
|
bool | GoBackToMark () noexcept |
| This function allows you to return to the load position that the last Mark() has been executed at. More...
|
|
bool | IsMarkSupported () const noexcept |
| This function returns true if this stream supports Mark() and GoBackToMark() .
|
|
| operator bool () const |
| Returns true if the object has been initialized and an error has not occurred inside, or returns false if an error has occurred inside.
|
|
constexpr | InputStream () noexcept |
| Instantiates the object with default parameters (default constructor). This function is called from the derived class.
|
|
virtual | ~InputStream () noexcept |
| Destructor. This function is called from the derived class.
|
|
The stream class for downloading using libcurl
.
- Description
- By using this class, you can handle data obtained with
libcurl
through the InputStream
interface. The following code is a common implementation for using the class. SUCCEED_IF(e == 0);
SUCCEED_IF(stream.
SetUrl(
"https://www.nintendo.co.jp") == CURLE_OK);
char buf[256];
size_t nread = stream.
Read(buf, 255);
if (nread == 0) {
return false;
}
buf[nread] = '\0';
- The transition of the object state.
- The overview of the object state transitions is described below:
Definition at line 31 of file CurlInputStream.h.