MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / LoadCache

Method LoadCache

src/FTPCache.cpp:216–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216FTPCache* FTPCache::LoadCache(const TiXmlElement * cacheElem) {
217 if (!cacheElem)
218 return NULL;
219
220 if ( strcmp(FTPCache::CacheElem, cacheElem->Value()) )
221 return NULL;
222
223 FTPCache * cache = new FTPCache();
224
225 const char * localpathstr = NULL;
226 const char * externalpathstr = NULL;
227 const TiXmlElement* child = cacheElem->FirstChildElement("Location");
228 for( ; child; child = child->NextSiblingElement("Location") )
229 {
230 localpathstr = child->Attribute("localpath");
231 if (!localpathstr)
232 continue;
233 TCHAR * localpath = SU::Utf8ToTChar(localpathstr);
234 if (!localpath)
235 continue;
236
237 externalpathstr = child->Attribute("externalpath");
238 if (!externalpathstr)
239 continue;
240
241 cache->AddPathMap(localpath, externalpathstr);
242 SU::FreeTChar(localpath);
243 }
244
245 return cache;
246}
247
248int FTPCache::AddPathMap(const TCHAR * localpath, const char * externalpath) {
249 if (localpath == 0 || externalpath == 0)

Callers

nothing calls this directly

Calls 5

AttributeMethod · 0.80
AddPathMapMethod · 0.80
ValueMethod · 0.45
FirstChildElementMethod · 0.45
NextSiblingElementMethod · 0.45

Tested by

no test coverage detected