MCPcopy Create free account
hub / github.com/bruderstein/nppPluginManager / parseString

Method parseString

pluginManager/src/PluginVersion.cpp:165–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164
165void PluginVersion::parseString(const char *version)
166{
167
168 if (NULL != _displayString)
169 {
170 delete[] _displayString;
171 _displayString = NULL;
172 }
173
174 size_t versionSize = strlen(version) + 1;
175 char* versionCopy = new char[versionSize];
176 strcpy_s(versionCopy, versionSize, version);
177
178 char* context;
179 char* versionPart = strtok_s(versionCopy, ",.", &context);
180
181 _major = _minor = _revision = _build = 0;
182
183 if (versionPart)
184 {
185 StrTrimA(versionPart, " ");
186 _major = atoi(versionPart);
187
188 versionPart = strtok_s(NULL, ",.", &context);
189 if (versionPart)
190 {
191 StrTrimA(versionPart, " ");
192 _minor = atoi(versionPart);
193
194 versionPart = strtok_s(NULL, ",.", &context);
195 if (versionPart)
196 {
197 StrTrimA(versionPart, " ");
198 _revision = atoi(versionPart);
199
200 versionPart = strtok_s(NULL, ",.", &context);
201 if (versionPart)
202 {
203 StrTrimA(versionPart, " ");
204 _build = atoi(versionPart);
205 }
206 }
207 }
208 }
209 delete[] versionCopy;
210}
211
212
213#ifdef _UNICODE

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected