author | truebrain |
Sat, 07 Jun 2008 23:05:36 +0000 | |
branch | noai |
changeset 10853 | 87f2238f47d4 |
parent 10734 | 06f95974ac15 |
permissions | -rw-r--r-- |
10212
1e0a2a182253
(svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents:
9825
diff
changeset
|
1 |
/* $Id$ */ |
1e0a2a182253
(svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents:
9825
diff
changeset
|
2 |
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */ |
1e0a2a182253
(svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents:
9825
diff
changeset
|
3 |
|
9825
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
4 |
#include "ai_date.hpp" |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
5 |
|
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
6 |
namespace SQConvert { |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
7 |
/* Allow AIDate to be used as Squirrel parameter */ |
10734
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
8 |
template <> AIDate *GetParam(ForceType<AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIDate *)instance; } |
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
9 |
template <> AIDate &GetParam(ForceType<AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; } |
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
10 |
template <> const AIDate *GetParam(ForceType<const AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIDate *)instance; } |
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
11 |
template <> const AIDate &GetParam(ForceType<const AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; } |
9825
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
12 |
template <> int Return<AIDate *>(HSQUIRRELVM vm, AIDate *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIDate", res, NULL, DefSQDestructorCallback<AIDate>); return 1; } |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
13 |
}; // namespace SQConvert |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
14 |
|
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
15 |
void SQAIDate_Register(Squirrel *engine) { |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
16 |
DefSQClass <AIDate> SQAIDate("AIDate"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
17 |
SQAIDate.PreRegister(engine); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
18 |
SQAIDate.AddConstructor<void (AIDate::*)(), 1>(engine, "x"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
19 |
|
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
20 |
SQAIDate.DefSQStaticMethod(engine, &AIDate::GetClassName, "GetClassName", 1, "x"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
21 |
SQAIDate.DefSQStaticMethod(engine, &AIDate::GetCurrentDate, "GetCurrentDate", 1, "x"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
22 |
SQAIDate.DefSQStaticMethod(engine, &AIDate::GetYear, "GetYear", 2, "xi"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
23 |
SQAIDate.DefSQStaticMethod(engine, &AIDate::GetMonth, "GetMonth", 2, "xi"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
24 |
SQAIDate.DefSQStaticMethod(engine, &AIDate::GetDayOfMonth, "GetDayOfMonth", 2, "xi"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
25 |
SQAIDate.DefSQStaticMethod(engine, &AIDate::GetDate, "GetDate", 4, "xiii"); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
26 |
|
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
27 |
SQAIDate.PostRegister(engine); |
cc77111ebd85
(svn r12437) [NoAI] -Add: functions to get the current date and to determine the year/month/day from that date.
rubidium
parents:
diff
changeset
|
28 |
} |