diff --git a/src/headers/linuxAmd64/string.ph b/src/headers/linuxAmd64/string.ph index 7e9f4c6..b7b7070 100644 --- a/src/headers/linuxAmd64/string.ph +++ b/src/headers/linuxAmd64/string.ph @@ -5,4 +5,7 @@ header function concatenate (stringA: String, stringB: String): String; header function getIndex (string: String, index: Int): String; header function setIndex (string: String, index: Int, character: String); +header function getIndexByte (string: String, index: Int): Int; +header function setIndexByte (string: String, index: Int, value: Int); + header function getLength (string: String): Int; diff --git a/src/platforms/amd64/linux/string.c b/src/platforms/amd64/linux/string.c index 425b15d..7b49873 100644 --- a/src/platforms/amd64/linux/string.c +++ b/src/platforms/amd64/linux/string.c @@ -45,6 +45,19 @@ void setIndex (const String string, const UInt index, const String character) newDataArray[index] = character->data[0]; } +Int getIndexByte (const String string, const UInt index) asm ("\"Standard.String~getIndexByte\""); +Int getIndexByte (const String string, const UInt index) +{ + return createString(string->data[index], 1); +} + +void setIndexByte (const String string, const UInt index, const Int value) asm ("\"Standard.String~setIndexByte\""); +void setIndexByte (const String string, const UInt index, const Int value) +{ + UInt8* newDataArray = string->data; + newDataArray[index] = value; +} + UInt getLength (const String string) asm ("\"Standard.String~getLength\""); UInt getLength (const String string) { diff --git a/src/platforms/amd64/linux/string.h b/src/platforms/amd64/linux/string.h index 57e156a..2f32aad 100644 --- a/src/platforms/amd64/linux/string.h +++ b/src/platforms/amd64/linux/string.h @@ -10,4 +10,7 @@ String concatenate (const String string1, const String string2); String getIndex (const String string, const UInt index); void setIndex (const String string, const UInt index, const String character); +Int getIndexByte (const String string, const UInt index); +void setIndexByte (const String string, const UInt index, const Int value); + UInt getLength (const String string);