3 #include "../../common/StringUtils.h" 4 #include "../../core/translator/Translator.h" 8 #include <boost/algorithm/string.hpp> 9 #include <boost/lexical_cast.hpp> 19 if(formatSplit.size() != 2)
24 std::string posfix = formatSplit[1];
26 if(boost::iequals(posfix,
"png"))
30 else if(boost::iequals(posfix,
"tiff"))
34 else if(boost::iequals(posfix,
"bmp"))
38 else if(boost::iequals(posfix,
"jpeg") || boost::iequals(posfix,
"jpg"))
50 if(epsgSplit.size() != 2)
55 std::string codeStr = epsgSplit[1];
57 int code = boost::lexical_cast<
int>(codeStr);
59 if(code < 4000 || code > 5000)
70 int rc = stat(filename.c_str(), &stat_buf);
71 return rc == 0 ? stat_buf.st_size : -1;
ImageType
This enum specifies the possible input and output image formats supported by the canvas API...
Utils of WS Core Runtime Library.
TECOMMONEXPORT std::vector< std::string > SplitString(const std::string &str, const char &delimiter)
TEWSCOREEXPORT bool IsInvertedEPSG(const std::string &epsg)
This function gets true for EPSGs that has inverted axis-order. Otherwise false. This implementation ...
#define TE_TR(message)
It marks a string in order to get translated.
TEWSCOREEXPORT long GetFileSize(const std::string &filename)
This function gets the size of a file, using C runtime stat struct that works on Windows, Mac and Linux.
TEWSCOREEXPORT te::map::ImageType FormatToImageType(const std::string &format)
This function gets an ImageType Enum according to an image format string (e.g. image/png).
boost::error_info< struct tag_error_description, std::string > ErrorDescription
The base type for error report messages.
Base exception class for WS Core Runtime Library.
Exception classes for the WS Core Runtime Library.