Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
CPPHTTPLIB_NAMESPACE::MultipartFormData Struct Reference

Public Member Functions

std::string get_field (const std::string &key, size_t id=0) const
std::vector< std::string > get_fields (const std::string &key) const
bool has_field (const std::string &key) const
size_t get_field_count (const std::string &key) const
FormData get_file (const std::string &key, size_t id=0) const
std::vector< FormData > get_files (const std::string &key) const
bool has_file (const std::string &key) const
size_t get_file_count (const std::string &key) const

Public Attributes

FormFields fields
FormFiles files

Member Function Documentation

◆ get_field()

std::string CPPHTTPLIB_NAMESPACE::MultipartFormData::get_field ( const std::string & key,
size_t id = 0 ) const
inline
288382 {
288383 auto rng = fields.equal_range(key);
288384 auto it = rng.first;
288385 std::advance(it, static_cast<ssize_t>(id));
288386 if (it != rng.second) { return it->second.content; }
288387 return std::string();
288388}

◆ get_fields()

std::vector< std::string > CPPHTTPLIB_NAMESPACE::MultipartFormData::get_fields ( const std::string & key) const
inline
288391 {
288392 std::vector<std::string> values;
288393 auto rng = fields.equal_range(key);
288394 for (auto it = rng.first; it != rng.second; it++) {
288395 values.push_back(it->second.content);
288396 }
288397 return values;
288398}

◆ has_field()

bool CPPHTTPLIB_NAMESPACE::MultipartFormData::has_field ( const std::string & key) const
inline
288400 {
288401 return fields.find(key) != fields.end();
288402}

◆ get_field_count()

size_t CPPHTTPLIB_NAMESPACE::MultipartFormData::get_field_count ( const std::string & key) const
inline
288404 {
288405 auto r = fields.equal_range(key);
288406 return static_cast<size_t>(std::distance(r.first, r.second));
288407}

◆ get_file()

FormData CPPHTTPLIB_NAMESPACE::MultipartFormData::get_file ( const std::string & key,
size_t id = 0 ) const
inline
288410 {
288411 auto rng = files.equal_range(key);
288412 auto it = rng.first;
288413 std::advance(it, static_cast<ssize_t>(id));
288414 if (it != rng.second) { return it->second; }
288415 return FormData();
288416}

◆ get_files()

std::vector< FormData > CPPHTTPLIB_NAMESPACE::MultipartFormData::get_files ( const std::string & key) const
inline
288419 {
288420 std::vector<FormData> values;
288421 auto rng = files.equal_range(key);
288422 for (auto it = rng.first; it != rng.second; it++) {
288423 values.push_back(it->second);
288424 }
288425 return values;
288426}

◆ has_file()

bool CPPHTTPLIB_NAMESPACE::MultipartFormData::has_file ( const std::string & key) const
inline
288428 {
288429 return files.find(key) != files.end();
288430}

◆ get_file_count()

size_t CPPHTTPLIB_NAMESPACE::MultipartFormData::get_file_count ( const std::string & key) const
inline
288432 {
288433 auto r = files.equal_range(key);
288434 return static_cast<size_t>(std::distance(r.first, r.second));
288435}

The documentation for this struct was generated from the following file: