chsvlib
chsv helper source code

◆ MapIterPrev()

EXTERN_C HCHSVMAPITERATOR Chusov::MapIterPrev ( HCHSVMAPITERATOR  hMapIter)
noexcept

The function returns an iterator preceding the specified one or NULL if there are no preceding elements.

Parameters
[in]hMapIteris a handle to the known iterator specifying an element following the one to be bound with the iterator being returned. If the function fails for any other reason it returns MAP_ITERATOR_ERROR (-1) setting appropriate last chsvlib error code which could be retrieved by
Returns
On success the function returns a handle to the iterator bound with an element preceding the specified one within the map, or MAP_ITERATOR_DOES_NOT_EXIST (NULL) if there is not such element. If the function fails for any other reason it returns MAP_ITERATOR_ERROR (-1) setting appropriate last chsvlib error code which could be retrieved by calling the GetLastChsvError.
Remarks
The hMapIter is a mandatory parameter and it is not allowed to be NULL or MAP_ITERATOR_DOES_NO_EXIST otherwise the function will fail with CHSVERROR_INVALID_PARAMETER_CODE. Although if the parameter is an iterator of the first existing element of the map the function would return MAP_ITERATOR_DOES_NO_EXIST (NULL) allowing to implement reverse loops.
Map iterators are just pointers to internal memory and they must not be closed specifically.
The complexity is \(O(1)\).
Declared in chsvmap.h.
See also
MapIterNext;
MapFind;
MapBegin;
MapEnd.