aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/example_contents.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-16 00:16:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-16 00:16:26 +0000
commitba066f45df8b0ee431f8f836b6ad789428132828 (patch)
treee4738aa7fee81bed9db67d10d60fa34ea94ff41d /doc/api/cplusplus/examples/example_contents.cc
parentca35d755e3758ea2a6e96c8640182af2f809ae45 (diff)
downloadpaludis-ba066f45df8b0ee431f8f836b6ad789428132828.tar.gz
paludis-ba066f45df8b0ee431f8f836b6ad789428132828.tar.xz
Give contents entries metadata keys.
This lets us remove the horrible ExtraInfo hack from the unmerger. Whilst we're at it, stop tracking fifo / dev / misc and just have an 'other' contents type.
Diffstat (limited to 'doc/api/cplusplus/examples/example_contents.cc')
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index 2aa398f65..b2ad342ba 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -32,35 +32,27 @@ namespace
class ContentsPrinter
{
public:
- void visit(const ContentsDevEntry & d)
- {
- cout << left << setw(10) << "device" << d.name() << endl;
- }
-
- void visit(const ContentsMiscEntry & d)
- {
- cout << left << setw(10) << "misc" << d.name() << endl;
- }
-
void visit(const ContentsFileEntry & d)
{
- cout << left << setw(10) << "file" << d.name() << endl;
+ cout << left << setw(10) << "file" << d.location_key()->value() << endl;
}
void visit(const ContentsDirEntry & d)
{
- cout << left << setw(10) << "dir" << d.name() << endl;
+ cout << left << setw(10) << "dir" << d.location_key()->value() << endl;
}
- void visit(const ContentsFifoEntry & d)
+ void visit(const ContentsSymEntry & d)
{
- cout << left << setw(10) << "fifo" << d.name() << endl;
+ cout << left << setw(10) << "sym" << d.location_key()->value()
+ << " -> " << d.target_key()->value() << endl;
}
- void visit(const ContentsSymEntry & d)
+ void visit(const ContentsOtherEntry & d)
{
- cout << left << setw(10) << "sym" << d.name() << " -> " << d.target() << endl;
+ cout << left << setw(10) << "other" << d.location_key()->value() << endl;
}
+
};
}