CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/FWCore/RootAutoLibraryLoader/src/stdNamespaceAdder.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     RootAutoLibraryLoader
00004 // Class  :     stdNamespaceAdder
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  
00010 //         Created:  Tue Dec  6 09:18:05 EST 2005
00011 // $Id: stdNamespaceAdder.cc,v 1.2 2006/12/20 00:23:40 wmtan Exp $
00012 //
00013 
00014 // system include files
00015 #include "boost/regex.hpp"
00016 
00017 // user include files
00018 #include "FWCore/RootAutoLibraryLoader/src/stdNamespaceAdder.h"
00019 
00020 
00021 //
00022 // constants, enums and typedefs
00023 //
00024 namespace edm {
00025   namespace root {
00026     std::string stdNamespaceAdder(const std::string& iClassName)
00027     {
00028       //adds the std:: prefix to vector, string, map, list or deque if it is not
00029       // already there
00030       static const boost::regex e("(^|[^[:alnum:]_:])((?:vector)|(?:string)|(?:map)|(?:list)|(?:deque))");
00031       const std::string format("\\1std::\\2");
00032       
00033       return regex_replace(iClassName, e, format, boost::match_default | boost::format_sed);
00034     }
00035   }
00036 }