First commit
This commit is contained in:
0
hGameTest/node_modules/haxe/.haxelib/.exist
generated
vendored
Normal file
0
hGameTest/node_modules/haxe/.haxelib/.exist
generated
vendored
Normal file
4
hGameTest/node_modules/haxe/.idea/haxe.xml
generated
vendored
Normal file
4
hGameTest/node_modules/haxe/.idea/haxe.xml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="HaxeProjectSettings" defines="" />
|
||||
</project>
|
||||
6
hGameTest/node_modules/haxe/.idea/misc.xml
generated
vendored
Normal file
6
hGameTest/node_modules/haxe/.idea/misc.xml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="true" project-jdk-name="Haxe 3.4.7" project-jdk-type="Haxe toolkit">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
9
hGameTest/node_modules/haxe/.idea/modules.xml
generated
vendored
Normal file
9
hGameTest/node_modules/haxe/.idea/modules.xml
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/npm-haxe.iml" filepath="$PROJECT_DIR$/npm-haxe.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/../test/test.iml" filepath="$PROJECT_DIR$/../test/test.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
hGameTest/node_modules/haxe/.idea/vcs.xml
generated
vendored
Normal file
6
hGameTest/node_modules/haxe/.idea/vcs.xml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
1037
hGameTest/node_modules/haxe/.idea/workspace.xml
generated
vendored
Normal file
1037
hGameTest/node_modules/haxe/.idea/workspace.xml
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
hGameTest/node_modules/haxe/.travis.yml
generated
vendored
Normal file
8
hGameTest/node_modules/haxe/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
|
||||
os:
|
||||
- linux
|
||||
|
||||
node_js:
|
||||
- "stable"
|
||||
- "4"
|
||||
111
hGameTest/node_modules/haxe/README.md
generated
vendored
Normal file
111
hGameTest/node_modules/haxe/README.md
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
# npm-haxe
|
||||
[](https://travis-ci.org/HaxeFoundation/npm-haxe)
|
||||
[](https://ci.appveyor.com/project/HaxeFoundation/npm-haxe)
|
||||
[](https://david-dm.org/HaxeFoundation/npm-haxe)
|
||||
|
||||
Installs [Haxe](http://haxe.org) using [Node Package Manager](https://www.npmjs.com/) aka `npm`
|
||||
|
||||
## Key-features
|
||||
|
||||
* Global or per-project, sandboxed, standard Haxe installation
|
||||
* Includes [Haxelib](http://lib.haxe.org/) and [Neko](https://nekovm.org/)
|
||||
* Tested on Ubuntu/Linux and Windows
|
||||
|
||||
## Usage
|
||||
|
||||
### CLI installation
|
||||
|
||||
```bash
|
||||
npm install haxe
|
||||
```
|
||||
|
||||
By default, this will make `haxe` and `haxelib` available to [npm scripts](https://docs.npmjs.com/misc/scripts) only,
|
||||
with haxelib repository sandboxed to your current working directory.
|
||||
|
||||
To have `haxe` and `haxelib` commands available globally, use the `-g` flag.
|
||||
This will also make the haxelib repo global.
|
||||
|
||||
### Package.json sample
|
||||
|
||||
```js
|
||||
{
|
||||
"scripts":{
|
||||
"postinstall": "haxelib --always install build.hxml",
|
||||
"build": "haxe build.hxml"
|
||||
},
|
||||
"dependencies": {
|
||||
"haxe": "4.1.4" // the npm haxe module
|
||||
},
|
||||
"haxeDependencies": {
|
||||
"haxe": "3.4.7", // haxe version
|
||||
"haxelib": "3.3.0", // haxelib version
|
||||
"neko": "2.2.0", // neko version
|
||||
"pixijs": "4.5.5", // additionnal haxelib dependency
|
||||
"perfjs": "1.1.18"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Please notice the `--always` flag in the `haxelib` command, to avoid having to confirm haxelibs installation.
|
||||
|
||||
### Running Haxe from NodeJS
|
||||
|
||||
This package also comes with the minimal bindings to run the Haxe compiler from NodeJS.
|
||||
|
||||
|
||||
```js
|
||||
var haxe = require('haxe').haxe;
|
||||
var haxelib = require('haxe').haxelib;
|
||||
|
||||
// all commands return a ChildProcess instance
|
||||
|
||||
haxe( "-version" );
|
||||
haxelib( "install", "hxnodejs" );
|
||||
|
||||
var server = haxe("--wait", "6000");
|
||||
```
|
||||
|
||||
See also [test.js](https://github.com/HaxeFoundation/npm-haxe/blob/master/test.js)
|
||||
|
||||
|
||||
### Configuration options
|
||||
|
||||
The following configuration options can be set in your package.json.
|
||||
|
||||
Please note they must be set before installing the package.
|
||||
|
||||
```json
|
||||
"haxeDependencies": {
|
||||
"haxe": "3.4.7",
|
||||
"haxelib": "3.3.0",
|
||||
"neko": "2.2.0",
|
||||
"pixijs": "4.5.5",
|
||||
"perfjs": "1.1.18"
|
||||
}
|
||||
```
|
||||
|
||||
#### Version
|
||||
|
||||
See [Haxe Download list](http://haxe.org/download/list/).
|
||||
Please notice the directory name in the archive must match.
|
||||
|
||||
In this case, the `haxeDependencies.haxe` value is still used, and must match the one of the directory extracted from the archive.
|
||||
|
||||
#### Haxelib
|
||||
|
||||
`haxeDependencies.haxelib` must match a release from the [official Haxelib repo](https://github.com/HaxeFoundation/haxelib/releases)
|
||||
|
||||
### Known issues
|
||||
|
||||
The package relies on the `node` command, which [has issues on some Ubuntu versions] (http://stackoverflow.com/questions/21168141/cannot-install-packages-using-node-package-manager-in-ubuntu).
|
||||
|
||||
If you get an error similar to this :
|
||||
```
|
||||
sh: 1: node: not found
|
||||
npm WARN This failure might be due to the use of legacy binary "node"
|
||||
npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian
|
||||
```
|
||||
Just install the `nodejs-legacy` package:
|
||||
```bash
|
||||
sudo apt-get install nodejs-legacy
|
||||
```
|
||||
15
hGameTest/node_modules/haxe/appveyor.yml
generated
vendored
Normal file
15
hGameTest/node_modules/haxe/appveyor.yml
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
version: "{build}"
|
||||
|
||||
environment:
|
||||
global:
|
||||
nodejs_version: "LTS"
|
||||
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
- node --version
|
||||
- npm --version
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- npm test
|
||||
2
hGameTest/node_modules/haxe/bin/haxe
generated
vendored
Executable file
2
hGameTest/node_modules/haxe/bin/haxe
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('..').haxe.cli();
|
||||
2
hGameTest/node_modules/haxe/bin/haxelib
generated
vendored
Executable file
2
hGameTest/node_modules/haxe/bin/haxelib
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('..').haxelib.cli();
|
||||
2
hGameTest/node_modules/haxe/bin/neko
generated
vendored
Executable file
2
hGameTest/node_modules/haxe/bin/neko
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('..').neko.cli();
|
||||
1864
hGameTest/node_modules/haxe/downloads/haxe/CHANGES.txt
generated
vendored
Normal file
1864
hGameTest/node_modules/haxe/downloads/haxe/CHANGES.txt
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
25
hGameTest/node_modules/haxe/downloads/haxe/CONTRIB.txt
generated
vendored
Normal file
25
hGameTest/node_modules/haxe/downloads/haxe/CONTRIB.txt
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
Contributor License Agreement :
|
||||
|
||||
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the project Haxe :
|
||||
|
||||
1) Definitions
|
||||
|
||||
"Contribution" : any source code, documentation, including any modifications or additions to an existing work that is intentionally submitted by You to the Haxe Foundation for inclusion in, or documentation of, any of the products managed and maintained by the Haxe Foundation.
|
||||
|
||||
"Submitted" means any form or electronic, verbal or written communication, including but not limited to communication on electronic mailing lists, source code control systems and issue tracking system that are managed by, or on behalf of, the Haxe Foundation for the purpose of improving Haxe.
|
||||
|
||||
2) Grant of Copyright License. Subject to the terms and conditions of this Grant, You hereby grant to the Haxe Foundation and to recipients of software distributed by the Haxe Foundation a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
|
||||
|
||||
3) You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Haxe Foundation, or that your employer has executed a separate Corporate Contributor License Grant with the Haxe Foundation.
|
||||
|
||||
4) You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
|
||||
|
||||
5) You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
Full Name :
|
||||
Email :
|
||||
Mailing Address :
|
||||
Country :
|
||||
|
||||
|
||||
Signature:
|
||||
311
hGameTest/node_modules/haxe/downloads/haxe/LICENSE.txt
generated
vendored
Normal file
311
hGameTest/node_modules/haxe/downloads/haxe/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,311 @@
|
||||
Haxe Licenses
|
||||
-------------
|
||||
|
||||
For details about Haxe Licenses, please read http://haxe.org/foundation/open-source.html
|
||||
|
||||
The Haxe Standard Library MIT License :
|
||||
--------------------------
|
||||
|
||||
Copyright (C)2005-2016 Haxe Foundation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
The Haxe compiler GPL License :
|
||||
-------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
BIN
hGameTest/node_modules/haxe/downloads/haxe/haxe
generated
vendored
Executable file
BIN
hGameTest/node_modules/haxe/downloads/haxe/haxe
generated
vendored
Executable file
Binary file not shown.
BIN
hGameTest/node_modules/haxe/downloads/haxe/haxelib
generated
vendored
Executable file
BIN
hGameTest/node_modules/haxe/downloads/haxe/haxelib
generated
vendored
Executable file
Binary file not shown.
38
hGameTest/node_modules/haxe/downloads/haxe/std/Any.hx
generated
vendored
Normal file
38
hGameTest/node_modules/haxe/downloads/haxe/std/Any.hx
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
`Any` is a type that is compatible with any other in both ways.
|
||||
|
||||
This means that a value of any type can be assigned to `Any`, and
|
||||
vice-versa, a value of `Any` type can be assigned to any other type.
|
||||
|
||||
It's a more type-safe alternative to `Dynamic`, because it doesn't
|
||||
support field access or operators and it's bound to monomorphs. So,
|
||||
to work with the actual value, it needs to be explicitly promoted
|
||||
to another type.
|
||||
**/
|
||||
abstract Any(Dynamic) {
|
||||
@:noCompletion @:extern @:to inline function __promote<T>():T return this;
|
||||
@:noCompletion @:extern @:from inline static function __cast<T>(value:T):Any return cast value;
|
||||
@:noCompletion @:extern inline function toString():String return Std.string(this);
|
||||
}
|
||||
288
hGameTest/node_modules/haxe/downloads/haxe/std/Array.hx
generated
vendored
Normal file
288
hGameTest/node_modules/haxe/downloads/haxe/std/Array.hx
generated
vendored
Normal file
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
An Array is a storage for values. You can access it using indexes or
|
||||
with its API.
|
||||
|
||||
@see https://haxe.org/manual/std-Array.html
|
||||
@see https://haxe.org/manual/lf-array-comprehension.html
|
||||
**/
|
||||
extern class Array<T> {
|
||||
|
||||
/**
|
||||
The length of `this` Array.
|
||||
**/
|
||||
var length(default,null) : Int;
|
||||
|
||||
/**
|
||||
Creates a new Array.
|
||||
**/
|
||||
function new() : Void;
|
||||
|
||||
/**
|
||||
Returns a new Array by appending the elements of `a` to the elements of
|
||||
`this` Array.
|
||||
|
||||
This operation does not modify `this` Array.
|
||||
|
||||
If `a` is the empty Array `[]`, a copy of `this` Array is returned.
|
||||
|
||||
The length of the returned Array is equal to the sum of `this.length`
|
||||
and `a.length`.
|
||||
|
||||
If `a` is `null`, the result is unspecified.
|
||||
**/
|
||||
function concat( a : Array<T> ) : Array<T>;
|
||||
|
||||
/**
|
||||
Returns a string representation of `this` Array, with `sep` separating
|
||||
each element.
|
||||
|
||||
The result of this operation is equal to `Std.string(this[0]) + sep +
|
||||
Std.string(this[1]) + sep + ... + sep + Std.string(this[this.length-1])`
|
||||
|
||||
If `this` is the empty Array `[]`, the result is the empty String `""`.
|
||||
If `this` has exactly one element, the result is equal to a call to
|
||||
`Std.string(this[0])`.
|
||||
|
||||
If `sep` is null, the result is unspecified.
|
||||
**/
|
||||
function join( sep : String ) : String;
|
||||
|
||||
/**
|
||||
Removes the last element of `this` Array and returns it.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
If `this` has at least one element, `this.length` will decrease by 1.
|
||||
|
||||
If `this` is the empty Array `[]`, null is returned and the length
|
||||
remains 0.
|
||||
**/
|
||||
function pop() : Null<T>;
|
||||
|
||||
/**
|
||||
Adds the element `x` at the end of `this` Array and returns the new
|
||||
length of `this` Array.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
`this.length` increases by 1.
|
||||
**/
|
||||
function push(x : T) : Int;
|
||||
|
||||
/**
|
||||
Reverse the order of elements of `this` Array.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
If `this.length < 2`, `this` remains unchanged.
|
||||
**/
|
||||
function reverse() : Void;
|
||||
|
||||
/**
|
||||
Removes the first element of `this` Array and returns it.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
If `this` has at least one element, `this`.length and the index of each
|
||||
remaining element is decreased by 1.
|
||||
|
||||
If `this` is the empty Array `[]`, `null` is returned and the length
|
||||
remains 0.
|
||||
**/
|
||||
function shift() : Null<T>;
|
||||
|
||||
/**
|
||||
Creates a shallow copy of the range of `this` Array, starting at and
|
||||
including `pos`, up to but not including `end`.
|
||||
|
||||
This operation does not modify `this` Array.
|
||||
|
||||
The elements are not copied and retain their identity.
|
||||
|
||||
If `end` is omitted or exceeds `this.length`, it defaults to the end of
|
||||
`this` Array.
|
||||
|
||||
If `pos` or `end` are negative, their offsets are calculated from the
|
||||
end of `this` Array by `this.length + pos` and `this.length + end`
|
||||
respectively. If this yields a negative value, 0 is used instead.
|
||||
|
||||
If `pos` exceeds `this.length` or if `end` is less than or equals
|
||||
`pos`, the result is `[]`.
|
||||
**/
|
||||
function slice( pos : Int, ?end : Int ) : Array<T>;
|
||||
|
||||
/**
|
||||
Sorts `this` Array according to the comparison function `f`, where
|
||||
`f(x,y)` returns 0 if x == y, a positive Int if x > y and a
|
||||
negative Int if x < y.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
The sort operation is not guaranteed to be stable, which means that the
|
||||
order of equal elements may not be retained. For a stable Array sorting
|
||||
algorithm, `haxe.ds.ArraySort.sort()` can be used instead.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
function sort( f : T -> T -> Int ) : Void;
|
||||
|
||||
/**
|
||||
Removes `len` elements from `this` Array, starting at and including
|
||||
`pos`, an returns them.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
If `len` is < 0 or `pos` exceeds `this`.length, an empty Array [] is
|
||||
returned and `this` Array is unchanged.
|
||||
|
||||
If `pos` is negative, its value is calculated from the end of `this`
|
||||
Array by `this.length + pos`. If this yields a negative value, 0 is
|
||||
used instead.
|
||||
|
||||
If the sum of the resulting values for `len` and `pos` exceed
|
||||
`this.length`, this operation will affect the elements from `pos` to the
|
||||
end of `this` Array.
|
||||
|
||||
The length of the returned Array is equal to the new length of `this`
|
||||
Array subtracted from the original length of `this` Array. In other
|
||||
words, each element of the original `this` Array either remains in
|
||||
`this` Array or becomes an element of the returned Array.
|
||||
**/
|
||||
function splice( pos : Int, len : Int ) : Array<T>;
|
||||
|
||||
/**
|
||||
Returns a string representation of `this` Array.
|
||||
|
||||
The result will include the individual elements' String representations
|
||||
separated by comma. The enclosing [ ] may be missing on some platforms,
|
||||
use `Std.string()` to get a String representation that is consistent
|
||||
across platforms.
|
||||
**/
|
||||
function toString() : String;
|
||||
|
||||
/**
|
||||
Adds the element `x` at the start of `this` Array.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
`this.length` and the index of each Array element increases by 1.
|
||||
**/
|
||||
function unshift( x : T ) : Void;
|
||||
|
||||
/**
|
||||
Inserts the element `x` at the position `pos`.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
The offset is calculated like so:
|
||||
|
||||
- If `pos` exceeds `this.length`, the offset is `this.length`.
|
||||
- If `pos` is negative, the offset is calculated from the end of `this`
|
||||
Array, i.e. `this.length + pos`. If this yields a negative value, the
|
||||
offset is 0.
|
||||
- Otherwise, the offset is `pos`.
|
||||
|
||||
If the resulting offset does not exceed `this.length`, all elements from
|
||||
and including that offset to the end of `this` Array are moved one index
|
||||
ahead.
|
||||
**/
|
||||
function insert( pos : Int, x : T ) : Void;
|
||||
|
||||
/**
|
||||
Removes the first occurrence of `x` in `this` Array.
|
||||
|
||||
This operation modifies `this` Array in place.
|
||||
|
||||
If `x` is found by checking standard equality, it is removed from `this`
|
||||
Array and all following elements are reindexed accordingly. The function
|
||||
then returns true.
|
||||
|
||||
If `x` is not found, `this` Array is not changed and the function
|
||||
returns false.
|
||||
**/
|
||||
function remove( x : T ) : Bool;
|
||||
|
||||
/**
|
||||
Returns position of the first occurrence of `x` in `this` Array, searching front to back.
|
||||
|
||||
If `x` is found by checking standard equality, the function returns its index.
|
||||
|
||||
If `x` is not found, the function returns -1.
|
||||
|
||||
If `fromIndex` is specified, it will be used as the starting index to search from,
|
||||
otherwise search starts with zero index. If it is negative, it will be taken as the
|
||||
offset from the end of `this` Array to compute the starting index. If given or computed
|
||||
starting index is less than 0, the whole array will be searched, if it is greater than
|
||||
or equal to the length of `this` Array, the function returns -1.
|
||||
**/
|
||||
function indexOf( x : T, ?fromIndex:Int ) : Int;
|
||||
|
||||
/**
|
||||
Returns position of the last occurrence of `x` in `this` Array, searching back to front.
|
||||
|
||||
If `x` is found by checking standard equality, the function returns its index.
|
||||
|
||||
If `x` is not found, the function returns -1.
|
||||
|
||||
If `fromIndex` is specified, it will be used as the starting index to search from,
|
||||
otherwise search starts with the last element index. If it is negative, it will be
|
||||
taken as the offset from the end of `this` Array to compute the starting index. If
|
||||
given or computed starting index is greater than or equal to the length of `this` Array,
|
||||
the whole array will be searched, if it is less than 0, the function returns -1.
|
||||
**/
|
||||
function lastIndexOf( x : T, ?fromIndex:Int ) : Int;
|
||||
|
||||
/**
|
||||
Returns a shallow copy of `this` Array.
|
||||
|
||||
The elements are not copied and retain their identity, so
|
||||
`a[i] == a.copy()[i]` is true for any valid `i`. However,
|
||||
`a == a.copy()` is always false.
|
||||
**/
|
||||
function copy() : Array<T>;
|
||||
|
||||
/**
|
||||
Returns an iterator of the Array values.
|
||||
**/
|
||||
function iterator() : Iterator<T>;
|
||||
|
||||
/**
|
||||
Creates a new Array by applying function `f` to all elements of `this`.
|
||||
|
||||
The order of elements is preserved.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
function map<S>( f : T -> S ) : Array<S>;
|
||||
|
||||
/**
|
||||
Returns an Array containing those elements of `this` for which `f`
|
||||
returned true.
|
||||
|
||||
The individual elements are not duplicated and retain their identity.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
function filter( f : T -> Bool ) : Array<T>;
|
||||
}
|
||||
30
hGameTest/node_modules/haxe/downloads/haxe/std/Class.hx
generated
vendored
Normal file
30
hGameTest/node_modules/haxe/downloads/haxe/std/Class.hx
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
An abstract type that represents a Class.
|
||||
|
||||
See `Type` for the Haxe Reflection API.
|
||||
|
||||
@see https://haxe.org/manual/types-class-instance.html
|
||||
**/
|
||||
@:coreType @:runtimeValue abstract Class<T> {
|
||||
}
|
||||
174
hGameTest/node_modules/haxe/downloads/haxe/std/Date.hx
generated
vendored
Normal file
174
hGameTest/node_modules/haxe/downloads/haxe/std/Date.hx
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
The Date class provides a basic structure for date and time related
|
||||
information. Date instances can be created by
|
||||
|
||||
- `new Date()` for a specific date,
|
||||
- `Date.now()` to obtain information about the current time,
|
||||
- `Date.fromTime()` with a given timestamp or
|
||||
- `Date.fromString()` by parsing from a String.
|
||||
|
||||
There are some extra functions available in the `DateTools` class.
|
||||
|
||||
In the context of Haxe dates, a timestamp is defined as the number of
|
||||
milliseconds elapsed since 1st January 1970.
|
||||
**/
|
||||
extern class Date
|
||||
{
|
||||
/**
|
||||
Creates a new date object from the given arguments.
|
||||
|
||||
The behaviour of a Date instance is only consistent across platforms if
|
||||
the the arguments describe a valid date.
|
||||
|
||||
- month: 0 to 11
|
||||
- day: 1 to 31
|
||||
- hour: 0 to 23
|
||||
- min: 0 to 59
|
||||
- sec: 0 to 59
|
||||
**/
|
||||
function new(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int ) : Void;
|
||||
|
||||
/**
|
||||
Returns the timestamp (in milliseconds) of the date. It might
|
||||
only have a per-second precision depending on the platforms.
|
||||
**/
|
||||
function getTime() : Float;
|
||||
|
||||
/**
|
||||
Returns the hours of `this` Date (0-23 range).
|
||||
**/
|
||||
function getHours() : Int;
|
||||
|
||||
/**
|
||||
Returns the minutes of `this` Date (0-59 range).
|
||||
**/
|
||||
function getMinutes() : Int;
|
||||
|
||||
/**
|
||||
Returns the seconds of `this` Date (0-59 range).
|
||||
**/
|
||||
function getSeconds() : Int;
|
||||
|
||||
/**
|
||||
Returns the full year of `this` Date (4-digits).
|
||||
**/
|
||||
function getFullYear() : Int;
|
||||
|
||||
/**
|
||||
Returns the month of `this` Date (0-11 range).
|
||||
**/
|
||||
function getMonth() : Int;
|
||||
|
||||
/**
|
||||
Returns the day of `this` Date (1-31 range).
|
||||
**/
|
||||
function getDate() : Int;
|
||||
|
||||
/**
|
||||
Returns the day of the week of `this` Date (0-6 range) where `0` is Sunday.
|
||||
**/
|
||||
function getDay() : Int;
|
||||
|
||||
/**
|
||||
Returns a string representation of `this` Date, by using the
|
||||
standard format [YYYY-MM-DD HH:MM:SS]. See `DateTools.format` for
|
||||
other formating rules.
|
||||
**/
|
||||
function toString():String;
|
||||
|
||||
/**
|
||||
Returns a Date representing the current local time.
|
||||
**/
|
||||
static function now() : Date;
|
||||
|
||||
/**
|
||||
Returns a Date from timestamp `t`.
|
||||
**/
|
||||
static function fromTime( t : Float ) : Date;
|
||||
|
||||
/**
|
||||
Returns a Date from a formated string `s`, with the following accepted
|
||||
formats:
|
||||
|
||||
- `"YYYY-MM-DD hh:mm:ss"`
|
||||
- `"YYYY-MM-DD"`
|
||||
- `"hh:mm:ss"`
|
||||
|
||||
The first two formats are expressed in local time, the third in UTC
|
||||
Epoch.
|
||||
**/
|
||||
static function fromString( s : String ) : Date;
|
||||
|
||||
|
||||
#if flash
|
||||
private static function __init__() : Void untyped {
|
||||
var d : Dynamic = Date;
|
||||
d.now = function() {
|
||||
return __new__(Date);
|
||||
};
|
||||
d.fromTime = function(t){
|
||||
var d : Date = __new__(Date);
|
||||
d.setTime(t);
|
||||
return d;
|
||||
};
|
||||
d.fromString = function(s : String) {
|
||||
switch( s.length ) {
|
||||
case 8: // hh:mm:ss
|
||||
var k = s.split(":");
|
||||
var d : Date = __new__(Date);
|
||||
d.setTime(0);
|
||||
d.setUTCHours(k[0]);
|
||||
d.setUTCMinutes(k[1]);
|
||||
d.setUTCSeconds(k[2]);
|
||||
return d;
|
||||
case 10: // YYYY-MM-DD
|
||||
var k = s.split("-");
|
||||
return new Date(cast k[0],cast k[1] - 1,cast k[2],0,0,0);
|
||||
case 19: // YYYY-MM-DD hh:mm:ss
|
||||
var k = s.split(" ");
|
||||
var y = k[0].split("-");
|
||||
var t = k[1].split(":");
|
||||
return new Date(cast y[0],cast y[1] - 1,cast y[2],cast t[0],cast t[1],cast t[2]);
|
||||
default:
|
||||
throw "Invalid date format : " + s;
|
||||
}
|
||||
};
|
||||
d.prototype[#if (as3 || no_flash_override) "toStringHX" #else "toString" #end] = function() {
|
||||
var date : Date = __this__;
|
||||
var m = date.getMonth() + 1;
|
||||
var d = date.getDate();
|
||||
var h = date.getHours();
|
||||
var mi = date.getMinutes();
|
||||
var s = date.getSeconds();
|
||||
return date.getFullYear()
|
||||
+"-"+(if( m < 10 ) "0"+m else ""+m)
|
||||
+"-"+(if( d < 10 ) "0"+d else ""+d)
|
||||
+" "+(if( h < 10 ) "0"+h else ""+h)
|
||||
+":"+(if( mi < 10 ) "0"+mi else ""+mi)
|
||||
+":"+(if( s < 10 ) "0"+s else ""+s);
|
||||
};
|
||||
}
|
||||
#end
|
||||
}
|
||||
249
hGameTest/node_modules/haxe/downloads/haxe/std/DateTools.hx
generated
vendored
Normal file
249
hGameTest/node_modules/haxe/downloads/haxe/std/DateTools.hx
generated
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
The DateTools class contains some extra functionalities for handling `Date`
|
||||
instances and timestamps.
|
||||
|
||||
In the context of Haxe dates, a timestamp is defined as the number of
|
||||
milliseconds elapsed since 1st January 1970.
|
||||
**/
|
||||
class DateTools {
|
||||
|
||||
#if php
|
||||
#elseif (neko && !(macro || interp))
|
||||
static var date_format = neko.Lib.load("std","date_format",2);
|
||||
#else
|
||||
static var DAY_SHORT_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
static var DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
||||
static var MONTH_SHORT_NAMES = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
static var MONTH_NAMES = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
||||
|
||||
private static function __format_get( d : Date, e : String ) : String {
|
||||
return switch( e ){
|
||||
case "%":
|
||||
"%";
|
||||
case "a":
|
||||
DAY_SHORT_NAMES[d.getDay()];
|
||||
case "A":
|
||||
DAY_NAMES[d.getDay()];
|
||||
case "b","h":
|
||||
MONTH_SHORT_NAMES[d.getMonth()];
|
||||
case "B":
|
||||
MONTH_NAMES[d.getMonth()];
|
||||
case "C":
|
||||
untyped StringTools.lpad(Std.string(Std.int(d.getFullYear()/100)),"0",2);
|
||||
case "d":
|
||||
untyped StringTools.lpad(Std.string(d.getDate()),"0",2);
|
||||
case "D":
|
||||
__format(d,"%m/%d/%y");
|
||||
case "e":
|
||||
untyped Std.string(d.getDate());
|
||||
case "F":
|
||||
__format(d,"%Y-%m-%d");
|
||||
case "H","k":
|
||||
untyped StringTools.lpad(Std.string(d.getHours()),if( e == "H" ) "0" else " ",2);
|
||||
case "I","l":
|
||||
var hour = d.getHours()%12;
|
||||
untyped StringTools.lpad(Std.string(hour == 0 ? 12 : hour),if( e == "I" ) "0" else " ",2);
|
||||
case "m":
|
||||
untyped StringTools.lpad(Std.string(d.getMonth()+1),"0",2);
|
||||
case "M":
|
||||
untyped StringTools.lpad(Std.string(d.getMinutes()),"0",2);
|
||||
case "n":
|
||||
"\n";
|
||||
case "p":
|
||||
untyped if( d.getHours() > 11 ) "PM"; else "AM";
|
||||
case "r":
|
||||
__format(d,"%I:%M:%S %p");
|
||||
case "R":
|
||||
__format(d,"%H:%M");
|
||||
case "s":
|
||||
Std.string(Std.int(d.getTime()/1000));
|
||||
case "S":
|
||||
untyped StringTools.lpad(Std.string(d.getSeconds()),"0",2);
|
||||
case "t":
|
||||
"\t";
|
||||
case "T":
|
||||
__format(d,"%H:%M:%S");
|
||||
case "u":
|
||||
untyped{
|
||||
var t = d.getDay();
|
||||
if( t == 0 ) "7"; else Std.string(t);
|
||||
}
|
||||
case "w":
|
||||
untyped Std.string(d.getDay());
|
||||
case "y":
|
||||
untyped StringTools.lpad(Std.string(d.getFullYear()%100),"0",2);
|
||||
case "Y":
|
||||
untyped Std.string(d.getFullYear());
|
||||
default:
|
||||
throw "Date.format %"+e+"- not implemented yet.";
|
||||
}
|
||||
}
|
||||
|
||||
private static function __format( d : Date, f : String ) : String {
|
||||
var r = new StringBuf();
|
||||
var p = 0;
|
||||
while( true ){
|
||||
var np = f.indexOf("%", p);
|
||||
if( np < 0 )
|
||||
break;
|
||||
|
||||
r.addSub(f,p,np-p);
|
||||
r.add( __format_get(d, f.substr(np+1,1) ) );
|
||||
|
||||
p = np+2;
|
||||
}
|
||||
r.addSub(f,p,f.length-p);
|
||||
return r.toString();
|
||||
}
|
||||
#end
|
||||
|
||||
/**
|
||||
Format the date `d` according to the format `f`. The format is
|
||||
compatible with the `strftime` standard format, except that there is no
|
||||
support in Flash and JS for day and months names (due to lack of proper
|
||||
internationalization API). On Haxe/Neko/Windows, some formats are not
|
||||
supported.
|
||||
|
||||
```haxe
|
||||
var t = DateTools.format(Date.now(), "%Y-%m-%d_%H:%M:%S");
|
||||
// 2016-07-08_14:44:05
|
||||
|
||||
var t = DateTools.format(Date.now(), "%r");
|
||||
// 02:44:05 PM
|
||||
|
||||
var t = DateTools.format(Date.now(), "%T");
|
||||
// 14:44:05
|
||||
|
||||
var t = DateTools.format(Date.now(), "%F");
|
||||
// 2016-07-08
|
||||
```
|
||||
**/
|
||||
public static function format( d : Date, f : String ) : String {
|
||||
#if (neko && !(macro || interp))
|
||||
return new String(untyped date_format(d.__t, f.__s));
|
||||
#elseif php
|
||||
return untyped __call__("strftime",f,d.__t);
|
||||
#else
|
||||
return __format(d,f);
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the result of adding timestamp `t` to Date `d`.
|
||||
|
||||
This is a convenience function for calling
|
||||
`Date.fromTime(d.getTime() + t)`.
|
||||
**/
|
||||
public static inline function delta( d : Date, t : Float ) : Date {
|
||||
return Date.fromTime( d.getTime() + t );
|
||||
}
|
||||
|
||||
static var DAYS_OF_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||
|
||||
/**
|
||||
Returns the number of days in the month of Date `d`.
|
||||
|
||||
This method handles leap years.
|
||||
**/
|
||||
public static function getMonthDays( d : Date ) : Int {
|
||||
var month = d.getMonth();
|
||||
var year = d.getFullYear();
|
||||
|
||||
if (month != 1)
|
||||
return DAYS_OF_MONTH[month];
|
||||
|
||||
var isB = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
|
||||
return if (isB) 29 else 28;
|
||||
}
|
||||
|
||||
/**
|
||||
Converts a number of seconds to a timestamp.
|
||||
**/
|
||||
public static inline function seconds( n : Float ) : Float {
|
||||
return n * 1000.0;
|
||||
}
|
||||
|
||||
/**
|
||||
Converts a number of minutes to a timestamp.
|
||||
**/
|
||||
#if as3 @:extern #end public static inline function minutes( n : Float ) : Float {
|
||||
return n * 60.0 * 1000.0;
|
||||
}
|
||||
|
||||
/**
|
||||
Converts a number of hours to a timestamp.
|
||||
**/
|
||||
public static inline function hours( n : Float ) : Float {
|
||||
return n * 60.0 * 60.0 * 1000.0;
|
||||
}
|
||||
|
||||
/**
|
||||
Converts a number of days to a timestamp.
|
||||
**/
|
||||
public static inline function days( n : Float ) : Float {
|
||||
return n * 24.0 * 60.0 * 60.0 * 1000.0;
|
||||
}
|
||||
|
||||
/**
|
||||
Separate a date-time into several components
|
||||
**/
|
||||
public static function parse( t : Float ) {
|
||||
var s = t / 1000;
|
||||
var m = s / 60;
|
||||
var h = m / 60;
|
||||
return {
|
||||
ms : t % 1000,
|
||||
seconds : Std.int(s % 60),
|
||||
minutes : Std.int(m % 60),
|
||||
hours : Std.int(h % 24),
|
||||
days : Std.int(h / 24),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
Build a date-time from several components
|
||||
**/
|
||||
public static function make( o : { ms : Float, seconds : Int, minutes : Int, hours : Int, days : Int } ) {
|
||||
return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 24.0 * o.days)));
|
||||
}
|
||||
|
||||
#if (js || flash || php || cpp || python)
|
||||
/**
|
||||
Retrieve Unix timestamp value from Date components. Takes same argument sequence as the Date constructor.
|
||||
**/
|
||||
public static #if (js || flash || php) inline #end function makeUtc(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int ):Float {
|
||||
#if (js || flash || python)
|
||||
return untyped Date.UTC(year, month, day, hour, min, sec);
|
||||
#elseif php
|
||||
return untyped __call__("gmmktime", hour, min, sec, month + 1, day, year) * 1000;
|
||||
#elseif cpp
|
||||
return untyped __global__.__hxcpp_utc_date(year,month,day,hour,min,sec)*1000.0 ;
|
||||
#else
|
||||
//TODO
|
||||
return 0.;
|
||||
#end
|
||||
}
|
||||
#end
|
||||
}
|
||||
195
hGameTest/node_modules/haxe/downloads/haxe/std/EReg.hx
generated
vendored
Normal file
195
hGameTest/node_modules/haxe/downloads/haxe/std/EReg.hx
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
The EReg class represents regular expressions.
|
||||
|
||||
While basic usage and patterns consistently work across platforms, some more
|
||||
complex operations may yield different results. This is a necessary trade-
|
||||
off to retain a certain level of performance.
|
||||
|
||||
EReg instances can be created by calling the constructor, or with the
|
||||
special syntax `~/pattern/modifier`
|
||||
|
||||
EReg instances maintain an internal state, which is affected by several of
|
||||
its methods.
|
||||
|
||||
A detailed explanation of the supported operations is available at
|
||||
<https://haxe.org/manual/std-regex.html>
|
||||
**/
|
||||
class EReg {
|
||||
|
||||
/**
|
||||
Creates a new regular expression with pattern `r` and modifiers `opt`.
|
||||
|
||||
This is equivalent to the shorthand syntax `~/r/opt`
|
||||
|
||||
If `r` or `opt` are null, the result is unspecified.
|
||||
**/
|
||||
public function new( r : String, opt : String ) {
|
||||
throw "Regular expressions are not implemented for this platform";
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if `this` regular expression matches String `s`.
|
||||
|
||||
This method modifies the internal state.
|
||||
|
||||
If `s` is `null`, the result is unspecified.
|
||||
**/
|
||||
public function match( s : String ) : Bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the matched sub-group `n` of `this` EReg.
|
||||
|
||||
This method should only be called after `this.match` or
|
||||
`this.matchSub`, and then operates on the String of that operation.
|
||||
|
||||
The index `n` corresponds to the n-th set of parentheses in the pattern
|
||||
of `this` EReg. If no such sub-group exists, an exception is thrown.
|
||||
|
||||
If `n` equals 0, the whole matched substring is returned.
|
||||
**/
|
||||
public function matched( n : Int ) : String {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the part to the left of the last matched substring.
|
||||
|
||||
If the most recent call to `this.match` or `this.matchSub` did not
|
||||
match anything, the result is unspecified.
|
||||
|
||||
If the global g modifier was in place for the matching, only the
|
||||
substring to the left of the leftmost match is returned.
|
||||
|
||||
The result does not include the matched part.
|
||||
**/
|
||||
public function matchedLeft() : String {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the part to the right of the last matched substring.
|
||||
|
||||
If the most recent call to `this.match` or `this.matchSub` did not
|
||||
match anything, the result is unspecified.
|
||||
|
||||
If the global g modifier was in place for the matching, only the
|
||||
substring to the right of the leftmost match is returned.
|
||||
|
||||
The result does not include the matched part.
|
||||
**/
|
||||
public function matchedRight() : String {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the position and length of the last matched substring, within
|
||||
the String which was last used as argument to `this.match` or
|
||||
`this.matchSub`.
|
||||
|
||||
If the most recent call to `this.match` or `this.matchSub` did not
|
||||
match anything, the result is unspecified.
|
||||
|
||||
If the global g modifier was in place for the matching, the position and
|
||||
length of the leftmost substring is returned.
|
||||
**/
|
||||
public function matchedPos() : { pos : Int, len : Int } {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if `this` regular expression matches a substring of String `s`.
|
||||
|
||||
This function expects `pos` and `len` to describe a valid substring of
|
||||
`s`, or else the result is unspecified. To get more robust behavior,
|
||||
`this.match(s.substr(pos,len))` can be used instead.
|
||||
|
||||
This method modifies the internal state.
|
||||
|
||||
If `s` is null, the result is unspecified.
|
||||
**/
|
||||
public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Splits String `s` at all substrings `this` EReg matches.
|
||||
|
||||
If a match is found at the start of `s`, the result contains a leading
|
||||
empty String "" entry.
|
||||
|
||||
If a match is found at the end of `s`, the result contains a trailing
|
||||
empty String "" entry.
|
||||
|
||||
If two matching substrings appear next to each other, the result
|
||||
contains the empty String `""` between them.
|
||||
|
||||
By default, this method splits `s` into two parts at the first matched
|
||||
substring. If the global g modifier is in place, `s` is split at each
|
||||
matched substring.
|
||||
|
||||
If `s` is null, the result is unspecified.
|
||||
**/
|
||||
public function split( s : String ) : Array<String> {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Replaces the first substring of `s` which `this` EReg matches with `by`.
|
||||
|
||||
If `this` EReg does not match any substring, the result is `s`.
|
||||
|
||||
By default, this method replaces only the first matched substring. If
|
||||
the global g modifier is in place, all matched substrings are replaced.
|
||||
|
||||
If `by` contains `$1` to `$9`, the digit corresponds to number of a
|
||||
matched sub-group and its value is used instead. If no such sub-group
|
||||
exists, the replacement is unspecified. The string `$$` becomes `$`.
|
||||
|
||||
If `s` or `by` are null, the result is unspecified.
|
||||
**/
|
||||
public function replace( s : String, by : String ) : String {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Calls the function `f` for the substring of `s` which `this` EReg matches
|
||||
and replaces that substring with the result of `f` call.
|
||||
|
||||
The `f` function takes `this` EReg object as its first argument and should
|
||||
return a replacement string for the substring matched.
|
||||
|
||||
If `this` EReg does not match any substring, the result is `s`.
|
||||
|
||||
By default, this method replaces only the first matched substring. If
|
||||
the global g modifier is in place, all matched substrings are replaced.
|
||||
|
||||
If `s` or `f` are null, the result is unspecified.
|
||||
**/
|
||||
public function map( s : String, f : EReg -> String ) : String {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
33
hGameTest/node_modules/haxe/downloads/haxe/std/Enum.hx
generated
vendored
Normal file
33
hGameTest/node_modules/haxe/downloads/haxe/std/Enum.hx
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
An abstract type that represents an Enum type.
|
||||
|
||||
The corresponding enum instance type is `EnumValue`.
|
||||
|
||||
See `Type` for the Haxe Reflection API.
|
||||
|
||||
@see https://haxe.org/manual/types-enum-instance.html
|
||||
**/
|
||||
@:coreType @:runtimeValue abstract Enum<T> {
|
||||
}
|
||||
30
hGameTest/node_modules/haxe/downloads/haxe/std/EnumValue.hx
generated
vendored
Normal file
30
hGameTest/node_modules/haxe/downloads/haxe/std/EnumValue.hx
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
An abstract type that represents any enum value.
|
||||
See `Type` for the Haxe Reflection API.
|
||||
|
||||
@see https://haxe.org/manual/types-enum-instance.html
|
||||
**/
|
||||
@:coreType abstract EnumValue {
|
||||
}
|
||||
67
hGameTest/node_modules/haxe/downloads/haxe/std/IntIterator.hx
generated
vendored
Normal file
67
hGameTest/node_modules/haxe/downloads/haxe/std/IntIterator.hx
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
IntIterator is used for implementing interval iterations.
|
||||
|
||||
It is usually not used explicitly, but through its special syntax:
|
||||
`min...max`
|
||||
|
||||
While it is possible to assign an instance of IntIterator to a variable or
|
||||
field, it is worth noting that IntIterator does not reset after being used
|
||||
in a for-loop. Subsequent uses of the same instance will then have no
|
||||
effect.
|
||||
|
||||
@see https://haxe.org/manual/lf-iterators.html
|
||||
**/
|
||||
class IntIterator {
|
||||
|
||||
var min : Int;
|
||||
var max : Int;
|
||||
|
||||
/**
|
||||
Iterates from `min` (inclusive) to `max` (exclusive).
|
||||
|
||||
If `max <= min`, the iterator will not act as a countdown.
|
||||
**/
|
||||
public inline function new( min : Int, max : Int ) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns true if the iterator has other items, false otherwise.
|
||||
**/
|
||||
public inline function hasNext() {
|
||||
return min < max;
|
||||
}
|
||||
|
||||
/**
|
||||
Moves to the next item of the iterator.
|
||||
|
||||
If this is called while hasNext() is false, the result is unspecified.
|
||||
**/
|
||||
public inline function next() {
|
||||
return min++;
|
||||
}
|
||||
|
||||
}
|
||||
285
hGameTest/node_modules/haxe/downloads/haxe/std/Lambda.hx
generated
vendored
Normal file
285
hGameTest/node_modules/haxe/downloads/haxe/std/Lambda.hx
generated
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
The `Lambda` class is a collection of methods to support functional
|
||||
programming. It is ideally used with `using Lambda` and then acts as an
|
||||
extension to Iterable types.
|
||||
|
||||
On static platforms, working with the Iterable structure might be slower
|
||||
than performing the operations directly on known types, such as Array and
|
||||
List.
|
||||
|
||||
If the first argument to any of the methods is null, the result is
|
||||
unspecified.
|
||||
|
||||
@see https://haxe.org/manual/std-Lambda.html
|
||||
**/
|
||||
class Lambda {
|
||||
|
||||
/**
|
||||
Creates an Array from Iterable `it`.
|
||||
|
||||
If `it` is an Array, this function returns a copy of it.
|
||||
**/
|
||||
public static function array<A>( it : Iterable<A> ) : Array<A> {
|
||||
var a = new Array<A>();
|
||||
for(i in it)
|
||||
a.push(i);
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a List form Iterable `it`.
|
||||
|
||||
If `it` is a List, this function returns a copy of it.
|
||||
**/
|
||||
public static function list<A>( it : Iterable<A> ) : List<A> {
|
||||
var l = new List<A>();
|
||||
for(i in it)
|
||||
l.add(i);
|
||||
return l;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a new List by applying function `f` to all elements of `it`.
|
||||
|
||||
The order of elements is preserved.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function map<A,B>( it : Iterable<A>, f : A -> B ) : List<B> {
|
||||
var l = new List<B>();
|
||||
for( x in it )
|
||||
l.add(f(x));
|
||||
return l;
|
||||
}
|
||||
|
||||
/**
|
||||
Similar to map, but also passes the index of each element to `f`.
|
||||
|
||||
The order of elements is preserved.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function mapi<A,B>( it : Iterable<A>, f : Int -> A -> B ) : List<B> {
|
||||
var l = new List<B>();
|
||||
var i = 0;
|
||||
for( x in it )
|
||||
l.add(f(i++,x));
|
||||
return l;
|
||||
}
|
||||
|
||||
/**
|
||||
Concatenate a list of lists.
|
||||
|
||||
The order of elements is preserved.
|
||||
**/
|
||||
public static function flatten<A>( it : Iterable<Iterable<A>> ) : List<A> {
|
||||
var l = new List<A>();
|
||||
for (e in it)
|
||||
for (x in e)
|
||||
l.add(x);
|
||||
return l;
|
||||
}
|
||||
|
||||
/**
|
||||
A composition of map and flatten.
|
||||
|
||||
The order of elements is preserved.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function flatMap<A,B>( it : Iterable<A>, f: A -> Iterable<B> ) : List<B> {
|
||||
return Lambda.flatten(Lambda.map(it, f));
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if `it` contains `elt`.
|
||||
|
||||
This function returns true as soon as an element is found which is equal
|
||||
to `elt` according to the `==` operator.
|
||||
|
||||
If no such element is found, the result is false.
|
||||
**/
|
||||
public static function has<A>( it : Iterable<A>, elt : A ) : Bool {
|
||||
for( x in it )
|
||||
if( x == elt )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if `it` contains an element for which `f` is true.
|
||||
|
||||
This function returns true as soon as an element is found for which a
|
||||
call to `f` returns true.
|
||||
|
||||
If no such element is found, the result is false.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function exists<A>( it : Iterable<A>, f : A -> Bool ) {
|
||||
for( x in it )
|
||||
if( f(x) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if `f` is true for all elements of `it`.
|
||||
|
||||
This function returns false as soon as an element is found for which a
|
||||
call to `f` returns false.
|
||||
|
||||
If no such element is found, the result is true.
|
||||
|
||||
In particular, this function always returns true if `it` is empty.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function foreach<A>( it : Iterable<A>, f : A -> Bool ) {
|
||||
for( x in it )
|
||||
if( !f(x) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
Calls `f` on all elements of `it`, in order.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function iter<A>( it : Iterable<A>, f : A -> Void ) {
|
||||
for( x in it )
|
||||
f(x);
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a List containing those elements of `it` for which `f` returned
|
||||
true.
|
||||
|
||||
If `it` is empty, the result is the empty List even if `f` is null.
|
||||
|
||||
Otherwise if `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function filter<A>( it : Iterable<A>, f : A -> Bool ) {
|
||||
var l = new List<A>();
|
||||
for( x in it )
|
||||
if( f(x) )
|
||||
l.add(x);
|
||||
return l;
|
||||
}
|
||||
|
||||
/**
|
||||
Functional fold on Iterable `it`, using function `f` with start argument
|
||||
`first`.
|
||||
|
||||
If `it` has no elements, the result is `first`.
|
||||
|
||||
Otherwise the first element of `it` is passed to `f` alongside `first`.
|
||||
The result of that call is then passed to `f` with the next element of
|
||||
`it`, and so on until `it` has no more elements.
|
||||
|
||||
If `it` or `f` are null, the result is unspecified.
|
||||
**/
|
||||
public static function fold<A,B>( it : Iterable<A>, f : A -> B -> B, first : B ) : B {
|
||||
for( x in it )
|
||||
first = f(x,first);
|
||||
return first;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the number of elements in `it` for which `pred` is true, or the
|
||||
total number of elements in `it` if `pred` is null.
|
||||
|
||||
This function traverses all elements.
|
||||
**/
|
||||
public static function count<A>( it : Iterable<A>, ?pred : A -> Bool ) {
|
||||
var n = 0;
|
||||
if( pred == null )
|
||||
for( _ in it )
|
||||
n++;
|
||||
else
|
||||
for( x in it )
|
||||
if( pred(x) )
|
||||
n++;
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if Iterable `it` does not contain any element.
|
||||
**/
|
||||
public static function empty<T>( it : Iterable<T> ) : Bool {
|
||||
return !it.iterator().hasNext();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the index of the first element `v` within Iterable `it`.
|
||||
|
||||
This function uses operator `==` to check for equality.
|
||||
|
||||
If `v` does not exist in `it`, the result is -1.
|
||||
**/
|
||||
public static function indexOf<T>( it : Iterable<T>, v : T ) : Int {
|
||||
var i = 0;
|
||||
for( v2 in it ) {
|
||||
if( v == v2 )
|
||||
return i;
|
||||
i++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the first element of `it` for which `f` is true.
|
||||
|
||||
This function returns as soon as an element is found for which a call to
|
||||
`f` returns true.
|
||||
|
||||
If no such element is found, the result is null.
|
||||
|
||||
If `f` is null, the result is unspecified.
|
||||
**/
|
||||
public static function find<T>( it : Iterable<T>, f : T -> Bool ) : Null<T> {
|
||||
for( v in it ) {
|
||||
if(f(v)) return v;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a new List containing all elements of Iterable `a` followed by
|
||||
all elements of Iterable `b`.
|
||||
|
||||
If `a` or `b` are null, the result is unspecified.
|
||||
**/
|
||||
public static function concat<T>( a : Iterable<T>, b : Iterable<T> ) : List<T> {
|
||||
var l = new List();
|
||||
for( x in a )
|
||||
l.add(x);
|
||||
for( x in b )
|
||||
l.add(x);
|
||||
return l;
|
||||
}
|
||||
|
||||
}
|
||||
281
hGameTest/node_modules/haxe/downloads/haxe/std/List.hx
generated
vendored
Normal file
281
hGameTest/node_modules/haxe/downloads/haxe/std/List.hx
generated
vendored
Normal file
@@ -0,0 +1,281 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
A linked-list of elements. The list is composed of element container objects
|
||||
that are chained together. It is optimized so that adding or removing an
|
||||
element does not imply copying the whole list content every time.
|
||||
|
||||
@see https://haxe.org/manual/std-List.html
|
||||
**/
|
||||
class List<T> {
|
||||
|
||||
private var h : ListNode<T>;
|
||||
private var q : ListNode<T>;
|
||||
|
||||
/**
|
||||
The length of `this` List.
|
||||
**/
|
||||
public var length(default,null) : Int;
|
||||
|
||||
/**
|
||||
Creates a new empty list.
|
||||
**/
|
||||
public function new() {
|
||||
length = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Adds element `item` at the end of `this` List.
|
||||
|
||||
`this.length` increases by 1.
|
||||
**/
|
||||
public function add( item : T ) {
|
||||
var x = ListNode.create(item, null);
|
||||
if( h == null )
|
||||
h = x;
|
||||
else
|
||||
q.next = x;
|
||||
q = x;
|
||||
length++;
|
||||
}
|
||||
|
||||
/**
|
||||
Adds element `item` at the beginning of `this` List.
|
||||
|
||||
`this.length` increases by 1.
|
||||
**/
|
||||
public function push( item : T ) {
|
||||
var x = ListNode.create(item, h);
|
||||
h = x;
|
||||
if( q == null )
|
||||
q = x;
|
||||
length++;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the first element of `this` List, or null if no elements exist.
|
||||
|
||||
This function does not modify `this` List.
|
||||
**/
|
||||
public function first() : Null<T> {
|
||||
return if( h == null ) null else h.item;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the last element of `this` List, or null if no elements exist.
|
||||
|
||||
This function does not modify `this` List.
|
||||
**/
|
||||
public function last() : Null<T> {
|
||||
return if( q == null ) null else q.item;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Returns the first element of `this` List, or null if no elements exist.
|
||||
|
||||
The element is removed from `this` List.
|
||||
**/
|
||||
public function pop() : Null<T> {
|
||||
if( h == null )
|
||||
return null;
|
||||
var x = h.item;
|
||||
h = h.next;
|
||||
if( h == null )
|
||||
q = null;
|
||||
length--;
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if `this` List is empty.
|
||||
**/
|
||||
public function isEmpty() : Bool {
|
||||
return (h == null);
|
||||
}
|
||||
|
||||
/**
|
||||
Empties `this` List.
|
||||
|
||||
This function does not traverse the elements, but simply sets the
|
||||
internal references to null and `this.length` to 0.
|
||||
**/
|
||||
public function clear() : Void {
|
||||
h = null;
|
||||
q = null;
|
||||
length = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Removes the first occurrence of `v` in `this` List.
|
||||
|
||||
If `v` is found by checking standard equality, it is removed from `this`
|
||||
List and the function returns true.
|
||||
|
||||
Otherwise, false is returned.
|
||||
**/
|
||||
public function remove( v : T ) : Bool {
|
||||
var prev:ListNode<T> = null;
|
||||
var l = h;
|
||||
while( l != null ) {
|
||||
if( l.item == v ) {
|
||||
if( prev == null )
|
||||
h = l.next;
|
||||
else
|
||||
prev.next = l.next;
|
||||
if( q == l )
|
||||
q = prev;
|
||||
length--;
|
||||
return true;
|
||||
}
|
||||
prev = l;
|
||||
l = l.next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an iterator on the elements of the list.
|
||||
**/
|
||||
public inline function iterator() : ListIterator<T> {
|
||||
return new ListIterator<T>(h);
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a string representation of `this` List.
|
||||
|
||||
The result is enclosed in { } with the individual elements being
|
||||
separated by a comma.
|
||||
**/
|
||||
public function toString() {
|
||||
var s = new StringBuf();
|
||||
var first = true;
|
||||
var l = h;
|
||||
s.add("{");
|
||||
while( l != null ) {
|
||||
if( first )
|
||||
first = false;
|
||||
else
|
||||
s.add(", ");
|
||||
s.add(Std.string(l.item));
|
||||
l = l.next;
|
||||
}
|
||||
s.add("}");
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a string representation of `this` List, with `sep` separating
|
||||
each element.
|
||||
**/
|
||||
public function join(sep : String) {
|
||||
var s = new StringBuf();
|
||||
var first = true;
|
||||
var l = h;
|
||||
while( l != null ) {
|
||||
if( first )
|
||||
first = false;
|
||||
else
|
||||
s.add(sep);
|
||||
s.add(l.item);
|
||||
l = l.next;
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a list filtered with `f`. The returned list will contain all
|
||||
elements for which `f(x) == true`.
|
||||
**/
|
||||
public function filter( f : T -> Bool ) {
|
||||
var l2 = new List();
|
||||
var l = h;
|
||||
while( l != null ) {
|
||||
var v = l.item;
|
||||
l = l.next;
|
||||
if( f(v) )
|
||||
l2.add(v);
|
||||
}
|
||||
return l2;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a new list where all elements have been converted by the
|
||||
function `f`.
|
||||
**/
|
||||
public function map<X>(f : T -> X) : List<X> {
|
||||
var b = new List();
|
||||
var l = h;
|
||||
while( l != null ) {
|
||||
var v = l.item;
|
||||
l = l.next;
|
||||
b.add(f(v));
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if neko
|
||||
private extern class ListNode<T> extends neko.NativeArray<Dynamic> {
|
||||
var item(get,set):T;
|
||||
var next(get,set):ListNode<T>;
|
||||
private inline function get_item():T return this[0];
|
||||
private inline function set_item(v:T):T return this[0] = v;
|
||||
private inline function get_next():ListNode<T> return this[1];
|
||||
private inline function set_next(v:ListNode<T>):ListNode<T> return this[1] = v;
|
||||
inline static function create<T>(item:T, next:ListNode<T>):ListNode<T> {
|
||||
return untyped __dollar__array(item, next);
|
||||
}
|
||||
}
|
||||
#else
|
||||
private class ListNode<T> {
|
||||
public var item:T;
|
||||
public var next:ListNode<T>;
|
||||
public function new(item:T, next:ListNode<T>) {
|
||||
this.item = item;
|
||||
this.next = next;
|
||||
}
|
||||
@:extern public inline static function create<T>(item:T, next:ListNode<T>):ListNode<T> {
|
||||
return new ListNode(item, next);
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
private class ListIterator<T> {
|
||||
var head:ListNode<T>;
|
||||
|
||||
public inline function new(head:ListNode<T>) {
|
||||
this.head = head;
|
||||
}
|
||||
|
||||
public inline function hasNext():Bool {
|
||||
return head != null;
|
||||
}
|
||||
|
||||
public inline function next():T {
|
||||
var val = head.item;
|
||||
head = head.next;
|
||||
return val;
|
||||
}
|
||||
}
|
||||
170
hGameTest/node_modules/haxe/downloads/haxe/std/Map.hx
generated
vendored
Normal file
170
hGameTest/node_modules/haxe/downloads/haxe/std/Map.hx
generated
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import haxe.ds.StringMap;
|
||||
import haxe.ds.IntMap;
|
||||
import haxe.ds.HashMap;
|
||||
import haxe.ds.ObjectMap;
|
||||
import haxe.ds.WeakMap;
|
||||
import haxe.ds.EnumValueMap;
|
||||
import haxe.Constraints.IMap;
|
||||
|
||||
/**
|
||||
Map allows key to value mapping for arbitrary value types, and many key
|
||||
types.
|
||||
|
||||
This is a multi-type abstract, it is instantiated as one of its
|
||||
specialization types depending on its type parameters.
|
||||
|
||||
A Map can be instantiated without explicit type parameters. Type inference
|
||||
will then determine the type parameters from the usage.
|
||||
|
||||
Maps can also be created with `key1 => value1, key2 => value2` syntax.
|
||||
|
||||
Map is an abstract type, it is not available at runtime.
|
||||
|
||||
@see https://haxe.org/manual/std-Map.html
|
||||
**/
|
||||
@:multiType(@:followWithAbstracts K)
|
||||
abstract Map<K,V>(IMap<K,V> ) {
|
||||
|
||||
/**
|
||||
Creates a new Map.
|
||||
|
||||
This becomes a constructor call to one of the specialization types in
|
||||
the output. The rules for that are as follows:
|
||||
|
||||
1. if K is a `String`, `haxe.ds.StringMap` is used
|
||||
2. if K is an `Int`, `haxe.ds.IntMap` is used
|
||||
3. if K is an `EnumValue`, `haxe.ds.EnumValueMap` is used
|
||||
4. if K is any other class or structure, `haxe.ds.ObjectMap` is used
|
||||
5. if K is any other type, it causes a compile-time error
|
||||
|
||||
(Cpp) Map does not use weak keys on ObjectMap by default.
|
||||
**/
|
||||
public function new();
|
||||
|
||||
/**
|
||||
Maps `key` to `value`.
|
||||
|
||||
If `key` already has a mapping, the previous value disappears.
|
||||
|
||||
If `key` is null, the result is unspecified.
|
||||
**/
|
||||
public inline function set(key:K, value:V) this.set(key, value);
|
||||
|
||||
/**
|
||||
Returns the current mapping of `key`.
|
||||
|
||||
If no such mapping exists, null is returned.
|
||||
|
||||
Note that a check like `map.get(key) == null` can hold for two reasons:
|
||||
|
||||
1. the map has no mapping for `key`
|
||||
2. the map has a mapping with a value of `null`
|
||||
|
||||
If it is important to distinguish these cases, `exists()` should be
|
||||
used.
|
||||
|
||||
If `key` is null, the result is unspecified.
|
||||
**/
|
||||
@:arrayAccess public inline function get(key:K) return this.get(key);
|
||||
|
||||
/**
|
||||
Returns true if `key` has a mapping, false otherwise.
|
||||
|
||||
If `key` is null, the result is unspecified.
|
||||
**/
|
||||
public inline function exists(key:K) return this.exists(key);
|
||||
|
||||
/**
|
||||
Removes the mapping of `key` and returns true if such a mapping existed,
|
||||
false otherwise.
|
||||
|
||||
If `key` is null, the result is unspecified.
|
||||
**/
|
||||
public inline function remove(key:K) return this.remove(key);
|
||||
|
||||
/**
|
||||
Returns an Iterator over the keys of `this` Map.
|
||||
|
||||
The order of keys is undefined.
|
||||
**/
|
||||
public inline function keys():Iterator<K> {
|
||||
return this.keys();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an Iterator over the values of `this` Map.
|
||||
|
||||
The order of values is undefined.
|
||||
**/
|
||||
public inline function iterator():Iterator<V> {
|
||||
return this.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a String representation of `this` Map.
|
||||
|
||||
The exact representation depends on the platform and key-type.
|
||||
**/
|
||||
public inline function toString():String {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
@:arrayAccess @:noCompletion public inline function arrayWrite(k:K, v:V):V {
|
||||
this.set(k, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
@:to static inline function toStringMap<K:String,V>(t:IMap<K,V>):StringMap<V> {
|
||||
return new StringMap<V>();
|
||||
}
|
||||
|
||||
@:to static inline function toIntMap<K:Int,V>(t:IMap<K,V>):IntMap<V> {
|
||||
return new IntMap<V>();
|
||||
}
|
||||
|
||||
@:to static inline function toEnumValueMapMap<K:EnumValue,V>(t:IMap<K,V>):EnumValueMap<K,V> {
|
||||
return new EnumValueMap<K, V>();
|
||||
}
|
||||
|
||||
@:to static inline function toObjectMap<K:{ },V>(t:IMap<K,V>):ObjectMap<K,V> {
|
||||
return new ObjectMap<K, V>();
|
||||
}
|
||||
|
||||
@:from static inline function fromStringMap<V>(map:StringMap<V>):Map< String, V > {
|
||||
return cast map;
|
||||
}
|
||||
|
||||
@:from static inline function fromIntMap<V>(map:IntMap<V>):Map< Int, V > {
|
||||
return cast map;
|
||||
}
|
||||
|
||||
@:from static inline function fromObjectMap<K:{ }, V>(map:ObjectMap<K,V>):Map<K,V> {
|
||||
return cast map;
|
||||
}
|
||||
}
|
||||
|
||||
@:dox(hide)
|
||||
@:deprecated
|
||||
typedef IMap<K, V> = haxe.Constraints.IMap<K, V>;
|
||||
328
hGameTest/node_modules/haxe/downloads/haxe/std/Math.hx
generated
vendored
Normal file
328
hGameTest/node_modules/haxe/downloads/haxe/std/Math.hx
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
This class defines mathematical functions and constants.
|
||||
|
||||
@see https://haxe.org/manual/std-math.html
|
||||
**/
|
||||
#if cpp @:include("hxMath.h") #end
|
||||
@:pure
|
||||
extern class Math
|
||||
{
|
||||
/**
|
||||
Represents the ratio of the circumference of a circle to its diameter,
|
||||
specified by the constant, π. `PI` is approximately 3.141592653589793.
|
||||
**/
|
||||
static var PI(default,null) : Float;
|
||||
|
||||
/**
|
||||
A special `Float` constant which denotes negative infinity.
|
||||
|
||||
For example, this is the result of -1.0 / 0.0.
|
||||
|
||||
Operations with `NEGATIVE_INFINITY` as an operand may result in
|
||||
`NEGATIVE_INFINITY`, `POSITIVE_INFINITY` or `NaN`.
|
||||
|
||||
If this constant is converted to an `Int`, e.g. through `Std.int()`, the
|
||||
result is unspecified.
|
||||
**/
|
||||
static var NEGATIVE_INFINITY(default, null) : Float;
|
||||
|
||||
/**
|
||||
A special `Float` constant which denotes positive infinity.
|
||||
|
||||
For example, this is the result of 1.0 / 0.0.
|
||||
|
||||
Operations with `POSITIVE_INFINITY` as an operand may result in
|
||||
`NEGATIVE_INFINITY`, `POSITIVE_INFINITY` or `NaN`.
|
||||
|
||||
If this constant is converted to an `Int`, e.g. through `Std.int()`, the
|
||||
result is unspecified.
|
||||
**/
|
||||
static var POSITIVE_INFINITY(default,null) : Float;
|
||||
|
||||
/**
|
||||
A special `Float` constant which denotes an invalid number.
|
||||
|
||||
NaN stands for "Not a Number". It occurs when a mathematically incorrect
|
||||
operation is executed, such as taking the square root of a negative
|
||||
number: Math.sqrt(-1).
|
||||
|
||||
All further operations with `NaN` as an operand will result in `NaN`.
|
||||
|
||||
If this constant is converted to an `Int`, e.g. through `Std.int()`, the
|
||||
result is unspecified.
|
||||
|
||||
In order to test if a value is `NaN`, you should use `Math.isNaN()` function.
|
||||
|
||||
@php In PHP versions prior to 5.3.1 VC 9 there may be unexpected
|
||||
results when performing arithmetic operations with `NaN` on Windows,
|
||||
see <https://bugs.php.net/bug.php?id=42143>
|
||||
**/
|
||||
static var NaN(default, null) : Float;
|
||||
|
||||
/**
|
||||
Returns the absolute value of `v`.
|
||||
|
||||
If `v` is positive or 0, the result is unchanged. Otherwise the result
|
||||
is -`v`.
|
||||
|
||||
If `v` is `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, the result is
|
||||
`POSITIVE_INFINITY`.
|
||||
|
||||
If `v` is `NaN`, the result is `NaN`.
|
||||
**/
|
||||
static function abs(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the smaller of values `a` and `b`.
|
||||
|
||||
If `a` or `b` are `NaN`, the result is `NaN`.
|
||||
If `a` or `b` are `NEGATIVE_INFINITY`, the result is `NEGATIVE_INFINITY`.
|
||||
If `a` and `b` are `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
|
||||
**/
|
||||
static function min(a:Float, b:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the greater of values `a` and `b`.
|
||||
|
||||
If `a` or `b` are `NaN`, the result is `NaN`.
|
||||
If `a` or `b` are `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
|
||||
If `a` and `b` are `NEGATIVE_INFINITY`, the result is `NEGATIVE_INFINITY`.
|
||||
**/
|
||||
static function max(a:Float, b:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric sine of the specified angle `v`, in radians.
|
||||
|
||||
If `v` is `NaN` or infinite, the result is `NaN`.
|
||||
**/
|
||||
static function sin(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric cosine of the specified angle `v`, in radians.
|
||||
|
||||
If `v` is `NaN` or infinite, the result is `NaN`.
|
||||
**/
|
||||
static function cos(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric tangent of the specified angle `v`, in radians.
|
||||
|
||||
If `v` is `NaN` or infinite, the result is `NaN`.
|
||||
**/
|
||||
static function tan(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric arc of the specified angle `v`, in radians.
|
||||
|
||||
If `v` is `NaN` or infinite, the result is `NaN`.
|
||||
**/
|
||||
static function asin(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric arc cosine of the specified angle `v`,
|
||||
in radians.
|
||||
|
||||
If `v` is `NaN` or infinite, the result is `NaN`.
|
||||
**/
|
||||
static function acos(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric arc tangent of the specified angle `v`,
|
||||
in radians.
|
||||
|
||||
If `v` is `NaN` or infinite, the result is `NaN`.
|
||||
**/
|
||||
static function atan(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the trigonometric arc tangent whose tangent is the quotient of
|
||||
two specified numbers, in radians.
|
||||
|
||||
If parameter `x` or `y` is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`,
|
||||
the result is `NaN`.
|
||||
**/
|
||||
static function atan2(y:Float, x:Float):Float;
|
||||
|
||||
/**
|
||||
Returns Euler's number, raised to the power of `v`.
|
||||
|
||||
exp(1.0) is approximately 2.718281828459.
|
||||
|
||||
If `v` is `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
|
||||
If `v` is `NEGATIVE_INFINITY`, the result is `0.0`.
|
||||
If `v` is `NaN`, the result is `NaN`.
|
||||
**/
|
||||
static function exp(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the natural logarithm of `v`.
|
||||
|
||||
This is the mathematical inverse operation of exp,
|
||||
i.e. `log(exp(v)) == v` always holds.
|
||||
|
||||
If `v` is negative (including `NEGATIVE_INFINITY`) or `NaN`, the result
|
||||
is `NaN`.
|
||||
If `v` is `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
|
||||
If `v` is `0.0`, the result is `NEGATIVE_INFINITY`.
|
||||
**/
|
||||
static function log(v:Float):Float;
|
||||
|
||||
/**
|
||||
Returns a specified base `v` raised to the specified power `exp`.
|
||||
**/
|
||||
static function pow(v:Float, exp:Float):Float;
|
||||
|
||||
/**
|
||||
Returns the square root of `v`.
|
||||
|
||||
If `v` is negative (including `NEGATIVE_INFINITY`) or `NaN`, the result
|
||||
is `NaN`.
|
||||
If `v` is `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`.
|
||||
If `v` is `0.0`, the result is `0.0`.
|
||||
**/
|
||||
static function sqrt(v:Float):Float;
|
||||
|
||||
/**
|
||||
Rounds `v` to the nearest integer value.
|
||||
|
||||
Ties are rounded up, so that `0.5` becomes `1` and `-0.5` becomes `0`.
|
||||
|
||||
If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY`
|
||||
or `POSITIVE_INFINITY`, the result is unspecified.
|
||||
**/
|
||||
static function round(v:Float):Int;
|
||||
|
||||
/**
|
||||
Returns the largest integer value that is not greater than `v`.
|
||||
|
||||
If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY`
|
||||
or `POSITIVE_INFINITY`, the result is unspecified.
|
||||
**/
|
||||
static function floor(v:Float):Int;
|
||||
|
||||
/**
|
||||
Returns the smallest integer value that is not less than `v`.
|
||||
|
||||
If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY`
|
||||
or `POSITIVE_INFINITY`, the result is unspecified.
|
||||
**/
|
||||
static function ceil(v:Float):Int;
|
||||
|
||||
/**
|
||||
Returns a pseudo-random number which is greater than or equal to 0.0,
|
||||
and less than 1.0.
|
||||
**/
|
||||
static function random() : Float;
|
||||
|
||||
#if ((flash && !as3) || cpp)
|
||||
/**
|
||||
Returns the largest integer value that is not greater than `v`, as a `Float`.
|
||||
|
||||
If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`,
|
||||
the result is unspecified.
|
||||
**/
|
||||
static function ffloor( v : Float ) : Float;
|
||||
|
||||
/**
|
||||
Returns the smallest integer value that is not less than `v`, as a `Float`.
|
||||
|
||||
If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`,
|
||||
the result is unspecified.
|
||||
**/
|
||||
static function fceil( v : Float ) : Float;
|
||||
|
||||
/**
|
||||
Rounds `v` to the nearest integer value, as a Float.
|
||||
|
||||
Ties are rounded up, so that `0.5` becomes `1` and `-0.5` becomes `0`.
|
||||
|
||||
If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`,
|
||||
the result is unspecified.
|
||||
**/
|
||||
static function fround( v : Float ) : Float;
|
||||
|
||||
#else
|
||||
|
||||
static inline function ffloor( v : Float ) : Float {
|
||||
return floor(v);
|
||||
}
|
||||
|
||||
static inline function fceil( v : Float ) : Float {
|
||||
return ceil(v);
|
||||
}
|
||||
|
||||
static inline function fround( v : Float ) : Float {
|
||||
return round(v);
|
||||
}
|
||||
|
||||
#end
|
||||
|
||||
|
||||
/**
|
||||
Tells if `f` is a finite number.
|
||||
|
||||
If `f` is `POSITIVE_INFINITY`, `NEGATIVE_INFINITY` or `NaN`, the result
|
||||
is `false`, otherwise the result is `true`.
|
||||
**/
|
||||
static function isFinite( f : Float ) : Bool;
|
||||
|
||||
/**
|
||||
Tells if `f` is not a valid number.
|
||||
|
||||
If `f` is `NaN`, the result is `true`, otherwise the result is `false`.
|
||||
In particular, both `POSITIVE_INFINITY` and `NEGATIVE_INFINITY` are
|
||||
not considered `NaN`.
|
||||
**/
|
||||
static function isNaN( f : Float ) : Bool;
|
||||
|
||||
private static function __init__() : Void untyped {
|
||||
#if flash
|
||||
NaN = __global__["Number"].NaN;
|
||||
NEGATIVE_INFINITY = __global__["Number"].NEGATIVE_INFINITY;
|
||||
POSITIVE_INFINITY = __global__["Number"].POSITIVE_INFINITY;
|
||||
#else
|
||||
Math.__name__ = ["Math"];
|
||||
Math.NaN = Number["NaN"];
|
||||
Math.NEGATIVE_INFINITY = Number["NEGATIVE_INFINITY"];
|
||||
Math.POSITIVE_INFINITY = Number["POSITIVE_INFINITY"];
|
||||
#end
|
||||
Math.isFinite = function(i) {
|
||||
return
|
||||
#if flash
|
||||
__global__["isFinite"](i);
|
||||
#else
|
||||
false;
|
||||
#end
|
||||
};
|
||||
Math.isNaN = function(i) {
|
||||
return
|
||||
#if flash
|
||||
__global__["isNaN"](i);
|
||||
#else
|
||||
false;
|
||||
#end
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
195
hGameTest/node_modules/haxe/downloads/haxe/std/Reflect.hx
generated
vendored
Normal file
195
hGameTest/node_modules/haxe/downloads/haxe/std/Reflect.hx
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
The Reflect API is a way to manipulate values dynamically through an
|
||||
abstract interface in an untyped manner. Use with care.
|
||||
|
||||
@see https://haxe.org/manual/std-reflection.html
|
||||
**/
|
||||
extern class Reflect {
|
||||
|
||||
/**
|
||||
Tells if structure `o` has a field named `field`.
|
||||
|
||||
This is only guaranteed to work for anonymous structures. Refer to
|
||||
`Type.getInstanceFields` for a function supporting class instances.
|
||||
|
||||
If `o` or `field` are null, the result is unspecified.
|
||||
**/
|
||||
public static function hasField( o : Dynamic, field : String ) : Bool;
|
||||
|
||||
/**
|
||||
Returns the value of the field named `field` on object `o`.
|
||||
|
||||
If `o` is not an object or has no field named `field`, the result is
|
||||
null.
|
||||
|
||||
If the field is defined as a property, its accessors are ignored. Refer
|
||||
to `Reflect.getProperty` for a function supporting property accessors.
|
||||
|
||||
If `field` is null, the result is unspecified.
|
||||
|
||||
(As3) If used on a property field, the getter will be invoked. It is
|
||||
not possible to obtain the value directly.
|
||||
**/
|
||||
public static function field( o : Dynamic, field : String ) : Dynamic;
|
||||
|
||||
/**
|
||||
Sets the field named `field` of object `o` to value `value`.
|
||||
|
||||
If `o` has no field named `field`, this function is only guaranteed to
|
||||
work for anonymous structures.
|
||||
|
||||
If `o` or `field` are null, the result is unspecified.
|
||||
|
||||
(As3) If used on a property field, the setter will be invoked. It is
|
||||
not possible to set the value directly.
|
||||
**/
|
||||
public static function setField( o : Dynamic, field : String, value : Dynamic ) : Void;
|
||||
|
||||
/**
|
||||
Returns the value of the field named `field` on object `o`, taking
|
||||
property getter functions into account.
|
||||
|
||||
If the field is not a property, this function behaves like
|
||||
`Reflect.field`, but might be slower.
|
||||
|
||||
If `o` or `field` are null, the result is unspecified.
|
||||
**/
|
||||
public static function getProperty( o : Dynamic, field : String ) : Dynamic;
|
||||
|
||||
/**
|
||||
Sets the field named `field` of object `o` to value `value`, taking
|
||||
property setter functions into account.
|
||||
|
||||
If the field is not a property, this function behaves like
|
||||
`Reflect.setField`, but might be slower.
|
||||
|
||||
If `field` is null, the result is unspecified.
|
||||
**/
|
||||
public static function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void;
|
||||
|
||||
/**
|
||||
Call a method with the given object and arguments.
|
||||
**/
|
||||
public static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array<Dynamic> ) : Dynamic;
|
||||
|
||||
/**
|
||||
Returns the fields of structure `o`.
|
||||
|
||||
This method is only guaranteed to work on anonymous structures. Refer to
|
||||
`Type.getInstanceFields` for a function supporting class instances.
|
||||
|
||||
If `o` is null, the result is unspecified.
|
||||
**/
|
||||
public static function fields( o : Dynamic ) : Array<String>;
|
||||
|
||||
/**
|
||||
Returns true if `f` is a function, false otherwise.
|
||||
|
||||
If `f` is null, the result is false.
|
||||
**/
|
||||
public static function isFunction( f : Dynamic ) : Bool;
|
||||
|
||||
/**
|
||||
Compares `a` and `b`.
|
||||
|
||||
If `a` is less than `b`, the result is negative. If `b` is less than
|
||||
`a`, the result is positive. If `a` and `b` are equal, the result is 0.
|
||||
|
||||
This function is only defined if `a` and `b` are of the same type.
|
||||
|
||||
If that type is a function, the result is unspecified and
|
||||
`Reflect.compareMethods` should be used instead.
|
||||
|
||||
For all other types, the result is 0 if `a` and `b` are equal. If they
|
||||
are not equal, the result depends on the type and is negative if:
|
||||
|
||||
- Numeric types: a is less than b
|
||||
- String: a is lexicographically less than b
|
||||
- Other: unspecified
|
||||
|
||||
If `a` and `b` are null, the result is 0. If only one of them is null,
|
||||
the result is unspecified.
|
||||
**/
|
||||
public static function compare<T>( a : T, b : T ) : Int;
|
||||
|
||||
/**
|
||||
Compares the functions `f1` and `f2`.
|
||||
|
||||
If `f1` or `f2` are not functions, the result is unspecified.
|
||||
|
||||
Otherwise the result is true if `f1` and the `f2` are physically equal,
|
||||
false otherwise.
|
||||
**/
|
||||
public static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool;
|
||||
|
||||
/**
|
||||
Tells if `v` is an object.
|
||||
|
||||
The result is true if `v` is one of the following:
|
||||
|
||||
- class instance
|
||||
- structure
|
||||
- `Class<T>`
|
||||
- `Enum<T>`
|
||||
|
||||
Otherwise, including if `v` is null, the result is false.
|
||||
**/
|
||||
public static function isObject( v : Dynamic ) : Bool;
|
||||
|
||||
/**
|
||||
Tells if `v` is an enum value.
|
||||
|
||||
The result is true if `v` is of type EnumValue, i.e. an enum
|
||||
constructor.
|
||||
|
||||
Otherwise, including if `v` is null, the result is false.
|
||||
**/
|
||||
public static function isEnumValue( v : Dynamic ) : Bool;
|
||||
|
||||
/**
|
||||
Removes the field named `field` from structure `o`.
|
||||
|
||||
This method is only guaranteed to work on anonymous structures.
|
||||
|
||||
If `o` or `field` are null, the result is unspecified.
|
||||
**/
|
||||
public static function deleteField( o : Dynamic, field : String ) : Bool;
|
||||
|
||||
/**
|
||||
Copies the fields of structure `o`.
|
||||
|
||||
This is only guaranteed to work on anonymous structures.
|
||||
|
||||
If `o` is null, the result is unspecified.
|
||||
**/
|
||||
public static function copy<T>( o : T ) : T;
|
||||
|
||||
/**
|
||||
Transform a function taking an array of arguments into a function that can
|
||||
be called with any number of arguments.
|
||||
**/
|
||||
@:overload(function( f : Array<Dynamic> -> Void ) : Dynamic {})
|
||||
public static function makeVarArgs( f : Array<Dynamic> -> Dynamic ) : Dynamic;
|
||||
|
||||
}
|
||||
119
hGameTest/node_modules/haxe/downloads/haxe/std/Std.hx
generated
vendored
Normal file
119
hGameTest/node_modules/haxe/downloads/haxe/std/Std.hx
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#if !(core_api || cross)
|
||||
#error "Please don't add haxe/std to your classpath, instead set HAXE_STD_PATH env var"
|
||||
#end
|
||||
|
||||
/**
|
||||
The Std class provides standard methods for manipulating basic types.
|
||||
**/
|
||||
extern class Std {
|
||||
|
||||
/**
|
||||
Tells if a value `v` is of the type `t`. Returns `false` if `v` or `t` are null.
|
||||
**/
|
||||
public static function is( v : Dynamic, t : Dynamic ) : Bool;
|
||||
|
||||
/**
|
||||
Checks if object `value` is an instance of class `c`.
|
||||
|
||||
Compiles only if the class specified by `c` can be assigned to the type
|
||||
of `value`.
|
||||
|
||||
This method checks if a downcast is possible. That is, if the runtime
|
||||
type of `value` is assignable to the class specified by `c`, `value` is
|
||||
returned. Otherwise null is returned.
|
||||
|
||||
This method is not guaranteed to work with interfaces or core types such
|
||||
as `String`, `Array` and `Date`.
|
||||
|
||||
If `value` is null, the result is null. If `c` is null, the result is
|
||||
unspecified.
|
||||
**/
|
||||
public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S;
|
||||
|
||||
/**
|
||||
Converts any value to a String.
|
||||
|
||||
If `s` is of `String`, `Int`, `Float` or `Bool`, its value is returned.
|
||||
|
||||
If `s` is an instance of a class and that class or one of its parent classes has
|
||||
a `toString` method, that method is called. If no such method is present, the result
|
||||
is unspecified.
|
||||
|
||||
If `s` is an enum constructor without argument, the constructor's name is returned. If
|
||||
arguments exists, the constructor's name followed by the String representations of
|
||||
the arguments is returned.
|
||||
|
||||
If `s` is a structure, the field names along with their values are returned. The field order
|
||||
and the operator separating field names and values are unspecified.
|
||||
|
||||
If s is null, "null" is returned.
|
||||
**/
|
||||
public static function string( s : Dynamic ) : String;
|
||||
|
||||
/**
|
||||
Converts a `Float` to an `Int`, rounded towards 0.
|
||||
|
||||
If `x` is outside of the signed Int32 range, or is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, the result is unspecified.
|
||||
**/
|
||||
public static function int( x : Float ) : Int;
|
||||
|
||||
/**
|
||||
Converts a `String` to an `Int`.
|
||||
|
||||
Leading whitespaces are ignored.
|
||||
|
||||
If `x` starts with 0x or 0X, hexadecimal notation is recognized where the following digits may
|
||||
contain 0-9 and A-F.
|
||||
|
||||
Otherwise `x` is read as decimal number with 0-9 being allowed characters. `x` may also start with
|
||||
a - to denote a negative value.
|
||||
|
||||
In decimal mode, parsing continues until an invalid character is detected, in which case the
|
||||
result up to that point is returned. For hexadecimal notation, the effect of invalid characters
|
||||
is unspecified.
|
||||
|
||||
Leading 0s that are not part of the 0x/0X hexadecimal notation are ignored, which means octal
|
||||
notation is not supported.
|
||||
|
||||
If the input cannot be recognized, the result is `null`.
|
||||
**/
|
||||
public static function parseInt( x : String ) : Null<Int>;
|
||||
|
||||
/**
|
||||
Converts a `String` to a `Float`.
|
||||
|
||||
The parsing rules for `parseInt` apply here as well, with the exception of invalid input
|
||||
resulting in a `NaN` value instead of null.
|
||||
|
||||
Additionally, decimal notation may contain a single `.` to denote the start of the fractions.
|
||||
**/
|
||||
public static function parseFloat( x : String ) : Float;
|
||||
|
||||
/**
|
||||
Return a random integer between 0 included and `x` excluded.
|
||||
|
||||
If `x <= 1`, the result is always 0.
|
||||
**/
|
||||
public static function random( x : Int ) : Int;
|
||||
}
|
||||
155
hGameTest/node_modules/haxe/downloads/haxe/std/StdTypes.hx
generated
vendored
Normal file
155
hGameTest/node_modules/haxe/downloads/haxe/std/StdTypes.hx
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
// standard Haxe types
|
||||
|
||||
/**
|
||||
The standard `Void` type. Only `null` values can be of the type `Void`.
|
||||
|
||||
@see https://haxe.org/manual/types-void.html
|
||||
**/
|
||||
@:coreType abstract Void { }
|
||||
|
||||
/**
|
||||
The standard `Float` type, this is a double-precision IEEE 64bit float.
|
||||
|
||||
On static targets, `null` cannot be assigned to Float. If this is necessary,
|
||||
`Null<Float>` can be used instead.
|
||||
|
||||
`Std.int` converts a `Float` to an `Int`, rounded towards 0.
|
||||
`Std.parseFloat` converts a `String` to a `Float`.
|
||||
|
||||
@see https://haxe.org/manual/types-basic-types.html
|
||||
@see https://haxe.org/manual/types-nullability.html
|
||||
**/
|
||||
@:coreType @:notNull @:runtimeValue abstract Float { }
|
||||
|
||||
/**
|
||||
The standard `Int` type. Its precision depends on the platform.
|
||||
|
||||
On static targets, `null` cannot be assigned to `Int`. If this is necessary,
|
||||
`Null<Int>` can be used instead.
|
||||
|
||||
`Std.int` converts a `Float` to an `Int`, rounded towards 0.
|
||||
`Std.parseInt` converts a `String` to an `Int`.
|
||||
|
||||
@see https://haxe.org/manual/types-basic-types.html
|
||||
@see https://haxe.org/manual/std-math-integer-math.html
|
||||
@see https://haxe.org/manual/types-nullability.html
|
||||
**/
|
||||
@:coreType @:notNull @:runtimeValue abstract Int to Float { }
|
||||
|
||||
#if (java || cs || hl)
|
||||
/**
|
||||
Single-precision IEEE 32bit float (4-byte).
|
||||
**/
|
||||
@:coreType @:notNull @:runtimeValue abstract Single to Float from Float {}
|
||||
#end
|
||||
|
||||
/**
|
||||
`Null` can be useful in two cases. In order to document some methods
|
||||
that accept or can return a `null` value, or for the Flash compiler and AS3
|
||||
generator to distinguish between base values that can be `null` and others that
|
||||
can't.
|
||||
|
||||
@see https://haxe.org/manual/types-nullability.html
|
||||
**/
|
||||
typedef Null<T> = T
|
||||
|
||||
/**
|
||||
The standard Boolean type, which can either be `true` or `false`.
|
||||
|
||||
On static targets, `null` cannot be assigned to `Bool`. If this is necessary,
|
||||
`Null<Bool>` can be used instead.
|
||||
|
||||
@see https://haxe.org/manual/types-bool.html
|
||||
@see https://haxe.org/manual/types-nullability.html
|
||||
**/
|
||||
@:coreType @:notNull @:runtimeValue abstract Bool {
|
||||
}
|
||||
|
||||
/**
|
||||
`Dynamic` is a special type which is compatible with all other types.
|
||||
|
||||
Use of `Dynamic` should be minimized as it prevents several compiler
|
||||
checks and optimizations. See `Any` type for a safer alternative for
|
||||
representing values of any type.
|
||||
|
||||
@see https://haxe.org/manual/types-dynamic.html
|
||||
**/
|
||||
@:coreType @:runtimeValue abstract Dynamic<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
An `Iterator` is a structure that permits iteration over elements of type `T`.
|
||||
|
||||
Any class with matching `hasNext()` and `next()` fields is considered an `Iterator`
|
||||
and can then be used e.g. in `for`-loops. This makes it easy to implement
|
||||
custom iterators.
|
||||
|
||||
@see https://haxe.org/manual/lf-iterators.html
|
||||
**/
|
||||
typedef Iterator<T> = {
|
||||
|
||||
/**
|
||||
Returns `false` if the iteration is complete, `true` otherwise.
|
||||
|
||||
Usually iteration is considered to be complete if all elements of the
|
||||
underlying data structure were handled through calls to `next()`. However,
|
||||
in custom iterators any logic may be used to determine the completion
|
||||
state.
|
||||
**/
|
||||
function hasNext() : Bool;
|
||||
|
||||
/**
|
||||
Returns the current item of the `Iterator` and advances to the next one.
|
||||
|
||||
This method is not required to check `hasNext()` first. A call to this
|
||||
method while `hasNext()` is `false` yields unspecified behavior.
|
||||
|
||||
On the other hand, iterators should not require a call to `hasNext()`
|
||||
before the first call to `next()` if an element is available.
|
||||
**/
|
||||
function next() : T;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
An `Iterable` is a data structure which has an `iterator()` method.
|
||||
See `Lambda` for generic functions on iterable structures.
|
||||
|
||||
@see https://haxe.org/manual/lf-iterators.html
|
||||
**/
|
||||
typedef Iterable<T> = {
|
||||
function iterator() : Iterator<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
`ArrayAccess` is used to indicate a class that can be accessed using brackets.
|
||||
The type parameter represents the type of the elements stored.
|
||||
|
||||
This interface should be used for externs only. Haxe does not support custom
|
||||
array access on classes. However, array access can be implemented for
|
||||
abstract types.
|
||||
|
||||
@see https://haxe.org/manual/types-abstract-array-access.html
|
||||
**/
|
||||
extern interface ArrayAccess<T> { }
|
||||
172
hGameTest/node_modules/haxe/downloads/haxe/std/String.hx
generated
vendored
Normal file
172
hGameTest/node_modules/haxe/downloads/haxe/std/String.hx
generated
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
The basic String class.
|
||||
|
||||
A Haxe String is immutable, it is not possible to modify individual
|
||||
characters. No method of this class changes the state of `this` String.
|
||||
|
||||
Strings can be constructed using the String literal syntax `"string value"`.
|
||||
|
||||
String can be concatenated by using the `+` operator. If an operand is not a
|
||||
String, it is passed through `Std.string()` first.
|
||||
|
||||
@see https://haxe.org/manual/std-String.html
|
||||
**/
|
||||
extern class String {
|
||||
|
||||
/**
|
||||
The number of characters in `this` String.
|
||||
**/
|
||||
var length(default,null) : Int;
|
||||
|
||||
/**
|
||||
Creates a copy from a given String.
|
||||
**/
|
||||
function new(string:String) : Void;
|
||||
|
||||
/**
|
||||
Returns a String where all characters of `this` String are upper case.
|
||||
|
||||
Affects the characters `a-z`. Other characters remain unchanged.
|
||||
**/
|
||||
function toUpperCase() : String;
|
||||
|
||||
/**
|
||||
Returns a String where all characters of `this` String are lower case.
|
||||
|
||||
Affects the characters `A-Z`. Other characters remain unchanged.
|
||||
**/
|
||||
function toLowerCase() : String;
|
||||
|
||||
/**
|
||||
Returns the character at position `index` of `this` String.
|
||||
|
||||
If `index` is negative or exceeds `this.length`, the empty String `""`
|
||||
is returned.
|
||||
**/
|
||||
function charAt(index : Int) : String;
|
||||
|
||||
/**
|
||||
Returns the character code at position `index` of `this` String.
|
||||
|
||||
If `index` is negative or exceeds `this.length`, `null` is returned.
|
||||
|
||||
To obtain the character code of a single character, `"x".code` can be
|
||||
used instead to inline the character code at compile time. Note that
|
||||
this only works on String literals of length 1.
|
||||
**/
|
||||
function charCodeAt( index : Int) : Null<Int>;
|
||||
|
||||
/**
|
||||
Returns the position of the leftmost occurrence of `str` within `this`
|
||||
String.
|
||||
|
||||
If `startIndex` is given, the search is performed within the substring
|
||||
of `this` String starting from `startIndex`. Otherwise the search is
|
||||
performed within `this` String. In either case, the returned position
|
||||
is relative to the beginning of `this` String.
|
||||
|
||||
If `str` cannot be found, -1 is returned.
|
||||
**/
|
||||
function indexOf( str : String, ?startIndex : Int ) : Int;
|
||||
|
||||
/**
|
||||
Returns the position of the rightmost occurrence of `str` within `this`
|
||||
String.
|
||||
|
||||
If `startIndex` is given, the search is performed within the substring
|
||||
of `this` String from 0 to `startIndex`. Otherwise the search is
|
||||
performed within `this` String. In either case, the returned position
|
||||
is relative to the beginning of `this` String.
|
||||
|
||||
If `str` cannot be found, -1 is returned.
|
||||
**/
|
||||
function lastIndexOf( str : String, ?startIndex : Int ) : Int;
|
||||
|
||||
/**
|
||||
Splits `this` String at each occurrence of `delimiter`.
|
||||
|
||||
If `this` String is the empty String `""`, the result is not consistent
|
||||
across targets and may either be `[]` (on Js, Cpp) or `[""]`.
|
||||
|
||||
If `delimiter` is the empty String `""`, `this` String is split into an
|
||||
Array of `this.length` elements, where the elements correspond to the
|
||||
characters of `this` String.
|
||||
|
||||
If `delimiter` is not found within `this` String, the result is an Array
|
||||
with one element, which equals `this` String.
|
||||
|
||||
If `delimiter` is null, the result is unspecified.
|
||||
|
||||
Otherwise, `this` String is split into parts at each occurrence of
|
||||
`delimiter`. If `this` String starts (or ends) with `delimiter`, the
|
||||
result `Array` contains a leading (or trailing) empty String `""` element.
|
||||
Two subsequent delimiters also result in an empty String `""` element.
|
||||
**/
|
||||
function split( delimiter : String ) : Array<String>;
|
||||
|
||||
/**
|
||||
Returns `len` characters of `this` String, starting at position `pos`.
|
||||
|
||||
If `len` is omitted, all characters from position `pos` to the end of
|
||||
`this` String are included.
|
||||
|
||||
If `pos` is negative, its value is calculated from the end of `this`
|
||||
String by `this.length + pos`. If this yields a negative value, 0 is
|
||||
used instead.
|
||||
|
||||
If the calculated position + `len` exceeds `this.length`, the characters
|
||||
from that position to the end of `this` String are returned.
|
||||
|
||||
If `len` is negative, the result is unspecified.
|
||||
**/
|
||||
function substr( pos : Int, ?len : Int ) : String;
|
||||
|
||||
/**
|
||||
Returns the part of `this` String from `startIndex` to but not including `endIndex`.
|
||||
|
||||
If `startIndex` or `endIndex` are negative, 0 is used instead.
|
||||
|
||||
If `startIndex` exceeds `endIndex`, they are swapped.
|
||||
|
||||
If the (possibly swapped) `endIndex` is omitted or exceeds
|
||||
`this.length`, `this.length` is used instead.
|
||||
|
||||
If the (possibly swapped) `startIndex` exceeds `this.length`, the empty
|
||||
String `""` is returned.
|
||||
**/
|
||||
function substring( startIndex : Int, ?endIndex : Int ) : String;
|
||||
|
||||
/**
|
||||
Returns the String itself.
|
||||
**/
|
||||
function toString() : String;
|
||||
|
||||
/**
|
||||
Returns the String corresponding to the character code `code`.
|
||||
|
||||
If `code` is negative or has another invalid value, the result is
|
||||
unspecified.
|
||||
**/
|
||||
@:pure static function fromCharCode( code : Int ) : String;
|
||||
}
|
||||
103
hGameTest/node_modules/haxe/downloads/haxe/std/StringBuf.hx
generated
vendored
Normal file
103
hGameTest/node_modules/haxe/downloads/haxe/std/StringBuf.hx
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
A String buffer is an efficient way to build a big string by appending small
|
||||
elements together.
|
||||
|
||||
Its cross-platform implementation uses String concatenation internally, but
|
||||
StringBuf may be optimized for different targets.
|
||||
|
||||
Unlike String, an instance of StringBuf is not immutable in the sense that
|
||||
it can be passed as argument to functions which modify it by appending more
|
||||
values. However, the internal buffer cannot be modified.
|
||||
**/
|
||||
class StringBuf {
|
||||
|
||||
var b:String;
|
||||
|
||||
/**
|
||||
The length of `this` StringBuf in characters.
|
||||
**/
|
||||
public var length(get,never) : Int;
|
||||
|
||||
/**
|
||||
Creates a new StringBuf instance.
|
||||
|
||||
This may involve initialization of the internal buffer.
|
||||
**/
|
||||
public inline function new() {
|
||||
b = "";
|
||||
}
|
||||
|
||||
inline function get_length() : Int {
|
||||
return b.length;
|
||||
}
|
||||
|
||||
/**
|
||||
Appends the representation of `x` to `this` StringBuf.
|
||||
|
||||
The exact representation of `x` may vary per platform. To get more
|
||||
consistent behavior, this function should be called with
|
||||
Std.string(x).
|
||||
|
||||
If `x` is null, the String "null" is appended.
|
||||
**/
|
||||
public inline function add<T>( x : T ) : Void {
|
||||
b += x;
|
||||
}
|
||||
|
||||
/**
|
||||
Appends the character identified by `c` to `this` StringBuf.
|
||||
|
||||
If `c` is negative or has another invalid value, the result is
|
||||
unspecified.
|
||||
**/
|
||||
public inline function addChar( c : Int ) : Void {
|
||||
b += String.fromCharCode(c);
|
||||
}
|
||||
|
||||
/**
|
||||
Appends a substring of `s` to `this` StringBuf.
|
||||
|
||||
This function expects `pos` and `len` to describe a valid substring of
|
||||
`s`, or else the result is unspecified. To get more robust behavior,
|
||||
`this.add(s.substr(pos,len))` can be used instead.
|
||||
|
||||
If `s` or `pos` are null, the result is unspecified.
|
||||
|
||||
If `len` is omitted or null, the substring ranges from `pos` to the end
|
||||
of `s`.
|
||||
**/
|
||||
public inline function addSub( s : String, pos : Int, ?len : Int) : Void {
|
||||
b += (len == null ? s.substr(pos) : s.substr(pos, len));
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the content of `this` StringBuf as String.
|
||||
|
||||
The buffer is not emptied by this operation.
|
||||
**/
|
||||
public inline function toString() : String {
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
||||
592
hGameTest/node_modules/haxe/downloads/haxe/std/StringTools.hx
generated
vendored
Normal file
592
hGameTest/node_modules/haxe/downloads/haxe/std/StringTools.hx
generated
vendored
Normal file
@@ -0,0 +1,592 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
This class provides advanced methods on Strings. It is ideally used with
|
||||
`using StringTools` and then acts as an [extension](https://haxe.org/manual/lf-static-extension.html)
|
||||
to the `String` class.
|
||||
|
||||
If the first argument to any of the methods is null, the result is
|
||||
unspecified.
|
||||
**/
|
||||
#if cpp
|
||||
using cpp.NativeString;
|
||||
#end
|
||||
class StringTools {
|
||||
/**
|
||||
Encode an URL by using the standard format.
|
||||
**/
|
||||
#if (!java && !cpp && !lua) inline #end public static function urlEncode( s : String ) : String {
|
||||
#if flash
|
||||
return untyped __global__["encodeURIComponent"](s);
|
||||
#elseif neko
|
||||
return untyped new String(_urlEncode(s.__s));
|
||||
#elseif js
|
||||
return untyped encodeURIComponent(s);
|
||||
#elseif cpp
|
||||
return untyped s.__URLEncode();
|
||||
#elseif java
|
||||
return postProcessUrlEncode(java.net.URLEncoder.encode(s, "UTF-8"));
|
||||
#elseif cs
|
||||
return untyped cs.system.Uri.EscapeDataString(s);
|
||||
#elseif python
|
||||
return python.lib.urllib.Parse.quote(s, "");
|
||||
#elseif hl
|
||||
var len = 0;
|
||||
var b = @:privateAccess s.bytes.urlEncode(len);
|
||||
return @:privateAccess String.__alloc__(b,len);
|
||||
#elseif lua
|
||||
s = lua.NativeStringTools.gsub(s, "\n", "\r\n");
|
||||
s = lua.NativeStringTools.gsub(s, "([^%w %-%_%.%~])", function (c) {
|
||||
return lua.NativeStringTools.format("%%%02X", lua.NativeStringTools.byte(c) + '');
|
||||
});
|
||||
s = lua.NativeStringTools.gsub(s, " ", "+");
|
||||
return s;
|
||||
#else
|
||||
return null;
|
||||
#end
|
||||
}
|
||||
|
||||
#if java
|
||||
private static function postProcessUrlEncode( s : String ) : String {
|
||||
var ret = new StringBuf();
|
||||
var i = 0,
|
||||
len = s.length;
|
||||
while (i < len) {
|
||||
switch(_charAt(s, i++)) {
|
||||
case '+'.code:
|
||||
ret.add('%20');
|
||||
case '%'.code if (i <= len - 2):
|
||||
var c1 = _charAt(s, i++),
|
||||
c2 = _charAt(s, i++);
|
||||
switch[c1, c2] {
|
||||
case ['2'.code, '1'.code]:
|
||||
ret.addChar('!'.code);
|
||||
case ['2'.code, '7'.code]:
|
||||
ret.addChar('\''.code);
|
||||
case ['2'.code, '8'.code]:
|
||||
ret.addChar('('.code);
|
||||
case ['2'.code, '9'.code]:
|
||||
ret.addChar(')'.code);
|
||||
case ['7'.code, 'E'.code] | ['7'.code, 'e'.code]:
|
||||
ret.addChar('~'.code);
|
||||
case _:
|
||||
ret.addChar('%'.code);
|
||||
ret.addChar(cast c1);
|
||||
ret.addChar(cast c2);
|
||||
}
|
||||
case chr:
|
||||
ret.addChar(cast chr);
|
||||
}
|
||||
}
|
||||
return ret.toString();
|
||||
}
|
||||
#end
|
||||
|
||||
/**
|
||||
Decode an URL using the standard format.
|
||||
**/
|
||||
#if (!java && !cpp && !lua) inline #end public static function urlDecode( s : String ) : String {
|
||||
#if flash
|
||||
return untyped __global__["decodeURIComponent"](s.split("+").join(" "));
|
||||
#elseif neko
|
||||
return untyped new String(_urlDecode(s.__s));
|
||||
#elseif js
|
||||
return untyped decodeURIComponent(s.split("+").join(" "));
|
||||
#elseif cpp
|
||||
return untyped s.__URLDecode();
|
||||
#elseif java
|
||||
try
|
||||
return untyped __java__("java.net.URLDecoder.decode(s, \"UTF-8\")")
|
||||
catch (e:Dynamic) throw e;
|
||||
#elseif cs
|
||||
return untyped cs.system.Uri.UnescapeDataString(s);
|
||||
#elseif python
|
||||
return python.lib.urllib.Parse.unquote(s);
|
||||
#elseif hl
|
||||
var len = 0;
|
||||
var b = @:privateAccess s.bytes.urlDecode(len);
|
||||
return @:privateAccess String.__alloc__(b,len);
|
||||
#elseif lua
|
||||
s = lua.NativeStringTools.gsub (s, "+", " ");
|
||||
s = lua.NativeStringTools.gsub (s, "%%(%x%x)",
|
||||
function(h) {return lua.NativeStringTools.char(lua.Lua.tonumber(h,16));});
|
||||
s = lua.NativeStringTools.gsub (s, "\r\n", "\n");
|
||||
return s;
|
||||
#else
|
||||
return null;
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Escapes HTML special characters of the string `s`.
|
||||
|
||||
The following replacements are made:
|
||||
|
||||
- `&` becomes `&`;
|
||||
- `<` becomes `<`;
|
||||
- `>` becomes `>`;
|
||||
|
||||
If `quotes` is true, the following characters are also replaced:
|
||||
|
||||
- `"` becomes `"`;
|
||||
- `'` becomes `'`;
|
||||
**/
|
||||
public static function htmlEscape( s : String, ?quotes : Bool ) : String {
|
||||
s = s.split("&").join("&").split("<").join("<").split(">").join(">");
|
||||
return quotes ? s.split('"').join(""").split("'").join("'") : s;
|
||||
}
|
||||
|
||||
/**
|
||||
Unescapes HTML special characters of the string `s`.
|
||||
|
||||
This is the inverse operation to htmlEscape, i.e. the following always
|
||||
holds: `htmlUnescape(htmlEscape(s)) == s`
|
||||
|
||||
The replacements follow:
|
||||
|
||||
- `&` becomes `&`
|
||||
- `<` becomes `<`
|
||||
- `>` becomes `>`
|
||||
- `"` becomes `"`
|
||||
- `'` becomes `'`
|
||||
**/
|
||||
public static function htmlUnescape( s : String ) : String {
|
||||
return s.split(">").join(">").split("<").join("<").split(""").join('"').split("'").join("'").split("&").join("&");
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if the string `s` starts with the string `start`.
|
||||
|
||||
If `start` is `null`, the result is unspecified.
|
||||
|
||||
If `start` is the empty String `""`, the result is true.
|
||||
**/
|
||||
public static #if (cs || java) inline #end function startsWith( s : String, start : String ) : Bool {
|
||||
#if java
|
||||
return untyped s.startsWith(start);
|
||||
#elseif cs
|
||||
return untyped s.StartsWith(start);
|
||||
#elseif cpp
|
||||
if (s.length<start.length)
|
||||
return false;
|
||||
var p0 = s.c_str();
|
||||
var p1 = start.c_str();
|
||||
for(i in 0...start.length)
|
||||
if ( p0.at(i) != p1.at(i) )
|
||||
return false;
|
||||
return true;
|
||||
#elseif hl
|
||||
return @:privateAccess (s.length >= start.length && s.bytes.compare(0,start.bytes,0,start.length<<1) == 0);
|
||||
#else
|
||||
return( s.length >= start.length && s.substr(0, start.length) == start );
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if the string `s` ends with the string `end`.
|
||||
|
||||
If `end` is `null`, the result is unspecified.
|
||||
|
||||
If `end` is the empty String `""`, the result is true.
|
||||
**/
|
||||
public static #if (cs || java) inline #end function endsWith( s : String, end : String ) : Bool {
|
||||
#if java
|
||||
return untyped s.endsWith(end);
|
||||
#elseif cs
|
||||
return untyped s.EndsWith(end);
|
||||
#elseif cpp
|
||||
if (s.length<end.length)
|
||||
return false;
|
||||
var p0 = s.c_str().add( s.length-end.length );
|
||||
var p1 = end.c_str();
|
||||
for(i in 0...end.length)
|
||||
if ( p0.at(i) != p1.at(i) )
|
||||
return false;
|
||||
return true;
|
||||
#elseif hl
|
||||
var elen = end.length;
|
||||
var slen = s.length;
|
||||
return @:privateAccess (slen >= elen && s.bytes.compare((slen - elen) << 1, end.bytes, 0, elen << 1) == 0);
|
||||
#else
|
||||
var elen = end.length;
|
||||
var slen = s.length;
|
||||
return( slen >= elen && s.substr(slen - elen, elen) == end );
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if the character in the string `s` at position `pos` is a space.
|
||||
|
||||
A character is considered to be a space character if its character code
|
||||
is 9,10,11,12,13 or 32.
|
||||
|
||||
If `s` is the empty String `""`, or if pos is not a valid position within
|
||||
`s`, the result is false.
|
||||
**/
|
||||
public static function isSpace( s : String, pos : Int ) : Bool {
|
||||
#if (python || lua)
|
||||
if (s.length == 0 || pos < 0 || pos >= s.length) return false;
|
||||
#end
|
||||
var c = s.charCodeAt( pos );
|
||||
return (c > 8 && c < 14) || c == 32;
|
||||
}
|
||||
|
||||
/**
|
||||
Removes leading space characters of `s`.
|
||||
|
||||
This function internally calls `isSpace()` to decide which characters to
|
||||
remove.
|
||||
|
||||
If `s` is the empty String `""` or consists only of space characters, the
|
||||
result is the empty String `""`.
|
||||
**/
|
||||
public #if cs inline #end static function ltrim( s : String ) : String {
|
||||
#if cs
|
||||
return untyped s.TrimStart();
|
||||
#else
|
||||
var l = s.length;
|
||||
var r = 0;
|
||||
while( r < l && isSpace(s,r) ){
|
||||
r++;
|
||||
}
|
||||
if( r > 0 )
|
||||
return s.substr(r, l-r);
|
||||
else
|
||||
return s;
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Removes trailing space characters of `s`.
|
||||
|
||||
This function internally calls `isSpace()` to decide which characters to
|
||||
remove.
|
||||
|
||||
If `s` is the empty String `""` or consists only of space characters, the
|
||||
result is the empty String `""`.
|
||||
**/
|
||||
public #if cs inline #end static function rtrim( s : String ) : String {
|
||||
#if cs
|
||||
return untyped s.TrimEnd();
|
||||
#else
|
||||
var l = s.length;
|
||||
var r = 0;
|
||||
while( r < l && isSpace(s,l-r-1) ){
|
||||
r++;
|
||||
}
|
||||
if( r > 0 ){
|
||||
return s.substr(0, l-r);
|
||||
}else{
|
||||
return s;
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Removes leading and trailing space characters of `s`.
|
||||
|
||||
This is a convenience function for `ltrim(rtrim(s))`.
|
||||
**/
|
||||
public #if (cs || java) inline #end static function trim( s : String ) : String {
|
||||
#if cs
|
||||
return untyped s.Trim();
|
||||
#elseif java
|
||||
return untyped s.trim();
|
||||
#else
|
||||
return ltrim(rtrim(s));
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Concatenates `c` to `s` until `s.length` is at least `l`.
|
||||
|
||||
If `c` is the empty String `""` or if `l` does not exceed `s.length`,
|
||||
`s` is returned unchanged.
|
||||
|
||||
If `c.length` is 1, the resulting String length is exactly `l`.
|
||||
|
||||
Otherwise the length may exceed `l`.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
**/
|
||||
public static function lpad( s : String, c : String, l : Int ) : String {
|
||||
if (c.length <= 0)
|
||||
return s;
|
||||
|
||||
while (s.length < l) {
|
||||
s = c + s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
Appends `c` to `s` until `s.length` is at least `l`.
|
||||
|
||||
If `c` is the empty String `""` or if `l` does not exceed `s.length`,
|
||||
`s` is returned unchanged.
|
||||
|
||||
If `c.length` is 1, the resulting String length is exactly `l`.
|
||||
|
||||
Otherwise the length may exceed `l`.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
**/
|
||||
public static function rpad( s : String, c : String, l : Int ) : String {
|
||||
if (c.length <= 0)
|
||||
return s;
|
||||
|
||||
while (s.length < l) {
|
||||
s = s + c;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
Replace all occurrences of the String `sub` in the String `s` by the
|
||||
String `by`.
|
||||
|
||||
If `sub` is the empty String `""`, `by` is inserted after each character
|
||||
of `s`. If `by` is also the empty String `""`, `s` remains unchanged.
|
||||
|
||||
This is a convenience function for `s.split(sub).join(by)`.
|
||||
|
||||
If `sub` or `by` are null, the result is unspecified.
|
||||
**/
|
||||
public static function replace( s : String, sub : String, by : String ) : String {
|
||||
#if java
|
||||
if (sub.length == 0)
|
||||
return s.split(sub).join(by);
|
||||
else
|
||||
return untyped s.replace(sub, by);
|
||||
#elseif cs
|
||||
if (sub.length == 0)
|
||||
return s.split(sub).join(by);
|
||||
else
|
||||
return untyped s.Replace(sub, by);
|
||||
#else
|
||||
return s.split(sub).join(by);
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Encodes `n` into a hexadecimal representation.
|
||||
|
||||
If `digits` is specified, the resulting String is padded with "0" until
|
||||
its `length` equals `digits`.
|
||||
**/
|
||||
public static function hex( n : Int, ?digits : Int ) {
|
||||
#if flash
|
||||
var n : UInt = n;
|
||||
var s : String = untyped n.toString(16);
|
||||
s = s.toUpperCase();
|
||||
#else
|
||||
var s = "";
|
||||
var hexChars = "0123456789ABCDEF";
|
||||
do {
|
||||
s = hexChars.charAt(n&15) + s;
|
||||
n >>>= 4;
|
||||
} while( n > 0 );
|
||||
#end
|
||||
#if python
|
||||
if (digits != null && s.length < digits) {
|
||||
var diff = digits - s.length;
|
||||
for (_ in 0...diff) {
|
||||
s = "0" + s;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if( digits != null )
|
||||
while( s.length < digits )
|
||||
s = "0"+s;
|
||||
#end
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the character code at position `index` of String `s`, or an
|
||||
end-of-file indicator at if `position` equals `s.length`.
|
||||
|
||||
This method is faster than `String.charCodeAt()` on some platforms, but
|
||||
the result is unspecified if `index` is negative or greater than
|
||||
`s.length`.
|
||||
|
||||
End of file status can be checked by calling `StringTools.isEof()` with
|
||||
the returned value as argument.
|
||||
|
||||
This operation is not guaranteed to work if `s` contains the `\0`
|
||||
character.
|
||||
**/
|
||||
public static inline function fastCodeAt( s : String, index : Int ) : Int {
|
||||
#if neko
|
||||
return untyped __dollar__sget(s.__s, index);
|
||||
#elseif cpp
|
||||
return untyped s.cca(index);
|
||||
#elseif flash
|
||||
return untyped s.cca(index);
|
||||
#elseif java
|
||||
return ( index < s.length ) ? cast(_charAt(s, index), Int) : -1;
|
||||
#elseif cs
|
||||
return ( cast(index, UInt) < s.length ) ? cast(s[index], Int) : -1;
|
||||
#elseif js
|
||||
return (untyped s).charCodeAt(index);
|
||||
#elseif python
|
||||
return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
||||
#elseif hl
|
||||
return @:privateAccess s.bytes.getUI16(index << 1);
|
||||
#elseif lua
|
||||
return lua.NativeStringTools.byte(s,index+1);
|
||||
#else
|
||||
return untyped s.cca(index);
|
||||
#end
|
||||
}
|
||||
|
||||
/*
|
||||
Tells if `c` represents the end-of-file (EOF) character.
|
||||
*/
|
||||
@:noUsing public static inline function isEof( c : Int ) : Bool {
|
||||
#if (flash || cpp || hl)
|
||||
return c == 0;
|
||||
#elseif js
|
||||
return c != c; // fast NaN
|
||||
#elseif (neko || lua)
|
||||
return c == null;
|
||||
#elseif cs
|
||||
return c == -1;
|
||||
#elseif java
|
||||
return c == -1;
|
||||
#elseif python
|
||||
return c == -1;
|
||||
#else
|
||||
return false;
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a String that can be used as a single command line argument
|
||||
on Unix.
|
||||
The input will be quoted, or escaped if necessary.
|
||||
*/
|
||||
public static function quoteUnixArg(argument:String):String {
|
||||
// Based on cpython's shlex.quote().
|
||||
// https://hg.python.org/cpython/file/a3f076d4f54f/Lib/shlex.py#l278
|
||||
|
||||
if (argument == "")
|
||||
return "''";
|
||||
|
||||
if (!~/[^a-zA-Z0-9_@%+=:,.\/-]/.match(argument))
|
||||
return argument;
|
||||
|
||||
// use single quotes, and put single quotes into double quotes
|
||||
// the string $'b is then quoted as '$'"'"'b'
|
||||
return "'" + replace(argument, "'", "'\"'\"'") + "'";
|
||||
}
|
||||
|
||||
/**
|
||||
Character codes of the characters that will be escaped by `quoteWinArg(_, true)`.
|
||||
*/
|
||||
public static var winMetaCharacters = [" ".code, "(".code, ")".code, "%".code, "!".code, "^".code, "\"".code, "<".code, ">".code, "&".code, "|".code, "\n".code, "\r".code, ",".code, ";".code];
|
||||
|
||||
/**
|
||||
Returns a String that can be used as a single command line argument
|
||||
on Windows.
|
||||
The input will be quoted, or escaped if necessary, such that the output
|
||||
will be parsed as a single argument using the rule specified in
|
||||
http://msdn.microsoft.com/en-us/library/ms880421
|
||||
|
||||
Examples:
|
||||
```
|
||||
quoteWinArg("abc") == "abc";
|
||||
quoteWinArg("ab c") == '"ab c"';
|
||||
```
|
||||
*/
|
||||
public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String {
|
||||
// If there is no space, tab, back-slash, or double-quotes, and it is not an empty string.
|
||||
if (!~/^[^ \t\\"]+$/.match(argument)) {
|
||||
|
||||
// Based on cpython's subprocess.list2cmdline().
|
||||
// https://hg.python.org/cpython/file/50741316dd3a/Lib/subprocess.py#l620
|
||||
|
||||
var result = new StringBuf();
|
||||
var needquote = argument.indexOf(" ") != -1 || argument.indexOf("\t") != -1 || argument == "";
|
||||
|
||||
if (needquote)
|
||||
result.add('"');
|
||||
|
||||
var bs_buf = new StringBuf();
|
||||
for (i in 0...argument.length) {
|
||||
switch (argument.charCodeAt(i)) {
|
||||
case "\\".code:
|
||||
// Don't know if we need to double yet.
|
||||
bs_buf.add("\\");
|
||||
case '"'.code:
|
||||
// Double backslashes.
|
||||
var bs = bs_buf.toString();
|
||||
result.add(bs);
|
||||
result.add(bs);
|
||||
bs_buf = new StringBuf();
|
||||
result.add('\\"');
|
||||
case c:
|
||||
// Normal char
|
||||
if (bs_buf.length > 0) {
|
||||
result.add(bs_buf.toString());
|
||||
bs_buf = new StringBuf();
|
||||
}
|
||||
result.addChar(c);
|
||||
}
|
||||
}
|
||||
|
||||
// Add remaining backslashes, if any.
|
||||
result.add(bs_buf.toString());
|
||||
|
||||
if (needquote) {
|
||||
result.add(bs_buf.toString());
|
||||
result.add('"');
|
||||
}
|
||||
|
||||
argument = result.toString();
|
||||
}
|
||||
|
||||
if (escapeMetaCharacters) {
|
||||
var result = new StringBuf();
|
||||
for (i in 0...argument.length) {
|
||||
var c = argument.charCodeAt(i);
|
||||
if (winMetaCharacters.indexOf(c) >= 0) {
|
||||
result.addChar("^".code);
|
||||
}
|
||||
result.addChar(c);
|
||||
}
|
||||
return result.toString();
|
||||
} else {
|
||||
return argument;
|
||||
}
|
||||
}
|
||||
|
||||
#if java
|
||||
private static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 return untyped str._charAt(idx);
|
||||
#end
|
||||
|
||||
#if neko
|
||||
private static var _urlEncode = neko.Lib.load("std","url_encode",1);
|
||||
private static var _urlDecode = neko.Lib.load("std","url_decode",1);
|
||||
#end
|
||||
|
||||
}
|
||||
148
hGameTest/node_modules/haxe/downloads/haxe/std/Sys.hx
generated
vendored
Normal file
148
hGameTest/node_modules/haxe/downloads/haxe/std/Sys.hx
generated
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
This class gives you access to many base functionalities of system platforms. Looks in `sys` sub packages for more system APIs.
|
||||
**/
|
||||
@:require(sys)
|
||||
extern class Sys {
|
||||
|
||||
/**
|
||||
Print any value on the standard output.
|
||||
**/
|
||||
static function print( v : Dynamic ) : Void;
|
||||
|
||||
/**
|
||||
Print any value on the standard output, followed by a newline.
|
||||
**/
|
||||
static function println( v : Dynamic ) : Void;
|
||||
|
||||
/**
|
||||
Returns all the arguments that were passed by the command line.
|
||||
**/
|
||||
static function args() : Array<String>;
|
||||
|
||||
/**
|
||||
Returns the value of the given environment variable.
|
||||
**/
|
||||
static function getEnv( s : String ) : String;
|
||||
|
||||
/**
|
||||
Set the value of the given environment variable.
|
||||
**/
|
||||
static function putEnv( s : String, v : String ) : Void;
|
||||
|
||||
/**
|
||||
Returns all environment variables.
|
||||
**/
|
||||
static function environment() : Map<String,String>;
|
||||
|
||||
/**
|
||||
Suspend the current execution for the given time (in seconds).
|
||||
**/
|
||||
static function sleep( seconds : Float ) : Void;
|
||||
|
||||
/**
|
||||
Change the current time locale, which will affect `DateTools.format` date formating.
|
||||
Returns true if the locale was successfully changed
|
||||
**/
|
||||
static function setTimeLocale( loc : String ) : Bool;
|
||||
|
||||
/**
|
||||
Get the current working directory (usually the one in which the program was started)
|
||||
**/
|
||||
static function getCwd() : String;
|
||||
|
||||
/**
|
||||
Change the current working directory.
|
||||
**/
|
||||
static function setCwd( s : String ) : Void;
|
||||
|
||||
/**
|
||||
Returns the name of the system you are running on. For instance :
|
||||
"Windows", "Linux", "BSD" and "Mac" depending on your desktop OS.
|
||||
**/
|
||||
static function systemName() : String;
|
||||
|
||||
/**
|
||||
Run the given command. The command output will be printed on the same output as the current process.
|
||||
The current process will block until the command terminates and it will return the command result (0 if there was no error).
|
||||
|
||||
Command arguments can be passed in two ways: 1. using `args`, 2. appending to `cmd` and leaving `args` as `null`.
|
||||
|
||||
1. When using `args` to pass command arguments, each argument will be automatically quoted, and shell meta-characters will be escaped if needed.
|
||||
`cmd` should be an executable name that can be located in the `PATH` environment variable, or a path to an executable.
|
||||
|
||||
2. When `args` is not given or is `null`, command arguments can be appended to `cmd`. No automatic quoting/escaping will be performed. `cmd` should be formatted exactly as it would be when typed at the command line.
|
||||
It can run executables, as well as shell commands that are not executables (e.g. on Windows: `dir`, `cd`, `echo` etc).
|
||||
|
||||
Read the `sys.io.Process` api for a more complete way to start background processes.
|
||||
**/
|
||||
static function command( cmd : String, ?args : Array<String> ) : Int;
|
||||
|
||||
/**
|
||||
Exit the current process with the given error code.
|
||||
**/
|
||||
static function exit( code : Int ) : Void;
|
||||
|
||||
/**
|
||||
Gives the most precise timestamp value (in seconds).
|
||||
**/
|
||||
static function time() : Float;
|
||||
|
||||
/**
|
||||
Gives the most precise timestamp value (in seconds) but only account for the actual time spent running on the CPU for the current thread/process.
|
||||
**/
|
||||
static function cpuTime() : Float;
|
||||
|
||||
/**
|
||||
Returns the path to the current executable that we are running.
|
||||
**/
|
||||
@:deprecated("Use programPath instead") static function executablePath() : String;
|
||||
|
||||
/**
|
||||
Returns the absolute path to the current program file that we are running.
|
||||
Concretely, for an executable binary, it returns the path to the binary.
|
||||
For a script (e.g. a PHP file), it returns the path to the script.
|
||||
**/
|
||||
static function programPath() : String;
|
||||
|
||||
/**
|
||||
Read a single input character from the standard input (without blocking) and returns it. Setting `echo` to true will also display it on the output.
|
||||
**/
|
||||
static function getChar( echo : Bool ) : Int;
|
||||
|
||||
/**
|
||||
Returns the process standard input, from which you can read what user enters. Usually it will block until the user send a full input line. See `getChar` for an alternative.
|
||||
**/
|
||||
static function stdin() : haxe.io.Input;
|
||||
|
||||
/**
|
||||
Returns the process standard output on which you can write.
|
||||
**/
|
||||
static function stdout() : haxe.io.Output;
|
||||
|
||||
/**
|
||||
Returns the process standard error on which you can write.
|
||||
**/
|
||||
static function stderr() : haxe.io.Output;
|
||||
|
||||
}
|
||||
303
hGameTest/node_modules/haxe/downloads/haxe/std/Type.hx
generated
vendored
Normal file
303
hGameTest/node_modules/haxe/downloads/haxe/std/Type.hx
generated
vendored
Normal file
@@ -0,0 +1,303 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
The Haxe Reflection API allows retrieval of type information at runtime.
|
||||
|
||||
This class complements the more lightweight Reflect class, with a focus on
|
||||
class and enum instances.
|
||||
|
||||
@see https://haxe.org/manual/types.html
|
||||
@see https://haxe.org/manual/std-reflection.html
|
||||
**/
|
||||
extern class Type {
|
||||
|
||||
/**
|
||||
Returns the class of `o`, if `o` is a class instance.
|
||||
|
||||
If `o` is null or of a different type, null is returned.
|
||||
|
||||
In general, type parameter information cannot be obtained at runtime.
|
||||
**/
|
||||
public static function getClass<T>( o : T ) : Class<T>;
|
||||
|
||||
/**
|
||||
Returns the enum of enum instance `o`.
|
||||
|
||||
An enum instance is the result of using an enum constructor. Given an
|
||||
`enum Color { Red; }`, `getEnum(Red)` returns `Enum<Color>`.
|
||||
|
||||
If `o` is null, null is returned.
|
||||
|
||||
In general, type parameter information cannot be obtained at runtime.
|
||||
**/
|
||||
public static function getEnum( o : EnumValue ) : Enum<Dynamic>;
|
||||
|
||||
|
||||
/**
|
||||
Returns the super-class of class `c`.
|
||||
|
||||
If `c` has no super class, null is returned.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
|
||||
In general, type parameter information cannot be obtained at runtime.
|
||||
**/
|
||||
public static function getSuperClass( c : Class<Dynamic> ) : Class<Dynamic>;
|
||||
|
||||
|
||||
/**
|
||||
Returns the name of class `c`, including its path.
|
||||
|
||||
If `c` is inside a package, the package structure is returned dot-
|
||||
separated, with another dot separating the class name:
|
||||
`pack1.pack2.(...).packN.ClassName`
|
||||
If `c` is a sub-type of a Haxe module, that module is not part of the
|
||||
package structure.
|
||||
|
||||
If `c` has no package, the class name is returned.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
|
||||
The class name does not include any type parameters.
|
||||
**/
|
||||
public static function getClassName( c : Class<Dynamic> ) : String;
|
||||
|
||||
/**
|
||||
Returns the name of enum `e`, including its path.
|
||||
|
||||
If `e` is inside a package, the package structure is returned dot-
|
||||
separated, with another dot separating the enum name:
|
||||
`pack1.pack2.(...).packN.EnumName`
|
||||
If `e` is a sub-type of a Haxe module, that module is not part of the
|
||||
package structure.
|
||||
|
||||
If `e` has no package, the enum name is returned.
|
||||
|
||||
If `e` is null, the result is unspecified.
|
||||
|
||||
The enum name does not include any type parameters.
|
||||
**/
|
||||
public static function getEnumName( e : Enum<Dynamic> ) : String;
|
||||
|
||||
/**
|
||||
Resolves a class by name.
|
||||
|
||||
If `name` is the path of an existing class, that class is returned.
|
||||
|
||||
Otherwise null is returned.
|
||||
|
||||
If `name` is null or the path to a different type, the result is
|
||||
unspecified.
|
||||
|
||||
The class name must not include any type parameters.
|
||||
**/
|
||||
public static function resolveClass( name : String ) : Class<Dynamic>;
|
||||
|
||||
/**
|
||||
Resolves an enum by name.
|
||||
|
||||
If `name` is the path of an existing enum, that enum is returned.
|
||||
|
||||
Otherwise null is returned.
|
||||
|
||||
If `name` is null the result is unspecified.
|
||||
|
||||
If `name` is the path to a different type, null is returned.
|
||||
|
||||
The enum name must not include any type parameters.
|
||||
**/
|
||||
public static function resolveEnum( name : String ) : Enum<Dynamic>;
|
||||
|
||||
/**
|
||||
Creates an instance of class `cl`, using `args` as arguments to the
|
||||
class constructor.
|
||||
|
||||
This function guarantees that the class constructor is called.
|
||||
|
||||
Default values of constructors arguments are not guaranteed to be
|
||||
taken into account.
|
||||
|
||||
If `cl` or `args` are null, or if the number of elements in `args` does
|
||||
not match the expected number of constructor arguments, or if any
|
||||
argument has an invalid type, or if `cl` has no own constructor, the
|
||||
result is unspecified.
|
||||
|
||||
In particular, default values of constructor arguments are not
|
||||
guaranteed to be taken into account.
|
||||
**/
|
||||
public static function createInstance<T>( cl : Class<T>, args : Array<Dynamic> ) : T;
|
||||
|
||||
/**
|
||||
Creates an instance of class `cl`.
|
||||
|
||||
This function guarantees that the class constructor is not called.
|
||||
|
||||
If `cl` is null, the result is unspecified.
|
||||
**/
|
||||
public static function createEmptyInstance<T>( cl : Class<T> ) : T;
|
||||
|
||||
/**
|
||||
Creates an instance of enum `e` by calling its constructor `constr` with
|
||||
arguments `params`.
|
||||
|
||||
If `e` or `constr` is null, or if enum `e` has no constructor named
|
||||
`constr`, or if the number of elements in `params` does not match the
|
||||
expected number of constructor arguments, or if any argument has an
|
||||
invalid type, the result is unspecified.
|
||||
**/
|
||||
public static function createEnum<T>( e : Enum<T>, constr : String, ?params : Array<Dynamic> ) : T;
|
||||
|
||||
/**
|
||||
Creates an instance of enum `e` by calling its constructor number
|
||||
`index` with arguments `params`.
|
||||
|
||||
The constructor indices are preserved from Haxe syntax, so the first
|
||||
declared is index 0, the next index 1 etc.
|
||||
|
||||
If `e` or `constr` is null, or if enum `e` has no constructor named
|
||||
`constr`, or if the number of elements in `params` does not match the
|
||||
expected number of constructor arguments, or if any argument has an
|
||||
invalid type, the result is unspecified.
|
||||
**/
|
||||
public static function createEnumIndex<T>( e : Enum<T>, index : Int, ?params : Array<Dynamic> ) : T;
|
||||
|
||||
/**
|
||||
Returns a list of the instance fields of class `c`.
|
||||
|
||||
This only includes fields which are known at compile-time. In
|
||||
particular, using getInstanceFields(getClass(obj)) will not include
|
||||
any fields which were added to obj at runtime.
|
||||
|
||||
The order of the fields in the returned Array is unspecified.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
|
||||
(As3) This method only returns instance fields that are public.
|
||||
**/
|
||||
public static function getInstanceFields( c : Class<Dynamic> ) : Array<String>;
|
||||
|
||||
/**
|
||||
Returns a list of static fields of class `c`.
|
||||
|
||||
This does not include static fields of parent classes.
|
||||
|
||||
The order of the fields in the returned Array is unspecified.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
|
||||
(As3) This method only returns class fields that are public.
|
||||
**/
|
||||
public static function getClassFields( c : Class<Dynamic> ) : Array<String>;
|
||||
|
||||
/**
|
||||
Returns a list of the names of all constructors of enum `e`.
|
||||
|
||||
The order of the constructor names in the returned Array is preserved
|
||||
from the original syntax.
|
||||
|
||||
If `c` is null, the result is unspecified.
|
||||
**/
|
||||
public static function getEnumConstructs( e : Enum<Dynamic> ) : Array<String>;
|
||||
|
||||
/**
|
||||
Returns the runtime type of value `v`.
|
||||
|
||||
The result corresponds to the type `v` has at runtime, which may vary
|
||||
per platform. Assumptions regarding this should be minimized to avoid
|
||||
surprises.
|
||||
**/
|
||||
public static function typeof( v : Dynamic ) : ValueType;
|
||||
|
||||
/**
|
||||
Recursively compares two enum instances `a` and `b` by value.
|
||||
|
||||
Unlike `a == b`, this function performs a deep equality check on the
|
||||
arguments of the constructors, if exists.
|
||||
|
||||
If `a` or `b` are null, the result is unspecified.
|
||||
**/
|
||||
public static function enumEq<T:EnumValue>( a : T, b : T ) : Bool;
|
||||
|
||||
/**
|
||||
Returns the constructor name of enum instance `e`.
|
||||
|
||||
The result String does not contain any constructor arguments.
|
||||
|
||||
If `e` is null, the result is unspecified.
|
||||
**/
|
||||
public static function enumConstructor( e : EnumValue ) : String;
|
||||
|
||||
/**
|
||||
Returns a list of the constructor arguments of enum instance `e`.
|
||||
|
||||
If `e` has no arguments, the result is [].
|
||||
|
||||
Otherwise the result are the values that were used as arguments to `e`,
|
||||
in the order of their declaration.
|
||||
|
||||
If `e` is null, the result is unspecified.
|
||||
**/
|
||||
public static function enumParameters( e : EnumValue ) : Array<Dynamic>;
|
||||
|
||||
/**
|
||||
Returns the index of enum instance `e`.
|
||||
|
||||
This corresponds to the original syntactic position of `e`. The index of
|
||||
the first declared constructor is 0, the next one is 1 etc.
|
||||
|
||||
If `e` is null, the result is unspecified.
|
||||
**/
|
||||
public static function enumIndex( e : EnumValue ) : Int;
|
||||
|
||||
/**
|
||||
Returns a list of all constructors of enum `e` that require no
|
||||
arguments.
|
||||
|
||||
This may return the empty Array `[]` if all constructors of `e` require
|
||||
arguments.
|
||||
|
||||
Otherwise an instance of `e` constructed through each of its non-
|
||||
argument constructors is returned, in the order of the constructor
|
||||
declaration.
|
||||
|
||||
If `e` is null, the result is unspecified.
|
||||
**/
|
||||
public static function allEnums<T>( e : Enum<T> ) : Array<T>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
The different possible runtime types of a value.
|
||||
**/
|
||||
enum ValueType {
|
||||
TNull;
|
||||
TInt;
|
||||
TFloat;
|
||||
TBool;
|
||||
TObject;
|
||||
TFunction;
|
||||
TClass( c : Class<Dynamic> );
|
||||
TEnum( e : Enum<Dynamic> );
|
||||
TUnknown;
|
||||
}
|
||||
294
hGameTest/node_modules/haxe/downloads/haxe/std/UInt.hx
generated
vendored
Normal file
294
hGameTest/node_modules/haxe/downloads/haxe/std/UInt.hx
generated
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#if ((flash || flash9doc || cs || hl) && !doc_gen)
|
||||
/**
|
||||
The unsigned `Int` type is only defined for Flash and C#. It's currently
|
||||
handled the same as a normal Int.
|
||||
|
||||
@see https://haxe.org/manual/types-basic-types.html
|
||||
**/
|
||||
@:coreType
|
||||
@:notNull
|
||||
@:runtimeValue
|
||||
@:analyzer(no_const_propagation)
|
||||
abstract UInt to Int from Int
|
||||
{
|
||||
@:commutative @:op(A+B) private static function addI(lhs:UInt, rhs:Int):UInt;
|
||||
@:commutative @:op(A+B) private static function addF(lhs:UInt, rhs:Float):Float;
|
||||
@:op(A+B) private static function add(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:commutative @:op(A*B) private static function mulI(lhs:UInt, rhs:Int):UInt;
|
||||
@:commutative @:op(A*B) private static function mulF(lhs:UInt, rhs:Float):Float;
|
||||
@:op(A*B) private static function mul(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:op(A%B) private static function modI(lhs:UInt, rhs:Int):UInt;
|
||||
@:op(A%B) private static function modF(lhs:UInt, rhs:Float):Float;
|
||||
@:op(A%B) private static function mod(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:op(A-B) private static function subI(lhs:UInt, rhs:Int):UInt;
|
||||
@:op(A-B) private static function subF(lhs:UInt, rhs:Float):Float;
|
||||
@:op(A-B) private static function sub(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:op(A/B) private static function divI(lhs:UInt, rhs:Int):Float;
|
||||
@:op(A/B) private static function divF(lhs:UInt, rhs:Float):Float;
|
||||
@:op(A/B) private static function div(lhs:UInt, rhs:UInt):Float;
|
||||
|
||||
@:commutative @:op(A|B) private static function orI(lhs:UInt, rhs:Int):UInt;
|
||||
@:op(A|B) private static function or(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:commutative @:op(A^B) private static function xorI(lhs:UInt, rhs:Int):UInt;
|
||||
@:op(A^B) private static function xor(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:commutative @:op(A&B) private static function andI(lhs:UInt, rhs:Int):UInt;
|
||||
@:op(A&B) private static function and(lhs:UInt, rhs:UInt):UInt;
|
||||
|
||||
@:op(A<<B) private static function shl(lhs:UInt, rhs:Int):UInt;
|
||||
@:op(A>>B) private static inline function shr(lhs:UInt, rhs:Int):UInt return lhs >>> rhs;
|
||||
@:op(A>>>B) private static function ushr(lhs:UInt, rhs:Int):UInt;
|
||||
|
||||
@:op(A>B) private static function gt(lhs:UInt, rhs:UInt):Bool;
|
||||
@:op(A>=B) private static function gte(lhs:UInt, rhs:UInt):Bool;
|
||||
@:op(A<B) private static function lt(lhs:UInt, rhs:UInt):Bool;
|
||||
@:op(A<=B) private static function lte(lhs:UInt, rhs:UInt):Bool;
|
||||
|
||||
@:op(A>B) private static function gtf(lhs:UInt, rhs:Float):Bool;
|
||||
@:op(A>B) private static function gtf2(lhs:Float, rhs:UInt):Bool;
|
||||
@:op(A>=B) private static function gtef(lhs:UInt, rhs:Float):Bool;
|
||||
@:op(A>=B) private static function gtef2(lhs:Float, rhs:UInt):Bool;
|
||||
@:op(A<B) private static function ltf(lhs:UInt, rhs:Float):Bool;
|
||||
@:op(A<B) private static function ltf2(lhs:Float, rhs:UInt):Bool;
|
||||
@:op(A<=B) private static function ltef(lhs:UInt, rhs:Float):Bool;
|
||||
@:op(A<=B) private static function ltef2(lhs:Float, rhs:UInt):Bool;
|
||||
|
||||
@:op(~A) private static function bneg(t:UInt):UInt;
|
||||
|
||||
@:commutative @:op(A == B) private static function equalsInt<T:Int>(a:UInt, b:T):Bool;
|
||||
@:commutative @:op(A != B) private static function notEqualsInt<T:Int>(a:UInt, b:T):Bool;
|
||||
@:commutative @:op(A == B) private static function equalsFloat<T:Float>(a:UInt, b:T):Bool;
|
||||
@:commutative @:op(A != B) private static function notEqualsFloat<T:Float>(a:UInt, b:T):Bool;
|
||||
|
||||
@:op(++A) private function prefixIncrement():UInt;
|
||||
@:op(A++) private function postfixIncrement():UInt;
|
||||
@:op(--A) private function prefixDecrement():UInt;
|
||||
@:op(A--) private function postfixDecrement():UInt;
|
||||
}
|
||||
#else
|
||||
/**
|
||||
The unsigned `Int` type is only defined for Flash and C#.
|
||||
Simulate it for other platforms.
|
||||
|
||||
@see https://haxe.org/manual/types-basic-types.html
|
||||
**/
|
||||
abstract UInt(Int) from Int to Int {
|
||||
|
||||
@:op(A + B) private static inline function add(a:UInt, b:UInt):UInt {
|
||||
return a.toInt() + b.toInt();
|
||||
}
|
||||
|
||||
@:op(A / B) private static inline function div(a:UInt, b:UInt):Float {
|
||||
return a.toFloat() / b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A * B) private static inline function mul(a:UInt, b:UInt):UInt {
|
||||
return a.toInt() * b.toInt();
|
||||
}
|
||||
|
||||
@:op(A - B) private static inline function sub(a:UInt, b:UInt):UInt {
|
||||
return a.toInt() - b.toInt();
|
||||
}
|
||||
|
||||
@:op(A > B) private static #if !js inline #end function gt(a:UInt, b:UInt):Bool {
|
||||
var aNeg = a.toInt() < 0;
|
||||
var bNeg = b.toInt() < 0;
|
||||
return
|
||||
if( aNeg != bNeg ) aNeg;
|
||||
else a.toInt() > b.toInt();
|
||||
}
|
||||
|
||||
@:op(A >= B) private static #if !js inline #end function gte(a:UInt, b:UInt):Bool {
|
||||
var aNeg = a.toInt() < 0;
|
||||
var bNeg = b.toInt() < 0;
|
||||
return
|
||||
if( aNeg != bNeg ) aNeg;
|
||||
else a.toInt() >= b.toInt();
|
||||
}
|
||||
|
||||
@:op(A < B) private static inline function lt(a:UInt, b:UInt):Bool {
|
||||
return gt(b, a);
|
||||
}
|
||||
|
||||
@:op(A <= B) private static inline function lte(a:UInt, b:UInt):Bool {
|
||||
return gte(b, a);
|
||||
}
|
||||
|
||||
@:op(A & B) private static inline function and(a:UInt, b:UInt):UInt {
|
||||
return a.toInt() & b.toInt();
|
||||
}
|
||||
|
||||
@:op(A | B) private static inline function or(a:UInt, b:UInt):UInt {
|
||||
return a.toInt() | b.toInt();
|
||||
}
|
||||
|
||||
@:op(A ^ B) private static inline function xor(a:UInt, b:UInt):UInt {
|
||||
return a.toInt() ^ b.toInt();
|
||||
}
|
||||
|
||||
@:op(A << B) private static inline function shl(a:UInt, b:Int):UInt {
|
||||
return a.toInt() << b;
|
||||
}
|
||||
|
||||
@:op(A >> B) private static inline function shr(a:UInt, b:Int):UInt {
|
||||
return a.toInt() >>> b;
|
||||
}
|
||||
|
||||
@:op(A >>> B) private static inline function ushr(a:UInt, b:Int):UInt {
|
||||
return a.toInt() >>> b;
|
||||
}
|
||||
|
||||
@:op(A % B) private static inline function mod(a:UInt, b:UInt):UInt {
|
||||
return Std.int( a.toFloat() % b.toFloat() );
|
||||
}
|
||||
|
||||
@:commutative @:op(A + B) private static inline function addWithFloat(a:UInt, b:Float):Float {
|
||||
return a.toFloat() + b;
|
||||
}
|
||||
|
||||
@:commutative @:op(A * B) private static inline function mulWithFloat(a:UInt, b:Float):Float {
|
||||
return a.toFloat() * b;
|
||||
}
|
||||
|
||||
@:op(A / B) private static inline function divFloat(a:UInt, b:Float):Float {
|
||||
return a.toFloat() / b;
|
||||
}
|
||||
|
||||
@:op(A / B) private static inline function floatDiv(a:Float, b:UInt):Float {
|
||||
return a / b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A - B) private static inline function subFloat(a:UInt, b:Float):Float {
|
||||
return a.toFloat() - b;
|
||||
}
|
||||
|
||||
@:op(A - B) private static inline function floatSub(a:Float, b:UInt):Float {
|
||||
return a - b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A > B) private static inline function gtFloat(a:UInt, b:Float):Bool {
|
||||
return a.toFloat() > b;
|
||||
}
|
||||
|
||||
@:commutative @:op(A == B) private static inline function equalsInt<T:Int>(a:UInt, b:T):Bool {
|
||||
return a.toInt() == b;
|
||||
}
|
||||
|
||||
@:commutative @:op(A != B) private static inline function notEqualsInt<T:Int>(a:UInt, b:T):Bool {
|
||||
return a.toInt() != b;
|
||||
}
|
||||
|
||||
@:commutative @:op(A == B) private static inline function equalsFloat<T:Float>(a:UInt, b:T):Bool {
|
||||
return a.toFloat() == b;
|
||||
}
|
||||
|
||||
@:commutative @:op(A != B) private static inline function notEqualsFloat<T:Float>(a:UInt, b:T):Bool {
|
||||
return a.toFloat() != b;
|
||||
}
|
||||
|
||||
@:op(A >= B) private static inline function gteFloat(a:UInt, b:Float):Bool {
|
||||
return a.toFloat() >= b;
|
||||
}
|
||||
|
||||
|
||||
@:op(A > B) private static inline function floatGt(a:Float, b:UInt):Bool {
|
||||
return a > b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A >= B) private static inline function floatGte(a:Float, b:UInt):Bool {
|
||||
return a >= b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A < B) private static inline function ltFloat(a:UInt, b:Float):Bool {
|
||||
return a.toFloat() < b;
|
||||
}
|
||||
|
||||
@:op(A <= B) private static inline function lteFloat(a:UInt, b:Float):Bool {
|
||||
return a.toFloat() <= b;
|
||||
}
|
||||
|
||||
@:op(A < B) private static inline function floatLt(a:Float, b:UInt):Bool {
|
||||
return a < b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A <= B) private static inline function floatLte(a:Float, b:UInt):Bool {
|
||||
return a <= b.toFloat();
|
||||
}
|
||||
|
||||
@:op(A % B) private static inline function modFloat(a:UInt, b:Float):Float {
|
||||
return a.toFloat() % b;
|
||||
}
|
||||
|
||||
@:op(A % B) private static inline function floatMod(a:Float, b:UInt):Float {
|
||||
return a % b.toFloat();
|
||||
}
|
||||
|
||||
@:op(~A) private inline function negBits():UInt {
|
||||
return ~this;
|
||||
}
|
||||
|
||||
@:op(++A) private inline function prefixIncrement():UInt {
|
||||
return ++this;
|
||||
}
|
||||
|
||||
@:op(A++) private inline function postfixIncrement():UInt {
|
||||
return this++;
|
||||
}
|
||||
|
||||
@:op(--A) private inline function prefixDecrement():UInt {
|
||||
return --this;
|
||||
}
|
||||
|
||||
@:op(A--) private inline function postfixDecrement():UInt {
|
||||
return this--;
|
||||
}
|
||||
|
||||
// TODO: radix is just defined to deal with doc_gen issues
|
||||
private inline function toString(?radix:Int):String {
|
||||
return Std.string(toFloat());
|
||||
}
|
||||
|
||||
private inline function toInt():Int {
|
||||
return this;
|
||||
}
|
||||
|
||||
@:to private #if (!js || analyzer) inline #end function toFloat():Float {
|
||||
var int = toInt();
|
||||
if (int < 0) {
|
||||
return 4294967296.0 + int;
|
||||
}
|
||||
else {
|
||||
// + 0.0 here to make sure we promote to Float on some platforms
|
||||
// In particular, PHP was having issues when comparing to Int in the == op.
|
||||
return int + 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#end
|
||||
381
hGameTest/node_modules/haxe/downloads/haxe/std/Xml.hx
generated
vendored
Normal file
381
hGameTest/node_modules/haxe/downloads/haxe/std/Xml.hx
generated
vendored
Normal file
@@ -0,0 +1,381 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
Xml node types.
|
||||
|
||||
@see https://haxe.org/manual/std-Xml.html
|
||||
**/
|
||||
@:enum abstract XmlType(Int) {
|
||||
/**
|
||||
Represents an XML element type.
|
||||
**/
|
||||
var Element = 0;
|
||||
/**
|
||||
Represents XML parsed character data type.
|
||||
**/
|
||||
var PCData = 1;
|
||||
/**
|
||||
Represents XML character data type.
|
||||
**/
|
||||
var CData = 2;
|
||||
/**
|
||||
Represents an XML comment type.
|
||||
**/
|
||||
var Comment = 3;
|
||||
/**
|
||||
Represents an XML doctype element type.
|
||||
**/
|
||||
var DocType = 4;
|
||||
/**
|
||||
Represents an XML processing instruction type.
|
||||
**/
|
||||
var ProcessingInstruction = 5;
|
||||
/**
|
||||
Represents an XML document type.
|
||||
**/
|
||||
var Document = 6;
|
||||
}
|
||||
|
||||
/**
|
||||
Cross-platform Xml API.
|
||||
|
||||
@see https://haxe.org/manual/std-Xml.html
|
||||
**/
|
||||
class Xml {
|
||||
/**
|
||||
XML element type.
|
||||
**/
|
||||
static public var Element(default,never) = XmlType.Element;
|
||||
/**
|
||||
XML parsed character data type.
|
||||
**/
|
||||
static public var PCData(default,never) = XmlType.PCData;
|
||||
/**
|
||||
XML character data type.
|
||||
**/
|
||||
static public var CData(default,never) = XmlType.CData;
|
||||
/**
|
||||
XML comment type.
|
||||
**/
|
||||
static public var Comment(default,never) = XmlType.Comment;
|
||||
/**
|
||||
XML doctype element type.
|
||||
**/
|
||||
static public var DocType(default,never) = XmlType.DocType;
|
||||
/**
|
||||
XML processing instruction type.
|
||||
**/
|
||||
static public var ProcessingInstruction(default,never) = XmlType.ProcessingInstruction;
|
||||
/**
|
||||
XML document type.
|
||||
**/
|
||||
static public var Document(default,never) = XmlType.Document;
|
||||
|
||||
/**
|
||||
Parses the String into an Xml document.
|
||||
**/
|
||||
static public function parse( str : String ) : Xml {
|
||||
return haxe.xml.Parser.parse(str);
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the type of the Xml Node. This should be used before
|
||||
accessing other functions since some might raise an exception
|
||||
if the node type is not correct.
|
||||
**/
|
||||
public var nodeType(default, null) : XmlType;
|
||||
|
||||
/**
|
||||
Returns the node name of an Element.
|
||||
**/
|
||||
@:isVar public var nodeName(get, set) : String;
|
||||
|
||||
/**
|
||||
Returns the node value. Only works if the Xml node is not an Element or a Document.
|
||||
**/
|
||||
@:isVar public var nodeValue(get, set) : String;
|
||||
|
||||
/**
|
||||
Returns the parent object in the Xml hierarchy.
|
||||
The parent can be `null`, an Element or a Document.
|
||||
**/
|
||||
public var parent(default, null) : Xml;
|
||||
|
||||
var children:Array<Xml>;
|
||||
var attributeMap:Map<String, String>;
|
||||
|
||||
#if !cppia inline #end function get_nodeName() {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
#if !cppia inline #end function set_nodeName(v) {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
return this.nodeName = v;
|
||||
}
|
||||
|
||||
#if !cppia inline #end function get_nodeValue() {
|
||||
if (nodeType == Document || nodeType == Element) {
|
||||
throw 'Bad node type, unexpected $nodeType';
|
||||
}
|
||||
return nodeValue;
|
||||
}
|
||||
|
||||
#if !cppia inline #end function set_nodeValue(v) {
|
||||
if (nodeType == Document || nodeType == Element) {
|
||||
throw 'Bad node type, unexpected $nodeType';
|
||||
}
|
||||
return this.nodeValue = v;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createElement( name : String ) : Xml {
|
||||
var xml = new Xml(Element);
|
||||
xml.nodeName = name;
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createPCData( data : String ) : Xml {
|
||||
var xml = new Xml(PCData);
|
||||
xml.nodeValue = data;
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createCData( data : String ) : Xml {
|
||||
var xml = new Xml(CData);
|
||||
xml.nodeValue = data;
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createComment( data : String ) : Xml {
|
||||
var xml = new Xml(Comment);
|
||||
xml.nodeValue = data;
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createDocType( data : String ) : Xml {
|
||||
var xml = new Xml(DocType);
|
||||
xml.nodeValue = data;
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createProcessingInstruction( data : String ) : Xml {
|
||||
var xml = new Xml(ProcessingInstruction);
|
||||
xml.nodeValue = data;
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a node of the given type.
|
||||
**/
|
||||
static public function createDocument() : Xml {
|
||||
return new Xml(Document);
|
||||
}
|
||||
|
||||
/**
|
||||
Get the given attribute of an Element node. Returns `null` if not found.
|
||||
Attributes are case-sensitive.
|
||||
**/
|
||||
public function get( att : String ) : String {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
return attributeMap[att];
|
||||
}
|
||||
|
||||
/**
|
||||
Set the given attribute value for an Element node.
|
||||
Attributes are case-sensitive.
|
||||
**/
|
||||
public function set( att : String, value : String ) : Void {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
attributeMap.set(att, value);
|
||||
}
|
||||
|
||||
/**
|
||||
Removes an attribute for an Element node.
|
||||
Attributes are case-sensitive.
|
||||
**/
|
||||
public function remove( att : String ) : Void {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
attributeMap.remove(att);
|
||||
}
|
||||
|
||||
/**
|
||||
Tells if the Element node has a given attribute.
|
||||
Attributes are case-sensitive.
|
||||
**/
|
||||
public function exists( att : String ) : Bool {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
return attributeMap.exists(att);
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an `Iterator` on all the attribute names.
|
||||
**/
|
||||
public function attributes() : Iterator<String> {
|
||||
if (nodeType != Element) {
|
||||
throw 'Bad node type, expected Element but found $nodeType';
|
||||
}
|
||||
return attributeMap.keys();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an iterator of all child nodes.
|
||||
Only works if the current node is an Element or a Document.
|
||||
**/
|
||||
public #if !cppia inline #end function iterator() : Iterator<Xml> {
|
||||
ensureElementType();
|
||||
return children.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an iterator of all child nodes which are Elements.
|
||||
Only works if the current node is an Element or a Document.
|
||||
**/
|
||||
public function elements() : Iterator<Xml> {
|
||||
ensureElementType();
|
||||
var ret = [for (child in children) if (child.nodeType == Element) child];
|
||||
return ret.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an iterator of all child nodes which are Elements with the given nodeName.
|
||||
Only works if the current node is an Element or a Document.
|
||||
**/
|
||||
public function elementsNamed( name : String ) : Iterator<Xml> {
|
||||
ensureElementType();
|
||||
var ret = [for (child in children) if (child.nodeType == Element && child.nodeName == name) child];
|
||||
return ret.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the first child node.
|
||||
**/
|
||||
public #if !cppia inline #end function firstChild() : Xml {
|
||||
ensureElementType();
|
||||
return children[0];
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the first child node which is an Element.
|
||||
**/
|
||||
public function firstElement() : Xml {
|
||||
ensureElementType();
|
||||
for (child in children) {
|
||||
if (child.nodeType == Element) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
Adds a child node to the Document or Element.
|
||||
A child node can only be inside one given parent node, which is indicated by the `parent` property.
|
||||
If the child is already inside this Document or Element, it will be moved to the last position among the Document or Element's children.
|
||||
If the child node was previously inside a different node, it will be moved to this Document or Element.
|
||||
**/
|
||||
public function addChild( x : Xml ) : Void {
|
||||
ensureElementType();
|
||||
if (x.parent != null) {
|
||||
x.parent.removeChild(x);
|
||||
}
|
||||
children.push(x);
|
||||
x.parent = this;
|
||||
}
|
||||
|
||||
/**
|
||||
Removes a child from the Document or Element.
|
||||
Returns true if the child was successfuly removed.
|
||||
**/
|
||||
public function removeChild( x : Xml ) : Bool {
|
||||
ensureElementType();
|
||||
if (children.remove(x)) {
|
||||
x.parent = null;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Inserts a child at the given position among the other childs.
|
||||
A child node can only be inside one given parent node, which is indicated by the [parent] property.
|
||||
If the child is already inside this Document or Element, it will be moved to the new position among the Document or Element's children.
|
||||
If the child node was previously inside a different node, it will be moved to this Document or Element.
|
||||
**/
|
||||
public function insertChild( x : Xml, pos : Int ) : Void {
|
||||
ensureElementType();
|
||||
if (x.parent != null) {
|
||||
x.parent.children.remove(x);
|
||||
}
|
||||
children.insert(pos, x);
|
||||
x.parent = this;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a String representation of the Xml node.
|
||||
**/
|
||||
public #if !cppia inline #end function toString() : String {
|
||||
return haxe.xml.Printer.print(this);
|
||||
}
|
||||
|
||||
function new(nodeType:XmlType) {
|
||||
this.nodeType = nodeType;
|
||||
children = [];
|
||||
attributeMap = new Map();
|
||||
}
|
||||
|
||||
inline function ensureElementType() {
|
||||
if (nodeType != Document && nodeType != Element) {
|
||||
throw 'Bad node type, expected Element or Document but found $nodeType';
|
||||
}
|
||||
}
|
||||
}
|
||||
32
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ArrayBase.hx
generated
vendored
Normal file
32
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ArrayBase.hx
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
extern class ArrayBase
|
||||
{
|
||||
// Length is number of elements
|
||||
public var length(default,null):Int;
|
||||
public function getElementSize():Int;
|
||||
public function getByteCount():Int;
|
||||
public function getBase():RawPointer<Char>;
|
||||
}
|
||||
|
||||
18
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/AtomicInt.hx
generated
vendored
Normal file
18
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/AtomicInt.hx
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package cpp;
|
||||
|
||||
@:scalar @:coreType
|
||||
extern abstract AtomicInt from(Int) to(Int)
|
||||
{
|
||||
// returns true if exchange took place
|
||||
@:native("_hx_atomic_exchange_if")
|
||||
public static function exchangeIf(ioValue:Pointer<AtomicInt>, test:Int, newVal:Int) : Bool;
|
||||
|
||||
// returns value before increment
|
||||
@:native("_hx_atomic_inc")
|
||||
public static function atomicInc(ioValue:Pointer<AtomicInt>) : Int;
|
||||
|
||||
// returns value before decrement
|
||||
@:native("_hx_atomic_dec")
|
||||
public static function atomicDec(ioValue:Pointer<AtomicInt>) : Int;
|
||||
}
|
||||
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/AutoCast.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/AutoCast.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
extern class AutoCast { }
|
||||
58
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Callable.hx
generated
vendored
Normal file
58
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Callable.hx
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
|
||||
@:noPackageRestrict @:callable
|
||||
typedef CallableData<T> = T;
|
||||
|
||||
// The generator intercepts this type and converts it to a cpp.Function<T> on cpp
|
||||
@:noPackageRestrict @:callable
|
||||
#if cpp extern #end
|
||||
abstract Callable<T>( CallableData<T> )
|
||||
{
|
||||
inline public function new(inValue:T) this = inValue;
|
||||
public var call(get,never):CallableData<T>;
|
||||
inline function get_call():CallableData<T> return this;
|
||||
|
||||
#if cpp
|
||||
@:from
|
||||
inline static public function fromFunction<F>( func:Function<F,cpp.abi.Abi> ) : Callable<F>
|
||||
return new Callable<F>(cast func);
|
||||
@:to
|
||||
inline public function toFunction() : Function<T,cpp.abi.Abi> return cast this;
|
||||
|
||||
|
||||
inline public static function getProcAddress<T,ABI:cpp.abi.Abi>(inModule:String, inFunction:String) : Function<T,ABI>
|
||||
return Function.getProcAddress(inModule, inFunction);
|
||||
|
||||
inline public static function fromStaticFunction<T>(inStaticFunction:T) : Callable<T>
|
||||
return Function.fromStaticFunction(inStaticFunction);
|
||||
|
||||
inline public function lt(inOther:Callable<T>):Bool return toFunction().lt(inOther.toFunction());
|
||||
inline public function leq(inOther:Callable<T>):Bool return toFunction().leq(inOther.toFunction());
|
||||
inline public function gt(inOther:Callable<T>):Bool return toFunction().gt(inOther.toFunction());
|
||||
inline public function geq(inOther:Callable<T>):Bool return toFunction().geq(inOther.toFunction());
|
||||
#end
|
||||
}
|
||||
|
||||
|
||||
34
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/CastCharStar.hx
generated
vendored
Normal file
34
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/CastCharStar.hx
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
abstract CastCharStar( RawPointer<Char> ) to(RawPointer<Char>)
|
||||
{
|
||||
inline function new(s:String) this = cast untyped s.__s;
|
||||
|
||||
@:from
|
||||
static public inline function fromString(s:String) return new CastCharStar(s);
|
||||
|
||||
@:to
|
||||
public inline function toPointer() return this;
|
||||
}
|
||||
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Char.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Char.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Char from Int to Int {}
|
||||
37
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ConstCharStar.hx
generated
vendored
Normal file
37
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ConstCharStar.hx
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:extern abstract ConstCharStar( RawConstPointer<Char> ) to(RawConstPointer<Char>)
|
||||
{
|
||||
inline function new(s:String) this = untyped s.__s;
|
||||
|
||||
@:from
|
||||
static public inline function fromString(s:String) return new ConstCharStar(s);
|
||||
|
||||
@:to @:extern
|
||||
public inline function toString():String return new String(untyped this);
|
||||
|
||||
@:to @:extern
|
||||
public inline function toPointer() return this;
|
||||
}
|
||||
|
||||
70
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ConstPointer.hx
generated
vendored
Normal file
70
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ConstPointer.hx
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:include("cpp/Pointer.h") @:native("cpp.Pointer") @:analyzer(as_var)
|
||||
extern class ConstPointer<T>
|
||||
{
|
||||
// ptr actually returns the pointer - not strictly a 'T' - for pointers to smart pointers
|
||||
// Use value or ref to get dereferenced value
|
||||
public var ptr:Star<T>;
|
||||
|
||||
public var value(get,never):T;
|
||||
|
||||
// Typecast to non-const
|
||||
public var raw(get,never):RawPointer<T>;
|
||||
|
||||
// const version
|
||||
public var constRaw(get,never):RawConstPointer<T>;
|
||||
|
||||
public function get_value() : Reference<T>;
|
||||
|
||||
public function get_constRaw() : RawConstPointer<T>;
|
||||
public function get_raw() : RawPointer<T>;
|
||||
|
||||
|
||||
public function lt(inOther:ConstPointer<T>):Bool;
|
||||
public function leq(inOther:ConstPointer<T>):Bool;
|
||||
public function gt(inOther:ConstPointer<T>):Bool;
|
||||
public function geq(inOther:ConstPointer<T>):Bool;
|
||||
|
||||
public function setRaw<O>(ptr:RawPointer<O>) : Void;
|
||||
|
||||
public static function fromRaw<T>(ptr:RawConstPointer<T>) : ConstPointer<T>;
|
||||
|
||||
|
||||
public static function fromPointer<T>(inNativePointer:Dynamic) : ConstPointer<T>;
|
||||
|
||||
public function reinterpret<Other>():Pointer<Other>;
|
||||
|
||||
public function rawCast<Other>():RawPointer<Other>;
|
||||
|
||||
public function at(inIndex:Int):Reference<T>;
|
||||
|
||||
public function inc():ConstPointer<T>;
|
||||
public function dec():ConstPointer<T>;
|
||||
public function postIncVal():Reference<T>;
|
||||
public function incBy(inT:Int):ConstPointer<T>;
|
||||
public function add(inT:Int):ConstPointer<T>;
|
||||
|
||||
}
|
||||
|
||||
27
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ConstStar.hx
generated
vendored
Normal file
27
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ConstStar.hx
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
// Allows haxe to type result correctly, and hxcpp can recognise this use the correct type
|
||||
typedef ConstStar<T> = T;
|
||||
|
||||
|
||||
31
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/EnumBase.hx
generated
vendored
Normal file
31
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/EnumBase.hx
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
package cpp;
|
||||
|
||||
@:native("hx.EnumBase")
|
||||
extern class EnumBase
|
||||
{
|
||||
#if (hxcpp_api_level >= 330)
|
||||
public function _hx_getIndex():Int;
|
||||
public function _hx_getTag():String;
|
||||
public function _hx_getParamCount():Int;
|
||||
public function _hx_getParamI(inIndex:Int):Dynamic;
|
||||
public function _hx_getParameters():Array<Dynamic>;
|
||||
|
||||
inline public function getIndex():Int return _hx_getIndex();
|
||||
inline public function getTag():String return _hx_getTag();
|
||||
inline public function getParamCount():Int return _hx_getParamCount();
|
||||
inline public function getParamI(inIndex:Int):Dynamic return _hx_getParamI(inIndex);
|
||||
inline public function getParameters():Array<Dynamic> return _hx_getParameters();
|
||||
#else
|
||||
public function __EnumParams():Array<Dynamic>;
|
||||
public function __Tag():String;
|
||||
public function __Index():Int;
|
||||
|
||||
inline public function _hx_getIndex():Int return untyped __Index();
|
||||
inline public function _hx_getTag():String return untyped __Tag();
|
||||
inline public function _hx_getParamCount():Int return untyped __EnumParams()==null ? 0 : __EnumParams().length;
|
||||
inline public function _hx_getParamI(inIndex:Int):Dynamic return untyped __EnumParams()[inIndex];
|
||||
inline public function _hx_getParameters():Array<Dynamic> return __EnumParams()==null ? [] : __EnumParams();
|
||||
|
||||
#end
|
||||
}
|
||||
|
||||
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/FILE.hx
generated
vendored
Normal file
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/FILE.hx
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package cpp;
|
||||
|
||||
@:include("stdio.h")
|
||||
@:native(" ::cpp::Pointer<FILE>")
|
||||
extern class FILE { }
|
||||
|
||||
29
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/FastIterator.hx
generated
vendored
Normal file
29
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/FastIterator.hx
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
extern class FastIterator<T>
|
||||
{
|
||||
public function hasNext():Bool;
|
||||
public function next():T;
|
||||
}
|
||||
|
||||
14
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Finalizable.hx
generated
vendored
Normal file
14
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Finalizable.hx
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
package cpp;
|
||||
|
||||
// This is just a helper class. You do not actually need to inherit from this to use
|
||||
// NativeGc.addFinalizable(this,inPin), you just need a function called "finalize"
|
||||
class Finalizable
|
||||
{
|
||||
public function new(inPin = false)
|
||||
{
|
||||
NativeGc.addFinalizable(this,inPin);
|
||||
}
|
||||
|
||||
public function finalize():Void { }
|
||||
}
|
||||
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Float32.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Float32.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Float32 from Float to Float {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Float64.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Float64.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Float64 from Float to Float {}
|
||||
59
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Function.hx
generated
vendored
Normal file
59
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Function.hx
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:callable
|
||||
typedef FunctionData<T,ABI> = T;
|
||||
|
||||
|
||||
@:include("cpp/Pointer.h") @:callable
|
||||
extern abstract Function<T, ABI:cpp.abi.Abi>( FunctionData<T,ABI> )
|
||||
{
|
||||
inline public function new(inValue:T) this = inValue;
|
||||
|
||||
// Legacy Api
|
||||
public var call(get,never):FunctionData<T,ABI>;
|
||||
inline function get_call():FunctionData<T,ABI> return this;
|
||||
|
||||
|
||||
@:native("::cpp::Function_obj::getProcAddress")
|
||||
@:extern static function nativeGetProcAddress<T,ABI:cpp.abi.Abi>(inModule:String, inFunction:String) : AutoCast return null;
|
||||
inline public static function getProcAddress<T,ABI:cpp.abi.Abi>(inModule:String, inFunction:String) : Function<T,ABI>
|
||||
{
|
||||
return cast nativeGetProcAddress(inModule, inFunction);
|
||||
}
|
||||
|
||||
@:native("::cpp::Function_obj::fromStaticFunction")
|
||||
@:extern static function nativeFromStaticFunction<T>(inStaticFunction:T) : AutoCast return null;
|
||||
inline public static function fromStaticFunction<T>(inStaticFunction:T) : Callable<T>
|
||||
{
|
||||
return cast nativeFromStaticFunction(inStaticFunction);
|
||||
}
|
||||
|
||||
@:extern public function lt(inOther:Function<T,ABI>):Bool return false;
|
||||
@:extern public function leq(inOther:Function<T,ABI>):Bool return false;
|
||||
@:extern public function gt(inOther:Function<T,ABI>):Bool return false;
|
||||
@:extern public function geq(inOther:Function<T,ABI>):Bool return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int16.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int16.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Int16 from Int to Int {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int32.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int32.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Int32 from Int to Int {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int64.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int64.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Int64 from Int to Int {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int8.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Int8.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract Int8 from Int to Int {}
|
||||
152
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Lib.hx
generated
vendored
Normal file
152
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Lib.hx
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
/**
|
||||
Platform-specific Cpp Library. Provides some platform-specific functions
|
||||
for the C++ target, such as conversion from Haxe types to native types
|
||||
and vice-versa.
|
||||
**/
|
||||
class Lib {
|
||||
|
||||
/**
|
||||
Load and return a Cpp primitive from a DLL library.
|
||||
**/
|
||||
public static function load( lib : String, prim : String, nargs : Int ) : Dynamic {
|
||||
#if (iphone || emscripten)
|
||||
return loadLazy(lib,prim,nargs);
|
||||
#else
|
||||
return untyped __global__.__loadprim(lib,prim,nargs);
|
||||
#end
|
||||
}
|
||||
|
||||
/**
|
||||
Unloaded all dynamic libraries in reverse order of loading.
|
||||
Returns the number of libraries unloaded.
|
||||
**/
|
||||
public static function unloadAllLibraries() : Int {
|
||||
return untyped __global__.__hxcpp_unload_all_libraries();
|
||||
}
|
||||
|
||||
public static function _loadPrime( lib : String, prim : String, signature : String, quietFail = false ) : Dynamic {
|
||||
var factory:Callable< ConstCharStar -> Object > =
|
||||
untyped __global__.__hxcpp_cast_get_proc_address(lib, prim + "__prime", quietFail);
|
||||
if (factory!=null)
|
||||
{
|
||||
var func:Dynamic = factory.call(signature);
|
||||
if (func==null && !quietFail)
|
||||
throw '$prim does not have signature $signature';
|
||||
return func;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Tries to load, and always returns a valid function, but the function may throw
|
||||
if called.
|
||||
**/
|
||||
public static function loadLazy(lib,prim,nargs) : Dynamic {
|
||||
try {
|
||||
return untyped __global__.__loadprim(lib,prim,nargs);
|
||||
} catch( e : Dynamic ) {
|
||||
switch(nargs) {
|
||||
case 0 : return function() { throw e; };
|
||||
case 2 : return function(_1,_2) { throw e; };
|
||||
case 3 : return function(_1,_2,_3) { throw e; };
|
||||
case 4 : return function(_1,_2,_3,_4) { throw e; };
|
||||
case 5 : return function(_1,_2,_3,_4,_5) { throw e; };
|
||||
default : return function(_1) { throw e; };
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@:extern @:noDebug @:native("HX_STACK_DO_RETHROW")
|
||||
static function do_rethrow(inExp:Dynamic) { throw inExp; }
|
||||
|
||||
@:noDebug #if(!cppia) inline #end
|
||||
public static function rethrow(inExp:Dynamic) { do_rethrow(inExp); }
|
||||
|
||||
public static function stringReference(inBytes:haxe.io.Bytes) : String
|
||||
{
|
||||
var result:String = "";
|
||||
untyped __global__.__hxcpp_string_of_bytes(inBytes.b, result, 0, 0, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static function pushDllSearchPath(inPath:String) : Void
|
||||
untyped __global__.__hxcpp_push_dll_path(inPath);
|
||||
|
||||
public static function getDllExtension() : String
|
||||
return untyped __global__.__hxcpp_get_dll_extension();
|
||||
|
||||
public static function getBinDirectory() : String
|
||||
return untyped __global__.__hxcpp_get_bin_dir();
|
||||
|
||||
/**
|
||||
Returns bytes referencing the content of a string.
|
||||
Use with extreme caution - changing constant strings will crash.
|
||||
Changing one string can cause others to change unexpectedly.
|
||||
Only really safe if you are using it read-only or if it comes from stringReference above
|
||||
**/
|
||||
public inline static function bytesReference( s : String ) : haxe.io.Bytes {
|
||||
var bytes = new haxe.io.BytesData();
|
||||
untyped bytes.__unsafeStringReference(s);
|
||||
return haxe.io.Bytes.ofData(bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
Print the specified value on the default output.
|
||||
**/
|
||||
public static function print( v : Dynamic ) : Void {
|
||||
untyped __global__.__hxcpp_print(v);
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to make porting from neko to cpp easy.
|
||||
It does not need to do anything because the c-code can work with any Dynamic
|
||||
**/
|
||||
public static function haxeToNeko( v : Dynamic ) : Dynamic {
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to make porting from neko to cpp easy.
|
||||
It does not need to do anything because the c-code can work with any Dynamic
|
||||
**/
|
||||
public static function nekoToHaxe( v : Dynamic ) : Dynamic {
|
||||
return v;
|
||||
}
|
||||
/**
|
||||
Print the specified value on the default output followed by a newline character.
|
||||
**/
|
||||
public static function println( v : Dynamic ) : Void {
|
||||
untyped __global__.__hxcpp_println(v);
|
||||
}
|
||||
|
||||
public static function setFloatFormat(inFormat:String):Void
|
||||
{
|
||||
untyped __global__.__hxcpp_set_float_format(inFormat);
|
||||
}
|
||||
|
||||
}
|
||||
12
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeArc.hx
generated
vendored
Normal file
12
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeArc.hx
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package cpp;
|
||||
|
||||
extern class NativeArc
|
||||
{
|
||||
@:native("(__bridge_transfer id)")
|
||||
public static function _bridgeTransfer<T>(ptr:cpp.RawPointer<cpp.Void> ):cpp.RawPointer<T>;
|
||||
|
||||
public static inline function bridgeTransfer<T>(ptr:cpp.RawPointer<cpp.Void> ):T return cast _bridgeTransfer(ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
105
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeArray.hx
generated
vendored
Normal file
105
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeArray.hx
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
extern class NativeArray {
|
||||
|
||||
#if cppia
|
||||
public static inline function create<T>(length:Int):Array<T>
|
||||
{
|
||||
var result = new Array<T>();
|
||||
NativeArray.setSize(result,length);
|
||||
return result;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@:native("_hx_create_array_length")
|
||||
public static function create<T>(length:Int):Array<T>;
|
||||
#end
|
||||
|
||||
public static inline function blit<T>( ioDestArray:Array<T>,
|
||||
inDestElement:Int, inSourceArray:Array<T>,
|
||||
inSourceElement:Int, inElementCount:Int ): Void {
|
||||
untyped ioDestArray.blit(inDestElement, inSourceArray, inSourceElement, inElementCount);
|
||||
};
|
||||
|
||||
public static inline function getBase( inArray:Array<Dynamic> ) : ArrayBase {
|
||||
return untyped inArray;
|
||||
}
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function reserve<T>( inArray:Array<T>,inElements:Int ) : Void { }
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function capacity<T>( inArray:Array<T> ) : Int { }
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function getElementSize<T>( inArray:Array<T> ) : Int { }
|
||||
|
||||
public static inline function address<T>( inArray:Array<T>,inIndex:Int ) : Pointer<T> {
|
||||
return Pointer.arrayElem(inArray,inIndex);
|
||||
}
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function setData<T>( inArray:Array<T>,inData:Pointer<T>,inElementCount:Int ) : Void { }
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function setUnmanagedData<T>( inArray:Array<T>,inData:ConstPointer<T>,inElementCount:Int ) : Void { }
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function zero<T>( ioDestArray:Array<T>, ?inFirst:Int, ?inElements:Int ) : Void { };
|
||||
|
||||
@:nativeStaticExtension
|
||||
public static function memcmp<T>( inArrayA:Array<T>, inArrayB:Array<T>) : Int { }
|
||||
|
||||
@:native("_hx_reslove_virtual_array")
|
||||
public static function resolveVirtualArray( inArray:Array<Dynamic>) : Dynamic { }
|
||||
|
||||
|
||||
#if cppia
|
||||
public static inline function unsafeGet<T>( inDestArray:Array<T>, inIndex:Int) : T {
|
||||
return untyped inDestArray.__unsafe_get(inIndex);
|
||||
}
|
||||
|
||||
public static inline function unsafeSet<T>( ioDestArray:Array<T>, inIndex:Int, inValue:T) : T {
|
||||
return untyped ioDestArray.__unsafe_set(inIndex,inValue);
|
||||
}
|
||||
|
||||
public static inline function setSize<T>( ioArray:Array<T>, inSize:Int) : Array<T> {
|
||||
return untyped ioArray.__SetSizeExact(inSize);
|
||||
}
|
||||
|
||||
#else
|
||||
@:native("_hx_array_unsafe_get")
|
||||
public static function unsafeGet<T>( inDestArray:Array<T>, inIndex:Int) : T { return untyped null; }
|
||||
|
||||
@:native("_hx_array_unsafe_set")
|
||||
public static inline function unsafeSet<T>( ioDestArray:Array<T>, inIndex:Int, inValue:T) : T {
|
||||
return untyped ioDestArray.__unsafe_set(inIndex,inValue);
|
||||
}
|
||||
|
||||
@:native("_hx_array_set_size_exact")
|
||||
public static function setSize<T>( ioArray:Array<T>, inSize:Int) : Array<T> return null;
|
||||
#end
|
||||
|
||||
}
|
||||
64
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeFile.hx
generated
vendored
Normal file
64
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeFile.hx
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
package cpp;
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/std/Build.xml"/>')
|
||||
extern class NativeFile
|
||||
{
|
||||
@:extern @:native("_hx_std_file_open")
|
||||
public static function file_open(fname:String,r:String) : Dynamic return null;
|
||||
|
||||
@:extern @:native("_hx_std_file_close")
|
||||
public static function file_close(handle:Dynamic) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_write")
|
||||
public static function file_write(handle:Dynamic,s:haxe.io.BytesData,p:Int,n:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_write_char")
|
||||
public static function file_write_char(handle:Dynamic,c:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_read")
|
||||
public static function file_read(handle:Dynamic,s:haxe.io.BytesData,p:Int,n:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_read_char")
|
||||
public static function file_read_char(handle:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_seek")
|
||||
public static function file_seek(handle:Dynamic,pos:Int,kind:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_tell")
|
||||
public static function file_tell(handle:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_eof")
|
||||
public static function file_eof(handle:Dynamic) : Bool return false;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_flush")
|
||||
public static function file_flush(handle:Dynamic) : Void return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_contents_string")
|
||||
public static function file_contents_string(name:String) : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_contents_bytes")
|
||||
public static function file_contents_bytes(name:String) : haxe.io.BytesData return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_stdin")
|
||||
public static function file_stdin() : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_stdout")
|
||||
public static function file_stdout() : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_stderr")
|
||||
public static function file_stderr() : Dynamic return null;
|
||||
|
||||
}
|
||||
59
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeGc.hx
generated
vendored
Normal file
59
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeGc.hx
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
package cpp;
|
||||
|
||||
extern class NativeGc
|
||||
{
|
||||
@:native("__hxcpp_gc_mem_info")
|
||||
static public function memInfo(inWhatInfo:Int) : Float return 0.0;
|
||||
|
||||
@:native("_hx_allocate_extended") @:templatedCall
|
||||
static public function allocateExtended<T>(cls:Class<T>, size:Int) : T return null;
|
||||
|
||||
@:native("_hx_add_finalizable")
|
||||
public static function addFinalizable( instance:{ function finalize():Void; }, inPin:Bool ): Void {}
|
||||
|
||||
@:native("hx::InternalNew")
|
||||
public static function allocGcBytesRaw( inBytes : Int, isContainer:Bool ): RawPointer<cpp.Void> return null;
|
||||
|
||||
inline public static function allocGcBytes( inBytes : Int ): Pointer<cpp.Void>
|
||||
{
|
||||
return Pointer.fromRaw( allocGcBytesRaw(inBytes, false) );
|
||||
}
|
||||
|
||||
|
||||
@:native("__hxcpp_enable") @:extern
|
||||
static public function enable(inEnable:Bool) : Void { }
|
||||
|
||||
@:native("__hxcpp_collect") @:extern
|
||||
static public function run(major:Bool) : Void { }
|
||||
|
||||
@:native("__hxcpp_gc_compact") @:extern
|
||||
static public function compact() : Void { }
|
||||
|
||||
@:native("__hxcpp_gc_trace") @:extern
|
||||
static public function nativeTrace(sought:Class<Dynamic>,printInstances:Bool) : Int return 0;
|
||||
|
||||
@:native("__hxcpp_gc_do_not_kill") @:extern
|
||||
static public function doNotKill(inObject:Dynamic) : Void { }
|
||||
|
||||
@:native("__hxcpp_get_next_zombie") @:extern
|
||||
static public function getNextZombie() : Dynamic return null;
|
||||
|
||||
@:native("__hxcpp_gc_safe_point") @:extern
|
||||
static public function safePoint() : Void { }
|
||||
|
||||
@:native("__hxcpp_enter_gc_free_zone") @:extern
|
||||
static public function enterGCFreeZone() : Void { }
|
||||
|
||||
@:native("__hxcpp_exit_gc_free_zone") @:extern
|
||||
static public function exitGCFreeZone() : Void { }
|
||||
|
||||
@:native("__hxcpp_set_minimum_free_space") @:extern
|
||||
static public function setMinimumFreeSpace(inBytes:Int) : Void { }
|
||||
|
||||
@:native("__hxcpp_set_target_free_space_percentage") @:extern
|
||||
static public function setTargetFreeSpacePercentage(inPercentage:Int) : Void { }
|
||||
|
||||
@:native("__hxcpp_set_minimum_working_memory") @:extern
|
||||
static public function setMinimumWorkingMemory(inBytes:Int) : Void { }
|
||||
}
|
||||
|
||||
31
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeMath.hx
generated
vendored
Normal file
31
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeMath.hx
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
package cpp;
|
||||
|
||||
@:noPackageRestrict
|
||||
extern class NativeMath
|
||||
{
|
||||
#if (cpp && !cppia)
|
||||
@:native("_hx_idiv")
|
||||
public static function idiv(num:Int,denom:Int):Int return 0;
|
||||
@:native("_hx_imod")
|
||||
public static function imod(num:Int,denom:Int):Int return 0;
|
||||
@:native("_hx_cast_int")
|
||||
public static function castInt(f:Float):Int return 0;
|
||||
@:native("_hx_fast_floor")
|
||||
public static function fastInt(f:Float):Int return 0;
|
||||
|
||||
#else
|
||||
|
||||
public static inline function imod(num:Int,denom:Int):Int
|
||||
return num%denom;
|
||||
|
||||
public static inline function idiv(num:Int,denom:Int):Int
|
||||
return Std.int(num/denom);
|
||||
|
||||
public static inline function castInt(f:Float):Int
|
||||
return Std.int(f);
|
||||
|
||||
public static inline function fastInt(f:Float):Int
|
||||
return Std.int(f);
|
||||
|
||||
#end
|
||||
}
|
||||
40
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeProcess.hx
generated
vendored
Normal file
40
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeProcess.hx
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package cpp;
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/std/Build.xml"/>')
|
||||
extern class NativeProcess
|
||||
{
|
||||
|
||||
@:extern @:native("_hx_std_process_run")
|
||||
public static function process_run(cmd:String,vargs:Array<String>) : Dynamic return null;
|
||||
|
||||
@:extern @:native("_hx_std_process_run")
|
||||
public static function process_run_with_show(cmd:String,vargs:Array<String>,inShow:Int) : Dynamic return null;
|
||||
|
||||
@:extern @:native("_hx_std_process_stdout_read")
|
||||
public static function process_stdout_read(handle:Dynamic,buf:haxe.io.BytesData,pos:Int,len:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_process_stderr_read")
|
||||
public static function process_stderr_read(handle:Dynamic,buf:haxe.io.BytesData,pos:Int,len:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_process_stdin_write")
|
||||
public static function process_stdin_write(handle:Dynamic,buf:haxe.io.BytesData,pos:Int,len:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_process_stdin_close")
|
||||
public static function process_stdin_close(handle:Dynamic) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_process_exit")
|
||||
public static function process_exit(handle:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_process_pid")
|
||||
public static function process_pid(handle:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_process_close")
|
||||
public static function process_close(handle:Dynamic) : Void { };
|
||||
|
||||
}
|
||||
23
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeRandom.hx
generated
vendored
Normal file
23
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeRandom.hx
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package cpp;
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/std/Build.xml"/>')
|
||||
extern class NativeRandom
|
||||
{
|
||||
|
||||
@:extern @:native("_hx_std_random_new")
|
||||
public static function random_new() : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_random_set_seed")
|
||||
public static function random_set_seed(handle:Dynamic,v:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_random_int")
|
||||
public static function random_int(handle:Dynamic,max:Int) : Int return 0;
|
||||
|
||||
@:extern @:native("_hx_std_random_float")
|
||||
public static function random_float(handle:Dynamic) : Float return 0.0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
155
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeSocket.hx
generated
vendored
Normal file
155
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeSocket.hx
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
package cpp;
|
||||
|
||||
import sys.net.Socket;
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/std/Build.xml"/>')
|
||||
extern class NativeSocket
|
||||
{
|
||||
@:extern @:native("_hx_std_socket_init")
|
||||
public static function socket_init() : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_new")
|
||||
public static function socket_new(udp:Bool) : Dynamic return null;
|
||||
|
||||
@:extern @:native("_hx_std_socket_new")
|
||||
public static function socket_new_ip(udp:Bool,ipv6:Bool) : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_close")
|
||||
public static function socket_close(handle:Dynamic) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_bind")
|
||||
public static function socket_bind(o:Dynamic,host:Int,port:Int) : Void { }
|
||||
|
||||
@:extern @:native("_hx_std_socket_bind_ipv6")
|
||||
public static function socket_bind_ipv6(o:Dynamic,host:haxe.io.BytesData,port:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_send_char")
|
||||
public static function socket_send_char(o:Dynamic,c:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_send")
|
||||
public static function socket_send(o:Dynamic,buf:haxe.io.BytesData,p:Int,l:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_recv")
|
||||
public static function socket_recv(o:Dynamic,buf:haxe.io.BytesData,p:Int,l:Int) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_recv_char")
|
||||
public static function socket_recv_char(o:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_write")
|
||||
public static function socket_write(o:Dynamic,buf:haxe.io.BytesData) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_read")
|
||||
public static function socket_read(o:Dynamic) : haxe.io.BytesData return null;
|
||||
|
||||
@:extern @:native("_hx_std_host_resolve_ipv6")
|
||||
public static function host_resolve_ipv6(host:String) : haxe.io.BytesData return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_host_resolve")
|
||||
public static function host_resolve(host:String) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_host_to_string")
|
||||
public static function host_to_string(ip:Int) : String return null;
|
||||
|
||||
@:extern @:native("_hx_std_host_to_string_ipv6")
|
||||
public static function host_to_string_ipv6(ipv6:haxe.io.BytesData) : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_host_reverse")
|
||||
public static function host_reverse(host:Int) : String return null;
|
||||
|
||||
@:extern @:native("_hx_std_host_reverse_ipv6")
|
||||
public static function host_reverse_ipv6(ipv6:haxe.io.BytesData) : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_host_local")
|
||||
public static function host_local() : String return null;
|
||||
|
||||
inline public static function host_local_ipv6() : String return "::1";
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_connect")
|
||||
public static function socket_connect(o:Dynamic,host:Int,port:Int) : Void { }
|
||||
|
||||
@:extern @:native("_hx_std_socket_connect_ipv6")
|
||||
public static function socket_connect_ipv6(o:Dynamic,host:haxe.io.BytesData,port:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_listen")
|
||||
public static function socket_listen(o:Dynamic,n:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_select")
|
||||
public static function socket_select(rs:Array<Dynamic>,ws:Array<Dynamic>,es:Array<Dynamic>,timeout:Dynamic) : Array<Dynamic> return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_fast_select")
|
||||
public static function socket_fast_select(rs:Array<Dynamic>,ws:Array<Dynamic>,es:Array<Dynamic>,timeout:Dynamic) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_accept")
|
||||
public static function socket_accept(o:Dynamic) : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_peer")
|
||||
public static function socket_peer(o:Dynamic) : Array<Int> return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_host")
|
||||
public static function socket_host(o:Dynamic) : Array<Int> return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_set_timeout")
|
||||
public static function socket_set_timeout(o:Dynamic,t:Dynamic) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_shutdown")
|
||||
public static function socket_shutdown(o:Dynamic,r:Bool,w:Bool) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_set_blocking")
|
||||
public static function socket_set_blocking(o:Dynamic,b:Bool) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_set_fast_send")
|
||||
public static function socket_set_fast_send(o:Dynamic,b:Bool) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_poll_alloc")
|
||||
public static function socket_poll_alloc(nsocks:Int) : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_poll_prepare")
|
||||
public static function socket_poll_prepare(pdata:Dynamic,rsocks:Array<Socket>,wsocks:Array<Socket>) : Array< Array<Int> > return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_poll_events")
|
||||
public static function socket_poll_events(pdata:Dynamic,timeout:Float) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_poll")
|
||||
public static function socket_poll(socks:Array<Socket>,pdata:Dynamic,timeout:Float) : Array<Socket> return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_send_to")
|
||||
public static function socket_send_to(o:Dynamic,buf:haxe.io.BytesData,p:Int,l:Int,inAddr:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_socket_recv_from")
|
||||
public static function socket_recv_from(o:Dynamic,buf:haxe.io.BytesData,p:Int,l:Int,outAddr:Dynamic) : Int return 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
114
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeSsl.hx
generated
vendored
Normal file
114
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeSsl.hx
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
package cpp;
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/ssl/Build.xml"/>')
|
||||
extern class NativeSsl
|
||||
{
|
||||
@:extern @:native("_hx_ssl_new")
|
||||
public static function ssl_new( conf : Dynamic ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_close")
|
||||
public static function ssl_close( ctx : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_handshake")
|
||||
public static function ssl_handshake( ctx : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_set_socket")
|
||||
public static function ssl_set_socket( ctx : Dynamic, socket : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_set_hostname")
|
||||
public static function ssl_set_hostname( ctx : Dynamic, hostname : String ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_get_peer_certificate")
|
||||
public static function ssl_get_peer_certificate( ctx : Dynamic ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_get_verify_result")
|
||||
public static function ssl_get_verify_result( ctx : Dynamic ) : Bool { }
|
||||
|
||||
@:extern @:native("_hx_ssl_send_char")
|
||||
public static function ssl_send_char( ctx : Dynamic, char : Int ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_send")
|
||||
public static function ssl_send( ctx : Dynamic, buf : haxe.io.BytesData, p : Int, l : Int ) : Int { }
|
||||
|
||||
@:extern @:native("_hx_ssl_write")
|
||||
public static function ssl_write( ctx : Dynamic, data : haxe.io.BytesData ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_recv_char")
|
||||
public static function ssl_recv_char( ctx : Dynamic ) : Int { }
|
||||
|
||||
@:extern @:native("_hx_ssl_recv")
|
||||
public static function ssl_recv( ctx : Dynamic, buf : haxe.io.BytesData, p : Int, l : Int ) : Int { }
|
||||
|
||||
@:extern @:native("_hx_ssl_read")
|
||||
public static function ssl_read( ctx : Dynamic ) : haxe.io.BytesData { }
|
||||
|
||||
@:extern @:native("_hx_ssl_conf_new")
|
||||
public static function conf_new( server : Bool ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_conf_close")
|
||||
public static function conf_close( conf : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_conf_set_ca")
|
||||
public static function conf_set_ca( conf : Dynamic, cert : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_conf_set_verify")
|
||||
public static function conf_set_verify( conf : Dynamic, mode : Int ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_conf_set_cert")
|
||||
public static function conf_set_cert( conf : Dynamic, cert : Dynamic, pkey : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_conf_set_servername_callback")
|
||||
public static function conf_set_servername_callback( conf : Dynamic, cb : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_load_defaults")
|
||||
public static function cert_load_defaults() : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_load_file")
|
||||
public static function cert_load_file( file : String ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_load_path")
|
||||
public static function cert_load_path( path : String ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_get_subject")
|
||||
public static function cert_get_subject( cert : Dynamic, field : String ) : String { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_get_issuer")
|
||||
public static function cert_get_issuer( cert : Dynamic, field : String ) : String { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_get_altnames")
|
||||
public static function cert_get_altnames( cert : Dynamic ) : Array<String> { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_get_notbefore")
|
||||
public static function cert_get_notbefore( cert : Dynamic ) : Array<Int> { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_get_notafter")
|
||||
public static function cert_get_notafter( cert : Dynamic ) : Array<Int> { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_get_next")
|
||||
public static function cert_get_next( cert : Dynamic ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_add_pem")
|
||||
public static function cert_add_pem( cert : Dynamic, data : String ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_cert_add_der")
|
||||
public static function cert_add_der( cert : Dynamic, data : haxe.io.BytesData ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_key_from_der")
|
||||
public static function key_from_der( data : haxe.io.BytesData, pub : Bool ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_key_from_pem")
|
||||
public static function key_from_pem( data : String, pub : Bool, pass : String ) : Dynamic { }
|
||||
|
||||
@:extern @:native("_hx_ssl_dgst_make")
|
||||
public static function dgst_make( data : haxe.io.BytesData, alg : String ) : haxe.io.BytesData { }
|
||||
|
||||
@:extern @:native("_hx_ssl_dgst_sign")
|
||||
public static function dgst_sign( data : haxe.io.BytesData, key : Dynamic, alg : String ) : haxe.io.BytesData { }
|
||||
|
||||
@:extern @:native("_hx_ssl_dgst_verify")
|
||||
public static function dgst_verify( data : haxe.io.BytesData, sign : haxe.io.BytesData, key : Dynamic, alg : String ) : Bool { }
|
||||
|
||||
@:extern @:native("_hx_ssl_init")
|
||||
public static function init() : Void { }
|
||||
|
||||
}
|
||||
62
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeString.hx
generated
vendored
Normal file
62
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeString.hx
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
extern class NativeString {
|
||||
|
||||
public static inline function raw( inString:String ) : RawConstPointer<Char> {
|
||||
return untyped inString.__s;
|
||||
}
|
||||
public static inline function c_str( inString:String ) : ConstPointer<Char> {
|
||||
return cpp.ConstPointer.fromPointer(untyped inString.__s);
|
||||
}
|
||||
public static inline function fromPointer(inPtr:ConstPointer<Char> ) : String {
|
||||
return untyped __global__.String(inPtr.ptr);
|
||||
}
|
||||
public static inline function fromGcPointer(inPtr:ConstPointer<Char>, inLen:Int ) : String {
|
||||
return untyped __global__.String(inPtr.ptr,inLen);
|
||||
}
|
||||
|
||||
|
||||
@:native("_hx_string_compare")
|
||||
public static function compare(inString0:String, inString1:String) : Int return 0;
|
||||
|
||||
@:native("_hx_utf8_char_code_at")
|
||||
public static function utf8CharCodeAt(inString:String, inIndex:Int) : Int return 0;
|
||||
|
||||
@:native("_hx_utf8_length")
|
||||
public static function utf8Length(inString:String) : Int return 1;
|
||||
|
||||
@:native("_hx_utf8_is_valid")
|
||||
public static function utf8IsValid(inString:String) : Bool return false;
|
||||
|
||||
@:native("_hx_utf8_sub")
|
||||
public static function utf8Sub(inString:String,charStart:Int, inLen:Int) : String return null;
|
||||
|
||||
@:native("_hx_string_create")
|
||||
public static function fromPointerLen(inPtr:ConstPointer<Char>, len:Int ) : String;
|
||||
|
||||
@:native("_hx_utf8_decode_advance")
|
||||
public static function utf8DecodeAdvance(reference:Char) : Int return 0;
|
||||
|
||||
}
|
||||
|
||||
113
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeSys.hx
generated
vendored
Normal file
113
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeSys.hx
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
package cpp;
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/std/Build.xml"/>')
|
||||
extern class NativeSys
|
||||
{
|
||||
@:native("__hxcpp_print")
|
||||
public static function print( v : Dynamic ) : Void { }
|
||||
|
||||
@:native("__hxcpp_println")
|
||||
public static function println( v : Dynamic ) : Void { }
|
||||
|
||||
@:extern @:native("_hx_std_get_env")
|
||||
public static function get_env(v:String) : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_put_env")
|
||||
public static function put_env(e:String,v:String) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_sleep")
|
||||
public static function sys_sleep(f:Float) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_set_time_locale")
|
||||
public static function set_time_locale(l:String) : Bool return false;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_get_cwd")
|
||||
public static function get_cwd() : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_set_cwd")
|
||||
public static function set_cwd(d:String) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_string")
|
||||
public static function sys_string() : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_is64")
|
||||
public static function sys_is64() : Bool return false;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_command")
|
||||
public static function sys_command(cmd:String) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_exit")
|
||||
public static function sys_exit(code:Int) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_exists")
|
||||
public static function sys_exists(path:String) : Bool return false;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_delete")
|
||||
public static function file_delete(path:String) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_rename")
|
||||
public static function sys_rename(path:String,newname:String) : Bool return false;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_stat")
|
||||
public static function sys_stat(path:String) : Dynamic return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_file_type")
|
||||
public static function sys_file_type(path:String) : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_create_dir")
|
||||
public static function sys_create_dir(path:String,mode:Int) : Bool return false;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_remove_dir")
|
||||
public static function sys_remove_dir(path:String) : Void { }
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_time")
|
||||
public static function sys_time() : Float return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_cpu_time")
|
||||
public static function sys_cpu_time() : Float return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_read_dir")
|
||||
public static function sys_read_dir(p:String) : Array<String> return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_file_full_path")
|
||||
public static function file_full_path(path:String) : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_exe_path")
|
||||
public static function sys_exe_path() : String return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_env")
|
||||
public static function sys_env() : Array<String> return null;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_getch")
|
||||
public static function sys_getch(b:Bool) : Int return 0;
|
||||
|
||||
|
||||
@:extern @:native("_hx_std_sys_get_pid")
|
||||
public static function sys_get_pid() : Int return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
500
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeXml.hx
generated
vendored
Normal file
500
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeXml.hx
generated
vendored
Normal file
@@ -0,0 +1,500 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:enum abstract XmlType(Int) {
|
||||
/**
|
||||
Represents an XML element type.
|
||||
**/
|
||||
var Element = 0;
|
||||
/**
|
||||
Represents XML parsed character data type.
|
||||
**/
|
||||
var PCData = 1;
|
||||
/**
|
||||
Represents XML character data type.
|
||||
**/
|
||||
var CData = 2;
|
||||
/**
|
||||
Represents an XML comment type.
|
||||
**/
|
||||
var Comment = 3;
|
||||
/**
|
||||
Represents an XML doctype element type.
|
||||
**/
|
||||
var DocType = 4;
|
||||
/**
|
||||
Represents an XML processing instruction type.
|
||||
**/
|
||||
var ProcessingInstruction = 5;
|
||||
/**
|
||||
Represents an XML document type.
|
||||
**/
|
||||
var Document = 6;
|
||||
}
|
||||
|
||||
class NativeXmlState
|
||||
{
|
||||
var cur : Xml;
|
||||
|
||||
public function new(x:Xml)
|
||||
{
|
||||
x._children = new Array<Xml>();
|
||||
cur = x;
|
||||
}
|
||||
|
||||
|
||||
@:keep
|
||||
public function xml(name:String, att:Dynamic<String>)
|
||||
{
|
||||
var x = new Xml();
|
||||
x._parent = cur;
|
||||
x.nodeType = Xml.Element;
|
||||
x._nodeName = name;
|
||||
x._attributes = att;
|
||||
x._children = new Array<Xml>();
|
||||
cur.addChild(x);
|
||||
cur = x;
|
||||
}
|
||||
|
||||
@:keep
|
||||
public function cdata(text:String)
|
||||
{
|
||||
var x = new Xml();
|
||||
x._parent = cur;
|
||||
x.nodeType = Xml.CData;
|
||||
x._nodeValue = text;
|
||||
cur.addChild(x);
|
||||
}
|
||||
|
||||
@:keep
|
||||
public function pcdata(text:String)
|
||||
{
|
||||
var x = new Xml();
|
||||
x._parent = cur;
|
||||
x.nodeType = Xml.PCData;
|
||||
x._nodeValue = text;
|
||||
cur.addChild(x);
|
||||
}
|
||||
|
||||
@:keep
|
||||
public function comment(text:String)
|
||||
{
|
||||
var x = new Xml();
|
||||
x._parent = cur;
|
||||
if( text.length>1 && StringTools.fastCodeAt(text,0) == 63 )
|
||||
{
|
||||
x.nodeType = Xml.ProcessingInstruction;
|
||||
text = text.substr(1, text.length - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
x.nodeType = Xml.Comment;
|
||||
}
|
||||
x._nodeValue = text;
|
||||
cur.addChild(x);
|
||||
}
|
||||
|
||||
@:keep
|
||||
public function doctype(text:String)
|
||||
{
|
||||
var x = new Xml();
|
||||
x._parent = cur;
|
||||
x.nodeType = Xml.DocType;
|
||||
x._nodeValue = text.substr(1);
|
||||
cur.addChild(x);
|
||||
}
|
||||
|
||||
@:keep
|
||||
public function done()
|
||||
{
|
||||
cur = cur._parent;
|
||||
}
|
||||
}
|
||||
|
||||
private class NativeXmlIterator
|
||||
{
|
||||
var cur = 0;
|
||||
var children:Array<Xml>;
|
||||
|
||||
public function new(inChildren:Array<Xml>)
|
||||
{
|
||||
children = inChildren;
|
||||
cur = 0;
|
||||
}
|
||||
|
||||
public function hasNext() : Bool
|
||||
{
|
||||
var k = cur;
|
||||
var l = children.length;
|
||||
while( k < l )
|
||||
{
|
||||
if (children[k].nodeType == Xml.Element)
|
||||
break;
|
||||
k += 1;
|
||||
}
|
||||
cur = k;
|
||||
return k < l;
|
||||
}
|
||||
|
||||
public function next():Xml
|
||||
{
|
||||
var k = cur;
|
||||
var l = children.length;
|
||||
while( k < l )
|
||||
{
|
||||
var n = children[k];
|
||||
k += 1;
|
||||
if( n.nodeType == Xml.Element )
|
||||
{
|
||||
cur = k;
|
||||
return n;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private class NativeXmlNamedIterator
|
||||
{
|
||||
var cur = 0;
|
||||
var children:Array<Xml>;
|
||||
var name:String;
|
||||
|
||||
public function new(inChildren:Array<Xml>, inName:String)
|
||||
{
|
||||
children = inChildren;
|
||||
name = inName;
|
||||
cur = 0;
|
||||
}
|
||||
|
||||
|
||||
public function hasNext() : Bool
|
||||
{
|
||||
var k = cur;
|
||||
var l = children.length;
|
||||
while( k < l )
|
||||
{
|
||||
var n = children[k];
|
||||
if( n.nodeType == Xml.Element && n._nodeName == name )
|
||||
break;
|
||||
k++;
|
||||
}
|
||||
cur = k;
|
||||
return k < l;
|
||||
}
|
||||
|
||||
public function next():Xml
|
||||
{
|
||||
var k = cur;
|
||||
var l = children.length;
|
||||
while( k < l )
|
||||
{
|
||||
var n = children[k];
|
||||
k++;
|
||||
if( n.nodeType == Xml.Element && n._nodeName == name ) {
|
||||
cur = k;
|
||||
return n;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@:cppInclude("./NativeXmlImport.cpp")
|
||||
@:allow(cpp.NativeXmlState) @:allow(cpp.NativeXmlIterator) @:allow(cpp.NativeXmlNamedIterator)
|
||||
class Xml {
|
||||
static inline var Element = XmlType.Element;
|
||||
static inline var PCData = XmlType.PCData;
|
||||
static inline var CData = XmlType.CData;
|
||||
static inline var Comment = XmlType.Comment;
|
||||
static inline var DocType = XmlType.DocType;
|
||||
static inline var ProcessingInstruction = XmlType.ProcessingInstruction;
|
||||
static inline var Document = XmlType.Document;
|
||||
|
||||
|
||||
private var _nodeName : String;
|
||||
private var _nodeValue : String;
|
||||
private var _attributes : Dynamic<String>;
|
||||
private var _children : Array<Xml>;
|
||||
private var _parent : Xml;
|
||||
|
||||
function new() : Void {
|
||||
}
|
||||
|
||||
@:extern @:native("parse_xml")
|
||||
static function parse_xml(str:String, state:NativeXmlState) { }
|
||||
|
||||
public static function parse( str : String ) : Xml
|
||||
{
|
||||
var x = new Xml();
|
||||
var state = new NativeXmlState(x);
|
||||
parse_xml(str,state);
|
||||
x.nodeType = Xml.Document;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
public static function createElement( name : String ) : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.Element;
|
||||
r._nodeName = name;
|
||||
r._attributes = null;
|
||||
r._children = new Array();
|
||||
return r;
|
||||
}
|
||||
|
||||
public static function createPCData( data : String ) : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.PCData;
|
||||
r._nodeValue = data;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static function createCData( data : String ) : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.CData;
|
||||
r._nodeValue = data;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static function createComment( data : String ) : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.Comment;
|
||||
r._nodeValue = data;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static function createDocType( data : String ) : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.DocType;
|
||||
r._nodeValue = data;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static function createProcessingInstruction( data : String ) : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.ProcessingInstruction;
|
||||
r._nodeValue = data;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static function createDocument() : Xml {
|
||||
var r = new Xml();
|
||||
r.nodeType = Xml.Document;
|
||||
r._children = new Array();
|
||||
return r;
|
||||
}
|
||||
|
||||
public var nodeType(default,null) : XmlType;
|
||||
|
||||
public var nodeName(get,set) : String;
|
||||
|
||||
public var nodeValue(get,set) : String;
|
||||
|
||||
|
||||
private function get_nodeName() : String {
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
return _nodeName;
|
||||
}
|
||||
|
||||
private function set_nodeName( n : String ) : String {
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
return _nodeName = n;
|
||||
}
|
||||
|
||||
private function get_nodeValue() : String {
|
||||
if( nodeType == Xml.Element || nodeType == Xml.Document )
|
||||
throw "bad nodeType";
|
||||
return _nodeValue;
|
||||
}
|
||||
|
||||
private function set_nodeValue( v : String ) : String {
|
||||
if( nodeType == Xml.Element || nodeType == Xml.Document )
|
||||
throw "bad nodeType";
|
||||
return _nodeValue = v;
|
||||
}
|
||||
|
||||
public var parent(get,null) : Xml;
|
||||
private function get_parent() : Xml {
|
||||
return _parent;
|
||||
}
|
||||
|
||||
public function get( att : String ) : String {
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
return Reflect.field( _attributes, att );
|
||||
}
|
||||
|
||||
public function set( att : String, value : String ) : Void {
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
if (_attributes==null)
|
||||
_attributes = {};
|
||||
Reflect.setField (_attributes, att, value );
|
||||
return null;
|
||||
}
|
||||
|
||||
public function remove( att : String ) : Void{
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
Reflect.deleteField( _attributes, att );
|
||||
return null;
|
||||
}
|
||||
|
||||
public function exists( att : String ) : Bool {
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
return Reflect.hasField( _attributes, att );
|
||||
}
|
||||
|
||||
public function attributes() : Iterator<String> {
|
||||
if( nodeType != Xml.Element )
|
||||
throw "bad nodeType";
|
||||
return Reflect.fields( _attributes ).iterator();
|
||||
}
|
||||
|
||||
public function iterator() : Iterator<Xml> {
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
return untyped _children.iterator();
|
||||
}
|
||||
|
||||
|
||||
public function elements(): Iterator<Xml>
|
||||
{
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
return new NativeXmlIterator(_children);
|
||||
}
|
||||
|
||||
public function elementsNamed( name : String ) : Iterator<Xml>
|
||||
{
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
return new NativeXmlNamedIterator(_children,name);
|
||||
}
|
||||
|
||||
public function firstChild() : Xml {
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
return _children[0];
|
||||
}
|
||||
|
||||
public function firstElement() : Xml {
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
for( cur in 0..._children.length ) {
|
||||
var n:Xml = _children[cur];
|
||||
if( n.nodeType == Xml.Element )
|
||||
return n;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addChild( x : Xml ) : Void {
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
if( x._parent != null ) x._parent._children.remove(x);
|
||||
x._parent = this;
|
||||
_children.push( x );
|
||||
return null;
|
||||
}
|
||||
|
||||
public function removeChild( x : Xml ) : Bool {
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
var b = _children.remove( x );
|
||||
if( b ) x._parent = null;
|
||||
return b;
|
||||
}
|
||||
|
||||
public function insertChild( x : Xml, pos : Int ) : Void {
|
||||
if( _children == null )
|
||||
throw "bad nodetype";
|
||||
if( x._parent != null ) x._parent._children.remove(x);
|
||||
x._parent = this;
|
||||
_children.insert( pos, x );
|
||||
return null;
|
||||
}
|
||||
|
||||
public function toString() : String {
|
||||
var s = new StringBuf();
|
||||
toStringRec(s);
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
private function toStringRec(s: StringBuf) : Void {
|
||||
switch( nodeType ) {
|
||||
case Xml.Document:
|
||||
for( x in _children )
|
||||
x.toStringRec(s);
|
||||
case Xml.Element:
|
||||
s.addChar("<".code);
|
||||
s.add(_nodeName);
|
||||
for( k in Reflect.fields(_attributes) ) {
|
||||
s.addChar(" ".code);
|
||||
s.add(k);
|
||||
s.addChar("=".code);
|
||||
s.addChar("\"".code);
|
||||
s.add(Reflect.field(_attributes,k));
|
||||
s.addChar("\"".code);
|
||||
}
|
||||
if( _children.length == 0 ) {
|
||||
s.addChar("/".code);
|
||||
s.addChar(">".code);
|
||||
return;
|
||||
}
|
||||
s.addChar(">".code);
|
||||
for( x in _children )
|
||||
x.toStringRec(s);
|
||||
s.addChar("<".code);
|
||||
s.addChar("/".code);
|
||||
s.add(_nodeName);
|
||||
s.addChar(">".code);
|
||||
case Xml.PCData:
|
||||
s.add(StringTools.htmlEscape(_nodeValue));
|
||||
case Xml.CData:
|
||||
s.add("<![CDATA[");
|
||||
s.add(_nodeValue);
|
||||
s.add("]]>");
|
||||
case Xml.Comment:
|
||||
s.add("<!--");
|
||||
s.add(_nodeValue);
|
||||
s.add("-->");
|
||||
case Xml.DocType:
|
||||
s.add("<!DOCTYPE ");
|
||||
s.add(_nodeValue);
|
||||
s.add(">");
|
||||
case Xml.ProcessingInstruction:
|
||||
s.add("<?");
|
||||
s.add(_nodeValue);
|
||||
s.add("?>");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
365
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeXmlImport.cpp
generated
vendored
Normal file
365
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/NativeXmlImport.cpp
generated
vendored
Normal file
@@ -0,0 +1,365 @@
|
||||
|
||||
#ifdef EPPC
|
||||
#include <memory>
|
||||
#else
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HX_WINDOWS
|
||||
# include <strings.h>
|
||||
# undef strcmpi
|
||||
# define strcmpi(a,b) strcasecmp(a,b)
|
||||
#else
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
|
||||
// -------------- parsing --------------------------
|
||||
|
||||
|
||||
enum STATE {
|
||||
IGNORE_SPACES,
|
||||
BEGIN,
|
||||
BEGIN_NODE,
|
||||
TAG_NAME,
|
||||
BODY,
|
||||
ATTRIB_NAME,
|
||||
EQUALS,
|
||||
ATTVAL_BEGIN,
|
||||
ATTRIB_VAL,
|
||||
CHILDS,
|
||||
CLOSE,
|
||||
WAIT_END,
|
||||
WAIT_END_RET,
|
||||
PCDATA,
|
||||
HEADER,
|
||||
COMMENT,
|
||||
DOCTYPE,
|
||||
CDATA,
|
||||
};
|
||||
|
||||
static void xml_error( const char *xml, const char *inWhere, int *line, String msg ) {
|
||||
String b = HX_CSTRING("Xml parse error : ") + msg + HX_CSTRING(" at line ") + String(*line) + HX_CSTRING(" : ");
|
||||
String where(inWhere);
|
||||
|
||||
int l = where.length;
|
||||
int nchars = 30;
|
||||
if( inWhere != xml )
|
||||
b += HX_CSTRING("...");
|
||||
|
||||
if (where.length==0)
|
||||
b+= HX_CSTRING("<eof>");
|
||||
else if (where.length<nchars)
|
||||
b+= where;
|
||||
else
|
||||
b+= where.substr(0,nchars) + HX_CSTRING("...");
|
||||
|
||||
hx::Throw(b);
|
||||
}
|
||||
|
||||
#define ERRORSTR(msg) xml_error(xml,p,line,msg);
|
||||
#define ERROR(msg) xml_error(xml,p,line,HX_CSTRING(msg));
|
||||
|
||||
static bool is_valid_char( int c ) {
|
||||
return ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || c == ':' || c == '.' || c == '_' || c == '-';
|
||||
}
|
||||
|
||||
static void do_parse_xml( const char *xml, const char **lp, int *line, cpp::NativeXmlState callb, String parentname )
|
||||
{
|
||||
STATE state = BEGIN;
|
||||
STATE next = BEGIN;
|
||||
String aname;
|
||||
hx::Anon attribs;
|
||||
String nodename;
|
||||
|
||||
const char *start = NULL;
|
||||
const char *p = *lp;
|
||||
char c = *p;
|
||||
int nsubs = 0, nbrackets = 0;
|
||||
while( c ) {
|
||||
switch( state ) {
|
||||
case IGNORE_SPACES:
|
||||
switch( c ) {
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\t':
|
||||
case ' ':
|
||||
break;
|
||||
default:
|
||||
state = next;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case BEGIN:
|
||||
switch( c ) {
|
||||
case '<':
|
||||
state = IGNORE_SPACES;
|
||||
next = BEGIN_NODE;
|
||||
break;
|
||||
default:
|
||||
start = p;
|
||||
state = PCDATA;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case PCDATA:
|
||||
if( c == '<' ) {
|
||||
callb->pcdata(String(start,p-start).dup());
|
||||
nsubs++;
|
||||
state = IGNORE_SPACES;
|
||||
next = BEGIN_NODE;
|
||||
}
|
||||
break;
|
||||
case CDATA:
|
||||
if( c == ']' && p[1] == ']' && p[2] == '>' ) {
|
||||
callb->cdata(String(start,p-start).dup());
|
||||
nsubs++;
|
||||
p += 2;
|
||||
state = BEGIN;
|
||||
}
|
||||
break;
|
||||
case BEGIN_NODE:
|
||||
switch( c ) {
|
||||
case '!':
|
||||
if( p[1] == '[' ) {
|
||||
p += 2;
|
||||
if( (p[0] != 'C' && p[0] != 'c') ||
|
||||
(p[1] != 'D' && p[1] != 'd') ||
|
||||
(p[2] != 'A' && p[2] != 'a') ||
|
||||
(p[3] != 'T' && p[3] != 't') ||
|
||||
(p[4] != 'A' && p[4] != 'a') ||
|
||||
(p[5] != '[') )
|
||||
ERROR("Expected <![CDATA[");
|
||||
p += 5;
|
||||
state = CDATA;
|
||||
start = p + 1;
|
||||
break;
|
||||
}
|
||||
if( p[1] == 'D' || p[1] == 'd' ) {
|
||||
if( (p[2] != 'O' && p[2] != 'o') ||
|
||||
(p[3] != 'C' && p[3] != 'c') ||
|
||||
(p[4] != 'T' && p[4] != 't') ||
|
||||
(p[5] != 'Y' && p[5] != 'y') ||
|
||||
(p[6] != 'P' && p[6] != 'p') ||
|
||||
(p[7] != 'E' && p[7] != 'e') )
|
||||
ERROR("Expected <!DOCTYPE");
|
||||
p += 7;
|
||||
state = DOCTYPE;
|
||||
start = p + 1;
|
||||
break;
|
||||
}
|
||||
if( p[1] != '-' || p[2] != '-' )
|
||||
ERROR("Expected <!--");
|
||||
p += 2;
|
||||
state = COMMENT;
|
||||
start = p + 1;
|
||||
break;
|
||||
case '?':
|
||||
state = HEADER;
|
||||
start = p;
|
||||
break;
|
||||
case '/':
|
||||
if( parentname.length==0 )
|
||||
ERROR("Expected node name");
|
||||
start = p + 1;
|
||||
state = IGNORE_SPACES;
|
||||
next = CLOSE;
|
||||
break;
|
||||
default:
|
||||
state = TAG_NAME;
|
||||
start = p;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case TAG_NAME:
|
||||
if( !is_valid_char(c) ) {
|
||||
if( p == start )
|
||||
ERROR("Expected node name");
|
||||
nodename = String(start,p-start).dup();
|
||||
attribs = hx::Anon_obj::Create();
|
||||
state = IGNORE_SPACES;
|
||||
next = BODY;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case BODY:
|
||||
switch( c ) {
|
||||
case '/':
|
||||
state = WAIT_END;
|
||||
nsubs++;
|
||||
callb->xml(nodename,attribs);
|
||||
break;
|
||||
case '>':
|
||||
state = CHILDS;
|
||||
nsubs++;
|
||||
callb->xml(nodename,attribs);
|
||||
break;
|
||||
default:
|
||||
state = ATTRIB_NAME;
|
||||
start = p;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case ATTRIB_NAME:
|
||||
if( !is_valid_char(c) ) {
|
||||
if( start == p )
|
||||
ERROR("Expected attribute name");
|
||||
aname = String(start,p-start).dup();
|
||||
if( attribs->__Field(aname,hx::paccDynamic) != null() )
|
||||
ERROR("Duplicate attribute");
|
||||
state = IGNORE_SPACES;
|
||||
next = EQUALS;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case EQUALS:
|
||||
switch( c ) {
|
||||
case '=':
|
||||
state = IGNORE_SPACES;
|
||||
next = ATTVAL_BEGIN;
|
||||
break;
|
||||
default:
|
||||
ERROR("Expected =");
|
||||
}
|
||||
break;
|
||||
case ATTVAL_BEGIN:
|
||||
switch( c ) {
|
||||
case '"':
|
||||
case '\'':
|
||||
state = ATTRIB_VAL;
|
||||
start = p;
|
||||
break;
|
||||
default:
|
||||
ERROR("Expected \"");
|
||||
}
|
||||
break;
|
||||
case ATTRIB_VAL:
|
||||
if( c == *start ) {
|
||||
attribs->Add( aname, String(start+1,p-start-1).dup() );
|
||||
state = IGNORE_SPACES;
|
||||
next = BODY;
|
||||
}
|
||||
break;
|
||||
case CHILDS:
|
||||
*lp = p;
|
||||
do_parse_xml(xml,lp,line,callb,nodename);
|
||||
p = *lp;
|
||||
start = p;
|
||||
state = BEGIN;
|
||||
break;
|
||||
case WAIT_END:
|
||||
switch( c ) {
|
||||
case '>':
|
||||
callb->done();
|
||||
state = BEGIN;
|
||||
break;
|
||||
default :
|
||||
ERROR("Expected >");
|
||||
}
|
||||
break;
|
||||
case WAIT_END_RET:
|
||||
switch( c ) {
|
||||
case '>':
|
||||
if( nsubs == 0 )
|
||||
callb->pcdata(HX_CSTRING(""));
|
||||
*lp = p;
|
||||
return;
|
||||
default :
|
||||
ERROR("Expected >");
|
||||
}
|
||||
break;
|
||||
case CLOSE:
|
||||
if( !is_valid_char(c) ) {
|
||||
if( start == p )
|
||||
ERROR("Expected node name");
|
||||
{
|
||||
String v = String(start,p - start).dup();
|
||||
if( strcmpi(parentname.__s,v.__s) != 0 ) {
|
||||
ERRORSTR(HX_CSTRING("Expected </") + parentname + HX_CSTRING(">"));
|
||||
}
|
||||
}
|
||||
state = IGNORE_SPACES;
|
||||
next = WAIT_END_RET;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case COMMENT:
|
||||
if( c == '-' && p[1] == '-' && p[2] == '>' ) {
|
||||
callb->comment(String(start,p-start).dup());
|
||||
p += 2;
|
||||
state = BEGIN;
|
||||
}
|
||||
break;
|
||||
case DOCTYPE:
|
||||
if( c == '[' )
|
||||
nbrackets++;
|
||||
else if( c == ']' )
|
||||
nbrackets--;
|
||||
else if( c == '>' && nbrackets == 0 ) {
|
||||
callb->doctype(String(start,p-start).dup());
|
||||
state = BEGIN;
|
||||
}
|
||||
break;
|
||||
case HEADER:
|
||||
if( c == '?' && p[1] == '>' ) {
|
||||
p++;
|
||||
callb->comment(String(start,p-start).dup());
|
||||
state = BEGIN;
|
||||
}
|
||||
break;
|
||||
}
|
||||
c = *++p;
|
||||
if( c == '\n' )
|
||||
(*line)++;
|
||||
}
|
||||
if( state == BEGIN ) {
|
||||
start = p;
|
||||
state = PCDATA;
|
||||
}
|
||||
if( parentname.__s == 0 && state == PCDATA ) {
|
||||
if( p != start || nsubs == 0 )
|
||||
callb->pcdata(String(start,p-start).dup());
|
||||
return;
|
||||
}
|
||||
ERROR("Unexpected end");
|
||||
}
|
||||
|
||||
// ----------------------------------------------
|
||||
|
||||
/**
|
||||
<doc>
|
||||
<h1>Xml</h1>
|
||||
<p>
|
||||
The standard event-driven XML parser.
|
||||
</p>
|
||||
</doc>
|
||||
**/
|
||||
|
||||
/**
|
||||
parse_xml : xml:string -> events:object -> void
|
||||
<doc>
|
||||
The [parse_xml] parse a string and for each parsed element call the
|
||||
corresponding object method in [events] :
|
||||
<ul>
|
||||
<li>[void xml( name : string, attribs : object)] when an XML node is found</li>
|
||||
<li>[void done()] when an XML node is closed</li>
|
||||
<li>[void pcdata(string)] when PCData chars found</li>
|
||||
<li>[void cdata(string)] when a CData session is found</li>
|
||||
<li>[void comment(string)] when some comment or special header is found</li>
|
||||
</ul>
|
||||
You can then implement the events so they build the appropriate XML data
|
||||
structure needed by your language.
|
||||
</doc>
|
||||
**/
|
||||
static void parse_xml( String str, cpp::NativeXmlState state )
|
||||
{
|
||||
int line = 0;
|
||||
const char *p = str.__s;
|
||||
// skip BOM
|
||||
if( p[0] == (char)0xEF && p[1] == (char)0xBB && p[2] == (char)0xBF )
|
||||
p += 3;
|
||||
do_parse_xml(p,&p,&line,state,String());
|
||||
}
|
||||
|
||||
|
||||
26
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Object.hx
generated
vendored
Normal file
26
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Object.hx
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:noPackageRestrict
|
||||
typedef Object = Dynamic;
|
||||
|
||||
19
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ObjectType.hx
generated
vendored
Normal file
19
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/ObjectType.hx
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package cpp;
|
||||
|
||||
extern class ObjectType
|
||||
{
|
||||
public inline static var vtUnknown = -1;
|
||||
public inline static var vtInt = 0xff;
|
||||
public inline static var vtNull = 0;
|
||||
public inline static var vtFloat = 1;
|
||||
public inline static var vtBool = 2;
|
||||
public inline static var vtString = 3;
|
||||
public inline static var vtObject = 4;
|
||||
public inline static var vtArray = 5;
|
||||
public inline static var vtFunction = 6;
|
||||
public inline static var vtEnum = 7;
|
||||
public inline static var vtClass = 8;
|
||||
public inline static var vtInt64 = 9;
|
||||
public inline static var vtAbstractBase = 0x100;
|
||||
}
|
||||
|
||||
87
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Pointer.hx
generated
vendored
Normal file
87
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Pointer.hx
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
import haxe.extern.AsVar;
|
||||
|
||||
@:coreType
|
||||
@:analyzer(as_var)
|
||||
extern class Pointer<T> extends ConstPointer<T> implements ArrayAccess<T>
|
||||
{
|
||||
public var ref(get,set):Reference<T>;
|
||||
|
||||
public function get_ref() : Reference<T>;
|
||||
public function set_ref(t:T) : Reference<T>;
|
||||
|
||||
public function setAt(inIndex:Int, value:T):Void;
|
||||
|
||||
public static function fromRaw<T>(ptr:RawPointer<T>) : Pointer<T>;
|
||||
|
||||
@:native("::cpp::Pointer_obj::fromHandle")
|
||||
static function nativeFromHandle<T>(inHandle:Dynamic,?inKind:String):AutoCast;
|
||||
inline public static function fromHandle<T>(inHandle:Dynamic,?inKind:String) : Pointer<T>
|
||||
{
|
||||
return cast nativeFromHandle(inHandle,inKind);
|
||||
}
|
||||
|
||||
public static function fromPointer<T>(inNativePointer:Dynamic) : Pointer<T>;
|
||||
|
||||
public static function addressOf<T>(inVariable:cpp.Reference<T>) : Pointer<T>;
|
||||
|
||||
public static function endOf<T:{}>(inVariable:T) : Pointer<cpp.Void>;
|
||||
|
||||
@:native("::cpp::Pointer_obj::arrayElem")
|
||||
static function nativeArrayElem<T>(array:Array<T>, inElem:Int):AutoCast;
|
||||
inline static function arrayElem<T>(array:Array<T>, inElem:Int):Pointer<T>
|
||||
{
|
||||
return cast nativeArrayElem(array,inElem);
|
||||
}
|
||||
|
||||
@:native("::cpp::Pointer_obj::ofArray")
|
||||
static function nativeOfArray<T>(array:Array<T>):AutoCast;
|
||||
inline public static function ofArray<T>(array:Array<T>):Pointer<T>
|
||||
{
|
||||
return cast nativeOfArray(array);
|
||||
}
|
||||
|
||||
inline public function toUnmanagedArray(elementCount:Int) : Array<T>
|
||||
{
|
||||
var result = new Array<T>();
|
||||
NativeArray.setUnmanagedData(result,this,elementCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline public function toUnmanagedVector(elementCount:Int) : haxe.ds.Vector<T>
|
||||
return cast toUnmanagedArray(elementCount);
|
||||
|
||||
|
||||
override public function inc():Pointer<T>;
|
||||
override public function dec():Pointer<T>;
|
||||
override public function incBy(inT:Int):Pointer<T>;
|
||||
override public function add(inT:Int):Pointer<T>;
|
||||
|
||||
public function postIncRef():Reference<T>;
|
||||
|
||||
public function destroy():Void;
|
||||
public function destroyArray():Void;
|
||||
}
|
||||
|
||||
122
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Prime.hx
generated
vendored
Normal file
122
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Prime.hx
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
#if macro
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Type;
|
||||
import haxe.macro.Expr;
|
||||
#end
|
||||
|
||||
@:noPackageRestrict
|
||||
class Prime {
|
||||
|
||||
#if (!macro && cpp)
|
||||
|
||||
public static function _loadPrime( lib : String, prim : String, signature : String, quietFail = false ) : Dynamic {
|
||||
var factory:Callable< ConstCharStar -> Object > =
|
||||
untyped __global__.__hxcpp_cast_get_proc_address(lib, prim + "__prime", quietFail);
|
||||
if (factory!=null)
|
||||
{
|
||||
var func:Dynamic = factory.call(signature);
|
||||
if (func==null && !quietFail)
|
||||
throw '$prim does not have signature $signature';
|
||||
return func;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
#end
|
||||
|
||||
#if (macro)
|
||||
static function codeToType(code:String,forCpp:Bool) : String
|
||||
{
|
||||
var isCpp = Context.defined("cpp");
|
||||
|
||||
switch(code)
|
||||
{
|
||||
case "b" : return "Bool";
|
||||
case "i" : return "Int";
|
||||
case "d" : return "Float";
|
||||
case "s" : return "String";
|
||||
case "f" : return forCpp ? "cpp.Float32" : "Float";
|
||||
case "o" : return forCpp ? "cpp.Object" : "Dynamic";
|
||||
case "v" : return forCpp ? "cpp.Void" : "Dynamic";
|
||||
case "c" :
|
||||
if (forCpp)
|
||||
return "cpp.ConstCharStar";
|
||||
throw "const char * type only supported in cpp mode";
|
||||
default:
|
||||
throw "Unknown signature type :" + code;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
public static function nekoInit(inModuleName:String) : Bool
|
||||
{
|
||||
#if neko
|
||||
var init = neko.Lib.load(inModuleName, "neko_init", 5);
|
||||
|
||||
if (init != null)
|
||||
{
|
||||
init( function(s) return new String(s),
|
||||
function(len:Int) { var r = []; if (len > 0) r[len - 1] = null; return r; },
|
||||
null,
|
||||
true,
|
||||
false);
|
||||
return true;
|
||||
|
||||
}
|
||||
#end
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static macro function load(inModule:String, inName:String, inSig:String,inAllowFail:Bool = false)
|
||||
{
|
||||
var parts = inSig.split("");
|
||||
if (parts.length<1)
|
||||
throw "Invalid function signature " + inSig;
|
||||
var argCount = parts.length-1;
|
||||
|
||||
var cppMode = Context.defined("cpp");
|
||||
|
||||
var typeString = parts.length==1 ? "Void" : codeToType(parts.shift(),cppMode);
|
||||
for(p in parts)
|
||||
typeString += "->" + codeToType(p,cppMode);
|
||||
|
||||
if (cppMode)
|
||||
{
|
||||
typeString = "cpp.Callable<" + typeString + ">";
|
||||
var expr = 'new $typeString(cpp.Prime._loadPrime("$inModule","$inName","$inSig",$inAllowFail))';
|
||||
return Context.parse( expr, Context.currentPos() );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (argCount>5)
|
||||
argCount = -1;
|
||||
var lazy = inAllowFail ? "loadLazy" : "load";
|
||||
var expr = 'new cpp.Callable<$typeString>(neko.Lib.$lazy("$inModule","$inName",$argCount))';
|
||||
return Context.parse( expr, Context.currentPos() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
44
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Random.hx
generated
vendored
Normal file
44
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Random.hx
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
class Random {
|
||||
|
||||
var r : Dynamic;
|
||||
|
||||
public function new() {
|
||||
r = cpp.NativeRandom.random_new();
|
||||
}
|
||||
|
||||
public function setSeed( s : Int ) {
|
||||
cpp.NativeRandom.random_set_seed(r,s);
|
||||
}
|
||||
|
||||
public function int( max : Int ) : Int {
|
||||
return cpp.NativeRandom.random_int(r,max);
|
||||
}
|
||||
|
||||
public function float() : Float {
|
||||
return cpp.NativeRandom.random_float(r);
|
||||
}
|
||||
|
||||
}
|
||||
29
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/RawConstPointer.hx
generated
vendored
Normal file
29
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/RawConstPointer.hx
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:unreflective
|
||||
extern class RawConstPointer<T> implements ArrayAccess<T>
|
||||
{
|
||||
@:native("hx::AddressOf")
|
||||
public static function addressOf<T>(t:T) : RawConstPointer<T>;
|
||||
}
|
||||
29
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/RawPointer.hx
generated
vendored
Normal file
29
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/RawPointer.hx
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:unreflective
|
||||
extern class RawPointer<T> extends RawConstPointer<T>
|
||||
{
|
||||
@:native("hx::AddressOf")
|
||||
public static function addressOf<T>(t:T) : RawPointer<T>;
|
||||
}
|
||||
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Reference.hx
generated
vendored
Normal file
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Reference.hx
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
// Allows haxe to type result correctly, and hxcpp can recognise this and prevent
|
||||
// unwanted casting
|
||||
typedef Reference<T> = T;
|
||||
|
||||
|
||||
27
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/SizeT.hx
generated
vendored
Normal file
27
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/SizeT.hx
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:native("size_t")
|
||||
@:scalar @:coreType @:notNull
|
||||
extern abstract SizeT from(Int) to(Int) {
|
||||
}
|
||||
27
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Star.hx
generated
vendored
Normal file
27
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Star.hx
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
// Allows haxe to type result correctly, and hxcpp can recognise this use the correct type
|
||||
typedef Star<T> = T;
|
||||
|
||||
|
||||
22
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/StdString.hx
generated
vendored
Normal file
22
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/StdString.hx
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package cpp;
|
||||
|
||||
using cpp.NativeString;
|
||||
|
||||
@:native("hx::StdString")
|
||||
@:include("hx/StdString.h")
|
||||
@:stackOnly
|
||||
@:structAccess
|
||||
extern class StdString extends StdStringRef
|
||||
{
|
||||
@:extern @:native("std::string::npos")
|
||||
public static var npos(default,null):Int;
|
||||
|
||||
//public function new(inData:StdStringData);
|
||||
|
||||
@:native("hx::StdString")
|
||||
static public function ofString(s:String) : StdString;
|
||||
//public function toString():String;
|
||||
//public function find(s:String):Int;
|
||||
//public function substr(pos:Int, len:Int):StdString;
|
||||
}
|
||||
|
||||
17
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/StdStringRef.hx
generated
vendored
Normal file
17
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/StdStringRef.hx
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package cpp;
|
||||
|
||||
using cpp.NativeString;
|
||||
|
||||
@:native("hx::StdString const &")
|
||||
@:include("hx/StdString.h")
|
||||
@:structAccess
|
||||
extern class StdStringRef
|
||||
{
|
||||
public function c_str() : ConstPointer<Char>;
|
||||
public function size() : Int;
|
||||
public function find(s:String):Int;
|
||||
public function substr(pos:Int, len:Int):StdString;
|
||||
public function toString():String;
|
||||
public function toStdString():StdString;
|
||||
}
|
||||
|
||||
45
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Stdio.hx
generated
vendored
Normal file
45
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Stdio.hx
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
import haxe.extern.Rest;
|
||||
|
||||
@:include("stdio.h")
|
||||
extern class Stdio
|
||||
{
|
||||
@:native("printf")
|
||||
public static function printf(format:ConstCharStar, rest:Rest<VarArg>):Void;
|
||||
|
||||
@:native("fopen")
|
||||
public static function fopen(filename:ConstCharStar, mode:ConstCharStar) : FILE;
|
||||
|
||||
@:native("fwrite")
|
||||
public static function fwrite<T>(data:RawPointer<T>, elemSize:SizeT, elemCount:SizeT, file:FILE ) : SizeT;
|
||||
|
||||
@:native("fclose")
|
||||
public static function fclose(file:FILE) : Int;
|
||||
|
||||
|
||||
@:native("fprintf")
|
||||
public static function fprintf(file:FILE,format:ConstCharStar, rest:Rest<VarArg>):Void;
|
||||
}
|
||||
|
||||
62
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Stdlib.hx
generated
vendored
Normal file
62
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Stdlib.hx
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package cpp;
|
||||
|
||||
@:include("stdlib.h")
|
||||
extern class Stdlib
|
||||
{
|
||||
@:native("malloc")
|
||||
public static function nativeMalloc(bytes:Int) : cpp.RawPointer<cpp.Void> return null;
|
||||
@:native("calloc")
|
||||
public static function nativeCalloc(bytes:Int) : cpp.RawPointer<cpp.Void> return null;
|
||||
@:native("realloc")
|
||||
public static function nativeRealloc(inPtr:cpp.RawPointer<cpp.Void>,bytes:Int) : cpp.RawPointer<cpp.Void> return null;
|
||||
@:native("free")
|
||||
public static function nativeFree(ptr:cpp.RawPointer<cpp.Void>) : Void { }
|
||||
@:native("memcpy")
|
||||
public static function nativeMemcpy(dest:cpp.RawPointer<cpp.Void>, src:cpp.RawConstPointer<cpp.Void>, bytes:Int) : Void { }
|
||||
|
||||
@:native("hx::ClassSizeOf") @:templatedCall
|
||||
public static function sizeof<T>(t:T) : Int { }
|
||||
|
||||
inline public static function memcpy<DEST,SRC>(dest:cpp.Pointer<DEST>, src:cpp.ConstPointer<SRC>, bytes:Int) : Void
|
||||
nativeMemcpy(cast dest.ptr, cast src.ptr, bytes);
|
||||
|
||||
inline public static function malloc<T>(bytes:Int) : cpp.Pointer<T>
|
||||
return cast nativeMalloc(bytes);
|
||||
|
||||
inline public static function calloc<T>(bytes:Int) : cpp.Pointer<T>
|
||||
return cast nativeCalloc(bytes);
|
||||
|
||||
inline public static function realloc<T>(ioPtr:cpp.Pointer<T>, bytes:Int) : Void
|
||||
ioPtr.setRaw( nativeRealloc(cast ioPtr.ptr, bytes) );
|
||||
|
||||
inline public static function free<T>(ptr:cpp.Pointer<T>) : Void
|
||||
{
|
||||
if (ptr!=null)
|
||||
{
|
||||
nativeFree(cast ptr.ptr);
|
||||
ptr.ptr = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Struct.hx
generated
vendored
Normal file
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Struct.hx
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
// Wrap external types with a class that integrates with Dynamic
|
||||
typedef Struct<T> = T;
|
||||
|
||||
|
||||
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt16.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt16.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract UInt16 from Int to Int {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt32.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt32.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract UInt32 from Int to Int {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt64.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt64.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract UInt64 from Int to Int {}
|
||||
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt8.hx
generated
vendored
Normal file
24
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/UInt8.hx
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:coreType @:notNull @:runtimeValue abstract UInt8 from Int to Int {}
|
||||
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/VarArg.hx
generated
vendored
Normal file
28
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/VarArg.hx
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
// Allows haxe to type params correctly, and hxcpp can recognise this use the correct type
|
||||
typedef VarArg = Dynamic;
|
||||
|
||||
|
||||
|
||||
76
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/VirtualArray.hx
generated
vendored
Normal file
76
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/VirtualArray.hx
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
package cpp;
|
||||
|
||||
@:native("cpp::VirtualArray")
|
||||
@:coreType extern class NativeVirtualArray implements ArrayAccess<Dynamic>
|
||||
{
|
||||
public function new() : Void;
|
||||
public var length(get,null) : Int;
|
||||
// concat<T>( a:Array<T> ) : Array<T> ?
|
||||
public function concat( a : VirtualArray ) : VirtualArray;
|
||||
public function join( sep : String ) : String;
|
||||
public function pop() : Dynamic;
|
||||
public function push(x : Dynamic) : Int;
|
||||
public function reverse() : Void;
|
||||
public function shift() : Dynamic;
|
||||
public function slice( pos : Int, ?end : Int ) : VirtualArray;
|
||||
public function sort( f : Dynamic -> Dynamic -> Int ) : Void;
|
||||
public function splice( pos : Int, len : Int ) : VirtualArray;
|
||||
public function toString() : String;
|
||||
public function unshift( x : Dynamic ) : Void;
|
||||
public function insert( pos : Int, x : Dynamic ) : Void;
|
||||
public function remove( x : Dynamic ) : Bool;
|
||||
public function indexOf( x : Dynamic, ?fromIndex:Int ) : Int;
|
||||
public function lastIndexOf( x : Dynamic, ?fromIndex:Int ) : Int;
|
||||
public function copy() : VirtualArray;
|
||||
public function iterator() : Iterator<Dynamic>;
|
||||
public function map<S>( f : Dynamic -> S ) : VirtualArray;
|
||||
public function filter( f : Dynamic -> Bool ) : VirtualArray;
|
||||
}
|
||||
|
||||
|
||||
abstract VirtualArray(NativeVirtualArray)
|
||||
{
|
||||
// Add these two functions...
|
||||
@:from @:extern inline static public function fromArray<T>(a:Array<T>) : VirtualArray
|
||||
return untyped a;
|
||||
@:to @:extern inline public function toArray<T>() : Array<T>
|
||||
return untyped this;
|
||||
|
||||
|
||||
|
||||
|
||||
// The rest is just boiler-plate
|
||||
inline public function new() this=new NativeVirtualArray();
|
||||
|
||||
@:extern @:arrayAccess inline function get(idx:Int) : Dynamic
|
||||
return untyped this[idx];
|
||||
|
||||
@:extern @:arrayAccess inline function set<T>(pos:Int, value:T ) : T
|
||||
return untyped this[idx] = value;
|
||||
|
||||
public var length(get,never) : Int;
|
||||
@:extern inline public function get_length() : Int return this.length;
|
||||
|
||||
|
||||
|
||||
// concat<T>( a:Array<T> ) : Array<T> ?
|
||||
@:extern inline public function concat( a : VirtualArray ) : VirtualArray return this.concat(a);
|
||||
@:extern inline public function join( sep : String ) : String return this.join(sep);
|
||||
@:extern inline public function pop() : Dynamic return this.pop();
|
||||
@:extern inline public function push(x : Dynamic) : Int return this.push(x);
|
||||
@:extern inline public function reverse() : Void this.reverse();
|
||||
@:extern inline public function shift() : Dynamic return this.shift();
|
||||
@:extern inline public function slice( pos : Int, ?end : Int ) : VirtualArray return this.slice(pos,end);
|
||||
@:extern inline public function sort( f : Dynamic -> Dynamic -> Int ) : Void this.sort(f);
|
||||
@:extern inline public function splice( pos : Int, len : Int ) : VirtualArray return this.slice(pos,len);
|
||||
@:extern inline public function unshift( x : Dynamic ) : Void this.unshift(x);
|
||||
@:extern inline public function insert( pos : Int, x : Dynamic ) : Void this.insert(pos,x);
|
||||
@:extern inline public function remove( x : Dynamic ) : Bool return this.remove(x);
|
||||
@:extern inline public function indexOf( x : Dynamic, ?fromIndex:Int ) : Int return this.indexOf(x,fromIndex);
|
||||
@:extern inline public function lastIndexOf( x : Dynamic, ?fromIndex:Int ) : Int return this.lastIndexOf(x,fromIndex);
|
||||
@:extern inline public function copy() : VirtualArray return this.copy();
|
||||
@:extern inline public function iterator() : Iterator<Dynamic> return this.iterator();
|
||||
@:extern inline public function map<S>( f : Dynamic -> S ) : VirtualArray return this.map(f);
|
||||
@:extern inline public function filter( f : Dynamic -> Bool ) : VirtualArray return this.filter(f);
|
||||
}
|
||||
|
||||
26
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Void.hx
generated
vendored
Normal file
26
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/Void.hx
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package cpp;
|
||||
|
||||
@:native("void")
|
||||
extern class Void { }
|
||||
|
||||
83
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/Date.hx
generated
vendored
Normal file
83
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/Date.hx
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
@:coreApi class Date {
|
||||
|
||||
private var mSeconds:Float;
|
||||
|
||||
public function new(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int ) : Void {
|
||||
mSeconds = untyped __global__.__hxcpp_new_date(year,month,day,hour,min,sec);
|
||||
}
|
||||
|
||||
public function getTime() : Float {
|
||||
return mSeconds * 1000.0;
|
||||
}
|
||||
|
||||
public function getHours() : Int { return untyped __global__.__hxcpp_get_hours(mSeconds); }
|
||||
|
||||
public function getMinutes() : Int { return untyped __global__.__hxcpp_get_minutes(mSeconds); }
|
||||
|
||||
public function getSeconds() : Int { return untyped __global__.__hxcpp_get_seconds(mSeconds); }
|
||||
|
||||
public function getFullYear() : Int { return untyped __global__.__hxcpp_get_year(mSeconds); }
|
||||
|
||||
public function getMonth() : Int { return untyped __global__.__hxcpp_get_month(mSeconds); }
|
||||
|
||||
public function getDate() : Int { return untyped __global__.__hxcpp_get_date(mSeconds); }
|
||||
|
||||
public function getDay() : Int { return untyped __global__.__hxcpp_get_day(mSeconds); }
|
||||
|
||||
public function toString():String { return untyped __global__.__hxcpp_to_string(mSeconds); }
|
||||
|
||||
public static function now() : Date {
|
||||
return fromTime( untyped __global__.__hxcpp_date_now()*1000.0);
|
||||
}
|
||||
private static function new1(t : Dynamic) : Date {
|
||||
return new Date(2005,1,1,0,0,0);
|
||||
}
|
||||
|
||||
public static function fromTime( t : Float ) : Date {
|
||||
var result = new Date(0,0,0,0,0,0);
|
||||
result.mSeconds = t*0.001;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static function fromString( s : String ) : Date {
|
||||
switch( s.length ) {
|
||||
case 8: // hh:mm:ss
|
||||
var k = s.split(":");
|
||||
var d : Date = new Date(0,0,0,Std.parseInt(k[0]),Std.parseInt(k[1]),Std.parseInt(k[2]));
|
||||
return d;
|
||||
case 10: // YYYY-MM-DD
|
||||
var k = s.split("-");
|
||||
return new Date(Std.parseInt(k[0]),Std.parseInt(k[1])-1,Std.parseInt(k[2]),0,0,0);
|
||||
case 19: // YYYY-MM-DD hh:mm:ss
|
||||
var k = s.split(" ");
|
||||
var y = k[0].split("-");
|
||||
var t = k[1].split(":");
|
||||
return new Date(Std.parseInt(y[0]),Std.parseInt(y[1]) - 1,Std.parseInt(y[2]),
|
||||
Std.parseInt(t[0]),Std.parseInt(t[1]),Std.parseInt(t[2]));
|
||||
default:
|
||||
throw "Invalid date format : " + s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
188
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/EReg.hx
generated
vendored
Normal file
188
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/EReg.hx
generated
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
@:buildXml('<include name="${HXCPP}/src/hx/libs/regexp/Build.xml"/>')
|
||||
@:coreApi class EReg {
|
||||
|
||||
var r : Dynamic;
|
||||
var last : String;
|
||||
var global : Bool;
|
||||
|
||||
public function new( r : String, opt : String ) : Void {
|
||||
var a = opt.split("g");
|
||||
global = a.length > 1;
|
||||
if( global )
|
||||
opt = a.join("");
|
||||
this.r = _hx_regexp_new_options(r, opt);
|
||||
}
|
||||
|
||||
public function match( s : String ) : Bool {
|
||||
var p = _hx_regexp_match(r,s,0,s.length);
|
||||
if( p )
|
||||
last = s;
|
||||
else
|
||||
last = null;
|
||||
return p;
|
||||
}
|
||||
|
||||
public function matched( n : Int ) : String {
|
||||
var m = _hx_regexp_matched(r,n);
|
||||
return m;
|
||||
}
|
||||
|
||||
public function matchedLeft() : String {
|
||||
var p = _hx_regexp_matched_pos(r,0);
|
||||
return last.substr(0,p.pos);
|
||||
}
|
||||
|
||||
public function matchedRight() : String {
|
||||
var p = _hx_regexp_matched_pos(r,0);
|
||||
var sz = p.pos+p.len;
|
||||
return last.substr(sz,last.length-sz);
|
||||
}
|
||||
|
||||
public function matchedPos() : { pos : Int, len : Int } {
|
||||
return _hx_regexp_matched_pos(r,0);
|
||||
}
|
||||
|
||||
public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
|
||||
var p = _hx_regexp_match(r, s, pos, len < 0 ? s.length - pos : len);
|
||||
if (p)
|
||||
last = s;
|
||||
else
|
||||
last = null;
|
||||
return p;
|
||||
}
|
||||
|
||||
public function split( s : String ) : Array<String> {
|
||||
var pos = 0;
|
||||
var len = s.length;
|
||||
var a = new Array();
|
||||
var first = true;
|
||||
do {
|
||||
if( !_hx_regexp_match(r,s,pos,len) )
|
||||
break;
|
||||
var p = _hx_regexp_matched_pos(r,0);
|
||||
if( p.len == 0 && !first ) {
|
||||
if( p.pos == s.length )
|
||||
break;
|
||||
p.pos += 1;
|
||||
}
|
||||
a.push(s.substr(pos,p.pos - pos));
|
||||
var tot = p.pos + p.len - pos;
|
||||
pos += tot;
|
||||
len -= tot;
|
||||
first = false;
|
||||
} while( global );
|
||||
a.push(s.substr(pos,len));
|
||||
return a;
|
||||
}
|
||||
|
||||
public function replace( s : String, by : String ) : String {
|
||||
var b = new StringBuf();
|
||||
var pos = 0;
|
||||
var len = s.length;
|
||||
var a = by.split("$");
|
||||
var first = true;
|
||||
do {
|
||||
if( !_hx_regexp_match(r,s,pos,len) )
|
||||
break;
|
||||
var p = _hx_regexp_matched_pos(r,0);
|
||||
if( p.len == 0 && !first ) {
|
||||
if( p.pos == s.length )
|
||||
break;
|
||||
p.pos += 1;
|
||||
}
|
||||
b.addSub(s,pos,p.pos-pos);
|
||||
if( a.length > 0 )
|
||||
b.add(a[0]);
|
||||
var i = 1;
|
||||
while( i < a.length ) {
|
||||
var k = a[i];
|
||||
var c = k.charCodeAt(0);
|
||||
// 1...9
|
||||
if( c >= 49 && c <= 57 ) {
|
||||
var p = try _hx_regexp_matched_pos(r,Std.int(c)-48) catch( e : String ) null;
|
||||
if( p == null ){
|
||||
b.add("$");
|
||||
b.add(k);
|
||||
}else{
|
||||
b.addSub(s,p.pos,p.len);
|
||||
b.addSub(k,1,k.length - 1);
|
||||
}
|
||||
} else if( c == null ) {
|
||||
b.add("$");
|
||||
i++;
|
||||
var k2 = a[i];
|
||||
if( k2 != null && k2.length > 0 )
|
||||
b.add(k2);
|
||||
} else
|
||||
b.add("$"+k);
|
||||
i++;
|
||||
}
|
||||
var tot = p.pos + p.len - pos;
|
||||
pos += tot;
|
||||
len -= tot;
|
||||
first = false;
|
||||
} while( global );
|
||||
b.addSub(s,pos,len);
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public function map( s : String, f : EReg -> String ) : String {
|
||||
var offset = 0;
|
||||
var buf = new StringBuf();
|
||||
do {
|
||||
if (offset >= s.length)
|
||||
break;
|
||||
else if (!matchSub(s, offset)) {
|
||||
buf.add(s.substr(offset));
|
||||
break;
|
||||
}
|
||||
var p = _hx_regexp_matched_pos(r,0);
|
||||
buf.add(s.substr(offset, p.pos - offset));
|
||||
buf.add(f(this));
|
||||
if (p.len == 0) {
|
||||
buf.add(s.substr(p.pos, 1));
|
||||
offset = p.pos + 1;
|
||||
}
|
||||
else
|
||||
offset = p.pos + p.len;
|
||||
} while (global);
|
||||
if (!global && offset > 0 && offset < s.length)
|
||||
buf.add(s.substr(offset));
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
|
||||
@:extern @:native("_hx_regexp_new_options")
|
||||
static function _hx_regexp_new_options(s:String, options:String) : Dynamic return null;
|
||||
|
||||
@:extern @:native("_hx_regexp_match")
|
||||
static function _hx_regexp_match(handler: Dynamic, string:String, pos:Int, len:Int) : Bool return false;
|
||||
|
||||
@:extern @:native("_hx_regexp_matched")
|
||||
static function _hx_regexp_matched(handle:Dynamic, pos:Int) : String return null;
|
||||
|
||||
@:extern @:native("_hx_regexp_matched_pos")
|
||||
static function _hx_regexp_matched_pos(handle:Dynamic, match:Int) : {pos:Int, len:Int} return null;
|
||||
}
|
||||
112
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/Reflect.hx
generated
vendored
Normal file
112
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/Reflect.hx
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import cpp.ObjectType;
|
||||
|
||||
@:coreApi
|
||||
@:analyzer(ignore)
|
||||
class Reflect {
|
||||
|
||||
public static function hasField( o : Dynamic, field : String ) : Bool untyped {
|
||||
return o!=null && o.__HasField(field);
|
||||
}
|
||||
|
||||
public static function field( o : Dynamic, field : String ) : Dynamic untyped {
|
||||
return (o==null) ? null : o.__Field(field,untyped __cpp__("hx::paccNever") );
|
||||
}
|
||||
|
||||
public static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {
|
||||
if (o!=null)
|
||||
o.__SetField(field,value,untyped __cpp__("hx::paccNever") );
|
||||
}
|
||||
|
||||
public static function getProperty( o : Dynamic, field : String ) : Dynamic {
|
||||
return (o==null) ? null : o.__Field(field,untyped __cpp__("hx::paccAlways") );
|
||||
}
|
||||
|
||||
public static function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void {
|
||||
if (o!=null)
|
||||
o.__SetField(field,value,untyped __cpp__("hx::paccAlways") );
|
||||
}
|
||||
|
||||
public static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array<Dynamic> ) : Dynamic untyped {
|
||||
if (func!=null && func.__GetType()==ObjectType.vtString)
|
||||
func = o.__Field(func,untyped __cpp__("hx::paccDynamic"));
|
||||
untyped func.__SetThis(o);
|
||||
return untyped func.__Run(args);
|
||||
}
|
||||
|
||||
public static function fields( o : Dynamic ) : Array<String> untyped {
|
||||
if( o == null ) return new Array();
|
||||
var a : Array<String> = [];
|
||||
o.__GetFields(a);
|
||||
return a;
|
||||
}
|
||||
|
||||
public static function isFunction( f : Dynamic ) : Bool untyped {
|
||||
return f!=null && f.__GetType() == ObjectType.vtFunction;
|
||||
}
|
||||
|
||||
public static function compare<T>( a : T, b : T ) : Int {
|
||||
return ( a == b ) ? 0 : (((a:Dynamic) > (b:Dynamic)) ? 1 : -1);
|
||||
}
|
||||
|
||||
public static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {
|
||||
if( f1 == f2 )
|
||||
return true;
|
||||
if( !isFunction(f1) || !isFunction(f2) )
|
||||
return false;
|
||||
return untyped __global__.__hxcpp_same_closure(f1,f2);
|
||||
}
|
||||
|
||||
public static function isObject( v : Dynamic ) : Bool untyped {
|
||||
if (v==null) return false;
|
||||
var t:Int = v.__GetType();
|
||||
return t == ObjectType.vtObject || t==ObjectType.vtClass || t==ObjectType.vtString ||
|
||||
t==ObjectType.vtArray;
|
||||
}
|
||||
|
||||
public static function isEnumValue( v : Dynamic ) : Bool untyped {
|
||||
return v!=null && v.__GetType() == ObjectType.vtEnum;
|
||||
}
|
||||
|
||||
public static function deleteField( o : Dynamic, field : String ) : Bool untyped {
|
||||
if (o==null) return false;
|
||||
return untyped __global__.__hxcpp_anon_remove(o,field);
|
||||
}
|
||||
|
||||
public static function copy<T>( o : T ) : T {
|
||||
if (o==null) return null;
|
||||
if(untyped o.__GetType()==ObjectType.vtString ) return o;
|
||||
if(untyped o.__GetType()==ObjectType.vtArray )
|
||||
return untyped o.__Field("copy", untyped __cpp__("hx::paccDynamic"))();
|
||||
var o2 : Dynamic = {};
|
||||
for( f in Reflect.fields(o) )
|
||||
Reflect.setField(o2,f,Reflect.field(o,f));
|
||||
return o2;
|
||||
}
|
||||
|
||||
@:overload(function( f : Array<Dynamic> -> Void ) : Dynamic {})
|
||||
public static function makeVarArgs( f : Array<Dynamic> -> Dynamic ) : Dynamic {
|
||||
return untyped __global__.__hxcpp_create_var_args(f);
|
||||
}
|
||||
}
|
||||
51
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/Std.hx
generated
vendored
Normal file
51
hGameTest/node_modules/haxe/downloads/haxe/std/cpp/_std/Std.hx
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
@:coreApi class Std {
|
||||
@:keep public static function is( v : Dynamic, t : Dynamic ) : Bool {
|
||||
return untyped __global__.__instanceof(v,t);
|
||||
}
|
||||
|
||||
@:keep public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S {
|
||||
return Std.is(value, c) ? cast value : null;
|
||||
}
|
||||
|
||||
@:keep public static function string( s : Dynamic ) : String {
|
||||
return untyped s==null ? "null" : s.toString();
|
||||
}
|
||||
|
||||
@:keep public static function int( x : Float ) : Int {
|
||||
return untyped __global__.__int__(x);
|
||||
}
|
||||
|
||||
@:keep public static function parseInt( x : String ) : Null<Int> {
|
||||
return untyped __global__.__hxcpp_parse_int(x);
|
||||
}
|
||||
|
||||
@:keep public static function parseFloat( x : String ) : Float {
|
||||
return untyped __global__.__hxcpp_parse_float(x);
|
||||
}
|
||||
|
||||
@:keep public static function random( x : Int ) : Int {
|
||||
if (x <= 0) return 0;
|
||||
return untyped __global__.__hxcpp_irand(x);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user