Added debugger documentation to reference guide and user guide
[deliverable/titan.core.git] / xsdconvert / GeneralFunctions.hh
CommitLineData
d44e3c4f 1/******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Balasko, Jeno
10 * Godar, Marton
11 * Raduly, Csaba
12 * Szabo, Bence Janos
13 *
14 ******************************************************************************/
970ed795
EL
15#ifndef GENERALFUNCTIONS_HH_
16#define GENERALFUNCTIONS_HH_
17
18#include "Mstring.hh"
19#include "List.hh"
20#include "GeneralTypes.hh"
21
22typedef List<QualifiedName> QualifiedNames;
23
3abe9331 24enum modeType {
25 type_reference_name, type_name, field_name, enum_id_name
26};
970ed795 27
3abe9331 28void XSDName2TTCN3Name(const Mstring& in, QualifiedNames & used_names, modeType type_of_the_name,
29 Mstring & res, Mstring & variant, bool no_replace = false);
970ed795
EL
30
31class ReferenceData;
32
33
3abe9331 34bool isBuiltInType(const Mstring& in);
35bool isStringType(const Mstring& in);
36bool isIntegerType(const Mstring& in);
37bool isFloatType(const Mstring& in);
38bool isTimeType(const Mstring& in);
39bool isSequenceType(const Mstring& in);
40bool isBooleanType(const Mstring& in);
41bool isQNameType(const Mstring& in);
42bool isAnyType(const Mstring& in);
970ed795 43
3abe9331 44bool matchDates(const char * string, const char * type);
45bool matchRegexp(const char * string, const char * pattern);
970ed795 46
3abe9331 47void printWarning(const Mstring& filename, int lineNumber, const Mstring& text);
48void printWarning(const Mstring& filename, const Mstring& typeName, const Mstring& text);
49void printError(const Mstring& filename, int lineNumber, const Mstring& text);
50void printError(const Mstring& filename, const Mstring& typeName, const Mstring& text);
51void indent(FILE * file, const int x);
970ed795 52
3abe9331 53long double stringToLongDouble(const char * input);
970ed795
EL
54
55class RootType;
56class SimpleType;
57class TTCN3Module;
58
3abe9331 59const Mstring& getNameSpaceByPrefix(const RootType * root, const Mstring& prefix);
60const Mstring& getPrefixByNameSpace(const RootType * root, const Mstring& namespace_);
61
62const Mstring findBuiltInType(const RootType * ref, Mstring type);
63
970ed795 64/// Lookup in a list of modules
3abe9331 65RootType * lookup(const List<TTCN3Module*> mods,
66 const SimpleType * reference, wanted w);
970ed795 67/// Lookup in a list of modules
3abe9331 68RootType * lookup(const List<TTCN3Module*> mods,
69 const Mstring& name, const Mstring& nsuri, const RootType *reference, wanted w);
970ed795
EL
70/// Lookup inside one module
71RootType *lookup1(const TTCN3Module *module,
3abe9331 72 const Mstring& name, const Mstring& nsuri, const RootType *reference, wanted w);
970ed795
EL
73
74int multi(const TTCN3Module *module, ReferenceData const& outside_reference,
3abe9331 75 const RootType *obj);
970ed795 76
feade998 77void generate_TTCN3_header(FILE * file, const char* modulename, const bool timestamp = true);
78
970ed795 79inline unsigned long long llmin(unsigned long long l, unsigned long long r) {
3abe9331 80 return l < r ? l : r;
970ed795
EL
81}
82
83inline unsigned long long llmax(unsigned long long l, unsigned long long r) {
3abe9331 84 return l > r ? l : r;
970ed795
EL
85}
86
87#endif /* GENERALFUNCTIONS_HH_ */
This page took 0.027987 seconds and 5 git commands to generate.