Expect.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2023 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Kernel/Classes/Expect.h
10 
11 #ifndef __dsp_Kernel_Classes_Expect_h
12 #define __dsp_Kernel_Classes_Expect_h
13 
14 #include "FilePtr.h"
15 
17 class Expect
18 {
19  protected:
21  FilePtr file;
22 
23  public:
24 
26  Expect(const std::string& filename);
27 
29  bool expect(const std::string& text);
30 
32  FILE* fptr();
33 };
34 
35 #endif
Checks for expected string in a data file.
Definition: Expect.h:17
FilePtr file
Pointer to the open file.
Definition: Expect.h:26
Expect(const std::string &filename)
Open filename for reading.
Definition: Expect.C:16
FILE * fptr()
Get the pointer to the open file.
Definition: Expect.C:14
bool expect(const std::string &text)
Return true if the next string read from file matches text.
Definition: Expect.C:23

Generated using doxygen 1.8.17