C++ IP API  9.5.5
TCP & UDP for virtual user scripts
PatternList.h
Go to the documentation of this file.
1 //
2 //--------------------------------------------------------------
3 // $Header: /home/cvsroot4/cpp/fc/Communicator/PatternList.h,v 1.2 2005/11/03 09:41:44 peter Exp $
4 //
5 // Copyright (c) 2024 Eggplant Ltd
6 // All Rights Reserved
7 //--------------------------------------------------------------
8 //
9 
10 #pragma once
11 
12 #include <string>
13 #include <vector>
14 
15 #include "Pattern.h"
16 #include <SharedReference.h>
17 
18 #ifdef WIN32
19 #pragma warning (disable : 4251 )
20 #endif
21 
22 using namespace std;
23 
24 using namespace Facilita;
25 namespace Facilita {
26 typedef vector<Pattern*> PatternVector;
27 typedef vector<Facilita::SharedReference<Pattern> > PatternRefVector;
42 class FC_API PatternList : public Pattern {
43  private:
44  PatternRefVector _builtPatterns;
45 
46  protected:
47  PatternVector _patterns;
48  int _matchIndex;
49 
50  public:
52  PatternList();
55  void append(const string &s);
58  void append(Pattern &pattern);
60  int isSatisfiedBy(char ch); // returns pattern index on match, else -1
62  void reset();
64  int getMatchIndex(); // returns matched pattern index, -1 if no match found
66  string toString();
67 };
68 
69 #ifdef WIN32
70 #pragma warning (default : 4251 )
71 #endif
72 }
STL namespace.
An Interface to which sub-classes must conform.
Definition: Pattern.h:13
vector< Pattern * > PatternVector
Definition: PatternList.h:26
A Pattern which is a list other Pattern instances.
Definition: PatternList.h:42
Definition: IpEndPoint.h:9
vector< Facilita::SharedReference< Pattern > > PatternRefVector
Definition: PatternList.h:27