Skip to content

Commit

Permalink
增加getHourGZ接口
Browse files Browse the repository at this point in the history
  • Loading branch information
yuangu committed Nov 20, 2021
1 parent 6e5edef commit f2b6ad6
Show file tree
Hide file tree
Showing 25 changed files with 4,408 additions and 418 deletions.
1 change: 1 addition & 0 deletions example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ int main()

do {
Day* day = sxtwl::fromSolar(2021, 11, 14);
day->getHourGZ(8);
auto ret = sxtwl::siZhu2Year(day->getYearGZ(), day->getMonthGZ(), day->getDayGZ(), getGZ("", ""), 2021, 2025);
printf("%d", ret.size());
} while (false);
Expand Down
5 changes: 5 additions & 0 deletions example/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
dTG = day.getDayGZ()
print("日干支", Gan[dTG.tg] + Zhi[dTG.dz])

#时干支,传24小时制的时间,分早晚子时
hour = 18
sTG = day.getHourGZ(hour)
print("%d时的干支"%(hour, ), Gan[sTG.tg] + Zhi[sTG.dz])

#时干支
for hour in range(24):
# 第一个参数为该天的天干,第二个参数为小时
Expand Down
5 changes: 5 additions & 0 deletions export/C#/Day.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ public GZ getDayGZ() {
return ret;
}

public GZ getHourGZ(byte hour) {
GZ ret = new GZ(sxtwlPINVOKE.Day_getHourGZ(swigCPtr, hour), true);
return ret;
}

public bool isLunarLeap() {
bool ret = sxtwlPINVOKE.Day_isLunarLeap(swigCPtr);
return ret;
Expand Down
26 changes: 26 additions & 0 deletions export/C#/SWIGTYPE_p_G.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------


public class SWIGTYPE_p_G {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;

internal SWIGTYPE_p_G(global::System.IntPtr cPtr, bool futureUse) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}

protected SWIGTYPE_p_G() {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}

internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_G obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
}
3 changes: 3 additions & 0 deletions export/C#/sxtwlPINVOKE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ static sxtwlPINVOKE() {
[global::System.Runtime.InteropServices.DllImport("sxtwl", EntryPoint="CSharp_Day_getDayGZ")]
public static extern global::System.IntPtr Day_getDayGZ(global::System.Runtime.InteropServices.HandleRef jarg1);

[global::System.Runtime.InteropServices.DllImport("sxtwl", EntryPoint="CSharp_Day_getHourGZ")]
public static extern global::System.IntPtr Day_getHourGZ(global::System.Runtime.InteropServices.HandleRef jarg1, byte jarg2);

[global::System.Runtime.InteropServices.DllImport("sxtwl", EntryPoint="CSharp_Day_isLunarLeap")]
public static extern bool Day_isLunarLeap(global::System.Runtime.InteropServices.HandleRef jarg1);

Expand Down
14 changes: 14 additions & 0 deletions export/C#/sxtwl_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,20 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Day_getDayGZ(void * jarg1) {
}


SWIGEXPORT void * SWIGSTDCALL CSharp_Day_getHourGZ(void * jarg1, unsigned char jarg2) {
void * jresult ;
Day *arg1 = (Day *) 0 ;
uint8_t arg2 ;
GZ result;

arg1 = (Day *)jarg1;
arg2 = (uint8_t)jarg2;
result = (arg1)->getHourGZ(arg2);
jresult = new GZ((const GZ &)result);
return jresult;
}


SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Day_isLunarLeap(void * jarg1) {
unsigned int jresult ;
Day *arg1 = (Day *) 0 ;
Expand Down
278 changes: 144 additions & 134 deletions export/golang/sxtwl.go

Large diffs are not rendered by default.

Loading

0 comments on commit f2b6ad6

Please sign in to comment.