Go to the source code of this file.
Typedefs | |
typedef struct le_pathIter_t * | le_pathIter_Ref_t |
Legato Path Iterator API include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license. license.
typedef struct le_pathIter_t* le_pathIter_Ref_t |
Objects of this type are used to iterate and manipulate path strings.
le_result_t le_pathIter_Append | ( | le_pathIter_Ref_t | iterRef, |
const char * | pathStr | ||
) |
Take the new string path and combine it with the object's existing path.
[in] | iterRef | The path object to write to. |
[in] | pathStr | The new path segment to append. |
le_pathIter_Ref_t le_pathIter_Clone | ( | le_pathIter_Ref_t | originalRef | ) |
Create a clone of an existing path iterator object.
[in] | originalRef | The path object to duplicate. |
le_pathIter_Ref_t le_pathIter_Create | ( | const char * | pathPtr, |
const char * | separatorPtr, | ||
const char * | parentSpecPtr, | ||
const char * | currentSpecPtr | ||
) |
Create a new path iterator object. On creation, the default position of the iterator is at the end of the path.
[in] | pathPtr | Optional. Pointer to the inital path to use. |
[in] | separatorPtr | Required. Path separator to use. The separator can not be NULL or empty. |
[in] | parentSpecPtr | Optional. Used to traverse upwards in a path. Leave as NULL or empty to not use. This acts like how ".." is used in a filesystem path. |
[in] | currentSpecPtr | Optional. Used to refer to a current node. Much like how a '.' is used in a filesystem path. |
le_pathIter_Ref_t le_pathIter_CreateForUnix | ( | const char * | pathPtr | ) |
Create a new path iterator object that is pre-configured for Unix styled paths. On creation, the default position of the iterator is at the end of the path.
The parameters are configured as follows:
[in] | pathPtr | Optional. Create an iterator for this path, or start with an empty path. |
void le_pathIter_Delete | ( | le_pathIter_Ref_t | iterRef | ) |
Delete an iterator object and free it's memory.
[in] | iterRef | The iterator object to destroy. |
le_result_t le_pathIter_GetCurrentNode | ( | le_pathIter_Ref_t | iterRef, |
char * | bufferPtr, | ||
size_t | bufferSize | ||
) |
Get the text for the node the itrator is pointing at.
[in] | iterRef | The iterator object to read. |
[out] | bufferPtr | The utf-8 formatted text buffer to write to. |
[in] | bufferSize | The size in bytes of the text buffer. |
le_result_t le_pathIter_GetCurrentSpecifier | ( | le_pathIter_Ref_t | iterRef, |
char * | bufferPtr, | ||
size_t | bufferSize | ||
) |
Read the iterators string for the current node specifier. For Unix style paths for this is ".". If an empty string is used, then this is ignored for the purposes of appending and normalizing paths.
[in] | iterRef | The iterator object to read. |
[out] | bufferPtr | The string buffer to write to. |
[in] | bufferSize | The size of the string buffer being written to. |
le_result_t le_pathIter_GetParentSpecifier | ( | le_pathIter_Ref_t | iterRef, |
char * | bufferPtr, | ||
size_t | bufferSize | ||
) |
Read the string that represents parent nodes in a path string. By for Unix style paths this is "..". If an empty string is used, then it is ignored for the purposes of appending and normalizing paths.
[in] | iterRef | The iterator object to read. |
[out] | bufferPtr | The string buffer to write to. |
[in] | bufferSize | The size of the buffer being written to. |
le_result_t le_pathIter_GetPath | ( | le_pathIter_Ref_t | iterRef, |
char * | bufferPtr, | ||
size_t | bufferSize | ||
) |
Get a copy of the path currently contained within the iterator.
[in] | iterRef | The iterator object to read. |
[out] | bufferPtr | The string buffer to write to. |
[in] | bufferSize | The size of the buffer being written to. |
le_result_t le_pathIter_GetSeparator | ( | le_pathIter_Ref_t | iterRef, |
char * | bufferPtr, | ||
size_t | bufferSize | ||
) |
Read the string that is being used to represent path separators in this iterator object.
[in] | iterRef | The iterator object to read. |
[out] | bufferPtr | The string buffer to write to. |
[in] | bufferSize | The size of the buffer being written to. |
le_result_t le_pathIter_GoToEnd | ( | le_pathIter_Ref_t | iterRef | ) |
Jump the iterator to the end of the path.
[in] | iterRef | The iterator object to update. |
le_result_t le_pathIter_GoToNext | ( | le_pathIter_Ref_t | iterRef | ) |
Move to the next node in the path.
[in] | iterRef | The iterator object to update. |
le_result_t le_pathIter_GoToPrev | ( | le_pathIter_Ref_t | iterRef | ) |
Move to the previous node in the path.
[in] | iterRef | The iterator object to update. |
le_result_t le_pathIter_GoToStart | ( | le_pathIter_Ref_t | iterRef | ) |
Jump the iterator to the beginning of the path.
[in] | iterRef | The iterator object to update. |
bool le_pathIter_IsAbsolute | ( | le_pathIter_Ref_t | iterRef | ) |
Is this an absolute or relative path?
[in] | iterRef | The iterator object to read. |
bool le_pathIter_IsEmpty | ( | le_pathIter_Ref_t | iterRef | ) |
Is the path object holding an empty string?
iterRef | The path object to read. |
void le_pathIter_Truncate | ( | le_pathIter_Ref_t | iterRef | ) |
Truncate the path at the current iterator node. If the iterator is at the beginning of the path, then the whole path is cleared. If the iterator is at the end of the path, then nothing happens.
Once done, then the iterator will be pointing at the new end of the path.
[in] | iterRef | The iterator to update. |