mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 09:05:46 +00:00
Add reference
This commit is contained in:
8
Tesses.CrossLang.Reference/cross.json
Normal file
8
Tesses.CrossLang.Reference/cross.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"info": {
|
||||
"type": "lib",
|
||||
"description": "This is used for reference only, don't include into your project"
|
||||
},
|
||||
"name": "Tesses.CrossLang.Reference",
|
||||
"version": "1.0.0.0-dev"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/^ Write Text To Standard Output ^/
|
||||
func Console.WriteLine(text)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/^ Get Documents Folder ^/
|
||||
func Env.getDocuments()
|
||||
{
|
||||
|
||||
}
|
||||
10
Tesses.CrossLang.Reference/src/runtime_methods/fs.tcross
Normal file
10
Tesses.CrossLang.Reference/src/runtime_methods/fs.tcross
Normal file
@@ -0,0 +1,10 @@
|
||||
/^ Read string contents from file ^/
|
||||
func FS.ReadAllText(filesystem, path)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Write string contents to file ^/
|
||||
func FS.WriteAllText(filesystem, path, contents)
|
||||
{
|
||||
|
||||
}
|
||||
16
Tesses.CrossLang.Reference/src/runtime_methods/json.tcross
Normal file
16
Tesses.CrossLang.Reference/src/runtime_methods/json.tcross
Normal file
@@ -0,0 +1,16 @@
|
||||
/^
|
||||
Decode JSON String to Object
|
||||
^/
|
||||
func Json.Decode(text)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/^
|
||||
Encode Object to JSON String
|
||||
pretty: true: make pretty, false: compact
|
||||
^/
|
||||
func Json.Encode(obj, $pretty)
|
||||
{
|
||||
|
||||
}
|
||||
71
Tesses.CrossLang.Reference/src/types/list.tcross
Normal file
71
Tesses.CrossLang.Reference/src/types/list.tcross
Normal file
@@ -0,0 +1,71 @@
|
||||
/^ A list created by using the [] expression ^/
|
||||
class List : HeapObject {
|
||||
/^ Returns an Enumerator for the each statement ^/
|
||||
public GetEnumerator()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Serializes to JSON ^/
|
||||
public ToString()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Insert an item at index ^/
|
||||
public Insert(index, value)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Add an item ^/
|
||||
public Add(item)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Returns whether the list contains the item ^/
|
||||
public Contains(item)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Gets the index of the item (optionally starting at an index) returns -1 if not found ^/
|
||||
public IndexOf(item, $index)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Removes all items that are the same value ^/
|
||||
public RemoveAllEqual(item)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Removes item at index ^/
|
||||
public RemoveAt(index)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Removes all items ^/
|
||||
public Clear()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Gets the item at index, also can use array subscript sugar ^/
|
||||
public GetAt(index)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Sets the item at index to value, also can use array subscript sugar ^/
|
||||
public SetAt(index, value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/^ Gets the nunber of items ^/
|
||||
|
||||
public Count()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Gets the nunber of items ^/
|
||||
|
||||
public Length()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
24
Tesses.CrossLang.Reference/src/types/mutex.tcross
Normal file
24
Tesses.CrossLang.Reference/src/types/mutex.tcross
Normal file
@@ -0,0 +1,24 @@
|
||||
class Mutex : HeapObject
|
||||
{
|
||||
/^ Create the mutex ^/
|
||||
public Mutex()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Lock the mutex ^/
|
||||
public Lock()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Unlock the mutex ^/
|
||||
public Unlock()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/^ Try to lock the mutex ^/
|
||||
public TryLock()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
17
Tesses.CrossLang.Reference/src/types/object.tcross
Normal file
17
Tesses.CrossLang.Reference/src/types/object.tcross
Normal file
@@ -0,0 +1,17 @@
|
||||
/^ Base Object ^/
|
||||
class Object {
|
||||
/^ Serializes object to String ^/
|
||||
public abstract ToString();
|
||||
}
|
||||
/^ All garbage collected objects inherit from me ^/
|
||||
class HeapObject : Object {
|
||||
|
||||
}
|
||||
/^ All CrossLang classes inherit from me ^/
|
||||
class ClassObject : HeapObject {
|
||||
|
||||
}
|
||||
/^ A non typesafe native object ^/
|
||||
class Native : HeapObject {
|
||||
|
||||
}
|
||||
74
Tesses.CrossLang.Reference/src/types/stream.tcross
Normal file
74
Tesses.CrossLang.Reference/src/types/stream.tcross
Normal file
@@ -0,0 +1,74 @@
|
||||
/^ base class for stream ^/
|
||||
class Stream : HeapObject {
|
||||
/^ Can Read be called ^/
|
||||
public getCanRead()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Can Write be called ^/
|
||||
public getCanWrite()
|
||||
{
|
||||
|
||||
}
|
||||
/^ Can Seek be called ^/
|
||||
public getCanSeek()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/^ Read bytes from stream into buffer ^/
|
||||
public Read(buffer, offset, length)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Write bytes to stream from buffer ^/
|
||||
public Write(buffer, offset, length)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Read bytes from stream into buffer, reading multiple times if needed ^/
|
||||
public ReadBlock(buffer, offset, length)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Write bytes to stream from buffer and ensuring that number of bytes is actually writen ^/
|
||||
public WriteBlock(buffer, offset, length)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/^ Write text to stream ^/
|
||||
public WriteText(text)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Copy to another stream ^/
|
||||
public CopyTo(stream,$bufferSize)
|
||||
{
|
||||
|
||||
}
|
||||
/^
|
||||
Seek to position
|
||||
whence:
|
||||
|
||||
Stream.Begin: 0
|
||||
Stream.Current: 1
|
||||
Stream.End: 2
|
||||
^/
|
||||
public Seek(pos, whence)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Flush to disk ^/
|
||||
public Flush()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/^ Close the stream ^/
|
||||
public Close()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
18
Tesses.CrossLang.Reference/src/types/string.tcross
Normal file
18
Tesses.CrossLang.Reference/src/types/string.tcross
Normal file
@@ -0,0 +1,18 @@
|
||||
/^
|
||||
The String Type
|
||||
To Concat a String use the + operator
|
||||
^/
|
||||
class String : Object {
|
||||
|
||||
|
||||
/^ Search and replace all ^/
|
||||
public Replace(oldStr, newStr)
|
||||
{
|
||||
|
||||
}
|
||||
/^ Return a copy of the string ^/
|
||||
public ToString()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user