| 1 | #cxx . . $ `<file>/io/buffersearch.h`/ifndef IOUTILITIES_BUFFER_SEARCH_H |
| 2 | #define IOUTILITIES_BUFFER_SEARCH_Hcxx . . $ `io/buffersearch.h:2:9`! |
| 3 | |
| 4 | #include "../global.h"cxx . . $ `<file>/global.h`/ |
| 5 | |
| 6 | #include <array> |
| 7 | #include <functional> |
| 8 | #include <memory> |
| 9 | #include <string> |
| 10 | #include <string_view> |
| 11 | |
| 12 | namespace CppUtilitiescxx . . $ CppUtilities/ { |
| 13 | |
| 14 | class CPP_UTILITIES_EXPORTcxx . . $ `global.h:11:9`! BufferSearchcxx . . $ CppUtilities/BufferSearch# { |
| 15 | public: |
| 16 | using CallbackTypecxx . . $ CppUtilities/BufferSearch#CallbackType# = stdcxx . . $ std/::functioncxx . . $ std/function#<void(BufferSearchcxx . . $ CppUtilities/BufferSearch# &, stdcxx . . $ std/::stringcxx . . $ std/string# &&)>; |
| 17 | BufferSearchcxx . . $ CppUtilities/BufferSearch#BufferSearch(e35b60e5adc9143b).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# searchTerm, stdcxx . . $ std/::string_viewcxx . . $ std/string_view# terminationChars, stdcxx . . $ std/::string_viewcxx . . $ std/string_view# giveUpTerm, CallbackTypecxx . . $ CppUtilities/BufferSearch#CallbackType# &&callback); |
| 18 | void operatorcxx . . $ CppUtilities/BufferSearch#`operator()`(c8024318075daf50).()(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# buffer); |
| 19 | void operatorcxx . . $ CppUtilities/BufferSearch#`operator()`(7cafb6e0818eff3b).()(const stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type# *buffer, stdcxx . . $ std/::size_tcxx . . $ std/size_t# bufferSize); |
| 20 | template <stdcxx . . $ std/::size_tcxx . . $ std/size_t# bufferCapacity> |
| 21 | void operatorcxx . . $ CppUtilities/BufferSearch#`operator()`(5f12740b0f22c40a).()(stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<stdcxx . . $ std/::arraycxx . . $ std/array#<stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type#, bufferCapacity>> buffer, stdcxx . . $ std/::size_tcxx . . $ std/size_t# bufferSize); |
| 22 | const stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type# *processcxx . . $ CppUtilities/BufferSearch#process(3660367cc6899df5).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# buffer); |
| 23 | const stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type# *processcxx . . $ CppUtilities/BufferSearch#process(e3d2f176fff90d6e).(const stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type# *buffer, stdcxx . . $ std/::size_tcxx . . $ std/size_t# bufferSize); |
| 24 | void resetcxx . . $ CppUtilities/BufferSearch#reset(49f6e7a06ebc5aa8).(); |
| 25 | stdcxx . . $ std/::stringcxx . . $ std/string# &resultcxx . . $ CppUtilities/BufferSearch#result(75da78375bc7a3dd).(); |
| 26 | const stdcxx . . $ std/::stringcxx . . $ std/string# &resultcxx . . $ CppUtilities/BufferSearch#result(f4fff0029955a25f).() const; |
| 27 | |
| 28 | private: |
| 29 | const stdcxx . . $ std/::string_viewcxx . . $ std/string_view# m_searchTermcxx . . $ CppUtilities/BufferSearch#m_searchTerm.; |
| 30 | const stdcxx . . $ std/::string_viewcxx . . $ std/string_view# m_terminationCharscxx . . $ CppUtilities/BufferSearch#m_terminationChars.; |
| 31 | const stdcxx . . $ std/::string_viewcxx . . $ std/string_view# m_terminationTermcxx . . $ CppUtilities/BufferSearch#m_terminationTerm.; |
| 32 | const stdcxx . . $ std/::string_viewcxx . . $ std/string_view# m_giveUpTermcxx . . $ CppUtilities/BufferSearch#m_giveUpTerm.; |
| 33 | const CallbackTypecxx . . $ CppUtilities/BufferSearch#CallbackType# m_callbackcxx . . $ CppUtilities/BufferSearch#m_callback.; |
| 34 | stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::const_iteratorcxx . . $ std/basic_string_view#const_iterator# m_searchTermIteratorcxx . . $ CppUtilities/BufferSearch#m_searchTermIterator.; |
| 35 | stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::const_iteratorcxx . . $ std/basic_string_view#const_iterator# m_giveUpTermIteratorcxx . . $ CppUtilities/BufferSearch#m_giveUpTermIterator.; |
| 36 | stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::const_iteratorcxx . . $ std/basic_string_view#const_iterator# m_terminationTermIteratorcxx . . $ CppUtilities/BufferSearch#m_terminationTermIterator.; |
| 37 | stdcxx . . $ std/::stringcxx . . $ std/string# m_resultcxx . . $ CppUtilities/BufferSearch#m_result.; |
| 38 | bool m_hasResultcxx . . $ CppUtilities/BufferSearch#m_hasResult.; |
| 39 | }; |
| 40 | |
| 41 | /*! |
| 42 | * \brief Constructs a new BufferSearch. Might be overloaded in the future. |
| 43 | */ |
| 44 | inline BufferSearchcxx . . $ CppUtilities/BufferSearch#::BufferSearchcxx . . $ CppUtilities/BufferSearch#BufferSearch(e35b60e5adc9143b).( |
| 45 | stdcxx . . $ std/::string_viewcxx . . $ std/string_view# searchTerm, stdcxx . . $ std/::string_viewcxx . . $ std/string_view# terminationChars, stdcxx . . $ std/::string_viewcxx . . $ std/string_view# giveUpTerm, CallbackTypecxx . . $ CppUtilities/BufferSearch#CallbackType# &&callback) |
| 46 | : m_searchTermcxx . . $ CppUtilities/BufferSearch#m_searchTerm.(searchTerm) |
| 47 | , m_terminationCharscxx . . $ CppUtilities/BufferSearch#m_terminationChars.(terminationChars) |
| 48 | , m_giveUpTermcxx . . $ CppUtilities/BufferSearch#m_giveUpTerm.(giveUpTerm) |
| 49 | , m_callbackcxx . . $ CppUtilities/BufferSearch#m_callback.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(callback)) |
| 50 | , m_searchTermIteratorcxx . . $ CppUtilities/BufferSearch#m_searchTermIterator.(m_searchTermcxx . . $ CppUtilities/BufferSearch#m_searchTerm..begincxx . . $ std/basic_string_view#begin(8e614c7de0b1573e).()) |
| 51 | , m_giveUpTermIteratorcxx . . $ CppUtilities/BufferSearch#m_giveUpTermIterator.(m_giveUpTermcxx . . $ CppUtilities/BufferSearch#m_giveUpTerm..begincxx . . $ std/basic_string_view#begin(8e614c7de0b1573e).()) |
| 52 | , m_terminationTermIteratorcxx . . $ CppUtilities/BufferSearch#m_terminationTermIterator.(m_terminationTermcxx . . $ CppUtilities/BufferSearch#m_terminationTerm..begincxx . . $ std/basic_string_view#begin(8e614c7de0b1573e).()) |
| 53 | , m_hasResultcxx . . $ CppUtilities/BufferSearch#m_hasResult.(false) |
| 54 | { |
| 55 | } |
| 56 | |
| 57 | /*! |
| 58 | * \brief Processes the specified \a buffer. Invokes the callback according to the remarks mentioned in the class documentation. |
| 59 | */ |
| 60 | inline void BufferSearchcxx . . $ CppUtilities/BufferSearch#::operatorcxx . . $ CppUtilities/BufferSearch#`operator()`(c8024318075daf50).()(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# buffer) |
| 61 | { |
| 62 | (*this)(cxx . . $ CppUtilities/BufferSearch#`operator()`(7cafb6e0818eff3b).buffer.datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).(), buffer.sizecxx . . $ std/basic_string_view#size(c9b1e749b64d5edc).()); |
| 63 | } |
| 64 | |
| 65 | /*! |
| 66 | * \brief Processes the specified \a buffer which is a shared array with fixed \tparam bufferCapacity. Invokes the callback according to the remarks mentioned in the class documentation. |
| 67 | */ |
| 68 | template <stdcxx . . $ std/::size_tcxx . . $ std/size_t# bufferCapacity> |
| 69 | inline void BufferSearchcxx . . $ CppUtilities/BufferSearch#::operatorcxx . . $ CppUtilities/BufferSearch#`operator()`(5f12740b0f22c40a).()(stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<stdcxx . . $ std/::arraycxx . . $ std/array#<stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type#, bufferCapacity>> buffer, stdcxx . . $ std/::size_tcxx . . $ std/size_t# bufferSize) |
| 70 | { |
| 71 | (*this)(buffer->data(), bufferSize); |
| 72 | } |
| 73 | |
| 74 | /*! |
| 75 | * \brief Processes the specified \a buffer. Invokes the callback according to the remarks mentioned in the class documentation. |
| 76 | * \returns See other overload for details. |
| 77 | */ |
| 78 | inline const stdcxx . . $ std/::string_viewcxx . . $ std/string_view#::value_typecxx . . $ std/basic_string_view#value_type# *BufferSearchcxx . . $ CppUtilities/BufferSearch#::processcxx . . $ CppUtilities/BufferSearch#process(3660367cc6899df5).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# buffer) |
| 79 | { |
| 80 | return processcxx . . $ CppUtilities/BufferSearch#process(e3d2f176fff90d6e).(buffer.datacxx . . $ std/basic_string_view#data(8e614c7de0b1573e).(), buffer.sizecxx . . $ std/basic_string_view#size(c9b1e749b64d5edc).()); |
| 81 | } |
| 82 | |
| 83 | /*! |
| 84 | * \brief Returns the search result at this point. |
| 85 | */ |
| 86 | inline stdcxx . . $ std/::stringcxx . . $ std/string# &BufferSearchcxx . . $ CppUtilities/BufferSearch#::resultcxx . . $ CppUtilities/BufferSearch#result(75da78375bc7a3dd).() |
| 87 | { |
| 88 | return m_resultcxx . . $ CppUtilities/BufferSearch#m_result.; |
| 89 | } |
| 90 | |
| 91 | /*! |
| 92 | * \brief Returns the search result at this point. |
| 93 | */ |
| 94 | inline const stdcxx . . $ std/::stringcxx . . $ std/string# &BufferSearchcxx . . $ CppUtilities/BufferSearch#::resultcxx . . $ CppUtilities/BufferSearch#result(f4fff0029955a25f).() const |
| 95 | { |
| 96 | return m_resultcxx . . $ CppUtilities/BufferSearch#m_result.; |
| 97 | } |
| 98 | |
| 99 | } // namespace CppUtilities |
| 100 | |
| 101 | #endif // IOUTILITIES_BUFFER_SEARCH_H |