mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-16 07:07:13 +02:00
Initial ZMQ bindings.
This commit is contained in:
@ -5,14 +5,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <Poco/Base32Encoder.h>
|
||||
#include <Poco/Base32Decoder.h>
|
||||
#include <Poco/Base64Encoder.h>
|
||||
#include <Poco/Base64Decoder.h>
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <Poco/Checksum.h>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
@ -240,7 +232,7 @@ static SQInteger SqGetADLER32(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_Crypto(HSQUIRRELVM vm)
|
||||
void Register_POCO_Crypto(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
Table ns(vm);
|
||||
|
||||
|
@ -4,7 +4,12 @@
|
||||
#include "Core/Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Poco/Crypto/DigestEngine.h"
|
||||
#include <Poco/Checksum.h>
|
||||
#include <Poco/Base32Encoder.h>
|
||||
#include <Poco/Base32Decoder.h>
|
||||
#include <Poco/Base64Encoder.h>
|
||||
#include <Poco/Base64Decoder.h>
|
||||
#include <Poco/Crypto/DigestEngine.h>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
@ -390,10 +390,10 @@ static void Register_POCO_Data_Binding(HSQUIRRELVM vm, Table & ns, const SQChar
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_Data(HSQUIRRELVM vm)
|
||||
void Register_POCO_Data(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
Table ns(vm);
|
||||
//Poco::Data::Keywords::into()
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
ns.Bind(_SC("Session"),
|
||||
Class< SqDataSession >(vm, SqPcDataSession::Str)
|
||||
|
@ -8,7 +8,7 @@ namespace SqMod {
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_JSON(HSQUIRRELVM vm)
|
||||
void Register_POCO_JSON(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
Table ns(vm);
|
||||
|
||||
|
@ -8,7 +8,7 @@ namespace SqMod {
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_Net(HSQUIRRELVM vm)
|
||||
void Register_POCO_Net(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
Table ns(vm);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "PocoLib/Foundation.hpp"
|
||||
#include "PocoLib/RegEx.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
@ -8,11 +8,11 @@ namespace SqMod {
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_Foundation(HSQUIRRELVM vm)
|
||||
void Register_POCO_RegEx(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
Table ns(vm);
|
||||
|
||||
RootTable(vm).Bind(_SC("SqPOCO"), ns);
|
||||
RootTable(vm).Bind(_SC("SqRegEx"), ns);
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
34
module/PocoLib/Register.cpp
Normal file
34
module/PocoLib/Register.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "PocoLib/Register.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
extern Register_POCO_Crypto(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_Data(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_JSON(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_Net(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_RegEx(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_Time(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_Util(HSQUIRRELVM vm, Table & ns);
|
||||
extern Register_POCO_XML(HSQUIRRELVM vm, Table & ns);
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO(HSQUIRRELVM vm)
|
||||
{
|
||||
Table ns(vm);
|
||||
|
||||
Register_POCO_Crypto(vm, ns);
|
||||
Register_POCO_Data(vm, ns);
|
||||
Register_POCO_JSON(vm, ns);
|
||||
Register_POCO_Net(vm, ns);
|
||||
Register_POCO_RegEx(vm, ns);
|
||||
Register_POCO_Time(vm, ns);
|
||||
Register_POCO_Util(vm, ns);
|
||||
Register_POCO_XML(vm, ns);
|
||||
|
||||
RootTable(vm).Bind(_SC("Sq"), ns);
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
11
module/PocoLib/Register.hpp
Normal file
11
module/PocoLib/Register.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Core/Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
|
||||
|
||||
} // Namespace:: SqMod
|
60
module/PocoLib/Time.cpp
Normal file
60
module/PocoLib/Time.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "PocoLib/Time.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQMOD_DECL_TYPENAME(SqClock, _SC("SqClock"))
|
||||
SQMOD_DECL_TYPENAME(SqDateTime, _SC("SqDateTime"))
|
||||
SQMOD_DECL_TYPENAME(SqDateTimeFormatter, _SC("SqDateTimeFormatter"))
|
||||
SQMOD_DECL_TYPENAME(SqDateTimeParser, _SC("SqDateTimeParser"))
|
||||
SQMOD_DECL_TYPENAME(SqLocalDateTime, _SC("SqLocalDateTime"))
|
||||
SQMOD_DECL_TYPENAME(SqStopwatch, _SC("SqStopwatch"))
|
||||
SQMOD_DECL_TYPENAME(SqTimespan, _SC("SqTimespan"))
|
||||
SQMOD_DECL_TYPENAME(SqTimestamp, _SC("SqTimestamp"))
|
||||
SQMOD_DECL_TYPENAME(SqTimezone, _SC("SqTimezone"))
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_Time(HSQUIRRELVM vm, Table & ns)
|
||||
{
|
||||
// --------------------------------------------------------------------------------------------
|
||||
ns.Bind(_SC("Timespan"),
|
||||
Class< Timespan >(vm, SqTimespan::Str)
|
||||
// Constructors
|
||||
.Ctor()
|
||||
.Ctor< const Timespan & >()
|
||||
.Ctor< long, long >()
|
||||
.Ctor< int, int, int, int, int >()
|
||||
// Meta-methods
|
||||
.SquirrelFunc(_SC("_typename"), &SqTimespan::Fn)
|
||||
// Properties
|
||||
.Prop(_SC("Days"), &Timespan::days)
|
||||
.Prop(_SC("Hours"), &Timespan::hours)
|
||||
.Prop(_SC("TotalHours"), &Timespan::totalHours)
|
||||
.Prop(_SC("Minutes"), &Timespan::minutes)
|
||||
.Prop(_SC("TotalMinutes"), &Timespan::totalMinutes)
|
||||
.Prop(_SC("Seconds"), &Timespan::seconds)
|
||||
.Prop(_SC("TotalSeconds"), &Timespan::totalSeconds)
|
||||
.Prop(_SC("Milliseconds"), &Timespan::milliseconds)
|
||||
.Prop(_SC("TotalMilliseconds"), &Timespan::totalMilliseconds)
|
||||
.Prop(_SC("Microseconds"), &Timespan::microseconds)
|
||||
.Prop(_SC("Useconds"), &Timespan::useconds)
|
||||
.Prop(_SC("TotalMicroseconds"), &Timespan::totalMicroseconds)
|
||||
// Member Methods
|
||||
.FmtFunc(_SC("Swap"), &Timespan::swap)
|
||||
// Member Overloads
|
||||
.Overload< Timespan & (Timespan::*)(long, long) >
|
||||
(_SC("Assign"), &Timespan::assign)
|
||||
.Overload< Timespan & (Timespan::*)(int, int, int, int, int) >
|
||||
(_SC("Assign"), &Timespan::assign)
|
||||
// Static Values
|
||||
.SetStaticValue(_SC("MILLISECONDS"), static_cast< SQInteger >(Timespan::MILLISECONDS))
|
||||
.SetStaticValue(_SC("SECONDS"), static_cast< SQInteger >(Timespan::SECONDS))
|
||||
.SetStaticValue(_SC("MINUTES"), static_cast< SQInteger >(Timespan::MINUTES))
|
||||
.SetStaticValue(_SC("HOURS"), static_cast< SQInteger >(Timespan::HOURS))
|
||||
.SetStaticValue(_SC("DAYS"), static_cast< SQInteger >(Timespan::DAYS))
|
||||
);
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
31
module/PocoLib/Time.hpp
Normal file
31
module/PocoLib/Time.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include "Core/Common.hpp"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <Poco/Clock.h>
|
||||
#include <Poco/DateTime.h>
|
||||
#include <Poco/DateTimeFormatter.h>
|
||||
#include <Poco/DateTimeParser.h>
|
||||
#include <Poco/LocalDateTime.h>
|
||||
#include <Poco/Stopwatch.h>
|
||||
#include <Poco/Timespan.h>
|
||||
#include <Poco/Timestamp.h>
|
||||
#include <Poco/Timezone.h>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
using Poco::Clock;
|
||||
using Poco::DateTime;
|
||||
using Poco::DateTimeFormatter;
|
||||
using Poco::DateTimeParser;
|
||||
using Poco::LocalDateTime;
|
||||
using Poco::Stopwatch;
|
||||
using Poco::Timespan;
|
||||
using Poco::Timestamp;
|
||||
using Poco::Timezone;
|
||||
|
||||
} // Namespace:: SqMod
|
@ -8,7 +8,7 @@ namespace SqMod {
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_Util(HSQUIRRELVM vm)
|
||||
void Register_POCO_Util(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ namespace SqMod {
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
void Register_POCO_XML(HSQUIRRELVM vm)
|
||||
void Register_POCO_XML(HSQUIRRELVM vm, Table &)
|
||||
{
|
||||
Table ns(vm);
|
||||
|
||||
|
Reference in New Issue
Block a user