Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- BuildInformation info;
- std::cout << info.getValue( "JPEG" ) << std::endl; // build (ver 90)
- */
- #ifndef __BUILD_INFORMATION__
- #define __BUILD_INFORMATION__
- #include <string>
- #include <sstream>
- #include <opencv2/opencv.hpp>
- class BuildInformation
- {
- private:
- std::stringstream stream;
- public:
- BuildInformation() : stream( cv::getBuildInformation() )
- {}
- ~BuildInformation()
- {
- stream.str( "" );
- }
- std::string getValue( const std::string& key )
- {
- std::string buffer;
- while( std::getline( stream, buffer ) ){
- std::string::size_type position;
- position = buffer.find( key + ":" );
- if( position == std::string::npos ){ continue; }
- position = buffer.find_first_not_of( " ", position + key.length() + 1 );
- if( position == std::string::npos ){ continue; }
- return buffer.substr( position );
- }
- return "";
- }
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement