Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////////////////////////////////////////
- /// \details
- /// Will throw if version data is invalid. More than MAX_COMPONENTS are
- /// automatically truncated and not treated as errors. Missing components are
- /// initialized to 0.
- ///
- /// \param version
- /// The version to deserialize into individual integral components.
- ///////////////////////////////////////////////////////////////////////////////
- void CVersionNumber::DeserializeString(std::string const& version)
- {
- std::vector<std::string> components;
- boost::split(components, version, boost::is_any_of("."));
- // Resize the split components. If we have more components than supported,
- // the excess components are truncated. If we have too few, each is
- // initialized to 0.
- components.resize(m_version.size(), "0");
- std::transform(
- components.begin(),
- components.end(),
- m_version.begin(),
- &boost::lexical_cast<unsigned, std::string>);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement