OCC.TCollection module

class Handle_TCollection_HAsciiString(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_TCollection_HExtendedString(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_TCollection_MapNode(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_TCollection_SeqNode(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
thisown

The membership flag

value()
class TCollection_AsciiString(*args)

Bases: object

  • Initializes a AsciiString to an empty AsciiString.
Return type:None
  • Initializes a AsciiString with a CString.
Parameters:message (char *) –
Return type:None
  • Initializes a AsciiString with a CString.
Parameters:
  • message (char *) –
  • aLen (int) –
Return type:

None

  • Initializes a AsciiString with a single character.
Parameters:aChar (Standard_Character) –
Return type:None
  • Initializes an AsciiString with <length> space allocated. and filled with <filler>. This is usefull for buffers.
Parameters:
  • length (int) –
  • filler (Standard_Character) –
Return type:

None

  • Initializes an AsciiString with an integer value
Parameters:value (int) –
Return type:None
  • Initializes an AsciiString with a real value
Parameters:value (float) –
Return type:None
  • Initializes a AsciiString with another AsciiString.
Parameters:astring (TCollection_AsciiString &) –
Return type:None
  • Initializes a AsciiString with copy of another AsciiString concatenated with the message character.
Parameters:
  • astring (TCollection_AsciiString &) –
  • message (Standard_Character) –
Return type:

None

  • Initializes a AsciiString with copy of another AsciiString concatenated with the message string.
Parameters:
  • astring (TCollection_AsciiString &) –
  • message (char *) –
Return type:

None

  • Initializes a AsciiString with copy of another AsciiString concatenated with the message string.
Parameters:
  • astring (TCollection_AsciiString &) –
  • message (TCollection_AsciiString &) –
Return type:

None

  • Creation by converting an extended string to an ascii string. If replaceNonAscii is non-null charecter, it will be used in place of any non-ascii character found in the source string. Otherwise, creates UTF-8 unicode string.
Parameters:
  • astring (TCollection_ExtendedString &) –
  • replaceNonAscii (Standard_Character) – default value is 0
Return type:

None

AssignCat()
  • Appends <other> to me. This is an unary operator.
Parameters:other (Standard_Character) –
Return type:None
  • Appends <other> to me. This is an unary operator.
Parameters:other (int) –
Return type:None
  • Appends <other> to me. This is an unary operator.
Parameters:other (float) –
Return type:None
  • Appends <other> to me. This is an unary operator. ex: aString += ‘Dummy’ To catenate more than one CString, you must put a AsciiString before. Example: aString += ‘Hello ‘ + ‘Dolly’ IS NOT VALID ! But astring += anotherString + ‘Hello ‘ + ‘Dolly’ is valid.
Parameters:other (char *) –
Return type:None
  • Appends <other> to me. This is an unary operator. Example: aString += anotherString
Parameters:other (TCollection_AsciiString &) –
Return type:None
Capitalize()
  • Converts the first character into its corresponding upper-case character and the other characters into lowercase Example: before me = ‘hellO ‘ after me = ‘Hello ‘
Return type:None
Cat()
  • Appends <other> to me. Syntax: aString = aString + ‘Dummy’ Example: aString contains ‘I say ‘ aString = aString + ‘Hello ‘ + ‘Dolly’ gives ‘I say Hello Dolly’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
Parameters:other (Standard_Character) –
Return type:TCollection_AsciiString
  • Appends <other> to me. Syntax: aString = aString + 15; Example: aString contains ‘I say ‘ gives ‘I say 15’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
Parameters:other (int) –
Return type:TCollection_AsciiString
  • Appends <other> to me. Syntax: aString = aString + 15.15; Example: aString contains ‘I say ‘ gives ‘I say 15.15’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
Parameters:other (float) –
Return type:TCollection_AsciiString
  • Appends <other> to me. Syntax: aString = aString + ‘Dummy’ Example: aString contains ‘I say ‘ aString = aString + ‘Hello ‘ + ‘Dolly’ gives ‘I say Hello Dolly’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
Parameters:other (char *) –
Return type:TCollection_AsciiString
  • Appends <other> to me. Example: aString = aString + anotherString
Parameters:other (TCollection_AsciiString &) –
Return type:TCollection_AsciiString
Center()
  • Modifies this ASCII string so that its length becomes equal to Width and the new characters are equal to Filler. New characters are added both at the beginning and at the end of this string. If Width is less than the length of this ASCII string, nothing happens. Example TCollection_AsciiString myAlphabet(‘abcdef’); myAlphabet.Center(9,’ ‘); assert ( myAlphabet == ‘ abcdef ‘ );
Parameters:
  • Width (int) –
  • Filler (Standard_Character) –
Return type:

None

ChangeAll()
  • Substitutes all the characters equal to aChar by NewChar in the AsciiString <self>. The substitution can be case sensitive. If you don’t use default case sensitive, no matter wether aChar is uppercase or not. Example: me = ‘Histake’ -> ChangeAll(‘H’,’M’,Standard_True) gives me = ‘Mistake’
Parameters:
  • aChar (Standard_Character) –
  • NewChar (Standard_Character) –
  • CaseSensitive (bool) – default value is Standard_True
Return type:

None

Clear()
  • Removes all characters contained in <self>. This produces an empty AsciiString.
Return type:None
Copy()
  • Copy <fromwhere> to <self>. Used as operator = Example: aString = anotherCString;
Parameters:fromwhere (char *) –
Return type:None
  • Copy <fromwhere> to <self>. Used as operator = Example: aString = anotherString;
Parameters:fromwhere (TCollection_AsciiString &) –
Return type:None
Destroy()
  • Frees memory allocated by AsciiString.
Return type:None
FirstLocationInSet()
  • Returns the index of the first character of <self> that is present in <Set>. The search begins to the index FromIndex and ends to the the index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 1
Parameters:
  • Set (TCollection_AsciiString &) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

FirstLocationNotInSet()
  • Returns the index of the first character of <self> that is not present in the set <Set>. The search begins to the index FromIndex and ends to the the index ToIndex in <self>. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 3
Parameters:
  • Set (TCollection_AsciiString &) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

static HashCode(*args)
  • Hash function for AsciiString (returns the same Integer value that the hash function for ExtendedString)
Parameters:
  • astring (TCollection_AsciiString &) –
  • Upper (int) –
Return type:

int

Insert()
  • Inserts a Character at position <where>. Example: aString contains ‘hy not ?’ aString.Insert(1,’W’); gives ‘Why not ?’ aString contains ‘Wh’ aString.Insert(3,’y’); gives ‘Why’ aString contains ‘Way’ aString.Insert(2,’h’); gives ‘Why’
Parameters:
  • where (int) –
  • what (Standard_Character) –
Return type:

None

  • Inserts a CString at position <where>. Example: aString contains ‘O more’ aString.Insert(2,’nce’); gives ‘Once more’
Parameters:
  • where (int) –
  • what (char *) –
Return type:

None

  • Inserts a AsciiString at position <where>.
Parameters:
  • where (int) –
  • what (TCollection_AsciiString &) –
Return type:

None

InsertAfter()
  • Pushing a string after a specific index in the string <self>. Raises an exception if Index is out of bounds. - less than 0 (InsertAfter), or less than 1 (InsertBefore), or - greater than the number of characters in this ASCII string. Example: before me = ‘cde’ , Index = 0 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
Parameters:
  • Index (int) –
  • other (TCollection_AsciiString &) –
Return type:

None

InsertBefore()
  • Pushing a string before a specific index in the string <self>. Raises an exception if Index is out of bounds. - less than 0 (InsertAfter), or less than 1 (InsertBefore), or - greater than the number of characters in this ASCII string. Example: before me = ‘cde’ , Index = 1 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
Parameters:
  • Index (int) –
  • other (TCollection_AsciiString &) –
Return type:

None

IntegerValue()
  • Converts a AsciiString containing a numeric expression to an Integer. Example: ‘215’ returns 215.
Return type:int
IsAscii()
  • Returns True if the AsciiString contains only ASCII characters between ‘ ‘ and ‘~’. This means no control character and no extended ASCII code.
Return type:bool
IsDifferent()
  • Returns true if there are differences between the characters in this ASCII string and ASCII string other. Note that this method is an alias of operator !=
Parameters:other (char *) –
Return type:bool
  • Returns true if there are differences between the characters in this ASCII string and ASCII string other. Note that this method is an alias of operator !=
Parameters:other (TCollection_AsciiString &) –
Return type:bool
IsEmpty()
  • Returns True if the string <self> contains zero character.
Return type:bool
static IsEqual(*args)
  • Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.
Parameters:other (char *) –
Return type:bool
  • Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.
Parameters:other (TCollection_AsciiString &) –
Return type:bool
  • Returns True when the two strings are the same. (Just for HashCode for AsciiString)
Parameters:
  • string1 (TCollection_AsciiString &) –
  • string2 (TCollection_AsciiString &) –
Return type:

bool

  • Returns True when the two strings are the same. (Just for HashCode for AsciiString)
Parameters:
  • string1 (TCollection_AsciiString &) –
  • string2 (char *) –
Return type:

bool

IsGreater()
  • Returns True if <self> is ‘ASCII’ greater than <other>.
Parameters:other (char *) –
Return type:bool
  • Returns True if <self> is ‘ASCII’ greater than <other>.
Parameters:other (TCollection_AsciiString &) –
Return type:bool
IsIntegerValue()
  • Returns True if the AsciiString contains an integer value. Note: an integer value is considered to be a real value as well.
Return type:bool
IsLess()
  • Returns True if <self> is ‘ASCII’ less than <other>.
Parameters:other (char *) –
Return type:bool
  • Returns True if <self> is ‘ASCII’ less than <other>.
Parameters:other (TCollection_AsciiString &) –
Return type:bool
IsRealValue()
  • Returns True if the AsciiString contains a real value. Note: an integer value is considered to be a real value as well.
Return type:bool
LeftAdjust()
  • Removes all space characters in the begining of the string.
Return type:None
LeftJustify()
  • left justify Length becomes equal to Width and the new characters are equal to Filler. If Width < Length nothing happens. Raises an exception if Width is less than zero. Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘abcdef ‘
Parameters:
  • Width (int) –
  • Filler (Standard_Character) –
Return type:

None

Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C. Example TCollection_AsciiString myAlphabet(‘abcdef’); assert ( myAlphabet.Length() == 6 ); - 1 is the position of the first character in this string. - The length of this string gives the position of its last character. - Positions less than or equal to zero, or greater than the length of this string are invalid in functions which identify a character of this string by its position.
Return type:int
Location()
  • Returns an index in the string <self> of the first occurence of the string S in the string <self> from the starting index FromIndex to the ending index ToIndex returns zero if failure Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAaAa’, S = ‘Aa’, FromIndex = 1, ToIndex = 7 after me = ‘aabAaAa’ returns 4
Parameters:
  • other (TCollection_AsciiString &) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

  • Returns the index of the nth occurence of the character C in the string <self> from the starting index FromIndex to the ending index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAa’, N = 3, C = ‘a’, FromIndex = 1, ToIndex = 5 after me = ‘aabAa’ returns 5
Parameters:
  • N (int) –
  • C (Standard_Character) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

LowerCase()
  • Converts <self> to its lower-case equivalent. Example TCollection_AsciiString myString(‘Hello Dolly’); myString.UpperCase(); assert ( myString == ‘HELLO DOLLY’ ); myString.LowerCase(); assert ( myString == ‘hello dolly’ );
Return type:None
Prepend()
  • Inserts the string other at the beginning of this ASCII string. Example TCollection_AsciiString myAlphabet(‘cde’); TCollection_AsciiString myBegin(‘ab’); myAlphabet.Prepend(myBegin); assert ( myAlphabet == ‘abcde’ );
Parameters:other (TCollection_AsciiString &) –
Return type:None
PrintToString()

TCollection_AsciiString_PrintToString(TCollection_AsciiString self) -> std::string

ReadFromString()

TCollection_AsciiString_ReadFromString(TCollection_AsciiString self, std::string src)

RealValue()
  • Converts an AsciiString containing a numeric expression. to a Real. Example: ex: ‘215’ returns 215.0. ex: ‘3.14159267’ returns 3.14159267.
Return type:float
Remove()
  • Erases <ahowmany> characters from position <where>, <where> included. Example: aString contains ‘Hello’ aString.Remove(2,2) erases 2 characters from position 2 This gives ‘Hlo’.
Parameters:
  • where (int) –
  • ahowmany (int) – default value is 1
Return type:

None

RemoveAll()
  • Remove all the occurences of the character C in the string. Example: before me = ‘HellLLo’, C = ‘L’ , CaseSensitive = True after me = ‘Hello’
Parameters:
  • C (Standard_Character) –
  • CaseSensitive (bool) –
Return type:

None

  • Removes every <what> characters from <self>.
Parameters:what (Standard_Character) –
Return type:None
RightAdjust()
  • Removes all space characters at the end of the string.
Return type:None
RightJustify()
  • Right justify. Length becomes equal to Width and the new characters are equal to Filler. if Width < Length nothing happens. Raises an exception if Width is less than zero. Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘ abcdef’
Parameters:
  • Width (int) –
  • Filler (Standard_Character) –
Return type:

None

Search()
  • Searches a CString in <self> from the beginning and returns position of first item <what> matching. it returns -1 if not found. Example: aString contains ‘Sample single test’ aString.Search(‘le’) returns 5
Parameters:what (char *) –
Return type:int
  • Searches an AsciiString in <self> from the beginning and returns position of first item <what> matching. It returns -1 if not found.
Parameters:what (TCollection_AsciiString &) –
Return type:int
SearchFromEnd()
  • Searches a CString in a AsciiString from the end and returns position of first item <what> matching. It returns -1 if not found. Example: aString contains ‘Sample single test’ aString.SearchFromEnd(‘le’) returns 12
Parameters:what (char *) –
Return type:int
  • Searches a AsciiString in another AsciiString from the end and returns position of first item <what> matching. It returns -1 if not found.
Parameters:what (TCollection_AsciiString &) –
Return type:int
Set()
Parameters:
  • fromwhere (TCollection_AsciiString &) –
  • fromwhere
Return type:

None

Return type:

None

SetValue()
  • Replaces one character in the AsciiString at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
Parameters:
  • where (int) –
  • what (Standard_Character) –
Return type:

None

  • Replaces a part of <self> by a CString. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘abcde’ aString.SetValue(4,‘1234567’) gives <self> = ‘abc1234567’
Parameters:
  • where (int) –
  • what (char *) –
Return type:

None

  • Replaces a part of <self> by another AsciiString.
Parameters:
  • where (int) –
  • what (TCollection_AsciiString &) –
Return type:

None

Split()
  • Splits a AsciiString into two sub-strings. Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
Parameters:where (int) –
Return type:TCollection_AsciiString
SubString()
  • Creation of a sub-string of the string <self>. The sub-string starts to the index Fromindex and ends to the index ToIndex. Raises an exception if ToIndex or FromIndex is out of bounds Example: before me = ‘abcdefg’, ToIndex=3, FromIndex=6 after me = ‘abcdefg’ returns ‘cdef’
Parameters:
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

TCollection_AsciiString

ToCString()
  • Returns pointer to AsciiString (char *). This is useful for some casual manipulations. Warning: Because this ‘char *‘ is ‘const’, you can’t modify its contents.
Return type:char *
Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns empty AsciiString. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowed : aString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
Parameters:
  • separators (char *) – default value is ‘ ‘
  • whichone (int) – default value is 1
Return type:

TCollection_AsciiString

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’
Parameters:ahowmany (int) –
Return type:None
UpperCase()
  • Converts <self> to its upper-case equivalent.
Return type:None
UsefullLength()
  • Length of the string ignoring all spaces (‘ ‘) and the control character at the end.
Return type:int
Value()
  • Returns character at position <where> in <self>. If <where> is less than zero or greater than the lenght of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’
Parameters:where (int) –
Return type:Standard_Character
thisown

The membership flag

TCollection_AsciiString_HashCode(*args)
  • Hash function for AsciiString (returns the same Integer value that the hash function for ExtendedString)
Parameters:
  • astring (TCollection_AsciiString &) –
  • Upper (int) –
Return type:

int

TCollection_AsciiString_IsEqual(*args)
  • Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.
Parameters:other (char *) –
Return type:bool
  • Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.
Parameters:other (TCollection_AsciiString &) –
Return type:bool
  • Returns True when the two strings are the same. (Just for HashCode for AsciiString)
Parameters:
  • string1 (TCollection_AsciiString &) –
  • string2 (TCollection_AsciiString &) –
Return type:

bool

  • Returns True when the two strings are the same. (Just for HashCode for AsciiString)
Parameters:
  • string1 (TCollection_AsciiString &) –
  • string2 (char *) –
Return type:

bool

class TCollection_BaseSequence(*args, **kwargs)

Bases: object

Exchange()
  • Swaps elements which are located at positions <I> and <J> in <self>. Raises an exception if I or J is out of bound. Example: before me = (A B C), I = 1, J = 3 after me = (C B A)
Parameters:
Return type:

None

IsEmpty()
  • returns True if the sequence <self> contains no elements.
Return type:bool
Length()
  • Returns the number of element(s) in the sequence. Returns zero if the sequence is empty.
Return type:int
Reverse()
  • Reverses the order of items on <self>. Example: before me = (A B C) after me = (C B A)
Return type:None
thisown

The membership flag

class TCollection_BasicMap(*args, **kwargs)

Bases: object

Extent()
  • Returns the number of keys already stored in <self>.
Return type:int
IsEmpty()
  • Returns True when the map contains no keys. This is exactly Extent() == 0.
Return type:bool
NbBuckets()
  • Returns the number of buckets in <self>.
Return type:int
StatisticsToString()

TCollection_BasicMap_StatisticsToString(TCollection_BasicMap self) -> std::string

thisown

The membership flag

class TCollection_BasicMapIterator(*args, **kwargs)

Bases: object

More()
  • Returns true if there is a current entry for this iterator in the map. Use the function Next to set this iterator to the position of the next entry, if it exists.
Return type:bool
Next()
  • Sets this iterator to the position of the next entry of the map. Nothing is changed if there is no more entry to explore in the map: this iterator is always positioned on the last entry of the map but the function More returns false.
Return type:None
Reset()
  • Resets the iterator to the first node.
Return type:None
thisown

The membership flag

class TCollection_CompareOfInteger(*args)

Bases: OCC.TCollection.TCollection_PrivCompareOfInteger

Return type:None
thisown

The membership flag

class TCollection_CompareOfReal(*args)

Bases: OCC.TCollection.TCollection_PrivCompareOfReal

Return type:None
thisown

The membership flag

class TCollection_ExtendedString(*args)

Bases: object

  • Initializes a ExtendedString to an empty ExtendedString.
Return type:None
  • Creation by converting a CString to an extended string. If <isMultiByte> is true then the string is treated as having UTF-8 coding. If it is not a UTF-8 then <isMultiByte> is ignored and each character is copied to ExtCharacter.
Parameters:
  • astring (char *) –
  • isMultiByte (bool) – default value is Standard_False
Return type:

None

  • Creation by converting an ExtString to an extended string.
Parameters:astring (Standard_ExtString) –
Return type:None
  • Initializes a AsciiString with a single character.
Parameters:aChar (Standard_Character) –
Return type:None
  • Initializes a ExtendedString with a single character.
Parameters:aChar (Standard_ExtCharacter) –
Return type:None
  • Initializes a ExtendedString with <length> space allocated. and filled with <filler>.This is useful for buffers.
Parameters:
  • length (int) –
  • filler (Standard_ExtCharacter) –
Return type:

None

  • Initializes an ExtendedString with an integer value
Parameters:value (int) –
Return type:None
  • Initializes an ExtendedString with a real value
Parameters:value (float) –
Return type:None
  • Initializes a ExtendedString with another ExtendedString.
Parameters:astring (TCollection_ExtendedString &) –
Return type:None
  • Creation by converting an Ascii string to an extended string. The string is treated as having UTF-8 coding. If it is not a UTF-8 then each character is copied to ExtCharacter.
Parameters:astring (TCollection_AsciiString &) –
Return type:None
AssignCat()
  • Appends the other extended string to this extended string. Note that this method is an alias of operator +=. Example: aString += anotherString
Parameters:other (TCollection_ExtendedString &) –
Return type:None
Cat()
  • Appends <other> to me.
Parameters:other (TCollection_ExtendedString &) –
Return type:TCollection_ExtendedString
ChangeAll()
  • Substitutes all the characters equal to aChar by NewChar in the ExtendedString <self>. The substitution can be case sensitive. If you don’t use default case sensitive, no matter wether aChar is uppercase or not.
Parameters:
  • aChar (Standard_ExtCharacter) –
  • NewChar (Standard_ExtCharacter) –
Return type:

None

Clear()
  • Removes all characters contained in <self>. This produces an empty ExtendedString.
Return type:None
Copy()
  • Copy <fromwhere> to <self>. Used as operator =
Parameters:fromwhere (TCollection_ExtendedString &) –
Return type:None
Destroy()
  • Frees memory allocated by ExtendedString.
Return type:None
static HashCode(*args)
  • Returns a hashed value for the extended string astring within the range 1..Upper. Note: if astring is ASCII, the computed value is the same as the value computed with the HashCode function on a TCollection_AsciiString string composed with equivalent ASCII characters
Parameters:
  • astring (TCollection_ExtendedString &) –
  • Upper (int) –
Return type:

int

Insert()
  • Insert a Character at position <where>.
Parameters:
  • where (int) –
  • what (Standard_ExtCharacter) –
Return type:

None

  • Insert a ExtendedString at position <where>.
Parameters:
  • where (int) –
  • what (TCollection_ExtendedString &) –
Return type:

None

IsAscii()
  • Returns True if the ExtendedString contains only ‘Ascii Range’ characters .
Return type:bool
IsDifferent()
  • Returns true if there are differences between the characters in this extended string and the other extended string. Note that this method is an alias of operator !=.
Parameters:other (Standard_ExtString) –
Return type:bool
  • Returns true if there are differences between the characters in this extended string and the other extended string. Note that this method is an alias of operator !=.
Parameters:other (TCollection_ExtendedString &) –
Return type:bool
static IsEqual(*args)
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==
Parameters:other (Standard_ExtString) –
Return type:bool
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==
Parameters:other (TCollection_ExtendedString &) –
Return type:bool
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==.
Parameters:
  • string1 (TCollection_ExtendedString &) –
  • string2 (TCollection_ExtendedString &) –
Return type:

bool

IsGreater()
  • Returns True if <self> is greater than <other>.
Parameters:other (Standard_ExtString) –
Return type:bool
  • Returns True if <self> is greater than <other>.
Parameters:other (TCollection_ExtendedString &) –
Return type:bool
IsLess()
  • Returns True if <self> is less than <other>.
Parameters:other (Standard_ExtString) –
Return type:bool
  • Returns True if <self> is less than <other>.
Parameters:other (TCollection_ExtendedString &) –
Return type:bool
Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C.
Return type:int
LengthOfCString()
  • Returns expected CString length in UTF8 coding. It can be used for memory calculation before converting to CString containing symbols in UTF8 coding.
Return type:int
PrintToString()

TCollection_ExtendedString_PrintToString(TCollection_ExtendedString self) -> std::string

Remove()
  • Erases <ahowmany> characters from position <where>,<where> included.
Parameters:
  • where (int) –
  • ahowmany (int) – default value is 1
Return type:

None

RemoveAll()
  • Removes every <what> characters from <self>.
Parameters:what (Standard_ExtCharacter) –
Return type:None
Search()
  • Searches a ExtendedString in <self> from the beginning and returns position of first item <what> matching. it returns -1 if not found.
Parameters:what (TCollection_ExtendedString &) –
Return type:int
SearchFromEnd()
  • Searches a ExtendedString in another ExtendedString from the end and returns position of first item <what> matching. it returns -1 if not found.
Parameters:what (TCollection_ExtendedString &) –
Return type:int
Set()
Parameters:fromwhere (TCollection_ExtendedString &) –
Return type:None
SetValue()
  • Replaces one character in the ExtendedString at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised.
Parameters:
  • where (int) –
  • what (Standard_ExtCharacter) –
Return type:

None

  • Replaces a part of <self> by another ExtendedString see above.
Parameters:
  • where (int) –
  • what (TCollection_ExtendedString &) –
Return type:

None

Split()
  • Splits this extended string into two sub-strings at position where. - The second sub-string (from position where + 1 of this string to the end) is returned in a new extended string. - this extended string is modified: its last characters are removed, it becomes equal to the first sub-string (from the first character to position where). Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
Parameters:where (int) –
Return type:TCollection_ExtendedString
ToExtString()
  • Returns pointer to ExtString
Return type:Standard_ExtString
ToUTF8CString()
  • Converts the internal <mystring> to UTF8 coding and returns length of the out CString. A memory for the <theCString> should be allocated before call!
Parameters:theCString (Standard_PCharacter &) –
Return type:int
Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns an empty AsciiString. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowed : aString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
Parameters:
  • separators (Standard_ExtString) –
  • whichone (int) – default value is 1
Return type:

TCollection_ExtendedString

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’ Exceptions Standard_OutOfRange if ahowmany is greater than the length of this string.
Parameters:ahowmany (int) –
Return type:None
Value()
  • Returns character at position <where> in <self>. If <where> is less than zero or greater than the lenght of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’ Exceptions Standard_OutOfRange if where lies outside the bounds of this extended string.
Parameters:where (int) –
Return type:Standard_ExtCharacter
thisown

The membership flag

TCollection_ExtendedString_HashCode(*args)
  • Returns a hashed value for the extended string astring within the range 1..Upper. Note: if astring is ASCII, the computed value is the same as the value computed with the HashCode function on a TCollection_AsciiString string composed with equivalent ASCII characters
Parameters:
  • astring (TCollection_ExtendedString &) –
  • Upper (int) –
Return type:

int

TCollection_ExtendedString_IsEqual(*args)
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==
Parameters:other (Standard_ExtString) –
Return type:bool
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==
Parameters:other (TCollection_ExtendedString &) –
Return type:bool
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==.
Parameters:
  • string1 (TCollection_ExtendedString &) –
  • string2 (TCollection_ExtendedString &) –
Return type:

bool

class TCollection_HAsciiString(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Initializes a HAsciiString to an empty AsciiString.
Return type:None
  • Initializes a HAsciiString with a CString.
Parameters:message (char *) –
Return type:None
  • Initializes a HAsciiString with a single character.
Parameters:aChar (Standard_Character) –
Return type:None
  • Initializes a HAsciiString with <length> space allocated. and filled with <filler>.This is useful for buffers.
Parameters:
  • length (int) –
  • filler (Standard_Character) –
Return type:

None

  • Initializes a HAsciiString with an integer value
Parameters:value (int) –
Return type:None
  • Initializes a HAsciiString with a real value
Parameters:value (float) –
Return type:None
  • Initializes a HAsciiString with a HAsciiString.
Parameters:aString (TCollection_AsciiString &) –
Return type:None
  • Initializes a HAsciiString with a HAsciiString.
Parameters:aString (Handle_TCollection_HAsciiString &) –
Return type:None
  • Initializes a HAsciiString with a HAsciiString. If replaceNonAscii is non-null charecter, it will be used in place of any non-ascii character found in the source string. Otherwise, raises OutOfRange exception if at least one character in the source string is not in the ‘Ascii range’.
Parameters:
  • aString (Handle_TCollection_HExtendedString &) –
  • replaceNonAscii (Standard_Character) –
Return type:

None

AssignCat()
  • Appends <other> to me.
Parameters:other (char *) –
Return type:None
  • Appends <other> to me. Example: aString = aString + anotherString
Parameters:other (Handle_TCollection_HAsciiString &) –
Return type:None
Capitalize()
  • Converts the first character into its corresponding upper-case character and the other characters into lowercase. Example: before me = ‘hellO ‘ after me = ‘Hello ‘
Return type:None
Cat()
  • Creates a new string by concatenation of this ASCII string and the other ASCII string. Example: aString = aString + anotherString aString = aString + ‘Dummy’ aString contains ‘I say ‘ aString = aString + ‘Hello ‘ + ‘Dolly’ gives ‘I say Hello Dolly’ Warning: To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
Parameters:other (char *) –
Return type:Handle_TCollection_HAsciiString
  • Creates a new string by concatenation of this ASCII string and the other ASCII string. Example: aString = aString + anotherString
Parameters:other (Handle_TCollection_HAsciiString &) –
Return type:Handle_TCollection_HAsciiString
Center()
  • Modifies this ASCII string so that its length becomes equal to Width and the new characters are equal to Filler. New characters are added both at the beginning and at the end of this string. If Width is less than the length of this ASCII string, nothing happens. Example Handle_TCollection_HAsciiString myAlphabet = new TCollection_HAsciiString (‘abcdef’); myAlphabet->Center(9,’ ‘); assert ( !strcmp( myAlphabet->ToCString(), ‘ abcdef ‘) );
Parameters:
  • Width (int) –
  • Filler (Standard_Character) –
Return type:

None

ChangeAll()
  • Replaces all characters equal to aChar by NewChar in this ASCII string. The substitution is case sensitive if CaseSensitive is true (default value). If you do not use the default case sensitive option, it does not matter whether aChar is upper-case or not. Example Handle_TCollection_HAsciiString myMistake = new TCollection_HAsciiString (‘Hather’); myMistake->ChangeAll(‘H’,’F’); assert ( !strcmp( myMistake->ToCString(), ‘Father’) );
Parameters:
  • aChar (Standard_Character) –
  • NewChar (Standard_Character) –
  • CaseSensitive (bool) – default value is Standard_True
Return type:

None

Clear()
  • Removes all characters contained in <self>. This produces an empty HAsciiString.
Return type:None
FirstLocationInSet()
  • Returns the index of the first character of <self> that is present in <Set>. The search begins to the index FromIndex and ends to the the index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 1
Parameters:
  • Set (Handle_TCollection_HAsciiString &) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

FirstLocationNotInSet()
  • Returns the index of the first character of <self> that is not present in the set <Set>. The search begins to the index FromIndex and ends to the the index ToIndex in <self>. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 3
Parameters:
  • Set (Handle_TCollection_HAsciiString &) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

GetHandle()
Insert()
  • Insert a Character at position <where>. Example: aString contains ‘hy not ?’ aString.Insert(1,’W’); gives ‘Why not ?’ aString contains ‘Wh’ aString.Insert(3,’y’); gives ‘Why’ aString contains ‘Way’ aString.Insert(2,’h’); gives ‘Why’
Parameters:
  • where (int) –
  • what (Standard_Character) –
Return type:

None

  • Insert a HAsciiString at position <where>.
Parameters:
  • where (int) –
  • what (char *) –
Return type:

None

  • Insert a HAsciiString at position <where>.
Parameters:
  • where (int) –
  • what (Handle_TCollection_HAsciiString &) –
Return type:

None

InsertAfter()
  • Inserts the other ASCII string a after a specific index in the string <self> Example: before me = ‘cde’ , Index = 0 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
Parameters:
  • Index (int) –
  • other (Handle_TCollection_HAsciiString &) –
Return type:

None

InsertBefore()
  • Inserts the other ASCII string a before a specific index in the string <self> Raises an exception if Index is out of bounds Example: before me = ‘cde’ , Index = 1 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
Parameters:
  • Index (int) –
  • other (Handle_TCollection_HAsciiString &) –
Return type:

None

IntegerValue()
  • Converts a HAsciiString containing a numeric expression to an Integer. Example: ‘215’ returns 215.
Return type:int
IsAscii()
  • Returns True if the string contains only ASCII characters between ‘ ‘ and ‘~’. This means no control character and no extended ASCII code.
Return type:bool
IsDifferent()
  • Returns True if the string S not contains same characters than the string <self>.
Parameters:S (Handle_TCollection_HAsciiString &) –
Return type:bool
IsEmpty()
  • Returns True if the string <self> contains zero character
Return type:bool
IsGreater()
  • Returns True if <self> is ‘ASCII’ greater than <other>.
Parameters:other (Handle_TCollection_HAsciiString &) –
Return type:bool
IsIntegerValue()
  • Returns True if the string contains an integer value.
Return type:bool
IsLess()
  • Returns True if <self> is ‘ASCII’ less than <other>.
Parameters:other (Handle_TCollection_HAsciiString &) –
Return type:bool
IsRealValue()
  • Returns True if the string contains a real value.
Return type:bool
IsSameState()
Parameters:other (Handle_TCollection_HAsciiString &) –
Return type:bool
IsSameString()
  • Returns True if the string S contains same characters than the string <self>.
Parameters:S (Handle_TCollection_HAsciiString &) –
Return type:bool
  • Returns True if the string S contains same characters than the string <self>.
Parameters:
  • S (Handle_TCollection_HAsciiString &) –
  • CaseSensitive (bool) –
Return type:

bool

LeftAdjust()
  • Removes all space characters in the begining of the string
Return type:None
LeftJustify()
  • Left justify. Length becomes equal to Width and the new characters are equal to Filler if Width < Length nothing happens Raises an exception if Width is less than zero Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘abcdef ‘
Parameters:
  • Width (int) –
  • Filler (Standard_Character) –
Return type:

None

Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C.
Return type:int
Location()
  • returns an index in the string <self> of the first occurence of the string S in the string <self> from the starting index FromIndex to the ending index ToIndex returns zero if failure Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAaAa’, S = ‘Aa’, FromIndex = 1, ToIndex = 7 after me = ‘aabAaAa’ returns 4
Parameters:
  • other (Handle_TCollection_HAsciiString &) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

  • Returns the index of the nth occurence of the character C in the string <self> from the starting index FromIndex to the ending index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range Example: before me = ‘aabAa’, N = 3, C = ‘a’, FromIndex = 1, ToIndex = 5 after me = ‘aabAa’ returns 5
Parameters:
  • N (int) –
  • C (Standard_Character) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

int

LowerCase()
  • Converts <self> to its lower-case equivalent.
Return type:None
Prepend()
  • Inserts the other string at the begining of the string <self> Example: before me = ‘cde’ , S = ‘ab’ after me = ‘abcde’ , S = ‘ab’
Parameters:other (Handle_TCollection_HAsciiString &) –
Return type:None
PrintToString()

TCollection_HAsciiString_PrintToString(TCollection_HAsciiString self) -> std::string

RealValue()
  • Converts a string containing a numeric expression to a Real. Example: ‘215’ returns 215.0. ‘3.14159267’ returns 3.14159267.
Return type:float
Remove()
  • Erases <ahowmany> characters from position <where>, <where> included. Example: aString contains ‘Hello’ aString.Erase(2,2) erases 2 characters from position 1 This gives ‘Hlo’.
Parameters:
  • where (int) –
  • ahowmany (int) – default value is 1
Return type:

None

RemoveAll()
  • Remove all the occurences of the character C in the string Example: before me = ‘HellLLo’, C = ‘L’ , CaseSensitive = True after me = ‘Hello’
Parameters:
  • C (Standard_Character) –
  • CaseSensitive (bool) –
Return type:

None

  • Removes every <what> characters from <self>
Parameters:what (Standard_Character) –
Return type:None
RightAdjust()
  • Removes all space characters at the end of the string.
Return type:None
RightJustify()
  • Right justify. Length becomes equal to Width and the new characters are equal to Filler if Width < Length nothing happens Raises an exception if Width is less than zero Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘ abcdef’
Parameters:
  • Width (int) –
  • Filler (Standard_Character) –
Return type:

None

Search()
  • Searches a CString in <self> from the beginning and returns position of first item <what> matching. It returns -1 if not found. Example: aString contains ‘Sample single test’ aString.Search(‘le’) returns 5
Parameters:what (char *) –
Return type:int
  • Searches a String in <self> from the beginning and returns position of first item <what> matching. it returns -1 if not found.
Parameters:what (Handle_TCollection_HAsciiString &) –
Return type:int
SearchFromEnd()
  • Searches a CString in a String from the end and returns position of first item <what> matching. It returns -1 if not found. Example: aString contains ‘Sample single test’ aString.SearchFromEnd(‘le’) returns 12
Parameters:what (char *) –
Return type:int
  • Searches a HAsciiString in another HAsciiString from the end and returns position of first item <what> matching. It returns -1 if not found.
Parameters:what (Handle_TCollection_HAsciiString &) –
Return type:int
SetValue()
  • Replaces one character in the string at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
Parameters:
  • where (int) –
  • what (Standard_Character) –
Return type:

None

  • Replaces a part of <self> in the string at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
Parameters:
  • where (int) –
  • what (char *) –
Return type:

None

  • Replaces a part of <self> by another string.
Parameters:
  • where (int) –
  • what (Handle_TCollection_HAsciiString &) –
Return type:

None

Split()
  • Splits a HAsciiString into two sub-strings. Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
Parameters:where (int) –
Return type:Handle_TCollection_HAsciiString
String()
  • Returns the field myString.
Return type:TCollection_AsciiString
SubString()
  • Creation of a sub-string of the string <self>. The sub-string starts to the index Fromindex and ends to the index ToIndex. Raises an exception if ToIndex or FromIndex is out of bounds Example: before me = ‘abcdefg’, ToIndex=3, FromIndex=6 after me = ‘abcdefg’ returns ‘cdef’
Parameters:
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

Handle_TCollection_HAsciiString

ToCString()
  • Returns pointer to string (char *) This is useful for some casual manipulations Because this ‘char *‘ is ‘const’, you can’t modify its contents.
Return type:char *
Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns an empty String. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowed aString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
Parameters:
  • separators (char *) – default value is ‘ ‘
  • whichone (int) – default value is 1
Return type:

Handle_TCollection_HAsciiString

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’
Parameters:ahowmany (int) –
Return type:None
UpperCase()
  • Converts <self> to its upper-case equivalent.
Return type:None
UsefullLength()
  • Length of the string ignoring all spaces (‘ ‘) and the control character at the end.
Return type:int
Value()
  • Returns character at position <where> in <self>. If <where> is less than zero or greater than the lenght of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’
Parameters:where (int) –
Return type:Standard_Character
thisown

The membership flag

class TCollection_HExtendedString(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Initializes a HExtendedString to an empty ExtendedString.
Return type:None
  • Initializes a HExtendedString with a CString.
Parameters:message (char *) –
Return type:None
  • Initializes a HExtendedString with an ExtString.
Parameters:message (Standard_ExtString) –
Return type:None
  • Initializes a HExtendedString with a single character.
Parameters:aChar (Standard_ExtCharacter) –
Return type:None
  • Initializes a HExtendedString with <length> space allocated. and filled with <filler>.This is usefull for buffers.
Parameters:
  • length (int) –
  • filler (Standard_ExtCharacter) –
Return type:

None

  • Initializes a HExtendedString with a HExtendedString.
Parameters:aString (TCollection_ExtendedString &) –
Return type:None
  • Initializes a HExtendedString with an HAsciiString.
Parameters:aString (Handle_TCollection_HAsciiString &) –
Return type:None
  • Initializes a HExtendedString with a HExtendedString.
Parameters:aString (Handle_TCollection_HExtendedString &) –
Return type:None
AssignCat()
  • Appends <other> to me.
Parameters:other (Handle_TCollection_HExtendedString &) –
Return type:None
Cat()
  • Returns a string appending <other> to me.
Parameters:other (Handle_TCollection_HExtendedString &) –
Return type:Handle_TCollection_HExtendedString
ChangeAll()
  • Substitutes all the characters equal to aChar by NewChar in the string <self>.
Parameters:
  • aChar (Standard_ExtCharacter) –
  • NewChar (Standard_ExtCharacter) –
Return type:

None

Clear()
  • Removes all characters contained in <self>. This produces an empty ExtendedString.
Return type:None
GetHandle()
Insert()
  • Insert a ExtCharacter at position <where>. Example: aString contains ‘hy not ?’ aString.Insert(1,’W’); gives ‘Why not ?’ aString contains ‘Wh’ aString.Insert(3,’y’); gives ‘Why’ aString contains ‘Way’ aString.Insert(2,’h’); gives ‘Why’
Parameters:
  • where (int) –
  • what (Standard_ExtCharacter) –
Return type:

None

  • Insert a HExtendedString at position <where>.
Parameters:
  • where (int) –
  • what (Handle_TCollection_HExtendedString &) –
Return type:

None

IsAscii()
  • Returns True if the string contains only ‘Ascii Range’ characters
Return type:bool
IsEmpty()
  • Returns True if the string <self> contains zero character
Return type:bool
IsGreater()
  • Returns True if <self> is greater than <other>.
Parameters:other (Handle_TCollection_HExtendedString &) –
Return type:bool
IsLess()
  • Returns True if <self> is less than <other>.
Parameters:other (Handle_TCollection_HExtendedString &) –
Return type:bool
IsSameState()
Parameters:other (Handle_TCollection_HExtendedString &) –
Return type:bool
Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C.
Return type:int
PrintToString()

TCollection_HExtendedString_PrintToString(TCollection_HExtendedString self) -> std::string

Remove()
  • Erases <ahowmany> characters from position <where>, <where> included. Example: aString contains ‘Hello’ aString.Erase(2,2) erases 2 characters from position 1 This gives ‘Hlo’.
Parameters:
  • where (int) –
  • ahowmany (int) – default value is 1
Return type:

None

RemoveAll()
  • Removes every <what> characters from <self>.
Parameters:what (Standard_ExtCharacter) –
Return type:None
Search()
  • Searches a String in <self> from the beginning and returns position of first item <what> matching. It returns -1 if not found.
Parameters:what (Handle_TCollection_HExtendedString &) –
Return type:int
SearchFromEnd()
  • Searches a ExtendedString in another ExtendedString from the end and returns position of first item <what> matching. It returns -1 if not found.
Parameters:what (Handle_TCollection_HExtendedString &) –
Return type:int
SetValue()
  • Replaces one character in the string at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
Parameters:
  • where (int) –
  • what (Standard_ExtCharacter) –
Return type:

None

  • Replaces a part of <self> by another string.
Parameters:
  • where (int) –
  • what (Handle_TCollection_HExtendedString &) –
Return type:

None

Split()
  • Splits a ExtendedString into two sub-strings. Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
Parameters:where (int) –
Return type:Handle_TCollection_HExtendedString
String()
  • Returns the field myString
Return type:TCollection_ExtendedString
ToExtString()
  • Returns pointer to ExtString
Return type:Standard_ExtString
Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns an empty String. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowed aString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
Parameters:
  • separators (Standard_ExtString) –
  • whichone (int) – default value is 1
Return type:

Handle_TCollection_HExtendedString

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’
Parameters:ahowmany (int) –
Return type:None
Value()
  • Returns ExtCharacter at position <where> in <self>. If <where> is less than zero or greater than the length of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’
Parameters:where (int) –
Return type:Standard_ExtCharacter
thisown

The membership flag

class TCollection_MapNode(*args)

Bases: OCC.MMgt.MMgt_TShared

Parameters:n (TCollection_MapNodePtr &) –
Return type:None
GetHandle()
Next()
Return type:TCollection_MapNodePtr
thisown

The membership flag

class TCollection_PrivCompareOfInteger

Bases: object

IsEqual()
Parameters:
  • Left (int &) –
  • Right (int &) –
Return type:

bool

IsGreater()
Parameters:
  • Left (int &) –
  • Right (int &) –
Return type:

bool

IsLower()
Parameters:
  • Left (int &) –
  • Right (int &) –
Return type:

bool

thisown

The membership flag

class TCollection_PrivCompareOfReal

Bases: object

IsEqual()
Parameters:
  • Left (float &) –
  • Right (float &) –
Return type:

bool

IsGreater()
Parameters:
  • Left (float &) –
  • Right (float &) –
Return type:

bool

IsLower()
Parameters:
  • Left (float &) –
  • Right (float &) –
Return type:

bool

thisown

The membership flag

class TCollection_SeqNode(*args)

Bases: OCC.MMgt.MMgt_TShared

Parameters:
  • n (TCollection_SeqNodePtr &) –
  • p (TCollection_SeqNodePtr &) –
Return type:

None

GetHandle()
Next()
Return type:TCollection_SeqNodePtr
Previous()
Return type:TCollection_SeqNodePtr
thisown

The membership flag

register_handle(handle, base_object)

Inserts the handle into the base object to prevent memory corruption in certain cases

class tcollection

Bases: object

static NextPrimeForMap(*args)
  • Returns a prime number greater than <I> suitable to dimension a Map. When <I> becomes great there is a limit on the result (today the limit is around 1 000 000). This is not a limit of the number of items but a limit in the number of buckets. i.e. there will be more collisions in the map.
Parameters:I (int) –
Return type:int
thisown

The membership flag

tcollection_NextPrimeForMap(*args)
  • Returns a prime number greater than <I> suitable to dimension a Map. When <I> becomes great there is a limit on the result (today the limit is around 1 000 000). This is not a limit of the number of items but a limit in the number of buckets. i.e. there will be more collisions in the map.
Parameters:I (int) –
Return type:int