C++ IP API  9.5.8
TCP & UDP for virtual user scripts
ExtractionCursor.h
Go to the documentation of this file.
1 
2 // Copyright (c) 2024 Eggplant Ltd
3 // All Rights Reserved
4 
5 #pragma once
6 
7 #include "fc.h"
8 
9 namespace Facilita
10 {
11 
16  class FC_API ExtractionCursor
17  {
18 
19  public:
21  ExtractionCursor(bool extractFromEnd=false): _extractFromEnd(extractFromEnd)
22  {
23  reset();
24  }
25 
26  virtual ~ExtractionCursor(){}
27 
30 
32 
38  int getIndex() { return _index;}
39  #ifndef DOXYGEN_SHOULD_SKIP_THIS
40  void setIndex(int index){ _index = index;}
41  #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42 
50  bool succeeded(){ return _succeeded;}
51 
52  #ifndef DOXYGEN_SHOULD_SKIP_THIS
53  void setSucceeded(bool succeeded){ _succeeded = succeeded;}
54  #endif /* DOXYGEN_SHOULD_SKIP_THIS */
55 
63  string getErrorMessage() const { return _errorMessage;}
65 
67 
70  void reset()
71  {
72  if (_extractFromEnd)
73  {
74  _index = -1;
75  }
76  else
77  {
78  _index = 0;
79  }
80 
81  _succeeded = false;
82  }
83 
85  void setErrorMessage(const string& errorMessage){ _errorMessage = errorMessage;}
86  void clearErrorMessage(){ _errorMessage.erase();}
88 
89  private:
90  int _index;
91  bool _succeeded;
92  bool _extractFromEnd;
93  #pragma warning(disable:4251)
94  string _errorMessage;
95  #pragma warning(default:4251)
96  };
97 }
ExtractionCursor(bool extractFromEnd=false)
Default constructor.
Definition: ExtractionCursor.h:21
bool succeeded()
Has the last search succeeded?
Definition: ExtractionCursor.h:50
void reset()
Reset this object for re-use.
Definition: ExtractionCursor.h:70
This class maintains information over a sequence of textual searches.
Definition: ExtractionCursor.h:16
int getIndex()
Get the current position of the search.
Definition: ExtractionCursor.h:38
virtual ~ExtractionCursor()
Definition: ExtractionCursor.h:26
Definition: IpEndPoint.h:9
string getErrorMessage() const
Get any error message.
Definition: ExtractionCursor.h:63