misc_util.h
Go to the documentation of this file.
#ifndef _MISC_UTIL_
#define _MISC_UTIL_
#include <string>
#include <iostream>
#include <fstream>
#include <functional>
#include <rcsb/CifFile.h>
#include <rcsb/DataInfo.h>
#include <xercesc/sax2/SAX2XMLReader.hpp>
#include <xercesc/util/XMLString.hpp>
XERCES_CPP_NAMESPACE_USE
class StrX
{
public:
StrX(const XMLCh* const toTranscode)
{
fLocalForm = XMLString::transcode(toTranscode);
}
~StrX()
{
delete [] fLocalForm;
}
const char* localForm() const
{
return(fLocalForm);
}
private:
char* fLocalForm;
};
class IsLostChar : public std::unary_function<char, bool>
{
public:
bool operator() (char oneChar) const
{
if ((oneChar == '[') || (oneChar == ']'))
{
return(true);
}
return(false);
}
};
inline std::ostream& operator<<(std::ostream& target, const StrX& toDump)
{
target << toDump.localForm();
return(target);
}
string toString(const XMLCh* toConvert);
void Error(string& err);
void DeleteFile(const string& fileName);
void ResurrectOrigItemNames(CifFile& cifFile, DataInfo& dataInfo);
void CorrectEmptyValuesOfMandatoryItems(CifFile& cifFile, DataInfo& dataInfo);
#endif
IsLostChar
Definition: misc_util.h:44
StrX::StrX
StrX(const XMLCh *const toTranscode)
Definition: misc_util.h:23
IsLostChar::operator()
bool operator()(char oneChar) const
Definition: misc_util.h:47
operator<<
std::ostream & operator<<(std::ostream &target, const StrX &toDump)
Definition: misc_util.h:59
DataInfo
Definition: DataInfo.h:26
ResurrectOrigItemNames
void ResurrectOrigItemNames(CifFile &cifFile, DataInfo &dataInfo)
StrX
Definition: misc_util.h:20
DeleteFile
void DeleteFile(const string &fileName)
StrX::~StrX
~StrX()
Definition: misc_util.h:28
CorrectEmptyValuesOfMandatoryItems
void CorrectEmptyValuesOfMandatoryItems(CifFile &cifFile, DataInfo &dataInfo)
StrX::localForm
const char * localForm() const
Definition: misc_util.h:33
CifFile
Public class that represents a CIF file, composed of blocks with tables.
Definition: CifFile.h:47
Error
void Error(string &err)
toString
string toString(const XMLCh *toConvert)
DataInfo.h
CifFile.h
Header file for CifFile class.