////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Datacard Corporation.  All Rights Reserved.
//
// commandline switch values for 'Print' XPS Driver SDK sample
////////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include <iostream>
#include <sstream>
#include "kiosk.h"
#include "CommandLineOptions.h"
#include "DXP01SDK.H"

using namespace std;

CommandLineOptions::CommandLineOptions() : 
  jobCompletion(false)
, emboss(false)
, hopperID(TEXT(""))
, cardEjectSide(TEXT(""))
, outputHopperLocation(TEXT(""))
{}

void CommandLineOptions::Validate()
{
    if (printerName.IsEmpty()) {
        usage();
    }

    // if hopperID is an empty string, that is OK
    if (hopperID != L"") {
        if (
            hopperID != L"1" &&
            hopperID != L"2" &&
            hopperID != L"3" &&
            hopperID != L"4" &&
            hopperID != L"5" &&
            hopperID != L"6" &&
            hopperID != L"r1" &&
            hopperID != L"exception") 
        {
            cout << "invalid hopperID: " << CW2A(hopperID) << endl;
            ::exit(-1);
        }
    }

    // if cardEjectSide is an empty string, that is OK
    if (cardEjectSide != L"") {
        if (
            cardEjectSide != L"front" &&
            cardEjectSide != L"back" && 
            cardEjectSide != L"Default") {
            cout << "invalid cardEjectSide: " << CW2A(cardEjectSide) << endl;
            ::exit(-1);
        }
    }
}