summaryrefslogtreecommitdiff
path: root/ppdc/testcatalog.cxx
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-07-03 05:38:29 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-07-03 05:38:29 +0000
commit4509bb49335b3edfdb1b03d83d6cd05890968b59 (patch)
treeddaed95be285a8c010203ca908b7ebeb66056cc2 /ppdc/testcatalog.cxx
parent75bd9771f6e44fdd887ee90faac46f403aefc0fc (diff)
Merge changes from CUPS 1.4svn-r7715.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@834 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'ppdc/testcatalog.cxx')
-rw-r--r--ppdc/testcatalog.cxx63
1 files changed, 63 insertions, 0 deletions
diff --git a/ppdc/testcatalog.cxx b/ppdc/testcatalog.cxx
new file mode 100644
index 000000000..808738d90
--- /dev/null
+++ b/ppdc/testcatalog.cxx
@@ -0,0 +1,63 @@
+//
+// "$Id$"
+//
+// Test program for message catalog class.
+//
+// Copyright 2008 by Apple Inc.
+//
+// These coded instructions, statements, and computer programs are the
+// property of Apple Inc. and are protected by Federal copyright
+// law. Distribution and use rights are outlined in the file "LICENSE.txt"
+// which should have been included with this file. If this file is
+// file is missing or damaged, see the license at "http://www.cups.org/".
+//
+// Contents:
+//
+// main() - Open a message catalog
+//
+
+//
+// Include necessary headers...
+//
+
+#include "ppdc.h"
+
+
+//
+// 'main()' - Open a message catalog
+//
+
+int // O - Exit status
+main(int argc, // I - Number of command-line arguments
+ char *argv[]) // I - Command-line arguments
+{
+ ppdcCatalog *catalog; // Message catalog
+ ppdcMessage *m; // Current message
+
+
+ if (argc != 2)
+ {
+ puts("Usage: testcatalog filename");
+ return (1);
+ }
+
+ // Scan the command-line...
+ catalog = new ppdcCatalog(NULL, argv[1]);
+
+ printf("%s: %d messages\n", argv[1], catalog->messages->count);
+
+ for (m = (ppdcMessage *)catalog->messages->first();
+ m;
+ m = (ppdcMessage *)catalog->messages->next())
+ printf("%s: %s\n", m->id->value, m->string->value);
+
+ delete catalog;
+
+ // Return with no errors.
+ return (0);
+}
+
+
+//
+// End of "$Id$".
+//