summaryrefslogtreecommitdiff
path: root/cpp/src/FreezeScript/Transformer.h
blob: 1bdaa56fc819408f619a9db930e51e3f4ad0e350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// **********************************************************************
//
// Copyright (c) 2004
// ZeroC, Inc.
// Billerica, MA, USA
//
// All Rights Reserved.
//
// Ice is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License version 2 as published by
// the Free Software Foundation.
//
// **********************************************************************

#ifndef FREEZE_SCRIPT_TRANSFORMER_H
#define FREEZE_SCRIPT_TRANSFORMER_H

#include <Ice/Ice.h>
#include <Slice/Parser.h>
#include <FreezeScript/Exception.h>

class Db;
class DbTxn;

namespace FreezeScript
{

class Transformer
{
public:

    Transformer(const Ice::CommunicatorPtr&, const Slice::UnitPtr&, const Slice::UnitPtr&, bool, bool);

    void analyze(const std::string&, const std::string&, const std::string&, const std::string&, std::ostream&,
                 Ice::StringSeq&, Ice::StringSeq&);

    void analyze(std::ostream&, Ice::StringSeq&, Ice::StringSeq&);

    void transform(std::istream&, Db*, DbTxn*, Db*, DbTxn*, std::ostream&, bool);

private:

    static Slice::TypePtr findType(const Slice::UnitPtr&, const std::string&, Ice::StringSeq&);

    Ice::CommunicatorPtr _communicator;
    Slice::UnitPtr _old;
    Slice::UnitPtr _new;
    bool _ignoreTypeChanges;
    bool _purgeObjects;
};

} // End of namespace FreezeScript

#endif