#include <fsc_RawMedVolPathCollector.h>


Definition at line 26 of file fsc_RawMedVolPathCollector.h.
Public Member Functions | |
| fsc_RawMedVolPathCollector (const string &a_partName, UInt32_t a_mediumKey, UInt32_t a_medVolNum) | |
| virtual | ~fsc_RawMedVolPathCollector (void) |
| virtual bool | ProcFileID (ivd_RecordIDX_t a_fileID) |
| coll inrerit method and clean filePath | |
| virtual bool | ProcRecMedPosMgr (fsc_MediaPosition_t &a_medPos) |
| this method is called by fsc_MedPosMgs to collect media's block offset | |
| ivd_RecordIDX_t | GetFileID () |
Public Attributes | |
| log_CLASSID_m | |
Private Member Functions | |
| const cmn_Path | GetFileName (const string &a_partName, ivd_MediaKey_t a_mediaKey) |
Private Attributes | |
| fsc_medVolData_t | m_medVolData |
| to collect each split info | |
| UInt32_t | m_pathCounter |
| UInt32_t | m_mediumKey |
| when medium key is set then get filePath too and collect only particular medium and volume if set othervice all volumes from medium. | |
| UInt32_t | m_medVolNum |
| string | m_filePath |
| ofstream | m_output |
| fsc_RawMedVolPathCollector::fsc_RawMedVolPathCollector | ( | const string & | a_partName, | |
| UInt32_t | a_mediumKey, | |||
| UInt32_t | a_medVolNum | |||
| ) |
Definition at line 36 of file fsc_RawMedVolPathCollector.cpp.
References cmn_File::DeleteFile(), GetFileName(), ie_INVALID_ARG, m_mediumKey, m_output, and path.
00039 : 00040 m_pathCounter(0), 00041 m_mediumKey(a_mediumKey), 00042 m_medVolNum(a_medVolNum) 00043 { 00044 // open proper file 00045 if (m_mediumKey == 0) { 00046 throw ivd_InternalError(ie_INVALID_ARG, "Medium Key must be greater than 0"); 00047 } 00048 cmn_Path path = GetFileName(a_partName, a_mediumKey); 00049 try { 00050 cmn_File::DeleteFile(path.c_str()); 00051 } 00052 catch (ivd_SysError) { // file is not generated 00053 } 00054 m_output.open(path.c_str()); 00055 } //============================================================================//

| fsc_RawMedVolPathCollector::~fsc_RawMedVolPathCollector | ( | void | ) | [virtual] |
Definition at line 58 of file fsc_RawMedVolPathCollector.cpp.
References m_output.
00058 { 00059 m_output.close(); 00060 }
| bool fsc_RawMedVolPathCollector::ProcFileID | ( | ivd_RecordIDX_t | a_fileID | ) | [virtual] |
coll inrerit method and clean filePath
Reimplemented from fsc_RawCollector.
Definition at line 63 of file fsc_RawMedVolPathCollector.cpp.
References fsc_medVolData_t::fileID, m_filePath, m_medVolData, and fsc_RawCollector::ProcFileID().
00063 { 00064 fsc_RawCollector::ProcFileID(a_fileID); 00065 m_medVolData.fileID = a_fileID; 00066 m_filePath.clear(); 00067 return true; 00068 }

| bool fsc_RawMedVolPathCollector::ProcRecMedPosMgr | ( | fsc_MediaPosition_t & | a_medPos | ) | [virtual] |
this method is called by fsc_MedPosMgs to collect media's block offset
Reimplemented from fsc_RawCollector.
Definition at line 71 of file fsc_RawMedVolPathCollector.cpp.
References fsc_medVolData_t::fileID, fsc_nsCreateElementObj(), fsc_nsRemoveElementObj(), fsc_nsElement::GetFullPath(), log_FUNC_m, m_filePath, m_mediumKey, m_medVolData, m_medVolNum, m_output, m_pathCounter, fsc_MediaPosition_t::mediaKey, fsc_MediaPosition_t::medVolNum, and NULL.
00071 { 00072 log_FUNC_m(ProcRecMedPosMgr); 00073 if ( m_mediumKey != 0 ) { 00074 if (m_mediumKey != a_medPos.mediaKey 00075 || (m_medVolNum != 0 00076 && m_medVolNum != a_medPos.medVolNum)) { 00077 return true; // skip, not proper volume 00078 } 00079 } 00080 m_pathCounter++; 00081 00082 if (m_filePath.empty()) { 00083 fsc_nsElement *nsElement = fsc_nsCreateElementObj(m_medVolData.fileID); 00084 nsElement->GetFullPath(m_filePath); 00085 if (nsElement != NULL) { 00086 fsc_nsRemoveElementObj(nsElement); 00087 } 00088 } 00089 m_output << (int)a_medPos.medVolNum << " " << m_medVolData.fileID << " " << m_filePath << endl; 00090 00091 return true; 00092 }

| ivd_RecordIDX_t fsc_RawMedVolPathCollector::GetFileID | ( | void | ) | [inline] |
Reimplemented from fsc_RawCollector.
Definition at line 43 of file fsc_RawMedVolPathCollector.h.
00043 { return m_medVolData.fileID;};
| const cmn_Path fsc_RawMedVolPathCollector::GetFileName | ( | const string & | a_partName, | |
| ivd_MediaKey_t | a_mediaKey | |||
| ) | [private] |
Definition at line 95 of file fsc_RawMedVolPathCollector.cpp.
References cmn_Global::dirs, g_cmn, ivd_Directories::log, and snprintf.
Referenced by fsc_RawMedVolPathCollector().
00096 { 00097 char sMediaKey[16]; 00098 00099 // file name is compound of files-on-med<mediakey>-<part-name>.txt 00100 // example: "files-on-med000000001-cosmos.txt" 00101 snprintf(sMediaKey , 16, "%09d", a_mediaKey); 00102 return g_cmn.dirs.log + (string("files-on-med") + sMediaKey + "-" + a_partName + ".txt"); 00103 }

to collect each split info
Definition at line 52 of file fsc_RawMedVolPathCollector.h.
Referenced by ProcFileID(), and ProcRecMedPosMgr().
when medium key is set then get filePath too and collect only particular medium and volume if set othervice all volumes from medium.
Definition at line 59 of file fsc_RawMedVolPathCollector.h.
Referenced by fsc_RawMedVolPathCollector(), and ProcRecMedPosMgr().
string fsc_RawMedVolPathCollector::m_filePath [private] |
Definition at line 61 of file fsc_RawMedVolPathCollector.h.
Referenced by ProcFileID(), and ProcRecMedPosMgr().
ofstream fsc_RawMedVolPathCollector::m_output [private] |
Definition at line 62 of file fsc_RawMedVolPathCollector.h.
Referenced by fsc_RawMedVolPathCollector(), ProcRecMedPosMgr(), and ~fsc_RawMedVolPathCollector().
1.5.6