/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/DetectorDescription/Identifier/Identifier-00-02-17/src/Identifier.cxx

Go to the documentation of this file.
00001 #include "Identifier/Identifier.h"
00002 #include <stdarg.h>
00003 #include <stdio.h>
00004 #include <algorithm>
00005 
00006 #include <iostream>
00007 #include <iomanip>
00008 
00009 //-----------------------------------------------
00010 void Identifier::set (const std::string& id)
00011 {
00012   sscanf (id.c_str(), "0x%x", &m_id);
00013 }
00014 
00015 
00016 //-----------------------------------------------
00017 std::string Identifier::getString() const
00018 {
00019    std::string result;
00020    char temp[20];
00021    
00022    sprintf (temp, "0x%x", (unsigned int)m_id);
00023    result += temp;
00024    result.insert(2,10-result.length(),'0');
00025    
00026    return (result);
00027 }
00028 
00029 //-----------------------------------------------
00030 void Identifier::show () const
00031 {
00032     const Identifier& me = *this;
00033     std::cout << me.getString();
00034 }
00035 
00036 std::ostream& operator<<(std::ostream & os, const Identifier& Id)
00037 {
00038    return (os<<Id.getString());
00039 }

Generated on Tue Nov 29 22:58:00 2016 for BOSS_7.0.2 by  doxygen 1.4.7