Go to the source code of this file.
Functions | |
le_result_t | le_path_GetDir (const char *pathPtr, const char *separatorPtr, char *dirPtr, size_t dirBuffSize) |
char * | le_path_GetBasenamePtr (const char *pathPtr, const char *separatorPtr) |
le_result_t | le_path_Concat (const char *separatorPtr, char *pathPtr, size_t pathSize,...) |
Legato Path API include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license. license.
le_result_t le_path_Concat | ( | const char * | separatorPtr, |
char * | pathPtr, | ||
size_t | pathSize, | ||
... | |||
) |
Concatenates multiple path segments together.
Concatenates the path in the pathPtr buffer with all path segments and stores the result in the pathPtr. Ensures that where path segments are joined there is only one separator between them. Duplicate trailing separators in the resultant path are also dropped.
If there is not enough space in pathPtr for all segments, as many characters from the segments that will fit in the buffer will be copied and LE_OVERFLOW will be returned. Partial UTF-8 characters and partial separators will never be copied.
[in] | separatorPtr | Separator string. |
[in,out] | pathPtr | Buffer containing the first segment and where the resultant path will be stored. |
[in] | pathSize | Buffer size. |
char* le_path_GetBasenamePtr | ( | const char * | pathPtr, |
const char * | separatorPtr | ||
) |
Gets a pointer to the basename (the last node in the path). This function gets the basename by returning a pointer to the character following the last separator.
[in] | pathPtr | Path string. |
[in] | separatorPtr | Separator string. |
le_result_t le_path_GetDir | ( | const char * | pathPtr, |
const char * | separatorPtr, | ||
char * | dirPtr, | ||
size_t | dirBuffSize | ||
) |
Gets the directory, which is the entire path up to and including the last separator.
[in] | pathPtr | Path string. |
[in] | separatorPtr | Separator string. |
[out] | dirPtr | Buffer to store the directory string. |
[in] | dirBuffSize | Size of the directory buffer in bytes. |