79 lines
1007 B
C++
Executable File
79 lines
1007 B
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfile_winix_plugins_ticket_ticket
|
|
#define headerfile_winix_plugins_ticket_ticket
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <algorithm>
|
|
|
|
|
|
namespace Ticket
|
|
{
|
|
|
|
struct Ticket
|
|
{
|
|
struct TicketParam
|
|
{
|
|
long param;
|
|
long intv;
|
|
std::wstring decv; // !! temporarily as a string (in the future there'll be a Dec type from ttmath)
|
|
|
|
void Clear()
|
|
{
|
|
param = 0;
|
|
intv = 0;
|
|
decv.clear();
|
|
}
|
|
|
|
TicketParam()
|
|
{
|
|
Clear();
|
|
}
|
|
};
|
|
|
|
long file_id;
|
|
typedef std::vector<TicketParam> ParTab;
|
|
ParTab par_tab;
|
|
|
|
|
|
Ticket()
|
|
{
|
|
Clear();
|
|
}
|
|
|
|
void Clear()
|
|
{
|
|
file_id = -1;
|
|
par_tab.clear();
|
|
}
|
|
|
|
|
|
struct Sort
|
|
{
|
|
bool operator()(const TicketParam & par1, const TicketParam & par2)
|
|
{
|
|
return par1.param < par2.param;
|
|
}
|
|
};
|
|
|
|
|
|
void SortParTab()
|
|
{
|
|
std::sort(par_tab.begin(), par_tab.end(), Sort());
|
|
}
|
|
};
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
#endif
|