version 1.22, 2004/06/03 15:04:54
|
version 1.23, 2004/06/22 22:06:23
|
|
|
// | // |
// Modified By: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) | // Modified By: Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
// Amit K Arora, IBM (amita@in.ibm.com) for PEP#101 | // Amit K Arora, IBM (amita@in.ibm.com) for PEP#101 |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
Boolean Tracer::isValidFileName(const char* filePath) | Boolean Tracer::isValidFileName(const char* filePath) |
{ | { |
|
String moduleName = _getInstance()->_moduleName; |
|
if (moduleName == String::EMPTY) |
|
{ |
return (_getInstance()->_traceHandler->isValidFilePath(filePath)); | return (_getInstance()->_traceHandler->isValidFilePath(filePath)); |
} | } |
|
else |
|
{ |
|
String extendedFilePath = String(filePath) + "." + moduleName; |
|
return (_getInstance()->_traceHandler->isValidFilePath( |
|
extendedFilePath.getCString())); |
|
} |
|
} |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
//Validate the trace components | //Validate the trace components |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
Boolean Tracer::isValidComponents(const String traceComponents) |
Boolean Tracer::isValidComponents(const String& traceComponents) |
{ | { |
String invalidComponents; | String invalidComponents; |
return isValidComponents(traceComponents, invalidComponents); | return isValidComponents(traceComponents, invalidComponents); |
} | } |
| |
Boolean Tracer::isValidComponents( | Boolean Tracer::isValidComponents( |
const String traceComponents, String& invalidComponents) |
const String& traceComponents, String& invalidComponents) |
{ | { |
// Validate the trace components and modify the traceComponents argument | // Validate the trace components and modify the traceComponents argument |
// to reflect the invalid components | // to reflect the invalid components |
|
|
} | } |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
|
//Set the name of the module being traced |
|
//////////////////////////////////////////////////////////////////////////////// |
|
void Tracer::setModuleName(const String& moduleName) |
|
{ |
|
_getInstance()->_moduleName = moduleName; |
|
} |
|
|
|
//////////////////////////////////////////////////////////////////////////////// |
//Returns the Singleton instance of the Tracer | //Returns the Singleton instance of the Tracer |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
Tracer* Tracer::_getInstance() | Tracer* Tracer::_getInstance() |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
Uint32 Tracer::setTraceFile(const char* traceFile) | Uint32 Tracer::setTraceFile(const char* traceFile) |
{ | { |
|
String moduleName = _getInstance()->_moduleName; |
|
if (moduleName == String::EMPTY) |
|
{ |
return (_getInstance()->_traceHandler->setFileName (traceFile)); | return (_getInstance()->_traceHandler->setFileName (traceFile)); |
} | } |
|
else |
|
{ |
|
String extendedTraceFile = String(traceFile) + "." + moduleName; |
|
return (_getInstance()->_traceHandler->setFileName( |
|
extendedTraceFile.getCString())); |
|
} |
|
} |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
//Set the trace level | //Set the trace level |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// Set components to be traced. | // Set components to be traced. |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
void Tracer::setTraceComponents( const String traceComponents ) |
void Tracer::setTraceComponents(const String& traceComponents) |
{ | { |
Uint32 position = 0; | Uint32 position = 0; |
Uint32 index = 0; | Uint32 index = 0; |