ScummVM API documentation
as_namespace.h
1 /*
2  AngelCode Scripting Library
3  Copyright (c) 2013-2014 Andreas Jonsson
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any
7  damages arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any
10  purpose, including commercial applications, and to alter it and
11  redistribute it freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you
14  must not claim that you wrote the original software. If you use
15  this software in a product, an acknowledgment in the product
16  documentation would be appreciated but is not required.
17 
18  2. Altered source versions must be plainly marked as such, and
19  must not be misrepresented as being the original software.
20 
21  3. This notice may not be removed or altered from any source
22  distribution.
23 
24  The original version of this library can be located at:
25  http://www.angelcode.com/angelscript/
26 
27  Andreas Jonsson
28  andreas@angelcode.com
29 */
30 
31 
32 #ifndef AS_NAMESPACE_H
33 #define AS_NAMESPACE_H
34 
35 #include "as_string.h"
36 
37 BEGIN_AS_NAMESPACE
38 
39 struct asSNameSpace {
40  asCString name;
41 
42  // TODO: namespace: A namespace should have access masks. The application should be
43  // able to restrict specific namespaces from access to specific modules
44 };
45 
46 
48  const asSNameSpace *ns;
49  asCString name;
50 
51  asSNameSpaceNamePair() : ns(0) {}
52  asSNameSpaceNamePair(const asSNameSpace *_ns, const asCString &_name) : ns(_ns), name(_name) {}
53 
54  asSNameSpaceNamePair &operator=(const asSNameSpaceNamePair &other) {
55  ns = other.ns;
56  name = other.name;
57  return *this;
58  }
59 
60  bool operator==(const asSNameSpaceNamePair &other) const {
61  return (ns == other.ns && name == other.name);
62  }
63 
64  bool operator<(const asSNameSpaceNamePair &other) const {
65  return (ns < other.ns || (ns == other.ns && name < other.name));
66  }
67 };
68 
69 END_AS_NAMESPACE
70 
71 #endif
72 
Definition: as_namespace.h:39
Definition: as_namespace.h:47
Definition: as_string.h:41