#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #include "Nuclex/Storage/FileSystem/FileManager.h" #include "Nuclex/Storage/FileSystem/Container.h" #include "Nuclex/Storage/FileSystem/File.h" #include // --------------------------------------------------------------------------------------------- // int main() { using Nuclex::Storage::FileSystem::FileManager; using Nuclex::Storage::FileSystem::Container; using Nuclex::Storage::FileSystem::File; std::shared_ptr fileManager( FileManager::CreateSystemDefault("Nuclex.Storage.Demo.Native") ); const Container &installContainer = fileManager->GetInstallContainer(); // Random access to data in a zip archive { std::shared_ptr zipContainer = installContainer.GetContainer("PlainZip.zip"); std::shared_ptr file = zipContainer->GetFile("Deflate.txt"); std::vector message(file->GetSize()); file->ReadAt(0, &message[0], file->GetSize()); } // Random access to data in a 7-Zip archive { std::shared_ptr sevenZipContainer = installContainer.GetContainer("SevenZip.7z"); std::shared_ptr file = sevenZipContainer->GetFile("DeflateA.txt"); std::vector message(file->GetSize()); file->ReadAt(0, &message[0], file->GetSize()); } return 0; } // --------------------------------------------------------------------------------------------- //