USGS

Isis 3.0 Application Source Code Reference

Home

catlab.cpp

Go to the documentation of this file.
00001 #include "Isis.h"
00002 
00003 #include <iostream>
00004 
00005 #include "Filename.h"
00006 #include "Pvl.h"
00007 #include "UserInterface.h"
00008 
00009 using namespace Isis;
00010 using namespace std;
00011 
00012 
00013 void IsisMain() {
00014 
00015   // Get filename provided by the user
00016   UserInterface &ui = Application::GetUserInterface();
00017   string file = ui.GetFilename("FROM");
00018   
00019   // Extract label from file
00020   Pvl label(file);
00021 
00022   // Output to file if entered
00023   if(ui.WasEntered("TO")) {
00024     if (ui.GetBoolean("APPEND")) {
00025       label.Append(Filename(ui.GetFilename("TO")).Expanded());
00026     }
00027     else {
00028       label.Write(Filename(ui.GetFilename("TO")).Expanded());
00029     }
00030   }
00031 
00032   // Print label to the gui log if it is interactive
00033   else if(ui.IsInteractive()) {
00034     Application::GuiLog(label);
00035   }
00036 
00037   // Print label to the screen if it is not
00038   else {
00039     cout << label << endl;
00040   }
00041 
00042 }
00043 
00044