From 4ea2cc3bd4a7d9b1c54a9d33e6a1cf82e7c8c21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 09:06:59 +0200 Subject: Imported Upstream version 0.18.1 --- .../shotwell-data-imports/FSpotPhotoTagsTable.vala | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 plugins/shotwell-data-imports/FSpotPhotoTagsTable.vala (limited to 'plugins/shotwell-data-imports/FSpotPhotoTagsTable.vala') diff --git a/plugins/shotwell-data-imports/FSpotPhotoTagsTable.vala b/plugins/shotwell-data-imports/FSpotPhotoTagsTable.vala new file mode 100644 index 0000000..7d65594 --- /dev/null +++ b/plugins/shotwell-data-imports/FSpotPhotoTagsTable.vala @@ -0,0 +1,57 @@ +/* Copyright 2011-2014 Yorba Foundation + * + * This software is licensed under the GNU Lesser General Public License + * (version 2.1 or later). See the COPYING file in this distribution. + */ + +namespace DataImports.FSpot.Db { + +/** + * The value object for the "photo_tags" table, representing a single database row. + */ +public class FSpotPhotoTagRow : Object { + public int64 photo_id; + public int64 tag_id; +} + +/** + * This class represents the F-Spot photo_tags table. + */ +public class FSpotPhotoTagsTable : FSpotDatabaseTable { + public static const string TABLE_NAME = "Photo_Tags"; + + public FSpotPhotoTagsTable(Sqlite.Database db, FSpotDatabaseBehavior db_behavior) { + base(db); + set_behavior(db_behavior.get_photo_tags_behavior()); + } +} + +public class FSpotPhotoTagsV0Behavior : FSpotTableBehavior, Object { + private static FSpotPhotoTagsV0Behavior instance; + + private FSpotPhotoTagsV0Behavior() { + } + + public static FSpotPhotoTagsV0Behavior get_instance() { + if (instance == null) + instance = new FSpotPhotoTagsV0Behavior(); + return instance; + } + + public string get_table_name() { + return FSpotPhotoTagsTable.TABLE_NAME; + } + + public string[] list_columns() { + return { "photo_id", "tag_id" }; + } + + public void build_row(Sqlite.Statement stmt, out FSpotPhotoTagRow row, int offset = 0) { + row = new FSpotPhotoTagRow(); + row.photo_id = stmt.column_int64(offset + 0); + row.tag_id = stmt.column_int64(offset + 1); + } +} + +} + -- cgit v1.2.3