ScummVM API documentation
as_scriptcode.h
1 /*
2  AngelCode Scripting Library
3  Copyright (c) 2003-2011 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 //
33 // as_scriptcode.h
34 //
35 // A container class for the script code to be compiled
36 //
37 
38 
39 
40 #ifndef AS_SCRIPTCODE_H
41 #define AS_SCRIPTCODE_H
42 
43 #include "as_memory.h"
44 #include "as_string.h"
45 
46 BEGIN_AS_NAMESPACE
47 
49 public:
50  asCScriptCode();
51  ~asCScriptCode();
52 
53  int SetCode(const char *name, const char *code, bool makeCopy);
54  int SetCode(const char *name, const char *code, size_t length, bool makeCopy);
55 
56  void ConvertPosToRowCol(size_t pos, int *row, int *col);
57 
58  bool TokenEquals(size_t pos, size_t len, const char *str);
59 
60  asCString name;
61  char *code;
62  size_t codeLength;
63  bool sharedCode;
64  int idx;
65  int lineOffset;
66  asCArray<size_t> linePositions;
67 };
68 
69 END_AS_NAMESPACE
70 
71 #endif
Definition: as_scriptcode.h:48
Definition: as_string.h:41