bool FileMessageHandler::ReadFile(const list<Path>& lps, POVMS_Object& msg, POVMS_Object& result) { Path path(FindFilePath(lps, Path(msg.GetUCS2String(kPOVAttrib_ReadFile)))); if(path.Empty() == false) result.SetUCS2String(kPOVAttrib_LocalFile, path().c_str()); return (path.Empty() == false); }
bool FileMessageHandler::FindFile(const list<Path>& lps, POVMS_Object& msg, POVMS_Object& result) { POVMS_List files; Path path; msg.Get(kPOVAttrib_ReadFile, files); for(int i = 1; i <= files.GetListSize(); i++) { POVMS_Attribute attr; files.GetNth(i, attr); path = FindFilePath(lps, Path(attr.GetUCS2String())); if(path.Empty() == false) break; } result.SetUCS2String(kPOVAttrib_ReadFile, path().c_str()); return (path.Empty() == false); }