GME  13
Input.h
Go to the documentation of this file.
00001 // Input.h: interface for the CInput class.
00002 //
00004 
00005 #ifndef AFX_INPUT_H
00006 #define AFX_INPUT_H
00007 
00008 #include <vector>
00009 #include "attribute.h"
00010 #include <regex>
00011 #if _MSC_VER > 1000
00012 #pragma once
00013 #endif // _MSC_VER > 1000
00014 
00015 using namespace std::tr1;
00016 
00022 class CInput  
00023 {
00024 protected:
00025     void ParseAttribute();
00026     void PrepareExpressionStack(const CString & strAttributeExpression, std::vector<Attribute> &stack);
00027     wregex GetRegExp(CString name);
00028 public:
00029         CInput();
00030         virtual ~CInput();
00031 
00032         void CInput::GetInput(CString strNameFirst, CString strRoleFirst, CString strKindFirst, CString strAttributeFirst,CString strNameSecond,CString strRoleSecond,CString strKindSecond,CString strAttributeSecond,
00033                       CString attrval, BOOL mod, BOOL atom, BOOL ref, BOOL set,BOOL connection,BOOL splSearch, BOOL full, 
00034                       IMgaFCO*, int, //WAS: IMgaFCO *root, int searchscope,
00035                       BOOL bMatchCase, int scopedSearch,int logicalExpr);
00036 
00037     //Getter methods
00038     wregex &GetFirstNameRegExp() {return m_regNameFirst;}
00039     wregex &GetFirstRoleRegExp() {return m_regRoleFirst;}
00040     wregex &GetFirstKindRegExp() {return m_regKindFirst;}
00041 
00042     wregex &GetSecondNameRegExp() {return m_regNameSecond;}
00043     wregex &GetSecondRoleRegExp() {return m_regRoleSecond;}
00044     wregex &GetSecondKindRegExp() {return m_regKindSecond;}
00045 
00046     //getter methods string forms
00047     CString &GetFirstName() {return m_strNameFirst;}
00048     CString &GetFirstRole() {return m_strRoleFirst;}
00049     CString &GetFirstKind() {return m_strKindFirst;}
00050     CString &GetFirstAttribute() {return m_strAttributeFirst;}
00051 
00052     CString &GetSecondName() {return m_strNameSecond;}
00053     CString &GetSecondKind() {return m_strKindSecond;}
00054     CString &GetSecondRole() {return m_strRoleSecond;}
00055     CString &GetSecondAttribute() {return m_strAttributeSecond;}
00056 
00057     //other
00058     BOOL &GetModels() {return m_bGetModels;}
00059     BOOL &GetAtoms() {return m_bGetAtoms;}
00060     BOOL &GetSets() {return m_bGetSets;}
00061     BOOL &GetReferences() {return m_bGetReferences;}
00062     BOOL &GetConnections() {return m_bGetConnections;}
00063     BOOL &GetSplSearch() {return m_bGetSplSearch;}
00064     BOOL &IsCaseIgnored() {return m_bGetCaseIgnored;}
00065     BOOL &DoScopedSearch() {return m_bDoScopedSearch;}
00066     int &GetSearchScope(){return m_intScope;}
00067     int &GetLogicalOperator() {return m_intLogical;}
00068     BOOL &UseSecondCriteria() {return m_bDoSecond;}
00069     BOOL &MatchWholeWord() {return m_bFull;}
00070 
00071     std::vector<Attribute>& GetFirstAttributeStack(){return  m_stackExpressionFirst;}
00072     std::vector<Attribute>& GetSecondAttributeStack() {return m_stackExpressionSecond;}
00073 
00074 private:
00076     wregex m_regNameFirst;
00078         wregex m_regRoleFirst;
00080         wregex m_regKindFirst;
00082         //attval_enum getAttrType;
00084     wregex m_regNameSecond;
00085     wregex m_regRoleSecond;
00086     wregex m_regKindSecond;
00087    
00088         //String forms of input
00089     CString m_strNameFirst;
00090     CString m_strRoleFirst;
00091     CString m_strKindFirst;
00092     CString m_strAttributeFirst;
00093     CString m_strNameSecond;
00094     CString m_strRoleSecond;
00095     CString m_strKindSecond;
00096         CString m_strAttributeSecond;
00097         
00098 
00100         BOOL m_bGetSplSearch;
00101 
00103         BOOL m_bGetModels;
00105         BOOL m_bGetAtoms;
00107         BOOL m_bGetReferences;
00109         BOOL m_bGetSets;
00110     //Does the user want to get Connections
00111     BOOL m_bGetConnections;
00112 
00114         BOOL m_bGetCaseIgnored;
00115 
00117         BOOL m_bDoScopedSearch;
00118   
00119     int m_intScope;
00120     int m_intLogical;
00121    // attval_enum getAttrType2;
00122     
00123     //matches whole word
00124     BOOL m_bFull;
00125 
00126     //if second criteria needs to be processed
00127     BOOL m_bDoSecond;
00128 
00129   
00130     std::vector<Attribute> m_stackExpressionFirst;
00131     std::vector<Attribute> m_stackExpressionSecond;
00132 };
00133 
00134 #endif