summaryrefslogtreecommitdiff
path: root/samples/source/DumpScannedXMP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samples/source/DumpScannedXMP.cpp')
-rw-r--r--samples/source/DumpScannedXMP.cpp50
1 files changed, 12 insertions, 38 deletions
diff --git a/samples/source/DumpScannedXMP.cpp b/samples/source/DumpScannedXMP.cpp
index c8c5f94..37929c6 100644
--- a/samples/source/DumpScannedXMP.cpp
+++ b/samples/source/DumpScannedXMP.cpp
@@ -1,11 +1,16 @@
// =================================================================================================
-// Copyright 2002-2005 Adobe Systems Incorporated
+// Copyright 2002-2008 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
// of the Adobe license agreement accompanying it.
// =================================================================================================
+/**
+* Scans a data file to find all embedded XMP Packets, without using the smart handlers. If a packet is found,
+* serializes the XMP and writes it to log file.
+*/
+
#include <string>
#include <time.h>
@@ -143,44 +148,13 @@ main ( int argc, const char * argv [] )
return -1;
}
- if ( argc > 1 ) {
-
- printf ( "\n" );
- for ( int i = 1; i < argc; i++ ) ProcessFile ( argv[i] );
-
- } else {
-
- char fileNameBuffer[1025];
-
- while ( true ) {
-
- printf ( "\nFile: " );
- fgets( fileNameBuffer, sizeof(fileNameBuffer), stdin );
- string fileName ( fileNameBuffer );
-
- if ( fileName.empty() ) break;
-
- if ( (fileName[fileName.size()-1] == '\n') || (fileName[fileName.size()-1] == '\r') ) {
- fileName.erase ( fileName.size()-1, 1 ); // Remove eol, allowing for CRLF.
- if ( (fileName[fileName.size()-1] == '\n') || (fileName[fileName.size()-1] == '\r') ) {
- fileName.erase ( fileName.size()-1, 1 );
- }
- }
-
- if ( fileName == "." ) break;
-
- // Dragging an icon on Windows pastes a quoted path.
- if ( fileName[fileName.size()-1] == '"' ) fileName.erase ( fileName.size()-1, 1 );
- if ( fileName[0] == '"' ) fileName.erase ( 0, 1 );
-
- if ( ! fileName.empty() ) {
- printf ( "\n" );
- ProcessFile ( fileName.c_str() );
- }
-
- }
-
+ if ( argc != 2 ) // 2 := command and 1 parameter
+ {
+ printf ("usage: DumpScannedXMP (filename)\n");
+ return 0;
}
+
+ ProcessFile ( argv[1] );
SXMPMeta::Terminate();
return 0;