mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add pikaStdData
This commit is contained in:
parent
5fe634105b
commit
0132327c84
@ -1,17 +1,39 @@
|
||||
from PikaObj import *
|
||||
|
||||
|
||||
class List(TinyObj):
|
||||
def __init__():
|
||||
pass
|
||||
|
||||
# add an arg after the end of list
|
||||
def append(arg: any):
|
||||
pass
|
||||
|
||||
# get an arg by the index
|
||||
def get(i: int) -> any:
|
||||
pass
|
||||
|
||||
# set an arg by the index
|
||||
def set(i: int, arg: any):
|
||||
pass
|
||||
|
||||
# get the length of list
|
||||
def len() -> int:
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
class Dict(TinyObj):
|
||||
def __init__():
|
||||
pass
|
||||
|
||||
# get an arg by the key
|
||||
def get(key: str) -> any:
|
||||
pass
|
||||
|
||||
# set an arg by the key
|
||||
def set(key: str, arg: any):
|
||||
pass
|
||||
|
||||
# remove an arg by the key
|
||||
def remove(key: str):
|
||||
pass
|
||||
|
17
package/PikaStdData/PikaStdData_Dict.c
Normal file
17
package/PikaStdData/PikaStdData_Dict.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include "PikaObj.h"
|
||||
#include "PikaStdLib_SysObj.h"
|
||||
#include "PikaStdData_Dict.h"
|
||||
|
||||
Arg* PikaStdData_Dict_get(PikaObj* self, char* key) {
|
||||
return arg_copy(obj_getArg(self, key));
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___init__(PikaObj* self) {}
|
||||
|
||||
void PikaStdData_Dict_set(PikaObj* self, Arg* arg, char* key) {
|
||||
obj_setArg(self, key, arg);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict_remove(PikaObj* self, char* key) {
|
||||
PikaStdLib_SysObj_remove(self, key);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
#include "PikaStdData_List.h"
|
||||
#include "PikaObj.h"
|
||||
|
||||
void PikaStdData_List_append(PikaObj* self, Arg* arg) {
|
||||
int top = obj_getInt(self, "top");
|
||||
|
Loading…
x
Reference in New Issue
Block a user