From 53c034aa85aeda10f4b4296143f78f1b75374575 Mon Sep 17 00:00:00 2001 From: ocoursiere Date: Mon, 7 Oct 2002 22:08:47 +0000 Subject: [PATCH] Start of BString and BList support by Eric --- bepascal/bepascal/be/support/BString.pp | 510 +++++++ bepascal/bepascal/be/support/List.cpp | 346 +++++ bepascal/bepascal/be/support/String.cpp | 1746 ++++++++++++++++++++++ bepascal/bepascal/be/support/list.pp | 187 +++ bepascal/bepascal/bepascal/bepascal.proj | Bin 14509 -> 14783 bytes 5 files changed, 2789 insertions(+) create mode 100644 bepascal/bepascal/be/support/BString.pp create mode 100644 bepascal/bepascal/be/support/List.cpp create mode 100644 bepascal/bepascal/be/support/String.cpp create mode 100644 bepascal/bepascal/be/support/list.pp diff --git a/bepascal/bepascal/be/support/BString.pp b/bepascal/bepascal/be/support/BString.pp new file mode 100644 index 0000000..111a90d --- /dev/null +++ b/bepascal/bepascal/be/support/BString.pp @@ -0,0 +1,510 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit BString; + +interface + +uses + beobj, SupportDefs, os; + +type + TString = class(TBeObject) + private + public + constructor Create; override; + // constructor Create(value : PChar); override; + destructor Destroy; override; + + function CountChars : integer; + function length : integer; + function String_pchar : PChar; + + // Affectation + procedure SetTo(value:PChar; lenght : cardinal); + procedure SetTo( from: TString); + procedure SetTo( value:TString; length1: cardinal); + procedure Adopt( from:TString); + end; + + +function BString_Create(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BString_Create'; +function BString_Create(AObject : TBeObject;value : PChar):TCPlusObject; cdecl; external BePascalLibName name 'BString_Create_1'; +procedure BString_Free(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BString_Free'; +function BString_CountChars(AObject : TCPlusObject): cardinal;cdecl; external BePascalLibName name 'BString_CountChars'; +function BString_Length(AObject : TCPlusObject): cardinal;cdecl; external BePascalLibName name 'BString_Length'; +function BString_String(AObject : TCPlusObject): Pchar;cdecl; external BePascalLibName name 'BString_String'; + +procedure BString_SetTo(AObject : TCPlusObject;value:Pchar;length:cardinal);cdecl; external BePascalLibName name 'BString_SetTo'; +procedure BString_SetTo_1(AObject : TCPlusObject; from: TBeObject);cdecl; external BePascalLibName name 'BString_SetTo_1'; +procedure BString_SetTo_2(AObject : TCPlusObject; value:TBeObject;length: cardinal);cdecl; external BePascalLibName name 'BString_SetTo_2'; + +procedure BString_Adopt(AObject : TCPlusObject; from:TBeObject);cdecl; external BePascalLibName name 'BString_Adopt'; + + +{ + +BString & +BString_Adopt_1(BString *String, BString &from, + int32 length) + +BString & +BString_SetTo_3(BString *String, char value, + int32 count) + + +BString & +BString_CopyInto(BString *String, BString &into, + int32 fromOffset, + int32 length) + + +void +BString_CopyInto_1 +(BString *String, char *into, + int32 fromOffset, + int32 length) + + +BString & +BString_Append(BString *String, const BString &value, + int32 length) + +BString & +BString_Append_1 +(BString *String, const char *value, + int32 length) + +BString & +BString_Append_2 +(BString *String, char value, + int32 count) + +BString & +BString_Prepend(BString *String, const char *value) + +BString & +BString_Prepend_1 +(BString *String, const BString &value) + +BString & +BString_Prepend_2 +(BString *String, const char *value, + int32 length) + +BString & +BString_Prepend_3 +(BString *String, const BString &value, + int32 length) + +BString & +BString_Prepend_4 +(BString *String, char value, + int32 count) + +BString & +BString_Insert(BString *String, const char *value, + int32 pos) + +BString & +BString_Insert_1 +(BString *String, const char *value, + int32 length, + int32 pos) + +BString & +BString_Insert_2 +(BString *String, const char *value, + int32 fromOffset, + int32 length, + int32 pos) + +BString & +BString_Insert_3 +(BString *String, const BString &value, + int32 pos) + +BString & +BString_Insert_4 +(BString *String, const BString &value, + int32 length, + int32 pos) + +BString & +BString_Insert_5 +(BString *String, const BString &value, + int32 fromOffset, + int32 length, + int32 pos) + +BString & +BString_Insert_6 +(BString *String, char value, + int32 count, + int32 pos) + +BString & +BString_Truncate(BString *String, int32 newLength, + bool lazy) + +BString & +BString_Remove(BString *String, int32 from, + int32 length) + +BString & +BString_RemoveFirst_1 +(BString *String, const BString &value) + +BString & +BString_RemoveLast(BString *String, const BString &value) + +BString & +BString_RemoveAll(BString *String, const BString &value) + +BString & +BString_RemoveFirst(BString *String, const char *value) + +BString & +BString_RemoveLast_1(BString *String, const char *value) + +BString & +BString_RemoveAll_1(BString *String, const char *value) + +BString & +BString_RemoveSet(BString *String, const char *setOfCharsToRemove) + +BString & +BString_MoveInto(BString *String, BString &into, + int32 from, + int32 length) + +void +BString_MoveInto_1 +(BString *String, char *into, + int32 from, + int32 length) + +int +BString_Compare(BString *String, const BString &value) + +int +BString_Compare_1 +(BString *String, const char *value) + +int +BString_Compare_2 +(BString *String, const BString &value, + int32 n) + +int +BString_Compare_3 +(BString *String, const char *value, + int32 n) + +int +BString_ICompare(BString *String, const BString &value) + +int +BString_ICompare_1 +(BString *String, const char *value) + +int +BString_ICompare_2 +(BString *String, const BString &value, + int32 n) + +int +BString_ICompare_3 +(BString *String, const char *value, + int32 n) + +int32 +BString_FindFirst(BString *String, const BString &value) + +int32 +BString_FindFirst_1 +(BString *String, const char *value) + +int32 +BString_FindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) + +int32 +BString_FindFirst_3 +(BString *String, const char *value, + int32 fromOffset) + +int32 +BString_FindFirst_4 +(BString *String, char value) + +int32 +BString_FindFirst_5 +(BString *String, char value, + int32 fromOffset) + +int32 +BString_FindLast(BString *String, const BString &value) + +int32 +BString_FindLast_1 +(BString *String, const char *value) + +int32 +BString_FindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) + +int32 +BString_FindLast_3 +(BString *String, const char *value, + int32 beforeOffset) + +int32 +BString_FindLast_4 +(BString *String, char value) + +int32 +BString_FindLast_5 +(BString *String, char value, + int32 fromOffset) + +int32 +BString_IFindFirst(BString *String, const BString &value) + +int32 +BString_IFindFirst_1 +(BString *String, const char *value) + +int32 +BString_IFindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) + +int32 +BString_IFindFirst_3 +(BString *String, const char *value, + int32 fromOffset) + +int32 +BString_IFindLast(BString *String, const BString &value) + +int32 +BString_IFindLast_1 +(BString *String, const char *value) + +int32 +BString_IFindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) + +int32 +BString_IFindLast_3 +(BString *String, const char *value, + int32 beforeOffset) + +BString & +BString_ReplaceFirst(BString *String, char replaceThis, + char withThis) + +BString & +BString_ReplaceLast(BString *String, char replaceThis, + char withThis) + +BString & +BString_ReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) + +BString & +BString_Replace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_ReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_ReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_ReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) + +BString & +BString_Replace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_IReplaceFirst(BString *String, char replaceThis, + char withThis) + +BString & +BString_IReplaceLast(BString *String, char replaceThis, + char withThis) + +BString & +BString_IReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) + +BString & +BString_IReplace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_IReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_IReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) + +BString & +BString_IReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) + +BString & +BString_IReplace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) + +BString & +BString_ReplaceSet(BString *String, const char *setOfChars, + char with) + +BString & +BString_ReplaceSet_1 +(BString *String, const char *setOfChars, + const char *with) + +char * +BString_LockBuffer(BString *String, int32 maxLength) + +BString & +BString_UnlockBuffer(BString *String, int32 length) + +BString & +BString_ToLower(BString *String) + +BString & +BString_ToUpper(BString *String) + +BString & +BString_Capitalize(BString *String) + +BString & +BString_CapitalizeEachWord_1 +(BString *String) + +BString & +BString_CharacterEscape(BString *String, const char *original, + const char *setOfCharsToEscape, + char escapeWith) + +BString & +BString_CharacterEscape_1 +(BString *String, const char *setOfCharsToEscape, + char escapeWith) + +BString & +BString_CharacterDeescape(BString *String, const char *original, + char escapeChar) + +BString & +BString_CharacterDeescape_1 +(BString *String, char escapeChar) +} + + +implementation + + +constructor TString.Create; +begin + inherited; + CPlusObject := BString_Create(Self); +end; + +{constructor TString.Create_1(value:PChar); +begin + inherited; + CPlusObject := BString_Create_1(Self,value); +end; +} +destructor TString.Destroy; +begin + if CPlusObject <> nil then + BString_Free(CPlusObject); + inherited; + +end; + +function TString.CountChars : integer; +begin + result:=BString_CountChars(CPlusObject); +end; + +function TString.length : integer; +begin + result:=BString_Length(CPlusObject); +end; + +function TString.String_pchar : PChar; +begin + result:=BString_String(CPlusObject); +end; + +procedure TString.SetTo(value:PChar; lenght : cardinal); +begin + BString_SetTo(CPlusObject,value,lenght); +end; + + +procedure TString.SetTo( from: TString); +begin + BString_SetTo_1(CPlusObject, from); +end; + +procedure TString.SetTo( value:TString;length1: cardinal); +begin + BString_SetTo_2(CPlusObject, value,length1); +end; + +procedure TString.Adopt( from:TString); +begin + BString_Adopt(CPlusObject, from); +end; + + + +end. + diff --git a/bepascal/bepascal/be/support/List.cpp b/bepascal/bepascal/be/support/List.cpp new file mode 100644 index 0000000..20358e8 --- /dev/null +++ b/bepascal/bepascal/be/support/List.cpp @@ -0,0 +1,346 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _LIST_CPP_ +#define _LIST_CPP_ + +#include "List.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BList::BList() + * Descr: + */ +TCPlusObject BList_Create( int32 itemsPerBlock) +{ + return new BList( itemsPerBlock); +} + + +/* + * Method: BList::BList() + * Descr: + */ +/*TCPlusObject BList_Create_1 +(TPasObject PasObject, const BList &) +{ + return new BPList(PasObject, ); +} +*/ + +/* + * Method: BList::~BList() + * Descr: + */ +void BList_Free(BList *List) +{ + delete List; +} + + +/* + * Method: BList::operator=() + * Descr: + */ +/*BList & +BList_operator=(BList *List, const BList &from) +{ + return List->operator=(from); +} +*/ + +/* + * Method: BList::AddItem() + * Descr: + */ +bool +BList_AddItem(BList *List, void *item) +{ + return List->AddItem(item); +} + + +/* + * Method: BList::AddItem() + * Descr: + */ +bool +BList_AddItem_1 +(BList *List, void *item, + int32 atIndex) +{ + return List->AddItem(item, + atIndex); +} + + +/* + * Method: BList::AddList() + * Descr: + */ +bool +BList_AddList(BList *List, BList *newItems) +{ + return List->AddList(newItems); +} + + +/* + * Method: BList::AddList() + * Descr: + */ +bool +BList_AddList_1 +(BList *List, BList *newItems, + int32 atIndex) +{ + return List->AddList(newItems, + atIndex); +} + + +/* + * Method: BList::RemoveItem() + * Descr: + */ +bool +BList_RemoveItem(BList *List, void *item) +{ + return List->RemoveItem(item); +} + + +/* + * Method: BList::RemoveItem() + * Descr: + */ +void * +BList_RemoveItem_1 +(BList *List, int32 index) +{ + return List->RemoveItem(index); +} + + +/* + * Method: BList::RemoveItems() + * Descr: + */ +bool +BList_RemoveItems_2 +(BList *List, int32 index, + int32 count) +{ + return List->RemoveItems(index, + count); +} + + +/* + * Method: BList::ReplaceItem() + * Descr: + */ +bool +BList_ReplaceItem(BList *List, int32 index, + void *newItem) +{ + return List->ReplaceItem(index, + newItem); +} + + +/* + * Method: BList::MakeEmpty() + * Descr: + */ +void +BList_MakeEmpty(BList *List) +{ + List->MakeEmpty(); +} + + +/* + * Method: BList::SwapItems() + * Descr: + */ +bool +BList_SwapItems(BList *List, int32 indexA, + int32 indexB) +{ + return List->SwapItems(indexA, + indexB); +} + + +/* + * Method: BList::MoveItem() + * Descr: + */ +bool +BList_MoveItem(BList *List, int32 fromIndex, + int32 toIndex) +{ + return List->MoveItem(fromIndex, + toIndex); +} + + +/* + * Method: BList::ItemAt() + * Descr: + */ +void * +BList_ItemAt(BList *List, int32 at) +{ + return List->ItemAt(at); +} + + +/* + * Method: BList::ItemAtFast() + * Descr: + */ +void * +BList_ItemAtFast_1 +(BList *List, int32 at) +{ + return List->ItemAtFast(at); +} + + +/* + * Method: BList::FirstItem() + * Descr: + */ +void * +BList_FirstItem(BList *List) +{ + return List->FirstItem(); +} + + +/* + * Method: BList::LastItem() + * Descr: + */ +void * +BList_LastItem(BList *List) +{ + return List->LastItem(); +} + + +/* + * Method: BList::Items() + * Descr: + */ +void * +BList_Items(BList *List) +{ + return List->Items(); +} + + +/* + * Method: BList::HasItem() + * Descr: + */ +bool +BList_HasItem(BList *List, void *item) +{ + return List->HasItem(item); +} + + +/* + * Method: BList::IndexOf() + * Descr: + */ +int32 +BList_IndexOf(BList *List, void *item) +{ + return List->IndexOf(item); +} + + +/* + * Method: BList::CountItems() + * Descr: + */ +int32 +BList_CountItems(BList *List) +{ + return List->CountItems(); +} + + +/* + * Method: BList::IsEmpty() + * Descr: + */ +bool +BList_IsEmpty(BList *List) +{ + return List->IsEmpty(); +} + + +/* + * Method: BList::_ReservedList1() + * Descr: + */ +/*void +BList__ReservedList1(BList *List) +{ + List->_ReservedList1(); +} +*/ + +/* + * Method: BList::_ReservedList2() + * Descr: + */ +/*void +BList__ReservedList2(BList *List) +{ + List->_ReservedList2(); +} +*/ + +/* + * Method: BList::Resize() + * Descr: + */ +/*void +BList_Resize(BList *List, int32 count) +{ + List->Resize(count); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _LIST_CPP_ */ + + diff --git a/bepascal/bepascal/be/support/String.cpp b/bepascal/bepascal/be/support/String.cpp new file mode 100644 index 0000000..37e236d --- /dev/null +++ b/bepascal/bepascal/be/support/String.cpp @@ -0,0 +1,1746 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef _STRING_CPP_ +#define _STRING_CPP_ + +#include "String.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* + * Method: BString::BString() + * Descr: + */ +TCPlusObject BString_Create() +{ + return new BString(); +} + + +/* + * Method: BString::BString() + * Descr: + */ +TCPlusObject BString_Create_1 +(TPasObject PasObject, const char *value) +{ + return new BString(value); +} + + +/* + * Method: BString::BString() + * Descr: + */ +/*TCPlusObject BString_Create_2 +(TPasObject PasObject, const BString &) +{ + return new BPString(PasObject, ); +} +*/ + +/* + * Method: BString::BString() + * Descr: + */ +/*TCPlusObject BString_Create_3 +(TPasObject PasObject, const char *, + int32 maxLength) +{ + return new BPString(PasObject, , + maxLength); +} + +*/ +/* + * Method: BString::~BString() + * Descr: + */ +void BString_Free(BString *String) +{ + delete String; +} + + +/* + * Method: BString::CountChars() + * Descr: + */ + +const char *BString_String(BString *String) +{ + return String->String(); +} + +int32 +BString_Length(BString *String) +{ + return String->Length(); +} + +int32 +BString_CountChars(BString *String) +{ + return String->CountChars(); +} + + +/* + * Method: BString::operator=() + * Descr: + */ +/*BString & +BString_operator=(BString *String, const BString &) +{ + return String->operator=(); +} +*/ + +/* + * Method: BString::operator=() + * Descr: + */ +/*BString & +BString_operator=_1 +(BString *String, const char *) +{ + return String->operator=(); +} +*/ + +/* + * Method: BString::operator=() + * Descr: + */ +/*BString & +BString_operator=_2 +(BString *String, char) +{ + return String->operator=(); +} + +*/ +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo(BString *String, const char *value, + int32 length) +{ + return String->SetTo(value,length); +} + + +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo_1 +(BString *String, const BString &from) +{ + return String->SetTo(from); +} + + +/* + * Method: BString::Adopt() + * Descr: + */ +BString & +BString_Adopt(BString *String, BString &from) +{ + return String->Adopt(from); +} + + +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo_2(BString *String, const BString &value, + int32 length) +{ + return String->SetTo(value, + length); +} + + +/* + * Method: BString::Adopt() + * Descr: + */ +BString & +BString_Adopt_1(BString *String, BString &from, + int32 length) +{ + return String->Adopt(from, + length); +} + + +/* + * Method: BString::SetTo() + * Descr: + */ +BString & +BString_SetTo_3(BString *String, char value, + int32 count) +{ + return String->SetTo(value, + count); +} + + +/* + * Method: BString::CopyInto() + * Descr: + */ +BString & +BString_CopyInto(BString *String, BString &into, + int32 fromOffset, + int32 length) +{ + return String->CopyInto(into, + fromOffset, + length); +} + + +/* + * Method: BString::CopyInto() + * Descr: + */ +void +BString_CopyInto_1 +(BString *String, char *into, + int32 fromOffset, + int32 length) +{ + String->CopyInto(into, + fromOffset, + length); +} + + +/* + * Method: BString::operator+=() + * Descr: + */ +/*BString & +BString_operator+=(BString *String, const char *) +{ + return String->operator+=(); +} +*/ + +/* + * Method: BString::operator+=() + * Descr: + */ +/*BString & +BString_operator+=_1 +(BString *String, char) +{ + return String->operator+=(); +} +*/ + +/* + * Method: BString::Append() + * Descr: + */ +BString & +BString_Append(BString *String, const BString &value, + int32 length) +{ + return String->Append(value, + length); +} + + +/* + * Method: BString::Append() + * Descr: + */ +BString & +BString_Append_1 +(BString *String, const char *value, + int32 length) +{ + return String->Append(value, + length); +} + + +/* + * Method: BString::Append() + * Descr: + */ +BString & +BString_Append_2 +(BString *String, char value, + int32 count) +{ + return String->Append(value, + count); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend(BString *String, const char *value) +{ + return String->Prepend(value); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_1 +(BString *String, const BString &value) +{ + return String->Prepend(value); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_2 +(BString *String, const char *value, + int32 length) +{ + return String->Prepend(value,length); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_3 +(BString *String, const BString &value, + int32 length) +{ + return String->Prepend(value,length + ); +} + + +/* + * Method: BString::Prepend() + * Descr: + */ +BString & +BString_Prepend_4 +(BString *String, char value, + int32 count) +{ + return String->Prepend(value, + count); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert(BString *String, const char *value, + int32 pos) +{ + return String->Insert(value, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_1 +(BString *String, const char *value, + int32 length, + int32 pos) +{ + return String->Insert(value, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_2 +(BString *String, const char *value, + int32 fromOffset, + int32 length, + int32 pos) +{ + return String->Insert(value, + fromOffset, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_3 +(BString *String, const BString &value, + int32 pos) +{ + return String->Insert(value, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_4 +(BString *String, const BString &value, + int32 length, + int32 pos) +{ + return String->Insert(value, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_5 +(BString *String, const BString &value, + int32 fromOffset, + int32 length, + int32 pos) +{ + return String->Insert(value, + fromOffset, + length, + pos); +} + + +/* + * Method: BString::Insert() + * Descr: + */ +BString & +BString_Insert_6 +(BString *String, char value, + int32 count, + int32 pos) +{ + return String->Insert(value, + count, + pos); +} + + +/* + * Method: BString::Truncate() + * Descr: + */ +BString & +BString_Truncate(BString *String, int32 newLength, + bool lazy) +{ + return String->Truncate(newLength, + lazy); +} + + +/* + * Method: BString::Remove() + * Descr: + */ +BString & +BString_Remove(BString *String, int32 from, + int32 length) +{ + return String->Remove(from, + length); +} + + +/* + * Method: BString::RemoveFirst() + * Descr: + */ +BString & +BString_RemoveFirst_1 +(BString *String, const BString &value) +{ + return String->RemoveFirst(value); +} + + +/* + * Method: BString::RemoveLast() + * Descr: + */ +BString & +BString_RemoveLast(BString *String, const BString &value) +{ + return String->RemoveLast(value); +} + + +/* + * Method: BString::RemoveAll() + * Descr: + */ +BString & +BString_RemoveAll(BString *String, const BString &value) +{ + return String->RemoveAll(value); +} + + +/* + * Method: BString::RemoveFirst() + * Descr: + */ +BString & +BString_RemoveFirst(BString *String, const char *value) +{ + return String->RemoveFirst(value); +} + + +/* + * Method: BString::RemoveLast() + * Descr: + */ +BString & +BString_RemoveLast_1(BString *String, const char *value) +{ + return String->RemoveLast(value); +} + + +/* + * Method: BString::RemoveAll() + * Descr: + */ +BString & +BString_RemoveAll_1(BString *String, const char *value) +{ + return String->RemoveAll(value); +} + + +/* + * Method: BString::RemoveSet() + * Descr: + */ +BString & +BString_RemoveSet(BString *String, const char *setOfCharsToRemove) +{ + return String->RemoveSet(setOfCharsToRemove); +} + + +/* + * Method: BString::MoveInto() + * Descr: + */ +BString & +BString_MoveInto(BString *String, BString &into, + int32 from, + int32 length) +{ + return String->MoveInto(into, + from, + length); +} + + +/* + * Method: BString::MoveInto() + * Descr: + */ +void +BString_MoveInto_1 +(BString *String, char *into, + int32 from, + int32 length) +{ + String->MoveInto(into, + from, + length); +} + + +/* + * Method: BString::operator<() + * Descr: + */ +/*bool +BString_operator<(BString *String, const char *) const +{ + return String->operator<(); +} +*/ + +/* + * Method: BString::operator<=() + * Descr: + */ +/*bool +BString_operator<=_1 +(BString *String, const char *) const +{ + return String->operator<=(); +} +*/ + +/* + * Method: BString::operator==() + * Descr: + */ +/*bool +BString_operator==(BString *String, const char *) const +{ + return String->operator==(); +} +*/ + +/* + * Method: BString::operator>=() + * Descr: + */ +/*bool +BString_operator>=(BString *String, const char *) const +{ + return String->operator>=(); +} +*/ + +/* + * Method: BString::operator>() + * Descr: + */ +/*bool +BString_operator>(BString *String, const char *) const +{ + return String->operator>(); +} +*/ + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare(BString *String, const BString &value) +{ + return String->Compare(value); +} + + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare_1 +(BString *String, const char *value) +{ + return String->Compare(value); +} + + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare_2 +(BString *String, const BString &value, + int32 n) +{ + return String->Compare(value, + n); +} + + +/* + * Method: BString::Compare() + * Descr: + */ +int +BString_Compare_3 +(BString *String, const char *value, + int32 n) +{ + return String->Compare(value, + n); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare(BString *String, const BString &value) +{ + return String->ICompare(value); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare_1 +(BString *String, const char *value) +{ + return String->ICompare(value); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare_2 +(BString *String, const BString &value, + int32 n) +{ + return String->ICompare(value, + n); +} + + +/* + * Method: BString::ICompare() + * Descr: + */ +int +BString_ICompare_3 +(BString *String, const char *value, + int32 n) +{ + return String->ICompare(value, + n); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst(BString *String, const BString &value) +{ + return String->FindFirst(value); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_1 +(BString *String, const char *value) +{ + return String->FindFirst(value); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) +{ + return String->FindFirst(value, + fromOffset); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_3 +(BString *String, const char *value, + int32 fromOffset) +{ + return String->FindFirst(value, + fromOffset); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_4 +(BString *String, char value) +{ + return String->FindFirst(value); +} + + +/* + * Method: BString::FindFirst() + * Descr: + */ +int32 +BString_FindFirst_5 +(BString *String, char value, + int32 fromOffset) +{ + return String->FindFirst(value, + fromOffset); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast(BString *String, const BString &value) +{ + return String->FindLast(value); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_1 +(BString *String, const char *value) +{ + return String->FindLast(value); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) +{ + return String->FindLast(value, + beforeOffset); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_3 +(BString *String, const char *value, + int32 beforeOffset) +{ + return String->FindLast(value, + beforeOffset); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_4 +(BString *String, char value) +{ + return String->FindLast(value); +} + + +/* + * Method: BString::FindLast() + * Descr: + */ +int32 +BString_FindLast_5 +(BString *String, char value, + int32 fromOffset) +{ + return String->FindLast(value, + fromOffset); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst(BString *String, const BString &value) +{ + return String->IFindFirst(value); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst_1 +(BString *String, const char *value) +{ + return String->IFindFirst(value); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst_2 +(BString *String, const BString &value, + int32 fromOffset) +{ + return String->IFindFirst(value, + fromOffset); +} + + +/* + * Method: BString::IFindFirst() + * Descr: + */ +int32 +BString_IFindFirst_3 +(BString *String, const char *value, + int32 fromOffset) +{ + return String->IFindFirst(value, + fromOffset); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast(BString *String, const BString &value) +{ + return String->IFindLast(value); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast_1 +(BString *String, const char *value) +{ + return String->IFindLast(value); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast_2 +(BString *String, const BString &value, + int32 beforeOffset) +{ + return String->IFindLast(value, + beforeOffset); +} + + +/* + * Method: BString::IFindLast() + * Descr: + */ +int32 +BString_IFindLast_3 +(BString *String, const char *value, + int32 beforeOffset) +{ + return String->IFindLast(value, + beforeOffset); +} + + +/* + * Method: BString::ReplaceFirst() + * Descr: + */ +BString & +BString_ReplaceFirst(BString *String, char replaceThis, + char withThis) +{ + return String->ReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceLast() + * Descr: + */ +BString & +BString_ReplaceLast(BString *String, char replaceThis, + char withThis) +{ + return String->ReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceAll() + * Descr: + */ +BString & +BString_ReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) +{ + return String->ReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::Replace() + * Descr: + */ +BString & +BString_Replace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->Replace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::ReplaceFirst() + * Descr: + */ +BString & +BString_ReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->ReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceLast() + * Descr: + */ +BString & +BString_ReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->ReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::ReplaceAll() + * Descr: + */ +BString & +BString_ReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) +{ + return String->ReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::Replace() + * Descr: + */ +BString & +BString_Replace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->Replace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::IReplaceFirst() + * Descr: + */ +BString & +BString_IReplaceFirst(BString *String, char replaceThis, + char withThis) +{ + return String->IReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceLast() + * Descr: + */ +BString & +BString_IReplaceLast(BString *String, char replaceThis, + char withThis) +{ + return String->IReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceAll() + * Descr: + */ +BString & +BString_IReplaceAll(BString *String, char replaceThis, + char withThis, + int32 fromOffset) +{ + return String->IReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::IReplace() + * Descr: + */ +BString & +BString_IReplace(BString *String, char replaceThis, + char withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->IReplace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::IReplaceFirst() + * Descr: + */ +BString & +BString_IReplaceFirst_1 +(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->IReplaceFirst(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceLast() + * Descr: + */ +BString & +BString_IReplaceLast_1(BString *String, const char *replaceThis, + const char *withThis) +{ + return String->IReplaceLast(replaceThis, + withThis); +} + + +/* + * Method: BString::IReplaceAll() + * Descr: + */ +BString & +BString_IReplaceAll_1(BString *String, const char *replaceThis, + const char *withThis, + int32 fromOffset) +{ + return String->IReplaceAll(replaceThis, + withThis, + fromOffset); +} + + +/* + * Method: BString::IReplace() + * Descr: + */ +BString & +BString_IReplace_1(BString *String, const char *replaceThis, + const char *withThis, + int32 maxReplaceCount, + int32 fromOffset) +{ + return String->IReplace(replaceThis, + withThis, + maxReplaceCount, + fromOffset); +} + + +/* + * Method: BString::ReplaceSet() + * Descr: + */ +BString & +BString_ReplaceSet(BString *String, const char *setOfChars, + char with) +{ + return String->ReplaceSet(setOfChars, + with); +} + + +/* + * Method: BString::ReplaceSet() + * Descr: + */ +BString & +BString_ReplaceSet_1 +(BString *String, const char *setOfChars, + const char *with) +{ + return String->ReplaceSet(setOfChars, + with); +} + + +/* + * Method: BString::operator[]() + * Descr: + */ +/*char & +BString_operator[](BString *String, int32 index) +{ + return String->operator[](index); +} +*/ + +/* + * Method: BString::LockBuffer() + * Descr: + */ +char * +BString_LockBuffer(BString *String, int32 maxLength) +{ + return String->LockBuffer(maxLength); +} + + +/* + * Method: BString::UnlockBuffer() + * Descr: + */ +BString & +BString_UnlockBuffer(BString *String, int32 length) +{ + return String->UnlockBuffer(length); +} + + +/* + * Method: BString::ToLower() + * Descr: + */ +BString & +BString_ToLower(BString *String) +{ + return String->ToLower(); +} + + +/* + * Method: BString::ToUpper() + * Descr: + */ +BString & +BString_ToUpper(BString *String) +{ + return String->ToUpper(); +} + + +/* + * Method: BString::Capitalize() + * Descr: + */ +BString & +BString_Capitalize(BString *String) +{ + return String->Capitalize(); +} + + +/* + * Method: BString::CapitalizeEachWord() + * Descr: + */ +BString & +BString_CapitalizeEachWord_1 +(BString *String) +{ + return String->CapitalizeEachWord(); +} + + +/* + * Method: BString::CharacterEscape() + * Descr: + */ +BString & +BString_CharacterEscape(BString *String, const char *original, + const char *setOfCharsToEscape, + char escapeWith) +{ + return String->CharacterEscape(original, + setOfCharsToEscape, + escapeWith); +} + + +/* + * Method: BString::CharacterEscape() + * Descr: + */ +BString & +BString_CharacterEscape_1 +(BString *String, const char *setOfCharsToEscape, + char escapeWith) +{ + return String->CharacterEscape(setOfCharsToEscape, + escapeWith); +} + + +/* + * Method: BString::CharacterDeescape() + * Descr: + */ +BString & +BString_CharacterDeescape(BString *String, const char *original, + char escapeChar) +{ + return String->CharacterDeescape(original, + escapeChar); +} + + +/* + * Method: BString::CharacterDeescape() + * Descr: + */ +BString & +BString_CharacterDeescape_1 +(BString *String, char escapeChar) +{ + return String->CharacterDeescape(escapeChar); +} + + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<(BString *String, const char *) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_1 +(BString *String, const BString &) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_2 +(BString *String, char) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_3 +(BString *String, int) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_4 +(BString *String, unsigned int) +{ + return String->operator<<(); +} + +*/ +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_5 +(BString *String, uint32) +{ + return String->operator<<(); +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_6 +(BString *String, int32) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_7 +(BString *String, uint64) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_8 +(BString *String, int64) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::operator<<() + * Descr: + */ +/*BString & +BString_operator<<_9 +(BString *String, float) +{ + return String->operator<<(); +} +*/ + +/* + * Method: BString::_Init() + * Descr: + */ +/*void +BString__Init(BString *String, const char *value, + int32 lenght) +{ + String->_Init(value,lenght + ); +} +*/ + +/* + * Method: BString::_DoAssign() + * Descr: + */ +/*void +BString__DoAssign(BString *String, const char *value, + int32 lenght) +{ + String->_DoAssign(value,lenght + ); +} +*/ + +/* + * Method: BString::_DoAppend() + * Descr: + */ +/*void +BString__DoAppend(BString *String, const char *, + int32) +{ + String->_DoAppend(, + ); +} + +*/ +/* + * Method: BString::_GrowBy() + * Descr: + */ +/*char * +BString__GrowBy(BString *String, int32) +{ + return String->_GrowBy(); +} +*/ + +/* + * Method: BString::_OpenAtBy() + * Descr: + */ +/*char * +BString__OpenAtBy(BString *String, int32, + int32) +{ + return String->_OpenAtBy(, + ); +} +*/ + +/* + * Method: BString::_ShrinkAtBy() + * Descr: + */ +/*char * +BString__ShrinkAtBy(BString *String, int32, + int32) +{ + return String->_ShrinkAtBy(, + ); +} +*/ + +/* + * Method: BString::_DoPrepend() + * Descr: + */ +/*void +BString__DoPrepend(BString *String, const char *, + int32) +{ + String->_DoPrepend(, + ); +} +*/ + +/* + * Method: BString::_FindAfter() + * Descr: + */ +/*int32 +BString__FindAfter(BString *String, const char *, + int32, + int32) const +{ + return String->_FindAfter(, + , + ); +} +*/ + +/* + * Method: BString::_IFindAfter() + * Descr: + */ +/*int32 +BString__IFindAfter(BString *String, const char *, + int32, + int32) const +{ + return String->_IFindAfter(, + , + ); +} + +*/ +/* + * Method: BString::_ShortFindAfter() + * Descr: + */ +/*int32 +BString__ShortFindAfter(BString *String, const char *, + int32) const +{ + return String->_ShortFindAfter(, + ); +} +*/ + +/* + * Method: BString::_FindBefore() + * Descr: + */ +/*int32 +BString__FindBefore(BString *String, const char *, + int32, + int32) const +{ + return String->_FindBefore(, + , + ); +} +*/ + +/* + * Method: BString::_IFindBefore() + * Descr: + */ +/*int32 +BString__IFindBefore(BString *String, const char *, + int32, + int32) const +{ + return String->_IFindBefore(, + , + ); +} +*/ + +/* + * Method: BString::_SetLength() + * Descr: + */ +/*void +BString__SetLength(BString *String, int32) +{ + String->_SetLength(); +} +*/ + +/* + * Method: BString::_SetUsingAsCString() + * Descr: + */ +/*void +BString__SetUsingAsCString(BString *String, bool) +{ + String->_SetUsingAsCString(); +} +*/ + +/* + * Method: BString::_AssertNotUsingAsCString() + * Descr: + */ +/*void +BString__AssertNotUsingAsCString(BString *String) const +{ + String->_AssertNotUsingAsCString(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _STRING_CPP_ */ + + diff --git a/bepascal/bepascal/be/support/list.pp b/bepascal/bepascal/be/support/list.pp new file mode 100644 index 0000000..80535ea --- /dev/null +++ b/bepascal/bepascal/be/support/list.pp @@ -0,0 +1,187 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} + +unit List; + +interface + +uses + beobj, SupportDefs, os; + +type + TList = class(TBeObject) + private + public + constructor Create; override; + destructor Destroy; override; + + function AddItem(item : pointer): boolean; + function AddItem(item : pointer; atindex : cardinal): boolean; + function AddList(newitem : TCPlusObject): boolean; + function ItemAt(at : cardinal): pointer; + function ItemAtFast(at : cardinal): pointer; + function RemoveItem(item : pointer) : boolean; + function RemoveItem(index : cardinal) : boolean; + function RemoveItems(index,count : cardinal) : boolean; + procedure MakeEmpty; + function FirstItem : pointer; + function LastItem : pointer; + function HasItem (item : pointer) : boolean; + function IndexOf(item : pointer) : cardinal; + function CountItems : cardinal; + function IsEmpty : boolean; + function ReplaceItem(index : cardinal; newItem : pointer): boolean; + function SwapItems(IndexA,IndexB : cardinal) : boolean; + function MoveItem(FromIndex,ToIndex : cardinal) : boolean; + end; + + +function BList_Create( itemsPerBlock: cardinal) : TCPlusObject; cdecl; external BePascalLibName name 'BList_Create'; +procedure BList_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BList_Free'; + +function BList_AddItem(AObject : TCPlusObject; item : pointer):boolean;cdecl; external BePascalLibName name 'BList_AddItem'; +function BList_AddItem(AObject : TCPlusObject; item : pointer; atIndex : cardinal):boolean;cdecl; external BePascalLibName name 'BList_AddItem_1'; +function BList_AddList(AObject : TCPlusObject; newitem : TCPlusObject): boolean;cdecl; external BePascalLibName name 'BList_AddList'; +function BList_ItemAt(AObject : TCPlusObject; at : cardinal) : pointer;cdecl; external BePascalLibName name 'BList_ItemAt'; +function BList_ItemAtFast(AObject : TCPlusObject; at : cardinal) : pointer;cdecl; external BePascalLibName name 'BList_ItemAtFast_1'; +function BList_RemoveItem(AObject : TCPlusObject; item : pointer): boolean;cdecl; external BePascalLibName name 'BList_RemoveItem'; +function BList_RemoveItem(AObject : TCPlusObject; index : cardinal): boolean;cdecl; external BePascalLibName name 'BList_RemoveItem_1'; +function BList_RemoveItems(AObject : TCPlusObject; index,count : cardinal): boolean;cdecl; external BePascalLibName name 'BList_RemoveItems_2'; +procedure BList_MakeEmpty(AObject : TCPlusObject);cdecl; external BePascalLibName name 'BList_MakeEmpty'; +function BList_FirstItem(AObject : TCPlusObject): pointer; cdecl; external BePascalLibName name 'BList_FirstItem'; +function BList_LastItem(AObject : TCPlusObject): pointer; cdecl; external BePascalLibName name 'BList_LastItem'; +function BList_HasItem(AObject : TCPlusObject; item : pointer) : boolean; cdecl; external BePascalLibName name 'BList_HasItem'; +function BList_IndexOf(AObject : TCPlusObject; item : pointer) : cardinal;cdecl; external BePascalLibName name 'BList_IndexOf'; +function BList_CountItems(AObject : TCPlusObject) : cardinal;cdecl; external BePascalLibName name 'BList_CountItems'; +function BList_IsEmpty(AObject : TCPlusObject) : boolean;cdecl; external BePascalLibName name 'BList_IsEmpty'; + +function BList_ReplaceItem(AObject : TCPlusObject; index : cardinal; newItem: pointer): boolean;cdecl; external BePascalLibName name 'BList_ReplaceItem'; +function BList_SwapItems(AObject : TCPlusObject; indexA : cardinal; indexB : cardinal) : boolean;cdecl; external BePascalLibName name 'BList_SwapItems'; +function BList_MoveItem(AObject : TCPlusObject; fromindex : cardinal; Toindex : cardinal) : boolean;cdecl; external BePascalLibName name 'BList_MoveItem'; + + +implementation + + + +constructor TList.Create; +begin + inherited; + CPlusObject:=BList_Create( 10); // we can't made a parametre under a constructor -> error : init with 10 items per blocks +end; + + +destructor TList.Destroy; +begin + if CPlusObject <> nil then + BList_Free(CPlusObject); + inherited; +end; + +function TList.AddItem(item : pointer): boolean; +begin + result := BList_AddItem(CPlusObject, item ); +end; + +function TList.AddItem(item : pointer; atindex : cardinal): boolean; +begin + result := BList_AddItem(CPlusObject, item , atindex); +end; + +function TList.AddList(newitem : TCPlusObject): boolean; +begin + result:=BList_AddList(CPlusObject, newitem ); +end; + + +function TList.ItemAt(at : cardinal): pointer; +begin + result:=BList_ItemAt(CPlusObject, at ); +end; + +function TList.ItemAtFast(at : cardinal): pointer; +begin + result:=BList_ItemAtFast(CPlusObject, at ); +end; + +function TList.RemoveItem(item : pointer) : boolean; +begin + result:=BList_RemoveItem(CPlusObject, item); +end; + +function TList.RemoveItem(index : cardinal) : boolean; +begin + result:=BList_RemoveItem(CPlusObject, index); +end; + +function TList.RemoveItems(index,count : cardinal) : boolean; +begin + result:=BList_RemoveItems(CPlusObject, index,count); +end; + +procedure TList.MakeEmpty; +begin + BList_MakeEmpty(CPlusObject); +end; + +function TList.FirstItem : pointer; +begin + result:=BList_FirstItem(CPlusObject); +end; + +function TList.LastItem : pointer; +begin + result:=BList_LastItem(CPlusObject); +end; + +function TList.HasItem(item : pointer) : boolean; +begin + result:=BList_HasItem(CPlusObject,item); +end; + +function TList.IndexOf(item : pointer) : cardinal; +begin + result:=BList_IndexOf(CPlusObject,item); +end; + +function TList.CountItems : cardinal; +begin + result:=BList_CountItems(CPlusObject); +end; + +function TList.IsEmpty : boolean; +begin + result:=BList_IsEmpty(CPlusObject); +end; + +function TList.ReplaceItem(index : cardinal; newItem : pointer): boolean; +begin + result:=BList_ReplaceItem(CPlusObject, index , newItem); +end; + +function TList.SwapItems(IndexA,IndexB : cardinal) : boolean; +begin + result:=BList_SwapItems(CPlusObject,indexA,indexB); +end; + +function TList.MoveItem(FromIndex,ToIndex : cardinal) : boolean; +begin + result:=BList_MoveItem(CPlusObject,Fromindex,Toindex); +end; + +end. diff --git a/bepascal/bepascal/bepascal/bepascal.proj b/bepascal/bepascal/bepascal/bepascal.proj index 8ef20d0dbf2c07146cdd604b880b6410cc3e117a..74f9c7692414325ef948b6277e84b90e2d3015fa 100644 GIT binary patch delta 540 zcmZ2mxWAag*VDz7fx&Y7MvfPpEDie74U;bjIBquOy04-u@z*7wDD9md0~q{}m-u@* zm$!jMQR43xPU(i0+u~q0NU}pgVzZ;Z1QTgmCbt=Okfvj^wb4uxE!oUy+RW&|4Dka4 z17mP$K|y{|i9&W}2}21(Ljuq@B=~aj8MAZ+x6B+vpn3HS46Kq+a~VN&0}$ITzOs6< zorT)ug{GoDKAFWOddUR^48cWiIY3EiAZB0$s`X3EO$9Q!ftVevD1!lNXfp$Y*maOH uAV4;BE!faVGg1BElA_GKbYx>?!HN;a@&fssP-PjDjm*_a4CFR*bw&VQ-<7KX delta 366 zcmdmAyta_T*VDz7fx%+wMvfPpEEi77H%z`D;JDe8>%NMv%3qg&qO^B<3}Em>UghuQ zT;2v2MU}rfMe+?Tx5dG1kYtB~%4SD>2`19COl~vmAWg?+YonPYTC$nZw3*R^5#k31 q2FBphf`a^_5{2x{5{43nh6JE*Nbu$4GiK?NT`kl|boLAjbw&Wbh;-8c