/*
* ArgList.h
* Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// SOL9
// 2009/09/24
#pragma once
#include <sol/Object.h>
#include <sol/Arg.h>
namespace SOL {
class ArgList :public Object {
private:
const Arg* arg;
private:
const size_t count;
public:
/**
* Constructor
*/
ArgList(const Arg* argList, size_t size)
:arg(argList), //Shallow pointer copy for Arg array.
count(size)
{
if (arg == NULL || size <=0) {
throw ERROR_BAD_ARGUMENTS;
}
}
public:
const TCHAR* getName(int value)
{
const TCHAR* name = _T("");
if (arg) {
for (size_t i = 0; i<count; i++) {
if(arg[i].value == value) {
name = arg[i].name;
break;
}
}
}
return name;
}
};
}
|