38 #include <boost/filesystem/path.hpp>
39 #include <boost/filesystem/convenience.hpp>
40 #include <boost/algorithm/string/trim.hpp>
41 #include <boost/algorithm/string/predicate.hpp>
42 #include <boost/algorithm/string/split.hpp>
62 struct _xsltStylesheet;
108 #define ByteSwap5(x) ByteSwap((unsigned char *) &x,sizeof(x))
109 void ByteSwap(
unsigned char * b,
int n);
163 inline void ltrim(std::string &s) {
164 s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](
int ch) {
165 return !std::isspace(ch);
170 inline void rtrim(std::string &s) {
171 s.erase(std::find_if(s.rbegin(), s.rend(), [](
int ch) {
172 return !std::isspace(ch);
177 inline void trim(std::string &s) {
183 inline std::string ltrim_copy(std::string s) {
189 inline std::string rtrim_copy(std::string s) {
195 inline std::string trim_copy(std::string s) {
201 inline std::string str_toupper(std::string s) {
202 std::transform(s.begin(), s.end(), s.begin(), [](
unsigned char c) {
return std::toupper(
c); });
207 inline std::string str_tolower(std::string s) {
208 std::transform(s.begin(), s.end(), s.begin(), [](
unsigned char c) {
return std::tolower(
c); });
214 inline void strsplit(
const std::string &str,
char delim, std::vector<std::string> &result) {
215 std::stringstream ss(str);
217 while(std::getline(ss,token,delim)) {
218 result.push_back(token);
223 inline bool file_exists(
const std::string &filename) {
225 return (stat(filename.c_str(),&statbuf)==0);
244 static std::string
version (
const std::string& asdmPath);
245 static std::vector<std::string>
telescopeNames(
const std::string& asdmPath);
247 static std::vector<std::string>
xmlFilenames(
const std::string& asdmPath);
253 #ifndef WITHOUT_BOOST
258 void operator() ( boost::filesystem::directory_entry& p);
432 return "XSLTransformerException : " +
message;
494 std::string
operator()(
const std::string& xmlPath);
ASDMParseOptions & asALMA()
This is an ALMA dataset.
std::string toString() const
static const ByteOrder * Machine_Endianity
static std::string version(const std::string &asdmPath)
A class to define a collection of options regarding the way to consider an ASDM dataset especially wh...
static std::set< std::string > almaValidNames
static std::string pathToV2V3ALMAxslTransform()
Functor class of for a comparison between a "given" character and a characted assumed to be read in a...
static std::string nameOfV2V3xslTransform(ASDMUtils::Origin origin)
std::string toString() const
Returns a string representation of this.
Functor class of for a comparison between a "given" character and a characted assumed to be read from...
A class to represent byte order information.
static const ByteOrder * Little_Endian
TableExprNode ltrim(const TableExprNode &node)
The ASDM class is the container for all tables.
DotXMLFilter(std::vector< std::string > &filenames)
static Origin origin(const std::vector< std::string > &telescopeNames)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
ASDMParseOptions & checkRowUniqueness(bool b)
Determines if a control of the uniqueness is performed (b==true) or not (b==false) for each row of ea...
ASDMParseOptions()
A null constructor.
CharComparator(std::ifstream *is_p=NULL, off_t limit=0)
ASDMParseOptions & asEVLA()
This is an EVLA dataset.
ASDMParseOptions & loadTablesOnDemand(bool b)
Load all the tables in memory or only those which are required by the code.
std::string * accumulator_p
TableExprNode rtrim(const TableExprNode &node)
static const ByteOrder * fromString(const std::string &s)
Convert a string to a const ByteOrder*.
static const ByteOrder * machineEndianity()
ASDMParseOptions & operator=(const ASDMParseOptions &rhs)
= operator.
static std::map< ASDMUtils::Origin, std::string > filenameOfV2V3xslTransform
std::string path(const std::string &name)
TableExprNode trim(const TableExprNode &node)
friend std::ostream & operator<<(std::ostream &output, const ASDMParseOptions &p)
Defines how an instance of ASDMParseOptions is output on an ostream.
static std::vector< std::string > telescopeNames(const std::string &asdmPath)
bool operator()(char cl, char cr)
bool createDirectory(const char *dir)
Creates the specified directory.
ByteOrder(const std::string &name)
static std::string pathToV2V3EVLAxslTransform()
void ByteSwap(unsigned char *b, int n)
static bool hasChild(xmlDocPtr, xmlNodePtr node, const xmlChar *childName)
ASDMParseOptions & asIRAM_PDB()
This is an IRAM / Plateau de Bure dataset.
ASDMUtils::Origin origin_
static std::vector< std::string > xmlFilenames(const std::string &asdmPath)
bool operator()(char cl, char cr)
Returns true when tpupper(cl) is equal to cr or when the read head position in is_p is >= limit...
bool createPath(const char *path)
Creates a complete path.
static std::map< std::string, std::string > rootSubdir
bool directoryExists(const char *dir)
Some utility methods to manipulate directories.
const std::string & getMessage()
static std::string parseRow(xmlDocPtr, xmlNodePtr node, const xmlChar *childName)
std::vector< std::string > * filenames
const Double c
Fundamental physical constants (SI units):
CharCompAccumulator(std::string *accumulator_p=NULL, std::ifstream *is_p=NULL, off_t limit=0)
The constructor.
xsltStylesheet * xsltStylesheetPtr
ASDMParseOptions & asV3()
This is a V3 dataset.
void operator()(boost::filesystem::directory_entry &p)
void operator() (path& p);
static const ByteOrder * Big_Endian
int xmlLoadExtDtdDefaultValue
static std::string pathToxslTransform(const std::string &xsltFilename)
virtual ~ASDMParseOptions()
The destructor.
static std::set< std::string > evlaValidNames
ASDMParseOptions & asV2()
This is a V2 dataset.
std::string uniqSlashes(const std::string &s)
Return a string whose content is equal to the content of s but with all the repetitions of '/' charac...
struct _xsltStylesheet xsltStylesheet
transform(a.begin(), a.end(), std::ostream_iterator< int >(cout,"\n"), compose(unary(h), compose(unary(f), unary(f))))
Global Functions.