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_
13 #include "GeneralTypes.hh"
15 typedef List<QualifiedName> QualifiedNames;
17 enum modeType {type_reference_name, type_name, field_name, enum_id_name};
19 void XSDName2TTCN3Name (const Mstring& in, QualifiedNames & used_names, modeType type_of_the_name,
20 Mstring & res, Mstring & variant);
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);
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);
40 long double stringToLongDouble (const char * input);
42 Mstring truncatePathWithOneElement (const Mstring& path);
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);
58 int multi(const TTCN3Module *module, ReferenceData const& outside_reference,
61 inline unsigned long long llmin(unsigned long long l, unsigned long long r) {
65 inline unsigned long long llmax(unsigned long long l, unsigned long long r) {
69 #endif /* GENERALFUNCTIONS_HH_ */