1 /* 2 * Copyright 2011, Oliver Tappe <zooey@hirschkaefer.de> 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <package/hpkg/RepositoryReader.h> 8 9 #include <new> 10 11 #include <package/hpkg/ErrorOutput.h> 12 #include <package/hpkg/RepositoryContentHandler.h> 13 #include <package/hpkg/RepositoryReaderImpl.h> 14 15 16 namespace BPackageKit { 17 18 namespace BHPKG { 19 20 21 BRepositoryReader::BRepositoryReader(BErrorOutput* errorOutput) 22 : 23 fImpl(new (std::nothrow) RepositoryReaderImpl(errorOutput)) 24 { 25 } 26 27 28 BRepositoryReader::~BRepositoryReader() 29 { 30 delete fImpl; 31 } 32 33 34 status_t 35 BRepositoryReader::Init(const char* fileName) 36 { 37 if (fImpl == NULL) 38 return B_NO_INIT; 39 40 return fImpl->Init(fileName); 41 } 42 43 44 status_t 45 BRepositoryReader::ParseContent(BRepositoryContentHandler* contentHandler) 46 { 47 if (fImpl == NULL) 48 return B_NO_INIT; 49 50 return fImpl->ParseContent(contentHandler); 51 } 52 53 54 } // namespace BHPKG 55 56 } // namespace BPackageKit 57