www.cemf.ir
helperTstream.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 #ifndef __helperTstream_hpp__
21 #define __helperTstream_hpp__
22 
23 
24 inline bool validTokenForStream(const token tok)
25 {
26  if( tok.good() && !tok.isPunctuation() )return true;
27  if( tok == token::SPACE) return false;
28  if( tok == token::TAB) return false;
29  if( tok == token::NL) return false;
30  if( tok == token::NULL_TOKEN )return false;
31 
32  return true;
33 }
34 
35 inline bool isBeginToken(const token& tok)
36 {
37  if( tok.good() && !tok.isPunctuation() )return false;
38  if( tok == token::BEGIN_LIST) return true;
39  if( tok == token::BEGIN_BLOCK) return true;
40  if( tok == token::BEGIN_SQR) return true;
41  return false;
42 }
43 
44 inline bool isEndToken(const token& tok)
45 {
46  if( tok.good() && !tok.isPunctuation() )return false;
47  if( tok == token::END_LIST) return true;
48  if( tok == token::END_BLOCK)return true;
49  if( tok == token::END_SQR) return true;
50  return false;
51 }
52 
53 #endif // __helperTstream__
isEndToken
bool isEndToken(const token &tok)
Definition: helperTstream.hpp:44
validTokenForStream
bool validTokenForStream(const token tok)
Definition: helperTstream.hpp:24
isBeginToken
bool isBeginToken(const token &tok)
Definition: helperTstream.hpp:35