Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

IONameFile.cpp

Go to the documentation of this file.
00001 #include "IONameFile.h"
00002 #include "../SctNames.h"
00003 
00004 namespace Sct {
00005 namespace File {
00006 
00007 IONameFile::IONameFile(const string& fileName) throw(InvalidArgument) : IOName(fileName) {
00008     IONameFile::parse();
00009 }
00010 
00011 IONameFile::IONameFile(const string& uniqueID, const string& className) throw() : IOName(uniqueID, className) {
00012     IONameFile::construct();
00013 }
00014 
00015 IONameFile::~IONameFile() throw() {
00016 }
00017 
00018 string IONameFile::getClassName() const throw() {
00019     return className;
00020 }
00021 
00022 void IONameFile::parse() throw(InvalidArgument) {
00023     int dot = nameIO.rfind('/');        //We want last /
00024     int dot2 = nameIO.find('.', ++dot);
00025     className = nameIO.substr(dot, dot2-dot);  //ClassName is everything between the last / and second .
00026     uniqueID = nameIO.substr(++dot2);
00027 }
00028 
00029 void IONameFile::construct() throw() {
00030     nameIO = SctNames::getTempDir();
00031     nameIO += "/" + className;
00032     nameIO += "." + uniqueID;
00033 }
00034 
00035 }
00036 }
00037 

Generated on Mon Dec 15 19:36:04 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3