Titan Core Initial Contribution
[deliverable/titan.core.git] / xsdconvert / GeneralFunctions.hh
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 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 #ifndef GENERALFUNCTIONS_HH_
9 #define GENERALFUNCTIONS_HH_
10
11 #include "Mstring.hh"
12 #include "List.hh"
13 #include "GeneralTypes.hh"
14
15 typedef List<QualifiedName> QualifiedNames;
16
17 enum modeType {type_reference_name, type_name, field_name, enum_id_name};
18
19 void XSDName2TTCN3Name (const Mstring& in, QualifiedNames & used_names, modeType type_of_the_name,
20 Mstring & res, Mstring & variant);
21
22 class ReferenceData;
23
24
25 bool isBuiltInType (const Mstring& in);
26 bool isStringType (const Mstring& in);
27 bool isIntegerType (const Mstring& in);
28 bool isFloatType (const Mstring& in);
29 bool isTimeType (const Mstring& in);
30 bool isSequenceType (const Mstring& in);
31 bool isBooleanType (const Mstring& in);
32 bool isQNameType (const Mstring& in);
33 bool isAnyType (const Mstring& in);
34
35 void printWarning (const Mstring& filename, int lineNumber, const Mstring& text);
36 void printWarning (const Mstring& filename, const Mstring& typeName, const Mstring& text);
37 void printError (const Mstring& filename, int lineNumber, const Mstring& text);
38 void printError (const Mstring& filename, const Mstring& typeName, const Mstring& text);
39
40 long double stringToLongDouble (const char * input);
41
42 Mstring truncatePathWithOneElement (const Mstring& path);
43
44 class RootType;
45 class SimpleType;
46 class TTCN3Module;
47
48 /// Lookup in a list of modules
49 RootType * lookup (const List<TTCN3Module*> mods,
50 const SimpleType * reference, wanted w);
51 /// Lookup in a list of modules
52 RootType * lookup (const List<TTCN3Module*> mods,
53 const Mstring& name, const Mstring& nsuri, const RootType *reference, wanted w);
54 /// Lookup inside one module
55 RootType *lookup1(const TTCN3Module *module,
56 const Mstring& name, const Mstring& nsuri, const RootType *reference, wanted w);
57
58 int multi(const TTCN3Module *module, ReferenceData const& outside_reference,
59 const RootType *obj);
60
61 inline unsigned long long llmin(unsigned long long l, unsigned long long r) {
62 return l < r ? l : r;
63 }
64
65 inline unsigned long long llmax(unsigned long long l, unsigned long long r) {
66 return l > r ? l : r;
67 }
68
69 #endif /* GENERALFUNCTIONS_HH_ */
This page took 0.048863 seconds and 5 git commands to generate.