source: branches/work_311/core/ARAssignHelper.h @ 592

Revision 592, 3.3 KB checked in by jls17, 5 years ago (diff)
  • the classes CRefItem, CARQualification, CARAssignHelper and the method CARInside::LinkToField? do support passing details via the Context class
Line 
1//Copyright (C) 2009 Stefan Nerlich | stefan.nerlich@hotmail.com
2//
3//This file is part of ARInside.
4//
5//    ARInside is free software: you can redistribute it and/or modify
6//    it under the terms of the GNU General Public License as published by
7//    the Free Software Foundation, version 2 of the License.
8//
9//    ARInside is distributed in the hope that it will be useful,
10//    but WITHOUT ANY WARRANTY; without even the implied warranty of
11//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12//    GNU General Public License for more details.
13//
14//    You should have received a copy of the GNU General Public License
15//    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
16
17#pragma once
18#include "ARValue.h"
19#include "../output/Table.h"
20#include "../output/TableRow.h"
21#include "../ARInside.h"
22
23using namespace OUTPUT;
24
25class MappingContext;
26
27class CARAssignHelper
28{
29public:
30        CARAssignHelper(CARInside& arIn, int rootLevel, const CARServerObject& obj, const CARSchema& schema1, const CARSchema& schema2);
31        CARAssignHelper(CARInside& arIn, int rootLevel, const CARServerObject& obj, int schemaId1, int schemaId2);
32        CARAssignHelper(CARInside& arIn, int rootLevel, const CARServerObject& obj, const string& schemaName1, const string& schemaName2);
33        CARAssignHelper(MappingContext &context);
34
35        ~CARAssignHelper(void);
36
37        bool pushFieldFlag;
38
39        string PushFieldsAssignment(const ARPushFieldsActionStruct &action, int nAction, IfElseState ifElse);
40        string SetFieldsAssignment(const ARSetFieldsActionStruct &action, int nAction, IfElseState ifElse);
41        string OpenWindowAssignment(const ARFieldAssignList &action, int nAction, IfElseState ifElse, OpenWindowMode openCloseInfo);
42        string ServiceAssignment(const ARFieldAssignList &action, int nAction, IfElseState ifElse, ServiceMappingMode serviceInfo);
43        string FilterApiInputAssignment(const ARAssignStruct* assignList, int numItems, int nAction, IfElseState ifElse);
44
45private:
46        unsigned int CheckAssignment(int targetFieldId, ARAssignStruct* parentAssignment, IfElseState ifElse, int nAction, ARAssignStruct &assignment, stringstream &assignText, const CRefItem& refItem);
47
48        void AssignValue(int targetFieldId, IfElseState ifElse, ARValueStruct &v, stringstream &assignText, const CRefItem& refItem);   
49        void AssignField(IfElseState ifElse, int nAction, ARAssignFieldStruct &v, stringstream &assignText, const CRefItem& refItem);
50        void AssignProcess(IfElseState ifElse, char *v, stringstream &assignText, const CRefItem& refItem);
51        void AssignFunction(int targetFieldId, IfElseState ifElse, int nAction, ARFunctionAssignStruct &v, stringstream &assignText, const  CRefItem& refItem);
52        void AssignDDE(IfElseState ifElse, ARDDEStruct &v, stringstream &assignText, const CRefItem& refItem);
53        void AssignSQL(IfElseState ifElse, ARAssignSQLStruct &v, stringstream &assignText, const CRefItem& refItem);   
54        void AssignFilterApi(IfElseState ifElse, ARAssignFilterApiStruct &v, stringstream &assignText, const CRefItem& refItem);       
55
56private:
57        enum AssignmentMode
58        {
59                AM_SETFIELDS,
60                AM_PUSHFIELD,
61                AM_OPENWINDOW,
62                AM_SERVICE,
63                AM_FILTERAPI_INPUT,
64        };
65
66        CARInside *arIn;
67        CARServerObject* object;
68
69        int schemaInsideId1;
70        int schemaInsideId2;
71        int rootLevel;
72        AssignmentMode mode;
73};
Note: See TracBrowser for help on using the repository browser.