virtual std::wstring TextRepresentation() const { ScopedLock s; std::wstring textRepresentation; textRepresentation.reserve(100*KiB); DirectoryDescriptionR(textRepresentation, m_rootDirectory, 0); return textRepresentation; }
void DirectoryDescriptionR(std::wstring& descriptions, const VfsDirectory& directory, size_t indentLevel) { const std::wstring indentation(4*indentLevel, ' '); const VfsDirectory::VfsSubdirectories& subdirectories = directory.Subdirectories(); for(VfsDirectory::VfsSubdirectories::const_iterator it = subdirectories.begin(); it != subdirectories.end(); ++it) { const VfsPath& name = it->first; const VfsDirectory& subdirectory = it->second; descriptions += indentation; descriptions += std::wstring(L"[") + name.string() + L"]\n"; descriptions += FileDescriptions(subdirectory, indentLevel+1); DirectoryDescriptionR(descriptions, subdirectory, indentLevel+1); } }