Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#aros]

SplitName

splits out a component of a pathname into a buffer

Declaration

Source position: amigados.pas line 2268

function SplitName(

  const Name: PChar;

  Seperator: LongWord;

  Buf: PChar;

  OldPos: LongInt;

  Size: LongInt

):LongInt;

Arguments

Name

  

Filename being parsed.

Seperator

  

Separator charactor to split by.

Buf

  

Buffer to hold separated name.

OldPos

  

Current position in the file.

Size

  

Size of buf in bytes (including null termination).

Function result

New position for next call to splitname. -1 for last one.

Description

This routine splits out the next piece of a name from a given file name. Each piece is copied into the buffer, truncating at size-1 characters. The new position is then returned so that it may be passed in to the next call to splitname. If the separator is not found within size characters, then size-1 characters plus a null will be put into the buffer, and the position of the next separator will be returned.

If a a separator cannot be found, -1 is returned (but the characters from the old position to the end of the string are copied into the buffer, up to a maximum of size-1 characters). Both strings are null-terminated.

This function is mainly intended to support handlers.

See also

FilePart

  

Returns the last component of a path

PathPart

  

Returns a pointer to the end of the next-to-last component of a path.

AddPart

  

Appends a file/dir to the end of a path


Documentation generated on: 2021-07-30