Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Struct key_value_pair

boost::process::v2::environment::key_value_pair

Synopsis

// In header: <boost/process/v2/environment.hpp>


struct key_value_pair {
  // types
  typedef char_type                      value_type;      
  typedef std::char_traits< char_type >  traits_type;     
  typedef std::basic_string< char_type > string_type;     
  typedef basic_cstring_ref< char_type > string_view_type;

  // construct/copy/destruct
  key_value_pair();
  key_value_pair(const key_value_pair &) = default;
  key_value_pair(key_value_pair &&);
  key_value_pair(key_view, value_view);
  key_value_pair(key_view, 
                 std::initializer_list< basic_string_view< char_type >>);
  key_value_pair(const string_type &);
  key_value_pair(string_type &&);
  key_value_pair(const value_type *);
  key_value_pair(value_type *);
  explicit key_value_pair(key_value_pair_view);
  template<typename Source> 
    key_value_pair(const Source &, decltype(source.data()) = nullptr, 
                   decltype(source.size()) = 0u);
  template<typename Key, typename Value> 
    key_value_pair(const std::pair< Key, Value > &);
  key_value_pair(const typename conditional< is_same< value_type, char >::value, wchar_t, char >::type *);
  template<typename InputIt, 
           typename std::iterator_traits< InputIt >::iterator_category> 
    key_value_pair(InputIt, InputIt);
  key_value_pair & operator=(const key_value_pair &) = default;
  key_value_pair & operator=(key_value_pair &&);
  key_value_pair & operator=(string_type &&);
  template<typename Source> key_value_pair & operator=(const Source &);
  ~key_value_pair();

  // public member functions
  key_value_pair & assign(string_type &&);
  template<typename Source> key_value_pair & assign(const Source &);
  template<typename InputIt> key_value_pair & assign(InputIt, InputIt);
  void clear();
  void swap(key_value_pair &) noexcept;
  const value_type * c_str() const noexcept;
  const string_type & native() const noexcept;
  string_view_type native_view() const noexcept;
  operator string_type() const;
  operator string_view_type() const;
  operator key_value_pair_view() const;
  int compare(const key_value_pair &) const noexcept;
  int compare(const string_type &) const;
  int compare(string_view_type) const;
  int compare(const value_type *) const;
  template<typename CharT, typename Traits = std::char_traits<CharT>, 
           typename Alloc = std::allocator<CharT> > 
    std::basic_string< CharT, Traits, Alloc > 
    basic_string(const Alloc & = Alloc()) const;
  std::string string() const;
  std::wstring wstring() const;
  const string_type & native_string() const;
  bool empty() const;
  struct key_view key() const;
  struct value_view value() const;
  const value_type * data() const;
  std::size_t size() const;
  template<std::size_t Idx> virtual auto get() const = 0;
  template<> key_view get() const;
  template<> value_view get() const;
};

Description

key_value_pair public construct/copy/destruct

  1. key_value_pair();
  2. key_value_pair(const key_value_pair & p) = default;
  3. key_value_pair(key_value_pair && p);
  4. key_value_pair(key_view key, value_view value);
  5. key_value_pair(key_view key, 
                   std::initializer_list< basic_string_view< char_type >> values);
  6. key_value_pair(const string_type & source);
  7. key_value_pair(string_type && source);
  8. key_value_pair(const value_type * raw);
  9. key_value_pair(value_type * raw);
  10. explicit key_value_pair(key_value_pair_view kv);
  11. template<typename Source> 
      key_value_pair(const Source & source, decltype(source.data()) = nullptr, 
                     decltype(source.size()) = 0u);
  12. template<typename Key, typename Value> 
      key_value_pair(const std::pair< Key, Value > & kv);
  13. key_value_pair(const typename conditional< is_same< value_type, char >::value, wchar_t, char >::type * raw);
  14. template<typename InputIt, 
             typename std::iterator_traits< InputIt >::iterator_category> 
      key_value_pair(InputIt first, InputIt last);
  15. key_value_pair & operator=(const key_value_pair & p) = default;
  16. key_value_pair & operator=(key_value_pair && p);
  17. key_value_pair & operator=(string_type && source);
  18. template<typename Source> key_value_pair & operator=(const Source & source);
  19. ~key_value_pair();

key_value_pair public member functions

  1. key_value_pair & assign(string_type && source);
  2. template<typename Source> key_value_pair & assign(const Source & source);
  3. template<typename InputIt> 
      key_value_pair & assign(InputIt first, InputIt last);
  4. void clear();
  5. void swap(key_value_pair & other) noexcept;
  6. const value_type * c_str() const noexcept;
  7. const string_type & native() const noexcept;
  8. string_view_type native_view() const noexcept;
  9. operator string_type() const;
  10. operator string_view_type() const;
  11. operator key_value_pair_view() const;
  12. int compare(const key_value_pair & p) const noexcept;
  13. int compare(const string_type & str) const;
  14. int compare(string_view_type str) const;
  15. int compare(const value_type * s) const;
  16. template<typename CharT, typename Traits = std::char_traits<CharT>, 
             typename Alloc = std::allocator<CharT> > 
      std::basic_string< CharT, Traits, Alloc > 
      basic_string(const Alloc & alloc = Alloc()) const;
  17. std::string string() const;
  18. std::wstring wstring() const;
  19. const string_type & native_string() const;
  20. bool empty() const;
  21. struct key_view key() const;
  22. struct value_view value() const;
  23. const value_type * data() const;
  24. std::size_t size() const;
  25. template<std::size_t Idx> virtual auto get() const = 0;
  26. template<> key_view get() const;
  27. template<> value_view get() const;

PrevUpHomeNext