| 1 |
#include <string> |
| 2 |
#include <iostream> |
| 3 |
#include "pUtils.h" |
| 4 |
#include "pPheaMgr.h" |
| 5 |
#include "pGenHeader.h" |
| 6 |
|
| 7 |
#define HEADER_NAMES "general " |
| 8 |
#define GENPOS 0 |
| 9 |
|
| 10 |
using std::string; |
| 11 |
using std::cout; |
| 12 |
using std::endl; |
| 13 |
using pUtils::ToLower; |
| 14 |
|
| 15 |
pPheaMgr * pPheaMgr::_pheamgr = 0; |
| 16 |
|
| 17 |
|
| 18 |
pPheaMgr * pPheaMgr::Get(){ |
| 19 |
if(_pheamgr==0) { |
| 20 |
_pheamgr = new pPheaMgr(); |
| 21 |
} |
| 22 |
return _pheamgr; |
| 23 |
} |
| 24 |
|
| 25 |
pHeader* pPheaMgr::GetpHea(const string &s, const char *c) |
| 26 |
{ |
| 27 |
string temp=HEADER_NAMES; |
| 28 |
string::size_type spos=temp.find(ToLower(s)); |
| 29 |
|
| 30 |
switch(spos){ |
| 31 |
case GENPOS: |
| 32 |
return new pGenHeader(c); |
| 33 |
case string::npos: |
| 34 |
cout << " pPheaMgr : Header = " << s << " not found "; |
| 35 |
return 0; |
| 36 |
default: |
| 37 |
cout << " pPheaMgr : Header = " << s << " not found "; |
| 38 |
return 0; |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
|