15 #include "pal_string_utils.h" 17 #include "pnmFileType.h" 18 #include "pnmFileTypeRegistry.h" 24 extract_param_value(
const string &str,
string ¶m,
string &value) {
28 while (i < str.length() && isspace(str[i])) {
35 while (i < str.length() && !isspace(str[i])) {
41 param = str.substr(start, end - start);
44 while (i < str.length() && isspace(str[i])) {
47 value = trim_right(str.substr(i));
52 parse_image_type_request(
const string &word,
PNMFileType *&color_type,
58 string color_name = word;
60 size_t comma = word.find(
',');
61 if (comma != string::npos) {
64 color_name = word.substr(0, comma);
65 alpha_name = word.substr(comma + 1);
68 if (!color_name.empty()) {
71 nout <<
"Image file type '" << color_name <<
"' is unknown.\n";
76 if (!alpha_name.empty()) {
79 nout <<
"Image file type '" << alpha_name <<
"' is unknown.\n";
This is the base class of a family of classes that represent particular image file types that PNMImag...
static PNMFileTypeRegistry * get_global_ptr()
Returns a pointer to the global PNMFileTypeRegistry object.
PNMFileType * get_type_from_extension(const string &filename) const
Tries to determine what the PNMFileType is likely to be for a particular image file based on its exte...
This class maintains the set of all known PNMFileTypes in the universe.