------------------------------------------------------------------------------
| 84 | |
| 85 | //------------------------------------------------------------------------------ |
| 86 | static void ReadStringVersion(const char* version, int& major, int& minor) |
| 87 | { |
| 88 | if (!version) |
| 89 | { |
| 90 | major = -1; |
| 91 | minor = -1; |
| 92 | return; |
| 93 | } |
| 94 | // Extract the major and minor version numbers. |
| 95 | size_t length = strlen(version); |
| 96 | const char* begin = version; |
| 97 | const char* end = version + length; |
| 98 | const char* s; |
| 99 | |
| 100 | for (s = begin; (s != end) && (*s != '.'); ++s) |
| 101 | { |
| 102 | } |
| 103 | |
| 104 | if (s > begin) |
| 105 | { |
| 106 | std::stringstream str; |
| 107 | str.write(begin, s - begin); |
| 108 | str >> major; |
| 109 | if (!str) |
| 110 | { |
| 111 | major = 0; |
| 112 | } |
| 113 | } |
| 114 | if (++s < end) |
| 115 | { |
| 116 | std::stringstream str; |
| 117 | str.write(s, end - s); |
| 118 | str >> minor; |
| 119 | if (!str) |
| 120 | { |
| 121 | minor = 0; |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | vtkCxxSetObjectMacro(vtkXMLReader, InputArray, vtkCharArray); |
| 127 |
no test coverage detected