diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-06-05 13:05:30 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-06-05 13:15:55 +0200 |
commit | d59671c9eef322c10abba22b0257fef37979dfd4 (patch) | |
tree | 5bfa714f18136ca6bd7a488e2dcecae14a1f26c1 /apt-pkg/edsp/edspindexfile.cc | |
parent | 382704d532b9a02237fe5706592858bbffec3862 (diff) |
refactor EDSP classes for better internal reuse
The classes are all marked as hidden, so changing them is no problem ABI
wise and will help with introducing protocols similar to EDSP.
The change has no observeable behavior difference, its just code
juggling.
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/edsp/edspindexfile.cc')
-rw-r--r-- | apt-pkg/edsp/edspindexfile.cc | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 4e0f9c26a..e2863a2cc 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -21,31 +21,27 @@ #include <string> /*}}}*/ -// EDSP Index /*{{{*/ -edspIndex::edspIndex(std::string const &File) : pkgDebianIndexRealFile(File, true), d(NULL) +// EDSP-like Index /*{{{*/ +edspLikeIndex::edspLikeIndex(std::string const &File) : pkgDebianIndexRealFile(File, true) { } -std::string edspIndex::GetComponent() const -{ - return "edsp"; -} -std::string edspIndex::GetArchitecture() const +std::string edspLikeIndex::GetArchitecture() const { return std::string(); } -bool edspIndex::HasPackages() const +bool edspLikeIndex::HasPackages() const { return true; } -bool edspIndex::Exists() const +bool edspLikeIndex::Exists() const { return true; } -uint8_t edspIndex::GetIndexFlags() const +uint8_t edspLikeIndex::GetIndexFlags() const { return 0; } -bool edspIndex::OpenListFile(FileFd &Pkg, std::string const &FileName) +bool edspLikeIndex::OpenListFile(FileFd &Pkg, std::string const &FileName) { if (FileName.empty() == false && FileName != "/nonexistent/stdin") return pkgDebianIndexRealFile::OpenListFile(Pkg, FileName); @@ -53,6 +49,15 @@ bool edspIndex::OpenListFile(FileFd &Pkg, std::string const &FileName) return _error->Error("Problem opening %s",FileName.c_str()); return true; } + /*}}}*/ +// EDSP Index /*{{{*/ +edspIndex::edspIndex(std::string const &File) : edspLikeIndex(File) +{ +} +std::string edspIndex::GetComponent() const +{ + return "edsp"; +} pkgCacheListParser * edspIndex::CreateListParser(FileFd &Pkg) { if (Pkg.IsOpen() == false) @@ -84,4 +89,5 @@ const pkgIndexFile::Type *edspIndex::GetType() const } /*}}}*/ +edspLikeIndex::~edspLikeIndex() {} edspIndex::~edspIndex() {} |