src/ds++/XGetopt.cc
std::vector<char> XGetopt::decompose_longopts(csmap const &longopts_) {
  Require(longopts_.size() > 0);
  std::vector<char> vso;
  for (auto const &it : longopts_) {
    char const key = it.first;
    std::string const value = it.second;
    Insist(std::find(vso.begin(), vso.end(), key) == vso.end(),
           "You cannot use the same single character command line argument "
           "more than once.");
    vso.push_back(key);
    if (value[value.size() - 1] == ':')
      this->vshortopts_hasarg[key] = true;
    else
      this->vshortopts_hasarg[key] = false;
  }
  Ensure(vso.size() == longopts_.size());
  return vso;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Convert long/short option map argument into state data for class.
 *
 * \param[in] longopts_ a map<char,string> that contains letters that represent valid command line
 *            arguments and associated long option names.
 * \return A vector<char> of all registered options
 *
 * - This function also populates the class member vshortopts_hasarg.
 * - Valid shortopts are single characters.
 * - Valid longopts are strings that are optionally followed by a colon to signify that a value is
 *   expected to follow the option.
 */
\brief Convert long/short option map argument into state data for class.
\param[in] longopts_ a map that contains letters that represent valid command line
arguments and associated long option names.
\return A vector of all registered options

- This function also populates the class member vshortopts_hasarg.
- Valid shortopts are single characters.
- Valid longopts are strings that are optionally followed by a colon to signify that a value is
expected to follow the option.
\ brief Convert long / short option map argument into state data for class . \ param [ in ] longopts_ a map that contains letters that represent valid command line arguments and associated long option names . \ return A vector of all registered options - This function also populates the class member vshortopts_hasarg . - Valid shortopts are single characters . - Valid longopts are strings that are optionally followed by a colon to signify that a value is expected to follow the option .
std::vector<char> XGetopt::decompose_longopts(csmap const &longopts_) {
  Require(longopts_.size() > 0);
  std::vector<char> vso;
  for (auto const &it : longopts_) {
    char const key = it.first;
    std::string const value = it.second;
    Insist(std::find(vso.begin(), vso.end(), key) == vso.end(),
           "You cannot use the same single character command line argument "
           "more than once.");
    vso.push_back(key);
    if (value[value.size() - 1] == ':')
      this->vshortopts_hasarg[key] = true;
    else
      this->vshortopts_hasarg[key] = false;
  }
  Ensure(vso.size() == longopts_.size());
  return vso;
}
std :: vector < char > XGetopt :: decompose_longopts ( csmap const & longopts_ ) { Require ( longopts_ . size ( ) > 0 ) ; std :: vector < char > vso ; for ( auto const & it : longopts_ ) { char const key = it . first ; std :: string const value = it . second ; Insist ( std :: find ( vso . begin ( ) , vso . end ( ) , key ) == vso . end ( ) , " " " " ) ; vso . push_back ( key ) ; if ( value [ value . size ( ) - 1 ] == ' ' ) this -> vshortopts_hasarg [ key ] = true ; else this -> vshortopts_hasarg [ key ] = false ; } Ensure ( vso . size ( ) == longopts_ . size ( ) ) ; return vso ; }
\brief Convert long/short option map argument into state data for class.
\ brief Convert long / short option map argument into state data for class .