diff options
author | John Mayhew | 2012-04-02 16:28:39 -0700 |
---|---|---|
committer | John Mayhew | 2012-04-02 16:28:39 -0700 |
commit | b4155fb4c33675a8a7cd37473513718043fdf0ba (patch) | |
tree | 3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/helper-classes/backup-delete/ParseUtils.js | |
parent | 5ba9aeac94c86049423fd5d4b37b277263939c13 (diff) | |
parent | c6de22bf42be90b403491b5f87b1818d9020310c (diff) | |
download | ninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts:
js/helper-classes/RDGE/rdge-compiled.js
js/helper-classes/RDGE/runtime/GLRuntime.js
js/helper-classes/RDGE/src/core/script/MeshManager.js
js/helper-classes/RDGE/src/core/script/engine.js
js/helper-classes/RDGE/src/core/script/fx/ssao.js
js/helper-classes/RDGE/src/core/script/init_state.js
js/helper-classes/RDGE/src/core/script/run_state.js
js/helper-classes/RDGE/src/core/script/scenegraphNodes.js
js/helper-classes/RDGE/src/core/script/utilities.js
js/helper-classes/RDGE/src/tools/compile-rdge-core.bat
js/helper-classes/RDGE/src/tools/compile-rdge-core.sh
js/helper-classes/RDGE/src/tools/rdge-compiled.js
js/lib/drawing/world.js
js/lib/rdge/materials/bump-metal-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/fly-material.js
js/lib/rdge/materials/julia-material.js
js/lib/rdge/materials/keleidoscope-material.js
js/lib/rdge/materials/linear-gradient-material.js
js/lib/rdge/materials/mandel-material.js
js/lib/rdge/materials/plasma-material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/radial-blur-material.js
js/lib/rdge/materials/radial-gradient-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
js/preloader/Preloader.js
Diffstat (limited to 'js/helper-classes/backup-delete/ParseUtils.js')
-rwxr-xr-x | js/helper-classes/backup-delete/ParseUtils.js | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/js/helper-classes/backup-delete/ParseUtils.js b/js/helper-classes/backup-delete/ParseUtils.js deleted file mode 100755 index 556253e9..00000000 --- a/js/helper-classes/backup-delete/ParseUtils.js +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | /////////////////////////////////////////////////////////////////////// | ||
8 | // Class Utils | ||
9 | // Vector Utility functions | ||
10 | /////////////////////////////////////////////////////////////////////// | ||
11 | function ParseUtils( theStr ) | ||
12 | { | ||
13 | /////////////////////////////////////////////////////////////////////// | ||
14 | // Instance variables | ||
15 | /////////////////////////////////////////////////////////////////////// | ||
16 | this._strBuffer = theStr; | ||
17 | |||
18 | /////////////////////////////////////////////////////////////////////// | ||
19 | // Property accessors | ||
20 | /////////////////////////////////////////////////////////////////////// | ||
21 | this.getBuffer = function() { return this._strBuffer; } | ||
22 | this.setBuffer = function(b) { this._strBuffer = b; } | ||
23 | |||
24 | /////////////////////////////////////////////////////////////////////// | ||
25 | // Methods | ||
26 | /////////////////////////////////////////////////////////////////////// | ||
27 | this.nextValue = function( prop, endKeyArg, advanceBufferArg ) | ||
28 | { | ||
29 | if (!this._strBuffer) return; | ||
30 | |||
31 | // make the 2 & 3rd argument optional. default is to advance the string | ||
32 | var endKey = "\n", advanceBuffer = true; | ||
33 | if (endKeyArg) | ||
34 | endKey = endKeyArg; | ||
35 | if (advanceBufferArg) | ||
36 | advanceBuffer = advanceBufferArg; | ||
37 | |||
38 | var iStart = this._strBuffer.indexOf( prop ); | ||
39 | if (iStart < 0) return; | ||
40 | |||
41 | var iEnd = this._strBuffer.indexOf( endKey, iStart ); | ||
42 | if (iEnd < 0) throw new Error( "property " + prop + " improperly terminated: " + this._strBuffer); | ||
43 | |||
44 | iStart += prop.length; | ||
45 | var nChars = iEnd - iStart; | ||
46 | var rtnStr = this._strBuffer.substr( iStart, nChars ); | ||
47 | |||
48 | if (advanceBuffer) | ||
49 | this._strBuffer = this._strBuffer.substr( iEnd + endKey.length ); | ||
50 | |||
51 | return rtnStr; | ||
52 | } | ||
53 | |||
54 | this.nextToken = function() | ||
55 | { | ||
56 | if (!this._strBuffer) return; | ||
57 | |||
58 | // find the limits | ||
59 | var index = this._strBuffer.search( /\S/ ); // first non-whitespace character | ||
60 | if (index > 0) this._strBuffer = this._strBuffer.slice(index); | ||
61 | index = this._strBuffer.search( /\s/ ); // first whitespace character marking the end of the token | ||
62 | |||
63 | var token; | ||
64 | if (index > 0) | ||
65 | { | ||
66 | token = this._strBuffer.slice(0, index); | ||
67 | this._strBuffer = this._strBuffer.slice( index ); | ||
68 | } | ||
69 | |||
70 | return token; | ||
71 | } | ||
72 | |||
73 | this.advancePastToken = function( token ) | ||
74 | { | ||
75 | var index = this._strBuffer.indexOf( token ); | ||
76 | if (index < 0) | ||
77 | console.log( "could not find token: " + token + " in string: " + this._strBuffer ); | ||
78 | else | ||
79 | this._strBuffer = this._strBuffer.substr( index + token.length ); | ||
80 | } | ||
81 | |||
82 | } | ||
83 | |||
84 | |||