code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
module vtkTemporalStatistics;
static import vtkd_im;
static import core.stdc.config;
static import std.conv;
static import std.string;
static import std.conv;
static import std.string;
static import vtkObjectBase;
static import vtkPassInputTypeAlgorithm;
class vtkTemporalStatistics : vtkPassInputTypeAlgorithm.vtkPassInputTypeAlgorithm {
private void* swigCPtr;
public this(void* cObject, bool ownCObject) {
super(vtkd_im.vtkTemporalStatistics_Upcast(cObject), ownCObject);
swigCPtr = cObject;
}
public static void* swigGetCPtr(vtkTemporalStatistics obj) {
return (obj is null) ? null : obj.swigCPtr;
}
mixin vtkd_im.SwigOperatorDefinitions;
public override void dispose() {
synchronized(this) {
if (swigCPtr !is null) {
if (swigCMemOwn) {
swigCMemOwn = false;
throw new object.Exception("C++ destructor does not have public access");
}
swigCPtr = null;
super.dispose();
}
}
}
public static int IsTypeOf(string type) {
auto ret = vtkd_im.vtkTemporalStatistics_IsTypeOf((type ? std.string.toStringz(type) : null));
return ret;
}
public static vtkTemporalStatistics SafeDownCast(vtkObjectBase.vtkObjectBase o) {
void* cPtr = vtkd_im.vtkTemporalStatistics_SafeDownCast(vtkObjectBase.vtkObjectBase.swigGetCPtr(o));
vtkTemporalStatistics ret = (cPtr is null) ? null : new vtkTemporalStatistics(cPtr, false);
return ret;
}
public vtkTemporalStatistics NewInstance() const {
void* cPtr = vtkd_im.vtkTemporalStatistics_NewInstance(cast(void*)swigCPtr);
vtkTemporalStatistics ret = (cPtr is null) ? null : new vtkTemporalStatistics(cPtr, false);
return ret;
}
alias vtkPassInputTypeAlgorithm.vtkPassInputTypeAlgorithm.NewInstance NewInstance;
public static vtkTemporalStatistics New() {
void* cPtr = vtkd_im.vtkTemporalStatistics_New();
vtkTemporalStatistics ret = (cPtr is null) ? null : new vtkTemporalStatistics(cPtr, false);
return ret;
}
public int GetComputeAverage() {
auto ret = vtkd_im.vtkTemporalStatistics_GetComputeAverage(cast(void*)swigCPtr);
return ret;
}
public void SetComputeAverage(int _arg) {
vtkd_im.vtkTemporalStatistics_SetComputeAverage(cast(void*)swigCPtr, _arg);
}
public void ComputeAverageOn() {
vtkd_im.vtkTemporalStatistics_ComputeAverageOn(cast(void*)swigCPtr);
}
public void ComputeAverageOff() {
vtkd_im.vtkTemporalStatistics_ComputeAverageOff(cast(void*)swigCPtr);
}
public int GetComputeMinimum() {
auto ret = vtkd_im.vtkTemporalStatistics_GetComputeMinimum(cast(void*)swigCPtr);
return ret;
}
public void SetComputeMinimum(int _arg) {
vtkd_im.vtkTemporalStatistics_SetComputeMinimum(cast(void*)swigCPtr, _arg);
}
public void ComputeMinimumOn() {
vtkd_im.vtkTemporalStatistics_ComputeMinimumOn(cast(void*)swigCPtr);
}
public void ComputeMinimumOff() {
vtkd_im.vtkTemporalStatistics_ComputeMinimumOff(cast(void*)swigCPtr);
}
public int GetComputeMaximum() {
auto ret = vtkd_im.vtkTemporalStatistics_GetComputeMaximum(cast(void*)swigCPtr);
return ret;
}
public void SetComputeMaximum(int _arg) {
vtkd_im.vtkTemporalStatistics_SetComputeMaximum(cast(void*)swigCPtr, _arg);
}
public void ComputeMaximumOn() {
vtkd_im.vtkTemporalStatistics_ComputeMaximumOn(cast(void*)swigCPtr);
}
public void ComputeMaximumOff() {
vtkd_im.vtkTemporalStatistics_ComputeMaximumOff(cast(void*)swigCPtr);
}
public int GetComputeStandardDeviation() {
auto ret = vtkd_im.vtkTemporalStatistics_GetComputeStandardDeviation(cast(void*)swigCPtr);
return ret;
}
public void SetComputeStandardDeviation(int _arg) {
vtkd_im.vtkTemporalStatistics_SetComputeStandardDeviation(cast(void*)swigCPtr, _arg);
}
public void ComputeStandardDeviationOn() {
vtkd_im.vtkTemporalStatistics_ComputeStandardDeviationOn(cast(void*)swigCPtr);
}
public void ComputeStandardDeviationOff() {
vtkd_im.vtkTemporalStatistics_ComputeStandardDeviationOff(cast(void*)swigCPtr);
}
}
|
D
|
/+ std.stdio
+ (c) 2007 John Ohno
+ Licensed under the GNU LGPL
+ Part of Project XANA
+/
module std.stdio;
import Stdout;
import Stdin;
import std.format;
import std.stdarg;
import std.string;
//import klib.Memory;
extern (C) int kernel_assert_strlen(char*);
extern(C) void putc(char c) {
if (Stdout.Stdout.cursor.x>=25 && Stdout.Stdout.cursor.y>=80) {
Stdout.Stdout.scrollDown();
}
Stdout.Stdout.putChar(c);
// kernel_assert_print(&c, 1, 0);
}
void puts(char[] s) {
/+ foreach (c; s) {
putc(c);
}+/
for (int i=0; i<s.length; i++) {
putc(s[i]);
}
// kernel_assert_print(&s[0], s.length, Stdout.Stdout.index);
// Stdout.Stdout.index+=s.length;
}
void writef(char[] f, TypeInfo[] args, va_list argptr, void* p_args) {
puts(format(f, args, argptr, p_args)); // non-worky, try appending and char instead ;-)
}
void writefl(char[] f, TypeInfo[] args, va_list argptr, void* p_args) {
puts(format(f, args, argptr, p_args)~"\n");
}
void writeln(char[] f) {
puts(f);
putc('\n');
}
extern(C) char getc() {
return KB_read();
}
/*private extern(C) char* read(int l) {
return cast(char*)(cast(void*)(read(l)~'\0'));
}*/
char[] read(int l) {
return KB_read(l);
}
private extern(C) char* gets(char* s) {
char[] s2=gets('\n');
memcpy(cast(void*)s, (cast(void*)(s2~"\0")), s2.length);
return s;
}
char[] gets(char delim=' ') {
char[] buf;
char temp;
temp=getc();
while (temp!=delim) {
if (temp=='\x03' || temp=='\x04') {
buf=buf[0 .. 0];
buf[0]=temp;
return buf;
}
buf~=temp;
temp=getc();
}
return buf;
}
char[] getln() {
return gets('\n');
}
|
D
|
/**
* DMD-specific parameters.
*
* Copyright: Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/dmdparams.d, _dmdparams.d)
* Documentation: https://dlang.org/phobos/dmd_dmdparams.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/dmdparams.d
*/
module dmd.dmdparams;
import dmd.target;
/// Position Indepent Code setting
enum PIC : ubyte
{
fixed, /// located at a specific address
pic, /// Position Independent Code
pie, /// Position Independent Executable
}
struct DMDparams
{
bool alwaysframe; // always emit standard stack frame
ubyte dwarf; // DWARF version
bool map; // generate linker .map file
bool vasm; // print generated assembler for each function
bool dll; // generate shared dynamic library
bool lib; // write library file instead of object file(s)
bool link = true; // perform link
bool oneobj; // write one object file instead of multiple ones
bool optimize; // run optimizer
bool nofloat; // code should not pull in floating point support
PIC pic = PIC.fixed; // generate fixed, pic or pie code
bool stackstomp; // add stack stomping code
ubyte symdebug; // insert debug symbolic information
bool symdebugref; // insert debug information for all referenced types, too
const(char)[] defaultlibname; // default library for non-debug builds
const(char)[] debuglibname; // default library for debug builds
const(char)[] mscrtlib; // MS C runtime library
// Hidden debug switches
bool debugb;
bool debugc;
bool debugf;
bool debugr;
bool debugx;
bool debugy;
}
/**
Sets CPU Operating System, and optionally C/C++ runtime environment from the given triple
e.g.
x86_64+avx2-apple-darwin20.3.0
x86-unknown-linux-musl-clang
x64-windows-msvc
x64-pc-windows-msvc
*/
struct Triple
{
private const(char)[] source;
CPU cpu;
bool is64bit;
bool isLP64;
Target.OS os;
ubyte osMajor;
TargetC.Runtime cenv;
TargetCPP.Runtime cppenv;
this(const(char)* _triple)
{
import dmd.root.string : toDString, toCStringThen;
const(char)[] triple = _triple.toDString();
const(char)[] next()
{
size_t i = 0;
const tmp = triple;
while (triple.length && triple[0] != '-')
{
triple = triple[1 .. $];
++i;
}
if (triple.length && triple[0] == '-')
{
triple = triple[1 .. $];
}
return tmp[0 .. i];
}
parseArch(next);
const(char)[] vendorOrOS = next();
const(char)[] _os;
if (tryParseVendor(vendorOrOS))
_os = next();
else
_os = vendorOrOS;
os = parseOS(_os, osMajor);
const(char)[] _cenv = next();
if (_cenv.length)
cenv = parseCEnv(_cenv);
else if (this.os == Target.OS.Windows)
cenv = TargetC.Runtime.Microsoft;
const(char)[] _cppenv = next();
if (_cppenv.length)
cppenv = parseCPPEnv(_cppenv);
else if (this.os == Target.OS.Windows)
cppenv = TargetCPP.Runtime.Microsoft;
}
private extern(D):
void unknown(const(char)[] unk, const(char)* what)
{
import dmd.errors : error;
import dmd.root.string : toCStringThen;
import dmd.globals : Loc;
unk.toCStringThen!(p => error(Loc.initial,"unknown %s `%s` for `-target`", what, p.ptr));
}
void parseArch(const(char)[] arch)
{
bool matches(const(char)[] str)
{
import dmd.root.string : startsWith;
if (!arch.ptr.startsWith(str))
return false;
arch = arch[str.length .. $];
return true;
}
if (matches("x86_64"))
is64bit = true;
else if (matches("x86"))
is64bit = false;
else if (matches("x64"))
is64bit = true;
else if (matches("x32"))
{
is64bit = true;
isLP64 = false;
}
else
return unknown(arch, "architecture");
if (!arch.length)
return;
switch (arch)
{
case "+sse2": cpu = CPU.sse2; break;
case "+avx": cpu = CPU.avx; break;
case "+avx2": cpu = CPU.avx2; break;
default:
unknown(arch, "architecture feature");
}
}
// try parsing vendor if present
bool tryParseVendor(const(char)[] vendor)
{
switch (vendor)
{
case "unknown": return true;
case "apple": return true;
case "pc": return true;
case "amd": return true;
default: return false;
}
}
/********************************
* Parse OS and osMajor version number.
* Params:
* _os = string to check for operating system followed by version number
* osMajor = set to version number (if any), otherwise set to 0.
* Set to 255 if version number is 255 or larger and error is generated
* Returns:
* detected operating system, Target.OS.none if none
*/
Target.OS parseOS(const(char)[] _os, out ubyte osMajor)
{
import dmd.errors : error;
import dmd.globals : Loc;
bool matches(const(char)[] str)
{
import dmd.root.string : startsWith;
if (!_os.ptr.startsWith(str))
return false;
_os = _os[str.length .. $];
return true;
}
Target.OS os;
if (matches("darwin"))
os = Target.OS.OSX;
else if (matches("dragonfly"))
os = Target.OS.DragonFlyBSD;
else if (matches("freebsd"))
os = Target.OS.FreeBSD;
else if (matches("openbsd"))
os = Target.OS.OpenBSD;
else if (matches("linux"))
os = Target.OS.linux;
else if (matches("windows"))
os = Target.OS.Windows;
else
{
unknown(_os, "operating system");
return Target.OS.none;
}
bool overflow;
auto major = parseNumber(_os, overflow);
if (overflow || major >= 255)
{
error(Loc.initial, "OS version overflowed max of 254");
major = 255;
}
osMajor = cast(ubyte)major;
/* Note that anything after the number up to the end or '-',
* such as '.3.4.hello.betty', is ignored
*/
return os;
}
/*******************************
* Parses a decimal number out of the str and returns it.
* Params:
* str = string to parse the number from, updated to text after the number
* overflow = set to true iff an overflow happens
* Returns:
* parsed number
*/
private pure static
uint parseNumber(ref const(char)[] str, ref bool overflow)
{
auto s = str;
ulong n;
while (s.length)
{
const c = s[0];
if (c < '0' || '9' < c)
break;
n = n * 10 + (c - '0');
overflow |= (n > uint.max); // sticky overflow check
s = s[1 .. $]; // consume digit
}
str = s;
return cast(uint)n;
}
TargetC.Runtime parseCEnv(const(char)[] cenv)
{
with (TargetC.Runtime) switch (cenv)
{
case "musl": return Musl;
case "msvc": return Microsoft;
case "bionic": return Bionic;
case "digital_mars": return DigitalMars;
case "newlib": return Newlib;
case "uclibc": return UClibc;
case "glibc": return Glibc;
default:
{
unknown(cenv, "C runtime environment");
return Unspecified;
}
}
}
TargetCPP.Runtime parseCPPEnv(const(char)[] cppenv)
{
with (TargetCPP.Runtime) switch (cppenv)
{
case "clang": return Clang;
case "gcc": return Gcc;
case "msvc": return Microsoft;
case "sun": return Sun;
case "digital_mars": return DigitalMars;
default:
{
unknown(cppenv, "C++ runtime environment");
return Unspecified;
}
}
}
}
void setTriple(ref Target target, const ref Triple triple)
{
target.cpu = triple.cpu;
target.is64bit = triple.is64bit;
target.isLP64 = triple.isLP64;
target.os = triple.os;
target.osMajor = triple.osMajor;
target.c.runtime = triple.cenv;
target.cpp.runtime = triple.cppenv;
}
/**
Returns: the final defaultlibname based on the command-line parameters
*/
extern (D) const(char)[] finalDefaultlibname()
{
import dmd.globals : global;
return global.params.betterC ? null :
driverParams.symdebug ? driverParams.debuglibname : driverParams.defaultlibname;
}
__gshared DMDparams driverParams = DMDparams.init;
|
D
|
/Users/aaronb/Development/Air-End/DerivedData/Air-End/Build/Intermediates/Air-End.build/Debug-iphonesimulator/Air-End.build/Objects-normal/x86_64/ListVC.o : /Users/aaronb/Development/Air-End/Air-End/MapVC-AddressTableViewDelegate-Extension.swift /Users/aaronb/Development/Air-End/Air-End/UIColor+Extension.swift /Users/aaronb/Development/Air-End/Air-End/TextToEnum-\ Extentsion.swift /Users/aaronb/Development/Air-End/Air-End/ListVC.swift /Users/aaronb/Development/Air-End/Air-End/MapVC.swift /Users/aaronb/Development/Air-End/Air-End/CorrectAddressTableView.swift /Users/aaronb/Development/Air-End/Air-End/ViewController-Conversions-Extension.swift /Users/aaronb/Development/Air-End/Air-End/ViewController-Extension.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-Guidance-ExtensionViewController.swift /Users/aaronb/Development/Air-End/Air-End/NewTaskVC.swift /Users/aaronb/Development/Air-End/Air-End/Theme.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-TextField-Extension.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-SegmentedControl-Extension.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapView.swift /Users/aaronb/Development/Air-End/Air-End/Noun.swift /Users/aaronb/Development/Air-End/Air-End/Task.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapVC.swift /Users/aaronb/Development/Air-End/Air-End/ListVC-LocationExtension.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapViewDelegate.swift /Users/aaronb/Development/Air-End/Air-End/AppDelegate.swift /Users/aaronb/Development/Air-End/Air-End/ColoredDatePicker.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/aaronb/Development/Air-End/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule ./Realm.framework/Headers/RLMObjectBase_Dynamic.h ./Realm.framework/Headers/RLMRealm_Dynamic.h ./Realm.framework/PrivateHeaders/RLMSchema_Private.h ./Realm.framework/PrivateHeaders/RLMResults_Private.h ./Realm.framework/PrivateHeaders/RLMRealm_Private.h ./Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h ./Realm.framework/PrivateHeaders/RLMProperty_Private.h ./Realm.framework/PrivateHeaders/RLMOptionalBase.h ./Realm.framework/PrivateHeaders/RLMObject_Private.h ./Realm.framework/PrivateHeaders/RLMObjectStore.h ./Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h ./Realm.framework/PrivateHeaders/RLMMigration_Private.h ./Realm.framework/PrivateHeaders/RLMListBase.h ./Realm.framework/PrivateHeaders/RLMArray_Private.h ./Realm.framework/PrivateHeaders/RLMAccessor.h ./Realm.framework/Headers/RLMSchema.h ./Realm.framework/Headers/RLMResults.h ./Realm.framework/Headers/RLMRealmConfiguration.h ./Realm.framework/Headers/RLMRealm.h ./Realm.framework/Headers/RLMConstants.h ./Realm.framework/Headers/RLMProperty.h ./Realm.framework/Headers/RLMPlatform.h ./Realm.framework/Headers/RLMObjectSchema.h ./Realm.framework/Headers/RLMObjectBase.h ./Realm.framework/Headers/RLMObject.h ./Realm.framework/Headers/RLMMigration.h ./Realm.framework/Headers/RLMDefines.h ./Realm.framework/Headers/RLMCollection.h ./Realm.framework/Headers/RLMArray.h ./Realm.framework/Headers/Realm.h ./Realm.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
/Users/aaronb/Development/Air-End/DerivedData/Air-End/Build/Intermediates/Air-End.build/Debug-iphonesimulator/Air-End.build/Objects-normal/x86_64/ListVC~partial.swiftmodule : /Users/aaronb/Development/Air-End/Air-End/MapVC-AddressTableViewDelegate-Extension.swift /Users/aaronb/Development/Air-End/Air-End/UIColor+Extension.swift /Users/aaronb/Development/Air-End/Air-End/TextToEnum-\ Extentsion.swift /Users/aaronb/Development/Air-End/Air-End/ListVC.swift /Users/aaronb/Development/Air-End/Air-End/MapVC.swift /Users/aaronb/Development/Air-End/Air-End/CorrectAddressTableView.swift /Users/aaronb/Development/Air-End/Air-End/ViewController-Conversions-Extension.swift /Users/aaronb/Development/Air-End/Air-End/ViewController-Extension.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-Guidance-ExtensionViewController.swift /Users/aaronb/Development/Air-End/Air-End/NewTaskVC.swift /Users/aaronb/Development/Air-End/Air-End/Theme.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-TextField-Extension.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-SegmentedControl-Extension.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapView.swift /Users/aaronb/Development/Air-End/Air-End/Noun.swift /Users/aaronb/Development/Air-End/Air-End/Task.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapVC.swift /Users/aaronb/Development/Air-End/Air-End/ListVC-LocationExtension.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapViewDelegate.swift /Users/aaronb/Development/Air-End/Air-End/AppDelegate.swift /Users/aaronb/Development/Air-End/Air-End/ColoredDatePicker.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/aaronb/Development/Air-End/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule ./Realm.framework/Headers/RLMObjectBase_Dynamic.h ./Realm.framework/Headers/RLMRealm_Dynamic.h ./Realm.framework/PrivateHeaders/RLMSchema_Private.h ./Realm.framework/PrivateHeaders/RLMResults_Private.h ./Realm.framework/PrivateHeaders/RLMRealm_Private.h ./Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h ./Realm.framework/PrivateHeaders/RLMProperty_Private.h ./Realm.framework/PrivateHeaders/RLMOptionalBase.h ./Realm.framework/PrivateHeaders/RLMObject_Private.h ./Realm.framework/PrivateHeaders/RLMObjectStore.h ./Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h ./Realm.framework/PrivateHeaders/RLMMigration_Private.h ./Realm.framework/PrivateHeaders/RLMListBase.h ./Realm.framework/PrivateHeaders/RLMArray_Private.h ./Realm.framework/PrivateHeaders/RLMAccessor.h ./Realm.framework/Headers/RLMSchema.h ./Realm.framework/Headers/RLMResults.h ./Realm.framework/Headers/RLMRealmConfiguration.h ./Realm.framework/Headers/RLMRealm.h ./Realm.framework/Headers/RLMConstants.h ./Realm.framework/Headers/RLMProperty.h ./Realm.framework/Headers/RLMPlatform.h ./Realm.framework/Headers/RLMObjectSchema.h ./Realm.framework/Headers/RLMObjectBase.h ./Realm.framework/Headers/RLMObject.h ./Realm.framework/Headers/RLMMigration.h ./Realm.framework/Headers/RLMDefines.h ./Realm.framework/Headers/RLMCollection.h ./Realm.framework/Headers/RLMArray.h ./Realm.framework/Headers/Realm.h ./Realm.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
/Users/aaronb/Development/Air-End/DerivedData/Air-End/Build/Intermediates/Air-End.build/Debug-iphonesimulator/Air-End.build/Objects-normal/x86_64/ListVC~partial.swiftdoc : /Users/aaronb/Development/Air-End/Air-End/MapVC-AddressTableViewDelegate-Extension.swift /Users/aaronb/Development/Air-End/Air-End/UIColor+Extension.swift /Users/aaronb/Development/Air-End/Air-End/TextToEnum-\ Extentsion.swift /Users/aaronb/Development/Air-End/Air-End/ListVC.swift /Users/aaronb/Development/Air-End/Air-End/MapVC.swift /Users/aaronb/Development/Air-End/Air-End/CorrectAddressTableView.swift /Users/aaronb/Development/Air-End/Air-End/ViewController-Conversions-Extension.swift /Users/aaronb/Development/Air-End/Air-End/ViewController-Extension.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-Guidance-ExtensionViewController.swift /Users/aaronb/Development/Air-End/Air-End/NewTaskVC.swift /Users/aaronb/Development/Air-End/Air-End/Theme.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-TextField-Extension.swift /Users/aaronb/Development/Air-End/Air-End/MapVC-SegmentedControl-Extension.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapView.swift /Users/aaronb/Development/Air-End/Air-End/Noun.swift /Users/aaronb/Development/Air-End/Air-End/Task.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapVC.swift /Users/aaronb/Development/Air-End/Air-End/ListVC-LocationExtension.swift /Users/aaronb/Development/Air-End/Air-End/TaskMapViewDelegate.swift /Users/aaronb/Development/Air-End/Air-End/AppDelegate.swift /Users/aaronb/Development/Air-End/Air-End/ColoredDatePicker.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/aaronb/Development/Air-End/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule ./Realm.framework/Headers/RLMObjectBase_Dynamic.h ./Realm.framework/Headers/RLMRealm_Dynamic.h ./Realm.framework/PrivateHeaders/RLMSchema_Private.h ./Realm.framework/PrivateHeaders/RLMResults_Private.h ./Realm.framework/PrivateHeaders/RLMRealm_Private.h ./Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h ./Realm.framework/PrivateHeaders/RLMProperty_Private.h ./Realm.framework/PrivateHeaders/RLMOptionalBase.h ./Realm.framework/PrivateHeaders/RLMObject_Private.h ./Realm.framework/PrivateHeaders/RLMObjectStore.h ./Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h ./Realm.framework/PrivateHeaders/RLMMigration_Private.h ./Realm.framework/PrivateHeaders/RLMListBase.h ./Realm.framework/PrivateHeaders/RLMArray_Private.h ./Realm.framework/PrivateHeaders/RLMAccessor.h ./Realm.framework/Headers/RLMSchema.h ./Realm.framework/Headers/RLMResults.h ./Realm.framework/Headers/RLMRealmConfiguration.h ./Realm.framework/Headers/RLMRealm.h ./Realm.framework/Headers/RLMConstants.h ./Realm.framework/Headers/RLMProperty.h ./Realm.framework/Headers/RLMPlatform.h ./Realm.framework/Headers/RLMObjectSchema.h ./Realm.framework/Headers/RLMObjectBase.h ./Realm.framework/Headers/RLMObject.h ./Realm.framework/Headers/RLMMigration.h ./Realm.framework/Headers/RLMDefines.h ./Realm.framework/Headers/RLMCollection.h ./Realm.framework/Headers/RLMArray.h ./Realm.framework/Headers/Realm.h ./Realm.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
|
D
|
/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
/*
* Conversion parameters:
* inFile = GstIndexFactory.html
* outPack = gstreamer
* outFile = IndexFactory
* strct = GstIndexFactory
* realStrct=
* ctorStrct=
* clss = IndexFactory
* interf =
* class Code: No
* interface Code: No
* template for:
* extend =
* implements:
* prefixes:
* - gst_index_factory_
* - gst_
* omit structs:
* omit prefixes:
* omit code:
* omit signals:
* imports:
* - gtkD.glib.Str
* - gtkD.gstreamer.Index
* structWrap:
* - GstIndex* -> Index
* - GstIndexFactory* -> IndexFactory
* module aliases:
* local aliases:
* overrides:
*/
module gtkD.gstreamer.IndexFactory;
public import gtkD.gstreamerc.gstreamertypes;
private import gtkD.gstreamerc.gstreamer;
private import gtkD.glib.ConstructionException;
private import gtkD.glib.Str;
private import gtkD.gstreamer.Index;
private import gtkD.gstreamer.PluginFeature;
/**
* Description
* GstIndexFactory is used to dynamically create GstIndex implementations.
*/
public class IndexFactory : PluginFeature
{
/** the main Gtk struct */
protected GstIndexFactory* gstIndexFactory;
public GstIndexFactory* getIndexFactoryStruct()
{
return gstIndexFactory;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gstIndexFactory;
}
/**
* Sets our main struct and passes it to the parent class
*/
public this (GstIndexFactory* gstIndexFactory)
{
if(gstIndexFactory is null)
{
this = null;
return;
}
//Check if there already is a D object for this gtk struct
void* ptr = getDObject(cast(GObject*)gstIndexFactory);
if( ptr !is null )
{
this = cast(IndexFactory)ptr;
return;
}
super(cast(GstPluginFeature*)gstIndexFactory);
this.gstIndexFactory = gstIndexFactory;
}
/**
*/
/**
* Create a new indexfactory with the given parameters
* Params:
* name = name of indexfactory to create
* longdesc = long description of indexfactory to create
* type = the GType of the GstIndex element of this factory
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this (string name, string longdesc, GType type)
{
// GstIndexFactory* gst_index_factory_new (const gchar *name, const gchar *longdesc, GType type);
auto p = gst_index_factory_new(Str.toStringz(name), Str.toStringz(longdesc), type);
if(p is null)
{
throw new ConstructionException("null returned by gst_index_factory_new(Str.toStringz(name), Str.toStringz(longdesc), type)");
}
this(cast(GstIndexFactory*) p);
}
/**
* Removes the index from the global list.
*/
public void destroy()
{
// void gst_index_factory_destroy (GstIndexFactory *factory);
gst_index_factory_destroy(gstIndexFactory);
}
/**
* Search for an indexfactory of the given name.
* Params:
* name = name of indexfactory to find
* Returns: GstIndexFactory if found, NULL otherwise
*/
public static IndexFactory find(string name)
{
// GstIndexFactory* gst_index_factory_find (const gchar *name);
auto p = gst_index_factory_find(Str.toStringz(name));
if(p is null)
{
return null;
}
return new IndexFactory(cast(GstIndexFactory*) p);
}
/**
* Create a new GstIndex instance from the
* given indexfactory.
* Returns: A new GstIndex instance.
*/
public Index create()
{
// GstIndex* gst_index_factory_create (GstIndexFactory *factory);
auto p = gst_index_factory_create(gstIndexFactory);
if(p is null)
{
return null;
}
return new Index(cast(GstIndex*) p);
}
/**
* Create a new GstIndex instance from the
* indexfactory with the given name.
* Params:
* name = the name of the factory used to create the instance
* Returns: A new GstIndex instance.
*/
public static Index make(string name)
{
// GstIndex* gst_index_factory_make (const gchar *name);
auto p = gst_index_factory_make(Str.toStringz(name));
if(p is null)
{
return null;
}
return new Index(cast(GstIndex*) p);
}
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwt.events.PaintEvent;
import dwt.dwthelper.utils;
import dwt.events.TypedEvent;
import dwt.graphics.GC;
import dwt.widgets.Event;
import tango.text.convert.Format;
/**
* Instances of this class are sent as a result of
* visible areas of controls requiring re-painting.
*
* @see PaintListener
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public final class PaintEvent : TypedEvent {
/**
* the graphics context to use when painting
* that is configured to use the colors, font and
* damaged region of the control. It is valid
* only during the paint and must not be disposed
*/
public GC gc;
/**
* the x offset of the bounding rectangle of the
* region that requires painting
*/
public int x;
/**
* the y offset of the bounding rectangle of the
* region that requires painting
*/
public int y;
/**
* the width of the bounding rectangle of the
* region that requires painting
*/
public int width;
/**
* the height of the bounding rectangle of the
* region that requires painting
*/
public int height;
/**
* the number of following paint events which
* are pending which may always be zero on
* some platforms
*/
public int count;
static const long serialVersionUID = 3256446919205992497L;
/**
* Constructs a new instance of this class based on the
* information in the given untyped event.
*
* @param e the untyped event containing the information
*/
public this(Event e) {
super(e);
this.gc = e.gc;
this.x = e.x;
this.y = e.y;
this.width = e.width;
this.height = e.height;
this.count = e.count;
}
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the event
*/
public override String toString() {
String string = super.toString ();
return Format("{}{}{}{}{}{}{}{}{}{}{}{}{}{}", string[0 .. string.length - 1] // remove trailing '}'
, " gc=" , gc
, " x=" , x
, " y=" , y
, " width=" , width
, " height=" , height
, " count=" , count
, "}");
}
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/errors.d, _errors.d)
* Documentation: https://dlang.org/phobos/dmd_errors.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/errors.d
*/
module dmd.errors;
import core.stdc.stdarg;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.globals;
import dmd.root.outbuffer;
import dmd.root.rmem;
import dmd.root.string;
import dmd.console;
nothrow:
/// Interface for diagnostic reporting.
abstract class DiagnosticReporter
{
nothrow:
/// Returns: the number of errors that occurred during lexing or parsing.
abstract int errorCount();
/// Returns: the number of warnings that occurred during lexing or parsing.
abstract int warningCount();
/// Returns: the number of deprecations that occurred during lexing or parsing.
abstract int deprecationCount();
/**
Reports an error message.
Params:
loc = Location of error
format = format string for error
... = format string arguments
*/
final void error(const ref Loc loc, const(char)* format, ...)
{
va_list args;
va_start(args, format);
error(loc, format, args);
va_end(args);
}
/// ditto
abstract void error(const ref Loc loc, const(char)* format, va_list args);
/**
Reports additional details about an error message.
Params:
loc = Location of error
format = format string for supplemental message
... = format string arguments
*/
final void errorSupplemental(const ref Loc loc, const(char)* format, ...)
{
va_list args;
va_start(args, format);
errorSupplemental(loc, format, args);
va_end(args);
}
/// ditto
abstract void errorSupplemental(const ref Loc loc, const(char)* format, va_list);
/**
Reports a warning message.
Params:
loc = Location of warning
format = format string for warning
... = format string arguments
*/
final void warning(const ref Loc loc, const(char)* format, ...)
{
va_list args;
va_start(args, format);
warning(loc, format, args);
va_end(args);
}
/// ditto
abstract void warning(const ref Loc loc, const(char)* format, va_list args);
/**
Reports additional details about a warning message.
Params:
loc = Location of warning
format = format string for supplemental message
... = format string arguments
*/
final void warningSupplemental(const ref Loc loc, const(char)* format, ...)
{
va_list args;
va_start(args, format);
warningSupplemental(loc, format, args);
va_end(args);
}
/// ditto
abstract void warningSupplemental(const ref Loc loc, const(char)* format, va_list);
/**
Reports a deprecation message.
Params:
loc = Location of the deprecation
format = format string for the deprecation
... = format string arguments
*/
final void deprecation(const ref Loc loc, const(char)* format, ...)
{
va_list args;
va_start(args, format);
deprecation(loc, format, args);
va_end(args);
}
/// ditto
abstract void deprecation(const ref Loc loc, const(char)* format, va_list args);
/**
Reports additional details about a deprecation message.
Params:
loc = Location of deprecation
format = format string for supplemental message
... = format string arguments
*/
final void deprecationSupplemental(const ref Loc loc, const(char)* format, ...)
{
va_list args;
va_start(args, format);
deprecationSupplemental(loc, format, args);
va_end(args);
}
/// ditto
abstract void deprecationSupplemental(const ref Loc loc, const(char)* format, va_list);
}
/**
Diagnostic reporter which prints the diagnostic messages to stderr.
This is usually the default diagnostic reporter.
*/
final class StderrDiagnosticReporter : DiagnosticReporter
{
private const DiagnosticReporting useDeprecated;
private int errorCount_;
private int warningCount_;
private int deprecationCount_;
nothrow:
/**
Initializes this object.
Params:
useDeprecated = indicates how deprecation diagnostics should be
handled
*/
this(DiagnosticReporting useDeprecated)
{
this.useDeprecated = useDeprecated;
}
override int errorCount()
{
return errorCount_;
}
override int warningCount()
{
return warningCount_;
}
override int deprecationCount()
{
return deprecationCount_;
}
override void error(const ref Loc loc, const(char)* format, va_list args)
{
verror(loc, format, args);
errorCount_++;
}
override void errorSupplemental(const ref Loc loc, const(char)* format, va_list args)
{
verrorSupplemental(loc, format, args);
}
override void warning(const ref Loc loc, const(char)* format, va_list args)
{
vwarning(loc, format, args);
warningCount_++;
}
override void warningSupplemental(const ref Loc loc, const(char)* format, va_list args)
{
vwarningSupplemental(loc, format, args);
}
override void deprecation(const ref Loc loc, const(char)* format, va_list args)
{
vdeprecation(loc, format, args);
if (useDeprecated == DiagnosticReporting.error)
errorCount_++;
else
deprecationCount_++;
}
override void deprecationSupplemental(const ref Loc loc, const(char)* format, va_list args)
{
vdeprecationSupplemental(loc, format, args);
}
}
/**
* Color highlighting to classify messages
*/
enum Classification
{
error = Color.brightRed, /// for errors
gagged = Color.brightBlue, /// for gagged errors
warning = Color.brightYellow, /// for warnings
deprecation = Color.brightCyan, /// for deprecations
tip = Color.brightGreen, /// for tip messages
}
/**
* Print an error message, increasing the global error count.
* Params:
* loc = location of error
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void error(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
verror(loc, format, ap);
va_end(ap);
}
/**
* Same as above, but allows Loc() literals to be passed.
* Params:
* loc = location of error
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (D) void error(Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
verror(loc, format, ap);
va_end(ap);
}
/**
* Same as above, but takes a filename and line information arguments as separate parameters.
* Params:
* filename = source file of error
* linnum = line in the source file
* charnum = column number on the line
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void error(const(char)* filename, uint linnum, uint charnum, const(char)* format, ...)
{
const loc = Loc(filename, linnum, charnum);
va_list ap;
va_start(ap, format);
verror(loc, format, ap);
va_end(ap);
}
/**
* Print additional details about an error message.
* Doesn't increase the error count or print an additional error prefix.
* Params:
* loc = location of error
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void errorSupplemental(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
verrorSupplemental(loc, format, ap);
va_end(ap);
}
/**
* Print a warning message, increasing the global warning count.
* Params:
* loc = location of warning
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void warning(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vwarning(loc, format, ap);
va_end(ap);
}
/**
* Print additional details about a warning message.
* Doesn't increase the warning count or print an additional warning prefix.
* Params:
* loc = location of warning
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void warningSupplemental(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vwarningSupplemental(loc, format, ap);
va_end(ap);
}
/**
* Print a deprecation message, may increase the global warning or error count
* depending on whether deprecations are ignored.
* Params:
* loc = location of deprecation
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void deprecation(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vdeprecation(loc, format, ap);
va_end(ap);
}
/**
* Print additional details about a deprecation message.
* Doesn't increase the error count, or print an additional deprecation prefix.
* Params:
* loc = location of deprecation
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void deprecationSupplemental(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vdeprecationSupplemental(loc, format, ap);
va_end(ap);
}
/**
* Print a verbose message.
* Doesn't prefix or highlight messages.
* Params:
* loc = location of message
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void message(const ref Loc loc, const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vmessage(loc, format, ap);
va_end(ap);
}
/**
* Same as above, but doesn't take a location argument.
* Params:
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void message(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vmessage(Loc.initial, format, ap);
va_end(ap);
}
/**
* The type of the diagnostic handler
* see verrorPrint for arguments
* Returns: true if error handling is done, false to continue printing to stderr
*/
alias DiagnosticHandler = bool delegate(const ref Loc location, Color headerColor, const(char)* header, const(char)* messageFormat, va_list args, const(char)* prefix1, const(char)* prefix2);
/**
* The diagnostic handler.
* If non-null it will be called for every diagnostic message issued by the compiler.
* If it returns false, the message will be printed to stderr as usual.
*/
__gshared DiagnosticHandler diagnosticHandler;
/**
* Print a tip message with the prefix and highlighting.
* Params:
* format = printf-style format specification
* ... = printf-style variadic arguments
*/
extern (C++) void tip(const(char)* format, ...)
{
va_list ap;
va_start(ap, format);
vtip(format, ap);
va_end(ap);
}
/**
* Just print to stderr, doesn't care about gagging.
* (format,ap) text within backticks gets syntax highlighted.
* Params:
* loc = location of error
* headerColor = color to set `header` output to
* header = title of error message
* format = printf-style format specification
* ap = printf-style variadic arguments
* p1 = additional message prefix
* p2 = additional message prefix
*/
private void verrorPrint(const ref Loc loc, Color headerColor, const(char)* header,
const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null)
{
if (diagnosticHandler && diagnosticHandler(loc, headerColor, header, format, ap, p1, p2))
return;
if (global.params.showGaggedErrors && global.gag)
fprintf(stderr, "(spec:%d) ", global.gag);
Console* con = cast(Console*)global.console;
const p = loc.toChars();
if (con)
con.setColorBright(true);
if (*p)
{
fprintf(stderr, "%s: ", p);
mem.xfree(cast(void*)p);
}
if (con)
con.setColor(headerColor);
fputs(header, stderr);
if (con)
con.resetColor();
OutBuffer tmp;
if (p1)
{
tmp.writestring(p1);
tmp.writestring(" ");
}
if (p2)
{
tmp.writestring(p2);
tmp.writestring(" ");
}
tmp.vprintf(format, ap);
if (con && strchr(tmp.peekChars(), '`'))
{
colorSyntaxHighlight(tmp);
writeHighlights(con, tmp);
}
else
fputs(tmp.peekChars(), stderr);
fputc('\n', stderr);
if (global.params.printErrorContext &&
// ignore invalid files
loc != Loc.initial &&
// ignore mixins for now
!loc.filename.strstr(".d-mixin-") &&
!global.params.mixinOut)
{
import dmd.filecache : FileCache;
auto fllines = FileCache.fileCache.addOrGetFile(loc.filename.toDString());
if (loc.linnum - 1 < fllines.lines.length)
{
auto line = fllines.lines[loc.linnum - 1];
if (loc.charnum < line.length)
{
fprintf(stderr, "%.*s\n", cast(int)line.length, line.ptr);
foreach (_; 1 .. loc.charnum)
fputc(' ', stderr);
fputc('^', stderr);
fputc('\n', stderr);
}
}
}
fflush(stderr); // ensure it gets written out in case of compiler aborts
}
/**
* Same as $(D error), but takes a va_list parameter, and optionally additional message prefixes.
* Params:
* loc = location of error
* format = printf-style format specification
* ap = printf-style variadic arguments
* p1 = additional message prefix
* p2 = additional message prefix
* header = title of error message
*/
extern (C++) void verror(const ref Loc loc, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null, const(char)* header = "Error: ")
{
global.errors++;
if (!global.gag)
{
verrorPrint(loc, Classification.error, header, format, ap, p1, p2);
if (global.params.errorLimit && global.errors >= global.params.errorLimit)
fatal(); // moderate blizzard of cascading messages
}
else
{
if (global.params.showGaggedErrors)
verrorPrint(loc, Classification.gagged, header, format, ap, p1, p2);
global.gaggedErrors++;
}
}
/**
* Same as $(D errorSupplemental), but takes a va_list parameter.
* Params:
* loc = location of error
* format = printf-style format specification
* ap = printf-style variadic arguments
*/
extern (C++) void verrorSupplemental(const ref Loc loc, const(char)* format, va_list ap)
{
Color color;
if (global.gag)
{
if (!global.params.showGaggedErrors)
return;
color = Classification.gagged;
}
else
color = Classification.error;
verrorPrint(loc, color, " ", format, ap);
}
/**
* Same as $(D warning), but takes a va_list parameter.
* Params:
* loc = location of warning
* format = printf-style format specification
* ap = printf-style variadic arguments
*/
extern (C++) void vwarning(const ref Loc loc, const(char)* format, va_list ap)
{
if (global.params.warnings != DiagnosticReporting.off)
{
if (!global.gag)
{
verrorPrint(loc, Classification.warning, "Warning: ", format, ap);
if (global.params.warnings == DiagnosticReporting.error)
global.warnings++;
}
else
{
global.gaggedWarnings++;
}
}
}
/**
* Same as $(D warningSupplemental), but takes a va_list parameter.
* Params:
* loc = location of warning
* format = printf-style format specification
* ap = printf-style variadic arguments
*/
extern (C++) void vwarningSupplemental(const ref Loc loc, const(char)* format, va_list ap)
{
if (global.params.warnings != DiagnosticReporting.off && !global.gag)
verrorPrint(loc, Classification.warning, " ", format, ap);
}
/**
* Same as $(D deprecation), but takes a va_list parameter, and optionally additional message prefixes.
* Params:
* loc = location of deprecation
* format = printf-style format specification
* ap = printf-style variadic arguments
* p1 = additional message prefix
* p2 = additional message prefix
*/
extern (C++) void vdeprecation(const ref Loc loc, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null)
{
__gshared const(char)* header = "Deprecation: ";
if (global.params.useDeprecated == DiagnosticReporting.error)
verror(loc, format, ap, p1, p2, header);
else if (global.params.useDeprecated == DiagnosticReporting.inform)
{
if (!global.gag)
{
verrorPrint(loc, Classification.deprecation, header, format, ap, p1, p2);
}
else
{
global.gaggedWarnings++;
}
}
}
/**
* Same as $(D message), but takes a va_list parameter.
* Params:
* loc = location of message
* format = printf-style format specification
* ap = printf-style variadic arguments
*/
extern (C++) void vmessage(const ref Loc loc, const(char)* format, va_list ap)
{
const p = loc.toChars();
if (*p)
{
fprintf(stdout, "%s: ", p);
mem.xfree(cast(void*)p);
}
OutBuffer tmp;
tmp.vprintf(format, ap);
fputs(tmp.peekChars(), stdout);
fputc('\n', stdout);
fflush(stdout); // ensure it gets written out in case of compiler aborts
}
/**
* Same as $(D tip), but takes a va_list parameter.
* Params:
* format = printf-style format specification
* ap = printf-style variadic arguments
*/
extern (C++) void vtip(const(char)* format, va_list ap)
{
if (!global.gag)
{
Loc loc = Loc.init;
verrorPrint(loc, Classification.tip, " Tip: ", format, ap);
}
}
/**
* Same as $(D deprecationSupplemental), but takes a va_list parameter.
* Params:
* loc = location of deprecation
* format = printf-style format specification
* ap = printf-style variadic arguments
*/
extern (C++) void vdeprecationSupplemental(const ref Loc loc, const(char)* format, va_list ap)
{
if (global.params.useDeprecated == DiagnosticReporting.error)
verrorSupplemental(loc, format, ap);
else if (global.params.useDeprecated == DiagnosticReporting.inform && !global.gag)
verrorPrint(loc, Classification.deprecation, " ", format, ap);
}
/**
* Call this after printing out fatal error messages to clean up and exit
* the compiler.
*/
extern (C++) void fatal()
{
version (none)
{
halt();
}
exit(EXIT_FAILURE);
}
/**
* Try to stop forgetting to remove the breakpoints from
* release builds.
*/
extern (C++) void halt()
{
assert(0);
}
/**
* Scan characters in `buf`. Assume text enclosed by `...`
* is D source code, and color syntax highlight it.
* Modify contents of `buf` with highlighted result.
* Many parallels to ddoc.highlightText().
* Params:
* buf = text containing `...` code to highlight
*/
private void colorSyntaxHighlight(ref OutBuffer buf)
{
//printf("colorSyntaxHighlight('%.*s')\n", cast(int)buf.length, buf.data);
bool inBacktick = false;
size_t iCodeStart = 0;
size_t offset = 0;
for (size_t i = offset; i < buf.length; ++i)
{
char c = buf[i];
switch (c)
{
case '`':
if (inBacktick)
{
inBacktick = false;
OutBuffer codebuf;
codebuf.write(buf[iCodeStart + 1 .. i]);
codebuf.writeByte(0);
// escape the contents, but do not perform highlighting except for DDOC_PSYMBOL
colorHighlightCode(codebuf);
buf.remove(iCodeStart, i - iCodeStart + 1); // also trimming off the current `
immutable pre = "";
i = buf.insert(iCodeStart, pre);
i = buf.insert(i, codebuf[]);
i--; // point to the ending ) so when the for loop does i++, it will see the next character
break;
}
inBacktick = true;
iCodeStart = i;
break;
default:
break;
}
}
}
/**
* Embed these highlighting commands in the text stream.
* HIGHLIGHT.Escape indicates a Color follows.
*/
enum HIGHLIGHT : ubyte
{
Default = Color.black, // back to whatever the console is set at
Escape = '\xFF', // highlight Color follows
Identifier = Color.white,
Keyword = Color.white,
Literal = Color.white,
Comment = Color.darkGray,
Other = Color.cyan, // other tokens
}
/**
* Highlight code for CODE section.
* Rewrite the contents of `buf` with embedded highlights.
* Analogous to doc.highlightCode2()
*/
private void colorHighlightCode(ref OutBuffer buf)
{
import dmd.lexer;
import dmd.tokens;
__gshared int nested;
if (nested)
{
// Should never happen, but don't infinitely recurse if it does
--nested;
return;
}
++nested;
auto gaggedErrorsSave = global.startGagging();
scope diagnosticReporter = new StderrDiagnosticReporter(global.params.useDeprecated);
scope Lexer lex = new Lexer(null, cast(char*)buf[].ptr, 0, buf.length - 1, 0, 1, diagnosticReporter);
OutBuffer res;
const(char)* lastp = cast(char*)buf[].ptr;
//printf("colorHighlightCode('%.*s')\n", cast(int)(buf.length - 1), buf.data);
res.reserve(buf.length);
res.writeByte(HIGHLIGHT.Escape);
res.writeByte(HIGHLIGHT.Other);
while (1)
{
Token tok;
lex.scan(&tok);
res.writestring(lastp[0 .. tok.ptr - lastp]);
HIGHLIGHT highlight;
switch (tok.value)
{
case TOK.identifier:
highlight = HIGHLIGHT.Identifier;
break;
case TOK.comment:
highlight = HIGHLIGHT.Comment;
break;
case TOK.int32Literal:
..
case TOK.dcharLiteral:
case TOK.string_:
highlight = HIGHLIGHT.Literal;
break;
default:
if (tok.isKeyword())
highlight = HIGHLIGHT.Keyword;
break;
}
if (highlight != HIGHLIGHT.Default)
{
res.writeByte(HIGHLIGHT.Escape);
res.writeByte(highlight);
res.writestring(tok.ptr[0 .. lex.p - tok.ptr]);
res.writeByte(HIGHLIGHT.Escape);
res.writeByte(HIGHLIGHT.Other);
}
else
res.writestring(tok.ptr[0 .. lex.p - tok.ptr]);
if (tok.value == TOK.endOfFile)
break;
lastp = lex.p;
}
res.writeByte(HIGHLIGHT.Escape);
res.writeByte(HIGHLIGHT.Default);
//printf("res = '%.*s'\n", cast(int)buf.length, buf.data);
buf.setsize(0);
buf.write(&res);
global.endGagging(gaggedErrorsSave);
--nested;
}
/**
* Write the buffer contents with embedded highlights to stderr.
* Params:
* buf = highlighted text
*/
private void writeHighlights(Console* con, ref const OutBuffer buf)
{
bool colors;
scope (exit)
{
/* Do not mess up console if highlighting aborts
*/
if (colors)
con.resetColor();
}
for (size_t i = 0; i < buf.length; ++i)
{
const c = buf[i];
if (c == HIGHLIGHT.Escape)
{
const color = buf[++i];
if (color == HIGHLIGHT.Default)
{
con.resetColor();
colors = false;
}
else
if (color == Color.white)
{
con.resetColor();
con.setColorBright(true);
colors = true;
}
else
{
con.setColor(cast(Color)color);
colors = true;
}
}
else
fputc(c, con.fp);
}
}
|
D
|
module dwt.internal.mozilla.nsITransfer;
import dwt.internal.mozilla.Common;
import dwt.internal.mozilla.nsID;
import dwt.internal.mozilla.nsISupports;
import dwt.internal.mozilla.prtime;
import dwt.internal.mozilla.nsIWebProgressListener2;
import dwt.internal.mozilla.nsIURI;
import dwt.internal.mozilla.nsICancelable;
import dwt.internal.mozilla.nsIMIMEInfo;
import dwt.internal.mozilla.nsILocalFile;
import dwt.internal.mozilla.nsStringAPI;
const char[] NS_ITRANSFER_IID_STR = "23c51569-e9a1-4a92-adeb-3723db82ef7c";
const nsIID NS_ITRANSFER_IID=
{0x23c51569, 0xe9a1, 0x4a92,
[ 0xad, 0xeb, 0x37, 0x23, 0xdb, 0x82, 0xef, 0x7c ]};
interface nsITransfer : nsIWebProgressListener2 {
static const char[] IID_STR = NS_ITRANSFER_IID_STR;
static const nsIID IID = NS_ITRANSFER_IID;
extern(System):
nsresult Init(nsIURI aSource, nsIURI aTarget, nsAString * aDisplayName, nsIMIMEInfo aMIMEInfo, PRTime startTime, nsILocalFile aTempFile, nsICancelable aCancelable);
}
|
D
|
instance ItWr_SaturasFirstMessage_Addon_Sealed(C_Item)
{
name = "Sealed Message";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_02.3DS";
material = MAT_LEATHER;
on_state[0] = Use_SaturasFirstMessage_Sealed;
scemeName = "MAPSEALED";
description = name;
text[2] = "This message was carefully sealed.";
};
var int Use_SaturasFirstMessage_OneTime;
func void Use_SaturasFirstMessage()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLine(nDocID,0,"Dear Vatras,");
Doc_PrintLines(nDocID,0,"We have adanced to the portal. You were correct.");
Doc_PrintLines(nDocID,0,"It indeed appears that they were believers in Adanos. I ask you to verify this once again with the help of my notes.");
Doc_PrintLines(nDocID,0,"We have not spotted any of those curious stone beings for days.");
Doc_PrintLines(nDocID,0,"Nevertheless, the earth continues to quake for no apparent reason.");
Doc_PrintLines(nDocID,0,"I suspect that our studies will soon bring us more enlightenment.");
Doc_PrintLines(nDocID,0,"The ornament which we found has a far more important significance than we first thought. It seems to be a crucial key artifact. Alas, it is not complete. We must study it further.");
Doc_PrintLines(nDocID,0,"Dispatch one of our children from the 'Ring of Water' to bring it back to us. If possible, do not send Cavalorn.");
Doc_PrintLines(nDocID,0,"I have assigned him to deliver this letter to you. I think that is enough for him to do. ");
Doc_PrintLines(nDocID,0,"I hope we are doing the right thing.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Saturas");
Doc_Show(nDocID);
if((Use_SaturasFirstMessage_OneTime == FALSE) && (MIS_Addon_Cavalorn_Letter2Vatras != LOG_SUCCESS))
{
//Log_CreateTopic(TOPIC_Addon_KDW,LOG_MISSION);
//Log_SetTopicStatus(TOPIC_Addon_KDW,LOG_Running);
//B_LogEntry(TOPIC_Addon_KDW,"I took a message that Cavalorn was supposed to deliver to the Water Mage Vatras from a bandit. Now it is my task.");
Use_SaturasFirstMessage_OneTime = TRUE;
};
if(SC_KnowsRanger == FALSE)
{
//Log_CreateTopic(TOPIC_Addon_RingOfWater,LOG_MISSION);
//Log_SetTopicStatus(TOPIC_Addon_RingOfWater,LOG_Running);
//Log_AddEntry(TOPIC_Addon_RingOfWater,"There is a community that calls itself the 'Ring of Water'. The Water Mages seem to be the commanders of this community.");
};
if(SC_IsRanger == FALSE)
{
//Log_CreateTopic(TOPIC_Addon_RingOfWater,LOG_MISSION);
//Log_SetTopicStatus(TOPIC_Addon_RingOfWater,LOG_Running);
//Log_AddEntry(TOPIC_Addon_RingOfWater,"Cavalorn belongs to the 'Ring of Water'.");
};
SC_KnowsRanger = TRUE;
};
func void Use_SaturasFirstMessage_Sealed()
{
CreateInvItems(self,ItWr_SaturasFirstMessage_Addon,1);
SaturasFirstMessageOpened = TRUE;
Use_SaturasFirstMessage();
};
instance ItWr_SaturasFirstMessage_Addon(C_Item)
{
name = "Opened message";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_SaturasFirstMessage;
scemeName = "MAP";
description = name;
text[2] = "Saturas' letter to Vatras";
};
instance ItMi_Ornament_Addon(C_Item)
{
name = "Ornament";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION | ITEM_MULTI;
value = 0;
visual = "ItMi_PortalRing_05.3DS";
material = MAT_METAL;
description = name;
text[0] = "Fragment of a large ornamental ring";
inv_zbias = INVCAM_ENTF_MISC5_STANDARD;
};
instance ItMi_Ornament_Addon_Vatras(C_Item)
{
name = "Ornament";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION | ITEM_MULTI;
value = 0;
visual = "ItMi_PortalRing_05.3DS";
material = MAT_METAL;
description = name;
text[0] = "Fragment of a large ornamental ring";
inv_zbias = INVCAM_ENTF_MISC5_STANDARD;
};
instance ItWr_Map_NewWorld_Ornaments_Addon(C_Item)
{
name = "Nefarius' map";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION | ITEM_MULTI;
value = 250;
visual = "ItWr_Map_01.3DS";
material = MAT_LEATHER;
scemeName = "MAP";
on_state[0] = Use_Map_NewWorld_Ornaments;
description = name;
text[0] = "The places where Nefarius assumes the missing";
text[1] = "ornaments can be found are marked on this map";
text[2] = "";
text[5] = NAME_Value;
count[5] = value;
};
func void Use_Map_NewWorld_Ornaments()
{
var int Document;
if(Npc_IsPlayer(self))
{
B_SetPlayerMap(ItWr_Map_NewWorld_Ornaments_Addon);
};
SC_SAW_ORNAMENT_MAP = TRUE;
Document = Doc_CreateMap();
Doc_SetPages(Document,1);
Doc_SetPage(Document,0,"Map_NewWorld_Ornaments.tga",TRUE);
Doc_SetLevel(Document,"NewWorld\NewWorld.zen");
Doc_SetLevelCoords(Document,-28000,50500,95500,-42500);
Doc_Show(Document);
};
instance ItWr_Map_NewWorld_Dexter(C_Item)
{
name = "Land Map of Khorinis";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION | ITEM_MULTI;
value = 210;
visual = "ItWr_Map_01.3DS";
material = MAT_LEATHER;
scemeName = "MAP";
on_state[0] = Use_Map_NewWorld_Dexter;
description = name;
text[0] = "Skip has marked the place";
text[1] = "where I can find the bandit chief";
text[2] = "Dexter.";
text[5] = NAME_Value;
count[5] = value;
};
func void Use_Map_NewWorld_Dexter()
{
var int Document;
if(Npc_IsPlayer(self))
{
B_SetPlayerMap(ItWr_Map_NewWorld_Dexter);
};
Document = Doc_CreateMap();
Doc_SetPages(Document,1);
Doc_SetPage(Document,0,"Map_NewWorld_Dexter.tga",TRUE);
Doc_SetLevel(Document,"NewWorld\NewWorld.zen");
Doc_SetLevelCoords(Document,-28000,50500,95500,-42500);
Doc_Show(Document);
};
prototype Rangerring_Prototype(C_Item)
{
name = "Aquamarine ring";
mainflag = ITEM_KAT_MAGIC;
flags = ITEM_RING | ITEM_MISSION;
value = Value_Ri_HpMana;
visual = "ItRi_Hp_Mana_01.3ds";
visual_skin = 0;
material = MAT_METAL;
on_equip = Equip_ItRi_Ranger_Addon;
on_unequip = UnEquip_ItRi_Ranger_Addon;
description = "Recognition sign of the 'Ring of Water'";
text[5] = NAME_Value;
count[5] = value;
inv_zbias = INVCAM_ENTF_RING_STANDARD;
inv_rotz = INVCAM_Z_RING_STANDARD;
inv_rotx = INVCAM_X_RING_STANDARD;
};
func void Equip_ItRi_Ranger_Addon()
{
if(Hlp_GetInstanceID(self) == Hlp_GetInstanceID(hero))
{
if(ENTERED_ADDONWORLD == FALSE)
{
if(Npc_HasItems(hero,ItRi_Ranger_Addon) == FALSE)
{
RangerRingIsLaresRing = TRUE;
};
};
SCIsWearingRangerRing = TRUE;
Print(PRINT_Addon_SCIsWearingRangerRing);
};
};
func void UnEquip_ItRi_Ranger_Addon()
{
if(Hlp_GetInstanceID(self) == Hlp_GetInstanceID(hero))
{
if(SC_IsRanger == FALSE)
{
SCIsWearingRangerRing = FALSE;
};
RangerRingIsLaresRing = FALSE;
};
};
instance ItRi_Ranger_Lares_Addon(Rangerring_Prototype)
{
text[1] = "This ring belongs to Lares";
};
instance ItRi_Ranger_Addon(Rangerring_Prototype)
{
text[1] = "This ring belongs to me";
};
instance ItRi_LanceRing(Rangerring_Prototype)
{
text[1] = "This ring belongs to Lance";
};
instance ItMi_PortalRing_Addon(C_Item)
{
name = "Ornamental ring";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 0;
visual = "ItMi_PortalRing_01.3DS";
material = MAT_STONE;
description = "This ring opens the portal";
inv_zbias = INVCAM_ENTF_MISC3_STANDARD;
};
instance ItWr_Martin_MilizEmpfehlung_Addon(C_Item)
{
name = "Martin's letter of recommendation";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_MartinMilizEmpfehlung_Addon;
scemeName = "MAP";
description = "Letter of recommendation for Lord Andre";
text[2] = "This letter should help me be";
text[3] = "accepted in the militia";
};
func void Use_MartinMilizEmpfehlung_Addon()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"Honored Lord Andre");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLines(nDocID,0,"With this letter I send a new recruit for our militia to you.");
Doc_PrintLines(nDocID,0,"He has already been of service to me in some difficult and important matters.");
Doc_PrintLines(nDocID,0,"I am sure that he is very well suited to protect the King and the welfare of the citizens of this city.");
Doc_PrintLine(nDocID,0,"Innos bless the King.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0," Provisions Master Martin");
Doc_Show(nDocID);
};
instance ItWr_RavensKidnapperMission_Addon(C_Item)
{
name = "Orders";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_RavensKidnapperMission_Addon;
scemeName = "MAP";
description = name;
text[2] = "I took this letter from";
text[3] = "the bandit Dexter";
};
var int Use_RavensKidnapperMission_Addon_OneTime;
func void Use_RavensKidnapperMission_Addon()
{
var int nDocID;
if((Use_RavensKidnapperMission_Addon_OneTime == FALSE) && (MIS_Addon_Vatras_WhereAreMissingPeople != 0))
{
//Log_CreateTopic(TOPIC_Addon_WhoStolePeople,LOG_MISSION);
//Log_SetTopicStatus(TOPIC_Addon_WhoStolePeople,LOG_Running);
//B_LogEntry(TOPIC_Addon_WhoStolePeople,"Now I have it in writing. Raven, the former ore baron, is behind the kidnapping of the citizens of Khorinis. Raven's hideout is somewhere behind the mountains in the northeast of Khorinis. Vatras should see this document.");
Use_RavensKidnapperMission_Addon_OneTime = TRUE;
};
SCKnowsMissingPeopleAreInAddonWorld = TRUE;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLines(nDocID,0,"Dexter, you bastard!");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"You weren't so unreliable when I was still an ore baron.");
Doc_PrintLines(nDocID,0,"If you can't manage to kidnap more citizens from the city and send them to me, then we will soon have a serious problem with the boys in our hideout.");
Doc_PrintLines(nDocID,0,"I need more slaves here or the boys will start a revolt. And I don't have to tell you what that means, do I?");
Doc_PrintLines(nDocID,0,"I am about to get inside the temple. With that, I can't afford disturbances of this sort.");
Doc_PrintLines(nDocID,0,"And one more problem:");
Doc_PrintLines(nDocID,0,"Sooner or later we have to find a way over the high mountains in the northeast of Khorinis. The pirates won't handle the transport much longer if we don't pay them any more.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0," Raven");
Doc_Show(nDocID);
};
instance ItWr_Vatras_KDFEmpfehlung_Addon(C_Item)
{
name = "Vatras' letter of recommendation";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_VatrasKDFEmpfehlung_Addon;
scemeName = "MAP";
description = "Vatras' letter of recommendation";
text[2] = "This letter should help me get into";
text[3] = "the Fire Magicians' monastery";
text[4] = "without tribute.";
};
func void Use_VatrasKDFEmpfehlung_Addon()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"Brothers of the Fire");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLines(nDocID,0,"It has just been reported to me that you require a tribute for admission into your realm.");
Doc_PrintLines(nDocID,0,"I send along with this letter a devout man who wishes to become a novice in your ranks.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Vatras");
Doc_Show(nDocID);
};
instance ItMi_LostInnosStatue_Daron(C_Item)
{
name = "Valuable statue of Innos";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI;
value = Value_InnosStatue;
visual = "ItMi_InnosStatue.3DS";
material = MAT_METAL;
description = name;
text[5] = NAME_Value;
count[5] = value;
};
instance ItWr_LuciasLoveLetter_Addon(C_Item)
{
name = "Lucia's farewell letter";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_LuciasLoveLetter_Addon;
scemeName = "MAP";
description = name;
};
func void Use_LuciasLoveLetter_Addon()
{
var int nDocID;
//Log_CreateTopic(TOPIC_Addon_Lucia,LOG_MISSION);
//Log_SetTopicStatus(TOPIC_Addon_Lucia,LOG_Running);
//B_LogEntry(TOPIC_Addon_Lucia,"Lucia wrote a farewell letter to Elvrich. That should interest him.");
MIS_LuciasLetter = LOG_Running;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"Dearest Elvrich");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLines(nDocID,0,"I cannot find the words to describe how sorry I am.");
Doc_PrintLines(nDocID,0,"I know that you will not understand but I have come to the conclusion that it is better for both of us if you find a more respectable girl than I am.");
Doc_PrintLines(nDocID,0,"I won't be coming back from where I am going now. Forget me. A wench like me isn't right for an upright fellow like you. Farewell.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0," Lucia");
Doc_Show(nDocID);
};
prototype EffectItemPrototype_Addon(C_Item)
{
name = "Stone";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI;
value = Value_Coal;
visual = "ItMi_Coal.3ds";
material = MAT_STONE;
description = name;
text[5] = NAME_Value;
count[5] = value;
inv_zbias = INVCAM_ENTF_MISC_STANDARD;
};
instance ItMi_AmbossEffekt_Addon(EffectItemPrototype_Addon)
{
};
instance ItMi_OrnamentEffekt_FARM_Addon(EffectItemPrototype_Addon)
{
};
instance ItMi_OrnamentEffekt_FOREST_Addon(EffectItemPrototype_Addon)
{
};
instance ItMi_OrnamentEffekt_BIGFARM_Addon(EffectItemPrototype_Addon)
{
};
instance ItMi_Rake(C_Item)
{
name = "Pick";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI;
value = Value_Rake;
visual = "ItMi_Rake.3DS";
material = MAT_WOOD;
scemeName = "RAKE";
on_state[1] = Use_Rake;
description = name;
text[5] = NAME_Value;
count[5] = value;
inv_zbias = INVCAM_ENTF_AMULETTE_STANDARD;
};
func void Use_Rake()
{
};
instance ItRi_Addon_BanditTrader(C_Item)
{
name = "Guild ring";
mainflag = ITEM_KAT_MAGIC;
flags = ITEM_RING;
value = 5;
visual = "ItRi_Prot_Point_02.3ds";
visual_skin = 0;
material = MAT_METAL;
description = "Engraved ring";
text[2] = "overseas-trader guild Araxos";
text[5] = NAME_Value;
count[5] = value;
inv_zbias = INVCAM_ENTF_RING_STANDARD;
inv_rotz = INVCAM_Z_RING_STANDARD;
inv_rotx = INVCAM_X_RING_STANDARD;
};
instance ItWr_Addon_BanditTrader(C_Item)
{
name = "Delivery";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_02.3DS";
material = MAT_LEATHER;
on_state[0] = Use_ItWr_Addon_BanditTrader;
scemeName = "MAP";
description = name;
text[2] = "I found this letter with the";
text[3] = "bandits behind Sekob's farm";
};
var int Use_ItWr_Addon_BanditTrader_OneTime;
func void Use_ItWr_Addon_BanditTrader()
{
var int nDocID;
BanditTrader_Lieferung_Gelesen = TRUE;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLines(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"15 short swords");
Doc_PrintLines(nDocID,0,"20 rapiers");
Doc_PrintLines(nDocID,0,"25 loaves of bread");
Doc_PrintLines(nDocID,0,"15 bottles of wine");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLines(nDocID,0,"That was the last time.");
Doc_PrintLines(nDocID,0,"This thing is getting too hot");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLine(nDocID,0,"FERNANDO");
Doc_Show(nDocID);
if((MIS_Vatras_FindTheBanditTrader != 0) && (Use_ItWr_Addon_BanditTrader_OneTime == FALSE))
{
//B_LogEntry(TOPIC_Addon_Bandittrader,"I found a document that can prove that Fernando is the weapons dealer I am looking for.");
Use_ItWr_Addon_BanditTrader_OneTime = TRUE;
};
};
instance ItWr_Vatras2Saturas_FindRaven(C_Item)
{
name = "Message";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_02.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Vatras2Saturas_FindRaven_Sealed;
scemeName = "MAPSEALED";
description = name;
text[2] = "Vatras' letter for Saturas";
};
func void Use_Vatras2Saturas_FindRaven()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"letters.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLine(nDocID,0,"Dear Saturas");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLines(nDocID,0,"I hope that you will soon reach your goal. Our situation here in the city appears to have relaxed somewhat at the moment. But I fear that the quiet is deceptive. You should hurry. I need you here.");
Doc_PrintLines(nDocID,0,"I have studied your records and can confirm your suspicion. The writing does indeed point to an Adanos-worshipping culture. Be careful and do not allow yourselves to be blinded by false prophets.");
Doc_PrintLines(nDocID,0,"The missing citizens of Khorinis were dragged by the former ore baron Raven to the region where the portal obviously leads.");
Doc_PrintLines(nDocID,0,"One more thing: I have sent you help. The bearer of this message is somebody very special. He has such a remarkable gleam in his eyes. I am not certain, but it could be HE, even if we had imagined him differently.");
Doc_PrintLines(nDocID,0,"Test him. I think I am right.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Vatras");
Doc_Show(nDocID);
};
func void Use_Vatras2Saturas_FindRaven_Sealed()
{
CreateInvItems(self,ItWr_Vatras2Saturas_FindRaven_opened,1);
Vatras2Saturas_FindRaven_Open = TRUE;
Use_Vatras2Saturas_FindRaven();
};
instance ItWr_Vatras2Saturas_FindRaven_opened(C_Item)
{
name = "Opened message";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION;
value = 0;
visual = "ItWr_Scroll_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Vatras2Saturas_FindRaven;
scemeName = "MAP";
description = name;
text[2] = "Vatras' letter for Saturas";
};
instance ItAm_Addon_WispDetector(C_Item)
{
name = "Ore amulet";
mainflag = ITEM_KAT_MAGIC;
flags = ITEM_AMULET;
value = Value_Am_DexStrg;
visual = "ItAm_Mana_01.3ds";
wear = WEAR_EFFECT;
effect = "SPELLFX_WEAKGLIMMER_BLUE";
visual_skin = 0;
material = MAT_METAL;
on_equip = Equip_WispDetector;
on_unequip = UnEquip_WispDetector;
description = "Ore amulet of the searching will-o'-the-wisp";
text[5] = NAME_Value;
count[5] = value;
inv_zbias = INVCAM_ENTF_AMULETTE_STANDARD;
};
var int Equip_WispDetector_OneTime;
func void Equip_WispDetector()
{
var C_Npc DetWsp;
if(Equip_WispDetector_OneTime == FALSE)
{
PLAYER_TALENT_WISPDETECTOR[WISPSKILL_NF] = TRUE;
WispSearching = WispSearch_NF;
Equip_WispDetector_OneTime = TRUE;
};
DetWsp = Hlp_GetNpc(Wisp_Detector);
AI_Teleport(DetWsp,"TOT");
Wld_SpawnNpcRange(self,Wisp_Detector,1,500);
Wld_PlayEffect("spellFX_LIGHTSTAR_WHITE",Wisp_Detector,Wisp_Detector,0,0,0,FALSE);
Snd_Play("MFX_Transform_Cast");
};
func void UnEquip_WispDetector()
{
var C_Npc DetWsp;
DetWsp = Hlp_GetNpc(Wisp_Detector);
if(Npc_IsDead(DetWsp) == FALSE)
{
Snd_Play("WSP_Dead_A1");
};
AI_Teleport(DetWsp,"TOT");
B_RemoveNpc(DetWsp);
AI_Teleport(DetWsp,"TOT");
};
instance ItFo_Addon_Krokofleisch_Mission(C_Item)
{
name = "Swamprat meat";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = Value_Rawmeat;
visual = "ItFoMuttonRaw.3DS";
material = MAT_LEATHER;
scemeName = "MEAT";
description = name;
text[1] = "Smells fishy somehow!";
text[5] = NAME_Value;
count[5] = Value_Rawmeat;
};
instance ItRi_Addon_MorgansRing_Mission(C_Item)
{
name = "Morgan's ring";
mainflag = ITEM_KAT_MAGIC;
flags = ITEM_RING | ITEM_MISSION;
value = 500;
visual = "ItRi_Prot_Total_02.3DS";
material = MAT_METAL;
on_equip = Equip_MorgansRing;
on_unequip = UnEquip_MorgansRing;
wear = WEAR_EFFECT;
effect = "SPELLFX_ITEMGLIMMER";
description = name;
text[1] = "The ring is decorated with many fine runes.";
text[2] = NAME_ADDON_BONUS_1H;
count[2] = 10;
text[5] = NAME_Value;
count[5] = value;
inv_zbias = INVCAM_ENTF_RING_STANDARD;
inv_rotz = INVCAM_Z_RING_STANDARD;
inv_rotx = INVCAM_X_RING_STANDARD;
};
func void Equip_MorgansRing()
{
B_AddFightSkill(self,NPC_TALENT_1H,10);
};
func void UnEquip_MorgansRing()
{
B_AddFightSkill(self,NPC_TALENT_1H,-10);
};
instance ItMi_Focus(C_Item)
{
name = "Focus stone";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI;
value = 0;
visual = "ItMi_Focus.3DS";
material = MAT_STONE;
wear = WEAR_EFFECT;
effect = "SPELLFX_MANAPOTION";
description = name;
};
instance ItMi_Addon_Steel_Paket(C_Item)
{
name = "Steel package";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION;
value = 300;
visual = "ItMi_Packet.3ds";
material = MAT_LEATHER;
description = name;
text[2] = "This package is REALLY heavy";
text[3] = "It contains a fat lump of steel";
text[5] = NAME_Value;
count[5] = value;
};
instance ItWr_StonePlateCommon_Addon(C_Item)
{
name = "Old stone tablet";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION | ITEM_MULTI;
value = value_StonePlateCommon;
visual = "ItMi_StonePlate_Read_06.3ds";
material = MAT_LEATHER;
on_state[0] = Use_StonePlateCommon;
scemeName = "MAP";
inv_rotx = -90;
inv_roty = 0;
inv_rotz = 0;
description = name;
text[2] = "A gray stone tablet";
text[3] = "";
text[5] = NAME_Value;
count[5] = value_StonePlateCommon;
};
func void Use_StonePlateCommon()
{
var int nDocID;
if(PLAYER_TALENT_FOREIGNLANGUAGE[LANGUAGE_1] == TRUE)
{
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Maya_Stoneplate_03.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,70,50,90,50,1);
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"The caste of the warriors called down the wrath of our god.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"RHADEMES, the successor of Quarhodron, was banished. But his evil power reached us even from the place of his exile.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"We were powerless against it.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"ADANOS' wrath struck JHERENDAR!");
}
else
{
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Maya_Stoneplate_02.TGA",0);
B_Say(self,self,"$CANTREADTHIS");
};
Doc_PrintLine(nDocID,0,"");
Doc_Show(nDocID);
};
instance ItMi_Addon_Stone_01(C_Item)
{
name = "Red stone tablet";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 0;
visual = "ItMi_StonePlate_Read_03.3ds";
material = MAT_STONE;
on_state[0] = Use_Addon_Stone_01;
scemeName = "MAP";
wear = WEAR_EFFECT;
effect = "SPELLFX_WEAKGLIMMER";
inv_rotx = -90;
inv_roty = 0;
inv_rotz = 0;
description = name;
text[2] = "A red stone tablet";
text[3] = "";
};
func void Use_Addon_Stone_01()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Adanos_Stoneplate_02.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,70,50,90,50,1);
Doc_PrintLine(nDocID,0,"");
if(PLAYER_TALENT_FOREIGNLANGUAGE[LANGUAGE_1] == TRUE)
{
Doc_PrintLines(nDocID,0,"We, the last three leaders of the Council of Five, have provided the chambers of the temple with traps and hidden the entrance so that the sword will never again see the light of day.");
}
else
{
Doc_PrintLines(nDocID,0,"Erfjkemvfj Hwoqmnyhan ckh. Fjewheege Egdgsmkd Ygc slje asdkjhnead Gkjsdhad Uhndter rygilliambwe ewzbfujbwe Iuhdfb. Revfnbrebuiwe ewohjfribwe wef. Sebnejbuwd Weinfiwjf Ihwqpjrnn.");
B_Say(self,self,"$CANTREADTHIS");
};
Doc_PrintLine(nDocID,0,"");
Doc_Show(nDocID);
};
instance ItMi_Addon_Stone_05(C_Item)
{
name = "Yellow stone tablet";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 0;
visual = "ItMi_StonePlate_Read_04.3ds";
material = MAT_STONE;
on_state[0] = Use_Addon_Stone_05;
scemeName = "MAP";
wear = WEAR_EFFECT;
effect = "SPELLFX_WEAKGLIMMER";
inv_rotx = -90;
inv_roty = 0;
inv_rotz = 0;
description = name;
text[2] = "A yellow stone tablet";
text[3] = "";
};
func void Use_Addon_Stone_05()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Adanos_Stoneplate_01.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,70,50,90,50,1);
Doc_PrintLine(nDocID,0,"");
if(PLAYER_TALENT_FOREIGNLANGUAGE[LANGUAGE_1] == TRUE)
{
Doc_PrintLines(nDocID,0,"I, who was against the decision of the Three, built the first trap. And only I know the correct doorway.");
}
else
{
Doc_PrintLines(nDocID,0,"Fjewheege Egdgsmkd Ygc slje asdkjhnead Gkjsdhad Uhnd Esfjwedbwe ewzbfujbwe Iuhdfb. Sebnejbuwd Weinfiwjf Ihwqpjrnn. Erfjkemvfj Hwoqmnyhan ckh.");
B_Say(self,self,"$CANTREADTHIS");
};
Doc_PrintLine(nDocID,0,"");
Doc_Show(nDocID);
};
instance ItMi_Addon_Stone_03(C_Item)
{
name = "Blue stone tablet";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 0;
visual = "ItMi_StonePlate_Read_05.3ds";
material = MAT_STONE;
on_state[0] = Use_Addon_Stone_03;
scemeName = "MAP";
inv_rotx = -90;
inv_roty = 0;
inv_rotz = 0;
wear = WEAR_EFFECT;
effect = "SPELLFX_WEAKGLIMMER";
description = name;
text[2] = "A blue stone tablet";
text[3] = "";
};
func void Use_Addon_Stone_03()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Adanos_Stoneplate_03.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,70,50,90,50,1);
Doc_PrintLine(nDocID,0,"");
if(PLAYER_TALENT_FOREIGNLANGUAGE[LANGUAGE_1] == TRUE)
{
Doc_PrintLines(nDocID,0,"KHARDIMON devised the second trap. And only he who follows the way of Light to the end will reach the third chamber.");
}
else
{
Doc_PrintLines(nDocID,0,"KHARDIMON Weinfiwjf Ihwqpjrnn. Erfjkemvfj Hwoqmnyhan ckh. Gkjsdhad Uhnd Esfjwedbwe ewzbfujbwe.");
B_Say(self,self,"$CANTREADTHIS");
};
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_Show(nDocID);
};
instance ItMi_Addon_Stone_04(C_Item)
{
name = "Green stone tablet";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 0;
visual = "ItMi_StonePlate_Read_01.3ds";
material = MAT_STONE;
on_state[0] = Use_Addon_Stone_04;
scemeName = "MAP";
inv_rotx = -90;
inv_roty = 0;
inv_rotz = 0;
wear = WEAR_EFFECT;
effect = "SPELLFX_WEAKGLIMMER";
description = name;
text[2] = "A green stone tablet";
text[3] = "";
};
func void Use_Addon_Stone_04()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Adanos_Stoneplate_04.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,70,50,90,50,1);
Doc_PrintLine(nDocID,0,"");
if(PLAYER_TALENT_FOREIGNLANGUAGE[LANGUAGE_1] == TRUE)
{
Doc_PrintLines(nDocID,0,"The third trap was built by QUARHODRON and only he knows how to open the portal.");
}
else
{
Doc_PrintLines(nDocID,0,"Esfjwedbwe ewzbfujbwe. Fjewheege QUARHODRON Ygc slje asdkjhnead. Sebnejbuwd Weinfiwjf Ihwqpjrnn. Gkjsdhad Uhnd.");
B_Say(self,self,"$CANTREADTHIS");
};
Doc_PrintLine(nDocID,0,"");
Doc_Show(nDocID);
};
instance ItMi_Addon_Stone_02(C_Item)
{
name = "Purple stone tablet";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 0;
visual = "ItMi_StonePlate_Read_02.3ds";
material = MAT_STONE;
on_state[0] = Use_Addon_Stone_02;
scemeName = "MAP";
inv_rotx = -90;
inv_roty = 0;
inv_rotz = 0;
wear = WEAR_EFFECT;
effect = "SPELLFX_WEAKGLIMMER";
description = name;
text[2] = "A purple stone tablet";
text[3] = "";
};
func void Use_Addon_Stone_02()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Adanos_Stoneplate_05.TGA",0);
Doc_SetFont(nDocID,-1,FONT_Book);
Doc_SetMargins(nDocID,-1,70,50,90,50,1);
Doc_PrintLine(nDocID,0,"");
if(PLAYER_TALENT_FOREIGNLANGUAGE[LANGUAGE_1] == TRUE)
{
Doc_PrintLines(nDocID,0,"It was also Quarhodron who sealed the outer gate of the temple with the help of KHARDIMON. Neither of them survived the ritual.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"Only I remain to tell the tale.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"I hope that RHADEMES rots for eternity in the temple!");
}
else
{
Doc_PrintLines(nDocID,0,"QUARHODRON Ygc slje asdkjhnead. KHARDIMON Weinfiwjf Ihwqpjrnn. Erfjkemvfj Hwoqmnyhan ckh. Fjewheege Egdgsmkd Esfjwedbwe asdkjhnead. Gkjsdhad Uhnd.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"Revfnbrebuiwe ewohjfribwe wef. Sebnejbuwd Weinfiwjf Ihwqpjrnn.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"Erfjkemvfj RHADEMES Fjewheege Egdgsmkd!");
B_Say(self,self,"$CANTREADTHIS");
};
Doc_PrintLine(nDocID,0,"");
Doc_Show(nDocID);
};
instance ItMI_Addon_Kompass_Mis(C_Item)
{
name = "Golden Compass";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI | ITEM_MISSION;
value = 500;
visual = "ItMi_Compass_01.3DS";
material = MAT_STONE;
description = name;
};
instance ItSE_Addon_FrancisChest(C_Item)
{
name = "Treasure Chest";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION;
value = 200;
visual = "ItMi_GoldChest.3ds";
scemeName = "MAPSEALED";
material = MAT_LEATHER;
on_state[0] = FrancisChest;
description = "A treasure chest";
text[0] = "The chest is very heavy.";
text[1] = "";
text[2] = "";
text[3] = "";
text[4] = "";
text[5] = NAME_Value;
count[5] = value;
};
func void FrancisChest()
{
CreateInvItems(hero,ItMi_GoldChest,1);
CreateInvItems(hero,ItMw_FrancisDagger_Mis,1);
CreateInvItems(hero,ItMi_Gold,153);
CreateInvItems(hero,ItMi_GoldCup,1);
CreateInvItems(hero,ItMi_SilverNecklace,1);
CreateInvItems(hero,ITWR_Addon_FrancisAbrechnung_Mis,1);
Snd_Play("Geldbeutel");
Print("Received a pile of stuff!");
};
instance ITWR_Addon_FrancisAbrechnung_Mis(C_Item)
{
name = "Paybook";
mainflag = ITEM_KAT_DOCS;
flags = 0;
value = 100;
visual = "ItWr_Book_02_05.3ds";
material = MAT_LEATHER;
scemeName = "MAP";
description = name;
text[5] = NAME_Value;
count[5] = value;
on_state[0] = UseFrancisAbrechnung_Mis;
};
func void UseFrancisAbrechnung_Mis()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,2);
Doc_SetPage(nDocID,0,"Book_Brown_L.tga",0);
Doc_SetPage(nDocID,1,"Book_Brown_R.tga",0);
Doc_SetMargins(nDocID,0,275,20,30,20,1);
Doc_SetFont(nDocID,0,FONT_Book);
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Merchantman 'Mermaid'");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Total booty: 14560 gold");
Doc_PrintLine(nDocID,0,"-----------------------");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Crew: 9840");
Doc_PrintLine(nDocID,0,"Officers: 2500");
Doc_PrintLine(nDocID,0,"Captain: 1000");
Doc_PrintLine(nDocID,0,"-----------------------");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Personal share: 2220");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Merchant vessel 'Miriam'");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Total booty: 4890 gold");
Doc_PrintLine(nDocID,0,"-----------------------");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Crew: 2390");
Doc_PrintLine(nDocID,0,"Officers: 500");
Doc_PrintLine(nDocID,0,"Captain: 500");
Doc_PrintLine(nDocID,0,"----------------------");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"Personal share: 1000");
Doc_PrintLine(nDocID,0,"");
Doc_SetMargins(nDocID,-1,30,20,275,20,1);
Doc_SetFont(nDocID,1,FONT_Book);
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Merchant ship 'Nico'");
Doc_SetFont(nDocID,1,FONT_Book);
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Total booty: 9970");
Doc_PrintLine(nDocID,1,"----------------------");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Crew: 5610");
Doc_PrintLine(nDocID,1,"Officers: 1500");
Doc_PrintLine(nDocID,1,"Captain: 1000");
Doc_PrintLine(nDocID,1,"----------------------");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Personal share: 1860");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Merchantman 'Maria'");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Total booty: 7851 gold");
Doc_PrintLine(nDocID,1,"----------------------");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Crew: 4400");
Doc_PrintLine(nDocID,1,"Officers: 750");
Doc_PrintLine(nDocID,1,"Captain: 1000");
Doc_PrintLine(nDocID,1,"----------------------");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLine(nDocID,1,"Personal share: 1701");
Doc_PrintLine(nDocID,1,"");
Francis_HasProof = TRUE;
Doc_Show(nDocID);
B_Say(self,self,"$ADDON_THISLITTLEBASTARD");
};
instance ITWR_Addon_GregsLogbuch_Mis(C_Item)
{
name = "Log book";
mainflag = ITEM_KAT_DOCS;
flags = 0;
value = 100;
visual = "ItWr_Book_01.3ds";
material = MAT_LEATHER;
scemeName = "MAP";
description = "Greg's log book";
text[5] = NAME_Value;
count[5] = value;
on_state[0] = UseGregsLogbuch;
};
func void UseGregsLogbuch()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,2);
Doc_SetPage(nDocID,0,"Book_Brown_L.tga",0);
Doc_SetPage(nDocID,1,"Book_Brown_R.tga",0);
Doc_SetMargins(nDocID,0,275,20,30,20,1);
Doc_SetFont(nDocID,0,FONT_Book);
Doc_PrintLines(nDocID,0,"I've seen more than enough of this beach. Sand everywhere. I can't even sleep right any more because everything itches. It's time that Raven forked over the gold for the prisoners and we put to sea again. I'll have to have a word with the puffed-up jerk.");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLines(nDocID,0,"How dare that ass? He made his stinking henchmen at the gate send me away. He'll have me to reckon with! I'll turn his bootlicker Bloodwyn into fish food with my own hands.");
Doc_PrintLines(nDocID,0,"If he doesn't pay soon, I'll have to get tough.");
Doc_SetMargins(nDocID,-1,30,20,275,20,1);
Doc_SetFont(nDocID,1,FONT_Book);
Doc_PrintLines(nDocID,1,"The bandits are getting brazen. They still haven't paid for the last delivery. We just don't have enough information. I have to find out what Raven wants here.");
Doc_PrintLine(nDocID,1,"");
Doc_PrintLines(nDocID,1,"I'll take the majority of the crew to the mainland and secure the ore. Francis will stay behind with a few people and fortify the camp.");
Doc_PrintLines(nDocID,1,"So the time doesn't go to waste, I gave Bones the armor. He'll sneak into the bandit camp for me and find out what Raven is planning there.");
Greg_GaveArmorToBones = TRUE;
Doc_Show(nDocID);
};
instance ITKE_Addon_Bloodwyn_01(C_Item)
{
name = NAME_Key;
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION;
value = Value_Key_01;
visual = "ItKe_Key_02.3ds";
material = MAT_METAL;
description = "Bloodwyn's key";
text[2] = "Fits a chest";
text[3] = "";
text[5] = NAME_Value;
count[5] = value;
};
instance ITKE_Addon_Heiler(C_Item)
{
name = NAME_Key;
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION;
value = Value_Key_01;
visual = "ItKe_Key_02.3ds";
material = MAT_METAL;
description = "A stone sentinel's key";
text[2] = "Fits a chest";
text[3] = "In a strange old building in the swamp";
text[5] = NAME_Value;
count[5] = value;
};
instance ItMi_TempelTorKey(C_Item)
{
name = "Stone tablet of Quarhodron";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION | ITEM_MULTI;
value = 0;
visual = "ItMi_StonePlate_Read_06.3ds";
material = MAT_STONE;
scemeName = "MAP";
on_state[0] = Use_TempelTorKey;
text[2] = "The key to the temple of Adanos";
};
func void Use_TempelTorKey()
{
var int nDocID;
nDocID = Doc_Create();
Doc_SetPages(nDocID,1);
Doc_SetPage(nDocID,0,"Maya_Stoneplate_03.TGA",0);
Doc_SetFont(nDocID,0,FONT_BookHeadline);
Doc_SetMargins(nDocID,-1,50,50,50,50,1);
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0,"");
Doc_PrintLine(nDocID,0," Jhehedra Akhantar");
Doc_Show(nDocID);
};
instance ItMi_Addon_Bloodwyn_Kopf(C_Item)
{
name = "Bloodwyn's head";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION;
value = 0;
visual = "ItMi_Head_Bloodwyn_01.3ds";
material = MAT_LEATHER;
description = name;
text[2] = "";
text[3] = "";
text[5] = NAME_Value;
count[5] = value;
};
instance ItWR_Addon_TreasureMap(C_Item)
{
name = "Treasure map";
mainflag = ITEM_KAT_DOCS;
flags = ITEM_MISSION | ITEM_MULTI;
value = 250;
visual = "ItWr_Map_01.3DS";
material = MAT_LEATHER;
scemeName = "MAP";
on_state[0] = Use_TreasureMap;
description = name;
text[0] = "";
text[1] = "Some places are marked on the map.";
text[5] = NAME_Value;
count[5] = value;
};
func void Use_TreasureMap()
{
var int Document;
if(Npc_IsPlayer(self))
{
B_SetPlayerMap(ItWR_Addon_TreasureMap);
};
Document = Doc_CreateMap();
Doc_SetPages(Document,1);
Doc_SetPage(Document,0,"Map_AddonWorld_Treasures.tga",TRUE);
Doc_SetLevel(Document,"Addon\AddonWorld.zen");
Doc_SetLevelCoords(Document,-47783,36300,43949,-32300);
Doc_Show(Document);
};
instance ItMi_Addon_GregsTreasureBottle_MIS(C_Item)
{
name = "Message in a bottle";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MISSION;
value = 0;
visual = "ItFo_Water.3DS";
material = MAT_LEATHER;
on_state[0] = Use_GregsBottle;
scemeName = "MAPSEALED";
description = name;
text[2] = "There is a piece of paper in the bottle";
};
func void Use_GregsBottle()
{
B_PlayerFindItem(ItWR_Addon_TreasureMap,1);
};
instance itmi_erolskelch(C_Item)
{
name = "Scratched silver bowl";
mainflag = ITEM_KAT_NONE;
flags = ITEM_MULTI;
value = 125;
visual = "ItMi_SilverChalice.3DS";
material = MAT_METAL;
description = name;
text[5] = NAME_Value;
count[5] = value;
};
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwtx.ui.forms.events.ExpansionEvent;
import dwt.events.TypedEvent;
import dwt.dwthelper.utils;
/**
* Notifies listeners when expandable controls change expansion state.
*
* @since 3.0
*/
public final class ExpansionEvent : TypedEvent {
private static const long serialVersionUID = 6009335074727417445L;
/**
* Creates a new expansion ecent.
*
* @param obj
* event source
* @param state
* the new expansion state
*/
public this(Object obj, bool state) {
super(obj);
data = state ? Boolean.TRUE : Boolean.FALSE;
}
/**
* Returns the new expansion state of the widget.
*
* @return <code>true</code> if the widget is now expaned, <code>false</code>
* otherwise.
*/
public bool getState() {
return data.opEquals(Boolean.TRUE) ? true : false;
}
}
|
D
|
/*
* #24 Cor Kalom closes wrong quest
*
* The hero is given 500 ore nuggets and the dialog function is called.
* Caution: This test will trigger the dialog as told and closes the quest. Save the game before this test.
*
* Expected behavior: The variable 'Kalom_DrugMonopol' remains as before and 'Kalom_Krautbote' is set to 'LOG_SUCCESS'
*/
func int G1CP_Test_024() {
// Define possibly missing symbols locally
const int LOG_RUNNING = 1;
const int LOG_SUCCESS = 2;
// Check status of the test
var int passed; passed = TRUE;
// Find Cor Kalom first
var int symbId; symbId = MEM_GetSymbolIndex("GUR_1201_CorKalom");
if (symbId == -1) {
G1CP_TestsuiteErrorDetail("NPC 'GUR_1201_CorKalom' not found");
passed = FALSE;
};
// Check if Cor Kalom exists in the world
var C_Npc kalom; kalom = Hlp_GetNpc(symbId);
if (!Hlp_IsValidNpc(kalom)) {
G1CP_TestsuiteErrorDetail("NPC 'GUR_1201_CorKalom' not valid");
passed = FALSE;
};
// Check if dialog exists
var int funcId; funcId = MEM_GetSymbolIndex("Info_Kalom_KrautboteBACK_Info");
if (funcId == -1) {
G1CP_TestsuiteErrorDetail("Dialog function 'Info_Kalom_KrautboteBACK_Info' not found");
passed = FALSE;
};
// Check if the ore nugget item exists
var int nuggetId; nuggetId = MEM_GetSymbolIndex("ItMiNugget");
if (nuggetId == -1) {
G1CP_TestsuiteErrorDetail("Item 'ItMiNugget' not found");
passed = FALSE;
};
// Obtain symbols
var int drugMonopolPtr; drugMonopolPtr = MEM_GetSymbol("Kalom_DrugMonopol");
if (!drugMonopolPtr) {
G1CP_TestsuiteErrorDetail("Variable 'Kalom_DrugMonopol' not found");
passed = FALSE;
};
drugMonopolPtr += zCParSymbol_content_offset;
var int krautbotePtr; krautbotePtr = MEM_GetSymbol("Kalom_Krautbote");
if (!krautbotePtr) {
G1CP_TestsuiteErrorDetail("Variable 'Kalom_Krautbote' not found");
passed = FALSE;
};
krautbotePtr += zCParSymbol_content_offset;
// At the latest now, we need to stop if there are fails already
if (!passed) {
return FALSE;
};
// Back up the values
var int drugMonopolBak; drugMonopolBak = MEM_ReadInt(drugMonopolPtr);
var int krautboteBak; krautboteBak = MEM_ReadInt(krautbotePtr);
// Set the variables
MEM_WriteInt(drugMonopolPtr, LOG_RUNNING);
MEM_WriteInt(krautbotePtr, LOG_RUNNING);
// Add 500 ore for the condition within the dialog
CreateInvItems(hero, nuggetId, 500);
// Backup self and other
var C_Npc slfBak; slfBak = MEM_CpyInst(self);
var C_Npc othBak; othBak = MEM_CpyInst(other);
// Set self and other
self = MEM_CpyInst(kalom);
other = MEM_CpyInst(hero);
// Just run the dialog and see what happens
MEM_CallByID(funcId);
// Restore self and other
self = MEM_CpyInst(slfBak);
other = MEM_CpyInst(othBak);
// Stop the output units
Npc_ClearAIQueue(hero);
AI_StandUpQuick(hero);
// Check the variables now
var int drugMonopolAfter; drugMonopolAfter = MEM_ReadInt(drugMonopolPtr);
var int krautboteAfter; krautboteAfter = MEM_ReadInt(krautbotePtr);
// Restore the variables
MEM_WriteInt(drugMonopolPtr, drugMonopolBak);
MEM_WriteInt(krautbotePtr, krautboteBak);
// Confirm the fix
if (drugMonopolAfter != LOG_RUNNING) {
G1CP_TestsuiteErrorDetail("Mission 'Kalom_DrugMonopol' was wrongfully closed");
passed = FALSE;
};
if (krautboteAfter != LOG_SUCCESS) {
G1CP_TestsuiteErrorDetail("Mission 'Kalom_Krautbote' is still open");
passed = FALSE;
};
return passed;
};
|
D
|
import std.stdio: writeln;
void shellSort(T)(T[] seq) pure nothrow {
int inc = seq.length / 2;
while (inc) {
foreach (ref i, el; seq) {
while (i >= inc && seq[i - inc] > el) {
seq[i] = seq[i - inc];
i -= inc;
}
seq[i] = el;
}
inc = (inc == 2) ? 1 : cast(int)(inc * 5.0 / 11);
}
}
void main() {
auto data = [22, 7, 2, -5, 8, 4];
shellSort(data);
writeln(data);
}
|
D
|
/*
TEST_OUTPUT:
----
fail_compilation/test17868.d(10): Error: pragma `crt_constructor` takes no argument
fail_compilation/test17868.d(11): Error: pragma `crt_constructor` takes no argument
fail_compilation/test17868.d(12): Error: pragma `crt_constructor` takes no argument
fail_compilation/test17868.d(13): Error: pragma `crt_constructor` takes no argument
----
*/
pragma(crt_constructor, ctfe())
pragma(crt_constructor, 1.5f)
pragma(crt_constructor, "foobar")
pragma(crt_constructor, S())
void foo()
{
}
int ctfe()
{
__gshared int val;
return val;
}
struct S {}
|
D
|
/Users/lefukeji/Desktop/content/chartDemoForPro/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ScatterChartView.o : /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartAxisBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/RadarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineScatterCandleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/CombinedHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartLimitLine.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/PieChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartAxisRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarLineScatterCandleBubbleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartFillFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/ScatterChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ScatterChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/LineChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarLineScatterCandleBubbleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRendererRadarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/ScatterChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/CombinedChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartXAxis.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Filters/ChartDataBaseFilter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartXAxisValueFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/LineChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/PieChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/RadarChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BarChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartYAxis.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/RadarChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Animation/ChartAnimationEasing.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/CandleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartTransformer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/HorizontalBarChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/RadarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartLegendRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartTransformerHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartColorTemplates.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/CandleStickChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartSelectionDetail.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/ChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/PieChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineRadarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/LineChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ScatterChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/CandleStickChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Filters/ChartDataApproximatorFilter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BarLineChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/PieChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartDataRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartViewPortHandler.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BubbleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/BarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartMarker.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ScatterChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/ChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BarChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/BarChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererRadarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/PieRadarChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Animation/ChartAnimator.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/BubbleChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BubbleChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartDefaultXAxisValueFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/CombinedChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartComponentBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CombinedChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartUtils.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartHighlight.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartLegend.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartRange.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/HorizontalBarChartView.swift /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Supporting\ Files/Charts.h /Users/lefukeji/Desktop/content/chartDemoForPro/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/lefukeji/Desktop/content/chartDemoForPro/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ScatterChartView~partial.swiftmodule : /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartAxisBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/RadarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineScatterCandleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/CombinedHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartLimitLine.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/PieChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartAxisRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarLineScatterCandleBubbleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartFillFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/ScatterChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ScatterChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/LineChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarLineScatterCandleBubbleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRendererRadarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/ScatterChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/CombinedChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartXAxis.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Filters/ChartDataBaseFilter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartXAxisValueFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/LineChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/PieChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/RadarChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BarChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartYAxis.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/RadarChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Animation/ChartAnimationEasing.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/CandleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartTransformer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/HorizontalBarChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/RadarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartLegendRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartTransformerHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartColorTemplates.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/CandleStickChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartSelectionDetail.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/ChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/PieChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineRadarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/LineChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ScatterChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/CandleStickChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Filters/ChartDataApproximatorFilter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BarLineChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/PieChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartDataRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartViewPortHandler.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BubbleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/BarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartMarker.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ScatterChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/ChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BarChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/BarChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererRadarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/PieRadarChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Animation/ChartAnimator.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/BubbleChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BubbleChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartDefaultXAxisValueFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/CombinedChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartComponentBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CombinedChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartUtils.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartHighlight.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartLegend.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartRange.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/HorizontalBarChartView.swift /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Supporting\ Files/Charts.h /Users/lefukeji/Desktop/content/chartDemoForPro/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
/Users/lefukeji/Desktop/content/chartDemoForPro/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/ScatterChartView~partial.swiftdoc : /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartAxisBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/RadarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineScatterCandleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/CombinedHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartLimitLine.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/PieChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartAxisRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarLineScatterCandleBubbleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartFillFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/ScatterChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ScatterChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/LineChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarLineScatterCandleBubbleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRendererRadarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/ScatterChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/CombinedChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartXAxis.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Filters/ChartDataBaseFilter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartXAxisValueFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/LineChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/PieChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/RadarChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BarChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartYAxis.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/RadarChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Animation/ChartAnimationEasing.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/HorizontalBarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/CandleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartTransformer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRendererHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/HorizontalBarChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/RadarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartLegendRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartTransformerHorizontalBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartColorTemplates.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/CandleStickChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartSelectionDetail.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/ChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/PieChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineRadarChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/LineChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererBarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ScatterChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/CandleStickChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Filters/ChartDataApproximatorFilter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BarLineChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/PieChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/LineChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartDataRendererBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartViewPortHandler.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/LineScatterCandleRadarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BubbleChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/BarChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartMarker.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BubbleChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ScatterChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/ChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Interfaces/BarChartDataProvider.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CandleChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/ChartDataSet.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/BarChartHighlighter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartXAxisRendererRadarChart.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/PieRadarChartViewBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Animation/ChartAnimator.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/BubbleChartRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/BubbleChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Formatters/ChartDefaultXAxisValueFormatter.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Renderers/ChartYAxisRenderer.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/CombinedChartView.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartComponentBase.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/BarChartDataEntry.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Data/CombinedChartData.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Utils/ChartUtils.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartHighlight.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Components/ChartLegend.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Highlight/ChartRange.swift /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Classes/Charts/HorizontalBarChartView.swift /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/lefukeji/Desktop/content/chartDemoForPro/Charts/Supporting\ Files/Charts.h /Users/lefukeji/Desktop/content/chartDemoForPro/Build/Intermediates/Charts.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode7.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule
|
D
|
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Vapor.build/View/Vapor+View.swift.o : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/ConsoleLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.3/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rsa.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.3/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ec.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.3/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.3/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bn.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.3/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.3/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.3/include/openssl/buffer.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.3/include/openssl/err.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.3/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslv.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509_vfy.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Vapor.build/Vapor+View~partial.swiftmodule : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/ConsoleLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.3/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rsa.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.3/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ec.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.3/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.3/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bn.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.3/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.3/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.3/include/openssl/buffer.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.3/include/openssl/err.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.3/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslv.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509_vfy.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Vapor.build/Vapor+View~partial.swiftdoc : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/FileIO.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/FormDataCoder+HTTP.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionData.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Thread.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/URLEncoded.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/ServeCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/RoutesCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/BootCommand.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Method.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ResponseCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/RequestCodable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/Middleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/CORSMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/FileMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/DateMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/ErrorMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+LazyMiddleware.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Response.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/AnyResponse.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Middleware/MiddlewareConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServerConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/SessionsConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/HTTPMethod+String.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Path.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/JSONCoder+Custom.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Request+Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Session.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Application.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/RouteCollection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Function.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/VaporProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Responder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/BasicResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/ApplicationResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketResponder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/PlaintextEncoder.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/ConsoleLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/HTTPMessageContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/ParametersContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/QueryContainer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/EngineRouter.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/Server.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/NIOServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Server/RunningServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketServer.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Error.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Logging/Logger+LogError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/AbortError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/Sessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/KeyedCacheSessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Sessions/MemorySessions.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/ContentCoders.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Utilities/Exports.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/HTTPStatus.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Response/Redirect.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/SingleValueGet.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Config+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Commands/CommandConfig+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Services/Services+Default.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/Client.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Client/FoundationClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/WebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/WebSocket/NIOWebSocketClient.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Routing/Router+Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Content/Content.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Error/Abort.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/Request/Request.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/vapor.git-5492988889259800272/Sources/Vapor/View/Vapor+View.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOHTTP1.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOOpenSSL.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/HTTP.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOTLS.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Routing.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Random.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/URLEncodedForm.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Validation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Crypto.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/WebSocket.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOWebSocket.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/TemplateKit.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Multipart.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOSHA1/include/c_nio_sha1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/asn1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/tls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dtls1.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs12.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem2.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl23.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509v3.h /usr/local/Cellar/libressl/2.7.3/include/openssl/md5.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pkcs7.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509.h /usr/local/Cellar/libressl/2.7.3/include/openssl/sha.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdsa.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rsa.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOZlib/include/c_nio_zlib.h /usr/local/Cellar/libressl/2.7.3/include/openssl/obj_mac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/hmac.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ec.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /usr/local/Cellar/libressl/2.7.3/include/openssl/rand.h /usr/local/Cellar/libressl/2.7.3/include/openssl/conf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslconf.h /usr/local/Cellar/libressl/2.7.3/include/openssl/dh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ecdh.h /usr/local/Cellar/libressl/2.7.3/include/openssl/lhash.h /usr/local/Cellar/libressl/2.7.3/include/openssl/stack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/safestack.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ssl.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl.git-1370587408992578247/Sources/CNIOOpenSSL/include/c_nio_openssl.h /usr/local/Cellar/libressl/2.7.3/include/openssl/pem.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bn.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /usr/local/Cellar/libressl/2.7.3/include/openssl/bio.h /usr/local/Cellar/libressl/2.7.3/include/openssl/crypto.h /usr/local/Cellar/libressl/2.7.3/include/openssl/srtp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/evp.h /usr/local/Cellar/libressl/2.7.3/include/openssl/ossl_typ.h /usr/local/Cellar/libressl/2.7.3/include/openssl/buffer.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOHTTPParser/include/c_nio_http_parser.h /usr/local/Cellar/libressl/2.7.3/include/openssl/err.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslfeatures.h /usr/local/Cellar/libressl/2.7.3/include/openssl/objects.h /usr/local/Cellar/libressl/2.7.3/include/openssl/opensslv.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /usr/local/Cellar/libressl/2.7.3/include/openssl/x509_vfy.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-ssl-support.git--2359138821295600615/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/crypto.git-7980259129511365902/Sources/libbcrypt/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
instance PAL_6077_RITTER(Npc_Default)
{
name[0] = NAME_Ritter;
guild = GIL_BDT;
aivar[AIV_IgnoresFakeGuild] = TRUE;
aivar[AIV_IgnoresArmor] = TRUE;
id = 6077;
voice = 12;
flags = 0;
npcType = NPCTYPE_PALMORA;
aivar[AIV_DropDeadAndKill] = TRUE;
B_SetAttributesToChapter(self,5);
fight_tactic = FAI_HUMAN_MASTER;
EquipItem(self,ItMw_2h_Pal_Sword_Etlu);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Fighter",Face_N_Normal17,BodyTex_N,ItAr_PAL_M_NPC);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Militia.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,80);
daily_routine = rtn_start_6077;
};
func void rtn_start_6077()
{
TA_Smalltalk(8,0,21,0,"INSEL_DORF_29");
TA_Sit_Chair(21,0,8,0,"INSEL_BAUERNHAUS_189");
};
|
D
|
// *************************************************************************
// Kapitel 1
// *************************************************************************
// *************************************************************************
// EXIT
// *************************************************************************
INSTANCE Info_PsiNov_2_EXIT(C_INFO)
{
// npc wird in B_AssignAmbientInfos_PsiNov_2 (s.u.) jeweils gesetzt
nr = 999;
condition = Info_PsiNov_2_EXIT_Condition;
information = Info_PsiNov_2_EXIT_Info;
permanent = 1;
description = "ENDE";
};
FUNC INT Info_PsiNov_2_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_PsiNov_2_EXIT_Info()
{
AI_StopProcessInfos (self);
};
// *************************************************************************
// Einer von Euch werden
// *************************************************************************
INSTANCE Info_PsiNov_2_EinerVonEuchWerden (C_INFO) // E1
{
nr = 4;
condition = Info_PsiNov_2_EinerVonEuchWerden_Condition;
information = Info_PsiNov_2_EinerVonEuchWerden_Info;
permanent = 1;
description = "Ich will bei euch mitmachen.";
};
FUNC INT Info_PsiNov_2_EinerVonEuchWerden_Condition()
{
if (SumpfNovize_Dabei == FALSE)
&& (Templer_Dabei == FALSE)
&& (HoherTempler_Dabei == FALSE)
&& (Guru_Dabei == FALSE)
&& (HoherGuru_Dabei == FALSE)
{
return TRUE;
};
};
FUNC VOID Info_PsiNov_2_EinerVonEuchWerden_Info()
{
AI_Output(hero,self,"Info_PsiNov_2_EinerVonEuchWerden_15_00"); //Ich will bei euch mitmachen.
AI_Output(self,hero,"Info_PsiNov_2_EinerVonEuchWerden_02_01"); //Du hast dich entschieden dich uns anzuschließen? Vor dir liegt ein Weg voller Freude und Glück.
AI_Output(self,hero,"Info_PsiNov_2_EinerVonEuchWerden_02_02"); //Gehe zu Cor Cadar, er entscheidet, für welche Aufgabe du am besten geeignet bist.
};
// *************************************************************************
// Wichtige Personen
// *************************************************************************
INSTANCE Info_PsiNov_2_WichtigePersonen(C_INFO)
{
nr = 3;
condition = Info_PsiNov_2_WichtigePersonen_Condition;
information = Info_PsiNov_2_WichtigePersonen_Info;
permanent = 1;
description = "Wer sind eure Anführer?";
};
FUNC INT Info_PsiNov_2_WichtigePersonen_Condition()
{
return 1;
};
FUNC VOID Info_PsiNov_2_WichtigePersonen_Info()
{
AI_Output(hero,self,"Info_PsiNov_2_WichtigePersonen_15_00"); //Wer sind eure Anführer?
AI_Output(self,hero,"Info_PsiNov_2_WichtigePersonen_02_01"); //Cor Cadar und Cor Angar sind unsere geistigen Väter.
AI_Output(self,hero,"Info_PsiNov_2_WichtigePersonen_02_02"); //Sie sorgen dafür, dass wir in Sicherheit sind und die Krautproduktion ohne Schwierigkeiten verläuft.
};
// *************************************************************************
// Das Lager (Orts-Infos)
// *************************************************************************
INSTANCE Info_PsiNov_2_DasLager(C_INFO)
{
nr = 2;
condition = Info_PsiNov_2_DasLager_Condition;
information = Info_PsiNov_2_DasLager_Info;
permanent = 1;
description = "Was gibt es wichtiges über diesen Ort zu wissen?";
};
FUNC INT Info_PsiNov_2_DasLager_Condition()
{
return 1;
};
FUNC VOID Info_PsiNov_2_DasLager_Info()
{
AI_Output(hero,self,"Info_PsiNov_2_DasLager_15_00"); //Was gibt es wichtiges über diesen Ort zu wissen?
AI_Output(self,hero,"Info_PsiNov_2_DasLager_02_01"); //Es ist ein Ort des Glaubens, Bruder. Wir haben nicht viel, aber was wir haben, teilen wir gerne mit denen, die sich unsere Lehren anhören wollen.
AI_Output(self,hero,"Info_PsiNov_2_DasLager_02_02"); //Suche einen der Gurus auf, und lass deine Seele bereichern.
};
// *************************************************************************
// Die Lage
// *************************************************************************
INSTANCE Info_PsiNov_2_DieLage(C_INFO) // E1
{
nr = 1;
condition = Info_PsiNov_2_DieLage_Condition;
information = Info_PsiNov_2_DieLage_Info;
permanent = 1;
description = "Wie sieht's aus?";
};
FUNC INT Info_PsiNov_2_DieLage_Condition()
{
return 1;
};
FUNC VOID Info_PsiNov_2_DieLage_Info()
{
AI_Output(hero,self,"Info_PsiNov_2_DieLage_15_00"); //Wie sieht's aus?
AI_Output(self,hero,"Info_PsiNov_2_DieLage_02_01"); //Ich habe wenig Zeit - muss mich um meine Aufgaben kümmern.
};
INSTANCE Info_Mod_PsiNov_2_Pickpocket (C_INFO)
{
nr = 6;
condition = Info_Mod_PsiNov_2_Pickpocket_Condition;
information = Info_Mod_PsiNov_2_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_60;
};
FUNC INT Info_Mod_PsiNov_2_Pickpocket_Condition()
{
C_Beklauen (30+r_max(30), ItMi_Gold, 100+r_max(50));
};
FUNC VOID Info_Mod_PsiNov_2_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
Info_AddChoice (Info_Mod_PsiNov_2_Pickpocket, DIALOG_BACK, Info_Mod_PsiNov_2_Pickpocket_BACK);
Info_AddChoice (Info_Mod_PsiNov_2_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_PsiNov_2_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_PsiNov_2_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
};
FUNC VOID Info_Mod_PsiNov_2_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
Info_AddChoice (Info_Mod_PsiNov_2_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_PsiNov_2_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_PsiNov_2_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_PsiNov_2_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_PsiNov_2_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_PsiNov_2_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_PsiNov_2_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_PsiNov_2_Pickpocket_Bestechung()
{
B_Say (hero, self, "$PICKPOCKET_BESTECHUNG");
var int rnd; rnd = r_max(99);
if (rnd < 25)
|| ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50))
|| ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100))
|| ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200))
{
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
}
else
{
if (rnd >= 75)
{
B_GiveInvItems (hero, self, ItMi_Gold, 200);
}
else if (rnd >= 50)
{
B_GiveInvItems (hero, self, ItMi_Gold, 100);
}
else if (rnd >= 25)
{
B_GiveInvItems (hero, self, ItMi_Gold, 50);
};
B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01");
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_PsiNov_2_Pickpocket_Herausreden()
{
B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN");
if (r_max(99) < Mod_Verhandlungsgeschick)
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01");
Info_ClearChoices (Info_Mod_PsiNov_2_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
// *************************************************************************
// -------------------------------------------------------------------------
FUNC VOID B_AssignAmbientInfos_PsiNov_2(var c_NPC slf)
{
Info_PsiNov_2_EXIT.npc = Hlp_GetInstanceID(slf);
Info_PsiNov_2_EinerVonEuchWerden.npc = Hlp_GetInstanceID(slf);
Info_PsiNov_2_WichtigePersonen.npc = Hlp_GetInstanceID(slf);
Info_PsiNov_2_DasLager.npc = Hlp_GetInstanceID(slf);
Info_PsiNov_2_DieLage.npc = Hlp_GetInstanceID(slf);
Info_Mod_PsiNov_2_Pickpocket.npc = Hlp_GetInstanceID(slf);
};
|
D
|
import
std.stdio,
std.random,
std.typecons,
std.algorithm,
std.experimental.allocator.building_blocks;
void main()
{
ubyte[1024 * 1024] buf;
auto a = KRRegion!()(buf);
while(true)
{
void[][] bufs;
foreach(_; 0..10_000)
{
bufs ~= a.allocate(uniform(1, buf.length));
}
foreach(b; bufs.randomCover)
{
a.deallocate(b);
}
if(a.empty == Ternary.no) break;
}
writeln(`all the elements are freed but allocator is not empty !`);
}
|
D
|
// Written in the D programming language.
/**
* Elementary mathematical functions
*
* Contains the elementary mathematical functions (powers, roots,
* and trignometric functions), and low-level floating-point operations.
* Mathematical special functions are available in std.mathspecial.
*
* The functionality closely follows the IEEE754-2008 standard for
* floating-point arithmetic, including the use of camelCase names rather
* than C99-style lower case names. All of these functions behave correctly
* when presented with an infinity or NaN.
*
* Unlike C, there is no global 'errno' variable. Consequently, almost all of
* these functions are pure nothrow.
*
* Status:
* The semantics and names of feqrel and approxEqual will be revised.
*
* Macros:
* WIKI = Phobos/StdMath
*
* TABLE_SV = <table border=1 cellpadding=4 cellspacing=0>
* <caption>Special Values</caption>
* $0</table>
* SVH = $(TR $(TH $1) $(TH $2))
* SV = $(TR $(TD $1) $(TD $2))
*
* NAN = $(RED NAN)
* SUP = <span style="vertical-align:super;font-size:smaller">$0</span>
* GAMMA = Γ
* THETA = θ
* INTEGRAL = ∫
* INTEGRATE = $(BIG ∫<sub>$(SMALL $1)</sub><sup>$2</sup>)
* POWER = $1<sup>$2</sup>
* SUB = $1<sub>$2</sub>
* BIGSUM = $(BIG Σ <sup>$2</sup><sub>$(SMALL $1)</sub>)
* CHOOSE = $(BIG () <sup>$(SMALL $1)</sup><sub>$(SMALL $2)</sub> $(BIG ))
* PLUSMN = ±
* INFIN = ∞
* PLUSMNINF = ±∞
* PI = π
* LT = <
* GT = >
* SQRT = √
* HALF = ½
*
* Copyright: Copyright Digital Mars 2000 - 2011.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: $(WEB digitalmars.com, Walter Bright),
* Don Clugston
* Source: $(PHOBOSSRC std/_math.d)
*/
module std.math;
import core.stdc.math;
import std.range, std.traits;
version(unittest) {
import std.typetuple;
}
version(LDC) {
import ldc.intrinsics;
}
version(DigitalMars){
version = INLINE_YL2X; // x87 has opcodes for these
}
version (X86){
version = X86_Any;
}
version (X86_64){
version = X86_Any;
}
version(D_InlineAsm_X86){
version = InlineAsm_X86_Any;
}
else version(D_InlineAsm_X86_64){
version = InlineAsm_X86_Any;
}
version(unittest)
{
import core.stdc.stdio;
static if(real.sizeof > double.sizeof)
enum uint useDigits = 16;
else
enum uint useDigits = 15;
/******************************************
* Compare floating point numbers to n decimal digits of precision.
* Returns:
* 1 match
* 0 nomatch
*/
private bool equalsDigit(real x, real y, uint ndigits)
{
if (signbit(x) != signbit(y))
return 0;
if (isinf(x) && isinf(y))
return 1;
if (isinf(x) || isinf(y))
return 0;
if (isnan(x) && isnan(y))
return 1;
if (isnan(x) || isnan(y))
return 0;
char bufx[30];
char bufy[30];
assert(ndigits < bufx.length);
int ix;
int iy;
ix = sprintf(bufx.ptr, "%.*Lg", ndigits, x);
assert(ix < bufx.length && ix > 0);
iy = sprintf(bufy.ptr, "%.*Lg", ndigits, y);
assert(ix < bufy.length && ix > 0);
return bufx[0 .. ix] == bufy[0 .. iy];
}
/****************************************
* Simple function to compare two floating point values
* to a specified precision.
* Returns:
* true match
* false nomatch
*/
private bool mfeq(real x, real y, real precision)
{
if (x == y)
return true;
if (isnan(x))
return isnan(y);
if (isnan(y))
return false;
return fabs(x - y) <= precision;
}
}
private:
/*
* The following IEEE 'real' formats are currently supported:
* 64 bit Big-endian 'double' (eg PowerPC)
* 128 bit Big-endian 'quadruple' (eg SPARC)
* 64 bit Little-endian 'double' (eg x86-SSE2)
* 80 bit Little-endian, with implied bit 'real80' (eg x87, Itanium).
* 128 bit Little-endian 'quadruple' (not implemented on any known processor!)
*
* Non-IEEE 128 bit Big-endian 'doubledouble' (eg PowerPC) has partial support
*/
version(LittleEndian) {
static assert(real.mant_dig == 53 || real.mant_dig==64
|| real.mant_dig == 113,
"Only 64-bit, 80-bit, and 128-bit reals"
" are supported for LittleEndian CPUs");
} else {
static assert(real.mant_dig == 53 || real.mant_dig==106
|| real.mant_dig == 113,
"Only 64-bit and 128-bit reals are supported for BigEndian CPUs."
" double-double reals have partial support");
}
// Constants used for extracting the components of the representation.
// They supplement the built-in floating point properties.
template floatTraits(T) {
// EXPMASK is a ushort mask to select the exponent portion (without sign)
// EXPPOS_SHORT is the index of the exponent when represented as a ushort array.
// SIGNPOS_BYTE is the index of the sign when represented as a ubyte array.
// RECIP_EPSILON is the value such that (smallest_subnormal) * RECIP_EPSILON == T.min_normal
enum T RECIP_EPSILON = (1/T.epsilon);
static if (T.mant_dig == 24)
{ // float
enum ushort EXPMASK = 0x7F80;
enum ushort EXPBIAS = 0x3F00;
enum uint EXPMASK_INT = 0x7F80_0000;
enum uint MANTISSAMASK_INT = 0x007F_FFFF;
version(LittleEndian) {
enum EXPPOS_SHORT = 1;
} else {
enum EXPPOS_SHORT = 0;
}
}
else static if (T.mant_dig == 53) // double, or real==double
{
enum ushort EXPMASK = 0x7FF0;
enum ushort EXPBIAS = 0x3FE0;
enum uint EXPMASK_INT = 0x7FF0_0000;
enum uint MANTISSAMASK_INT = 0x000F_FFFF; // for the MSB only
version(LittleEndian) {
enum EXPPOS_SHORT = 3;
enum SIGNPOS_BYTE = 7;
} else {
enum EXPPOS_SHORT = 0;
enum SIGNPOS_BYTE = 0;
}
}
else static if (T.mant_dig == 64) // real80
{
enum ushort EXPMASK = 0x7FFF;
enum ushort EXPBIAS = 0x3FFE;
version(LittleEndian)
{
enum EXPPOS_SHORT = 4;
enum SIGNPOS_BYTE = 9;
}
else
{
enum EXPPOS_SHORT = 0;
enum SIGNPOS_BYTE = 0;
}
} else static if (T.mant_dig == 113){ // quadruple
enum ushort EXPMASK = 0x7FFF;
version(LittleEndian)
{
enum EXPPOS_SHORT = 7;
enum SIGNPOS_BYTE = 15;
}
else
{
enum EXPPOS_SHORT = 0;
enum SIGNPOS_BYTE = 0;
}
} else static if (T.mant_dig == 106) { // doubledouble
enum ushort EXPMASK = 0x7FF0;
// the exponent byte is not unique
version(LittleEndian)
{
enum EXPPOS_SHORT = 7; // [3] is also an exp short
enum SIGNPOS_BYTE = 15;
}
else
{
enum EXPPOS_SHORT = 0; // [4] is also an exp short
enum SIGNPOS_BYTE = 0;
}
}
}
// These apply to all floating-point types
version(LittleEndian)
{
enum MANTISSA_LSB = 0;
enum MANTISSA_MSB = 1;
}
else
{
enum MANTISSA_LSB = 1;
enum MANTISSA_MSB = 0;
}
public:
// Values obtained from Wolfram Alpha. 116 bits ought to be enough for anybody.
// Wolfram Alpha LLC. 2011. Wolfram|Alpha. http://www.wolframalpha.com/input/?i=e+in+base+16 (access July 6, 2011).
enum real E = 0x1.5bf0a8b1457695355fb8ac404e7a8p+1L; /** e = 2.718281... */
enum real LOG2T = 0x1.a934f0979a3715fc9257edfe9b5fbp+1L; /** $(SUB log, 2)10 = 3.321928... */
enum real LOG2E = 0x1.71547652b82fe1777d0ffda0d23a8p+0L; /** $(SUB log, 2)e = 1.442695... */
enum real LOG2 = 0x1.34413509f79fef311f12b35816f92p-2L; /** $(SUB log, 10)2 = 0.301029... */
enum real LOG10E = 0x1.bcb7b1526e50e32a6ab7555f5a67cp-2L; /** $(SUB log, 10)e = 0.434294... */
enum real LN2 = 0x1.62e42fefa39ef35793c7673007e5fp-1L; /** ln 2 = 0.693147... */
enum real LN10 = 0x1.26bb1bbb5551582dd4adac5705a61p+1L; /** ln 10 = 2.302585... */
enum real PI = 0x1.921fb54442d18469898cc51701b84p+1L; /** $(_PI) = 3.141592... */
enum real PI_2 = PI/2; /** $(PI) / 2 = 1.570796... */
enum real PI_4 = PI/4; /** $(PI) / 4 = 0.785398... */
enum real M_1_PI = 0x1.45f306dc9c882a53f84eafa3ea69cp-2L; /** 1 / $(PI) = 0.318309... */
enum real M_2_PI = 2*M_1_PI; /** 2 / $(PI) = 0.636619... */
enum real M_2_SQRTPI = 0x1.20dd750429b6d11ae3a914fed7fd8p+0L; /** 2 / $(SQRT)$(PI) = 1.128379... */
enum real SQRT2 = 0x1.6a09e667f3bcc908b2fb1366ea958p+0L; /** $(SQRT)2 = 1.414213... */
enum real SQRT1_2 = SQRT2/2; /** $(SQRT)$(HALF) = 0.707106... */
// Note: Make sure the magic numbers in compiler backend for x87 match these.
/*
Octal versions:
PI/64800 0.00001 45530 36176 77347 02143 15351 61441 26767
PI/180 0.01073 72152 11224 72344 25603 54276 63351 22056
PI/8 0.31103 75524 21026 43021 51423 06305 05600 67016
SQRT(1/PI) 0.44067 27240 41233 33210 65616 51051 77327 77303
2/PI 0.50574 60333 44710 40522 47741 16537 21752 32335
PI/4 0.62207 73250 42055 06043 23046 14612 13401 56034
SQRT(2/PI) 0.63041 05147 52066 24106 41762 63612 00272 56161
PI 3.11037 55242 10264 30215 14230 63050 56006 70163
LOG2 0.23210 11520 47674 77674 61076 11263 26013 37111
*/
/***********************************
* Calculates the absolute value
*
* For complex numbers, abs(z) = sqrt( $(POWER z.re, 2) + $(POWER z.im, 2) )
* = hypot(z.re, z.im).
*/
Num abs(Num)(Num x) @safe pure nothrow
if (is(typeof(Num.init >= 0)) && is(typeof(-Num.init)) &&
!(is(Num* : const(ifloat*)) || is(Num* : const(idouble*))
|| is(Num* : const(ireal*))))
{
static if (isFloatingPoint!(Num))
return fabs(x);
else
return x>=0 ? x : -x;
}
auto abs(Num)(Num z) @safe pure nothrow
if (is(Num* : const(cfloat*)) || is(Num* : const(cdouble*))
|| is(Num* : const(creal*)))
{
return hypot(z.re, z.im);
}
/** ditto */
real abs(Num)(Num y) @safe pure nothrow
if (is(Num* : const(ifloat*)) || is(Num* : const(idouble*))
|| is(Num* : const(ireal*)))
{
return fabs(y.im);
}
unittest
{
assert(isIdentical(abs(-0.0L), 0.0L));
assert(isNaN(abs(real.nan)));
assert(abs(-real.infinity) == real.infinity);
assert(abs(-3.2Li) == 3.2L);
assert(abs(71.6Li) == 71.6L);
assert(abs(-56) == 56);
assert(abs(2321312L) == 2321312L);
assert(abs(-1+1i) == sqrt(2.0));
}
/***********************************
* Complex conjugate
*
* conj(x + iy) = x - iy
*
* Note that z * conj(z) = $(POWER z.re, 2) - $(POWER z.im, 2)
* is always a real number
*/
creal conj(creal z) @safe pure nothrow
{
return z.re - z.im*1i;
}
/** ditto */
ireal conj(ireal y) @safe pure nothrow
{
return -y;
}
unittest
{
assert(conj(7 + 3i) == 7-3i);
ireal z = -3.2Li;
assert(conj(z) == -z);
}
/***********************************
* Returns cosine of x. x is in radians.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH cos(x)) $(TH invalid?))
* $(TR $(TD $(NAN)) $(TD $(NAN)) $(TD yes) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(NAN)) $(TD yes) )
* )
* Bugs:
* Results are undefined if |x| >= $(POWER 2,64).
*/
real cos(real x) @safe pure nothrow; /* intrinsic */
/***********************************
* Returns sine of x. x is in radians.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH sin(x)) $(TH invalid?))
* $(TR $(TD $(NAN)) $(TD $(NAN)) $(TD yes))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no))
* $(TR $(TD $(PLUSMNINF)) $(TD $(NAN)) $(TD yes))
* )
* Bugs:
* Results are undefined if |x| >= $(POWER 2,64).
*/
real sin(real x) @safe pure nothrow; /* intrinsic */
/***********************************
* sine, complex and imaginary
*
* sin(z) = sin(z.re)*cosh(z.im) + cos(z.re)*sinh(z.im)i
*
* If both sin($(THETA)) and cos($(THETA)) are required,
* it is most efficient to use expi($(THETA)).
*/
creal sin(creal z) @safe pure nothrow
{
creal cs = expi(z.re);
creal csh = coshisinh(z.im);
return cs.im * csh.re + cs.re * csh.im * 1i;
}
/** ditto */
ireal sin(ireal y) @safe pure nothrow
{
return cosh(y.im)*1i;
}
unittest
{
assert(sin(0.0+0.0i) == 0.0);
assert(sin(2.0+0.0i) == sin(2.0L) );
}
/***********************************
* cosine, complex and imaginary
*
* cos(z) = cos(z.re)*cosh(z.im) - sin(z.re)*sinh(z.im)i
*/
creal cos(creal z) @safe pure nothrow
{
creal cs = expi(z.re);
creal csh = coshisinh(z.im);
return cs.re * csh.re - cs.im * csh.im * 1i;
}
/** ditto */
real cos(ireal y) @safe pure nothrow
{
return cosh(y.im);
}
unittest{
assert(cos(0.0+0.0i)==1.0);
assert(cos(1.3L+0.0i)==cos(1.3L));
assert(cos(5.2Li)== cosh(5.2L));
}
/****************************************************************************
* Returns tangent of x. x is in radians.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH tan(x)) $(TH invalid?))
* $(TR $(TD $(NAN)) $(TD $(NAN)) $(TD yes))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no))
* $(TR $(TD $(PLUSMNINF)) $(TD $(NAN)) $(TD yes))
* )
*/
real tan(real x) @trusted pure nothrow
{
version(D_InlineAsm_X86)
{
asm
{
fld x[EBP] ; // load theta
fxam ; // test for oddball values
fstsw AX ;
sahf ;
jc trigerr ; // x is NAN, infinity, or empty
// 387's can handle subnormals
SC18: fptan ;
fstp ST(0) ; // dump X, which is always 1
fstsw AX ;
sahf ;
jnp Lret ; // C2 = 1 (x is out of range)
// Do argument reduction to bring x into range
fldpi ;
fxch ;
SC17: fprem1 ;
fstsw AX ;
sahf ;
jp SC17 ;
fstp ST(1) ; // remove pi from stack
jmp SC18 ;
trigerr:
jnp Lret ; // if theta is NAN, return theta
fstp ST(0) ; // dump theta
}
return real.nan;
Lret:
;
}
else version(D_InlineAsm_X86_64)
{
version (Win64)
{
asm
{
fld real ptr [RCX] ; // load theta
}
}
else
{
asm
{
fld x[RBP] ; // load theta
}
}
asm
{
fxam ; // test for oddball values
fstsw AX ;
test AH,1 ;
jnz trigerr ; // x is NAN, infinity, or empty
// 387's can handle subnormals
SC18: fptan ;
fstp ST(0) ; // dump X, which is always 1
fstsw AX ;
test AH,4 ;
jz Lret ; // C2 = 1 (x is out of range)
// Do argument reduction to bring x into range
fldpi ;
fxch ;
SC17: fprem1 ;
fstsw AX ;
test AH,4 ;
jnz SC17 ;
fstp ST(1) ; // remove pi from stack
jmp SC18 ;
trigerr:
test AH,4 ;
jz Lret ; // if theta is NAN, return theta
fstp ST(0) ; // dump theta
}
return real.nan;
Lret:
;
} else {
return core.stdc.math.tanl(x);
}
}
unittest
{
static real vals[][2] = // angle,tan
[
[ 0, 0],
[ .5, .5463024898],
[ 1, 1.557407725],
[ 1.5, 14.10141995],
[ 2, -2.185039863],
[ 2.5,-.7470222972],
[ 3, -.1425465431],
[ 3.5, .3745856402],
[ 4, 1.157821282],
[ 4.5, 4.637332055],
[ 5, -3.380515006],
[ 5.5,-.9955840522],
[ 6, -.2910061914],
[ 6.5, .2202772003],
[ 10, .6483608275],
// special angles
[ PI_4, 1],
//[ PI_2, real.infinity], // PI_2 is not _exactly_ pi/2.
[ 3*PI_4, -1],
[ PI, 0],
[ 5*PI_4, 1],
//[ 3*PI_2, -real.infinity],
[ 7*PI_4, -1],
[ 2*PI, 0],
];
int i;
for (i = 0; i < vals.length; i++)
{
real x = vals[i][0];
real r = vals[i][1];
real t = tan(x);
//printf("tan(%Lg) = %Lg, should be %Lg\n", x, t, r);
if (!isIdentical(r, t)) assert(fabs(r-t) <= .0000001);
x = -x;
r = -r;
t = tan(x);
//printf("tan(%Lg) = %Lg, should be %Lg\n", x, t, r);
if (!isIdentical(r, t) && !(r!<>=0 && t!<>=0)) assert(fabs(r-t) <= .0000001);
}
// overflow
assert(isNaN(tan(real.infinity)));
assert(isNaN(tan(-real.infinity)));
// NaN propagation
assert(isIdentical( tan(NaN(0x0123L)), NaN(0x0123L) ));
}
unittest
{
assert(equalsDigit(tan(PI / 3), std.math.sqrt(3.0), useDigits));
}
/***************
* Calculates the arc cosine of x,
* returning a value ranging from 0 to $(PI).
*
* $(TABLE_SV
* $(TR $(TH x) $(TH acos(x)) $(TH invalid?))
* $(TR $(TD $(GT)1.0) $(TD $(NAN)) $(TD yes))
* $(TR $(TD $(LT)-1.0) $(TD $(NAN)) $(TD yes))
* $(TR $(TD $(NAN)) $(TD $(NAN)) $(TD yes))
* )
*/
real acos(real x) @safe pure nothrow
{
return atan2(sqrt(1-x*x), x);
}
/// ditto
double acos(double x) @safe pure nothrow { return acos(cast(real)x); }
/// ditto
float acos(float x) @safe pure nothrow { return acos(cast(real)x); }
unittest
{
assert(equalsDigit(acos(0.5), std.math.PI / 3, useDigits));
}
/***************
* Calculates the arc sine of x,
* returning a value ranging from -$(PI)/2 to $(PI)/2.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH asin(x)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no))
* $(TR $(TD $(GT)1.0) $(TD $(NAN)) $(TD yes))
* $(TR $(TD $(LT)-1.0) $(TD $(NAN)) $(TD yes))
* )
*/
real asin(real x) @safe pure nothrow
{
return atan2(x, sqrt(1-x*x));
}
/// ditto
double asin(double x) @safe pure nothrow { return asin(cast(real)x); }
/// ditto
float asin(float x) @safe pure nothrow { return asin(cast(real)x); }
unittest
{
assert(equalsDigit(asin(0.5), PI / 6, useDigits));
}
/***************
* Calculates the arc tangent of x,
* returning a value ranging from -$(PI)/2 to $(PI)/2.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH atan(x)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no))
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(NAN)) $(TD yes))
* )
*/
real atan(real x) @safe pure nothrow { return atan2(x, 1.0L); }
/// ditto
double atan(double x) @safe pure nothrow { return atan(cast(real)x); }
/// ditto
float atan(float x) @safe pure nothrow { return atan(cast(real)x); }
unittest
{
assert(equalsDigit(atan(std.math.sqrt(3.0)), PI / 3, useDigits));
}
/***************
* Calculates the arc tangent of y / x,
* returning a value ranging from -$(PI) to $(PI).
*
* $(TABLE_SV
* $(TR $(TH y) $(TH x) $(TH atan(y, x)))
* $(TR $(TD $(NAN)) $(TD anything) $(TD $(NAN)) )
* $(TR $(TD anything) $(TD $(NAN)) $(TD $(NAN)) )
* $(TR $(TD $(PLUSMN)0.0) $(TD $(GT)0.0) $(TD $(PLUSMN)0.0) )
* $(TR $(TD $(PLUSMN)0.0) $(TD +0.0) $(TD $(PLUSMN)0.0) )
* $(TR $(TD $(PLUSMN)0.0) $(TD $(LT)0.0) $(TD $(PLUSMN)$(PI)))
* $(TR $(TD $(PLUSMN)0.0) $(TD -0.0) $(TD $(PLUSMN)$(PI)))
* $(TR $(TD $(GT)0.0) $(TD $(PLUSMN)0.0) $(TD $(PI)/2) )
* $(TR $(TD $(LT)0.0) $(TD $(PLUSMN)0.0) $(TD -$(PI)/2) )
* $(TR $(TD $(GT)0.0) $(TD $(INFIN)) $(TD $(PLUSMN)0.0) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD anything) $(TD $(PLUSMN)$(PI)/2))
* $(TR $(TD $(GT)0.0) $(TD -$(INFIN)) $(TD $(PLUSMN)$(PI)) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(INFIN)) $(TD $(PLUSMN)$(PI)/4))
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD -$(INFIN)) $(TD $(PLUSMN)3$(PI)/4))
* )
*/
real atan2(real y, real x) @trusted pure nothrow
{
version(InlineAsm_X86_Any)
{
version (Win64)
{
asm {
naked;
fld real ptr [RDX]; // y
fld real ptr [RCX]; // x
fpatan;
ret;
}
}
else
{
asm {
fld y;
fld x;
fpatan;
}
}
}
else
{
return core.stdc.math.atan2l(y,x);
}
}
/// ditto
double atan2(double y, double x) @safe pure nothrow
{
return atan2(cast(real)y, cast(real)x);
}
/// ditto
float atan2(float y, float x) @safe pure nothrow
{
return atan2(cast(real)y, cast(real)x);
}
unittest
{
assert(equalsDigit(atan2(1.0L, std.math.sqrt(3.0L)), PI / 6, useDigits));
}
/***********************************
* Calculates the hyperbolic cosine of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH cosh(x)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(PLUSMN)0.0) $(TD no) )
* )
*/
real cosh(real x) @safe pure nothrow
{
// cosh = (exp(x)+exp(-x))/2.
// The naive implementation works correctly.
real y = exp(x);
return (y + 1.0/y) * 0.5;
}
/// ditto
double cosh(double x) @safe pure nothrow { return cosh(cast(real)x); }
/// ditto
float cosh(float x) @safe pure nothrow { return cosh(cast(real)x); }
unittest
{
assert(equalsDigit(cosh(1.0), (E + 1.0 / E) / 2, useDigits));
}
/***********************************
* Calculates the hyperbolic sine of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH sinh(x)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no))
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(PLUSMN)$(INFIN)) $(TD no))
* )
*/
real sinh(real x) @safe pure nothrow
{
// sinh(x) = (exp(x)-exp(-x))/2;
// Very large arguments could cause an overflow, but
// the maximum value of x for which exp(x) + exp(-x)) != exp(x)
// is x = 0.5 * (real.mant_dig) * LN2. // = 22.1807 for real80.
if (fabs(x) > real.mant_dig * LN2) {
return copysign(0.5 * exp(fabs(x)), x);
}
real y = expm1(x);
return 0.5 * y / (y+1) * (y+2);
}
/// ditto
double sinh(double x) @safe pure nothrow { return sinh(cast(real)x); }
/// ditto
float sinh(float x) @safe pure nothrow { return sinh(cast(real)x); }
unittest
{
assert(equalsDigit(sinh(1.0), (E - 1.0 / E) / 2, useDigits));
}
/***********************************
* Calculates the hyperbolic tangent of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH tanh(x)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(PLUSMN)1.0) $(TD no))
* )
*/
real tanh(real x) @safe pure nothrow
{
// tanh(x) = (exp(x) - exp(-x))/(exp(x)+exp(-x))
if (fabs(x) > real.mant_dig * LN2) {
return copysign(1, x);
}
real y = expm1(2*x);
return y / (y + 2);
}
/// ditto
double tanh(double x) @safe pure nothrow { return tanh(cast(real)x); }
/// ditto
float tanh(float x) @safe pure nothrow { return tanh(cast(real)x); }
unittest
{
assert(equalsDigit(tanh(1.0), sinh(1.0) / cosh(1.0), 15));
}
package:
/* Returns cosh(x) + I * sinh(x)
* Only one call to exp() is performed.
*/
creal coshisinh(real x) @safe pure nothrow
{
// See comments for cosh, sinh.
if (fabs(x) > real.mant_dig * LN2) {
real y = exp(fabs(x));
return y * 0.5 + 0.5i * copysign(y, x);
} else {
real y = expm1(x);
return (y + 1.0 + 1.0/(y + 1.0)) * 0.5 + 0.5i * y / (y+1) * (y+2);
}
}
unittest {
creal c = coshisinh(3.0L);
assert(c.re == cosh(3.0L));
assert(c.im == sinh(3.0L));
}
public:
/***********************************
* Calculates the inverse hyperbolic cosine of x.
*
* Mathematically, acosh(x) = log(x + sqrt( x*x - 1))
*
* $(TABLE_DOMRG
* $(DOMAIN 1..$(INFIN))
* $(RANGE 1..log(real.max), $(INFIN)) )
* $(TABLE_SV
* $(SVH x, acosh(x) )
* $(SV $(NAN), $(NAN) )
* $(SV $(LT)1, $(NAN) )
* $(SV 1, 0 )
* $(SV +$(INFIN),+$(INFIN))
* )
*/
real acosh(real x) @safe pure nothrow
{
if (x > 1/real.epsilon)
return LN2 + log(x);
else
return log(x + sqrt(x*x - 1));
}
/// ditto
double acosh(double x) @safe pure nothrow { return acosh(cast(real)x); }
/// ditto
float acosh(float x) @safe pure nothrow { return acosh(cast(real)x); }
unittest
{
assert(isNaN(acosh(0.9)));
assert(isNaN(acosh(real.nan)));
assert(acosh(1.0)==0.0);
assert(acosh(real.infinity) == real.infinity);
assert(isNaN(acosh(0.5)));
assert(equalsDigit(acosh(cosh(3.0)), 3, useDigits));
}
/***********************************
* Calculates the inverse hyperbolic sine of x.
*
* Mathematically,
* ---------------
* asinh(x) = log( x + sqrt( x*x + 1 )) // if x >= +0
* asinh(x) = -log(-x + sqrt( x*x + 1 )) // if x <= -0
* -------------
*
* $(TABLE_SV
* $(SVH x, asinh(x) )
* $(SV $(NAN), $(NAN) )
* $(SV $(PLUSMN)0, $(PLUSMN)0 )
* $(SV $(PLUSMN)$(INFIN),$(PLUSMN)$(INFIN))
* )
*/
real asinh(real x) @safe pure nothrow
{
return (fabs(x) > 1 / real.epsilon)
// beyond this point, x*x + 1 == x*x
? copysign(LN2 + log(fabs(x)), x)
// sqrt(x*x + 1) == 1 + x * x / ( 1 + sqrt(x*x + 1) )
: copysign(log1p(fabs(x) + x*x / (1 + sqrt(x*x + 1)) ), x);
}
/// ditto
double asinh(double x) @safe pure nothrow { return asinh(cast(real)x); }
/// ditto
float asinh(float x) @safe pure nothrow { return asinh(cast(real)x); }
unittest
{
assert(isIdentical(asinh(0.0), 0.0));
assert(isIdentical(asinh(-0.0), -0.0));
assert(asinh(real.infinity) == real.infinity);
assert(asinh(-real.infinity) == -real.infinity);
assert(isNaN(asinh(real.nan)));
assert(equalsDigit(asinh(sinh(3.0)), 3, useDigits));
}
/***********************************
* Calculates the inverse hyperbolic tangent of x,
* returning a value from ranging from -1 to 1.
*
* Mathematically, atanh(x) = log( (1+x)/(1-x) ) / 2
*
*
* $(TABLE_DOMRG
* $(DOMAIN -$(INFIN)..$(INFIN))
* $(RANGE -1..1) )
* $(TABLE_SV
* $(SVH x, acosh(x) )
* $(SV $(NAN), $(NAN) )
* $(SV $(PLUSMN)0, $(PLUSMN)0)
* $(SV -$(INFIN), -0)
* )
*/
real atanh(real x) @safe pure nothrow
{
// log( (1+x)/(1-x) ) == log ( 1 + (2*x)/(1-x) )
return 0.5 * log1p( 2 * x / (1 - x) );
}
/// ditto
double atanh(double x) @safe pure nothrow { return atanh(cast(real)x); }
/// ditto
float atanh(float x) @safe pure nothrow { return atanh(cast(real)x); }
unittest
{
assert(isIdentical(atanh(0.0), 0.0));
assert(isIdentical(atanh(-0.0),-0.0));
assert(isNaN(atanh(real.nan)));
assert(isNaN(atanh(-real.infinity)));
assert(atanh(0.0) == 0);
assert(equalsDigit(atanh(tanh(0.5L)), 0.5, useDigits));
}
/*****************************************
* Returns x rounded to a long value using the current rounding mode.
* If the integer value of x is
* greater than long.max, the result is
* indeterminate.
*/
long rndtol(real x) @safe pure nothrow; /* intrinsic */
/*****************************************
* Returns x rounded to a long value using the FE_TONEAREST rounding mode.
* If the integer value of x is
* greater than long.max, the result is
* indeterminate.
*/
extern (C) real rndtonl(real x);
/***************************************
* Compute square root of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH sqrt(x)) $(TH invalid?))
* $(TR $(TD -0.0) $(TD -0.0) $(TD no))
* $(TR $(TD $(LT)0.0) $(TD $(NAN)) $(TD yes))
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD no))
* )
*/
float sqrt(float x) @safe pure nothrow; /* intrinsic */
double sqrt(double x) @safe pure nothrow; /* intrinsic */ /// ditto
real sqrt(real x) @safe pure nothrow; /* intrinsic */ /// ditto
unittest
{
//ctfe
enum ZX80 = sqrt(7.0f);
enum ZX81 = sqrt(7.0);
enum ZX82 = sqrt(7.0L);
}
creal sqrt(creal z) @safe pure nothrow
{
creal c;
real x,y,w,r;
if (z == 0)
{
c = 0 + 0i;
}
else
{
real z_re = z.re;
real z_im = z.im;
x = fabs(z_re);
y = fabs(z_im);
if (x >= y)
{
r = y / x;
w = sqrt(x) * sqrt(0.5 * (1 + sqrt(1 + r * r)));
}
else
{
r = x / y;
w = sqrt(y) * sqrt(0.5 * (r + sqrt(1 + r * r)));
}
if (z_re >= 0)
{
c = w + (z_im / (w + w)) * 1.0i;
}
else
{
if (z_im < 0)
w = -w;
c = z_im / (w + w) + w * 1.0i;
}
}
return c;
}
/**
* Calculates e$(SUP x).
*
* $(TABLE_SV
* $(TR $(TH x) $(TH e$(SUP x)) )
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) )
* $(TR $(TD -$(INFIN)) $(TD +0.0) )
* $(TR $(TD $(NAN)) $(TD $(NAN)) )
* )
*/
real exp(real x) @trusted pure nothrow
{
version(D_InlineAsm_X86)
{
// e^^x = 2^^(LOG2E*x)
// (This is valid because the overflow & underflow limits for exp
// and exp2 are so similar).
return exp2(LOG2E*x);
}
else version(D_InlineAsm_X86_64)
{
// e^^x = 2^^(LOG2E*x)
// (This is valid because the overflow & underflow limits for exp
// and exp2 are so similar).
return exp2(LOG2E*x);
} else {
return core.stdc.math.expl(x);
}
}
/// ditto
double exp(double x) @safe pure nothrow { return exp(cast(real)x); }
/// ditto
float exp(float x) @safe pure nothrow { return exp(cast(real)x); }
unittest
{
assert(equalsDigit(exp(3.0), E * E * E, useDigits));
}
/**
* Calculates the value of the natural logarithm base (e)
* raised to the power of x, minus 1.
*
* For very small x, expm1(x) is more accurate
* than exp(x)-1.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH e$(SUP x)-1) )
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) )
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) )
* $(TR $(TD -$(INFIN)) $(TD -1.0) )
* $(TR $(TD $(NAN)) $(TD $(NAN)) )
* )
*/
real expm1(real x) @trusted pure nothrow
{
version(D_InlineAsm_X86) {
enum { PARAMSIZE = (real.sizeof+3)&(0xFFFF_FFFC) } // always a multiple of 4
asm {
/* expm1() for x87 80-bit reals, IEEE754-2008 conformant.
* Author: Don Clugston.
*
* expm1(x) = 2^^(rndint(y))* 2^^(y-rndint(y)) - 1 where y = LN2*x.
* = 2rndy * 2ym1 + 2rndy - 1, where 2rndy = 2^^(rndint(y))
* and 2ym1 = (2^^(y-rndint(y))-1).
* If 2rndy < 0.5*real.epsilon, result is -1.
* Implementation is otherwise the same as for exp2()
*/
naked;
fld real ptr [ESP+4] ; // x
mov AX, [ESP+4+8]; // AX = exponent and sign
sub ESP, 12+8; // Create scratch space on the stack
// [ESP,ESP+2] = scratchint
// [ESP+4..+6, +8..+10, +10] = scratchreal
// set scratchreal mantissa = 1.0
mov dword ptr [ESP+8], 0;
mov dword ptr [ESP+8+4], 0x80000000;
and AX, 0x7FFF; // drop sign bit
cmp AX, 0x401D; // avoid InvalidException in fist
jae L_extreme;
fldl2e;
fmulp ST(1), ST; // y = x*log2(e)
fist dword ptr [ESP]; // scratchint = rndint(y)
fisub dword ptr [ESP]; // y - rndint(y)
// and now set scratchreal exponent
mov EAX, [ESP];
add EAX, 0x3fff;
jle short L_largenegative;
cmp EAX,0x8000;
jge short L_largepositive;
mov [ESP+8+8],AX;
f2xm1; // 2ym1 = 2^^(y-rndint(y)) -1
fld real ptr [ESP+8] ; // 2rndy = 2^^rndint(y)
fmul ST(1), ST; // ST=2rndy, ST(1)=2rndy*2ym1
fld1;
fsubp ST(1), ST; // ST = 2rndy-1, ST(1) = 2rndy * 2ym1 - 1
faddp ST(1), ST; // ST = 2rndy * 2ym1 + 2rndy - 1
add ESP,12+8;
ret PARAMSIZE;
L_extreme: // Extreme exponent. X is very large positive, very
// large negative, infinity, or NaN.
fxam;
fstsw AX;
test AX, 0x0400; // NaN_or_zero, but we already know x!=0
jz L_was_nan; // if x is NaN, returns x
test AX, 0x0200;
jnz L_largenegative;
L_largepositive:
// Set scratchreal = real.max.
// squaring it will create infinity, and set overflow flag.
mov word ptr [ESP+8+8], 0x7FFE;
fstp ST(0);
fld real ptr [ESP+8]; // load scratchreal
fmul ST(0), ST; // square it, to create havoc!
L_was_nan:
add ESP,12+8;
ret PARAMSIZE;
L_largenegative:
fstp ST(0);
fld1;
fchs; // return -1. Underflow flag is not set.
add ESP,12+8;
ret PARAMSIZE;
}
} else version(D_InlineAsm_X86_64) {
asm
{
naked;
}
version (Win64)
{
asm
{
fld real ptr [RCX]; // x
mov AX,[RCX+8]; // AX = exponent and sign
}
}
else
{
asm
{
fld real ptr [RSP+8]; // x
mov AX,[RSP+8+8]; // AX = exponent and sign
}
}
asm
{
/* expm1() for x87 80-bit reals, IEEE754-2008 conformant.
* Author: Don Clugston.
*
* expm1(x) = 2^(rndint(y))* 2^(y-rndint(y)) - 1 where y = LN2*x.
* = 2rndy * 2ym1 + 2rndy - 1, where 2rndy = 2^(rndint(y))
* and 2ym1 = (2^(y-rndint(y))-1).
* If 2rndy < 0.5*real.epsilon, result is -1.
* Implementation is otherwise the same as for exp2()
*/
sub RSP, 24; // Create scratch space on the stack
// [RSP,RSP+2] = scratchint
// [RSP+4..+6, +8..+10, +10] = scratchreal
// set scratchreal mantissa = 1.0
mov dword ptr [RSP+8], 0;
mov dword ptr [RSP+8+4], 0x80000000;
and AX, 0x7FFF; // drop sign bit
cmp AX, 0x401D; // avoid InvalidException in fist
jae L_extreme;
fldl2e;
fmul ; // y = x*log2(e)
fist dword ptr [RSP]; // scratchint = rndint(y)
fisub dword ptr [RSP]; // y - rndint(y)
// and now set scratchreal exponent
mov EAX, [RSP];
add EAX, 0x3fff;
jle short L_largenegative;
cmp EAX,0x8000;
jge short L_largepositive;
mov [RSP+8+8],AX;
f2xm1; // 2^(y-rndint(y)) -1
fld real ptr [RSP+8] ; // 2^rndint(y)
fmul ST(1), ST;
fld1;
fsubp ST(1), ST;
fadd;
add RSP,24;
ret;
L_extreme: // Extreme exponent. X is very large positive, very
// large negative, infinity, or NaN.
fxam;
fstsw AX;
test AX, 0x0400; // NaN_or_zero, but we already know x!=0
jz L_was_nan; // if x is NaN, returns x
test AX, 0x0200;
jnz L_largenegative;
L_largepositive:
// Set scratchreal = real.max.
// squaring it will create infinity, and set overflow flag.
mov word ptr [RSP+8+8], 0x7FFE;
fstp ST(0);
fld real ptr [RSP+8]; // load scratchreal
fmul ST(0), ST; // square it, to create havoc!
L_was_nan:
add RSP,24;
ret;
L_largenegative:
fstp ST(0);
fld1;
fchs; // return -1. Underflow flag is not set.
add RSP,24;
ret;
}
} else {
return core.stdc.math.expm1l(x);
}
}
/**
* Calculates 2$(SUP x).
*
* $(TABLE_SV
* $(TR $(TH x) $(TH exp2(x)) )
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) )
* $(TR $(TD -$(INFIN)) $(TD +0.0) )
* $(TR $(TD $(NAN)) $(TD $(NAN)) )
* )
*/
real exp2(real x) @trusted pure nothrow
{
version(D_InlineAsm_X86) {
enum { PARAMSIZE = (real.sizeof+3)&(0xFFFF_FFFC) } // always a multiple of 4
asm {
/* exp2() for x87 80-bit reals, IEEE754-2008 conformant.
* Author: Don Clugston.
*
* exp2(x) = 2^^(rndint(x))* 2^^(y-rndint(x))
* The trick for high performance is to avoid the fscale(28cycles on core2),
* frndint(19 cycles), leaving f2xm1(19 cycles) as the only slow instruction.
*
* We can do frndint by using fist. BUT we can't use it for huge numbers,
* because it will set the Invalid Operation flag if overflow or NaN occurs.
* Fortunately, whenever this happens the result would be zero or infinity.
*
* We can perform fscale by directly poking into the exponent. BUT this doesn't
* work for the (very rare) cases where the result is subnormal. So we fall back
* to the slow method in that case.
*/
naked;
fld real ptr [ESP+4] ; // x
mov AX, [ESP+4+8]; // AX = exponent and sign
sub ESP, 12+8; // Create scratch space on the stack
// [ESP,ESP+2] = scratchint
// [ESP+4..+6, +8..+10, +10] = scratchreal
// set scratchreal mantissa = 1.0
mov dword ptr [ESP+8], 0;
mov dword ptr [ESP+8+4], 0x80000000;
and AX, 0x7FFF; // drop sign bit
cmp AX, 0x401D; // avoid InvalidException in fist
jae L_extreme;
fist dword ptr [ESP]; // scratchint = rndint(x)
fisub dword ptr [ESP]; // x - rndint(x)
// and now set scratchreal exponent
mov EAX, [ESP];
add EAX, 0x3fff;
jle short L_subnormal;
cmp EAX,0x8000;
jge short L_overflow;
mov [ESP+8+8],AX;
L_normal:
f2xm1;
fld1;
faddp ST(1), ST; // 2^^(x-rndint(x))
fld real ptr [ESP+8] ; // 2^^rndint(x)
add ESP,12+8;
fmulp ST(1), ST;
ret PARAMSIZE;
L_subnormal:
// Result will be subnormal.
// In this rare case, the simple poking method doesn't work.
// The speed doesn't matter, so use the slow fscale method.
fild dword ptr [ESP]; // scratchint
fld1;
fscale;
fstp real ptr [ESP+8]; // scratchreal = 2^^scratchint
fstp ST(0); // drop scratchint
jmp L_normal;
L_extreme: // Extreme exponent. X is very large positive, very
// large negative, infinity, or NaN.
fxam;
fstsw AX;
test AX, 0x0400; // NaN_or_zero, but we already know x!=0
jz L_was_nan; // if x is NaN, returns x
// set scratchreal = real.min_normal
// squaring it will return 0, setting underflow flag
mov word ptr [ESP+8+8], 1;
test AX, 0x0200;
jnz L_waslargenegative;
L_overflow:
// Set scratchreal = real.max.
// squaring it will create infinity, and set overflow flag.
mov word ptr [ESP+8+8], 0x7FFE;
L_waslargenegative:
fstp ST(0);
fld real ptr [ESP+8]; // load scratchreal
fmul ST(0), ST; // square it, to create havoc!
L_was_nan:
add ESP,12+8;
ret PARAMSIZE;
}
} else version(D_InlineAsm_X86_64) {
asm
{
naked;
}
version (Win64)
{
asm
{
fld real ptr [RCX]; // x
mov AX,[RCX+8]; // AX = exponent and sign
}
}
else
{
asm
{
fld real ptr [RSP+8]; // x
mov AX,[RSP+8+8]; // AX = exponent and sign
}
}
asm {
/* exp2() for x87 80-bit reals, IEEE754-2008 conformant.
* Author: Don Clugston.
*
* exp2(x) = 2^(rndint(x))* 2^(y-rndint(x))
* The trick for high performance is to avoid the fscale(28cycles on core2),
* frndint(19 cycles), leaving f2xm1(19 cycles) as the only slow instruction.
*
* We can do frndint by using fist. BUT we can't use it for huge numbers,
* because it will set the Invalid Operation flag is overflow or NaN occurs.
* Fortunately, whenever this happens the result would be zero or infinity.
*
* We can perform fscale by directly poking into the exponent. BUT this doesn't
* work for the (very rare) cases where the result is subnormal. So we fall back
* to the slow method in that case.
*/
sub RSP, 24; // Create scratch space on the stack
// [RSP,RSP+2] = scratchint
// [RSP+4..+6, +8..+10, +10] = scratchreal
// set scratchreal mantissa = 1.0
mov dword ptr [RSP+8], 0;
mov dword ptr [RSP+8+4], 0x80000000;
and AX, 0x7FFF; // drop sign bit
cmp AX, 0x401D; // avoid InvalidException in fist
jae L_extreme;
fist dword ptr [RSP]; // scratchint = rndint(x)
fisub dword ptr [RSP]; // x - rndint(x)
// and now set scratchreal exponent
mov EAX, [RSP];
add EAX, 0x3fff;
jle short L_subnormal;
cmp EAX,0x8000;
jge short L_overflow;
mov [RSP+8+8],AX;
L_normal:
f2xm1;
fld1;
fadd; // 2^(x-rndint(x))
fld real ptr [RSP+8] ; // 2^rndint(x)
add RSP,24;
fmulp ST(1), ST;
ret;
L_subnormal:
// Result will be subnormal.
// In this rare case, the simple poking method doesn't work.
// The speed doesn't matter, so use the slow fscale method.
fild dword ptr [RSP]; // scratchint
fld1;
fscale;
fstp real ptr [RSP+8]; // scratchreal = 2^scratchint
fstp ST(0); // drop scratchint
jmp L_normal;
L_extreme: // Extreme exponent. X is very large positive, very
// large negative, infinity, or NaN.
fxam;
fstsw AX;
test AX, 0x0400; // NaN_or_zero, but we already know x!=0
jz L_was_nan; // if x is NaN, returns x
// set scratchreal = real.min
// squaring it will return 0, setting underflow flag
mov word ptr [RSP+8+8], 1;
test AX, 0x0200;
jnz L_waslargenegative;
L_overflow:
// Set scratchreal = real.max.
// squaring it will create infinity, and set overflow flag.
mov word ptr [RSP+8+8], 0x7FFE;
L_waslargenegative:
fstp ST(0);
fld real ptr [RSP+8]; // load scratchreal
fmul ST(0), ST; // square it, to create havoc!
L_was_nan:
add RSP,24;
ret;
}
} else {
return core.stdc.math.exp2l(x);
}
}
unittest{
assert(exp2(0.5L)== SQRT2);
assert(exp2(8.0L) == 256.0);
assert(exp2(-9.0L)== 1.0L/512.0);
assert(exp(3.0L) == E*E*E);
assert( core.stdc.math.exp2f(0.0f) == 1 );
assert( core.stdc.math.exp2 (0.0) == 1 );
assert( core.stdc.math.exp2l(0.0L) == 1 );
}
unittest
{
FloatingPointControl ctrl;
ctrl.disableExceptions(FloatingPointControl.allExceptions);
ctrl.rounding = FloatingPointControl.roundToNearest;
// @@BUG@@: Non-immutable array literals are ridiculous.
// Note that these are only valid for 80-bit reals: overflow will be different for 64-bit reals.
static const real [2][] exptestpoints =
[ // x, exp(x)
[1.0L, E ],
[0.5L, 0x1.A612_98E1_E069_BC97p+0L ],
[3.0L, E*E*E ],
[0x1.1p13L, 0x1.29aeffefc8ec645p+12557L ], // near overflow
[-0x1.18p13L, 0x1.5e4bf54b4806db9p-12927L ], // near underflow
[-0x1.625p13L, 0x1.a6bd68a39d11f35cp-16358L],
[-0x1p30L, 0 ], // underflow - subnormal
[-0x1.62DAFp13L, 0x1.96c53d30277021dp-16383L ],
[-0x1.643p13L, 0x1p-16444L ],
[-0x1.645p13L, 0 ], // underflow to zero
[0x1p80L, real.infinity ], // far overflow
[real.infinity, real.infinity ],
[0x1.7p13L, real.infinity ] // close overflow
];
real x;
IeeeFlags f;
for (int i=0; i<exptestpoints.length;++i) {
resetIeeeFlags();
x = exp(exptestpoints[i][0]);
f = ieeeFlags;
assert(x == exptestpoints[i][1]);
// Check the overflow bit
assert(f.overflow == (fabs(x) == real.infinity));
// Check the underflow bit
assert(f.underflow == (fabs(x) < real.min_normal));
// Invalid and div by zero shouldn't be affected.
assert(!f.invalid);
assert(!f.divByZero);
}
// Ideally, exp(0) would not set the inexact flag.
// Unfortunately, fldl2e sets it!
// So it's not realistic to avoid setting it.
assert(exp(0.0L) == 1.0);
// NaN propagation. Doesn't set flags, bcos was already NaN.
resetIeeeFlags();
x = exp(real.nan);
f = ieeeFlags;
assert(isIdentical(x,real.nan));
assert(f.flags == 0);
resetIeeeFlags();
x = exp(-real.nan);
f = ieeeFlags;
assert(isIdentical(x, -real.nan));
assert(f.flags == 0);
x = exp(NaN(0x123));
assert(isIdentical(x, NaN(0x123)));
// High resolution test
assert(exp(0.5L) == 0x1.A612_98E1_E069_BC97_2DFE_FAB6D_33Fp+0L);
}
/**
* Calculate cos(y) + i sin(y).
*
* On many CPUs (such as x86), this is a very efficient operation;
* almost twice as fast as calculating sin(y) and cos(y) separately,
* and is the preferred method when both are required.
*/
creal expi(real y) @trusted pure nothrow
{
version(InlineAsm_X86_Any)
{
version (Win64)
{
asm
{
naked;
fld real ptr [ECX];
fsincos;
fxch ST(1), ST(0);
ret;
}
}
else
{
asm
{
fld y;
fsincos;
fxch ST(1), ST(0);
}
}
}
else
{
return cos(y) + sin(y)*1i;
}
}
unittest
{
assert(expi(1.3e5L) == cos(1.3e5L) + sin(1.3e5L) * 1i);
assert(expi(0.0L) == 1L + 0.0Li);
}
/*********************************************************************
* Separate floating point value into significand and exponent.
*
* Returns:
* Calculate and return $(I x) and $(I exp) such that
* value =$(I x)*2$(SUP exp) and
* .5 $(LT)= |$(I x)| $(LT) 1.0
*
* $(I x) has same sign as value.
*
* $(TABLE_SV
* $(TR $(TH value) $(TH returns) $(TH exp))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD 0))
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD int.max))
* $(TR $(TD -$(INFIN)) $(TD -$(INFIN)) $(TD int.min))
* $(TR $(TD $(PLUSMN)$(NAN)) $(TD $(PLUSMN)$(NAN)) $(TD int.min))
* )
*/
real frexp(real value, out int exp) @trusted pure nothrow
{
ushort* vu = cast(ushort*)&value;
long* vl = cast(long*)&value;
uint ex;
alias floatTraits!(real) F;
ex = vu[F.EXPPOS_SHORT] & F.EXPMASK;
static if (real.mant_dig == 64) { // real80
if (ex) { // If exponent is non-zero
if (ex == F.EXPMASK) { // infinity or NaN
if (*vl & 0x7FFF_FFFF_FFFF_FFFF) { // NaN
*vl |= 0xC000_0000_0000_0000; // convert NaNS to NaNQ
exp = int.min;
} else if (vu[F.EXPPOS_SHORT] & 0x8000) { // negative infinity
exp = int.min;
} else { // positive infinity
exp = int.max;
}
} else {
exp = ex - F.EXPBIAS;
vu[F.EXPPOS_SHORT] = (0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FFE;
}
} else if (!*vl) {
// value is +-0.0
exp = 0;
} else {
// subnormal
value *= F.RECIP_EPSILON;
ex = vu[F.EXPPOS_SHORT] & F.EXPMASK;
exp = ex - F.EXPBIAS - real.mant_dig + 1;
vu[F.EXPPOS_SHORT] = (0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FFE;
}
} else static if (real.mant_dig == 113) { // quadruple
if (ex) { // If exponent is non-zero
if (ex == F.EXPMASK) { // infinity or NaN
if (vl[MANTISSA_LSB] |
( vl[MANTISSA_MSB] & 0x0000_FFFF_FFFF_FFFF)) { // NaN
// convert NaNS to NaNQ
vl[MANTISSA_MSB] |= 0x0000_8000_0000_0000;
exp = int.min;
} else if (vu[F.EXPPOS_SHORT] & 0x8000) { // negative infinity
exp = int.min;
} else { // positive infinity
exp = int.max;
}
} else {
exp = ex - F.EXPBIAS;
vu[F.EXPPOS_SHORT] =
cast(ushort)((0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FFE);
}
} else if ((vl[MANTISSA_LSB]
|(vl[MANTISSA_MSB] & 0x0000_FFFF_FFFF_FFFF)) == 0) {
// value is +-0.0
exp = 0;
} else {
// subnormal
value *= F.RECIP_EPSILON;
ex = vu[F.EXPPOS_SHORT] & F.EXPMASK;
exp = ex - F.EXPBIAS - real.mant_dig + 1;
vu[F.EXPPOS_SHORT] =
cast(ushort)((0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FFE);
}
} else static if (real.mant_dig==53) { // real is double
if (ex) { // If exponent is non-zero
if (ex == F.EXPMASK) { // infinity or NaN
if (*vl == 0x7FF0_0000_0000_0000) { // positive infinity
exp = int.max;
} else if (*vl == 0xFFF0_0000_0000_0000) { // negative infinity
exp = int.min;
} else { // NaN
*vl |= 0x0008_0000_0000_0000; // convert NaNS to NaNQ
exp = int.min;
}
} else {
exp = (ex - F.EXPBIAS) >> 4;
vu[F.EXPPOS_SHORT] = cast(ushort)((0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FE0);
}
} else if (!(*vl & 0x7FFF_FFFF_FFFF_FFFF)) {
// value is +-0.0
exp = 0;
} else {
// subnormal
value *= F.RECIP_EPSILON;
ex = vu[F.EXPPOS_SHORT] & F.EXPMASK;
exp = ((ex - F.EXPBIAS)>> 4) - real.mant_dig + 1;
vu[F.EXPPOS_SHORT] =
cast(ushort)((0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FE0);
}
} else { //static if(real.mant_dig==106) // doubledouble
assert (0, "frexp not implemented");
}
return value;
}
unittest
{
static real vals[][3] = // x,frexp,exp
[
[0.0, 0.0, 0],
[-0.0, -0.0, 0],
[1.0, .5, 1],
[-1.0, -.5, 1],
[2.0, .5, 2],
[double.min_normal/2.0, .5, -1022],
[real.infinity,real.infinity,int.max],
[-real.infinity,-real.infinity,int.min],
[real.nan,real.nan,int.min],
[-real.nan,-real.nan,int.min],
];
int i;
for (i = 0; i < vals.length; i++) {
real x = vals[i][0];
real e = vals[i][1];
int exp = cast(int)vals[i][2];
int eptr;
real v = frexp(x, eptr);
assert(isIdentical(e, v));
assert(exp == eptr);
}
static if (real.mant_dig == 64) {
static real extendedvals[][3] = [ // x,frexp,exp
[0x1.a5f1c2eb3fe4efp+73L, 0x1.A5F1C2EB3FE4EFp-1L, 74], // normal
[0x1.fa01712e8f0471ap-1064L, 0x1.fa01712e8f0471ap-1L, -1063],
[real.min_normal, .5, -16381],
[real.min_normal/2.0L, .5, -16382] // subnormal
];
for (i = 0; i < extendedvals.length; i++) {
real x = extendedvals[i][0];
real e = extendedvals[i][1];
int exp = cast(int)extendedvals[i][2];
int eptr;
real v = frexp(x, eptr);
assert(isIdentical(e, v));
assert(exp == eptr);
}
}
}
unittest
{
int exp;
real mantissa = frexp(123.456, exp);
assert(equalsDigit(mantissa * pow(2.0L, cast(real)exp), 123.456, 19));
assert(frexp(-real.nan, exp) && exp == int.min);
assert(frexp(real.nan, exp) && exp == int.min);
assert(frexp(-real.infinity, exp) == -real.infinity && exp == int.min);
assert(frexp(real.infinity, exp) == real.infinity && exp == int.max);
assert(frexp(-0.0, exp) == -0.0 && exp == 0);
assert(frexp(0.0, exp) == 0.0 && exp == 0);
}
/******************************************
* Extracts the exponent of x as a signed integral value.
*
* If x is not a special value, the result is the same as
* $(D cast(int)logb(x)).
*
* $(TABLE_SV
* $(TR $(TH x) $(TH ilogb(x)) $(TH Range error?))
* $(TR $(TD 0) $(TD FP_ILOGB0) $(TD yes))
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD int.max) $(TD no))
* $(TR $(TD $(NAN)) $(TD FP_ILOGBNAN) $(TD no))
* )
*/
int ilogb(real x) @trusted nothrow
{
version (Win64)
{
asm
{
naked ;
fld real ptr [RCX] ;
fxam ;
fstsw AX ;
and AH,0x45 ;
cmp AH,0x40 ;
jz Lzeronan ;
cmp AH,5 ;
jz Linfinity ;
cmp AH,1 ;
jz Lzeronan ;
fxtract ;
fstp ST(0) ;
fistp dword ptr 8[RSP] ;
mov EAX,8[RSP] ;
ret ;
Lzeronan:
mov EAX,0x80000000 ;
fstp ST(0) ;
ret ;
Linfinity:
mov EAX,0x7FFFFFFF ;
fstp ST(0) ;
ret ;
}
}
else
return core.stdc.math.ilogbl(x);
}
alias core.stdc.math.FP_ILOGB0 FP_ILOGB0;
alias core.stdc.math.FP_ILOGBNAN FP_ILOGBNAN;
/*******************************************
* Compute n * 2$(SUP exp)
* References: frexp
*/
real ldexp(real n, int exp) @safe pure nothrow; /* intrinsic */
unittest {
assert(ldexp(1, -16384) == 0x1p-16384L);
assert(ldexp(1, -16382) == 0x1p-16382L);
int x;
real n = frexp(0x1p-16384L, x);
assert(n==0.5L);
assert(x==-16383);
assert(ldexp(n, x)==0x1p-16384L);
}
unittest
{
static real vals[][3] = // value,exp,ldexp
[
[ 0, 0, 0],
[ 1, 0, 1],
[ -1, 0, -1],
[ 1, 1, 2],
[ 123, 10, 125952],
[ real.max, int.max, real.infinity],
[ real.max, -int.max, 0],
[ real.min_normal, -int.max, 0],
];
int i;
for (i = 0; i < vals.length; i++)
{
real x = vals[i][0];
int exp = cast(int)vals[i][1];
real z = vals[i][2];
real l = ldexp(x, exp);
assert(equalsDigit(z, l, 7));
}
}
unittest
{
real r;
r = ldexp(3.0L, 3);
assert(r == 24);
r = ldexp(cast(real) 3.0, cast(int) 3);
assert(r == 24);
real n = 3.0;
int exp = 3;
r = ldexp(n, exp);
assert(r == 24);
}
/**************************************
* Calculate the natural logarithm of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH log(x)) $(TH divide by 0?) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD -$(INFIN)) $(TD yes) $(TD no))
* $(TR $(TD $(LT)0.0) $(TD $(NAN)) $(TD no) $(TD yes))
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD no) $(TD no))
* )
*/
real log(real x) @safe pure nothrow
{
version (INLINE_YL2X)
return yl2x(x, LN2);
else
return core.stdc.math.logl(x);
}
unittest
{
assert(log(E) == 1);
}
/**************************************
* Calculate the base-10 logarithm of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH log10(x)) $(TH divide by 0?) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD -$(INFIN)) $(TD yes) $(TD no))
* $(TR $(TD $(LT)0.0) $(TD $(NAN)) $(TD no) $(TD yes))
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD no) $(TD no))
* )
*/
real log10(real x) @safe pure nothrow
{
version (INLINE_YL2X)
return yl2x(x, LOG2);
else
return core.stdc.math.log10l(x);
}
unittest
{
//printf("%Lg\n", log10(1000) - 3);
assert(fabs(log10(1000) - 3) < .000001);
}
/******************************************
* Calculates the natural logarithm of 1 + x.
*
* For very small x, log1p(x) will be more accurate than
* log(1 + x).
*
* $(TABLE_SV
* $(TR $(TH x) $(TH log1p(x)) $(TH divide by 0?) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no) $(TD no))
* $(TR $(TD -1.0) $(TD -$(INFIN)) $(TD yes) $(TD no))
* $(TR $(TD $(LT)-1.0) $(TD $(NAN)) $(TD no) $(TD yes))
* $(TR $(TD +$(INFIN)) $(TD -$(INFIN)) $(TD no) $(TD no))
* )
*/
real log1p(real x) @safe pure nothrow
{
version(INLINE_YL2X)
{
// On x87, yl2xp1 is valid if and only if -0.5 <= lg(x) <= 0.5,
// ie if -0.29<=x<=0.414
return (fabs(x) <= 0.25) ? yl2xp1(x, LN2) : yl2x(x+1, LN2);
}
else
{
return core.stdc.math.log1pl(x);
}
}
/***************************************
* Calculates the base-2 logarithm of x:
* $(SUB log, 2)x
*
* $(TABLE_SV
* $(TR $(TH x) $(TH log2(x)) $(TH divide by 0?) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD -$(INFIN)) $(TD yes) $(TD no) )
* $(TR $(TD $(LT)0.0) $(TD $(NAN)) $(TD no) $(TD yes) )
* $(TR $(TD +$(INFIN)) $(TD +$(INFIN)) $(TD no) $(TD no) )
* )
*/
real log2(real x) @safe pure nothrow
{
version (INLINE_YL2X)
return yl2x(x, 1);
else
return core.stdc.math.log2l(x);
}
unittest
{
assert(equalsDigit(log2(1024), 10, 19));
}
/*****************************************
* Extracts the exponent of x as a signed integral value.
*
* If x is subnormal, it is treated as if it were normalized.
* For a positive, finite x:
*
* 1 $(LT)= $(I x) * FLT_RADIX$(SUP -logb(x)) $(LT) FLT_RADIX
*
* $(TABLE_SV
* $(TR $(TH x) $(TH logb(x)) $(TH divide by 0?) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD +$(INFIN)) $(TD no))
* $(TR $(TD $(PLUSMN)0.0) $(TD -$(INFIN)) $(TD yes) )
* )
*/
real logb(real x) @trusted nothrow
{
version (Win64)
{
asm
{
naked ;
fld real ptr [RCX] ;
fxtract ;
fstp ST(0) ;
ret ;
}
}
else
return core.stdc.math.logbl(x);
}
/************************************
* Calculates the remainder from the calculation x/y.
* Returns:
* The value of x - i * y, where i is the number of times that y can
* be completely subtracted from x. The result has the same sign as x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH y) $(TH fmod(x, y)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD not 0.0) $(TD $(PLUSMN)0.0) $(TD no))
* $(TR $(TD $(PLUSMNINF)) $(TD anything) $(TD $(NAN)) $(TD yes))
* $(TR $(TD anything) $(TD $(PLUSMN)0.0) $(TD $(NAN)) $(TD yes))
* $(TR $(TD !=$(PLUSMNINF)) $(TD $(PLUSMNINF)) $(TD x) $(TD no))
* )
*/
real fmod(real x, real y) @trusted nothrow
{
version (Win64)
{
return x % y;
}
else
return core.stdc.math.fmodl(x, y);
}
/************************************
* Breaks x into an integral part and a fractional part, each of which has
* the same sign as x. The integral part is stored in i.
* Returns:
* The fractional part of x.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH i (on input)) $(TH modf(x, i)) $(TH i (on return)))
* $(TR $(TD $(PLUSMNINF)) $(TD anything) $(TD $(PLUSMN)0.0) $(TD $(PLUSMNINF)))
* )
*/
real modf(real x, ref real i) @trusted nothrow
{
version (Win64)
{
i = trunc(x);
return copysign(isInfinity(x) ? 0.0 : x - i, x);
}
else
return core.stdc.math.modfl(x,&i);
}
/*************************************
* Efficiently calculates x * 2$(SUP n).
*
* scalbn handles underflow and overflow in
* the same fashion as the basic arithmetic operators.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH scalb(x)))
* $(TR $(TD $(PLUSMNINF)) $(TD $(PLUSMNINF)) )
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) )
* )
*/
real scalbn(real x, int n) @trusted nothrow
{
version(InlineAsm_X86_Any) {
// scalbnl is not supported on DMD-Windows, so use asm.
version (Win64)
{
asm {
naked ;
mov 16[RSP],RCX ;
fild word ptr 16[RSP] ;
fld real ptr [RDX] ;
fscale ;
fstp ST(1) ;
ret ;
}
}
else
{
asm {
fild n;
fld x;
fscale;
fstp ST(1);
}
}
} else {
return core.stdc.math.scalbnl(x, n);
}
}
unittest {
assert(scalbn(-real.infinity, 5) == -real.infinity);
}
/***************
* Calculates the cube root of x.
*
* $(TABLE_SV
* $(TR $(TH $(I x)) $(TH cbrt(x)) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD $(PLUSMN)0.0) $(TD no) )
* $(TR $(TD $(NAN)) $(TD $(NAN)) $(TD yes) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD $(PLUSMN)$(INFIN)) $(TD no) )
* )
*/
real cbrt(real x) @trusted nothrow
{
version (Win64)
{
return copysign(exp2(yl2x(fabs(x), 1.0L/3.0L)), x);
}
else
return core.stdc.math.cbrtl(x);
}
/*******************************
* Returns |x|
*
* $(TABLE_SV
* $(TR $(TH x) $(TH fabs(x)))
* $(TR $(TD $(PLUSMN)0.0) $(TD +0.0) )
* $(TR $(TD $(PLUSMN)$(INFIN)) $(TD +$(INFIN)) )
* )
*/
real fabs(real x) @safe pure nothrow; /* intrinsic */
/***********************************************************************
* Calculates the length of the
* hypotenuse of a right-angled triangle with sides of length x and y.
* The hypotenuse is the value of the square root of
* the sums of the squares of x and y:
*
* sqrt($(POWER x, 2) + $(POWER y, 2))
*
* Note that hypot(x, y), hypot(y, x) and
* hypot(x, -y) are equivalent.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH y) $(TH hypot(x, y)) $(TH invalid?))
* $(TR $(TD x) $(TD $(PLUSMN)0.0) $(TD |x|) $(TD no))
* $(TR $(TD $(PLUSMNINF)) $(TD y) $(TD +$(INFIN)) $(TD no))
* $(TR $(TD $(PLUSMNINF)) $(TD $(NAN)) $(TD +$(INFIN)) $(TD no))
* )
*/
real hypot(real x, real y) @safe pure nothrow
{
// Scale x and y to avoid underflow and overflow.
// If one is huge and the other tiny, return the larger.
// If both are huge, avoid overflow by scaling by 1/sqrt(real.max/2).
// If both are tiny, avoid underflow by scaling by sqrt(real.min_normal*real.epsilon).
enum real SQRTMIN = 0.5*sqrt(real.min_normal); // This is a power of 2.
enum real SQRTMAX = 1.0L/SQRTMIN; // 2^^((max_exp)/2) = nextUp(sqrt(real.max))
static assert(2*(SQRTMAX/2)*(SQRTMAX/2) <= real.max);
static assert(real.min_normal*real.max>2 && real.min_normal*real.max<=4); // Proves that sqrt(real.max) ~~ 0.5/sqrt(real.min_normal)
real u = fabs(x);
real v = fabs(y);
if (u !>= v) // check for NaN as well.
{
v = u;
u = fabs(y);
if (u == real.infinity) return u; // hypot(inf, nan) == inf
if (v == real.infinity) return v; // hypot(nan, inf) == inf
}
// Now u >= v, or else one is NaN.
if (v >= SQRTMAX*0.5)
{
// hypot(huge, huge) -- avoid overflow
u *= SQRTMIN*0.5;
v *= SQRTMIN*0.5;
return sqrt(u*u + v*v) * SQRTMAX * 2.0;
}
if (u <= SQRTMIN)
{
// hypot (tiny, tiny) -- avoid underflow
// This is only necessary to avoid setting the underflow
// flag.
u *= SQRTMAX / real.epsilon;
v *= SQRTMAX / real.epsilon;
return sqrt(u*u + v*v) * SQRTMIN * real.epsilon;
}
if (u * real.epsilon > v)
{
// hypot (huge, tiny) = huge
return u;
}
// both are in the normal range
return sqrt(u*u + v*v);
}
unittest
{
static real vals[][3] = // x,y,hypot
[
[ 0.0, 0.0, 0.0],
[ 0.0, -0.0, 0.0],
[ -0.0, -0.0, 0.0],
[ 3.0, 4.0, 5.0],
[ -300, -400, 500],
[0.0, 7.0, 7.0],
[9.0, 9*real.epsilon, 9.0],
[88/(64*sqrt(real.min_normal)), 105/(64*sqrt(real.min_normal)), 137/(64*sqrt(real.min_normal))],
[88/(128*sqrt(real.min_normal)), 105/(128*sqrt(real.min_normal)), 137/(128*sqrt(real.min_normal))],
[3*real.min_normal*real.epsilon, 4*real.min_normal*real.epsilon, 5*real.min_normal*real.epsilon],
[ real.min_normal, real.min_normal, sqrt(2.0L)*real.min_normal],
[ real.max/sqrt(2.0L), real.max/sqrt(2.0L), real.max],
[ real.infinity, real.nan, real.infinity],
[ real.nan, real.infinity, real.infinity],
[ real.nan, real.nan, real.nan],
[ real.nan, real.max, real.nan],
[ real.max, real.nan, real.nan],
];
for (int i = 0; i < vals.length; i++)
{
real x = vals[i][0];
real y = vals[i][1];
real z = vals[i][2];
real h = hypot(x, y);
assert(isIdentical(z, h));
}
}
/**************************************
* Returns the value of x rounded upward to the next integer
* (toward positive infinity).
*/
real ceil(real x) @trusted nothrow
{
version (Win64)
{
asm
{
naked ;
fld real ptr [RCX] ;
fstcw 8[RSP] ;
mov AL,9[RSP] ;
mov DL,AL ;
and AL,0xC3 ;
or AL,0x08 ; // round to +infinity
mov 9[RSP],AL ;
fldcw 8[RSP] ;
frndint ;
mov 9[RSP],DL ;
fldcw 8[RSP] ;
ret ;
}
}
else
return core.stdc.math.ceill(x);
}
unittest
{
assert(ceil(+123.456) == +124);
assert(ceil(-123.456) == -123);
}
/**************************************
* Returns the value of x rounded downward to the next integer
* (toward negative infinity).
*/
real floor(real x) @trusted nothrow
{
version (Win64)
{
asm
{
naked ;
fld real ptr [RCX] ;
fstcw 8[RSP] ;
mov AL,9[RSP] ;
mov DL,AL ;
and AL,0xC3 ;
or AL,0x04 ; // round to -infinity
mov 9[RSP],AL ;
fldcw 8[RSP] ;
frndint ;
mov 9[RSP],DL ;
fldcw 8[RSP] ;
ret ;
}
}
else
return core.stdc.math.floorl(x);
}
unittest
{
assert(floor(+123.456) == +123);
assert(floor(-123.456) == -124);
}
/******************************************
* Rounds x to the nearest integer value, using the current rounding
* mode.
*
* Unlike the rint functions, nearbyint does not raise the
* FE_INEXACT exception.
*/
real nearbyint(real x) @trusted nothrow
{
version (Win64)
{
assert(0); // not implemented in C library
}
else
return core.stdc.math.nearbyintl(x);
}
/**********************************
* Rounds x to the nearest integer value, using the current rounding
* mode.
* If the return value is not equal to x, the FE_INEXACT
* exception is raised.
* $(B nearbyint) performs
* the same operation, but does not set the FE_INEXACT exception.
*/
real rint(real x) @safe pure nothrow; /* intrinsic */
/***************************************
* Rounds x to the nearest integer value, using the current rounding
* mode.
*
* This is generally the fastest method to convert a floating-point number
* to an integer. Note that the results from this function
* depend on the rounding mode, if the fractional part of x is exactly 0.5.
* If using the default rounding mode (ties round to even integers)
* lrint(4.5) == 4, lrint(5.5)==6.
*/
long lrint(real x) @trusted pure nothrow
{
version(InlineAsm_X86_Any)
{
version (Win64)
{
asm
{
naked;
fld real ptr [RCX];
fistp 8[RSP];
mov RAX,8[RSP];
ret;
}
}
else
{
long n;
asm
{
fld x;
fistp n;
}
return n;
}
} else {
return core.stdc.math.llrintl(x);
}
}
/*******************************************
* Return the value of x rounded to the nearest integer.
* If the fractional part of x is exactly 0.5, the return value is rounded to
* the even integer.
*/
real round(real x) @trusted nothrow
{
version (Win64)
{
auto old = FloatingPointControl.getControlState();
FloatingPointControl.setControlState((old & ~FloatingPointControl.ROUNDING_MASK) | FloatingPointControl.roundToZero);
x = rint((x >= 0) ? x + 0.5 : x - 0.5);
FloatingPointControl.setControlState(old);
return x;
}
else
return core.stdc.math.roundl(x);
}
/**********************************************
* Return the value of x rounded to the nearest integer.
*
* If the fractional part of x is exactly 0.5, the return value is rounded
* away from zero.
*/
long lround(real x) @trusted nothrow
{
version (Posix)
return core.stdc.math.llroundl(x);
else
assert (0, "lround not implemented");
}
version(Posix)
{
unittest
{
assert(lround(0.49) == 0);
assert(lround(0.5) == 1);
assert(lround(1.5) == 2);
}
}
/****************************************************
* Returns the integer portion of x, dropping the fractional portion.
*
* This is also known as "chop" rounding.
*/
real trunc(real x) @trusted nothrow
{
version (Win64)
{
asm
{
naked ;
fld real ptr [RCX] ;
fstcw 8[RSP] ;
mov AL,9[RSP] ;
mov DL,AL ;
and AL,0xC3 ;
or AL,0x0C ; // round to 0
mov 9[RSP],AL ;
fldcw 8[RSP] ;
frndint ;
mov 9[RSP],DL ;
fldcw 8[RSP] ;
ret ;
}
}
else
return core.stdc.math.truncl(x);
}
/****************************************************
* Calculate the remainder x REM y, following IEC 60559.
*
* REM is the value of x - y * n, where n is the integer nearest the exact
* value of x / y.
* If |n - x / y| == 0.5, n is even.
* If the result is zero, it has the same sign as x.
* Otherwise, the sign of the result is the sign of x / y.
* Precision mode has no effect on the remainder functions.
*
* remquo returns n in the parameter n.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH y) $(TH remainder(x, y)) $(TH n) $(TH invalid?))
* $(TR $(TD $(PLUSMN)0.0) $(TD not 0.0) $(TD $(PLUSMN)0.0) $(TD 0.0) $(TD no))
* $(TR $(TD $(PLUSMNINF)) $(TD anything) $(TD $(NAN)) $(TD ?) $(TD yes))
* $(TR $(TD anything) $(TD $(PLUSMN)0.0) $(TD $(NAN)) $(TD ?) $(TD yes))
* $(TR $(TD != $(PLUSMNINF)) $(TD $(PLUSMNINF)) $(TD x) $(TD ?) $(TD no))
* )
*
* Note: remquo not supported on windows
*/
real remainder(real x, real y) @trusted nothrow
{
version (Win64)
{
int n;
return remquo(x, y, n);
}
else
return core.stdc.math.remainderl(x, y);
}
real remquo(real x, real y, out int n) @trusted nothrow /// ditto
{
version (Posix)
return core.stdc.math.remquol(x, y, &n);
else
assert (0, "remquo not implemented");
}
/** IEEE exception status flags ('sticky bits')
These flags indicate that an exceptional floating-point condition has occurred.
They indicate that a NaN or an infinity has been generated, that a result
is inexact, or that a signalling NaN has been encountered. If floating-point
exceptions are enabled (unmasked), a hardware exception will be generated
instead of setting these flags.
Example:
----
real a=3.5;
// Set all the flags to zero
resetIeeeFlags();
assert(!ieeeFlags.divByZero);
// Perform a division by zero.
a/=0.0L;
assert(a==real.infinity);
assert(ieeeFlags.divByZero);
// Create a NaN
a*=0.0L;
assert(ieeeFlags.invalid);
assert(isNaN(a));
// Check that calling func() has no effect on the
// status flags.
IeeeFlags f = ieeeFlags;
func();
assert(ieeeFlags == f);
----
*/
struct IeeeFlags
{
private:
// The x87 FPU status register is 16 bits.
// The Pentium SSE2 status register is 32 bits.
uint flags;
version (X86_Any) {
// Applies to both x87 status word (16 bits) and SSE2 status word(32 bits).
enum : int {
INEXACT_MASK = 0x20,
UNDERFLOW_MASK = 0x10,
OVERFLOW_MASK = 0x08,
DIVBYZERO_MASK = 0x04,
INVALID_MASK = 0x01
}
// Don't bother about subnormals, they are not supported on most CPUs.
// SUBNORMAL_MASK = 0x02;
} else version (PPC) {
// PowerPC FPSCR is a 32-bit register.
enum : int {
INEXACT_MASK = 0x600,
UNDERFLOW_MASK = 0x010,
OVERFLOW_MASK = 0x008,
DIVBYZERO_MASK = 0x020,
INVALID_MASK = 0xF80 // PowerPC has five types of invalid exceptions.
}
} else version (ARM) {
// TODO: Fill this in for VFP.
} else version(SPARC) { // SPARC FSR is a 32bit register
//(64 bits for Sparc 7 & 8, but high 32 bits are uninteresting).
enum : int {
INEXACT_MASK = 0x020,
UNDERFLOW_MASK = 0x080,
OVERFLOW_MASK = 0x100,
DIVBYZERO_MASK = 0x040,
INVALID_MASK = 0x200
}
} else
static assert(0, "Not implemented");
private:
static uint getIeeeFlags()
{
version(D_InlineAsm_X86) {
asm {
fstsw AX;
// NOTE: If compiler supports SSE2, need to OR the result with
// the SSE2 status register.
// Clear all irrelevant bits
and EAX, 0x03D;
}
} else version(D_InlineAsm_X86_64) {
asm {
fstsw AX;
// NOTE: If compiler supports SSE2, need to OR the result with
// the SSE2 status register.
// Clear all irrelevant bits
and RAX, 0x03D;
}
} else version (SPARC) {
/*
int retval;
asm { st %fsr, retval; }
return retval;
*/
assert(0, "Not yet supported");
} else version (ARM) {
assert(false, "Not yet supported.");
} else
assert(0, "Not yet supported");
}
static void resetIeeeFlags()
{
version(InlineAsm_X86_Any) {
asm {
fnclex;
}
} else {
/* SPARC:
int tmpval;
asm { st %fsr, tmpval; }
tmpval &=0xFFFF_FC00;
asm { ld tmpval, %fsr; }
*/
assert(0, "Not yet supported");
}
}
public:
version (X86_Any) { // TODO: Lift this version condition when we support !x86.
/// The result cannot be represented exactly, so rounding occured.
/// (example: x = sin(0.1); )
@property bool inexact() { return (flags & INEXACT_MASK) != 0; }
/// A zero was generated by underflow (example: x = real.min*real.epsilon/2;)
@property bool underflow() { return (flags & UNDERFLOW_MASK) != 0; }
/// An infinity was generated by overflow (example: x = real.max*2;)
@property bool overflow() { return (flags & OVERFLOW_MASK) != 0; }
/// An infinity was generated by division by zero (example: x = 3/0.0; )
@property bool divByZero() { return (flags & DIVBYZERO_MASK) != 0; }
/// A machine NaN was generated. (example: x = real.infinity * 0.0; )
@property bool invalid() { return (flags & INVALID_MASK) != 0; }
}
}
/// Set all of the floating-point status flags to false.
void resetIeeeFlags() { IeeeFlags.resetIeeeFlags(); }
/// Return a snapshot of the current state of the floating-point status flags.
@property IeeeFlags ieeeFlags()
{
return IeeeFlags(IeeeFlags.getIeeeFlags());
}
/** Control the Floating point hardware
Change the IEEE754 floating-point rounding mode and the floating-point
hardware exceptions.
By default, the rounding mode is roundToNearest and all hardware exceptions
are disabled. For most applications, debugging is easier if the $(I division
by zero), $(I overflow), and $(I invalid operation) exceptions are enabled.
These three are combined into a $(I severeExceptions) value for convenience.
Note in particular that if $(I invalidException) is enabled, a hardware trap
will be generated whenever an uninitialized floating-point variable is used.
All changes are temporary. The previous state is restored at the
end of the scope.
Example:
----
{
// Enable hardware exceptions for division by zero, overflow to infinity,
// invalid operations, and uninitialized floating-point variables.
FloatingPointControl fpctrl;
fpctrl.enableExceptions(FloatingPointControl.severeExceptions);
double y = x*3.0; // will generate a hardware exception, if x is uninitialized.
//
fpctrl.rounding = FloatingPointControl.roundUp;
// The hardware exceptions will be disabled when leaving this scope.
// The original rounding mode will also be restored.
}
----
*/
struct FloatingPointControl
{
alias uint RoundingMode;
/** IEEE rounding modes.
* The default mode is roundToNearest.
*/
enum : RoundingMode
{
roundToNearest = 0x0000,
roundDown = 0x0400,
roundUp = 0x0800,
roundToZero = 0x0C00
};
/** IEEE hardware exceptions.
* By default, all exceptions are masked (disabled).
*/
enum : uint
{
inexactException = 0x20,
underflowException = 0x10,
overflowException = 0x08,
divByZeroException = 0x04,
subnormalException = 0x02,
invalidException = 0x01,
/// Severe = The overflow, division by zero, and invalid exceptions.
severeExceptions = overflowException | divByZeroException
| invalidException,
allExceptions = severeExceptions | underflowException
| inexactException | subnormalException,
};
private:
enum ushort EXCEPTION_MASK = 0x3F;
enum ushort ROUNDING_MASK = 0xC00;
public:
/// Enable (unmask) specific hardware exceptions. Multiple exceptions may be ORed together.
void enableExceptions(uint exceptions)
{
initialize();
setControlState(getControlState() & ~(exceptions & EXCEPTION_MASK));
}
/// Disable (mask) specific hardware exceptions. Multiple exceptions may be ORed together.
void disableExceptions(uint exceptions)
{
initialize();
setControlState(getControlState() | (exceptions & EXCEPTION_MASK));
}
//// Change the floating-point hardware rounding mode
@property void rounding(RoundingMode newMode)
{
ushort old = getControlState();
setControlState((old & ~ROUNDING_MASK) | (newMode & ROUNDING_MASK));
}
/// Return the exceptions which are currently enabled (unmasked)
@property static uint enabledExceptions()
{
return (getControlState() & EXCEPTION_MASK) ^ EXCEPTION_MASK;
}
/// Return the currently active rounding mode
@property static RoundingMode rounding()
{
return cast(RoundingMode)(getControlState() & ROUNDING_MASK);
}
/// Clear all pending exceptions, then restore the original exception state and rounding mode.
~this()
{
clearExceptions();
setControlState(savedState);
}
private:
ushort savedState;
bool initialized=false;
void initialize()
{
// BUG: This works around the absence of this() constructors.
if (initialized) return;
clearExceptions();
savedState = getControlState();
initialized=true;
}
// Clear all pending exceptions
static void clearExceptions()
{
version (InlineAsm_X86_Any)
{
asm
{
fclex;
}
}
else
assert(0, "Not yet supported");
}
// Read from the control register
static ushort getControlState() @trusted nothrow
{
version (D_InlineAsm_X86)
{
short cont;
asm
{
xor EAX, EAX;
fstcw cont;
}
return cont;
}
else
version (D_InlineAsm_X86_64)
{
short cont;
asm
{
xor RAX, RAX;
fstcw cont;
}
return cont;
}
else
assert(0, "Not yet supported");
}
// Set the control register
static void setControlState(ushort newState) @trusted nothrow
{
version (InlineAsm_X86_Any)
{
version (Win64)
{
asm
{
naked;
mov 8[RSP],RCX;
fclex;
fldcw 8[RSP];
ret;
}
}
else
{
asm
{
fclex;
fldcw newState;
}
}
}
else
assert(0, "Not yet supported");
}
}
unittest
{
{
FloatingPointControl ctrl;
ctrl.enableExceptions(FloatingPointControl.divByZeroException
| FloatingPointControl.overflowException);
assert(ctrl.enabledExceptions ==
(FloatingPointControl.divByZeroException
| FloatingPointControl.overflowException));
ctrl.rounding = FloatingPointControl.roundUp;
assert(FloatingPointControl.rounding == FloatingPointControl.roundUp);
}
assert(FloatingPointControl.rounding
== FloatingPointControl.roundToNearest);
assert(FloatingPointControl.enabledExceptions ==0);
}
/*********************************
* Returns !=0 if e is a NaN.
*/
bool isNaN(real x) @trusted pure nothrow
{
alias floatTraits!(real) F;
static if (real.mant_dig==53) { // double
ulong* p = cast(ulong *)&x;
return ((*p & 0x7FF0_0000_0000_0000) == 0x7FF0_0000_0000_0000)
&& *p & 0x000F_FFFF_FFFF_FFFF;
} else static if (real.mant_dig==64) { // real80
ushort e = F.EXPMASK & (cast(ushort *)&x)[F.EXPPOS_SHORT];
ulong* ps = cast(ulong *)&x;
return e == F.EXPMASK &&
*ps & 0x7FFF_FFFF_FFFF_FFFF; // not infinity
} else static if (real.mant_dig==113) { // quadruple
ushort e = F.EXPMASK & (cast(ushort *)&x)[F.EXPPOS_SHORT];
ulong* ps = cast(ulong *)&x;
return e == F.EXPMASK &&
(ps[MANTISSA_LSB] | (ps[MANTISSA_MSB]& 0x0000_FFFF_FFFF_FFFF))!=0;
} else {
return x!=x;
}
}
unittest
{
assert(isNaN(float.nan));
assert(isNaN(-double.nan));
assert(isNaN(real.nan));
assert(!isNaN(53.6));
assert(!isNaN(float.infinity));
}
/*********************************
* Returns !=0 if e is finite (not infinite or $(NAN)).
*/
int isFinite(real e) @trusted pure nothrow
{
alias floatTraits!(real) F;
ushort* pe = cast(ushort *)&e;
return (pe[F.EXPPOS_SHORT] & F.EXPMASK) != F.EXPMASK;
}
unittest
{
assert(isFinite(1.23));
assert(!isFinite(double.infinity));
assert(!isFinite(float.nan));
}
/*********************************
* Returns !=0 if x is normalized (not zero, subnormal, infinite, or $(NAN)).
*/
/* Need one for each format because subnormal floats might
* be converted to normal reals.
*/
int isNormal(X)(X x) @trusted pure nothrow
{
alias floatTraits!(X) F;
static if(real.mant_dig==106) { // doubledouble
// doubledouble is normal if the least significant part is normal.
return isNormal((cast(double*)&x)[MANTISSA_LSB]);
} else {
ushort e = F.EXPMASK & (cast(ushort *)&x)[F.EXPPOS_SHORT];
return (e != F.EXPMASK && e!=0);
}
}
unittest
{
float f = 3;
double d = 500;
real e = 10e+48;
assert(isNormal(f));
assert(isNormal(d));
assert(isNormal(e));
f = d = e = 0;
assert(!isNormal(f));
assert(!isNormal(d));
assert(!isNormal(e));
assert(!isNormal(real.infinity));
assert(isNormal(-real.max));
assert(!isNormal(real.min_normal/4));
}
/*********************************
* Is number subnormal? (Also called "denormal".)
* Subnormals have a 0 exponent and a 0 most significant mantissa bit.
*/
/* Need one for each format because subnormal floats might
* be converted to normal reals.
*/
int isSubnormal(float f) @trusted pure nothrow
{
uint *p = cast(uint *)&f;
return (*p & 0x7F80_0000) == 0 && *p & 0x007F_FFFF;
}
unittest
{
float f = 3.0;
for (f = 1.0; !isSubnormal(f); f /= 2)
assert(f != 0);
}
/// ditto
int isSubnormal(double d) @trusted pure nothrow
{
uint *p = cast(uint *)&d;
return (p[MANTISSA_MSB] & 0x7FF0_0000) == 0
&& (p[MANTISSA_LSB] || p[MANTISSA_MSB] & 0x000F_FFFF);
}
unittest
{
double f;
for (f = 1; !isSubnormal(f); f /= 2)
assert(f != 0);
}
/// ditto
int isSubnormal(real x) @trusted pure nothrow
{
alias floatTraits!(real) F;
static if (real.mant_dig == 53) { // double
return isSubnormal(cast(double)x);
} else static if (real.mant_dig == 113) { // quadruple
ushort e = F.EXPMASK & (cast(ushort *)&x)[F.EXPPOS_SHORT];
long* ps = cast(long *)&x;
return (e == 0 &&
(((ps[MANTISSA_LSB]|(ps[MANTISSA_MSB]& 0x0000_FFFF_FFFF_FFFF))) !=0));
} else static if (real.mant_dig==64) { // real80
ushort* pe = cast(ushort *)&x;
long* ps = cast(long *)&x;
return (pe[F.EXPPOS_SHORT] & F.EXPMASK) == 0 && *ps > 0;
} else { // double double
return isSubnormal((cast(double*)&x)[MANTISSA_MSB]);
}
}
unittest
{
real f;
for (f = 1; !isSubnormal(f); f /= 2)
assert(f != 0);
}
/*********************************
* Return !=0 if e is $(PLUSMN)$(INFIN).
*/
bool isInfinity(real x) @trusted pure nothrow
{
alias floatTraits!(real) F;
static if (real.mant_dig == 53) { // double
return ((*cast(ulong *)&x) & 0x7FFF_FFFF_FFFF_FFFF)
== 0x7FF8_0000_0000_0000;
} else static if(real.mant_dig == 106) { //doubledouble
return (((cast(ulong *)&x)[MANTISSA_MSB]) & 0x7FFF_FFFF_FFFF_FFFF)
== 0x7FF8_0000_0000_0000;
} else static if (real.mant_dig == 113) { // quadruple
long* ps = cast(long *)&x;
return (ps[MANTISSA_LSB] == 0)
&& (ps[MANTISSA_MSB] & 0x7FFF_FFFF_FFFF_FFFF) == 0x7FFF_0000_0000_0000;
} else { // real80
ushort e = cast(ushort)(F.EXPMASK & (cast(ushort *)&x)[F.EXPPOS_SHORT]);
ulong* ps = cast(ulong *)&x;
// On Motorola 68K, infinity can have hidden bit=1 or 0. On x86, it is always 1.
return e == F.EXPMASK && (*ps & 0x7FFF_FFFF_FFFF_FFFF) == 0;
}
}
unittest
{
assert(isInfinity(float.infinity));
assert(!isInfinity(float.nan));
assert(isInfinity(double.infinity));
assert(isInfinity(-real.infinity));
assert(isInfinity(-1.0 / 0.0));
}
/*********************************
* Is the binary representation of x identical to y?
*
* Same as ==, except that positive and negative zero are not identical,
* and two $(NAN)s are identical if they have the same 'payload'.
*/
bool isIdentical(real x, real y) @trusted pure nothrow
{
// We're doing a bitwise comparison so the endianness is irrelevant.
long* pxs = cast(long *)&x;
long* pys = cast(long *)&y;
static if (real.mant_dig == 53)
{ //double
return pxs[0] == pys[0];
}
else static if (real.mant_dig == 113 || real.mant_dig==106)
{
// quadruple or doubledouble
return pxs[0] == pys[0] && pxs[1] == pys[1];
}
else
{ // real80
ushort* pxe = cast(ushort *)&x;
ushort* pye = cast(ushort *)&y;
return pxe[4] == pye[4] && pxs[0] == pys[0];
}
}
/*********************************
* Return 1 if sign bit of e is set, 0 if not.
*/
int signbit(real x) @trusted pure nothrow
{
return ((cast(ubyte *)&x)[floatTraits!(real).SIGNPOS_BYTE] & 0x80) != 0;
}
unittest
{
debug (math) printf("math.signbit.unittest\n");
assert(!signbit(float.nan));
assert(signbit(-float.nan));
assert(!signbit(168.1234));
assert(signbit(-168.1234));
assert(!signbit(0.0));
assert(signbit(-0.0));
assert(signbit(-double.max));
assert(!signbit(double.max));
}
/*********************************
* Return a value composed of to with from's sign bit.
*/
real copysign(real to, real from) @trusted pure nothrow
{
ubyte* pto = cast(ubyte *)&to;
const ubyte* pfrom = cast(ubyte *)&from;
alias floatTraits!(real) F;
pto[F.SIGNPOS_BYTE] &= 0x7F;
pto[F.SIGNPOS_BYTE] |= pfrom[F.SIGNPOS_BYTE] & 0x80;
return to;
}
unittest
{
real e;
e = copysign(21, 23.8);
assert(e == 21);
e = copysign(-21, 23.8);
assert(e == 21);
e = copysign(21, -23.8);
assert(e == -21);
e = copysign(-21, -23.8);
assert(e == -21);
e = copysign(real.nan, -23.8);
assert(isNaN(e) && signbit(e));
}
/*********************************
Returns $(D -1) if $(D x < 0), $(D x) if $(D x == 0), $(D 1) if
$(D x > 0), and $(NAN) if x==$(NAN).
*/
F sgn(F)(F x) @safe pure nothrow
{
// @@@TODO@@@: make this faster
return x > 0 ? 1 : x < 0 ? -1 : x;
}
unittest
{
debug (math) printf("math.sgn.unittest\n");
assert(sgn(168.1234) == 1);
assert(sgn(-168.1234) == -1);
assert(sgn(0.0) == 0);
assert(sgn(-0.0) == 0);
}
// Functions for NaN payloads
/*
* A 'payload' can be stored in the significand of a $(NAN). One bit is required
* to distinguish between a quiet and a signalling $(NAN). This leaves 22 bits
* of payload for a float; 51 bits for a double; 62 bits for an 80-bit real;
* and 111 bits for a 128-bit quad.
*/
/**
* Create a quiet $(NAN), storing an integer inside the payload.
*
* For floats, the largest possible payload is 0x3F_FFFF.
* For doubles, it is 0x3_FFFF_FFFF_FFFF.
* For 80-bit or 128-bit reals, it is 0x3FFF_FFFF_FFFF_FFFF.
*/
real NaN(ulong payload) @trusted pure nothrow
{
static if (real.mant_dig == 64) { //real80
ulong v = 3; // implied bit = 1, quiet bit = 1
} else {
ulong v = 2; // no implied bit. quiet bit = 1
}
ulong a = payload;
// 22 Float bits
ulong w = a & 0x3F_FFFF;
a -= w;
v <<=22;
v |= w;
a >>=22;
// 29 Double bits
v <<=29;
w = a & 0xFFF_FFFF;
v |= w;
a -= w;
a >>=29;
static if (real.mant_dig == 53) { // double
v |=0x7FF0_0000_0000_0000;
real x;
* cast(ulong *)(&x) = v;
return x;
} else {
v <<=11;
a &= 0x7FF;
v |= a;
real x = real.nan;
// Extended real bits
static if (real.mant_dig==113) { //quadruple
v<<=1; // there's no implicit bit
version(LittleEndian) {
*cast(ulong*)(6+cast(ubyte*)(&x)) = v;
} else {
*cast(ulong*)(2+cast(ubyte*)(&x)) = v;
}
} else { // real80
* cast(ulong *)(&x) = v;
}
return x;
}
}
/**
* Extract an integral payload from a $(NAN).
*
* Returns:
* the integer payload as a ulong.
*
* For floats, the largest possible payload is 0x3F_FFFF.
* For doubles, it is 0x3_FFFF_FFFF_FFFF.
* For 80-bit or 128-bit reals, it is 0x3FFF_FFFF_FFFF_FFFF.
*/
ulong getNaNPayload(real x) @trusted pure nothrow
{
// assert(isNaN(x));
static if (real.mant_dig == 53) {
ulong m = *cast(ulong *)(&x);
// Make it look like an 80-bit significand.
// Skip exponent, and quiet bit
m &= 0x0007_FFFF_FFFF_FFFF;
m <<= 10;
} else static if (real.mant_dig==113) { // quadruple
version(LittleEndian) {
ulong m = *cast(ulong*)(6+cast(ubyte*)(&x));
} else {
ulong m = *cast(ulong*)(2+cast(ubyte*)(&x));
}
m>>=1; // there's no implicit bit
} else {
ulong m = *cast(ulong *)(&x);
}
// ignore implicit bit and quiet bit
ulong f = m & 0x3FFF_FF00_0000_0000L;
ulong w = f >>> 40;
w |= (m & 0x00FF_FFFF_F800L) << (22 - 11);
w |= (m & 0x7FF) << 51;
return w;
}
debug(UnitTest) {
unittest {
real nan4 = NaN(0x789_ABCD_EF12_3456);
static if (real.mant_dig == 64 || real.mant_dig==113) {
assert (getNaNPayload(nan4) == 0x789_ABCD_EF12_3456);
} else {
assert (getNaNPayload(nan4) == 0x1_ABCD_EF12_3456);
}
double nan5 = nan4;
assert (getNaNPayload(nan5) == 0x1_ABCD_EF12_3456);
float nan6 = nan4;
assert (getNaNPayload(nan6) == 0x12_3456);
nan4 = NaN(0xFABCD);
assert (getNaNPayload(nan4) == 0xFABCD);
nan6 = nan4;
assert (getNaNPayload(nan6) == 0xFABCD);
nan5 = NaN(0x100_0000_0000_3456);
assert(getNaNPayload(nan5) == 0x0000_0000_3456);
}
}
/**
* Calculate the next largest floating point value after x.
*
* Return the least number greater than x that is representable as a real;
* thus, it gives the next point on the IEEE number line.
*
* $(TABLE_SV
* $(SVH x, nextUp(x) )
* $(SV -$(INFIN), -real.max )
* $(SV $(PLUSMN)0.0, real.min_normal*real.epsilon )
* $(SV real.max, $(INFIN) )
* $(SV $(INFIN), $(INFIN) )
* $(SV $(NAN), $(NAN) )
* )
*/
real nextUp(real x) @trusted pure nothrow
{
alias floatTraits!(real) F;
static if (real.mant_dig == 53) { // double
return nextUp(cast(double)x);
} else static if(real.mant_dig==113) { // quadruple
ushort e = F.EXPMASK & (cast(ushort *)&x)[F.EXPPOS_SHORT];
if (e == F.EXPMASK) { // NaN or Infinity
if (x == -real.infinity) return -real.max;
return x; // +Inf and NaN are unchanged.
}
ulong* ps = cast(ulong *)&e;
if (ps[MANTISSA_LSB] & 0x8000_0000_0000_0000) { // Negative number
if (ps[MANTISSA_LSB] == 0
&& ps[MANTISSA_MSB] == 0x8000_0000_0000_0000) {
// it was negative zero, change to smallest subnormal
ps[MANTISSA_LSB] = 0x0000_0000_0000_0001;
ps[MANTISSA_MSB] = 0;
return x;
}
--*ps;
if (ps[MANTISSA_LSB]==0) --ps[MANTISSA_MSB];
} else { // Positive number
++ps[MANTISSA_LSB];
if (ps[MANTISSA_LSB]==0) ++ps[MANTISSA_MSB];
}
return x;
} else static if(real.mant_dig==64){ // real80
// For 80-bit reals, the "implied bit" is a nuisance...
ushort *pe = cast(ushort *)&x;
ulong *ps = cast(ulong *)&x;
if ((pe[F.EXPPOS_SHORT] & F.EXPMASK) == F.EXPMASK) {
// First, deal with NANs and infinity
if (x == -real.infinity) return -real.max;
return x; // +Inf and NaN are unchanged.
}
if (pe[F.EXPPOS_SHORT] & 0x8000) {
// Negative number -- need to decrease the significand
--*ps;
// Need to mask with 0x7FFF... so subnormals are treated correctly.
if ((*ps & 0x7FFF_FFFF_FFFF_FFFF) == 0x7FFF_FFFF_FFFF_FFFF) {
if (pe[F.EXPPOS_SHORT] == 0x8000) { // it was negative zero
*ps = 1;
pe[F.EXPPOS_SHORT] = 0; // smallest subnormal.
return x;
}
--pe[F.EXPPOS_SHORT];
if (pe[F.EXPPOS_SHORT] == 0x8000) {
return x; // it's become a subnormal, implied bit stays low.
}
*ps = 0xFFFF_FFFF_FFFF_FFFF; // set the implied bit
return x;
}
return x;
} else {
// Positive number -- need to increase the significand.
// Works automatically for positive zero.
++*ps;
if ((*ps & 0x7FFF_FFFF_FFFF_FFFF) == 0) {
// change in exponent
++pe[F.EXPPOS_SHORT];
*ps = 0x8000_0000_0000_0000; // set the high bit
}
}
return x;
} // doubledouble is not supported
}
/** ditto */
double nextUp(double x) @trusted pure nothrow
{
ulong *ps = cast(ulong *)&x;
if ((*ps & 0x7FF0_0000_0000_0000) == 0x7FF0_0000_0000_0000) {
// First, deal with NANs and infinity
if (x == -x.infinity) return -x.max;
return x; // +INF and NAN are unchanged.
}
if (*ps & 0x8000_0000_0000_0000) { // Negative number
if (*ps == 0x8000_0000_0000_0000) { // it was negative zero
*ps = 0x0000_0000_0000_0001; // change to smallest subnormal
return x;
}
--*ps;
} else { // Positive number
++*ps;
}
return x;
}
/** ditto */
float nextUp(float x) @trusted pure nothrow
{
uint *ps = cast(uint *)&x;
if ((*ps & 0x7F80_0000) == 0x7F80_0000) {
// First, deal with NANs and infinity
if (x == -x.infinity) return -x.max;
return x; // +INF and NAN are unchanged.
}
if (*ps & 0x8000_0000) { // Negative number
if (*ps == 0x8000_0000) { // it was negative zero
*ps = 0x0000_0001; // change to smallest subnormal
return x;
}
--*ps;
} else { // Positive number
++*ps;
}
return x;
}
/**
* Calculate the next smallest floating point value before x.
*
* Return the greatest number less than x that is representable as a real;
* thus, it gives the previous point on the IEEE number line.
*
* $(TABLE_SV
* $(SVH x, nextDown(x) )
* $(SV $(INFIN), real.max )
* $(SV $(PLUSMN)0.0, -real.min_normal*real.epsilon )
* $(SV -real.max, -$(INFIN) )
* $(SV -$(INFIN), -$(INFIN) )
* $(SV $(NAN), $(NAN) )
* )
*/
real nextDown(real x) @safe pure nothrow
{
return -nextUp(-x);
}
/** ditto */
double nextDown(double x) @safe pure nothrow
{
return -nextUp(-x);
}
/** ditto */
float nextDown(float x) @safe pure nothrow
{
return -nextUp(-x);
}
unittest {
assert( nextDown(1.0 + real.epsilon) == 1.0);
}
unittest {
static if (real.mant_dig == 64) {
// Tests for 80-bit reals
assert(isIdentical(nextUp(NaN(0xABC)), NaN(0xABC)));
// negative numbers
assert( nextUp(-real.infinity) == -real.max );
assert( nextUp(-1.0L-real.epsilon) == -1.0 );
assert( nextUp(-2.0L) == -2.0 + real.epsilon);
// subnormals and zero
assert( nextUp(-real.min_normal) == -real.min_normal*(1-real.epsilon) );
assert( nextUp(-real.min_normal*(1-real.epsilon)) == -real.min_normal*(1-2*real.epsilon) );
assert( isIdentical(-0.0L, nextUp(-real.min_normal*real.epsilon)) );
assert( nextUp(-0.0L) == real.min_normal*real.epsilon );
assert( nextUp(0.0L) == real.min_normal*real.epsilon );
assert( nextUp(real.min_normal*(1-real.epsilon)) == real.min_normal );
assert( nextUp(real.min_normal) == real.min_normal*(1+real.epsilon) );
// positive numbers
assert( nextUp(1.0L) == 1.0 + real.epsilon );
assert( nextUp(2.0L-real.epsilon) == 2.0 );
assert( nextUp(real.max) == real.infinity );
assert( nextUp(real.infinity)==real.infinity );
}
double n = NaN(0xABC);
assert(isIdentical(nextUp(n), n));
// negative numbers
assert( nextUp(-double.infinity) == -double.max );
assert( nextUp(-1-double.epsilon) == -1.0 );
assert( nextUp(-2.0) == -2.0 + double.epsilon);
// subnormals and zero
assert( nextUp(-double.min_normal) == -double.min_normal*(1-double.epsilon) );
assert( nextUp(-double.min_normal*(1-double.epsilon)) == -double.min_normal*(1-2*double.epsilon) );
assert( isIdentical(-0.0, nextUp(-double.min_normal*double.epsilon)) );
assert( nextUp(0.0) == double.min_normal*double.epsilon );
assert( nextUp(-0.0) == double.min_normal*double.epsilon );
assert( nextUp(double.min_normal*(1-double.epsilon)) == double.min_normal );
assert( nextUp(double.min_normal) == double.min_normal*(1+double.epsilon) );
// positive numbers
assert( nextUp(1.0) == 1.0 + double.epsilon );
assert( nextUp(2.0-double.epsilon) == 2.0 );
assert( nextUp(double.max) == double.infinity );
float fn = NaN(0xABC);
assert(isIdentical(nextUp(fn), fn));
float f = -float.min_normal*(1-float.epsilon);
float f1 = -float.min_normal;
assert( nextUp(f1) == f);
f = 1.0f+float.epsilon;
f1 = 1.0f;
assert( nextUp(f1) == f );
f1 = -0.0f;
assert( nextUp(f1) == float.min_normal*float.epsilon);
assert( nextUp(float.infinity)==float.infinity );
assert(nextDown(1.0L+real.epsilon)==1.0);
assert(nextDown(1.0+double.epsilon)==1.0);
f = 1.0f+float.epsilon;
assert(nextDown(f)==1.0);
assert(nextafter(1.0+real.epsilon, -real.infinity)==1.0);
}
/******************************************
* Calculates the next representable value after x in the direction of y.
*
* If y > x, the result will be the next largest floating-point value;
* if y < x, the result will be the next smallest value.
* If x == y, the result is y.
*
* Remarks:
* This function is not generally very useful; it's almost always better to use
* the faster functions nextUp() or nextDown() instead.
*
* The FE_INEXACT and FE_OVERFLOW exceptions will be raised if x is finite and
* the function result is infinite. The FE_INEXACT and FE_UNDERFLOW
* exceptions will be raised if the function value is subnormal, and x is
* not equal to y.
*/
T nextafter(T)(T x, T y) @safe pure nothrow
{
if (x==y) return y;
return ((y>x) ? nextUp(x) : nextDown(x));
}
unittest
{
float a = 1;
assert(is(typeof(nextafter(a, a)) == float));
assert(nextafter(a, a.infinity) > a);
double b = 2;
assert(is(typeof(nextafter(b, b)) == double));
assert(nextafter(b, b.infinity) > b);
real c = 3;
assert(is(typeof(nextafter(c, c)) == real));
assert(nextafter(c, c.infinity) > c);
}
//real nexttoward(real x, real y) { return core.stdc.math.nexttowardl(x, y); }
/*******************************************
* Returns the positive difference between x and y.
* Returns:
* $(TABLE_SV
* $(TR $(TH x, y) $(TH fdim(x, y)))
* $(TR $(TD x $(GT) y) $(TD x - y))
* $(TR $(TD x $(LT)= y) $(TD +0.0))
* )
*/
real fdim(real x, real y) @safe pure nothrow { return (x > y) ? x - y : +0.0; }
/****************************************
* Returns the larger of x and y.
*/
real fmax(real x, real y) @safe pure nothrow { return x > y ? x : y; }
/****************************************
* Returns the smaller of x and y.
*/
real fmin(real x, real y) @safe pure nothrow { return x < y ? x : y; }
/**************************************
* Returns (x * y) + z, rounding only once according to the
* current rounding mode.
*
* BUGS: Not currently implemented - rounds twice.
*/
real fma(real x, real y, real z) @safe pure nothrow { return (x * y) + z; }
/*******************************************************************
* Compute the value of x $(SUP n), where n is an integer
*/
Unqual!F pow(F, G)(F x, G n) @trusted pure nothrow
if (isFloatingPoint!(F) && isIntegral!(G))
{
real p = 1.0, v = void;
Unsigned!(Unqual!G) m = n;
if (n < 0)
{
switch (n)
{
case -1:
return 1 / x;
case -2:
return 1 / (x * x);
default:
}
m = -n;
v = p / x;
}
else
{
switch (n)
{
case 0:
return 1.0;
case 1:
return x;
case 2:
return x * x;
default:
}
v = x;
}
while (1)
{
if (m & 1)
p *= v;
m >>= 1;
if (!m)
break;
v *= v;
}
return p;
}
unittest
{
// Make sure it instantiates and works properly on immutable values and
// with various integer and float types.
immutable real x = 46;
immutable float xf = x;
immutable double xd = x;
immutable uint one = 1;
immutable ushort two = 2;
immutable ubyte three = 3;
immutable ulong eight = 8;
immutable int neg1 = -1;
immutable short neg2 = -2;
immutable byte neg3 = -3;
immutable long neg8 = -8;
assert(pow(x,0) == 1.0);
assert(pow(xd,one) == x);
assert(pow(xf,two) == x * x);
assert(pow(x,three) == x * x * x);
assert(pow(x,eight) == (x * x) * (x * x) * (x * x) * (x * x));
assert(pow(x, neg1) == 1 / x);
version(X86_64)
{
pragma(msg, "test disabled on x86_64, see bug 5628");
}
else
{
assert(pow(xd, neg2) == 1 / (x * x));
assert(pow(xf, neg8) == 1 / ((x * x) * (x * x) * (x * x) * (x * x)));
}
assert(pow(x, neg3) == 1 / (x * x * x));
}
unittest
{
assert(equalsDigit(pow(2.0L, 10.0L), 1024, 19));
}
/** Compute the value of an integer x, raised to the power of a positive
* integer n.
*
* If both x and n are 0, the result is 1.
* If n is negative, an integer divide error will occur at runtime,
* regardless of the value of x.
*/
typeof(Unqual!(F).init * Unqual!(G).init) pow(F, G)(F x, G n) @trusted pure nothrow
if (isIntegral!(F) && isIntegral!(G))
{
if (n<0) return x/0; // Only support positive powers
typeof(return) p, v = void;
Unqual!G m = n;
switch (m)
{
case 0:
p = 1;
break;
case 1:
p = x;
break;
case 2:
p = x * x;
break;
default:
v = x;
p = 1;
while (1){
if (m & 1)
p *= v;
m >>= 1;
if (!m)
break;
v *= v;
}
break;
}
return p;
}
unittest
{
immutable int one = 1;
immutable byte two = 2;
immutable ubyte three = 3;
immutable short four = 4;
immutable long ten = 10;
assert(pow(two, three) == 8);
assert(pow(two, ten) == 1024);
assert(pow(one, ten) == 1);
assert(pow(ten, four) == 10_000);
assert(pow(four, 10) == 1_048_576);
assert(pow(three, four) == 81);
}
/**Computes integer to floating point powers.*/
real pow(I, F)(I x, F y) @trusted pure nothrow
if(isIntegral!I && isFloatingPoint!F)
{
return pow(cast(real) x, cast(Unqual!F) y);
}
/*********************************************
* Calculates x$(SUP y).
*
* $(TABLE_SV
* $(TR $(TH x) $(TH y) $(TH pow(x, y))
* $(TH div 0) $(TH invalid?))
* $(TR $(TD anything) $(TD $(PLUSMN)0.0) $(TD 1.0)
* $(TD no) $(TD no) )
* $(TR $(TD |x| $(GT) 1) $(TD +$(INFIN)) $(TD +$(INFIN))
* $(TD no) $(TD no) )
* $(TR $(TD |x| $(LT) 1) $(TD +$(INFIN)) $(TD +0.0)
* $(TD no) $(TD no) )
* $(TR $(TD |x| $(GT) 1) $(TD -$(INFIN)) $(TD +0.0)
* $(TD no) $(TD no) )
* $(TR $(TD |x| $(LT) 1) $(TD -$(INFIN)) $(TD +$(INFIN))
* $(TD no) $(TD no) )
* $(TR $(TD +$(INFIN)) $(TD $(GT) 0.0) $(TD +$(INFIN))
* $(TD no) $(TD no) )
* $(TR $(TD +$(INFIN)) $(TD $(LT) 0.0) $(TD +0.0)
* $(TD no) $(TD no) )
* $(TR $(TD -$(INFIN)) $(TD odd integer $(GT) 0.0) $(TD -$(INFIN))
* $(TD no) $(TD no) )
* $(TR $(TD -$(INFIN)) $(TD $(GT) 0.0, not odd integer) $(TD +$(INFIN))
* $(TD no) $(TD no))
* $(TR $(TD -$(INFIN)) $(TD odd integer $(LT) 0.0) $(TD -0.0)
* $(TD no) $(TD no) )
* $(TR $(TD -$(INFIN)) $(TD $(LT) 0.0, not odd integer) $(TD +0.0)
* $(TD no) $(TD no) )
* $(TR $(TD $(PLUSMN)1.0) $(TD $(PLUSMN)$(INFIN)) $(TD $(NAN))
* $(TD no) $(TD yes) )
* $(TR $(TD $(LT) 0.0) $(TD finite, nonintegral) $(TD $(NAN))
* $(TD no) $(TD yes))
* $(TR $(TD $(PLUSMN)0.0) $(TD odd integer $(LT) 0.0) $(TD $(PLUSMNINF))
* $(TD yes) $(TD no) )
* $(TR $(TD $(PLUSMN)0.0) $(TD $(LT) 0.0, not odd integer) $(TD +$(INFIN))
* $(TD yes) $(TD no))
* $(TR $(TD $(PLUSMN)0.0) $(TD odd integer $(GT) 0.0) $(TD $(PLUSMN)0.0)
* $(TD no) $(TD no) )
* $(TR $(TD $(PLUSMN)0.0) $(TD $(GT) 0.0, not odd integer) $(TD +0.0)
* $(TD no) $(TD no) )
* )
*/
Unqual!(Largest!(F, G)) pow(F, G)(F x, G y) @trusted pure nothrow
if (isFloatingPoint!(F) && isFloatingPoint!(G))
{
alias typeof(return) Float;
static real impl(real x, real y) pure nothrow
{
if (isNaN(y))
return y;
if (y == 0)
return 1; // even if x is $(NAN)
if (isNaN(x) && y != 0)
return x;
if (isInfinity(y))
{
if (fabs(x) > 1)
{
if (signbit(y))
return +0.0;
else
return F.infinity;
}
else if (fabs(x) == 1)
{
return y * 0; // generate NaN.
}
else // < 1
{
if (signbit(y))
return F.infinity;
else
return +0.0;
}
}
if (isInfinity(x))
{
if (signbit(x))
{ long i;
i = cast(long)y;
if (y > 0)
{
if (i == y && i & 1)
return -F.infinity;
else
return F.infinity;
}
else if (y < 0)
{
if (i == y && i & 1)
return -0.0;
else
return +0.0;
}
}
else
{
if (y > 0)
return F.infinity;
else if (y < 0)
return +0.0;
}
}
if (x == 0.0)
{
if (signbit(x))
{ long i;
i = cast(long)y;
if (y > 0)
{
if (i == y && i & 1)
return -0.0;
else
return +0.0;
}
else if (y < 0)
{
if (i == y && i & 1)
return -F.infinity;
else
return F.infinity;
}
}
else
{
if (y > 0)
return +0.0;
else if (y < 0)
return F.infinity;
}
}
double sign = 1.0;
if (x < 0) {
// Result is real only if y is an integer
// Check for a non-zero fractional part
if (y > -1.0 / real.epsilon && y < 1.0 / real.epsilon)
{
long w = cast(long)y;
if (w != y)
return sqrt(x); // Complex result -- create a NaN
if (w & 1) sign = -1.0;
}
x = -x;
}
version(INLINE_YL2X) {
// If x > 0, x ^^ y == 2 ^^ ( y * log2(x) )
// TODO: This is not accurate in practice. A fast and accurate
// (though complicated) method is described in:
// "An efficient rounding boundary test for pow(x, y)
// in double precision", C.Q. Lauter and V. Lefèvre, INRIA (2007).
return sign * exp2( yl2x(x, y) );
} else {
return sign * core.stdc.math.powl(x, y);
}
}
return impl(x, y);
}
unittest
{
// Test all the special values. These unittests can be run on Windows
// by temporarily changing the version(linux) to version(all).
immutable float zero = 0;
immutable real one = 1;
immutable double two = 2;
immutable float three = 3;
immutable float fnan = float.nan;
immutable double dnan = double.nan;
immutable real rnan = real.nan;
immutable dinf = double.infinity;
immutable rninf = -real.infinity;
assert(pow(fnan, zero) == 1);
assert(pow(dnan, zero) == 1);
assert(pow(rnan, zero) == 1);
assert(pow(two, dinf) == double.infinity);
assert(isIdentical(pow(0.2f, dinf), +0.0));
assert(pow(0.99999999L, rninf) == real.infinity);
assert(isIdentical(pow(1.000000001, rninf), +0.0));
assert(pow(dinf, 0.001) == dinf);
assert(isIdentical(pow(dinf, -0.001), +0.0));
assert(pow(rninf, 3.0L) == rninf);
assert(pow(rninf, 2.0L) == real.infinity);
assert(isIdentical(pow(rninf, -3.0), -0.0));
assert(isIdentical(pow(rninf, -2.0), +0.0));
// @@@BUG@@@ somewhere
version(OSX) {} else assert(isNaN(pow(one, dinf)));
version(OSX) {} else assert(isNaN(pow(-one, dinf)));
assert(isNaN(pow(-0.2, PI)));
// boundary cases. Note that epsilon == 2^^-n for some n,
// so 1/epsilon == 2^^n is always even.
assert(pow(-1.0L, 1/real.epsilon - 1.0L) == -1.0L);
assert(pow(-1.0L, 1/real.epsilon) == 1.0L);
assert(isNaN(pow(-1.0L, 1/real.epsilon-0.5L)));
assert(isNaN(pow(-1.0L, -1/real.epsilon+0.5L)));
assert(pow(0.0, -3.0) == double.infinity);
assert(pow(-0.0, -3.0) == -double.infinity);
assert(pow(0.0, -PI) == double.infinity);
assert(pow(-0.0, -PI) == double.infinity);
assert(isIdentical(pow(0.0, 5.0), 0.0));
assert(isIdentical(pow(-0.0, 5.0), -0.0));
assert(isIdentical(pow(0.0, 6.0), 0.0));
assert(isIdentical(pow(-0.0, 6.0), 0.0));
// Now, actual numbers.
assert(approxEqual(pow(two, three), 8.0));
assert(approxEqual(pow(two, -2.5), 0.1767767));
// Test integer to float power.
immutable uint twoI = 2;
assert(approxEqual(pow(twoI, three), 8.0));
}
/**************************************
* To what precision is x equal to y?
*
* Returns: the number of mantissa bits which are equal in x and y.
* eg, 0x1.F8p+60 and 0x1.F1p+60 are equal to 5 bits of precision.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH y) $(TH feqrel(x, y)))
* $(TR $(TD x) $(TD x) $(TD real.mant_dig))
* $(TR $(TD x) $(TD $(GT)= 2*x) $(TD 0))
* $(TR $(TD x) $(TD $(LT)= x/2) $(TD 0))
* $(TR $(TD $(NAN)) $(TD any) $(TD 0))
* $(TR $(TD any) $(TD $(NAN)) $(TD 0))
* )
*/
int feqrel(X)(X x, X y) @trusted pure nothrow
if (isFloatingPoint!(X))
{
/* Public Domain. Author: Don Clugston, 18 Aug 2005.
*/
static if (X.mant_dig == 106) // doubledouble
{
if (cast(double*)(&x)[MANTISSA_MSB] == cast(double*)(&y)[MANTISSA_MSB])
{
return double.mant_dig
+ feqrel(cast(double*)(&x)[MANTISSA_LSB],
cast(double*)(&y)[MANTISSA_LSB]);
}
else
{
return feqrel(cast(double*)(&x)[MANTISSA_MSB],
cast(double*)(&y)[MANTISSA_MSB]);
}
}
else
{
static assert( X.mant_dig == 64 || X.mant_dig == 113
|| X.mant_dig == double.mant_dig || X.mant_dig == float.mant_dig);
if (x == y)
return X.mant_dig; // ensure diff!=0, cope with INF.
X diff = fabs(x - y);
ushort *pa = cast(ushort *)(&x);
ushort *pb = cast(ushort *)(&y);
ushort *pd = cast(ushort *)(&diff);
alias floatTraits!(X) F;
// The difference in abs(exponent) between x or y and abs(x-y)
// is equal to the number of significand bits of x which are
// equal to y. If negative, x and y have different exponents.
// If positive, x and y are equal to 'bitsdiff' bits.
// AND with 0x7FFF to form the absolute value.
// To avoid out-by-1 errors, we subtract 1 so it rounds down
// if the exponents were different. This means 'bitsdiff' is
// always 1 lower than we want, except that if bitsdiff==0,
// they could have 0 or 1 bits in common.
static if (X.mant_dig == 64 || X.mant_dig == 113)
{ // real80 or quadruple
int bitsdiff = ( ((pa[F.EXPPOS_SHORT] & F.EXPMASK)
+ (pb[F.EXPPOS_SHORT] & F.EXPMASK) - 1) >> 1)
- pd[F.EXPPOS_SHORT];
}
else static if (X.mant_dig == double.mant_dig)
{ // double
int bitsdiff = (( ((pa[F.EXPPOS_SHORT]&0x7FF0)
+ (pb[F.EXPPOS_SHORT]&0x7FF0)-0x10)>>1)
- (pd[F.EXPPOS_SHORT]&0x7FF0))>>4;
}
else static if (X.mant_dig == float.mant_dig)
{ // float
int bitsdiff = (( ((pa[F.EXPPOS_SHORT]&0x7F80)
+ (pb[F.EXPPOS_SHORT]&0x7F80)-0x80)>>1)
- (pd[F.EXPPOS_SHORT]&0x7F80))>>7;
}
if ( (pd[F.EXPPOS_SHORT] & F.EXPMASK) == 0)
{ // Difference is subnormal
// For subnormals, we need to add the number of zeros that
// lie at the start of diff's significand.
// We do this by multiplying by 2^^real.mant_dig
diff *= F.RECIP_EPSILON;
return bitsdiff + X.mant_dig - pd[F.EXPPOS_SHORT];
}
if (bitsdiff > 0)
return bitsdiff + 1; // add the 1 we subtracted before
// Avoid out-by-1 errors when factor is almost 2.
static if (X.mant_dig == 64 || X.mant_dig == 113)
{ // real80 or quadruple
return (bitsdiff == 0) ? (pa[F.EXPPOS_SHORT] == pb[F.EXPPOS_SHORT]) : 0;
}
else static if (X.mant_dig == double.mant_dig || X.mant_dig == float.mant_dig)
{
if (bitsdiff == 0
&& !((pa[F.EXPPOS_SHORT] ^ pb[F.EXPPOS_SHORT]) & F.EXPMASK))
{
return 1;
} else return 0;
}
}
}
unittest
{
void testFeqrel(F)()
{
// Exact equality
assert(feqrel(F.max, F.max) == F.mant_dig);
assert(feqrel!(F)(0.0, 0.0) == F.mant_dig);
assert(feqrel(F.infinity, F.infinity) == F.mant_dig);
// a few bits away from exact equality
F w=1;
for (int i = 1; i < F.mant_dig - 1; ++i)
{
assert(feqrel!(F)(1.0 + w * F.epsilon, 1.0) == F.mant_dig-i);
assert(feqrel!(F)(1.0 - w * F.epsilon, 1.0) == F.mant_dig-i);
assert(feqrel!(F)(1.0, 1 + (w-1) * F.epsilon) == F.mant_dig - i + 1);
w*=2;
}
assert(feqrel!(F)(1.5+F.epsilon, 1.5) == F.mant_dig-1);
assert(feqrel!(F)(1.5-F.epsilon, 1.5) == F.mant_dig-1);
assert(feqrel!(F)(1.5-F.epsilon, 1.5+F.epsilon) == F.mant_dig-2);
// Numbers that are close
assert(feqrel!(F)(0x1.Bp+84, 0x1.B8p+84) == 5);
assert(feqrel!(F)(0x1.8p+10, 0x1.Cp+10) == 2);
assert(feqrel!(F)(1.5 * (1 - F.epsilon), 1.0L) == 2);
assert(feqrel!(F)(1.5, 1.0) == 1);
assert(feqrel!(F)(2 * (1 - F.epsilon), 1.0L) == 1);
// Factors of 2
assert(feqrel(F.max, F.infinity) == 0);
assert(feqrel!(F)(2 * (1 - F.epsilon), 1.0L) == 1);
assert(feqrel!(F)(1.0, 2.0) == 0);
assert(feqrel!(F)(4.0, 1.0) == 0);
// Extreme inequality
assert(feqrel(F.nan, F.nan) == 0);
assert(feqrel!(F)(0.0L, -F.nan) == 0);
assert(feqrel(F.nan, F.infinity) == 0);
assert(feqrel(F.infinity, -F.infinity) == 0);
assert(feqrel(F.max, -F.max) == 0);
}
assert(feqrel(7.1824L, 7.1824L) == real.mant_dig);
assert(feqrel(real.min_normal / 8, real.min_normal / 17) == 3);
testFeqrel!(real)();
testFeqrel!(double)();
testFeqrel!(float)();
}
package: // Not public yet
/* Return the value that lies halfway between x and y on the IEEE number line.
*
* Formally, the result is the arithmetic mean of the binary significands of x
* and y, multiplied by the geometric mean of the binary exponents of x and y.
* x and y must have the same sign, and must not be NaN.
* Note: this function is useful for ensuring O(log n) behaviour in algorithms
* involving a 'binary chop'.
*
* Special cases:
* If x and y are within a factor of 2, (ie, feqrel(x, y) > 0), the return value
* is the arithmetic mean (x + y) / 2.
* If x and y are even powers of 2, the return value is the geometric mean,
* ieeeMean(x, y) = sqrt(x * y).
*
*/
T ieeeMean(T)(T x, T y) @trusted pure nothrow
in {
// both x and y must have the same sign, and must not be NaN.
assert(signbit(x) == signbit(y));
assert(x<>=0 && y<>=0);
}
body {
// Runtime behaviour for contract violation:
// If signs are opposite, or one is a NaN, return 0.
if (!((x>=0 && y>=0) || (x<=0 && y<=0))) return 0.0;
// The implementation is simple: cast x and y to integers,
// average them (avoiding overflow), and cast the result back to a floating-point number.
alias floatTraits!(real) F;
T u;
static if (T.mant_dig==64) { // real80
// There's slight additional complexity because they are actually
// 79-bit reals...
ushort *ue = cast(ushort *)&u;
ulong *ul = cast(ulong *)&u;
ushort *xe = cast(ushort *)&x;
ulong *xl = cast(ulong *)&x;
ushort *ye = cast(ushort *)&y;
ulong *yl = cast(ulong *)&y;
// Ignore the useless implicit bit. (Bonus: this prevents overflows)
ulong m = ((*xl) & 0x7FFF_FFFF_FFFF_FFFFL) + ((*yl) & 0x7FFF_FFFF_FFFF_FFFFL);
// @@@ BUG? @@@
// Cast shouldn't be here
ushort e = cast(ushort) ((xe[F.EXPPOS_SHORT] & F.EXPMASK)
+ (ye[F.EXPPOS_SHORT] & F.EXPMASK));
if (m & 0x8000_0000_0000_0000L) {
++e;
m &= 0x7FFF_FFFF_FFFF_FFFFL;
}
// Now do a multi-byte right shift
uint c = e & 1; // carry
e >>= 1;
m >>>= 1;
if (c) m |= 0x4000_0000_0000_0000L; // shift carry into significand
if (e) *ul = m | 0x8000_0000_0000_0000L; // set implicit bit...
else *ul = m; // ... unless exponent is 0 (subnormal or zero).
ue[4]= e | (xe[F.EXPPOS_SHORT]& 0x8000); // restore sign bit
} else static if(T.mant_dig == 113) { //quadruple
// This would be trivial if 'ucent' were implemented...
ulong *ul = cast(ulong *)&u;
ulong *xl = cast(ulong *)&x;
ulong *yl = cast(ulong *)&y;
// Multi-byte add, then multi-byte right shift.
ulong mh = ((xl[MANTISSA_MSB] & 0x7FFF_FFFF_FFFF_FFFFL)
+ (yl[MANTISSA_MSB] & 0x7FFF_FFFF_FFFF_FFFFL));
// Discard the lowest bit (to avoid overflow)
ulong ml = (xl[MANTISSA_LSB]>>>1) + (yl[MANTISSA_LSB]>>>1);
// add the lowest bit back in, if necessary.
if (xl[MANTISSA_LSB] & yl[MANTISSA_LSB] & 1) {
++ml;
if (ml==0) ++mh;
}
mh >>>=1;
ul[MANTISSA_MSB] = mh | (xl[MANTISSA_MSB] & 0x8000_0000_0000_0000);
ul[MANTISSA_LSB] = ml;
} else static if (T.mant_dig == double.mant_dig) {
ulong *ul = cast(ulong *)&u;
ulong *xl = cast(ulong *)&x;
ulong *yl = cast(ulong *)&y;
ulong m = (((*xl) & 0x7FFF_FFFF_FFFF_FFFFL)
+ ((*yl) & 0x7FFF_FFFF_FFFF_FFFFL)) >>> 1;
m |= ((*xl) & 0x8000_0000_0000_0000L);
*ul = m;
} else static if (T.mant_dig == float.mant_dig) {
uint *ul = cast(uint *)&u;
uint *xl = cast(uint *)&x;
uint *yl = cast(uint *)&y;
uint m = (((*xl) & 0x7FFF_FFFF) + ((*yl) & 0x7FFF_FFFF)) >>> 1;
m |= ((*xl) & 0x8000_0000);
*ul = m;
} else {
assert(0, "Not implemented");
}
return u;
}
unittest {
assert(ieeeMean(-0.0,-1e-20)<0);
assert(ieeeMean(0.0,1e-20)>0);
assert(ieeeMean(1.0L,4.0L)==2L);
assert(ieeeMean(2.0*1.013,8.0*1.013)==4*1.013);
assert(ieeeMean(-1.0L,-4.0L)==-2L);
assert(ieeeMean(-1.0,-4.0)==-2);
assert(ieeeMean(-1.0f,-4.0f)==-2f);
assert(ieeeMean(-1.0,-2.0)==-1.5);
assert(ieeeMean(-1*(1+8*real.epsilon),-2*(1+8*real.epsilon))
==-1.5*(1+5*real.epsilon));
assert(ieeeMean(0x1p60,0x1p-10)==0x1p25);
static if (real.mant_dig==64) { // x87, 80-bit reals
assert(ieeeMean(1.0L,real.infinity)==0x1p8192L);
assert(ieeeMean(0.0L,real.infinity)==1.5);
}
assert(ieeeMean(0.5*real.min_normal*(1-4*real.epsilon),0.5*real.min_normal)
== 0.5*real.min_normal*(1-2*real.epsilon));
}
public:
/***********************************
* Evaluate polynomial A(x) = $(SUB a, 0) + $(SUB a, 1)x + $(SUB a, 2)$(POWER x,2)
* + $(SUB a,3)$(POWER x,3); ...
*
* Uses Horner's rule A(x) = $(SUB a, 0) + x($(SUB a, 1) + x($(SUB a, 2)
* + x($(SUB a, 3) + ...)))
* Params:
* A = array of coefficients $(SUB a, 0), $(SUB a, 1), etc.
*/
real poly(real x, const real[] A) @trusted pure nothrow
in
{
assert(A.length > 0);
}
body
{
version (D_InlineAsm_X86)
{
version (Windows)
{
// BUG: This code assumes a frame pointer in EBP.
asm // assembler by W. Bright
{
// EDX = (A.length - 1) * real.sizeof
mov ECX,A[EBP] ; // ECX = A.length
dec ECX ;
lea EDX,[ECX][ECX*8] ;
add EDX,ECX ;
add EDX,A+4[EBP] ;
fld real ptr [EDX] ; // ST0 = coeff[ECX]
jecxz return_ST ;
fld x[EBP] ; // ST0 = x
fxch ST(1) ; // ST1 = x, ST0 = r
align 4 ;
L2: fmul ST,ST(1) ; // r *= x
fld real ptr -10[EDX] ;
sub EDX,10 ; // deg--
faddp ST(1),ST ;
dec ECX ;
jne L2 ;
fxch ST(1) ; // ST1 = r, ST0 = x
fstp ST(0) ; // dump x
align 4 ;
return_ST: ;
;
}
}
else version (linux)
{
asm // assembler by W. Bright
{
// EDX = (A.length - 1) * real.sizeof
mov ECX,A[EBP] ; // ECX = A.length
dec ECX ;
lea EDX,[ECX*8] ;
lea EDX,[EDX][ECX*4] ;
add EDX,A+4[EBP] ;
fld real ptr [EDX] ; // ST0 = coeff[ECX]
jecxz return_ST ;
fld x[EBP] ; // ST0 = x
fxch ST(1) ; // ST1 = x, ST0 = r
align 4 ;
L2: fmul ST,ST(1) ; // r *= x
fld real ptr -12[EDX] ;
sub EDX,12 ; // deg--
faddp ST(1),ST ;
dec ECX ;
jne L2 ;
fxch ST(1) ; // ST1 = r, ST0 = x
fstp ST(0) ; // dump x
align 4 ;
return_ST: ;
;
}
}
else version (OSX)
{
asm // assembler by W. Bright
{
// EDX = (A.length - 1) * real.sizeof
mov ECX,A[EBP] ; // ECX = A.length
dec ECX ;
lea EDX,[ECX*8] ;
add EDX,EDX ;
add EDX,A+4[EBP] ;
fld real ptr [EDX] ; // ST0 = coeff[ECX]
jecxz return_ST ;
fld x[EBP] ; // ST0 = x
fxch ST(1) ; // ST1 = x, ST0 = r
align 4 ;
L2: fmul ST,ST(1) ; // r *= x
fld real ptr -16[EDX] ;
sub EDX,16 ; // deg--
faddp ST(1),ST ;
dec ECX ;
jne L2 ;
fxch ST(1) ; // ST1 = r, ST0 = x
fstp ST(0) ; // dump x
align 4 ;
return_ST: ;
;
}
}
else version (FreeBSD)
{
asm // assembler by W. Bright
{
// EDX = (A.length - 1) * real.sizeof
mov ECX,A[EBP] ; // ECX = A.length
dec ECX ;
lea EDX,[ECX*8] ;
lea EDX,[EDX][ECX*4] ;
add EDX,A+4[EBP] ;
fld real ptr [EDX] ; // ST0 = coeff[ECX]
jecxz return_ST ;
fld x[EBP] ; // ST0 = x
fxch ST(1) ; // ST1 = x, ST0 = r
align 4 ;
L2: fmul ST,ST(1) ; // r *= x
fld real ptr -12[EDX] ;
sub EDX,12 ; // deg--
faddp ST(1),ST ;
dec ECX ;
jne L2 ;
fxch ST(1) ; // ST1 = r, ST0 = x
fstp ST(0) ; // dump x
align 4 ;
return_ST: ;
;
}
}
else
{
static assert(0);
}
}
else
{
ptrdiff_t i = A.length - 1;
real r = A[i];
while (--i >= 0)
{
r *= x;
r += A[i];
}
return r;
}
}
unittest
{
debug (math) printf("math.poly.unittest\n");
real x = 3.1;
static real pp[] = [56.1, 32.7, 6];
assert( poly(x, pp) == (56.1L + (32.7L + 6L * x) * x) );
}
/**
Computes whether $(D lhs) is approximately equal to $(D rhs)
admitting a maximum relative difference $(D maxRelDiff) and a
maximum absolute difference $(D maxAbsDiff).
If the two inputs are ranges, $(D approxEqual) returns true if and
only if the ranges have the same number of elements and if $(D
approxEqual) evaluates to $(D true) for each pair of elements.
*/
bool approxEqual(T, U, V)(T lhs, U rhs, V maxRelDiff, V maxAbsDiff = 1e-5)
{
static if (isInputRange!T)
{
static if (isInputRange!U)
{
// Two ranges
for (;; lhs.popFront(), rhs.popFront())
{
if (lhs.empty) return rhs.empty;
if (rhs.empty) return lhs.empty;
if (!approxEqual(lhs.front, rhs.front, maxRelDiff, maxAbsDiff))
return false;
}
}
else
{
// lhs is range, rhs is number
for (; !lhs.empty; lhs.popFront())
{
if (!approxEqual(lhs.front, rhs, maxRelDiff, maxAbsDiff))
return false;
}
return true;
}
}
else
{
static if (isInputRange!U)
{
// lhs is number, rhs is array
return approxEqual(rhs, lhs, maxRelDiff, maxAbsDiff);
}
else
{
// two numbers
//static assert(is(T : real) && is(U : real));
if (rhs == 0)
{
return fabs(lhs) <= maxAbsDiff;
}
static if (is(typeof(lhs.infinity)) && is(typeof(rhs.infinity)))
{
if (lhs == lhs.infinity && rhs == rhs.infinity ||
lhs == -lhs.infinity && rhs == -rhs.infinity) return true;
}
return fabs((lhs - rhs) / rhs) <= maxRelDiff
|| maxAbsDiff != 0 && fabs(lhs - rhs) <= maxAbsDiff;
}
}
}
/**
Returns $(D approxEqual(lhs, rhs, 1e-2, 1e-5)).
*/
bool approxEqual(T, U)(T lhs, U rhs)
{
return approxEqual(lhs, rhs, 1e-2, 1e-5);
}
unittest
{
assert(approxEqual(1.0, 1.0099));
assert(!approxEqual(1.0, 1.011));
float[] arr1 = [ 1.0, 2.0, 3.0 ];
double[] arr2 = [ 1.001, 1.999, 3 ];
assert(approxEqual(arr1, arr2));
real num = real.infinity;
assert(num == real.infinity); // Passes.
assert(approxEqual(num, real.infinity)); // Fails.
num = -real.infinity;
assert(num == -real.infinity); // Passes.
assert(approxEqual(num, -real.infinity)); // Fails.
}
// Included for backwards compatibility with Phobos1
alias isNaN isnan;
alias isFinite isfinite;
alias isNormal isnormal;
alias isSubnormal issubnormal;
alias isInfinity isinf;
/* **********************************
* Building block functions, they
* translate to a single x87 instruction.
*/
real yl2x(real x, real y) @safe pure nothrow; // y * log2(x)
real yl2xp1(real x, real y) @safe pure nothrow; // y * log2(x + 1)
unittest
{
version (INLINE_YL2X)
{
assert(yl2x(1024, 1) == 10);
assert(yl2xp1(1023, 1) == 10);
}
}
unittest
{
real num = real.infinity;
assert(num == real.infinity); // Passes.
assert(approxEqual(num, real.infinity)); // Fails.
}
unittest
{
float f = sqrt(2.0f);
assert(fabs(f * f - 2.0f) < .00001);
double d = sqrt(2.0);
assert(fabs(d * d - 2.0) < .00001);
real r = sqrt(2.0L);
assert(fabs(r * r - 2.0) < .00001);
}
unittest
{
float f = fabs(-2.0f);
assert(f == 2);
double d = fabs(-2.0);
assert(d == 2);
real r = fabs(-2.0L);
assert(r == 2);
}
unittest
{
float f = sin(-2.0f);
assert(fabs(f - -0.909297f) < .00001);
double d = sin(-2.0);
assert(fabs(d - -0.909297f) < .00001);
real r = sin(-2.0L);
assert(fabs(r - -0.909297f) < .00001);
}
unittest
{
float f = cos(-2.0f);
assert(fabs(f - -0.416147f) < .00001);
double d = cos(-2.0);
assert(fabs(d - -0.416147f) < .00001);
real r = cos(-2.0L);
assert(fabs(r - -0.416147f) < .00001);
}
unittest
{
float f = tan(-2.0f);
assert(fabs(f - 2.18504f) < .00001);
double d = tan(-2.0);
assert(fabs(d - 2.18504f) < .00001);
real r = tan(-2.0L);
assert(fabs(r - 2.18504f) < .00001);
}
|
D
|
instance VLK_435_Nadja (Npc_Default)
{
// ------ NSC ------
name = "Nadja";
guild = GIL_VLK;
id = 435;
voice = 16;
flags = 0;
npctype = NPCTYPE_MAIN;
//-----------AIVARS----------------
aivar[AIV_ToughGuy] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 1);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_COWARD;
// ------ Equippte Waffen ------
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------
B_SetNpcVisual (self, FEMALE, "Hum_Head_Babe8", FaceBabe_N_Hure, BodyTex_N, ITAR_VlkBabe_H);
Mdl_SetModelFatness (self,0);
Mdl_ApplyOverlayMds (self, "Humans_Babe.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 30);
// ------ TA anmelden ------
daily_routine = Rtn_Start_435;
};
FUNC VOID Rtn_Start_435 () // Nadja hält sich für gewöhnlich unten auf...
{
TA_Stand_Drinking (05,00,17,00,"NW_PUFF_DANCE");
TA_Dance (17,00,21,00,"NW_PUFF_DANCE");
TA_Stand_Drinking (21,00,21,30,"NW_PUFF_DANCE");
TA_Dance (21,30,05,00,"NW_PUFF_DANCE");
};
FUNC VOID Rtn_Dance_435 ()// Aber wenn der Spieler zahlt, dann geht sie schon mal mit ihm nach oben
{
TA_Stand_ArmsCrossed (08,00,22,00,"NW_CITY_HABOUR_PUFF_NADJA");
TA_Stand_ArmsCrossed (22,00,08,00,"NW_CITY_HABOUR_PUFF_NADJA");
};
FUNC VOID Rtn_Smoke_435 () //
{
TA_Smoke_Joint (05,00,17,00,"NW_PUFF_DANCE");
TA_Dance (17,00,21,00,"NW_PUFF_DANCE");
TA_Smoke_Joint (21,00,21,30,"NW_PUFF_DANCE");
TA_Dance (21,30,05,00,"NW_PUFF_DANCE");
};
FUNC VOID Rtn_Tot_435 () //
{
TA_Stand_Guarding (00,00,12,00,"TOT");
TA_Stand_Guarding (12,00,00,00,"TOT");
};
|
D
|
/*
* #93 Spelling - Horatio: "zuzuschlagen" (DE)
*/
func int G1CP_093_DE_LogEntryHoratio() {
// I'm sorry for not breaking the line at 120 characters
const string curString = "Horatio, ein Bauer auf den Reisfeldern des Neuen Lagers will mir beibringen, stärker zuzuschalgen. Doch irgendwie habe ich noch nicht die richtige Antwort auf seine Frage WOZU gefunden.";
const string newString = "Horatio, ein Bauer auf den Reisfeldern des Neuen Lagers will mir beibringen, stärker zuzuschlagen. Doch irgendwie habe ich noch nicht die richtige Antwort auf seine Frage WOZU gefunden.";
const string topicName = "";
// Do only once per session for performance on consecutive calls
const int topicId = -2; // -1 is reserved for invalid symbols
const int count = -1;
if (topicId == -2) {
// Find and retrieve the topic
topicId = MEM_GetSymbolIndex("CH1_HoratiosTeachings");
topicName = G1CP_GetStringVarByIndex(topicId, 0, "");
// Replace the push of the old string with the new string (this is never reverted, i.e. session fix)
count = G1CP_ReplacePushStr(MEM_GetSymbolIndex("DIA_Horatio_PleaseTeachSTR_Info"), curString, newString);
};
// Check if the log topic constant exists and if the adding of the log entry was successfully replaced
if (topicId == -1) || (count < 1) {
return FALSE;
};
// Replace the log entry
G1CP_LogReplaceEntry(topicName, curString, newString);
// Return success
return TRUE;
};
/*
* This function reverts the changes of #93
*/
func int G1CP_093_DE_LogEntryHoratioRevert() {
// I'm sorry for not breaking the line at 120 characters
const string oldString = "Horatio, ein Bauer auf den Reisfeldern des Neuen Lagers will mir beibringen, stärker zuzuschalgen. Doch irgendwie habe ich noch nicht die richtige Antwort auf seine Frage WOZU gefunden.";
const string curString = "Horatio, ein Bauer auf den Reisfeldern des Neuen Lagers will mir beibringen, stärker zuzuschlagen. Doch irgendwie habe ich noch nicht die richtige Antwort auf seine Frage WOZU gefunden.";
const string topicName = "";
// Only revert if it was applied by the G1CP
if (!G1CP_IsFixApplied(93)) {
return FALSE;
};
// Retrieve the topic name only once per session for performance on consecutive calls
const int once = 0;
if (!once) {
topicName = G1CP_GetStringVar("CH1_HoratiosTeachings", 0, "");
once = 1;
};
// Revert the log entry
G1CP_LogReplaceEntry(topicName, curString, oldString);
// Return success
return TRUE;
};
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons;
string[100] WS;
bool[string] MEMO;
void main()
{
auto N = readln.chomp.to!int;
foreach (i; 0..N) {
WS[i] = readln.chomp;
}
char c = WS[0][0];
foreach (w; WS[0..N]) {
if (c != w[0] || w in MEMO) {
writeln("No");
return;
}
MEMO[w] = true;
c = w[$-1];
}
writeln("Yes");
}
|
D
|
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Fluent.build/Cache/CacheEntry.swift.o : /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/ID.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Model+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/MigrateCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/RevertCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/SoftDeletable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Join/JoinSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QuerySupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationLog.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Model.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/AnyModel.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Children.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/Migration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/AnyMigration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/FluentProvider.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaBuilder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaUpdater.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/FluentError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaCreator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Siblings.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/Migrations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/AnyMigrations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Parent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/ModelEvent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Pivot.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Cache/CacheEntry.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Fluent.build/CacheEntry~partial.swiftmodule : /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/ID.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Model+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/MigrateCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/RevertCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/SoftDeletable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Join/JoinSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QuerySupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationLog.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Model.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/AnyModel.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Children.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/Migration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/AnyMigration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/FluentProvider.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaBuilder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaUpdater.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/FluentError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaCreator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Siblings.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/Migrations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/AnyMigrations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Parent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/ModelEvent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Pivot.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Cache/CacheEntry.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Fluent.build/CacheEntry~partial.swiftdoc : /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/ID.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Model+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/MigrateCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/RevertCommand.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/SoftDeletable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationConfig.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Join/JoinSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/QuerySupporting.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationLog.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Model.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/AnyModel.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Children.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/Migration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/AnyMigration.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/FluentProvider.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaBuilder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaUpdater.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/FluentError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/SchemaCreator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Siblings.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/Migrations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/AnyMigrations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Relations/Parent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/ModelEvent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Model/Pivot.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Cache/CacheEntry.swift /Users/Khanh/vapor/TILApp/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Command.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Console.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Logging.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
// D import file generated from 'derelict\openal\alfuncs.d'
module derelict.openal.alfuncs;
private
{
import derelict.util.compat;
import derelict.openal.altypes;
}
extern (C)
{
alias void function(ALenum) da_alEnable;
alias void function(ALenum) da_alDisable;
alias ALboolean function(ALenum) da_alIsEnabled;
alias CCPTR function(ALenum) da_alGetString;
alias void function(ALenum, ALboolean*) da_alGetBooleanv;
alias void function(ALenum, ALint*) da_alGetIntegerv;
alias void function(ALenum, ALfloat*) da_alGetFloatv;
alias void function(ALenum, ALdouble*) da_alGetDoublev;
alias ALboolean function(ALenum) da_alGetBoolean;
alias ALint function(ALenum) da_alGetInteger;
alias ALfloat function(ALenum) da_alGetFloat;
alias ALdouble function(ALenum) da_alGetDouble;
alias ALenum function() da_alGetError;
alias ALboolean function(in char*) da_alIsExtensionPresent;
alias ALboolean function(in char*) da_alGetProcAddress;
alias ALenum function(in char*) da_alGetEnumValue;
alias void function(ALenum, ALfloat) da_alListenerf;
alias void function(ALenum, ALfloat, ALfloat, ALfloat) da_alListener3f;
alias void function(ALenum, in ALfloat*) da_alListenerfv;
alias void function(ALenum, ALint) da_alListeneri;
alias void function(ALenum, ALint, ALint, ALint) da_alListener3i;
alias void function(ALenum, in ALint*) da_alListeneriv;
alias void function(ALenum, ALfloat*) da_alGetListenerf;
alias void function(ALenum, ALfloat*, ALfloat*, ALfloat*) da_alGetListener3f;
alias void function(ALenum, ALfloat*) da_alGetListenerfv;
alias void function(ALenum, ALint*) da_alGetListeneri;
alias void function(ALenum, ALint*, ALint*, ALint*) da_alGetListener3i;
alias void function(ALenum, ALint*) da_alGetListeneriv;
alias void function(ALsizei, ALuint*) da_alGenSources;
alias void function(ALsizei, in ALuint*) da_alDeleteSources;
alias ALboolean function(ALuint) da_alIsSource;
alias void function(ALuint, ALenum, ALfloat) da_alSourcef;
alias void function(ALuint, ALenum, ALfloat, ALfloat, ALfloat) da_alSource3f;
alias void function(ALuint, ALenum, in ALfloat*) da_alSourcefv;
alias void function(ALuint, ALenum, ALint) da_alSourcei;
alias void function(ALuint, ALenum, ALint, ALint, ALint) da_alSource3i;
alias void function(ALuint, ALenum, in ALint*) da_alSourceiv;
alias void function(ALuint, ALenum, ALfloat*) da_alGetSourcef;
alias void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*) da_alGetSource3f;
alias void function(ALuint, ALenum, ALfloat*) da_alGetSourcefv;
alias void function(ALuint, ALenum, ALint*) da_alGetSourcei;
alias void function(ALuint, ALenum, ALint*, ALint*, ALint*) da_alGetSource3i;
alias void function(ALuint, ALenum, ALint*) da_alGetSourceiv;
alias void function(ALsizei, in ALuint*) da_alSourcePlayv;
alias void function(ALsizei, in ALuint*) da_alSourceStopv;
alias void function(ALsizei, in ALuint*) da_alSourceRewindv;
alias void function(ALsizei, in ALuint*) da_alSourcePausev;
alias void function(ALuint) da_alSourcePlay;
alias void function(ALuint) da_alSourcePause;
alias void function(ALuint) da_alSourceRewind;
alias void function(ALuint) da_alSourceStop;
alias void function(ALuint, ALsizei, ALuint*) da_alSourceQueueBuffers;
alias void function(ALuint, ALsizei, ALuint*) da_alSourceUnqueueBuffers;
alias void function(ALsizei, ALuint*) da_alGenBuffers;
alias void function(ALsizei, in ALuint*) da_alDeleteBuffers;
alias ALboolean function(ALuint) da_alIsBuffer;
alias void function(ALuint, ALenum, in ALvoid*, ALsizei, ALsizei) da_alBufferData;
alias void function(ALuint, ALenum, ALfloat) da_alBufferf;
alias void function(ALuint, ALenum, ALfloat, ALfloat, ALfloat) da_alBuffer3f;
alias void function(ALuint, ALenum, in ALfloat*) da_alBufferfv;
alias void function(ALuint, ALenum, ALint) da_alBufferi;
alias void function(ALuint, ALenum, ALint, ALint, ALint) da_alBuffer3i;
alias void function(ALuint, ALenum, in ALint*) da_alBufferiv;
alias void function(ALuint, ALenum, ALfloat*) da_alGetBufferf;
alias void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*) da_alGetBuffer3f;
alias void function(ALuint, ALenum, ALfloat*) da_alGetBufferfv;
alias void function(ALuint, ALenum, ALint*) da_alGetBufferi;
alias void function(ALuint, ALenum, ALint*, ALint*, ALint*) da_alGetBuffer3i;
alias void function(ALuint, ALenum, ALint*) da_alGetBufferiv;
alias void function(ALfloat) da_alDopplerFactor;
alias void function(ALfloat) da_alDopplerVelocity;
alias void function(ALfloat) da_alSpeedOfSound;
alias void function(ALenum) da_alDistanceModel;
alias ALCcontext* function(ALCdevice*, in ALCint*) da_alcCreateContext;
alias ALCboolean function(ALCcontext*) da_alcMakeContextCurrent;
alias void function(ALCcontext*) da_alcProcessContext;
alias void function(ALCcontext*) da_alcSuspendContext;
alias void function(ALCcontext*) da_alcDestroyContext;
alias ALCcontext* function() da_alcGetCurrentContext;
alias ALCdevice* function(ALCcontext*) da_alcGetContextsDevice;
alias ALCdevice* function(in char*) da_alcOpenDevice;
alias ALCboolean function(ALCdevice*) da_alcCloseDevice;
alias ALCenum function(ALCdevice*) da_alcGetError;
alias ALCboolean function(ALCdevice*, in char*) da_alcIsExtensionPresent;
alias void* function(ALCdevice*, in char*) da_alcGetProcAddress;
alias ALCenum function(ALCdevice*, in char*) da_alcGetEnumValue;
alias CCPTR function(ALCdevice*, ALCenum) da_alcGetString;
alias void function(ALCdevice*, ALCenum, ALCsizei, ALCint*) da_alcGetIntegerv;
alias ALCdevice* function(in char*, ALCuint, ALCenum, ALCsizei) da_alcCaptureOpenDevice;
alias ALCboolean function(ALCdevice*) da_alcCaptureCloseDevice;
alias void function(ALCdevice*) da_alcCaptureStart;
alias void function(ALCdevice*) da_alcCaptureStop;
alias void function(ALCdevice*, ALCvoid*, ALCsizei) da_alcCaptureSamples;
}
mixin(gsharedString!() ~ "\x0ada_alEnable alEnable;\x0ada_alDisable alDisable;\x0ada_alIsEnabled alIsEnabled;\x0a\x0ada_alGetString alGetString;\x0ada_alGetBooleanv alGetBooleanv;\x0ada_alGetIntegerv alGetIntegerv;\x0ada_alGetFloatv alGetFloatv;\x0ada_alGetDoublev alGetDoublev;\x0ada_alGetBoolean alGetBoolean;\x0ada_alGetInteger alGetInteger;\x0ada_alGetFloat alGetFloat;\x0ada_alGetDouble alGetDouble;\x0ada_alGetError alGetError;\x0a\x0ada_alIsExtensionPresent alIsExtensionPresent;\x0ada_alGetProcAddress alGetProcAddress;\x0ada_alGetEnumValue alGetEnumValue;\x0a\x0ada_alListenerf alListenerf;\x0ada_alListener3f alListener3f;\x0ada_alListenerfv alListenerfv;\x0ada_alListeneri alListeneri;\x0ada_alListener3i alListener3i;\x0ada_alListeneriv alListeneriv;\x0a\x0ada_alGetListenerf alGetListenerf;\x0ada_alGetListener3f alGetListener3f;\x0ada_alGetListenerfv alGetListenerfv;\x0ada_alGetListeneri alGetListeneri;\x0ada_alGetListener3i alGetListener3i;\x0ada_alGetListeneriv alGetListeneriv;\x0a\x0ada_alGenSources alGenSources;\x0ada_alDeleteSources alDeleteSources;\x0ada_alIsSource alIsSource;\x0a\x0ada_alSourcef alSourcef;\x0ada_alSource3f alSource3f;\x0ada_alSourcefv alSourcefv;\x0ada_alSourcei alSourcei;\x0ada_alSource3i alSource3i;\x0ada_alSourceiv alSourceiv;\x0a\x0a\x0ada_alGetSourcef alGetSourcef;\x0ada_alGetSource3f alGetSource3f;\x0ada_alGetSourcefv alGetSourcefv;\x0ada_alGetSourcei alGetSourcei;\x0ada_alGetSource3i alGetSource3i;\x0ada_alGetSourceiv alGetSourceiv;\x0a\x0ada_alSourcePlayv alSourcePlayv;\x0ada_alSourceStopv alSourceStopv;\x0ada_alSourceRewindv alSourceRewindv;\x0ada_alSourcePausev alSourcePausev;\x0ada_alSourcePlay alSourcePlay;\x0ada_alSourcePause alSourcePause;\x0ada_alSourceRewind alSourceRewind;\x0ada_alSourceStop alSourceStop;\x0a\x0ada_alSourceQueueBuffers alSourceQueueBuffers;\x0ada_alSourceUnqueueBuffers alSourceUnqueueBuffers;\x0a\x0ada_alGenBuffers alGenBuffers;\x0ada_alDeleteBuffers alDeleteBuffers;\x0ada_alIsBuffer alIsBuffer;\x0ada_alBufferData alBufferData;\x0a\x0ada_alBufferf alBufferf;\x0ada_alBuffer3f alBuffer3f;\x0ada_alBufferfv alBufferfv;\x0ada_alBufferi alBufferi;\x0ada_alBuffer3i alBuffer3i;\x0ada_alBufferiv alBufferiv;\x0ada_alGetBufferf alGetBufferf;\x0ada_alGetBuffer3f alGetBuffer3f;\x0ada_alGetBufferfv alGetBufferfv;\x0ada_alGetBufferi alGetBufferi;\x0ada_alGetBuffer3i alGetBuffer3i;\x0ada_alGetBufferiv alGetBufferiv;\x0a\x0ada_alDopplerFactor alDopplerFactor;\x0ada_alDopplerVelocity alDopplerVelocity;\x0ada_alSpeedOfSound alSpeedOfSound;\x0ada_alDistanceModel alDistanceModel;\x0a\x0ada_alcCreateContext alcCreateContext;\x0ada_alcMakeContextCurrent alcMakeContextCurrent;\x0ada_alcProcessContext alcProcessContext;\x0ada_alcSuspendContext alcSuspendContext;\x0ada_alcDestroyContext alcDestroyContext;\x0ada_alcGetCurrentContext alcGetCurrentContext;\x0ada_alcGetContextsDevice alcGetContextsDevice;\x0ada_alcOpenDevice alcOpenDevice;\x0ada_alcCloseDevice alcCloseDevice;\x0ada_alcGetError alcGetError;\x0ada_alcIsExtensionPresent alcIsExtensionPresent;\x0ada_alcGetProcAddress alcGetProcAddress;\x0ada_alcGetEnumValue alcGetEnumValue;\x0ada_alcGetString alcGetString;\x0ada_alcGetIntegerv alcGetIntegerv;\x0ada_alcCaptureOpenDevice alcCaptureOpenDevice;\x0ada_alcCaptureCloseDevice alcCaptureCloseDevice;\x0ada_alcCaptureStart alcCaptureStart;\x0ada_alcCaptureStop alcCaptureStop;\x0ada_alcCaptureSamples alcCaptureSamples;\x0a");
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (c) 1999-2017 by Digital Mars, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/ddmd/globals.d, _globals.d)
*/
module ddmd.globals;
// Online documentation: https://dlang.org/phobos/ddmd_globals.html
import core.stdc.stdint;
import core.stdc.stdio;
import ddmd.root.array;
import ddmd.root.filename;
import ddmd.root.outbuffer;
template xversion(string s)
{
enum xversion = mixin(`{ version (` ~ s ~ `) return true; else return false; }`)();
}
enum IN_GCC = xversion!`IN_GCC`;
enum TARGET_LINUX = xversion!`linux`;
enum TARGET_OSX = xversion!`OSX`;
enum TARGET_FREEBSD = xversion!`FreeBSD`;
enum TARGET_OPENBSD = xversion!`OpenBSD`;
enum TARGET_SOLARIS = xversion!`Solaris`;
enum TARGET_WINDOS = xversion!`Windows`;
enum BOUNDSCHECK : int
{
BOUNDSCHECKdefault, // initial value
BOUNDSCHECKoff, // never do bounds checking
BOUNDSCHECKon, // always do bounds checking
BOUNDSCHECKsafeonly, // do bounds checking only in @safe functions
}
alias BOUNDSCHECKdefault = BOUNDSCHECK.BOUNDSCHECKdefault;
alias BOUNDSCHECKoff = BOUNDSCHECK.BOUNDSCHECKoff;
alias BOUNDSCHECKon = BOUNDSCHECK.BOUNDSCHECKon;
alias BOUNDSCHECKsafeonly = BOUNDSCHECK.BOUNDSCHECKsafeonly;
enum CPU
{
x87,
mmx,
sse,
sse2,
sse3,
ssse3,
sse4_1,
sse4_2,
avx, // AVX1 instruction set
avx2, // AVX2 instruction set
avx512, // AVX-512 instruction set
// Special values that don't survive past the command line processing
baseline, // (default) the minimum capability CPU
native // the machine the compiler is being run on
}
// Put command line switches in here
struct Param
{
bool obj; // write object file
bool link; // perform link
bool dll; // generate shared dynamic library
bool lib; // write library file instead of object file(s)
bool multiobj; // break one object file into multiple ones
bool oneobj; // write one object file instead of multiple ones
bool trace; // insert profiling hooks
bool tracegc; // instrument calls to 'new'
bool verbose; // verbose compile
bool vcg_ast; // write-out codegen-ast
bool showColumns; // print character (column) numbers in diagnostics
bool vtls; // identify thread local variables
bool vgc; // identify gc usage
bool vfield; // identify non-mutable field variables
bool vcomplex; // identify complex/imaginary type usage
ubyte symdebug; // insert debug symbolic information
bool symdebugref; // insert debug information for all referenced types, too
bool alwaysframe; // always emit standard stack frame
bool optimize; // run optimizer
bool map; // generate linker .map file
bool is64bit; // generate 64 bit code
bool isLP64; // generate code for LP64
bool isLinux; // generate code for linux
bool isOSX; // generate code for Mac OSX
bool isWindows; // generate code for Windows
bool isFreeBSD; // generate code for FreeBSD
bool isOpenBSD; // generate code for OpenBSD
bool isSolaris; // generate code for Solaris
bool hasObjectiveC; // target supports Objective-C
bool mscoff; // for Win32: write COFF object files instead of OMF
// 0: don't allow use of deprecated features
// 1: silently allow use of deprecated features
// 2: warn about the use of deprecated features
byte useDeprecated;
bool useAssert; // generate runtime code for assert()'s
bool useInvariants; // generate class invariant checks
bool useIn; // generate precondition checks
bool useOut; // generate postcondition checks
bool stackstomp; // add stack stomping code
bool useSwitchError; // check for switches without a default
bool useUnitTests; // generate unittest code
bool useInline; // inline expand functions
bool useDIP25; // implement http://wiki.dlang.org/DIP25
bool release; // build release version
bool preservePaths; // true means don't strip path from source file
// 0: disable warnings
// 1: warnings as errors
// 2: informational warnings (no errors)
byte warnings;
bool pic; // generate position-independent-code for shared libs
bool color; // use ANSI colors in console output
bool cov; // generate code coverage data
ubyte covPercent; // 0..100 code coverage percentage required
bool nofloat; // code should not pull in floating point support
bool ignoreUnsupportedPragmas; // rather than error on them
bool enforcePropertySyntax;
bool betterC; // be a "better C" compiler; no dependency on D runtime
bool addMain; // add a default main() function
bool allInst; // generate code for all template instantiations
bool check10378; // check for issues transitioning to 10738
bool bug10378; // use pre- https://issues.dlang.org/show_bug.cgi?id=10378 search strategy
bool vsafe; // use enhanced @safe checking
/** The --transition=safe switch should only be used to show code with
* silent semantics changes related to @safe improvements. It should not be
* used to hide a feature that will have to go through deprecate-then-error
* before becoming default.
*/
bool showGaggedErrors; // print gagged errors anyway
bool manual; // open browser on compiler manual
bool usage; // print usage and exit
bool mcpuUsage; // print help on -mcpu switch
bool transitionUsage; // print help on -transition switch
bool logo; // print logo;
CPU cpu; // CPU instruction set to target
BOUNDSCHECK useArrayBounds;
const(char)* argv0; // program name
Array!(const(char)*)* modFileAliasStrings; // array of char*'s of -I module filename alias strings
Array!(const(char)*)* imppath; // array of char*'s of where to look for import modules
Array!(const(char)*)* fileImppath; // array of char*'s of where to look for file import modules
const(char)* objdir; // .obj/.lib file output directory
const(char)* objname; // .obj file output name
const(char)* libname; // .lib file output name
bool doDocComments; // process embedded documentation comments
const(char)* docdir; // write documentation file to docdir directory
const(char)* docname; // write documentation file to docname
Array!(const(char)*)* ddocfiles; // macro include files for Ddoc
bool doHdrGeneration; // process embedded documentation comments
const(char)* hdrdir; // write 'header' file to docdir directory
const(char)* hdrname; // write 'header' file to docname
bool hdrStripPlainFunctions; // strip the bodies of plain (non-template) functions
bool doJsonGeneration; // write JSON file
const(char)* jsonfilename; // write JSON file to jsonfilename
uint debuglevel; // debug level
Array!(const(char)*)* debugids; // debug identifiers
uint versionlevel; // version level
Array!(const(char)*)* versionids; // version identifiers
const(char)* defaultlibname; // default library for non-debug builds
const(char)* debuglibname; // default library for debug builds
const(char)* mscrtlib; // MS C runtime library
const(char)* moduleDepsFile; // filename for deps output
OutBuffer* moduleDeps; // contents to be written to deps file
// Hidden debug switches
bool debugb;
bool debugc;
bool debugf;
bool debugr;
bool debugx;
bool debugy;
bool run; // run resulting executable
Strings runargs; // arguments for executable
// Linker stuff
Array!(const(char)*)* objfiles;
Array!(const(char)*)* linkswitches;
Array!(const(char)*)* libfiles;
Array!(const(char)*)* dllfiles;
const(char)* deffile;
const(char)* resfile;
const(char)* exefile;
const(char)* mapfile;
}
struct Compiler
{
const(char)* vendor; // Compiler backend name
}
alias structalign_t = uint;
// magic value means "match whatever the underlying C compiler does"
// other values are all powers of 2
enum STRUCTALIGN_DEFAULT = (cast(structalign_t)~0);
struct Global
{
const(char)* inifilename;
const(char)* mars_ext;
const(char)* obj_ext;
const(char)* lib_ext;
const(char)* dll_ext;
const(char)* doc_ext; // for Ddoc generated files
const(char)* ddoc_ext; // for Ddoc macro include files
const(char)* hdr_ext; // for D 'header' import files
const(char)* json_ext; // for JSON files
const(char)* map_ext; // for .map files
bool run_noext; // allow -run sources without extensions.
const(char)* copyright;
const(char)* written;
const(char)* main_d; // dummy filename for dummy main()
Array!(const(char)*)* path; // Array of char*'s which form the import lookup path
Array!(const(char)*)* filePath; // Array of char*'s which form the file import lookup path
const(char)* _version;
Compiler compiler;
Param params;
uint errors; // number of errors reported so far
uint warnings; // number of warnings reported so far
FILE* stdmsg; // where to send verbose messages
uint gag; // !=0 means gag reporting of errors & warnings
uint gaggedErrors; // number of errors reported while gagged
uint errorLimit;
void* console; // opaque pointer to console for controlling text attributes
/* Start gagging. Return the current number of gagged errors
*/
extern (C++) uint startGagging()
{
++gag;
return gaggedErrors;
}
/* End gagging, restoring the old gagged state.
* Return true if errors occurred while gagged.
*/
extern (C++) bool endGagging(uint oldGagged)
{
bool anyErrs = (gaggedErrors != oldGagged);
--gag;
// Restore the original state of gagged errors; set total errors
// to be original errors + new ungagged errors.
errors -= (gaggedErrors - oldGagged);
gaggedErrors = oldGagged;
return anyErrs;
}
/* Increment the error count to record that an error
* has occurred in the current context. An error message
* may or may not have been printed.
*/
extern (C++) void increaseErrorCount()
{
if (gag)
++gaggedErrors;
++errors;
}
extern (C++) void _init()
{
inifilename = null;
mars_ext = "d";
hdr_ext = "di";
doc_ext = "html";
ddoc_ext = "ddoc";
json_ext = "json";
map_ext = "map";
static if (TARGET_WINDOS)
{
obj_ext = "obj";
}
else static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS)
{
obj_ext = "o";
}
else
{
static assert(0, "fix this");
}
static if (TARGET_WINDOS)
{
lib_ext = "lib";
}
else static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS)
{
lib_ext = "a";
}
else
{
static assert(0, "fix this");
}
static if (TARGET_WINDOS)
{
dll_ext = "dll";
}
else static if (TARGET_LINUX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS)
{
dll_ext = "so";
}
else static if (TARGET_OSX)
{
dll_ext = "dylib";
}
else
{
static assert(0, "fix this");
}
static if (TARGET_WINDOS)
{
run_noext = false;
}
else static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS)
{
// Allow 'script' D source files to have no extension.
run_noext = true;
}
else
{
static assert(0, "fix this");
}
copyright = "Copyright (c) 1999-2017 by Digital Mars";
written = "written by Walter Bright";
_version = (import("VERSION") ~ '\0').ptr;
compiler.vendor = "Digital Mars D";
stdmsg = stdout;
main_d = "__main.d";
errorLimit = 20;
}
}
// Because int64_t and friends may be any integral type of the
// correct size, we have to explicitly ask for the correct
// integer type to get the correct mangling with ddmd
// Be careful not to care about sign when using dinteger_t
// use this instead of integer_t to
// avoid conflicts with system #include's
alias dinteger_t = ulong;
// Signed and unsigned variants
alias sinteger_t = long;
alias uinteger_t = ulong;
alias d_int8 = int8_t;
alias d_uns8 = uint8_t;
alias d_int16 = int16_t;
alias d_uns16 = uint16_t;
alias d_int32 = int32_t;
alias d_uns32 = uint32_t;
alias d_int64 = int64_t;
alias d_uns64 = uint64_t;
// file location
struct Loc
{
const(char)* filename;
uint linnum;
uint charnum;
extern (D) this(const(char)* filename, uint linnum, uint charnum)
{
this.linnum = linnum;
this.charnum = charnum;
this.filename = filename;
}
extern (C++) const(char)* toChars() const
{
OutBuffer buf;
if (filename)
{
buf.printf("%s", filename);
}
if (linnum)
{
buf.printf("(%d", linnum);
if (global.params.showColumns && charnum)
buf.printf(",%d", charnum);
buf.writeByte(')');
}
return buf.extractString();
}
extern (C++) bool equals(ref const(Loc) loc)
{
return (!global.params.showColumns || charnum == loc.charnum) && linnum == loc.linnum && FileName.equals(filename, loc.filename);
}
}
enum LINK : int
{
def, // default
d,
c,
cpp,
windows,
pascal,
objc,
system,
}
alias LINKdefault = LINK.def;
alias LINKd = LINK.d;
alias LINKc = LINK.c;
alias LINKcpp = LINK.cpp;
alias LINKwindows = LINK.windows;
alias LINKpascal = LINK.pascal;
alias LINKobjc = LINK.objc;
alias LINKsystem = LINK.system;
enum CPPMANGLE : int
{
def,
asStruct,
asClass,
}
alias CPPMANGLEdefault = CPPMANGLE.def;
alias CPPMANGLEstruct = CPPMANGLE.asStruct;
alias CPPMANGLEclass = CPPMANGLE.asClass;
enum MATCH : int
{
nomatch, // no match
convert, // match with conversions
constant, // match with conversion to const
exact, // exact match
}
alias MATCHnomatch = MATCH.nomatch;
alias MATCHconvert = MATCH.convert;
alias MATCHconst = MATCH.constant;
alias MATCHexact = MATCH.exact;
enum PINLINE : int
{
def, // as specified on the command line
never, // never inline
always, // always inline
}
alias PINLINEdefault = PINLINE.def;
alias PINLINEnever = PINLINE.never;
alias PINLINEalways = PINLINE.always;
alias StorageClass = uinteger_t;
extern (C++) __gshared Global global;
|
D
|
instance VLK_452_Buerger(Npc_Default)
{
name[0] = NAME_Buerger;
guild = GIL_VLK;
id = 452;
voice = 6;
flags = 0;
npcType = NPCTYPE_AMBIENT;
B_SetAttributesToChapter(self,2);
aivar[AIV_MM_RestStart] = TRUE;
level = 1;
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1h_Vlk_Sword);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_Weak_Asghan,BodyTex_N,ITAR_Vlk_H);
Mdl_SetModelFatness(self,1);
Mdl_ApplyOverlayMds(self,"Humans_Arrogance.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_452;
};
func void Rtn_Start_452()
{
TA_Smalltalk(6,5,20,15,"NW_CITY_MERCHANT_SHOP01_FRONT_03_C");
TA_Sleep(20,15,6,5,"NW_CITY_LEOMAR_BED_07");
};
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module org.eclipse.swt.graphics.Transform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.internal.gdip.Gdip;
import org.eclipse.swt.graphics.Resource;
import org.eclipse.swt.graphics.Device;
import java.lang.all;
/**
* Instances of this class represent transformation matrices for
* points expressed as (x, y) pairs of floating point numbers.
* <p>
* Application code must explicitly invoke the <code>Transform.dispose()</code>
* method to release the operating system resources managed by each instance
* when those instances are no longer required.
* </p>
* <p>
* This class requires the operating system's advanced graphics subsystem
* which may not be available on some platforms.
* </p>
*
* @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: GraphicsExample</a>
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*
* @since 3.1
*/
public class Transform : Resource {
alias Resource.init_ init_;
/**
* the OS resource for the Transform
* (Warning: This field is platform dependent)
* <p>
* <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
* public API. It is marked public only so that it can be shared
* within the packages provided by SWT. It is not available on all
* platforms and should never be accessed from application code.
* </p>
*/
public Gdip.Matrix handle;
/**
* Constructs a new identity Transform.
* <p>
* This operation requires the operating system's advanced
* graphics subsystem which may not be available on some
* platforms.
* </p>
*
* @param device the device on which to allocate the Transform
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
* </ul>
* @exception SWTError <ul>
* <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
* </ul>
*
* @see #dispose()
*/
public this (Device device) {
this(device, 1, 0, 0, 1, 0, 0);
}
/**
* Constructs a new Transform given an array of elements that represent the
* matrix that describes the transformation.
* <p>
* This operation requires the operating system's advanced
* graphics subsystem which may not be available on some
* platforms.
* </p>
*
* @param device the device on which to allocate the Transform
* @param elements an array of floats that describe the transformation matrix
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device, or the elements array is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the elements array is too small to hold the matrix values</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
* </ul>
* @exception SWTError <ul>
* <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
* </ul>
*
* @see #dispose()
*/
public this(Device device, float[] elements) {
this (device, checkTransform(elements)[0], elements[1], elements[2], elements[3], elements[4], elements[5]);
}
/**
* Constructs a new Transform given all of the elements that represent the
* matrix that describes the transformation.
* <p>
* This operation requires the operating system's advanced
* graphics subsystem which may not be available on some
* platforms.
* </p>
*
* @param device the device on which to allocate the Transform
* @param m11 the first element of the first row of the matrix
* @param m12 the second element of the first row of the matrix
* @param m21 the first element of the second row of the matrix
* @param m22 the second element of the second row of the matrix
* @param dx the third element of the first row of the matrix
* @param dy the third element of the second row of the matrix
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
* </ul>
* @exception SWTError <ul>
* <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
* </ul>
*
* @see #dispose()
*/
public this (Device device, float m11, float m12, float m21, float m22, float dx, float dy) {
super(device);
this.device.checkGDIP();
handle = Gdip.Matrix_new(m11, m12, m21, m22, dx, dy);
if (handle is null) SWT.error(SWT.ERROR_NO_HANDLES);
init_();
}
static float[] checkTransform(float[] elements) {
if (elements is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
return elements;
}
override
void destroy() {
Gdip.Matrix_delete(handle);
handle = null;
}
/**
* Fills the parameter with the values of the transformation matrix
* that the receiver represents, in the order {m11, m12, m21, m22, dx, dy}.
*
* @param elements array to hold the matrix values
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the matrix values</li>
* </ul>
*/
public void getElements(float[] elements) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (elements is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
Gdip.Matrix_GetElements(handle, elements.ptr);
}
/**
* Modifies the receiver such that the matrix it represents becomes the
* identity matrix.
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*
* @since 3.4
*/
public void identity() {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
Gdip.Matrix_SetElements(handle, 1, 0, 0, 1, 0, 0);
}
/**
* Modifies the receiver such that the matrix it represents becomes
* the mathematical inverse of the matrix it previously represented.
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_CANNOT_INVERT_MATRIX - if the matrix is not invertible</li>
* </ul>
*/
public void invert() {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (Gdip.Matrix_Invert(handle) !is 0) SWT.error(SWT.ERROR_CANNOT_INVERT_MATRIX);
}
/**
* Returns <code>true</code> if the Transform has been disposed,
* and <code>false</code> otherwise.
* <p>
* This method gets the dispose state for the Transform.
* When a Transform has been disposed, it is an error to
* invoke any other method using the Transform.
*
* @return <code>true</code> when the Transform is disposed, and <code>false</code> otherwise
*/
override public bool isDisposed() {
return handle is null;
}
/**
* Returns <code>true</code> if the Transform represents the identity matrix
* and false otherwise.
*
* @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise
*/
public bool isIdentity() {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
return cast(bool) Gdip.Matrix_IsIdentity(handle);
}
/**
* Modifies the receiver such that the matrix it represents becomes the
* the result of multiplying the matrix it previously represented by the
* argument.
*
* @param matrix the matrix to multiply the receiver by
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
* </ul>
*/
public void multiply(Transform matrix) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (matrix is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (matrix.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
Gdip.Matrix_Multiply(handle, matrix.handle, Gdip.MatrixOrderPrepend);
}
/**
* Modifies the receiver so that it represents a transformation that is
* equivalent to its previous transformation rotated by the specified angle.
* The angle is specified in degrees and for the identity transform 0 degrees
* is at the 3 o'clock position. A positive value indicates a clockwise rotation
* while a negative value indicates a counter-clockwise rotation.
*
* @param angle the angle to rotate the transformation by
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void rotate(float angle) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
Gdip.Matrix_Rotate(handle, angle, Gdip.MatrixOrderPrepend);
}
/**
* Modifies the receiver so that it represents a transformation that is
* equivalent to its previous transformation scaled by (scaleX, scaleY).
*
* @param scaleX the amount to scale in the X direction
* @param scaleY the amount to scale in the Y direction
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void scale(float scaleX, float scaleY) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
Gdip.Matrix_Scale(handle, scaleX, scaleY, Gdip.MatrixOrderPrepend);
}
/**
* Modifies the receiver to represent a new transformation given all of
* the elements that represent the matrix that describes that transformation.
*
* @param m11 the first element of the first row of the matrix
* @param m12 the second element of the first row of the matrix
* @param m21 the first element of the second row of the matrix
* @param m22 the second element of the second row of the matrix
* @param dx the third element of the first row of the matrix
* @param dy the third element of the second row of the matrix
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void setElements(float m11, float m12, float m21, float m22, float dx, float dy) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
Gdip.Matrix_SetElements(handle, m11, m12, m21, m22, dx, dy);
}
/**
* Modifies the receiver so that it represents a transformation that is
* equivalent to its previous transformation sheared by (shearX, shearY).
*
* @param shearX the shear factor in the X direction
* @param shearY the shear factor in the Y direction
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*
* @since 3.4
*/
public void shear(float shearX, float shearY) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
Gdip.Matrix_Shear(handle, shearX, shearY, Gdip.MatrixOrderPrepend);
}
/**
* Given an array containing points described by alternating x and y values,
* modify that array such that each point has been replaced with the result of
* applying the transformation represented by the receiver to that point.
*
* @param pointArray an array of alternating x and y values to be transformed
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the point array is null</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void transform(float[] pointArray) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (pointArray is null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
Gdip.Matrix_TransformPoints(handle, cast(Gdip.PointF*)pointArray.ptr, cast(int) (pointArray.length / 2));
}
/**
* Modifies the receiver so that it represents a transformation that is
* equivalent to its previous transformation translated by (offsetX, offsetY).
*
* @param offsetX the distance to translate in the X direction
* @param offsetY the distance to translate in the Y direction
*
* @exception SWTException <ul>
* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
* </ul>
*/
public void translate(float offsetX, float offsetY) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
Gdip.Matrix_Translate(handle, offsetX, offsetY, Gdip.MatrixOrderPrepend);
}
/**
* Returns a string containing a concise, human-readable
* description of the receiver.
*
* @return a string representation of the receiver
*/
override public String toString() {
if (isDisposed()) return "Transform {*DISPOSED*}";
float[6] elements;
getElements(elements);
return Format("Transform {{{},{},{},{},{}}", elements [0], elements [1], elements [2], elements [3], elements [4], elements [5] );
}
}
|
D
|
struct sha512_ctx
{
uint64_t [8]state;
uint64_t count_low;
uint64_t count_high;
uint8_t [128]block;
uint index;
}
|
D
|
/Users/mu/Hello/.build/x86_64-apple-macosx/debug/TemplateKit.build/Data/TemplateData.swift.o : /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mu/Hello/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mu/Hello/.build/x86_64-apple-macosx/debug/TemplateKit.build/Data/TemplateData~partial.swiftmodule : /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mu/Hello/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mu/Hello/.build/x86_64-apple-macosx/debug/TemplateKit.build/Data/TemplateData~partial.swiftdoc : /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/mu/Hello/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/mu/Hello/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/mu/Hello/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/mu/Hello/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/mu/Hello/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module artemisd.entityobserver;
import artemisd.entity;
interface EntityObserver {
void added(Entity e);
void changed(Entity e);
void deleted(Entity e);
void enabled(Entity e);
void disabled(Entity e);
}
|
D
|
/**
* Handles the creation and life cycle of UI objects and webview textures
*/
module dash.components.userinterface;
import dash.core;
import dash.utility.awesomium, dash.components, dash.utility, dash.graphics.graphics;
import std.string, gl3n.linalg;
/**
* User interface objects handle drawing/updating an AwesomiumView over the screen
*/
class UserInterface
{
private:
uint _height;
uint _width;
mat4 _scaleMat;
AwesomiumView _view;
// TODO: Handle JS
public:
/// WebView to be drawn
mixin( Property!(_view, AccessModifier.Public) );
/// Scale of the UI
mixin( Property!(_scaleMat, AccessModifier.Public) );
/**
* Create UI object
*
* Params:
* w = Width (in pixels) of UI
* h = Height (in pixels) of UI
* filePath = Absolute file path to UI file
*/
this( uint w, uint h, string filePath )
{
_scaleMat = mat4.identity;
_scaleMat[0][0] = cast(float)w/2.0f;
_scaleMat[1][1] = cast(float)h/2.0f;
_height = h;
_width = w;
version(Windows)
{
_view = new AwesomiumView( w, h, filePath, null );
}
logDebug( "UI File: ", filePath );
}
/**
* Update UI view
*/
void update()
{
/// TODO: Check for mouse & keyboard input
version(Windows)
{
// Send mouse pos to awesomium
auto mousePos = Input.mousePos();
awe_webview_inject_mouse_move( _view.webView, cast(int)mousePos.x,cast(int)( Graphics.height - mousePos.y ) );
_view.update();
}
}
/**
* Draw UI view
*/
void draw()
{
Graphics.addUI( this );
}
/**
* Cleanup UI memory
*/
void shutdown()
{
version(Windows)
// Try to clean up gl buffers
_view.shutdown();
// Clean up mesh, material, and view
}
/*
* Call a JS Function on this UI
*
* Params:
* funcName = Name of the function to call
* args = Array of integer args to send to the function
* object = Name of the js object containing the function. Blank for global function.
*/
void callJSFunction( string funcName, int[] args, string object = "" )
{
version(Windows)
{
// Convert params to awe_js objects
awe_string* funcStr = awe_string_create_from_ascii( funcName.toStringz(), funcName.length );
awe_string* objectStr = awe_string_create_from_ascii( object.toStringz(), object.length );
awe_string* frameStr = awe_string_create_from_ascii( "".toStringz(), 1 );
// Build array of js ints
awe_jsvalue*[] jsArgs = new awe_jsvalue*[ args.length ];
for( int i = 0; i < args.length; i++ )
{
jsArgs[i] = awe_jsvalue_create_integer_value( args[i] );
}
awe_jsarray* argArr = awe_jsarray_create( jsArgs.ptr, args.length );
// Execute call
awe_webview_call_javascript_function( _view.webView, objectStr, funcStr, argArr, frameStr );
// Clean up js objects
for( int i = 0; i < args.length; i++ )
{
awe_jsvalue_destroy( jsArgs[i] );
}
awe_jsarray_destroy( argArr );
}
}
/**
* Initializes Awesomium singleton
*/
static void initializeAwesomium()
{
version( Windows )
{
// Webcore setup
awe_webcore_initialize_default();
string baseDir = Resources.UI;
awe_string* aweBaseDir = awe_string_create_from_ascii( baseDir.toStringz(), baseDir.length );
awe_webcore_set_base_directory( aweBaseDir );
awe_string_destroy( aweBaseDir );
}
}
/**
* Updates Awesomium singleton
*/
static void updateAwesomium()
{
version( Windows )
awe_webcore_update();
}
/**
* Shutdowns Awesomium singleton
*/
static void shutdownAwesomium()
{
version( Windows )
awe_webcore_shutdown();
}
}
/**
* Creates an Awesomium web view texture
*/
class AwesomiumView : Texture
{
private:
version( Windows )
awe_webview* webView;
ubyte[] glBuffer;
public:
this( uint w, uint h, string filePath, GameObject owner, bool localFilePath = true )
{
_width = w;
_height = h;
glBuffer = new ubyte[_width*_height*4];
this.owner = owner;
super( cast(ubyte*)null );
version( Windows )
{
webView = awe_webcore_create_webview( _width, _height, false );
webView.awe_webview_set_transparent( true );
awe_string* urlString = awe_string_create_from_ascii( filePath.toStringz(), filePath.length );
if ( localFilePath )
webView.awe_webview_load_file( urlString,
awe_string_empty());
else
webView.awe_webview_load_url( urlString,
awe_string_empty(),
awe_string_empty(),
awe_string_empty());
// Wait for WebView to finish loading the page
// JK DON'T
//while(awe_webview_is_loading_page(cast(awe_webview*)webView))
//awe_webcore_update();
// Destroy our URL string
urlString.awe_string_destroy();
}
}
override void update()
{
// No webview? No update.
version( Windows )
if ( webView && webView.awe_webview_is_dirty() )
{
const(awe_renderbuffer)* buffer = webView.awe_webview_render();
// Ensure the buffer exists
if ( buffer !is null ) {
buffer.awe_renderbuffer_copy_to( glBuffer.ptr, awe_renderbuffer_get_rowspan( buffer ), 4, false, true );
updateBuffer( glBuffer.ptr );
}
}
}
override void shutdown()
{
destroy( glBuffer );
version( Windows )
webView.awe_webview_destroy();
}
}
|
D
|
/**********************************************************************************
БЕЛИАР
Молиться только ночью.
Молитва: макс. здоровья или маны => золото.
Mod:
Коготь Белиара удален.
Если Белиар покровитель, можно призвать демона или нежить за ману и здоровье.
Если Иннос покровитель, он будет наказывать.
//*********************************************************************************/
var int PrayIdolDay;
var int RecievedMoney;
var int GivenHitpoints;
var int GivenMana;
const int BeliarsDispo = 10000;
func void B_HitpointAngleich(var int BeliarsCost)
{
var int CurrentHitpoints;
GivenHitpoints = GivenHitpoints + BeliarsCost;
hero.attribute[ATR_HITPOINTS_MAX] = hero.attribute[ATR_HITPOINTS_MAX] - BeliarsCost;
hero.aivar[REAL_HITPOINTS_MAX] = hero.aivar[REAL_HITPOINTS_MAX] - BeliarsCost;
CurrentHitpoints = hero.attribute[ATR_HITPOINTS] - BeliarsCost;
if(CurrentHitpoints < 2)
{
CurrentHitpoints = 2;
};
hero.attribute[ATR_HITPOINTS] = CurrentHitpoints;
};
func void B_ManaAngleich(var int BeliarsCost)
{
var int CurrentMana;
GivenMana = GivenMana + BeliarsCost;
hero.attribute[ATR_MANA_MAX] = hero.attribute[ATR_MANA_MAX] - BeliarsCost;
hero.aivar[REAL_MANA_MAX] = hero.aivar[REAL_MANA_MAX] - BeliarsCost;
CurrentMana = hero.attribute[ATR_MANA] - BeliarsCost;
if(CurrentMana < 0)
{
CurrentMana = 0;
};
hero.attribute[ATR_MANA] = CurrentMana;
};
// Белиар наказывает ГГ
func void B_BlitzInArsch()
{
var string concatText1;
var string concatText2;
// на 1/5 здоровья
var int CurrentHitpoints; CurrentHitpoints = hero.attribute[ATR_HITPOINTS];
var int BlitzInArsch_Hitpoints; BlitzInArsch_Hitpoints = (CurrentHitpoints * 4) / 5;
if(BlitzInArsch_Hitpoints < 2) {
BlitzInArsch_Hitpoints = 2;
};
//сколько осталось?
var int Abzug; Abzug = hero.attribute[ATR_HITPOINTS] - BlitzInArsch_Hitpoints;
if(Abzug > 0)
{
concatText1 = ConcatStrings(" ",NAME_Damage);
concatText2 = ConcatStrings(IntToString(Abzug),concatText1);
AI_PrintScreen(concatText2,-1,YPOS_ItemTaken,FONT_ScreenSmall,2);
Wld_PlayEffect("spellFX_BELIARSRAGE",hero,hero,0,0,0,FALSE);
};
hero.attribute[ATR_HITPOINTS] = BlitzInArsch_Hitpoints;
};
//дает золотишко
func void B_GetBeliarsGold(var int Kohle)
{
var string concatText1;
var string concatText2;
RecievedMoney = RecievedMoney + Kohle;
if(RecievedMoney > BeliarsDispo)
{
Kohle = 100;
};
CreateInvItems(hero,ItMi_Gold,Kohle);
concatText1 = ConcatStrings(IntToString(Kohle)," ");
concatText2 = ConcatStrings(concatText1,PRINT_GoldErhalten);
AI_PrintScreen(concatText2,-1,YPOS_ItemTaken,FONT_ScreenSmall,2);
};
//==================================================
instance PC_PrayIdol_End(C_Info)
{
npc = PC_Hero;
nr = 999;
condition = PC_PrayIdol_End_Condition;
information = PC_PrayIdol_End_Info;
permanent = TRUE;
description = Dialog_Ende;
};
func int PC_PrayIdol_End_Condition()
{
if(PLAYER_MOBSI_PRODUCTION == MOBSI_PRAYIDOL)
{
return TRUE;
};
};
func void PC_PrayIdol_End_Info()
{
b_endproductiondialog();
};
//==================================================
instance PC_PrayIdol_PrayIdol(C_Info)
{
npc = PC_Hero;
nr = 2;
condition = PC_PrayIdol_PrayIdol_Condition;
information = PC_PrayIdol_PrayIdol_Info;
permanent = TRUE;
description = NAME_ADDON_BETEN;
};
func int PC_PrayIdol_PrayIdol_Condition()
{
if(PLAYER_MOBSI_PRODUCTION == MOBSI_PRAYIDOL)
{
return TRUE;
};
};
func void PC_PrayIdol_PrayIdol_Info()
{
//Покровитель - Иннос
if (PATRONGOD == PATRONGOD_Innos) {
PrintScreen(PRINT_GOD_Innos_Rage, -1, 55, FONT_Screen, 3);
if (self.attribute[ATR_HITPOINTS] > 1) {
self.attribute[ATR_HITPOINTS] = self.attribute[ATR_HITPOINTS] / 2;
};
};
Info_ClearChoices(PC_PrayIdol_PrayIdol);
Info_AddChoice(PC_PrayIdol_PrayIdol,Dialog_Back,PC_PrayIdol_PrayIdol_Back);
Info_AddChoice(PC_PrayIdol_PrayIdol,NAME_ADDON_PRAYIDOL_GIVENOTHING,PC_PrayIdol_PrayIdol_NoPay);
if(GivenHitpoints <= 50)
{
if(hero.attribute[ATR_HITPOINTS_MAX] >= 40)
{
Info_AddChoice(PC_PrayIdol_PrayIdol,NAME_ADDON_PRAYIDOL_GIVEHITPOINT1,PC_PrayIdol_PrayIdol_SmallPay);
};
if(hero.attribute[ATR_HITPOINTS_MAX] >= 50)
{
Info_AddChoice(PC_PrayIdol_PrayIdol,NAME_ADDON_PRAYIDOL_GIVEHITPOINT2,PC_PrayIdol_PrayIdol_MediumPay);
};
if(hero.attribute[ATR_HITPOINTS_MAX] >= 60)
{
Info_AddChoice(PC_PrayIdol_PrayIdol,NAME_ADDON_PRAYIDOL_GIVEHITPOINT3,PC_PrayIdol_PrayIdol_BigPay);
};
};
if(GivenMana <= 10)
{
if(hero.attribute[ATR_MANA_MAX] > 10)
{
Info_AddChoice(PC_PrayIdol_PrayIdol,NAME_ADDON_PRAYIDOL_GIVEMANA,PC_PrayIdol_PrayIdol_ManaPay);
};
};
};
func void PC_PrayIdol_PrayIdol_Back()
{
Info_ClearChoices(PC_PrayIdol_PrayIdol);
};
func void PC_PrayIdol_PrayIdol_NoPay()
{
PrayCounter_Beliar += 1;
B_BlitzInArsch();
Info_ClearChoices(PC_PrayIdol_PrayIdol);
};
func void PC_PrayIdol_PrayIdol_Pay(var int GoldValue)
{
PrayCounter_Beliar += 1;
if((PrayIdolDay >= Wld_GetDay()) || (RecievedMoney >= BeliarsDispo))
{
B_BlitzInArsch();
}
else if((hero.guild == GIL_PAL) || (hero.guild == GIL_KDF))
{
B_GetBeliarsGold(GoldValue / 2);
}
else
{
B_GetBeliarsGold(GoldValue);
};
PrayIdolDay = Wld_GetDay() + 1;
Info_ClearChoices(PC_PrayIdol_PrayIdol);
};
func void PC_PrayIdol_PrayIdol_SmallPay()
{
B_HitpointAngleich(1);
PC_PrayIdol_PrayIdol_Pay(50);
};
func void PC_PrayIdol_PrayIdol_MediumPay()
{
B_HitpointAngleich(2);
PC_PrayIdol_PrayIdol_Pay(250);
};
func void PC_PrayIdol_PrayIdol_BigPay()
{
B_HitpointAngleich(3);
PC_PrayIdol_PrayIdol_Pay(500);
};
func void PC_PrayIdol_PrayIdol_ManaPay()
{
B_ManaAngleich(1);
PC_PrayIdol_PrayIdol_Pay(500);
};
// ПРИЗЫВ ==================================================
instance PC_PrayIdol_Summon(C_Info)
{
npc = PC_Hero;
nr = 3;
condition = PC_PrayIdol_Summon_Condition;
information = PC_PrayIdol_Summon_Info;
permanent = TRUE;
description = NAME_Summon;
};
func int PC_PrayIdol_Summon_Condition()
{
//только для слуг Белиара!
if((PLAYER_MOBSI_PRODUCTION == MOBSI_PRAYIDOL) && (PATRONGOD == PATRONGOD_Beliar))
{
return TRUE;
};
};
//строка - кого и почем призываем (мана + здоровье)
func string PC_PrayIdol_Summon_Text(var string name, var int Mana_Costen, var int HP_Costen)
{
var string result;
result = ConcatStrings(name, " (");
result = ConcatStrings(result, IntToString(Mana_Costen));
result = ConcatStrings(result, PRINT_Mana_Costen);
result = ConcatStrings(result, ", ");
result = ConcatStrings(result, IntToString(HP_Costen));
result = ConcatStrings(result, PRINT_HP_Costen);
result = ConcatStrings(result, ")");
return result;
};
func void PC_PrayIdol_Summon_Info()
{
Info_ClearChoices(PC_PrayIdol_Summon);
Info_AddChoice(PC_PrayIdol_Summon,Dialog_Back,PC_PrayIdol_Summon_Back);
Info_AddChoice(PC_PrayIdol_Summon,PC_PrayIdol_Summon_Text(NAME_Summon_Demon,SPL_Cost_SummonDemon / 4, SPL_Cost_SummonDemon),PC_PrayIdol_Summon_Demon);
Info_AddChoice(PC_PrayIdol_Summon,PC_PrayIdol_Summon_Text(NAME_Summon_Zombie,SPL_Cost_SummonZombie / 4, SPL_Cost_SummonZombie),PC_PrayIdol_Summon_Zombie);
Info_AddChoice(PC_PrayIdol_Summon,PC_PrayIdol_Summon_Text(NAME_Summon_Skeleton,SPL_Cost_SummonSkeleton / 4, SPL_Cost_SummonSkeleton),PC_PrayIdol_Summon_Skeleton);
Info_AddChoice(PC_PrayIdol_Summon,PC_PrayIdol_Summon_Text(NAME_Summon_GobboSkeleton,SPL_Cost_SummonGoblinSkeleton / 4, SPL_Cost_SummonGoblinSkeleton),PC_PrayIdol_Summon_GobboSkeleton);
};
//кого призываем?
func void PC_PrayIdol_Summon_Back()
{
Info_ClearChoices(PC_PrayIdol_Summon);
};
func void PC_PrayIdol_Summon_Demon()
{
PrayCounter_Beliar += 1;
Info_ClearChoices(PC_PrayIdol_Summon);
if (self.attribute[ATR_MANA] < SPL_Cost_SummonDemon / 4) {
PrintScreen(PRINT_NotEnoughMana,-1,-1,FONT_ScreenSmall,2);
}
else if (self.attribute[ATR_HITPOINTS] < SPL_Cost_SummonDemon) {
PrintScreen(PRINT_NotEnoughHP,-1,-1,FONT_ScreenSmall,2);
}
else {
PrintScreen(PRINT_GOD_Beliar_Support,-1,-1,FONT_Screen,2);
self.attribute[ATR_MANA] -= SPL_Cost_SummonDemon / 4;
self.attribute[ATR_HITPOINTS] -= SPL_Cost_SummonDemon;
Wld_InsertNpc(Summoned_Demon,Npc_GetNearestWP(self));
//Wld_SpawnNpcRange(self,Summoned_Demon,1,-1);
self.aivar[AIV_SummonedTime] = 5 * MONSTER_SUMMON_TIME; //живет дольше, чем из свитка
b_endproductiondialog();
};
};
func void PC_PrayIdol_Summon_Zombie()
{
PrayCounter_Beliar += 1;
if (self.attribute[ATR_MANA] < SPL_Cost_SummonZombie / 4) {
PrintScreen(PRINT_NotEnoughMana,-1,-1,FONT_ScreenSmall,2);
}
else if (self.attribute[ATR_HITPOINTS] < SPL_Cost_SummonZombie) {
PrintScreen(PRINT_NotEnoughHP,-1,-1,FONT_ScreenSmall,2);
}
else {
PrintScreen(PRINT_GOD_Beliar_Support,-1,-1,FONT_Screen,2);
self.attribute[ATR_MANA] -= SPL_Cost_SummonZombie / 4;
self.attribute[ATR_HITPOINTS] -= SPL_Cost_SummonZombie;
Wld_InsertNpc(Summoned_ZOMBIE,Npc_GetNearestWP(self));
self.aivar[AIV_SummonedTime] = 5 * MONSTER_SUMMON_TIME; //живет дольше, чем из свитка
//Wld_SpawnNpcRange(self,Summoned_ZOMBIE,1,500);
};
Info_ClearChoices(PC_PrayIdol_Summon);
};
func void PC_PrayIdol_Summon_Skeleton()
{
PrayCounter_Beliar += 1;
if (self.attribute[ATR_MANA] < SPL_Cost_SummonSkeleton / 4) {
PrintScreen(PRINT_NotEnoughMana,-1,-1,FONT_ScreenSmall,2);
}
else if (self.attribute[ATR_HITPOINTS] < SPL_Cost_SummonSkeleton) {
PrintScreen(PRINT_NotEnoughHP,-1,-1,FONT_ScreenSmall,2);
}
else {
PrintScreen(PRINT_GOD_Beliar_Support,-1,-1,FONT_Screen,2);
self.attribute[ATR_MANA] -= SPL_Cost_SummonSkeleton / 4;
self.attribute[ATR_HITPOINTS] -= SPL_Cost_SummonSkeleton;
Wld_InsertNpc(Summoned_Skeleton,Npc_GetNearestWP(self));
self.aivar[AIV_SummonedTime] = 5 * MONSTER_SUMMON_TIME; //живет дольше, чем из свитка
//Wld_SpawnNpcRange(self,Summoned_Skeleton,1,500);
};
Info_ClearChoices(PC_PrayIdol_Summon);
};
func void PC_PrayIdol_Summon_GobboSkeleton()
{
PrayCounter_Beliar += 1;
if (self.attribute[ATR_MANA] < SPL_Cost_SummonGoblinSkeleton / 4) {
PrintScreen(PRINT_NotEnoughMana,-1,-1,FONT_ScreenSmall,2);
}
else if (self.attribute[ATR_HITPOINTS] < SPL_Cost_SummonGoblinSkeleton) {
PrintScreen(PRINT_NotEnoughHP,-1,-1,FONT_ScreenSmall,2);
}
else {
PrintScreen(PRINT_GOD_Beliar_Support,-1,-1,FONT_Screen,2);
self.attribute[ATR_MANA] -= SPL_Cost_SummonGoblinSkeleton / 4;
self.attribute[ATR_HITPOINTS] -= SPL_Cost_SummonGoblinSkeleton;
Wld_InsertNpc(Summoned_Gobbo_Skeleton,Npc_GetNearestWP(self));
self.aivar[AIV_SummonedTime] = 5 * MONSTER_SUMMON_TIME; //живет дольше, чем из свитка
//Wld_SpawnNpcRange(self,Summoned_Gobbo_Skeleton,1,500);
};
Info_ClearChoices(PC_PrayIdol_Summon);
};
// ---------------------------------------
instance PC_PrayIdol_PrayBerny(C_Info)
{
npc = PC_Hero;
nr = 1;
condition = PC_PrayIdol_PrayBerny_Condition;
information = PC_PrayIdol_PrayBerny_Info;
description = "Помолиться за упокой души Берни.";
permanent = TRUE;
};
func int PC_PrayIdol_PrayBerny_Condition()
{
if ((PLAYER_MOBSI_PRODUCTION == MOBSI_PRAYIDOL) && MIS_Sarah_OldFriends_BernyPray)
{
return TRUE;
};
};
func void PC_PrayIdol_PrayBerny_Info()
{
Info_ClearChoices(PC_PrayIdol_PrayBerny);
Info_AddChoice(PC_PrayIdol_PrayBerny,Dialog_Back,PC_PrayIdol_PrayBerny_Back);
if(Npc_HasItems(hero,ItMi_Gold) >= 50)
{
Info_AddChoice(PC_PrayIdol_PrayBerny,"Пожертвовать 100 золотых монет.",PC_PrayIdol_PrayBerny_SmallPay);
};
if(Npc_HasItems(hero,ItMi_Gold) >= 200)
{
Info_AddChoice(PC_PrayIdol_PrayBerny,"Пожертвовать 200 золотых монет.",PC_PrayIdol_PrayBerny_MediumPay);
};
if(Npc_HasItems(hero,ItMi_Gold) >= 500)
{
Info_AddChoice(PC_PrayIdol_PrayBerny,"Пожертвовать 500 золотых монет.",PC_PrayIdol_PrayBerny_BigPay);
};
};
func void PC_PrayIdol_PrayBerny_Back()
{
Info_ClearChoices(PC_PrayIdol_PrayBerny);
};
func void PC_PrayIdol_PrayBerny_Pay(var int pay)
{
PrayCounter_Beliar += 1;
PrintScreen("Белиар внимает твоим мольбам.",-1,-1,FONT_Screen,2);
Npc_RemoveInvItems(hero,ItMi_Gold,pay);
Info_ClearChoices(PC_PrayIdol_PrayBerny);
MIS_Sarah_OldFriends_BernyPray = FALSE;
};
func void PC_PrayIdol_PrayBerny_SmallPay()
{
PC_PrayIdol_PrayBerny_Pay(100);
B_LogEntry_Sarah_OldFriends(TOPIC_Sarah_OldFriends_BernyPrayBeliar);
};
func void PC_PrayIdol_PrayBerny_MediumPay()
{
PC_PrayIdol_PrayBerny_Pay(200);
B_LogEntry_Sarah_OldFriends(TOPIC_Sarah_OldFriends_BernyPrayBeliar);
};
func void PC_PrayIdol_PrayBerny_BigPay()
{
PC_PrayIdol_PrayBerny_Pay(500);
Wld_InsertNpc(OUT_1214_OldBerny,Npc_GetNearestWP(hero));
b_endproductiondialog();
};
// ---------------------------------------
instance PC_PrayIdol_BlessHeart(C_Info)
{
npc = PC_Hero; nr = 11;
condition = PC_PrayIdol_BlessHeart_Condition;
information = PC_PrayIdol_BlessHeart_Info;
description = "Благословить гриб-сердце.";
permanent = TRUE;
};
func int PC_PrayIdol_BlessHeart_Condition()
{
if ((PLAYER_MOBSI_PRODUCTION == MOBSI_PrayShrine) && Npc_HasItems(hero,ItMr_Heart) && (PATRONGOD == PATRONGOD_Beliar))
{
return TRUE;
};
};
func void PC_PrayIdol_BlessHeart_Info()
{
PrayCounter_Beliar += 1;
PrintScreen("Белиар наполняет силой этот сосуд",-1,-1,FONT_Screen,2);
PrintScreen("Получен благословленный гриб-сердце",-1,YPOS_ItemGiven,FONT_ScreenSmall,2);
Npc_RemoveInvItem(hero,ItMr_Heart);
CreateInvItem(hero,ItMr_Heart_Blessed);
};
// ============================================
func void PrayIdol_S1()
{
if(Npc_IsPlayer(self))
{
//Иннос гневается
if(PATRONGOD == PATRONGOD_Innos)
{
AI_PrintScreen(PRINT_GOD_Innos_Rage,-1,YPOS_ItemTaken,FONT_ScreenSmall,2);
Wld_PlayEffect("SPELLFX_PYROKINESIS",self,self,0,0,0,FALSE);
Wld_PlayEffect("SPELLFX_PYROKINESIS_SPREAD",self,self,0,0,0,FALSE);
};
PC_PrayIdol_End.npc = Hlp_GetInstanceID(self);
PC_PrayIdol_PrayIdol.npc = Hlp_GetInstanceID(self);
PC_PrayIdol_Summon.npc = Hlp_GetInstanceID(self);
PC_PrayIdol_PrayBerny.npc = Hlp_GetInstanceID(self);
Wld_PlayEffect("DEMENTOR_FX",self,self,0,0,0,FALSE);
self.aivar[AIV_INVINCIBLE] = TRUE;
PLAYER_MOBSI_PRODUCTION = MOBSI_PRAYIDOL;
AI_ProcessInfos(self);
};
};
|
D
|
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/SQLIdentifier.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/SQLIdentifier~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/SQLIdentifier~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/SQLIdentifier~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/PostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentPostgreSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Redis.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
instance NOV_610_Novize(Npc_Default)
{
name[0] = NAME_Novize;
guild = GIL_NOV;
id = 610;
voice = 8;
flags = 0;
npcType = NPCTYPE_AMBIENT;
B_SetAttributesToChapter(self,2);
aivar[AIV_MM_RestStart] = TRUE;
fight_tactic = FAI_HUMAN_COWARD;
EquipItem(self,ItMw_1h_Nov_Mace);
B_CreateAmbientInv(self);
B_SetNpcVisual(self,MALE,"Hum_Head_Bald",Face_N_Normal04,BodyTex_N,ItAr_NOV_L);
Mdl_SetModelFatness(self,0);
Mdl_ApplyOverlayMds(self,"Humans_Mage.mds");
B_GiveNpcTalents(self);
B_SetFightSkills(self,30);
daily_routine = Rtn_Start_610;
};
func void Rtn_Start_610()
{
TA_Pick_FP(8,0,13,0,"NW_MONASTERY_HERB_03");
TA_Pray_Innos_FP(13,0,14,0,"NW_MONASTERY_CHURCH_03");
TA_Pick_FP(14,0,22,50,"NW_MONASTERY_HERB_03");
TA_Sleep(22,50,8,0,"NW_MONASTERY_NOVICE04_06");
};
|
D
|
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Console.build/Activity/ProgressBar.swift.o : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Console.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Console.build/Activity/ProgressBar~partial.swiftmodule : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Console.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Console.build/Activity/ProgressBar~partial.swiftdoc : /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Terminal/ANSI.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Deprecated.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Console.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleStyle.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Choose.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorState.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Ask.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Terminal/Terminal.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/Console+Ephemeral.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Confirm.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/LoadingBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ProgressBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityBar.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/Console+Clear.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Clear/ConsoleClear.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleLogger.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicatorRenderer.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Center.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleColor.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/ConsoleError.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/ActivityIndicator.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Utilities/Exports.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Wait.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleTextFragment.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Input/Console+Input.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/Console+Output.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Output/ConsoleText.swift /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/console/Sources/Console/Activity/CustomActivity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/nathanwhite/Desktop/vaporserver/simpleVapor/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
module dalet.binary;
import std.stdio;
import math;
int[] binaryAdd( int[] arr1, int[] arr2 ) {
int len1 = arr1.length;
int len2 = arr2.length;
writeln( max( [ len1, len2 ] ) );
return arr1;
}
int main() {
int[] array1 = [ 1, 0, 1, 0 ];
int[] array2 = [ 0, 1, 1 ];
binaryAdd( array1, array2 );
return 0;
}
|
D
|
/**
* Defines the static Output class, which handles all output to the console window.
*/
module utility.output;
import utility.config;
import std.stdio, std.functional;
/**
* The types of output.
*/
enum OutputType
{
/// Info for developers.
Debug,
/// Purely informational.
Info,
/// Something went wrong, but it's recoverable.
Warning,
/// The ship is sinking.
Error,
}
/**
* The levels of output available.
*/
enum Verbosity
{
/// Show me everything++.
Debug,
/// Show me everything.
High,
/// Show me things that shouldn't have happened.
Medium,
/// I only care about things gone horribly wrong.
Low,
/// I like to live on the edge.
Off,
}
/// Alias for Output.printMessage
void log( A... )( OutputType type, A messages ) { Output.log( type, messages ); }
alias logInfo = curry!( log, OutputType.Info );
alias logWarning = curry!( log, OutputType.Warning );
alias logError = curry!( log, OutputType.Error );
alias logDebug = curry!( log, OutputType.Debug );
/**
* Benchmark the running of a function, and log the result to the debug buffer.
*
* Params:
* func = The function to benchmark
* name = The name to print in the log
*/
void bench( alias func )( lazy string name )
{
import std.datetime, core.time;
logDebug( name, " time:\t\t\t", cast(Duration)benchmark!func( 1 ) );
}
shared OutputManager Output;
shared static this()
{
Output = new shared OutputManager;
}
/**
* Static class for handling interactions with the console.
*/
shared final class OutputManager
{
public:
/**
* Initialize the controller.
*/
final void initialize()
{
verbosity = Config.get!Verbosity( "Game.Verbosity" );
}
/**
* Print a message to the console.
*/
synchronized final void log( A... )( OutputType type, A messages ) if( A.length > 0 )
{
if( shouldPrint( type ) )
{
write( getHeader( type ) );
foreach( msg; messages )
write( msg );
writeln();
}
}
private:
/**
* Caches the verbosity set in the config.
*/
Verbosity verbosity;
this() { }
/**
* Gets the header for the given output type.
*/
final string getHeader( OutputType type )
{
final switch( type ) with( OutputType )
{
case Info:
//SetConsoleTextAttribute( hConsole, 15 );
return "[INFO] ";
case Warning:
//SetConsoleTextAttribute( hConsole, 14 );
return "[WARNING] ";
case Error:
//SetConsoleTextAttribute( hConsole, 12 );
return "[ERROR] ";
case Debug:
return "[DEBUG] ";
}
}
/**
* TODO
*/
final bool shouldPrint( OutputType type )
{
return type >= verbosity;
}
}
|
D
|
/Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/RatingControl.o : /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
/Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/RatingControl~partial.swiftmodule : /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
/Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Intermediates/FoodTracker.build/Debug-iphonesimulator/FoodTracker.build/Objects-normal/x86_64/RatingControl~partial.swiftdoc : /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/DateManager.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/listViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/Meal.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/imageViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/imageCollectionViewCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/RatingControl.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/AppDelegate.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealTableViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/MealTableViewCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/calendarViewController.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/FoodTracker/CalendarCell.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Diary+CoreDataProperties.swift /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Diary+CoreDataClass.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Photos.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/AVFoundation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreLocation.swiftmodule /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/os.swiftmodule /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/FontAwesome_swift.swiftmodule/x86_64.swiftmodule /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome_swift-Swift.h /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Headers/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/cafeDaiay-b1b70009d201388525eea8414f389516ed31bc4a/FoodTracker/Build/Intermediates/IBDesignables/Products/Debug-iphonesimulator/FontAwesome.swift/FontAwesome_swift.framework/Modules/module.modulemap
|
D
|
a person skilled in a particular type of therapy
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range;
void get(Args...)(ref Args args)
{
import std.traits, std.meta, std.typecons;
static if (Args.length == 1) {
alias Arg = Args[0];
static if (isArray!Arg) {
static if (isSomeChar!(ElementType!Arg)) {
args[0] = readln.chomp.to!Arg;
} else {
args[0] = readln.split.to!Arg;
}
} else static if (isTuple!Arg) {
auto input = readln.split;
static foreach (i; 0..Fields!Arg.length) {
args[0][i] = input[i].to!(Fields!Arg[i]);
}
} else {
args[0] = readln.chomp.to!Arg;
}
} else {
auto input = readln.split;
assert(input.length == Args.length);
static foreach (i; 0..Args.length) {
args[i] = input[i].to!(Args[i]);
}
}
}
void get_lines(Args...)(size_t N, ref Args args)
{
import std.traits, std.range;
static foreach (i; 0..Args.length) {
static assert(isArray!(Args[i]));
args[i].length = N;
}
foreach (i; 0..N) {
static if (Args.length == 1) {
get(args[0][i]);
} else {
auto input = readln.split;
static foreach (j; 0..Args.length) {
args[j][i] = input[j].to!(ElementType!(Args[j]));
}
}
}
}
alias P = Tuple!(int, "l", int, "r");
void main()
{
int N; get(N);
P[] ps; get_lines(N, ps);
auto rbt = redBlackTree!("a.r < b.r", true)(ps.dup);
auto rbs = redBlackTree!("a.r < b.r", true)([P(0, 0)]);
rbs.removeFront();
sort!"a.l == b.l ? a.r > b.r : a.l < b.l"(ps);
int max_r;
foreach (p; ps[0..$-1]) {
rbt.removeKey(p);
rbs.insert(p);
max_r = max(max_r, max(0, rbs.front.r - p.l + 1) + max(0, rbt.front.r - ps[$-1].l + 1));
max_r = max(max_r, max(0, rbs.back.r - p.l + 1) + max(0, min(rbt.front.r, rbs.front.r) - ps[$-1].l + 1));
}
writeln(max_r);
}
|
D
|
<?xml version="1.0" encoding="ASCII" standalone="no"?>
<di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0">
<pageList>
<availablePage>
<emfPageIdentifier href="VAR_6_MobileMedia-4223819795.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_6_MobileMedia-4223819795.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
module nbuff.buffer;
import std.string;
import std.array;
import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.traits;
import std.format;
import core.exception;
import std.exception;
import std.range.primitives;
import std.experimental.logger;
///
// network buffer
///
/// Range Empty exception
static immutable Exception RangeEmpty = new Exception("try to pop from empty Buffer"); // @suppress(dscanner.style.phobos_naming_convention) // @suppress(dscanner.style.phobos_naming_convention)
/// Requested index is out of range
static immutable Exception IndexOutOfRange = new Exception("Index out of range");
/// Buffer internal struct problem
static immutable Exception BufferError = new Exception("Buffer internal struct corrupted");
// goals
// 1 minomal data copy
// 2 Range interface
// 3 minimal footprint
public alias BufferChunk = immutable(ubyte)[];
public alias BufferChunksArray = immutable(BufferChunk)[];
/// Network buffer (collected from network data chunks)
struct Buffer { // @suppress(dscanner.suspicious.incomplete_operator_overloading)
package:
// alias Chunk = BufferChunk;
size_t _length;
BufferChunksArray _chunks;
size_t _pos; // offset from beginning, always points inside first chunk
long _end_pos; // offset of the _length in the last chunk
public:
/// build from string
this(string s) pure @safe nothrow {
_chunks = [s.representation];
_length = s.length;
_end_pos = _length;
}
/// build from chunk
this(BufferChunk s) pure @safe nothrow {
_chunks = [s];
_length = s.length;
_end_pos = _length;
}
/// build from other buffer slice
this(in Buffer other, size_t m, size_t n) pure @safe {
// produce slice view m..n
if ( n == m ) {
return;
}
enforce(m < n && n <=other._length, "wrong m or n");
assert(other._pos < other._chunks[0].length);
m += other._pos;
n += other._pos;
_length = n - m;
n = n - m;
if ( other._chunks.length == 1 ) {
// special frequent usecase
// no loops
_chunks = [other._chunks[0][m .. m+n]];
_end_pos = n;
return;
}
ulong i;
while( m > other._chunks[i].length ) {
m -= other._chunks[i].length;
i++;
}
BufferChunksArray content;
auto to_copy = min(n, other._chunks[i].length - m);
if ( to_copy > 0 ) {
content ~= other._chunks[i][m..m+to_copy];
}
i++;
n -= to_copy;
while(n > 0) {
to_copy = min(n, other._chunks[i].length);
if ( n > to_copy ) {
content ~= other._chunks[i];
}
else {
content ~= other._chunks[i][0..to_copy];
}
n -= to_copy;
i++;
}
_end_pos = to_copy;
_chunks = content;
}
/// construct from other buffer slice
this(in Buffer other, size_t m, size_t n) pure @safe immutable {
// produce slice view m..n
if ( n == m ) {
return;
}
BufferChunksArray content;
enforce(m < n && n <=other.length, "wrong m or n");
assert(other._pos < other._chunks[0].length);
m += other._pos;
n += other._pos;
_length = n - m;
n = n - m;
ulong i;
while( m > other._chunks[i].length ) {
m -= other._chunks[i].length;
i++;
}
auto to_copy = min(n, other._chunks[i].length - m);
if ( to_copy > 0 ) {
content ~= other._chunks[i][m..m+to_copy];
//_end_pos = to_copy;
}
i++;
n -= to_copy;
while(n > 0) {
to_copy = min(n, other._chunks[i].length);
if ( n > to_copy ) {
content ~= other._chunks[i];
}
else {
content ~= other._chunks[i][0..to_copy];
}
n -= to_copy;
i++;
}
_end_pos = to_copy;
_chunks = content;
}
/// if Buffer is empty?
bool empty() const pure @safe @nogc nothrow {
return _length == 0;
}
alias put = append;
/// append data chunk to buffer
auto append(in string s) pure @safe nothrow {
if (s.length == 0 ) {
return;
}
BufferChunk chunk = s.representation;
if ( _chunks.length > 0 && _end_pos < _chunks[$-1].length ) {
// we have to copy chunks with last chunk trimmed
_chunks = _chunks[0..$-1] ~ _chunks[$-1][0.._end_pos];
}
_chunks ~= chunk;
_length += chunk.length;
_end_pos = s.length;
}
/// append chunk
auto append(in BufferChunk s) pure @safe nothrow {
if (s.length == 0 ) {
return;
}
if ( _chunks.length > 0 && _end_pos < _chunks[$-1].length ) {
// we have to copy chunks with last chunk trimmed
_chunks = _chunks[0..$-1] ~ _chunks[$-1][0.._end_pos];
}
_chunks ~= s;
_length += s.length;
_end_pos = s.length;
}
/// length in bytes
@property size_t length() const pure @safe @nogc nothrow {
return _length;
}
/// opDollar - $
@property auto opDollar() const pure @safe @nogc nothrow {
return _length;
}
/// build slice over buffer
Buffer opSlice(size_t m, size_t n) const pure @safe {
if ( this._length==0 || m == n ) {
return Buffer();
}
return Buffer(this, m, n);
}
/// opIndex
@property ubyte opIndex(size_t n) const pure @safe @nogc nothrow {
if ( n >= _length ) {
return _chunks[$][0];
}
n += _pos;
if ( _chunks.length == 1 ) {
return _chunks[0][n];
}
foreach(ref b; _chunks) {
immutable l = b.length;
if ( n < l ) {
return b[n];
}
n -= l;
}
// XXX
// this is a way to have @nogc, while throwing RangeError
// in case of wrong n value (n>=_length)
return _chunks[$][0];
}
auto opEquals(T)(in T other) const pure @safe @nogc nothrow if (isSomeString!T) {
if (other.length != _length ) {
return false;
}
size_t m;
immutable last_chunk = _chunks.length;
if (_chunks.length == 1) {
// single chunk
return _chunks[0][_pos.._end_pos] == other;
}
foreach(i, ref c; _chunks) {
size_t a, b;
if ( i == 0 ) {
a = _pos;
}
if ( i == last_chunk ) {
b = _end_pos;
} else {
b = c.length;
}
auto cmp_len = b - a;
if ( c[a..b] != other[m..m+cmp_len] ) {
return false;
}
m += cmp_len;
}
return true;
}
/// save (for range ops)
@property auto save() pure @safe @nogc nothrow {
return this;
}
alias front = frontByte;
alias popFront = popFrontByte;
/// return front byte
@property ubyte frontByte() const pure @safe @nogc nothrow {
assert(_pos < _chunks[0].length);
return _chunks[0][_pos];
}
/// pop front byte
@property void popFrontByte() pure @safe @nogc {
assert(_pos < _chunks[0].length);
if ( _length == 0 ) {
throw RangeEmpty;
}
_pos++;
_length--;
if ( _pos >= _chunks[0].length ) {
_pos = 0;
_chunks = _chunks[1..$];
}
}
/// return front data chunk
BufferChunk frontChunk() const pure @safe @nogc nothrow {
return _chunks[0][_pos..$];
}
/// pop first chunk
void popFrontChunk() pure @nogc @safe {
assert(_pos < _chunks[0].length);
if ( _length == 0 ) {
throw RangeEmpty;
}
_length -= _chunks[0].length - _pos;
_pos = 0;
_chunks = _chunks[1..$];
}
alias back = backByte;
/// value of last byte
@property ubyte backByte() const pure @nogc @safe nothrow {
return _chunks[$-1][_end_pos - 1];
}
/// pop last byte
@property void popBack() pure @safe @nogc {
if ( _length == 0 ) {
throw RangeEmpty;
}
if ( _end_pos > _chunks[$-1].length) {
throw BufferError;
}
_length--;
_end_pos--;
if ( _end_pos == 0 && _length > 0) {
_chunks.popBack;
_end_pos = _chunks[$-1].length;
}
}
///
/// Return array of buffer chunks, all chunks length adjusted
//
BufferChunksArray dataChunks() const pure @safe nothrow {
BufferChunksArray res;
if ( _length == 0 ) {
return res;
}
immutable last_chunk = _chunks.length - 1; // @suppress(dscanner.suspicious.length_subtraction)
foreach(i,ref c; _chunks) {
long a,b = c.length;
if ( i == 0 ) {
a = _pos;
}
if ( i == last_chunk ) {
b = _end_pos;
}
res ~= c[a..b];
}
return res;
}
/// collect data chunks in contigouos buffer
BufferChunk data() const pure @trusted {
if ( _length == 0 ) {
return BufferChunk.init;
}
if ( _chunks.length == 1 ) {
return _chunks[0][_pos.._end_pos];
}
assert(_pos < _chunks[0].length);
ubyte[] r = new ubyte[this.length];
uint d = 0;
size_t p = _pos;
foreach(ref c; _chunks[0..$-1]) {
r[d..d+c.length-p] = c[p..$];
d += c.length-p;
p = 0;
}
auto c = _chunks[$-1];
r[d..$] = c[p.._end_pos];
return assumeUnique(r);
}
/// split buffer on single-byte separator
Buffer[] splitOn(ubyte sep) const pure @safe {
Buffer[] res;
Buffer a = this;
Buffer b = this.find(sep);
while( b.length ) {
auto al = a.length;
auto bl = b.length;
res ~= a[0..al-bl];
b.popFront;
a = b;
b = b.find(sep);
}
res ~= a;
return res;
}
/// index of s
ptrdiff_t indexOf(string s) const pure @safe {
if ( s.length == 0 || s.length > _length ) {
return -1;
}
Buffer haystack = this;
ubyte b = s.representation[0];
while( haystack.length > 0 ) {
auto r = haystack.find(b);
if ( r.length < s.length ) {
return -1;
}
if ( s.length == 1 || r[1..s.length] == s[1..$]) {
return _length - r.length;
}
haystack = r;
haystack.popFront;
}
return -1;
}
/// canFind string?
bool canFindString(string s) const pure @safe {
return indexOf(s) >= 0;
}
private bool cmp(size_t pos, const(ubyte)[] other) const @safe {
if ( pos + other.length > _length ) {
return false;
}
if (_chunks.length == 1) {
// single chunk
return _chunks[0][pos .. pos + other.length] == other;
}
int i;
while (pos >= _chunks[i].length) {
pos -= _chunks[i].length;
i++;
}
size_t compare_pos, compare_len = other.length;
size_t a = pos;
foreach (ref c; _chunks[i..$]) {
size_t to_compare = min(compare_len, c.length - a);
if (c[a..a+to_compare] != other[compare_pos .. compare_pos+to_compare]) {
return false;
}
a = 0;
compare_len -= to_compare;
compare_pos += to_compare;
if ( compare_len == 0 ) {
return true;
}
}
return true;
}
/// starting from pos count until buffer 'b'
private size_t countUntil(size_t pos, const(ubyte)[] b) const @safe {
if (b.length == 0) {
throw RangeEmpty;
}
if (pos == -1) {
return -1;
}
if (_chunks.length == 0)
return -1;
immutable needleLen = b.length;
while ( pos < _length - needleLen + 1 ) {
if ( cmp(pos, b) ) {
return pos;
}
pos++;
}
return -1;
}
/// find on char using predicate
Buffer find(alias pred="a==b")(char needle) const pure @safe {
return find!pred(cast(ubyte)needle);
}
/// find on ubyte using predicate
Buffer find(alias pred="a==b")(ubyte needle) const pure @safe {
immutable chunk_last = _chunks.length - 1; // @suppress(dscanner.suspicious.length_subtraction)
long chunk_pos = 0;
foreach (i,ref c; _chunks) {
long a,b;
if (i == 0) {
a = _pos;
}
if (i == chunk_last) {
b = _end_pos;
} else {
b = c.length;
}
immutable f = c[a..b].find!pred(needle);
if ( f.length > 0) {
auto p = b - f.length;
return this[chunk_pos-_pos+p..$];
}
else {
chunk_pos += c.length;
}
}
return Buffer();
}
/// find and split buffer
Buffer[] findSplitOn(immutable(ubyte)[] b) const @safe {
immutable i = countUntil(0, b);
if ( i == -1 ) {
return new Buffer[](3);
}
Buffer[] f;
f ~= this[0..i];
f ~= Buffer(b);
f ~= this[i+b.length..this.length];
return f;
}
// _Range range() const pure @safe @nogc nothrow {
// return _Range(this);
// }
string toString() const @safe {
return cast(string)data();
}
/// cast to string
string opCast(string)() const {
return toString();
}
/// print some buffer internal info
void describe() const @safe {
writefln("leng: %d", _length);
writefln("_pos: %d", _pos);
writefln("_end: %d", _end_pos);
writefln("chunks: %d", _chunks.length);
foreach(ref c; _chunks) {
writefln("%d bytes: %s", c.length, cast(string)c[0..min(10, c.length)]);
}
}
}
unittest {
info("Test buffer");
static assert(isInputRange!Buffer);
static assert(isForwardRange!Buffer);
static assert(hasLength!Buffer);
static assert(hasSlicing!Buffer);
static assert(isBidirectionalRange!Buffer);
static assert(isRandomAccessRange!Buffer);
auto b = Buffer();
b.append("abc");
b.append("def".representation);
b.append("123");
assert(equal(b.data(), "abcdef123"));
assert(b == "abcdef123");
auto bi = immutable Buffer("abc");
assert(equal(bi.data(), "abc"));
Buffer c = b;
assert(cast(string)c.data() == "abcdef123");
assert(c.length == 9);
assert(c._chunks.length == 3);
// update B do not affect C
b.append("ghi");
assert(cast(string)c.data() == "abcdef123");
// test slices
immutable Buffer di = b[1..5];
//immutable Buffer dii = di[1..2];
// +di+
// |bc|
// |de|
// +--+
assert(cast(string)di.data == "bcde");
b = Buffer("a\nb");
assert(b.findSplitOn("\n".representation) == ["a", "\n", "b"]);
b = Buffer();
b.append("a");
b.append("\n");
b.append("b");
assert(b.findSplitOn("\n".representation) == ["a", "\n", "b"]);
b = Buffer();
b.append("abc");
b.append("def");
b.append("ghi");
assert(b.findSplitOn("cdefg".representation) == ["ab","cdefg", "hi"]);
b = Buffer("012");
b.append("345");
b.popFrontByte();
assert(equal(b.data, "12345"));
assert(equal(b[1..$-1].data, "234"));
b.popFrontByte();
assert(equal(b.data, "2345"));
b.popFrontByte();
assert(equal(b.data, "345"));
b.popFrontByte();
assert(equal(b.data, "45"));
b = Buffer("012");
b.append("345");
auto bb = b;
b.popFrontByte();
assert(b[0]=='1');
assert(b[$-1]=='5');
assert(b.back == '5');
assertThrown!RangeError(b[$]=='5');
assert(equal(b[1..$-1], "234"));
b.popFrontChunk();
assert(equal(b.data, "345"));
assert(b[0]=='3');
assert(b[$-1]=='5');
assert(equal(b[1..$-1], "4"));
assert(equal(bb, "012345"));
b.popFrontChunk();
assertThrown!RangeError(b.popFrontChunk());
bb = Buffer();
bb.append("0123");
bb.append("45".representation);
bb.popFront();
bb.popBack();
assert(bb.front == '1');
assert(bb[0] == '1');
assert(bb.back == '4');
assert(bb[$-1] == '4');
assert(bb.data == "1234");
assert(bb.length == 4);
assertThrown!RangeError(bb[5]==0);
bb.popFront();
bb.popBack();
assert(bb.front == '2');
assert(bb.back == '3');
assert(bb.data == "23");
assert(bb.length == 2);
bb.popFront();
bb.popBack();
assert(bb.length == 0);
bb = Buffer();
bb.append("0123");
bb.append("45");
bb.popBack();
bb.append("abc");
assert(bb.back == 'c');
assert(bb.length == 8);
assert(bb == "01234abc");
bb = Buffer();
bb.append("0123");
bb.append("4");
bb.popBack();
bb.append("abc");
assert(bb.back == 'c');
assert(bb.length == 7);
assert(bb == "0123abc");
bb = Buffer();
bb.append("0123");
bb.append("");
bb.popBack();
bb.append("abc");
assert(bb.back == 'c');
assert(bb.length == 6);
assert(bb == "012abc");
bb = Buffer();
bb.append("0123".representation);
bb.popFront();
bb.popBack();
assert(bb.front == '1');
assert(bb.back == '2');
assert(bb.length == 2);
assert(equal(bb, "12"));
assert(!bb.canFind('0'));
assert(equal(bb.find('0'), "")); // internal, fast
assert(!bb.canFind('0'));
assert(equal(bb.find('0'), "")); // internal, fast
assert(bb.canFind('1'));
assert(equal(bb.find('1'), "12")); // internal, fast
assert(!bb.canFind('3'));
assert(equal(find(bb, '3'), "")); // use InputRange, slow
bb.append("3");
assert(bb.back == '3');
assert(bb.length == 3);
assert(equal(bb, "123"));
assert(bb[0..$] == "123");
assert(bb[$-1] == '3');
assert(equal(bb.find('0'), "")); // internal, fast
assert(!bb.canFind('0'));
assert(equal(bb.find('1'), "123")); // internal, fast
assert(bb.canFind('3'));
assert(equal(bb.find('3'), "3")); // internal method, fast
assert(equal(find(bb, '3'), "3")); // use InputRange, slow
bb = Buffer();
bb.append("0");
bb.append("1");
bb.append("2");
bb.append("3");
assert(equal(bb.retro, "3210"));
bb.popFront();
bb.popBack();
assert(bb.front == '1');
assert(bb.back == '2');
assert(bb.length == 2);
assert(equal(bb, "12"));
assert(!bb.canFind('0'));
assert(equal(bb.find('0'), "")); // internal, fast
assert(!bb.canFind('0'));
assert(equal(bb.find('0'), "")); // internal, fast
assert(bb.canFind('1'));
assert(equal(bb.find('1'), "12")); // internal, fast
assert(!bb.canFind('3'));
assert(equal(find(bb, '3'), "")); // use InputRange, slow
bb.append("3");
assert(bb.back == '3');
assert(bb.length == 3);
assert(equal(bb, "123"));
assert(bb[0..$] == "123");
assert(bb[$-1] == '3');
assert(equal(bb.find('0'), "")); // internal, fast
assert(!bb.canFind('0'));
assert(equal(bb.find('1'), "123")); // internal, fast
assert(bb.canFind('3'));
assert(equal(bb.find('3'), "3")); // internal method, fast
assert(equal(find(bb, '3'), "3")); // use InputRange, slow
bb = Buffer();
bb.append("aaa\n");
bb.append("bbb\n");
bb.append("ccc\n");
assert(equal(splitter(bb, '\n').array[0], "aaa"));
bb = Buffer();
bb.append("0\naaa\n");
bb.append("bbb\n");
bb.popFront;
bb.popFront;
assert(equal(splitter(bb, '\n').array[0], "aaa"));
bb = Buffer();
bb.append("0\naaa\n");
bb.append("bbb\n\n");
bb.append("ccc\n1");
bb.popFrontN(2);
bb.popBackN(2);
assert(bb.indexOf("aaa") == 0);
assert(bb.indexOf("bbb") == 4);
assert(bb.indexOf("0") == -1);
assert(bb.indexOf("1") == -1);
assert(equal(bb.splitOn('\n'), ["aaa", "bbb", "", "ccc"]));
bb = Buffer();
bb.append("0\naaa\nbbb\n\nccc\n1");
bb.popFrontN(2);
bb.popBackN(2);
assert(equal(bb.splitOn('\n'), ["aaa", "bbb", "", "ccc"]));
bb = Buffer();
bb.append("aaa\nbbb\n\nccc\n");
assert(bb.canFindString("\n\n"));
assert(!bb.canFindString("\na\n"));
bb = Buffer();
bb.append("aaa\nbbb\n");
bb.append("\nccc\n");
assert(bb.canFindString("\n\n"));
assert(!bb.canFindString("\na\n"));
bb = Buffer();
bb.append("aaa\r\nbbb\r\n\r\nddd");
assert(bb.indexOf("\r\n\r\n") == 8);
assert(!bb.canFindString("\na\n"));
}
@safe unittest {
Buffer httpMessage = Buffer();
httpMessage.append("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r");
httpMessage.append("\n");
httpMessage.append("Conte");
httpMessage.append("nt-Length: 4\r\n");
httpMessage.append("\r\n");
httpMessage.append("body");
writeln(httpMessage.splitOn('\n').map!"a.toString.strip");
}
|
D
|
/Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionManager.o : /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/AFError.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Alamofire.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/MultipartFormData.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Notifications.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Request.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Response.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Result.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/SessionDelegate.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/SessionManager.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/TaskDelegate.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Timeline.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionManager~partial.swiftmodule : /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/AFError.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Alamofire.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/MultipartFormData.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Notifications.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Request.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Response.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Result.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/SessionDelegate.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/SessionManager.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/TaskDelegate.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Timeline.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
/Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionManager~partial.swiftdoc : /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/AFError.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Alamofire.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/MultipartFormData.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Notifications.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Request.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Response.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Result.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/ServerTrustPolicy.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/SessionDelegate.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/SessionManager.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/TaskDelegate.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Timeline.swift /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Alamofire/Source/Validation.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/lee_bennett/Desktop/Playground/iOS/MiniLovTap/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule
|
D
|
/Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/Macaw.build/Objects-normal/x86_64/ShapeRenderer.o : /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/export/MacawView+PDF.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFillMode_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFunctionName_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MDisplayLink_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineJoin_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MBezierPath+Extension_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/Common_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineCap_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/Graphics_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MView_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFillMode_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFunctionName_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/MDisplayLink_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineJoin_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/Common_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineCap_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/Graphics_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/MView_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Arc.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/AnimationSequence.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Node.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Image.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/UIImage2Image.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/AnimationCache.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Stroke.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/Touchable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/NodeHashable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/TransformHashable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/Variable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimatableVariable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/Interpolable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/Disposable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/GroupDisposable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Drawable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/CGFloat+Double.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Circle.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Line.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Baseline.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Polyline.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Shape.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathSegmentType.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/NSTimer+Closure.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/CAAnimationClosure.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Ellipse.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Size.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/Easing.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Path.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/MDisplayLink.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Fill.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationImpl.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/MacawZoom.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Transform.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Align.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LineJoin.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Polygon.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/StrokeInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/DoubleInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/ShapeInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/FillInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/TransformInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/ContentsInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/LocusInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/Animation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/CombineAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/ShapeAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/MorphingAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/TransformAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/ContentsAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/OpacityAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/TimingFunction.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Pattern.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/MoveTo.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/AspectRatio.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LineCap.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Stop.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Group.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationProducer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathBuilder.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/NodeRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/ImageRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/ShapeRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/GroupRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/TextRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGParser.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/CSSParser.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/ShapeLayer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGSerializer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Color.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGParserError.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/MorphingGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/TransformGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/ShapeAnimationGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/CombinationAnimationGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/OpacityGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/GaussianBlur.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGCanvas.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/FuncBounds.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/PathBounds.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/CGMappings.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/SceneUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/GeomUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/RenderUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/BoundsUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/DescriptionExtensions.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/PathFunctions.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/AnimOperators.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Insets.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGConstants.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Locus.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/TransformedLocus.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Rect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/RoundRect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Effect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/AlphaEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/BlendEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/OffsetEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/ColorMatrixEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Gradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/RadialGradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LinearGradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathSegment.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/Event.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/RotateEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/PinchEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/TouchEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/PanEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/TapEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Point.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Font.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGNodeLayout.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/layout/ContentLayout.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Text.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/RenderContext.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGView.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/MacawView.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/ColorMatrix.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Debug-iphonesimulator/SWXMLHash/SWXMLHash.framework/Modules/SWXMLHash.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Target\ Support\ Files/SWXMLHash/SWXMLHash-umbrella.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Target\ Support\ Files/Macaw/Macaw-umbrella.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Debug-iphonesimulator/SWXMLHash/SWXMLHash.framework/Headers/SWXMLHash-Swift.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/Macaw.build/unextended-module.modulemap /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/SWXMLHash.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/Macaw.build/Objects-normal/x86_64/ShapeRenderer~partial.swiftmodule : /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/export/MacawView+PDF.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFillMode_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFunctionName_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MDisplayLink_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineJoin_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MBezierPath+Extension_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/Common_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineCap_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/Graphics_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MView_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFillMode_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFunctionName_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/MDisplayLink_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineJoin_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/Common_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineCap_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/Graphics_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/MView_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Arc.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/AnimationSequence.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Node.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Image.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/UIImage2Image.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/AnimationCache.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Stroke.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/Touchable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/NodeHashable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/TransformHashable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/Variable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimatableVariable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/Interpolable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/Disposable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/GroupDisposable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Drawable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/CGFloat+Double.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Circle.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Line.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Baseline.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Polyline.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Shape.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathSegmentType.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/NSTimer+Closure.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/CAAnimationClosure.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Ellipse.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Size.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/Easing.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Path.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/MDisplayLink.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Fill.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationImpl.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/MacawZoom.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Transform.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Align.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LineJoin.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Polygon.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/StrokeInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/DoubleInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/ShapeInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/FillInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/TransformInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/ContentsInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/LocusInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/Animation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/CombineAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/ShapeAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/MorphingAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/TransformAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/ContentsAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/OpacityAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/TimingFunction.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Pattern.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/MoveTo.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/AspectRatio.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LineCap.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Stop.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Group.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationProducer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathBuilder.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/NodeRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/ImageRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/ShapeRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/GroupRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/TextRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGParser.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/CSSParser.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/ShapeLayer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGSerializer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Color.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGParserError.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/MorphingGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/TransformGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/ShapeAnimationGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/CombinationAnimationGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/OpacityGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/GaussianBlur.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGCanvas.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/FuncBounds.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/PathBounds.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/CGMappings.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/SceneUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/GeomUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/RenderUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/BoundsUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/DescriptionExtensions.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/PathFunctions.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/AnimOperators.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Insets.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGConstants.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Locus.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/TransformedLocus.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Rect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/RoundRect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Effect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/AlphaEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/BlendEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/OffsetEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/ColorMatrixEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Gradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/RadialGradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LinearGradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathSegment.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/Event.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/RotateEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/PinchEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/TouchEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/PanEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/TapEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Point.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Font.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGNodeLayout.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/layout/ContentLayout.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Text.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/RenderContext.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGView.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/MacawView.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/ColorMatrix.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Debug-iphonesimulator/SWXMLHash/SWXMLHash.framework/Modules/SWXMLHash.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Target\ Support\ Files/SWXMLHash/SWXMLHash-umbrella.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Target\ Support\ Files/Macaw/Macaw-umbrella.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Debug-iphonesimulator/SWXMLHash/SWXMLHash.framework/Headers/SWXMLHash-Swift.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/Macaw.build/unextended-module.modulemap /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/SWXMLHash.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/Macaw.build/Objects-normal/x86_64/ShapeRenderer~partial.swiftdoc : /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/export/MacawView+PDF.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFillMode_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFunctionName_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MDisplayLink_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineJoin_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MBezierPath+Extension_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/Common_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineCap_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/Graphics_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/macOS/MView_macOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFillMode_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAMediaTimingFunctionName_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/MDisplayLink_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineJoin_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/Common_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/MCAShapeLayerLineCap_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/Graphics_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/iOS/MView_iOS.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Arc.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/AnimationSequence.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Node.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Image.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/UIImage2Image.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/AnimationCache.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Stroke.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/Touchable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/NodeHashable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/Cache/TransformHashable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/Variable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimatableVariable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/Interpolable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/Disposable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/bindings/GroupDisposable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Drawable.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/CGFloat+Double.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Circle.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Line.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Baseline.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Polyline.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Shape.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathSegmentType.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/NSTimer+Closure.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/thirdparty/CAAnimationClosure.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Ellipse.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Size.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/Easing.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Path.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/platform/MDisplayLink.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Fill.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationImpl.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/MacawZoom.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Transform.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Align.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LineJoin.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Polygon.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/StrokeInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/DoubleInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/ShapeInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/FillInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/TransformInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/ContentsInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/LocusInterpolation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/Animation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/CombineAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/ShapeAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/MorphingAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/TransformAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/ContentsAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/OpacityAnimation.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/TimingFunction.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Pattern.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/MoveTo.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/AspectRatio.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LineCap.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Stop.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Group.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationProducer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathBuilder.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/NodeRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/ImageRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/ShapeRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/GroupRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/TextRenderer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGParser.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/CSSParser.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/ShapeLayer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGSerializer.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Color.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGParserError.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/MorphingGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/TransformGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/ShapeAnimationGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/CombinationAnimationGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/types/animation_generators/OpacityGenerator.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/GaussianBlur.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGCanvas.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/FuncBounds.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/PathBounds.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/CGMappings.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/SceneUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/GeomUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/AnimationUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/RenderUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/BoundsUtils.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/utils/DescriptionExtensions.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/PathFunctions.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/animation/layer_animation/Extensions/AnimOperators.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Insets.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGConstants.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Locus.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/TransformedLocus.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Rect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/RoundRect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Effect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/AlphaEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/BlendEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/OffsetEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/ColorMatrixEffect.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Gradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/RadialGradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/LinearGradient.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/PathSegment.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/Event.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/RotateEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/PinchEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/TouchEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/PanEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/events/TapEvent.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/geom2d/Point.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/Font.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGNodeLayout.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/layout/ContentLayout.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/scene/Text.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/render/RenderContext.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/svg/SVGView.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/views/MacawView.swift /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Macaw/Source/model/draw/ColorMatrix.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Debug-iphonesimulator/SWXMLHash/SWXMLHash.framework/Modules/SWXMLHash.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Target\ Support\ Files/SWXMLHash/SWXMLHash-umbrella.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/Pods/Target\ Support\ Files/Macaw/Macaw-umbrella.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Debug-iphonesimulator/SWXMLHash/SWXMLHash.framework/Headers/SWXMLHash-Swift.h /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/Macaw.build/unextended-module.modulemap /Users/mac/Documents/Bhupendra/RedialAnimateMenuBar/build/Pods.build/Debug-iphonesimulator/SWXMLHash.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/Build/Intermediates/ioFullColorLED.build/Debug-iphoneos/ioFullColorLED.build/Objects-normal/arm64/BLECommon.o : /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLECommon.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLEManager.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLESerialCommunicator.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLEDevice.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Swift.swiftmodule /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/ioFullColorLED.h /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/Build/Intermediates/ioFullColorLED.build/Debug-iphoneos/ioFullColorLED.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreImage.swiftmodule
/Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/Build/Intermediates/ioFullColorLED.build/Debug-iphoneos/ioFullColorLED.build/Objects-normal/arm64/BLECommon~partial.swiftmodule : /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLECommon.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLEManager.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLESerialCommunicator.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLEDevice.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Swift.swiftmodule /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/ioFullColorLED.h /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/Build/Intermediates/ioFullColorLED.build/Debug-iphoneos/ioFullColorLED.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreImage.swiftmodule
/Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/Build/Intermediates/ioFullColorLED.build/Debug-iphoneos/ioFullColorLED.build/Objects-normal/arm64/BLECommon~partial.swiftdoc : /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLECommon.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLEManager.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLESerialCommunicator.swift /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/BLEDevice.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Swift.swiftmodule /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/ioFullColorLED/ioFullColorLED.h /Users/yamamoto/Documents/Xcode/ioFullColorLED/ioFullColorLED/Build/Intermediates/ioFullColorLED.build/Debug-iphoneos/ioFullColorLED.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/CoreImage.swiftmodule
|
D
|
/Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/Alamofire.build/Alamofire.swift.o : /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/MultipartFormData.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Timeline.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/DispatchQueue+Alamofire.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Alamofire.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Response.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/TaskDelegate.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/SessionDelegate.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ParameterEncoding.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Validation.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ResponseSerialization.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/SessionManager.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/NetworkReachabilityManager.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/AFError.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Notifications.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Result.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Request.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/RxCocoaRuntime.build/module.modulemap /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/QuickSpecBase.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/Alamofire.build/Alamofire~partial.swiftmodule : /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/MultipartFormData.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Timeline.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/DispatchQueue+Alamofire.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Alamofire.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Response.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/TaskDelegate.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/SessionDelegate.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ParameterEncoding.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Validation.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ResponseSerialization.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/SessionManager.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/NetworkReachabilityManager.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/AFError.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Notifications.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Result.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Request.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/RxCocoaRuntime.build/module.modulemap /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/QuickSpecBase.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/Alamofire.build/Alamofire~partial.swiftdoc : /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/MultipartFormData.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Timeline.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/DispatchQueue+Alamofire.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Alamofire.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Response.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/TaskDelegate.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/SessionDelegate.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ParameterEncoding.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Validation.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ResponseSerialization.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/SessionManager.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/NetworkReachabilityManager.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/AFError.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Notifications.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Result.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/Request.swift /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/checkouts/Alamofire.git-6801331143877184500/Source/ServerTrustPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/RxCocoaRuntime.build/module.modulemap /Users/rrunfa/Desktop/RxIssuesSample/RxIssuesSample/.build/x86_64-apple-macosx10.10/debug/QuickSpecBase.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
// Written in the D programming language
/++
$(SCRIPT inhibitQuickIndex = 1;)
$(BOOKTABLE,
$(TR $(TH Category) $(TH Functions))
$(TR $(TD Types) $(TD
$(LREF Clock)
$(LREF SysTime)
$(LREF DosFileTime)
))
$(TR $(TD Conversion) $(TD
$(LREF parseRFC822DateTime)
$(LREF DosFileTimeToSysTime)
$(LREF FILETIMEToStdTime)
$(LREF FILETIMEToSysTime)
$(LREF stdTimeToFILETIME)
$(LREF stdTimeToUnixTime)
$(LREF SYSTEMTIMEToSysTime)
$(LREF SysTimeToDosFileTime)
$(LREF SysTimeToFILETIME)
$(LREF SysTimeToSYSTEMTIME)
$(LREF unixTimeToStdTime)
))
)
License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Jonathan M Davis
Source: $(PHOBOSSRC std/datetime/_systime.d)
+/
module std.datetime.systime;
// Note: reconsider using specific imports below after
// https://issues.dlang.org/show_bug.cgi?id=17630 has been fixed
import core.time;// : ClockType, convert, dur, Duration, seconds, TimeException;
import std.datetime.date;// : _monthNames, AllowDayOverflow, CmpTimeUnits, Date,
//DateTime, DateTimeException, DayOfWeek, enforceValid, getDayOfWeek, maxDay,
//Month, splitUnitsFromHNSecs, TimeOfDay, validTimeUnits, yearIsLeapYear;
import std.datetime.timezone;// : LocalTime, SimpleTimeZone, TimeZone, UTC;
import std.exception : enforce;
import std.format : format;
import std.range.primitives;
import std.traits : isIntegral, isSigned, isSomeString, Unqual, isNarrowString;
version(Windows)
{
import core.stdc.time : time_t;
import core.sys.windows.windows;
import core.sys.windows.winsock2;
}
else version(Posix)
{
import core.sys.posix.signal : timespec;
import core.sys.posix.sys.types : time_t;
}
version(unittest)
{
import core.exception : AssertError;
import std.exception : assertThrown;
}
@safe unittest
{
initializeTests();
}
/++
Effectively a namespace to make it clear that the methods it contains are
getting the time from the system clock. It cannot be instantiated.
+/
final class Clock
{
public:
/++
Returns the current time in the given time zone.
Params:
clockType = The $(REF ClockType, core,time) indicates which system
clock to use to get the current time. Very few programs
need to use anything other than the default.
tz = The time zone for the SysTime that's returned.
Throws:
$(REF DateTimeException,std,datetime,date) if it fails to get the
time.
+/
static SysTime currTime(ClockType clockType = ClockType.normal)(immutable TimeZone tz = LocalTime()) @safe
{
return SysTime(currStdTime!clockType, tz);
}
@safe unittest
{
import std.format : format;
import std.stdio : writefln;
import core.time;
assert(currTime().timezone is LocalTime());
assert(currTime(UTC()).timezone is UTC());
// core.stdc.time.time does not always use unix time on Windows systems.
// In particular, dmc does not use unix time. If we can guarantee that
// the MS runtime uses unix time, then we may be able run this test
// then, but for now, we're just not going to run this test on Windows.
version(Posix)
{
static import core.stdc.time;
static import std.math;
immutable unixTimeD = currTime().toUnixTime();
immutable unixTimeC = core.stdc.time.time(null);
assert(std.math.abs(unixTimeC - unixTimeD) <= 2);
}
auto norm1 = Clock.currTime;
auto norm2 = Clock.currTime(UTC());
assert(norm1 <= norm2, format("%s %s", norm1, norm2));
assert(abs(norm1 - norm2) <= seconds(2));
import std.meta : AliasSeq;
static foreach (ct; AliasSeq!(ClockType.coarse, ClockType.precise, ClockType.second))
{{
scope(failure) writefln("ClockType.%s", ct);
auto value1 = Clock.currTime!ct;
auto value2 = Clock.currTime!ct(UTC());
assert(value1 <= value2, format("%s %s", value1, value2));
assert(abs(value1 - value2) <= seconds(2));
}}
}
/++
Returns the number of hnsecs since midnight, January 1st, 1 A.D. for the
current time.
Params:
clockType = The $(REF ClockType, core,time) indicates which system
clock to use to get the current time. Very few programs
need to use anything other than the default.
Throws:
$(REF DateTimeException,std,datetime,date) if it fails to get the
time.
+/
static @property long currStdTime(ClockType clockType = ClockType.normal)() @trusted
{
static if (clockType != ClockType.coarse &&
clockType != ClockType.normal &&
clockType != ClockType.precise &&
clockType != ClockType.second)
{
static assert(0, format("ClockType.%s is not supported by Clock.currTime or Clock.currStdTime", clockType));
}
version(Windows)
{
FILETIME fileTime;
GetSystemTimeAsFileTime(&fileTime);
immutable result = FILETIMEToStdTime(&fileTime);
static if (clockType == ClockType.second)
{
// Ideally, this would use core.std.time.time, but the C runtime
// has to be using unix time for that to work, and that's not
// guaranteed on Windows. Digital Mars does not use unix time.
// MS may or may not. If it does, then this can be made to use
// core.stdc.time for MS, but for now, we'll leave it like this.
return convert!("seconds", "hnsecs")(convert!("hnsecs", "seconds")(result));
}
else
return result;
}
else version(Posix)
{
static import core.stdc.time;
enum hnsecsToUnixEpoch = unixTimeToStdTime(0);
version(OSX)
{
static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
import core.sys.posix.sys.time : gettimeofday, timeval;
timeval tv;
if (gettimeofday(&tv, null) != 0)
throw new TimeException("Call to gettimeofday() failed");
return convert!("seconds", "hnsecs")(tv.tv_sec) +
convert!("usecs", "hnsecs")(tv.tv_usec) +
hnsecsToUnixEpoch;
}
}
else version(linux)
{
static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
import core.sys.linux.time : CLOCK_REALTIME_COARSE;
import core.sys.posix.time : clock_gettime, CLOCK_REALTIME;
static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_COARSE;
else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME;
else static assert(0, "Previous static if is wrong.");
timespec ts;
if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
hnsecsToUnixEpoch;
}
}
else version(FreeBSD)
{
import core.sys.freebsd.time : clock_gettime, CLOCK_REALTIME,
CLOCK_REALTIME_FAST, CLOCK_REALTIME_PRECISE, CLOCK_SECOND;
static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_FAST;
else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME_PRECISE;
else static if (clockType == ClockType.second) alias clockArg = CLOCK_SECOND;
else static assert(0, "Previous static if is wrong.");
timespec ts;
if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
hnsecsToUnixEpoch;
}
else version(NetBSD)
{
static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
import core.sys.posix.sys.time : gettimeofday, timeval;
timeval tv;
if (gettimeofday(&tv, null) != 0)
throw new TimeException("Call to gettimeofday() failed");
return convert!("seconds", "hnsecs")(tv.tv_sec) +
convert!("usecs", "hnsecs")(tv.tv_usec) +
hnsecsToUnixEpoch;
}
}
else version(DragonFlyBSD)
{
import core.sys.dragonflybsd.time : clock_gettime, CLOCK_REALTIME,
CLOCK_REALTIME_FAST, CLOCK_REALTIME_PRECISE, CLOCK_SECOND;
static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME_FAST;
else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME_PRECISE;
else static if (clockType == ClockType.second) alias clockArg = CLOCK_SECOND;
else static assert(0, "Previous static if is wrong.");
timespec ts;
if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
hnsecsToUnixEpoch;
}
else version(Solaris)
{
static if (clockType == ClockType.second)
return unixTimeToStdTime(core.stdc.time.time(null));
else
{
import core.sys.solaris.time : clock_gettime, CLOCK_REALTIME;
static if (clockType == ClockType.coarse) alias clockArg = CLOCK_REALTIME;
else static if (clockType == ClockType.normal) alias clockArg = CLOCK_REALTIME;
else static if (clockType == ClockType.precise) alias clockArg = CLOCK_REALTIME;
else static assert(0, "Previous static if is wrong.");
timespec ts;
if (clock_gettime(clockArg, &ts) != 0)
throw new TimeException("Call to clock_gettime() failed");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
hnsecsToUnixEpoch;
}
}
else static assert(0, "Unsupported OS");
}
else static assert(0, "Unsupported OS");
}
@safe unittest
{
import std.format : format;
import std.math : abs;
import std.meta : AliasSeq;
import std.stdio : writefln;
enum limit = convert!("seconds", "hnsecs")(2);
auto norm1 = Clock.currStdTime;
auto norm2 = Clock.currStdTime;
assert(norm1 <= norm2, format("%s %s", norm1, norm2));
assert(abs(norm1 - norm2) <= limit);
static foreach (ct; AliasSeq!(ClockType.coarse, ClockType.precise, ClockType.second))
{{
scope(failure) writefln("ClockType.%s", ct);
auto value1 = Clock.currStdTime!ct;
auto value2 = Clock.currStdTime!ct;
assert(value1 <= value2, format("%s %s", value1, value2));
assert(abs(value1 - value2) <= limit);
}}
}
private:
@disable this() {}
}
/++
$(D SysTime) is the type used to get the current time from the
system or doing anything that involves time zones. Unlike
$(REF DateTime,std,datetime,date), the time zone is an integral part of
$(D SysTime) (though for local time applications, time zones can be ignored
and it will work, since it defaults to using the local time zone). It holds
its internal time in std time (hnsecs since midnight, January 1st, 1 A.D.
UTC), so it interfaces well with the system time. However, that means that,
unlike $(REF DateTime,std,datetime,date), it is not optimized for
calendar-based operations, and getting individual units from it such as
years or days is going to involve conversions and be less efficient.
For calendar-based operations that don't
care about time zones, then $(REF DateTime,std,datetime,date) would be
the type to use. For system time, use $(D SysTime).
$(LREF Clock.currTime) will return the current time as a $(D SysTime).
To convert a $(D SysTime) to a $(REF Date,std,datetime,date) or
$(REF DateTime,std,datetime,date), simply cast it. To convert a
$(REF Date,std,datetime,date) or $(REF DateTime,std,datetime,date) to a
$(D SysTime), use $(D SysTime)'s constructor, and pass in the ntended time
zone with it (or don't pass in a $(REF TimeZone,std,datetime,timezone), and
the local time zone will be used). Be aware, however, that converting from a
$(REF DateTime,std,datetime,date) to a $(D SysTime) will not necessarily
be 100% accurate due to DST (one hour of the year doesn't exist and another
occurs twice). To not risk any conversion errors, keep times as
$(D SysTime)s. Aside from DST though, there shouldn't be any conversion
problems.
For using time zones other than local time or UTC, use
$(REF PosixTimeZone,std,datetime,timezone) on Posix systems (or on Windows,
if providing the TZ Database files), and use
$(REF WindowsTimeZone,std,datetime,timezone) on Windows systems. The time in
$(D SysTime) is kept internally in hnsecs from midnight, January 1st, 1 A.D.
UTC. Conversion error cannot happen when changing the time zone of a
$(D SysTime). $(REF LocalTime,std,datetime,timezone) is the
$(REF TimeZone,std,datetime,timezone) class which represents the local time,
and $(D UTC) is the $(REF TimeZone,std,datetime,timezone) class which
represents UTC. $(D SysTime) uses $(REF LocalTime,std,datetime,timezone) if
no $(REF TimeZone,std,datetime,timezone) is provided. For more details on
time zones, see the documentation for $(REF TimeZone,std,datetime,timezone),
$(REF PosixTimeZone,std,datetime,timezone), and
$(REF WindowsTimeZone,std,datetime,timezone).
$(D SysTime)'s range is from approximately 29,000 B.C. to approximately
29,000 A.D.
+/
struct SysTime
{
import core.stdc.time : tm;
version(Posix) import core.sys.posix.sys.time : timeval;
import std.typecons : Rebindable;
public:
/++
Params:
dateTime = The $(REF DateTime,std,datetime,date) to use to set
this $(LREF SysTime)'s internal std time. As
$(REF DateTime,std,datetime,date) has no concept of
time zone, tz is used as its time zone.
tz = The $(REF TimeZone,std,datetime,timezone) to use for this
$(LREF SysTime). If null,
$(REF LocalTime,std,datetime,timezone) will be used. The
given $(REF DateTime,std,datetime,date) is assumed to
be in the given time zone.
+/
this(in DateTime dateTime, immutable TimeZone tz = null) @safe nothrow
{
try
this(dateTime, Duration.zero, tz);
catch (Exception e)
assert(0, "SysTime's constructor threw when it shouldn't have.");
}
@safe unittest
{
static void test(DateTime dt, immutable TimeZone tz, long expected)
{
auto sysTime = SysTime(dt, tz);
assert(sysTime._stdTime == expected);
assert(sysTime._timezone is (tz is null ? LocalTime() : tz), format("Given DateTime: %s", dt));
}
test(DateTime.init, UTC(), 0);
test(DateTime(1, 1, 1, 12, 30, 33), UTC(), 450_330_000_000L);
test(DateTime(0, 12, 31, 12, 30, 33), UTC(), -413_670_000_000L);
test(DateTime(1, 1, 1, 0, 0, 0), UTC(), 0);
test(DateTime(1, 1, 1, 0, 0, 1), UTC(), 10_000_000L);
test(DateTime(0, 12, 31, 23, 59, 59), UTC(), -10_000_000L);
test(DateTime(1, 1, 1, 0, 0, 0), new immutable SimpleTimeZone(dur!"minutes"(-60)), 36_000_000_000L);
test(DateTime(1, 1, 1, 0, 0, 0), new immutable SimpleTimeZone(Duration.zero), 0);
test(DateTime(1, 1, 1, 0, 0, 0), new immutable SimpleTimeZone(dur!"minutes"(60)), -36_000_000_000L);
}
/++
Params:
dateTime = The $(REF DateTime,std,datetime,date) to use to set
this $(LREF SysTime)'s internal std time. As
$(REF DateTime,std,datetime,date) has no concept of
time zone, tz is used as its time zone.
fracSecs = The fractional seconds portion of the time.
tz = The $(REF TimeZone,std,datetime,timezone) to use for this
$(LREF SysTime). If null,
$(REF LocalTime,std,datetime,timezone) will be used. The
given $(REF DateTime,std,datetime,date) is assumed to
be in the given time zone.
Throws:
$(REF DateTimeException,std,datetime,date) if $(D fracSecs) is negative or if it's
greater than or equal to one second.
+/
this(in DateTime dateTime, in Duration fracSecs, immutable TimeZone tz = null) @safe
{
enforce(fracSecs >= Duration.zero, new DateTimeException("A SysTime cannot have negative fractional seconds."));
enforce(fracSecs < seconds(1), new DateTimeException("Fractional seconds must be less than one second."));
auto nonNullTZ = tz is null ? LocalTime() : tz;
immutable dateDiff = dateTime.date - Date.init;
immutable todDiff = dateTime.timeOfDay - TimeOfDay.init;
immutable adjustedTime = dateDiff + todDiff + fracSecs;
immutable standardTime = nonNullTZ.tzToUTC(adjustedTime.total!"hnsecs");
this(standardTime, nonNullTZ);
}
@safe unittest
{
import core.time;
static void test(DateTime dt, Duration fracSecs, immutable TimeZone tz, long expected)
{
auto sysTime = SysTime(dt, fracSecs, tz);
assert(sysTime._stdTime == expected);
assert(sysTime._timezone is (tz is null ? LocalTime() : tz),
format("Given DateTime: %s, Given Duration: %s", dt, fracSecs));
}
test(DateTime.init, Duration.zero, UTC(), 0);
test(DateTime(1, 1, 1, 12, 30, 33), Duration.zero, UTC(), 450_330_000_000L);
test(DateTime(0, 12, 31, 12, 30, 33), Duration.zero, UTC(), -413_670_000_000L);
test(DateTime(1, 1, 1, 0, 0, 0), msecs(1), UTC(), 10_000L);
test(DateTime(0, 12, 31, 23, 59, 59), msecs(999), UTC(), -10_000L);
test(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC(), -1);
test(DateTime(0, 12, 31, 23, 59, 59), hnsecs(1), UTC(), -9_999_999);
test(DateTime(0, 12, 31, 23, 59, 59), Duration.zero, UTC(), -10_000_000);
assertThrown!DateTimeException(SysTime(DateTime.init, hnsecs(-1), UTC()));
assertThrown!DateTimeException(SysTime(DateTime.init, seconds(1), UTC()));
}
/++
Params:
date = The $(REF Date,std,datetime,date) to use to set this
$(LREF SysTime)'s internal std time. As
$(REF Date,std,datetime,date) has no concept of time zone, tz
is used as its time zone.
tz = The $(REF TimeZone,std,datetime,timezone) to use for this
$(LREF SysTime). If null,
$(REF LocalTime,std,datetime,timezone) will be used. The
given $(REF Date,std,datetime,date) is assumed to be in the
given time zone.
+/
this(in Date date, immutable TimeZone tz = null) @safe nothrow
{
_timezone = tz is null ? LocalTime() : tz;
try
{
immutable adjustedTime = (date - Date(1, 1, 1)).total!"hnsecs";
immutable standardTime = _timezone.tzToUTC(adjustedTime);
this(standardTime, _timezone);
}
catch (Exception e)
assert(0, "Date's constructor through when it shouldn't have.");
}
@safe unittest
{
static void test(Date d, immutable TimeZone tz, long expected)
{
auto sysTime = SysTime(d, tz);
assert(sysTime._stdTime == expected);
assert(sysTime._timezone is (tz is null ? LocalTime() : tz), format("Given Date: %s", d));
}
test(Date.init, UTC(), 0);
test(Date(1, 1, 1), UTC(), 0);
test(Date(1, 1, 2), UTC(), 864000000000);
test(Date(0, 12, 31), UTC(), -864000000000);
}
/++
Note:
Whereas the other constructors take in the given date/time, assume
that it's in the given time zone, and convert it to hnsecs in UTC
since midnight, January 1st, 1 A.D. UTC - i.e. std time - this
constructor takes a std time, which is specifically already in UTC,
so no conversion takes place. Of course, the various getter
properties and functions will use the given time zone's conversion
function to convert the results to that time zone, but no conversion
of the arguments to this constructor takes place.
Params:
stdTime = The number of hnsecs since midnight, January 1st, 1 A.D.
UTC.
tz = The $(REF TimeZone,std,datetime,timezone) to use for this
$(LREF SysTime). If null,
$(REF LocalTime,std,datetime,timezone) will be used.
+/
this(long stdTime, immutable TimeZone tz = null) @safe pure nothrow
{
_stdTime = stdTime;
_timezone = tz is null ? LocalTime() : tz;
}
@safe unittest
{
static void test(long stdTime, immutable TimeZone tz)
{
auto sysTime = SysTime(stdTime, tz);
assert(sysTime._stdTime == stdTime);
assert(sysTime._timezone is (tz is null ? LocalTime() : tz), format("Given stdTime: %s", stdTime));
}
foreach (stdTime; [-1234567890L, -250, 0, 250, 1235657390L])
{
foreach (tz; testTZs)
test(stdTime, tz);
}
}
/++
Params:
rhs = The $(LREF SysTime) to assign to this one.
+/
ref SysTime opAssign(const ref SysTime rhs) return @safe pure nothrow
{
_stdTime = rhs._stdTime;
_timezone = rhs._timezone;
return this;
}
/++
Params:
rhs = The $(LREF SysTime) to assign to this one.
+/
ref SysTime opAssign(SysTime rhs) scope return @safe pure nothrow
{
_stdTime = rhs._stdTime;
_timezone = rhs._timezone;
return this;
}
/++
Checks for equality between this $(LREF SysTime) and the given
$(LREF SysTime).
Note that the time zone is ignored. Only the internal
std times (which are in UTC) are compared.
+/
bool opEquals(const SysTime rhs) @safe const pure nothrow
{
return opEquals(rhs);
}
/// ditto
bool opEquals(const ref SysTime rhs) @safe const pure nothrow
{
return _stdTime == rhs._stdTime;
}
@safe unittest
{
import std.range : chain;
assert(SysTime(DateTime.init, UTC()) == SysTime(0, UTC()));
assert(SysTime(DateTime.init, UTC()) == SysTime(0));
assert(SysTime(Date.init, UTC()) == SysTime(0));
assert(SysTime(0) == SysTime(0));
static void test(DateTime dt, immutable TimeZone tz1, immutable TimeZone tz2)
{
auto st1 = SysTime(dt);
st1.timezone = tz1;
auto st2 = SysTime(dt);
st2.timezone = tz2;
assert(st1 == st2);
}
foreach (tz1; testTZs)
{
foreach (tz2; testTZs)
{
foreach (dt; chain(testDateTimesBC, testDateTimesAD))
test(dt, tz1, tz2);
}
}
auto st = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
const cst = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
assert(st == st);
assert(st == cst);
//assert(st == ist);
assert(cst == st);
assert(cst == cst);
//assert(cst == ist);
//assert(ist == st);
//assert(ist == cst);
//assert(ist == ist);
}
/++
Compares this $(LREF SysTime) with the given $(LREF SysTime).
Time zone is irrelevant when comparing $(LREF SysTime)s.
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
+/
int opCmp(in SysTime rhs) @safe const pure nothrow
{
if (_stdTime < rhs._stdTime)
return -1;
if (_stdTime > rhs._stdTime)
return 1;
return 0;
}
@safe unittest
{
import std.algorithm.iteration : map;
import std.array : array;
import std.range : chain;
assert(SysTime(DateTime.init, UTC()).opCmp(SysTime(0, UTC())) == 0);
assert(SysTime(DateTime.init, UTC()).opCmp(SysTime(0)) == 0);
assert(SysTime(Date.init, UTC()).opCmp(SysTime(0)) == 0);
assert(SysTime(0).opCmp(SysTime(0)) == 0);
static void testEqual(SysTime st, immutable TimeZone tz1, immutable TimeZone tz2)
{
auto st1 = st;
st1.timezone = tz1;
auto st2 = st;
st2.timezone = tz2;
assert(st1.opCmp(st2) == 0);
}
auto sts = array(map!SysTime(chain(testDateTimesBC, testDateTimesAD)));
foreach (st; sts)
{
foreach (tz1; testTZs)
{
foreach (tz2; testTZs)
testEqual(st, tz1, tz2);
}
}
static void testCmp(SysTime st1, immutable TimeZone tz1, SysTime st2, immutable TimeZone tz2)
{
st1.timezone = tz1;
st2.timezone = tz2;
assert(st1.opCmp(st2) < 0);
assert(st2.opCmp(st1) > 0);
}
foreach (si, st1; sts)
{
foreach (st2; sts[si + 1 .. $])
{
foreach (tz1; testTZs)
{
foreach (tz2; testTZs)
testCmp(st1, tz1, st2, tz2);
}
}
}
auto st = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
const cst = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 33, 30));
assert(st.opCmp(st) == 0);
assert(st.opCmp(cst) == 0);
//assert(st.opCmp(ist) == 0);
assert(cst.opCmp(st) == 0);
assert(cst.opCmp(cst) == 0);
//assert(cst.opCmp(ist) == 0);
//assert(ist.opCmp(st) == 0);
//assert(ist.opCmp(cst) == 0);
//assert(ist.opCmp(ist) == 0);
}
/**
* Returns: A hash of the $(LREF SysTime)
*/
size_t toHash() const @nogc pure nothrow @safe
{
static if (is(size_t == ulong))
return _stdTime;
else
{
// MurmurHash2
enum ulong m = 0xc6a4a7935bd1e995UL;
enum ulong n = m * 16;
enum uint r = 47;
ulong k = _stdTime;
k *= m;
k ^= k >> r;
k *= m;
ulong h = n;
h ^= k;
h *= m;
return cast(size_t) h;
}
}
@safe unittest
{
assert(SysTime(0).toHash == SysTime(0).toHash);
assert(SysTime(DateTime(2000, 1, 1)).toHash == SysTime(DateTime(2000, 1, 1)).toHash);
assert(SysTime(DateTime(2000, 1, 1)).toHash != SysTime(DateTime(2000, 1, 2)).toHash);
// test that timezones aren't taken into account
assert(SysTime(0, LocalTime()).toHash == SysTime(0, LocalTime()).toHash);
assert(SysTime(0, LocalTime()).toHash == SysTime(0, UTC()).toHash);
assert(SysTime(DateTime(2000, 1, 1), LocalTime()).toHash == SysTime(DateTime(2000, 1, 1), LocalTime()).toHash);
immutable zone = new SimpleTimeZone(dur!"minutes"(60));
assert(SysTime(DateTime(2000, 1, 1, 1), zone).toHash == SysTime(DateTime(2000, 1, 1), UTC()).toHash);
assert(SysTime(DateTime(2000, 1, 1), zone).toHash != SysTime(DateTime(2000, 1, 1), UTC()).toHash);
}
/++
Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive
are B.C.
+/
@property short year() @safe const nothrow
{
return (cast(Date) this).year;
}
@safe unittest
{
import std.range : chain;
static void test(SysTime sysTime, long expected)
{
assert(sysTime.year == expected, format("Value given: %s", sysTime));
}
test(SysTime(0, UTC()), 1);
test(SysTime(1, UTC()), 1);
test(SysTime(-1, UTC()), 0);
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (tod; testTODs)
{
auto dt = DateTime(Date(year, md.month, md.day), tod);
foreach (tz; testTZs)
{
foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), year);
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.year == 1999);
//assert(ist.year == 1999);
}
/++
Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive
are B.C.
Params:
year = The year to set this $(LREF SysTime)'s year to.
Throws:
$(REF DateTimeException,std,datetime,date) if the new year is not
a leap year and the resulting date would be on February 29th.
+/
@property void year(int year) @safe
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto date = Date(cast(int) days);
date.year = year;
immutable newDaysHNSecs = convert!("days", "hnsecs")(date.dayOfGregorianCal - 1);
adjTime = newDaysHNSecs + hnsecs;
}
///
@safe unittest
{
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1999, 7, 6, 9, 7, 5)).year == 1999);
assert(SysTime(DateTime(2010, 10, 4, 0, 0, 30)).year == 2010);
assert(SysTime(DateTime(-7, 4, 5, 7, 45, 2)).year == -7);
}
@safe unittest
{
import std.range : chain;
static void test(SysTime st, int year, in SysTime expected)
{
st.year = year;
assert(st == expected);
}
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
foreach (year; chain(testYearsBC, testYearsAD))
{
auto e = SysTime(DateTime(year, dt.month, dt.day, dt.hour, dt.minute, dt.second),
st.fracSecs,
st.timezone);
test(st, year, e);
}
}
foreach (fs; testFracSecs)
{
foreach (tz; testTZs)
{
foreach (tod; testTODs)
{
test(SysTime(DateTime(Date(1999, 2, 28), tod), fs, tz), 2000,
SysTime(DateTime(Date(2000, 2, 28), tod), fs, tz));
test(SysTime(DateTime(Date(2000, 2, 28), tod), fs, tz), 1999,
SysTime(DateTime(Date(1999, 2, 28), tod), fs, tz));
}
foreach (tod; testTODsThrown)
{
auto st = SysTime(DateTime(Date(2000, 2, 29), tod), fs, tz);
assertThrown!DateTimeException(st.year = 1999);
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.year = 7));
//static assert(!__traits(compiles, ist.year = 7));
}
/++
Year B.C. of the Gregorian Calendar counting year 0 as 1 B.C.
Throws:
$(REF DateTimeException,std,datetime,date) if $(D isAD) is true.
+/
@property ushort yearBC() @safe const
{
return (cast(Date) this).yearBC;
}
///
@safe unittest
{
import std.datetime.date : DateTime;
assert(SysTime(DateTime(0, 1, 1, 12, 30, 33)).yearBC == 1);
assert(SysTime(DateTime(-1, 1, 1, 10, 7, 2)).yearBC == 2);
assert(SysTime(DateTime(-100, 1, 1, 4, 59, 0)).yearBC == 101);
}
@safe unittest
{
import std.exception : assertNotThrown;
foreach (st; testSysTimesBC)
{
auto msg = format("SysTime: %s", st);
assertNotThrown!DateTimeException(st.yearBC, msg);
assert(st.yearBC == (st.year * -1) + 1, msg);
}
foreach (st; [testSysTimesAD[0], testSysTimesAD[$/2], testSysTimesAD[$-1]])
assertThrown!DateTimeException(st.yearBC, format("SysTime: %s", st));
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
st.year = 12;
assert(st.year == 12);
static assert(!__traits(compiles, cst.year = 12));
//static assert(!__traits(compiles, ist.year = 12));
}
/++
Year B.C. of the Gregorian Calendar counting year 0 as 1 B.C.
Params:
year = The year B.C. to set this $(LREF SysTime)'s year to.
Throws:
$(REF DateTimeException,std,datetime,date) if a non-positive value
is given.
+/
@property void yearBC(int year) @safe
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto date = Date(cast(int) days);
date.yearBC = year;
immutable newDaysHNSecs = convert!("days", "hnsecs")(date.dayOfGregorianCal - 1);
adjTime = newDaysHNSecs + hnsecs;
}
@safe unittest
{
auto st = SysTime(DateTime(2010, 1, 1, 7, 30, 0));
st.yearBC = 1;
assert(st == SysTime(DateTime(0, 1, 1, 7, 30, 0)));
st.yearBC = 10;
assert(st == SysTime(DateTime(-9, 1, 1, 7, 30, 0)));
}
@safe unittest
{
import std.range : chain;
static void test(SysTime st, int year, in SysTime expected)
{
st.yearBC = year;
assert(st == expected, format("SysTime: %s", st));
}
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
foreach (year; testYearsBC)
{
auto e = SysTime(DateTime(year, dt.month, dt.day, dt.hour, dt.minute, dt.second),
st.fracSecs,
st.timezone);
test(st, (year * -1) + 1, e);
}
}
foreach (st; [testSysTimesBC[0], testSysTimesBC[$ - 1], testSysTimesAD[0], testSysTimesAD[$ - 1]])
{
foreach (year; testYearsBC)
assertThrown!DateTimeException(st.yearBC = year);
}
foreach (fs; testFracSecs)
{
foreach (tz; testTZs)
{
foreach (tod; testTODs)
{
test(SysTime(DateTime(Date(-1999, 2, 28), tod), fs, tz), 2001,
SysTime(DateTime(Date(-2000, 2, 28), tod), fs, tz));
test(SysTime(DateTime(Date(-2000, 2, 28), tod), fs, tz), 2000,
SysTime(DateTime(Date(-1999, 2, 28), tod), fs, tz));
}
foreach (tod; testTODsThrown)
{
auto st = SysTime(DateTime(Date(-2000, 2, 29), tod), fs, tz);
assertThrown!DateTimeException(st.year = -1999);
}
}
}
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
st.yearBC = 12;
assert(st.yearBC == 12);
static assert(!__traits(compiles, cst.yearBC = 12));
//static assert(!__traits(compiles, ist.yearBC = 12));
}
/++
Month of a Gregorian Year.
+/
@property Month month() @safe const nothrow
{
return (cast(Date) this).month;
}
///
@safe unittest
{
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1999, 7, 6, 9, 7, 5)).month == 7);
assert(SysTime(DateTime(2010, 10, 4, 0, 0, 30)).month == 10);
assert(SysTime(DateTime(-7, 4, 5, 7, 45, 2)).month == 4);
}
@safe unittest
{
import std.range : chain;
static void test(SysTime sysTime, Month expected)
{
assert(sysTime.month == expected, format("Value given: %s", sysTime));
}
test(SysTime(0, UTC()), Month.jan);
test(SysTime(1, UTC()), Month.jan);
test(SysTime(-1, UTC()), Month.dec);
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (tod; testTODs)
{
auto dt = DateTime(Date(year, md.month, md.day), tod);
foreach (fs; testFracSecs)
{
foreach (tz; testTZs)
test(SysTime(dt, fs, tz), md.month);
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.month == 7);
//assert(ist.month == 7);
}
/++
Month of a Gregorian Year.
Params:
month = The month to set this $(LREF SysTime)'s month to.
Throws:
$(REF DateTimeException,std,datetime,date) if the given month is
not a valid month.
+/
@property void month(Month month) @safe
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto date = Date(cast(int) days);
date.month = month;
immutable newDaysHNSecs = convert!("days", "hnsecs")(date.dayOfGregorianCal - 1);
adjTime = newDaysHNSecs + hnsecs;
}
@safe unittest
{
import std.algorithm.iteration : filter;
import std.range : chain;
static void test(SysTime st, Month month, in SysTime expected)
{
st.month = cast(Month) month;
assert(st == expected);
}
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
foreach (md; testMonthDays)
{
if (st.day > maxDay(dt.year, md.month))
continue;
auto e = SysTime(DateTime(dt.year, md.month, dt.day, dt.hour, dt.minute, dt.second),
st.fracSecs,
st.timezone);
test(st, md.month, e);
}
}
foreach (fs; testFracSecs)
{
foreach (tz; testTZs)
{
foreach (tod; testTODs)
{
foreach (year; filter!((a){return yearIsLeapYear(a);}) (chain(testYearsBC, testYearsAD)))
{
test(SysTime(DateTime(Date(year, 1, 29), tod), fs, tz),
Month.feb,
SysTime(DateTime(Date(year, 2, 29), tod), fs, tz));
}
foreach (year; chain(testYearsBC, testYearsAD))
{
test(SysTime(DateTime(Date(year, 1, 28), tod), fs, tz),
Month.feb,
SysTime(DateTime(Date(year, 2, 28), tod), fs, tz));
test(SysTime(DateTime(Date(year, 7, 30), tod), fs, tz),
Month.jun,
SysTime(DateTime(Date(year, 6, 30), tod), fs, tz));
}
}
}
}
foreach (fs; [testFracSecs[0], testFracSecs[$-1]])
{
foreach (tz; testTZs)
{
foreach (tod; testTODsThrown)
{
foreach (year; [testYearsBC[$-3], testYearsBC[$-2],
testYearsBC[$-2], testYearsAD[0],
testYearsAD[$-2], testYearsAD[$-1]])
{
auto day = yearIsLeapYear(year) ? 30 : 29;
auto st1 = SysTime(DateTime(Date(year, 1, day), tod), fs, tz);
assertThrown!DateTimeException(st1.month = Month.feb);
auto st2 = SysTime(DateTime(Date(year, 7, 31), tod), fs, tz);
assertThrown!DateTimeException(st2.month = Month.jun);
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.month = 12));
//static assert(!__traits(compiles, ist.month = 12));
}
/++
Day of a Gregorian Month.
+/
@property ubyte day() @safe const nothrow
{
return (cast(Date) this).day;
}
///
@safe unittest
{
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1999, 7, 6, 9, 7, 5)).day == 6);
assert(SysTime(DateTime(2010, 10, 4, 0, 0, 30)).day == 4);
assert(SysTime(DateTime(-7, 4, 5, 7, 45, 2)).day == 5);
}
@safe unittest
{
import std.range : chain;
static void test(SysTime sysTime, int expected)
{
assert(sysTime.day == expected, format("Value given: %s", sysTime));
}
test(SysTime(0, UTC()), 1);
test(SysTime(1, UTC()), 1);
test(SysTime(-1, UTC()), 31);
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (tod; testTODs)
{
auto dt = DateTime(Date(year, md.month, md.day), tod);
foreach (tz; testTZs)
{
foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), md.day);
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.day == 6);
//assert(ist.day == 6);
}
/++
Day of a Gregorian Month.
Params:
day = The day of the month to set this $(LREF SysTime)'s day to.
Throws:
$(REF DateTimeException,std,datetime,date) if the given day is not
a valid day of the current month.
+/
@property void day(int day) @safe
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto date = Date(cast(int) days);
date.day = day;
immutable newDaysHNSecs = convert!("days", "hnsecs")(date.dayOfGregorianCal - 1);
adjTime = newDaysHNSecs + hnsecs;
}
@safe unittest
{
import std.range : chain;
import std.traits : EnumMembers;
foreach (day; chain(testDays))
{
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
if (day > maxDay(dt.year, dt.month))
continue;
auto expected = SysTime(DateTime(dt.year, dt.month, day, dt.hour, dt.minute, dt.second),
st.fracSecs,
st.timezone);
st.day = day;
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
foreach (tz; testTZs)
{
foreach (tod; testTODs)
{
foreach (fs; testFracSecs)
{
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (month; EnumMembers!Month)
{
auto st = SysTime(DateTime(Date(year, month, 1), tod), fs, tz);
immutable max = maxDay(year, month);
auto expected = SysTime(DateTime(Date(year, month, max), tod), fs, tz);
st.day = max;
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
}
}
}
foreach (tz; testTZs)
{
foreach (tod; testTODsThrown)
{
foreach (fs; [testFracSecs[0], testFracSecs[$-1]])
{
foreach (year; [testYearsBC[$-3], testYearsBC[$-2],
testYearsBC[$-2], testYearsAD[0],
testYearsAD[$-2], testYearsAD[$-1]])
{
foreach (month; EnumMembers!Month)
{
auto st = SysTime(DateTime(Date(year, month, 1), tod), fs, tz);
immutable max = maxDay(year, month);
assertThrown!DateTimeException(st.day = max + 1);
}
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.day = 27));
//static assert(!__traits(compiles, ist.day = 27));
}
/++
Hours past midnight.
+/
@property ubyte hour() @safe const nothrow
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
return cast(ubyte) getUnitsFromHNSecs!"hours"(hnsecs);
}
@safe unittest
{
import std.range : chain;
static void test(SysTime sysTime, int expected)
{
assert(sysTime.hour == expected, format("Value given: %s", sysTime));
}
test(SysTime(0, UTC()), 0);
test(SysTime(1, UTC()), 0);
test(SysTime(-1, UTC()), 23);
foreach (tz; testTZs)
{
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (hour; testHours)
{
foreach (minute; testMinSecs)
{
foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day), TimeOfDay(hour, minute, second));
foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), hour);
}
}
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.hour == 12);
//assert(ist.hour == 12);
}
/++
Hours past midnight.
Params:
hour = The hours to set this $(LREF SysTime)'s hour to.
Throws:
$(REF DateTimeException,std,datetime,date) if the given hour are
not a valid hour of the day.
+/
@property void hour(int hour) @safe
{
enforceValid!"hours"(hour);
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs);
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
hnsecs = removeUnitsFromHNSecs!"hours"(hnsecs);
hnsecs += convert!("hours", "hnsecs")(hour);
if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
}
@safe unittest
{
import std.range : chain;
foreach (hour; chain(testHours))
{
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
auto expected = SysTime(DateTime(dt.year, dt.month, dt.day, hour, dt.minute, dt.second),
st.fracSecs,
st.timezone);
st.hour = hour;
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
auto st = testSysTimesAD[0];
assertThrown!DateTimeException(st.hour = -1);
assertThrown!DateTimeException(st.hour = 60);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.hour = 27));
//static assert(!__traits(compiles, ist.hour = 27));
}
/++
Minutes past the current hour.
+/
@property ubyte minute() @safe const nothrow
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
hnsecs = removeUnitsFromHNSecs!"hours"(hnsecs);
return cast(ubyte) getUnitsFromHNSecs!"minutes"(hnsecs);
}
@safe unittest
{
import std.range : chain;
static void test(SysTime sysTime, int expected)
{
assert(sysTime.minute == expected, format("Value given: %s", sysTime));
}
test(SysTime(0, UTC()), 0);
test(SysTime(1, UTC()), 0);
test(SysTime(-1, UTC()), 59);
foreach (tz; testTZs)
{
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (hour; testHours)
{
foreach (minute; testMinSecs)
{
foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day), TimeOfDay(hour, minute, second));
foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), minute);
}
}
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.minute == 30);
//assert(ist.minute == 30);
}
/++
Minutes past the current hour.
Params:
minute = The minute to set this $(LREF SysTime)'s minute to.
Throws:
$(REF DateTimeException,std,datetime,date) if the given minute are
not a valid minute of an hour.
+/
@property void minute(int minute) @safe
{
enforceValid!"minutes"(minute);
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs);
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
hnsecs = removeUnitsFromHNSecs!"minutes"(hnsecs);
hnsecs += convert!("hours", "hnsecs")(hour);
hnsecs += convert!("minutes", "hnsecs")(minute);
if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
}
@safe unittest
{
import std.range : chain;
foreach (minute; testMinSecs)
{
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
auto expected = SysTime(DateTime(dt.year, dt.month, dt.day, dt.hour, minute, dt.second),
st.fracSecs,
st.timezone);
st.minute = minute;
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
auto st = testSysTimesAD[0];
assertThrown!DateTimeException(st.minute = -1);
assertThrown!DateTimeException(st.minute = 60);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.minute = 27));
//static assert(!__traits(compiles, ist.minute = 27));
}
/++
Seconds past the current minute.
+/
@property ubyte second() @safe const nothrow
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
hnsecs = removeUnitsFromHNSecs!"hours"(hnsecs);
hnsecs = removeUnitsFromHNSecs!"minutes"(hnsecs);
return cast(ubyte) getUnitsFromHNSecs!"seconds"(hnsecs);
}
@safe unittest
{
import std.range : chain;
static void test(SysTime sysTime, int expected)
{
assert(sysTime.second == expected, format("Value given: %s", sysTime));
}
test(SysTime(0, UTC()), 0);
test(SysTime(1, UTC()), 0);
test(SysTime(-1, UTC()), 59);
foreach (tz; testTZs)
{
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (hour; testHours)
{
foreach (minute; testMinSecs)
{
foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day), TimeOfDay(hour, minute, second));
foreach (fs; testFracSecs)
test(SysTime(dt, fs, tz), second);
}
}
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.second == 33);
//assert(ist.second == 33);
}
/++
Seconds past the current minute.
Params:
second = The second to set this $(LREF SysTime)'s second to.
Throws:
$(REF DateTimeException,std,datetime,date) if the given second are
not a valid second of a minute.
+/
@property void second(int second) @safe
{
enforceValid!"seconds"(second);
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs);
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = hnsecs < 0;
if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
hnsecs = removeUnitsFromHNSecs!"seconds"(hnsecs);
hnsecs += convert!("hours", "hnsecs")(hour);
hnsecs += convert!("minutes", "hnsecs")(minute);
hnsecs += convert!("seconds", "hnsecs")(second);
if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + hnsecs;
}
@safe unittest
{
import std.range : chain;
foreach (second; testMinSecs)
{
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
auto expected = SysTime(DateTime(dt.year, dt.month, dt.day, dt.hour, dt.minute, second),
st.fracSecs,
st.timezone);
st.second = second;
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
auto st = testSysTimesAD[0];
assertThrown!DateTimeException(st.second = -1);
assertThrown!DateTimeException(st.second = 60);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.seconds = 27));
//static assert(!__traits(compiles, ist.seconds = 27));
}
/++
Fractional seconds past the second (i.e. the portion of a
$(LREF SysTime) which is less than a second).
+/
@property Duration fracSecs() @safe const nothrow
{
auto hnsecs = removeUnitsFromHNSecs!"days"(adjTime);
if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
return dur!"hnsecs"(removeUnitsFromHNSecs!"seconds"(hnsecs));
}
///
@safe unittest
{
import core.time : msecs, usecs, hnsecs, nsecs;
import std.datetime.date : DateTime;
auto dt = DateTime(1982, 4, 1, 20, 59, 22);
assert(SysTime(dt, msecs(213)).fracSecs == msecs(213));
assert(SysTime(dt, usecs(5202)).fracSecs == usecs(5202));
assert(SysTime(dt, hnsecs(1234567)).fracSecs == hnsecs(1234567));
// SysTime and Duration both have a precision of hnsecs (100 ns),
// so nsecs are going to be truncated.
assert(SysTime(dt, nsecs(123456789)).fracSecs == nsecs(123456700));
}
@safe unittest
{
import std.range : chain;
import core.time;
assert(SysTime(0, UTC()).fracSecs == Duration.zero);
assert(SysTime(1, UTC()).fracSecs == hnsecs(1));
assert(SysTime(-1, UTC()).fracSecs == hnsecs(9_999_999));
foreach (tz; testTZs)
{
foreach (year; chain(testYearsBC, testYearsAD))
{
foreach (md; testMonthDays)
{
foreach (hour; testHours)
{
foreach (minute; testMinSecs)
{
foreach (second; testMinSecs)
{
auto dt = DateTime(Date(year, md.month, md.day), TimeOfDay(hour, minute, second));
foreach (fs; testFracSecs)
assert(SysTime(dt, fs, tz).fracSecs == fs);
}
}
}
}
}
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.fracSecs == Duration.zero);
//assert(ist.fracSecs == Duration.zero);
}
/++
Fractional seconds past the second (i.e. the portion of a
$(LREF SysTime) which is less than a second).
Params:
fracSecs = The duration to set this $(LREF SysTime)'s fractional
seconds to.
Throws:
$(REF DateTimeException,std,datetime,date) if the given duration
is negative or if it's greater than or equal to one second.
+/
@property void fracSecs(Duration fracSecs) @safe
{
enforce(fracSecs >= Duration.zero, new DateTimeException("A SysTime cannot have negative fractional seconds."));
enforce(fracSecs < seconds(1), new DateTimeException("Fractional seconds must be less than one second."));
auto oldHNSecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(oldHNSecs);
immutable daysHNSecs = convert!("days", "hnsecs")(days);
immutable negative = oldHNSecs < 0;
if (negative)
oldHNSecs += convert!("hours", "hnsecs")(24);
immutable seconds = splitUnitsFromHNSecs!"seconds"(oldHNSecs);
immutable secondsHNSecs = convert!("seconds", "hnsecs")(seconds);
auto newHNSecs = fracSecs.total!"hnsecs" + secondsHNSecs;
if (negative)
newHNSecs -= convert!("hours", "hnsecs")(24);
adjTime = daysHNSecs + newHNSecs;
}
///
@safe unittest
{
import core.time : Duration, msecs, hnsecs, nsecs;
import std.datetime.date : DateTime;
auto st = SysTime(DateTime(1982, 4, 1, 20, 59, 22));
assert(st.fracSecs == Duration.zero);
st.fracSecs = msecs(213);
assert(st.fracSecs == msecs(213));
st.fracSecs = hnsecs(1234567);
assert(st.fracSecs == hnsecs(1234567));
// SysTime has a precision of hnsecs (100 ns), so nsecs are
// going to be truncated.
st.fracSecs = nsecs(123456789);
assert(st.fracSecs == hnsecs(1234567));
}
@safe unittest
{
import std.range : chain;
import core.time;
foreach (fracSec; testFracSecs)
{
foreach (st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime) st;
auto expected = SysTime(dt, fracSec, st.timezone);
st.fracSecs = fracSec;
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
auto st = testSysTimesAD[0];
assertThrown!DateTimeException(st.fracSecs = hnsecs(-1));
assertThrown!DateTimeException(st.fracSecs = seconds(1));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.fracSecs = msecs(7)));
//static assert(!__traits(compiles, ist.fracSecs = msecs(7)));
}
/++
The total hnsecs from midnight, January 1st, 1 A.D. UTC. This is the
internal representation of $(LREF SysTime).
+/
@property long stdTime() @safe const pure nothrow
{
return _stdTime;
}
@safe unittest
{
import core.time;
assert(SysTime(0).stdTime == 0);
assert(SysTime(1).stdTime == 1);
assert(SysTime(-1).stdTime == -1);
assert(SysTime(DateTime(1, 1, 1, 0, 0, 33), hnsecs(502), UTC()).stdTime == 330_000_502L);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), UTC()).stdTime == 621_355_968_000_000_000L);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.stdTime > 0);
//assert(ist.stdTime > 0);
}
/++
The total hnsecs from midnight, January 1st, 1 A.D. UTC. This is the
internal representation of $(LREF SysTime).
Params:
stdTime = The number of hnsecs since January 1st, 1 A.D. UTC.
+/
@property void stdTime(long stdTime) @safe pure nothrow
{
_stdTime = stdTime;
}
@safe unittest
{
import core.time;
static void test(long stdTime, in SysTime expected, size_t line = __LINE__)
{
auto st = SysTime(0, UTC());
st.stdTime = stdTime;
assert(st == expected);
}
test(0, SysTime(Date(1, 1, 1), UTC()));
test(1, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1), UTC()));
test(-1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()));
test(330_000_502L, SysTime(DateTime(1, 1, 1, 0, 0, 33), hnsecs(502), UTC()));
test(621_355_968_000_000_000L, SysTime(DateTime(1970, 1, 1, 0, 0, 0), UTC()));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.stdTime = 27));
//static assert(!__traits(compiles, ist.stdTime = 27));
}
/++
The current time zone of this $(LREF SysTime). Its internal time is
always kept in UTC, so there are no conversion issues between time zones
due to DST. Functions which return all or part of the time - such as
hours - adjust the time to this $(LREF SysTime)'s time zone before
returning.
+/
@property immutable(TimeZone) timezone() @safe const pure nothrow
{
return _timezone;
}
/++
The current time zone of this $(LREF SysTime). It's internal time is
always kept in UTC, so there are no conversion issues between time zones
due to DST. Functions which return all or part of the time - such as
hours - adjust the time to this $(LREF SysTime)'s time zone before
returning.
Params:
timezone = The $(REF _TimeZone,std,datetime,_timezone) to set this
$(LREF SysTime)'s time zone to.
+/
@property void timezone(immutable TimeZone timezone) @safe pure nothrow
{
if (timezone is null)
_timezone = LocalTime();
else
_timezone = timezone;
}
/++
Returns whether DST is in effect for this $(LREF SysTime).
+/
@property bool dstInEffect() @safe const nothrow
{
return _timezone.dstInEffect(_stdTime);
// This function's unit testing is done in the time zone classes.
}
/++
Returns what the offset from UTC is for this $(LREF SysTime).
It includes the DST offset in effect at that time (if any).
+/
@property Duration utcOffset() @safe const nothrow
{
return _timezone.utcOffsetAt(_stdTime);
}
/++
Returns a $(LREF SysTime) with the same std time as this one, but with
$(REF LocalTime,std,datetime,timezone) as its time zone.
+/
SysTime toLocalTime() @safe const pure nothrow
{
return SysTime(_stdTime, LocalTime());
}
@safe unittest
{
import core.time;
{
auto sysTime = SysTime(DateTime(1982, 1, 4, 8, 59, 7), hnsecs(27));
assert(sysTime == sysTime.toLocalTime());
assert(sysTime._stdTime == sysTime.toLocalTime()._stdTime);
assert(sysTime.toLocalTime().timezone is LocalTime());
assert(sysTime.toLocalTime().timezone is sysTime.timezone);
assert(sysTime.toLocalTime().timezone !is UTC());
}
{
auto stz = new immutable SimpleTimeZone(dur!"minutes"(-3 * 60));
auto sysTime = SysTime(DateTime(1982, 1, 4, 8, 59, 7), hnsecs(27), stz);
assert(sysTime == sysTime.toLocalTime());
assert(sysTime._stdTime == sysTime.toLocalTime()._stdTime);
assert(sysTime.toLocalTime().timezone is LocalTime());
assert(sysTime.toLocalTime().timezone !is UTC());
assert(sysTime.toLocalTime().timezone !is stz);
}
}
/++
Returns a $(LREF SysTime) with the same std time as this one, but with
$(D UTC) as its time zone.
+/
SysTime toUTC() @safe const pure nothrow
{
return SysTime(_stdTime, UTC());
}
@safe unittest
{
import core.time;
auto sysTime = SysTime(DateTime(1982, 1, 4, 8, 59, 7), hnsecs(27));
assert(sysTime == sysTime.toUTC());
assert(sysTime._stdTime == sysTime.toUTC()._stdTime);
assert(sysTime.toUTC().timezone is UTC());
assert(sysTime.toUTC().timezone !is LocalTime());
assert(sysTime.toUTC().timezone !is sysTime.timezone);
}
/++
Returns a $(LREF SysTime) with the same std time as this one, but with
given time zone as its time zone.
+/
SysTime toOtherTZ(immutable TimeZone tz) @safe const pure nothrow
{
if (tz is null)
return SysTime(_stdTime, LocalTime());
else
return SysTime(_stdTime, tz);
}
@safe unittest
{
import core.time;
auto stz = new immutable SimpleTimeZone(dur!"minutes"(11 * 60));
auto sysTime = SysTime(DateTime(1982, 1, 4, 8, 59, 7), hnsecs(27));
assert(sysTime == sysTime.toOtherTZ(stz));
assert(sysTime._stdTime == sysTime.toOtherTZ(stz)._stdTime);
assert(sysTime.toOtherTZ(stz).timezone is stz);
assert(sysTime.toOtherTZ(stz).timezone !is LocalTime());
assert(sysTime.toOtherTZ(stz).timezone !is UTC());
}
/++
Converts this $(LREF SysTime) to unix time (i.e. seconds from midnight,
January 1st, 1970 in UTC).
The C standard does not specify the representation of time_t, so it is
implementation defined. On POSIX systems, unix time is equivalent to
time_t, but that's not necessarily true on other systems (e.g. it is
not true for the Digital Mars C runtime). So, be careful when using unix
time with C functions on non-POSIX systems.
By default, the return type is time_t (which is normally an alias for
int on 32-bit systems and long on 64-bit systems), but if a different
size is required than either int or long can be passed as a template
argument to get the desired size.
If the return type is int, and the result can't fit in an int, then the
closest value that can be held in 32 bits will be used (so $(D int.max)
if it goes over and $(D int.min) if it goes under). However, no attempt
is made to deal with integer overflow if the return type is long.
Params:
T = The return type (int or long). It defaults to time_t, which is
normally 32 bits on a 32-bit system and 64 bits on a 64-bit
system.
Returns:
A signed integer representing the unix time which is equivalent to
this SysTime.
+/
T toUnixTime(T = time_t)() @safe const pure nothrow
if (is(T == int) || is(T == long))
{
return stdTimeToUnixTime!T(_stdTime);
}
///
@safe unittest
{
import core.time : hours;
import std.datetime.date : DateTime;
import std.datetime.timezone : SimpleTimeZone, UTC;
assert(SysTime(DateTime(1970, 1, 1), UTC()).toUnixTime() == 0);
auto pst = new immutable SimpleTimeZone(hours(-8));
assert(SysTime(DateTime(1970, 1, 1), pst).toUnixTime() == 28800);
auto utc = SysTime(DateTime(2007, 12, 22, 8, 14, 45), UTC());
assert(utc.toUnixTime() == 1_198_311_285);
auto ca = SysTime(DateTime(2007, 12, 22, 8, 14, 45), pst);
assert(ca.toUnixTime() == 1_198_340_085);
}
@safe unittest
{
import std.meta : AliasSeq;
import core.time;
assert(SysTime(DateTime(1970, 1, 1), UTC()).toUnixTime() == 0);
static foreach (units; ["hnsecs", "usecs", "msecs"])
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), dur!units(1), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), UTC()).toUnixTime() == 1);
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), usecs(999_999), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), msecs(999), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), UTC()).toUnixTime() == -1);
}
/++
Converts from unix time (i.e. seconds from midnight, January 1st, 1970
in UTC) to a $(LREF SysTime).
The C standard does not specify the representation of time_t, so it is
implementation defined. On POSIX systems, unix time is equivalent to
time_t, but that's not necessarily true on other systems (e.g. it is
not true for the Digital Mars C runtime). So, be careful when using unix
time with C functions on non-POSIX systems.
Params:
unixTime = Seconds from midnight, January 1st, 1970 in UTC.
tz = The time zone for the SysTime that's returned.
+/
static SysTime fromUnixTime(long unixTime, immutable TimeZone tz = LocalTime()) @safe pure nothrow
{
return SysTime(unixTimeToStdTime(unixTime), tz);
}
///
@safe unittest
{
import core.time : hours;
import std.datetime.date : DateTime;
import std.datetime.timezone : SimpleTimeZone, UTC;
assert(SysTime.fromUnixTime(0) ==
SysTime(DateTime(1970, 1, 1), UTC()));
auto pst = new immutable SimpleTimeZone(hours(-8));
assert(SysTime.fromUnixTime(28800) ==
SysTime(DateTime(1970, 1, 1), pst));
auto st1 = SysTime.fromUnixTime(1_198_311_285, UTC());
assert(st1 == SysTime(DateTime(2007, 12, 22, 8, 14, 45), UTC()));
assert(st1.timezone is UTC());
assert(st1 == SysTime(DateTime(2007, 12, 22, 0, 14, 45), pst));
auto st2 = SysTime.fromUnixTime(1_198_311_285, pst);
assert(st2 == SysTime(DateTime(2007, 12, 22, 8, 14, 45), UTC()));
assert(st2.timezone is pst);
assert(st2 == SysTime(DateTime(2007, 12, 22, 0, 14, 45), pst));
}
@safe unittest
{
import core.time;
assert(SysTime.fromUnixTime(0) == SysTime(DateTime(1970, 1, 1), UTC()));
assert(SysTime.fromUnixTime(1) == SysTime(DateTime(1970, 1, 1, 0, 0, 1), UTC()));
assert(SysTime.fromUnixTime(-1) == SysTime(DateTime(1969, 12, 31, 23, 59, 59), UTC()));
auto st = SysTime.fromUnixTime(0);
auto dt = cast(DateTime) st;
assert(dt <= DateTime(1970, 2, 1) && dt >= DateTime(1969, 12, 31));
assert(st.timezone is LocalTime());
auto aest = new immutable SimpleTimeZone(hours(10));
assert(SysTime.fromUnixTime(-36000) == SysTime(DateTime(1970, 1, 1), aest));
}
/++
Returns a $(D timeval) which represents this $(LREF SysTime).
Note that like all conversions in std.datetime, this is a truncating
conversion.
If $(D timeval.tv_sec) is int, and the result can't fit in an int, then
the closest value that can be held in 32 bits will be used for
$(D tv_sec). (so $(D int.max) if it goes over and $(D int.min) if it
goes under).
+/
timeval toTimeVal() @safe const pure nothrow
{
immutable tv_sec = toUnixTime!(typeof(timeval.tv_sec))();
immutable fracHNSecs = removeUnitsFromHNSecs!"seconds"(_stdTime - 621_355_968_000_000_000L);
immutable tv_usec = cast(typeof(timeval.tv_usec))convert!("hnsecs", "usecs")(fracHNSecs);
return timeval(tv_sec, tv_usec);
}
@safe unittest
{
import core.time;
assert(SysTime(DateTime(1970, 1, 1), UTC()).toTimeVal() == timeval(0, 0));
assert(SysTime(DateTime(1970, 1, 1), hnsecs(9), UTC()).toTimeVal() == timeval(0, 0));
assert(SysTime(DateTime(1970, 1, 1), hnsecs(10), UTC()).toTimeVal() == timeval(0, 1));
assert(SysTime(DateTime(1970, 1, 1), usecs(7), UTC()).toTimeVal() == timeval(0, 7));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), UTC()).toTimeVal() == timeval(1, 0));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), hnsecs(9), UTC()).toTimeVal() == timeval(1, 0));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), hnsecs(10), UTC()).toTimeVal() == timeval(1, 1));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), usecs(7), UTC()).toTimeVal() == timeval(1, 7));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toTimeVal() == timeval(0, 0));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), hnsecs(9_999_990), UTC()).toTimeVal() == timeval(0, -1));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), usecs(999_999), UTC()).toTimeVal() == timeval(0, -1));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), usecs(999), UTC()).toTimeVal() == timeval(0, -999_001));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), msecs(999), UTC()).toTimeVal() == timeval(0, -1000));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), UTC()).toTimeVal() == timeval(-1, 0));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 58), usecs(17), UTC()).toTimeVal() == timeval(-1, -999_983));
}
version(StdDdoc)
{
private struct timespec {}
/++
Returns a $(D timespec) which represents this $(LREF SysTime).
$(BLUE This function is Posix-Only.)
+/
timespec toTimeSpec() @safe const pure nothrow;
}
else version(Posix)
{
timespec toTimeSpec() @safe const pure nothrow
{
immutable tv_sec = toUnixTime!(typeof(timespec.tv_sec))();
immutable fracHNSecs = removeUnitsFromHNSecs!"seconds"(_stdTime - 621_355_968_000_000_000L);
immutable tv_nsec = cast(typeof(timespec.tv_nsec))convert!("hnsecs", "nsecs")(fracHNSecs);
return timespec(tv_sec, tv_nsec);
}
@safe unittest
{
import core.time;
assert(SysTime(DateTime(1970, 1, 1), UTC()).toTimeSpec() == timespec(0, 0));
assert(SysTime(DateTime(1970, 1, 1), hnsecs(9), UTC()).toTimeSpec() == timespec(0, 900));
assert(SysTime(DateTime(1970, 1, 1), hnsecs(10), UTC()).toTimeSpec() == timespec(0, 1000));
assert(SysTime(DateTime(1970, 1, 1), usecs(7), UTC()).toTimeSpec() == timespec(0, 7000));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), UTC()).toTimeSpec() == timespec(1, 0));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), hnsecs(9), UTC()).toTimeSpec() == timespec(1, 900));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), hnsecs(10), UTC()).toTimeSpec() == timespec(1, 1000));
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), usecs(7), UTC()).toTimeSpec() == timespec(1, 7000));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toTimeSpec() ==
timespec(0, -100));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), hnsecs(9_999_990), UTC()).toTimeSpec() ==
timespec(0, -1000));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), usecs(999_999), UTC()).toTimeSpec() ==
timespec(0, -1_000));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), usecs(999), UTC()).toTimeSpec() ==
timespec(0, -999_001_000));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), msecs(999), UTC()).toTimeSpec() ==
timespec(0, -1_000_000));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 59), UTC()).toTimeSpec() ==
timespec(-1, 0));
assert(SysTime(DateTime(1969, 12, 31, 23, 59, 58), usecs(17), UTC()).toTimeSpec() ==
timespec(-1, -999_983_000));
}
}
/++
Returns a $(D tm) which represents this $(LREF SysTime).
+/
tm toTM() @safe const nothrow
{
auto dateTime = cast(DateTime) this;
tm timeInfo;
timeInfo.tm_sec = dateTime.second;
timeInfo.tm_min = dateTime.minute;
timeInfo.tm_hour = dateTime.hour;
timeInfo.tm_mday = dateTime.day;
timeInfo.tm_mon = dateTime.month - 1;
timeInfo.tm_year = dateTime.year - 1900;
timeInfo.tm_wday = dateTime.dayOfWeek;
timeInfo.tm_yday = dateTime.dayOfYear - 1;
timeInfo.tm_isdst = _timezone.dstInEffect(_stdTime);
version(Posix)
{
import std.utf : toUTFz;
timeInfo.tm_gmtoff = cast(int) convert!("hnsecs", "seconds")(adjTime - _stdTime);
auto zone = (timeInfo.tm_isdst ? _timezone.dstName : _timezone.stdName);
timeInfo.tm_zone = zone.toUTFz!(char*)();
}
return timeInfo;
}
@system unittest
{
import std.conv : to;
import core.time;
version(Posix)
{
import std.datetime.timezone : clearTZEnvVar, setTZEnvVar;
setTZEnvVar("America/Los_Angeles");
scope(exit) clearTZEnvVar();
}
{
auto timeInfo = SysTime(DateTime(1970, 1, 1)).toTM();
assert(timeInfo.tm_sec == 0);
assert(timeInfo.tm_min == 0);
assert(timeInfo.tm_hour == 0);
assert(timeInfo.tm_mday == 1);
assert(timeInfo.tm_mon == 0);
assert(timeInfo.tm_year == 70);
assert(timeInfo.tm_wday == 4);
assert(timeInfo.tm_yday == 0);
version(Posix)
assert(timeInfo.tm_isdst == 0);
else version(Windows)
assert(timeInfo.tm_isdst == 0 || timeInfo.tm_isdst == 1);
version(Posix)
{
assert(timeInfo.tm_gmtoff == -8 * 60 * 60);
assert(to!string(timeInfo.tm_zone) == "PST");
}
}
{
auto timeInfo = SysTime(DateTime(2010, 7, 4, 12, 15, 7), hnsecs(15)).toTM();
assert(timeInfo.tm_sec == 7);
assert(timeInfo.tm_min == 15);
assert(timeInfo.tm_hour == 12);
assert(timeInfo.tm_mday == 4);
assert(timeInfo.tm_mon == 6);
assert(timeInfo.tm_year == 110);
assert(timeInfo.tm_wday == 0);
assert(timeInfo.tm_yday == 184);
version(Posix)
assert(timeInfo.tm_isdst == 1);
else version(Windows)
assert(timeInfo.tm_isdst == 0 || timeInfo.tm_isdst == 1);
version(Posix)
{
assert(timeInfo.tm_gmtoff == -7 * 60 * 60);
assert(to!string(timeInfo.tm_zone) == "PDT");
}
}
}
/++
Adds the given number of years or months to this $(LREF SysTime). A
negative number will subtract.
Note that if day overflow is allowed, and the date with the adjusted
year/month overflows the number of days in the new month, then the month
will be incremented by one, and the day set to the number of days
overflowed. (e.g. if the day were 31 and the new month were June, then
the month would be incremented to July, and the new day would be 1). If
day overflow is not allowed, then the day will be set to the last valid
day in the month (e.g. June 31st would become June 30th).
Params:
units = The type of units to add ("years" or "months").
value = The number of months or years to add to this
$(LREF SysTime).
allowOverflow = Whether the days should be allowed to overflow,
causing the month to increment.
+/
ref SysTime add(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe nothrow
if (units == "years" || units == "months")
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto date = Date(cast(int) days);
date.add!units(value, allowOverflow);
days = date.dayOfGregorianCal - 1;
if (days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
}
immutable newDaysHNSecs = convert!("days", "hnsecs")(days);
adjTime = newDaysHNSecs + hnsecs;
return this;
}
@safe unittest
{
auto st1 = SysTime(DateTime(2010, 1, 1, 12, 30, 33));
st1.add!"months"(11);
assert(st1 == SysTime(DateTime(2010, 12, 1, 12, 30, 33)));
auto st2 = SysTime(DateTime(2010, 1, 1, 12, 30, 33));
st2.add!"months"(-11);
assert(st2 == SysTime(DateTime(2009, 2, 1, 12, 30, 33)));
auto st3 = SysTime(DateTime(2000, 2, 29, 12, 30, 33));
st3.add!"years"(1);
assert(st3 == SysTime(DateTime(2001, 3, 1, 12, 30, 33)));
auto st4 = SysTime(DateTime(2000, 2, 29, 12, 30, 33));
st4.add!"years"(1, AllowDayOverflow.no);
assert(st4 == SysTime(DateTime(2001, 2, 28, 12, 30, 33)));
}
// Test add!"years"() with AllowDayOverflow.yes
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"years"(7);
assert(sysTime == SysTime(Date(2006, 7, 6)));
sysTime.add!"years"(-9);
assert(sysTime == SysTime(Date(1997, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.add!"years"(1);
assert(sysTime == SysTime(Date(2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 29));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(Date(1999, 3, 1)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 12, 7, 3), msecs(234));
sysTime.add!"years"(7);
assert(sysTime == SysTime(DateTime(2006, 7, 6, 12, 7, 3), msecs(234)));
sysTime.add!"years"(-9);
assert(sysTime == SysTime(DateTime(1997, 7, 6, 12, 7, 3), msecs(234)));
}
{
auto sysTime = SysTime(DateTime(1999, 2, 28, 0, 7, 2), usecs(1207));
sysTime.add!"years"(1);
assert(sysTime == SysTime(DateTime(2000, 2, 28, 0, 7, 2), usecs(1207)));
}
{
auto sysTime = SysTime(DateTime(2000, 2, 29, 0, 7, 2), usecs(1207));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(DateTime(1999, 3, 1, 0, 7, 2), usecs(1207)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"years"(-7);
assert(sysTime == SysTime(Date(-2006, 7, 6)));
sysTime.add!"years"(9);
assert(sysTime == SysTime(Date(-1997, 7, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(Date(-2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 29));
sysTime.add!"years"(1);
assert(sysTime == SysTime(Date(-1999, 3, 1)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 12, 7, 3), msecs(234));
sysTime.add!"years"(-7);
assert(sysTime == SysTime(DateTime(-2006, 7, 6, 12, 7, 3), msecs(234)));
sysTime.add!"years"(9);
assert(sysTime == SysTime(DateTime(-1997, 7, 6, 12, 7, 3), msecs(234)));
}
{
auto sysTime = SysTime(DateTime(-1999, 2, 28, 3, 3, 3), hnsecs(3));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(DateTime(-2000, 2, 28, 3, 3, 3), hnsecs(3)));
}
{
auto sysTime = SysTime(DateTime(-2000, 2, 29, 3, 3, 3), hnsecs(3));
sysTime.add!"years"(1);
assert(sysTime == SysTime(DateTime(-1999, 3, 1, 3, 3, 3), hnsecs(3)));
}
// Test Both
{
auto sysTime = SysTime(Date(4, 7, 6));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(Date(-1, 7, 6)));
sysTime.add!"years"(5);
assert(sysTime == SysTime(Date(4, 7, 6)));
}
{
auto sysTime = SysTime(Date(-4, 7, 6));
sysTime.add!"years"(5);
assert(sysTime == SysTime(Date(1, 7, 6)));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(Date(-4, 7, 6)));
}
{
auto sysTime = SysTime(Date(4, 7, 6));
sysTime.add!"years"(-8);
assert(sysTime == SysTime(Date(-4, 7, 6)));
sysTime.add!"years"(8);
assert(sysTime == SysTime(Date(4, 7, 6)));
}
{
auto sysTime = SysTime(Date(-4, 7, 6));
sysTime.add!"years"(8);
assert(sysTime == SysTime(Date(4, 7, 6)));
sysTime.add!"years"(-8);
assert(sysTime == SysTime(Date(-4, 7, 6)));
}
{
auto sysTime = SysTime(Date(-4, 2, 29));
sysTime.add!"years"(5);
assert(sysTime == SysTime(Date(1, 3, 1)));
}
{
auto sysTime = SysTime(Date(4, 2, 29));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(Date(-1, 3, 1)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(DateTime(0, 1, 1, 0, 0, 0)));
sysTime.add!"years"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"years"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 1, 1, 0, 0, 0));
sysTime.add!"years"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(DateTime(0, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"years"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"years"(-1);
assert(sysTime == SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(4, 7, 6, 14, 7, 1), usecs(54329));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(DateTime(-1, 7, 6, 14, 7, 1), usecs(54329)));
sysTime.add!"years"(5);
assert(sysTime == SysTime(DateTime(4, 7, 6, 14, 7, 1), usecs(54329)));
}
{
auto sysTime = SysTime(DateTime(-4, 7, 6, 14, 7, 1), usecs(54329));
sysTime.add!"years"(5);
assert(sysTime == SysTime(DateTime(1, 7, 6, 14, 7, 1), usecs(54329)));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(DateTime(-4, 7, 6, 14, 7, 1), usecs(54329)));
}
{
auto sysTime = SysTime(DateTime(-4, 2, 29, 5, 5, 5), msecs(555));
sysTime.add!"years"(5);
assert(sysTime == SysTime(DateTime(1, 3, 1, 5, 5, 5), msecs(555)));
}
{
auto sysTime = SysTime(DateTime(4, 2, 29, 5, 5, 5), msecs(555));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(DateTime(-1, 3, 1, 5, 5, 5), msecs(555)));
}
{
auto sysTime = SysTime(DateTime(4, 2, 29, 5, 5, 5), msecs(555));
sysTime.add!"years"(-5).add!"years"(7);
assert(sysTime == SysTime(DateTime(6, 3, 1, 5, 5, 5), msecs(555)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.add!"years"(4)));
//static assert(!__traits(compiles, ist.add!"years"(4)));
}
// Test add!"years"() with AllowDayOverflow.no
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"years"(7, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2006, 7, 6)));
sysTime.add!"years"(-9, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 29));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 2, 28)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 12, 7, 3), msecs(234));
sysTime.add!"years"(7, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(2006, 7, 6, 12, 7, 3), msecs(234)));
sysTime.add!"years"(-9, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1997, 7, 6, 12, 7, 3), msecs(234)));
}
{
auto sysTime = SysTime(DateTime(1999, 2, 28, 0, 7, 2), usecs(1207));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(2000, 2, 28, 0, 7, 2), usecs(1207)));
}
{
auto sysTime = SysTime(DateTime(2000, 2, 29, 0, 7, 2), usecs(1207));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 2, 28, 0, 7, 2), usecs(1207)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"years"(-7, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2006, 7, 6)));
sysTime.add!"years"(9, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 7, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 29));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 2, 28)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 12, 7, 3), msecs(234));
sysTime.add!"years"(-7, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2006, 7, 6, 12, 7, 3), msecs(234)));
sysTime.add!"years"(9, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1997, 7, 6, 12, 7, 3), msecs(234)));
}
{
auto sysTime = SysTime(DateTime(-1999, 2, 28, 3, 3, 3), hnsecs(3));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2000, 2, 28, 3, 3, 3), hnsecs(3)));
}
{
auto sysTime = SysTime(DateTime(-2000, 2, 29, 3, 3, 3), hnsecs(3));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1999, 2, 28, 3, 3, 3), hnsecs(3)));
}
// Test Both
{
auto sysTime = SysTime(Date(4, 7, 6));
sysTime.add!"years"(-5, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1, 7, 6)));
sysTime.add!"years"(5, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 7, 6)));
}
{
auto sysTime = SysTime(Date(-4, 7, 6));
sysTime.add!"years"(5, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1, 7, 6)));
sysTime.add!"years"(-5, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 7, 6)));
}
{
auto sysTime = SysTime(Date(4, 7, 6));
sysTime.add!"years"(-8, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 7, 6)));
sysTime.add!"years"(8, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 7, 6)));
}
{
auto sysTime = SysTime(Date(-4, 7, 6));
sysTime.add!"years"(8, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 7, 6)));
sysTime.add!"years"(-8, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 7, 6)));
}
{
auto sysTime = SysTime(Date(-4, 2, 29));
sysTime.add!"years"(5, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1, 2, 28)));
}
{
auto sysTime = SysTime(Date(4, 2, 29));
sysTime.add!"years"(-5, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1, 2, 28)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 1, 1, 0, 0, 0)));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 1, 1, 0, 0, 0));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"years"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"years"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(4, 7, 6, 14, 7, 1), usecs(54329));
sysTime.add!"years"(-5);
assert(sysTime == SysTime(DateTime(-1, 7, 6, 14, 7, 1), usecs(54329)));
sysTime.add!"years"(5);
assert(sysTime == SysTime(DateTime(4, 7, 6, 14, 7, 1), usecs(54329)));
}
{
auto sysTime = SysTime(DateTime(4, 7, 6, 14, 7, 1), usecs(54329));
sysTime.add!"years"(-5, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1, 7, 6, 14, 7, 1), usecs(54329)));
sysTime.add!"years"(5, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(4, 7, 6, 14, 7, 1), usecs(54329)));
}
{
auto sysTime = SysTime(DateTime(-4, 7, 6, 14, 7, 1), usecs(54329));
sysTime.add!"years"(5, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 7, 6, 14, 7, 1), usecs(54329)));
sysTime.add!"years"(-5, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-4, 7, 6, 14, 7, 1), usecs(54329)));
}
{
auto sysTime = SysTime(DateTime(-4, 2, 29, 5, 5, 5), msecs(555));
sysTime.add!"years"(5, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 2, 28, 5, 5, 5), msecs(555)));
}
{
auto sysTime = SysTime(DateTime(4, 2, 29, 5, 5, 5), msecs(555));
sysTime.add!"years"(-5, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1, 2, 28, 5, 5, 5), msecs(555)));
}
{
auto sysTime = SysTime(DateTime(4, 2, 29, 5, 5, 5), msecs(555));
sysTime.add!"years"(-5, AllowDayOverflow.no).add!"years"(7, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(6, 2, 28, 5, 5, 5), msecs(555)));
}
}
// Test add!"months"() with AllowDayOverflow.yes
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"months"(3);
assert(sysTime == SysTime(Date(1999, 10, 6)));
sysTime.add!"months"(-4);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"months"(6);
assert(sysTime == SysTime(Date(2000, 1, 6)));
sysTime.add!"months"(-6);
assert(sysTime == SysTime(Date(1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"months"(27);
assert(sysTime == SysTime(Date(2001, 10, 6)));
sysTime.add!"months"(-28);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(1999, 7, 1)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(Date(1999, 5, 1)));
}
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.add!"months"(12);
assert(sysTime == SysTime(Date(2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 29));
sysTime.add!"months"(12);
assert(sysTime == SysTime(Date(2001, 3, 1)));
}
{
auto sysTime = SysTime(Date(1999, 7, 31));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(1999, 8, 31)));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(1999, 10, 1)));
}
{
auto sysTime = SysTime(Date(1998, 8, 31));
sysTime.add!"months"(13);
assert(sysTime == SysTime(Date(1999, 10, 1)));
sysTime.add!"months"(-13);
assert(sysTime == SysTime(Date(1998, 9, 1)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.add!"months"(13);
assert(sysTime == SysTime(Date(1999, 1, 31)));
sysTime.add!"months"(-13);
assert(sysTime == SysTime(Date(1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.add!"months"(14);
assert(sysTime == SysTime(Date(1999, 3, 3)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(Date(1998, 1, 3)));
}
{
auto sysTime = SysTime(Date(1998, 12, 31));
sysTime.add!"months"(14);
assert(sysTime == SysTime(Date(2000, 3, 2)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(Date(1999, 1, 2)));
}
{
auto sysTime = SysTime(Date(1999, 12, 31));
sysTime.add!"months"(14);
assert(sysTime == SysTime(Date(2001, 3, 3)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(Date(2000, 1, 3)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.add!"months"(3);
assert(sysTime == SysTime(DateTime(1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.add!"months"(-4);
assert(sysTime == SysTime(DateTime(1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(1998, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14);
assert(sysTime == SysTime(DateTime(2000, 3, 2, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(DateTime(1999, 1, 2, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(1999, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14);
assert(sysTime == SysTime(DateTime(2001, 3, 3, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(DateTime(2000, 1, 3, 7, 7, 7), hnsecs(422202)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"months"(3);
assert(sysTime == SysTime(Date(-1999, 10, 6)));
sysTime.add!"months"(-4);
assert(sysTime == SysTime(Date(-1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"months"(6);
assert(sysTime == SysTime(Date(-1998, 1, 6)));
sysTime.add!"months"(-6);
assert(sysTime == SysTime(Date(-1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"months"(-27);
assert(sysTime == SysTime(Date(-2001, 4, 6)));
sysTime.add!"months"(28);
assert(sysTime == SysTime(Date(-1999, 8, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(-1999, 7, 1)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(Date(-1999, 5, 1)));
}
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.add!"months"(-12);
assert(sysTime == SysTime(Date(-2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 29));
sysTime.add!"months"(-12);
assert(sysTime == SysTime(Date(-2001, 3, 1)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 31));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(-1999, 8, 31)));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(-1999, 10, 1)));
}
{
auto sysTime = SysTime(Date(-1998, 8, 31));
sysTime.add!"months"(13);
assert(sysTime == SysTime(Date(-1997, 10, 1)));
sysTime.add!"months"(-13);
assert(sysTime == SysTime(Date(-1998, 9, 1)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.add!"months"(13);
assert(sysTime == SysTime(Date(-1995, 1, 31)));
sysTime.add!"months"(-13);
assert(sysTime == SysTime(Date(-1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.add!"months"(14);
assert(sysTime == SysTime(Date(-1995, 3, 3)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(Date(-1996, 1, 3)));
}
{
auto sysTime = SysTime(Date(-2002, 12, 31));
sysTime.add!"months"(14);
assert(sysTime == SysTime(Date(-2000, 3, 2)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(Date(-2001, 1, 2)));
}
{
auto sysTime = SysTime(Date(-2001, 12, 31));
sysTime.add!"months"(14);
assert(sysTime == SysTime(Date(-1999, 3, 3)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(Date(-2000, 1, 3)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.add!"months"(3);
assert(sysTime == SysTime(DateTime(-1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.add!"months"(-4);
assert(sysTime == SysTime(DateTime(-1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(-2002, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14);
assert(sysTime == SysTime(DateTime(-2000, 3, 2, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(DateTime(-2001, 1, 2, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(-2001, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14);
assert(sysTime == SysTime(DateTime(-1999, 3, 3, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14);
assert(sysTime == SysTime(DateTime(-2000, 1, 3, 7, 7, 7), hnsecs(422202)));
}
// Test Both
{
auto sysTime = SysTime(Date(1, 1, 1));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(Date(0, 12, 1)));
sysTime.add!"months"(1);
assert(sysTime == SysTime(Date(1, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 1, 1));
sysTime.add!"months"(-48);
assert(sysTime == SysTime(Date(0, 1, 1)));
sysTime.add!"months"(48);
assert(sysTime == SysTime(Date(4, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.add!"months"(-49);
assert(sysTime == SysTime(Date(0, 3, 2)));
sysTime.add!"months"(49);
assert(sysTime == SysTime(Date(4, 4, 2)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.add!"months"(-85);
assert(sysTime == SysTime(Date(-3, 3, 3)));
sysTime.add!"months"(85);
assert(sysTime == SysTime(Date(4, 4, 3)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
sysTime.add!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 0, 0, 0));
sysTime.add!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17));
sysTime.add!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 7, 9), hnsecs(17)));
sysTime.add!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17)));
}
{
auto sysTime = SysTime(DateTime(4, 3, 31, 12, 11, 10), msecs(9));
sysTime.add!"months"(-85);
assert(sysTime == SysTime(DateTime(-3, 3, 3, 12, 11, 10), msecs(9)));
sysTime.add!"months"(85);
assert(sysTime == SysTime(DateTime(4, 4, 3, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.add!"months"(85);
assert(sysTime == SysTime(DateTime(4, 5, 1, 12, 11, 10), msecs(9)));
sysTime.add!"months"(-85);
assert(sysTime == SysTime(DateTime(-3, 4, 1, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.add!"months"(85).add!"months"(-83);
assert(sysTime == SysTime(DateTime(-3, 6, 1, 12, 11, 10), msecs(9)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.add!"months"(4)));
//static assert(!__traits(compiles, ist.add!"months"(4)));
}
// Test add!"months"() with AllowDayOverflow.no
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 10, 6)));
sysTime.add!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"months"(6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2000, 1, 6)));
sysTime.add!"months"(-6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.add!"months"(27, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2001, 10, 6)));
sysTime.add!"months"(-28, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 6, 30)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 4, 30)));
}
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.add!"months"(12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 29));
sysTime.add!"months"(12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2001, 2, 28)));
}
{
auto sysTime = SysTime(Date(1999, 7, 31));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 8, 31)));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 9, 30)));
}
{
auto sysTime = SysTime(Date(1998, 8, 31));
sysTime.add!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 9, 30)));
sysTime.add!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1998, 8, 30)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.add!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 1, 31)));
sysTime.add!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 2, 28)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 12, 28)));
}
{
auto sysTime = SysTime(Date(1998, 12, 31));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2000, 2, 29)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1998, 12, 29)));
}
{
auto sysTime = SysTime(Date(1999, 12, 31));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2001, 2, 28)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 12, 28)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.add!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.add!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(1998, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(2000, 2, 29, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1998, 12, 29, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(1999, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(2001, 2, 28, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 12, 28, 7, 7, 7), hnsecs(422202)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 10, 6)));
sysTime.add!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"months"(6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1998, 1, 6)));
sysTime.add!"months"(-6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.add!"months"(-27, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2001, 4, 6)));
sysTime.add!"months"(28, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 8, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 6, 30)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 4, 30)));
}
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.add!"months"(-12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2000, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 29));
sysTime.add!"months"(-12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2001, 2, 28)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 31));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 8, 31)));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 9, 30)));
}
{
auto sysTime = SysTime(Date(-1998, 8, 31));
sysTime.add!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 9, 30)));
sysTime.add!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1998, 8, 30)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.add!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1995, 1, 31)));
sysTime.add!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1995, 2, 28)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 12, 28)));
}
{
auto sysTime = SysTime(Date(-2002, 12, 31));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2000, 2, 29)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2002, 12, 29)));
}
{
auto sysTime = SysTime(Date(-2001, 12, 31));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 2, 28)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2001, 12, 28)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.add!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.add!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(-2002, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2000, 2, 29, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2002, 12, 29, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(-2001, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.add!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1999, 2, 28, 7, 7, 7), hnsecs(422202)));
sysTime.add!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2001, 12, 28, 7, 7, 7), hnsecs(422202)));
}
// Test Both
{
auto sysTime = SysTime(Date(1, 1, 1));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(0, 12, 1)));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 1, 1));
sysTime.add!"months"(-48, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(0, 1, 1)));
sysTime.add!"months"(48, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.add!"months"(-49, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(0, 2, 29)));
sysTime.add!"months"(49, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 3, 29)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.add!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-3, 2, 28)));
sysTime.add!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 3, 28)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 0, 0, 0));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17));
sysTime.add!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 7, 9), hnsecs(17)));
sysTime.add!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17)));
}
{
auto sysTime = SysTime(DateTime(4, 3, 31, 12, 11, 10), msecs(9));
sysTime.add!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-3, 2, 28, 12, 11, 10), msecs(9)));
sysTime.add!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(4, 3, 28, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.add!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(4, 4, 30, 12, 11, 10), msecs(9)));
sysTime.add!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-3, 3, 30, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.add!"months"(85, AllowDayOverflow.no).add!"months"(-83, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-3, 5, 30, 12, 11, 10), msecs(9)));
}
}
/++
Adds the given number of years or months to this $(LREF SysTime). A
negative number will subtract.
The difference between rolling and adding is that rolling does not
affect larger units. Rolling a $(LREF SysTime) 12 months
gets the exact same $(LREF SysTime). However, the days can still be
affected due to the differing number of days in each month.
Because there are no units larger than years, there is no difference
between adding and rolling years.
Params:
units = The type of units to add ("years" or "months").
value = The number of months or years to add to this
$(LREF SysTime).
allowOverflow = Whether the days should be allowed to overflow,
causing the month to increment.
+/
ref SysTime roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe nothrow
if (units == "years")
{
return add!"years"(value, allowOverflow);
}
///
@safe unittest
{
import std.datetime.date : AllowDayOverflow, DateTime;
auto st1 = SysTime(DateTime(2010, 1, 1, 12, 33, 33));
st1.roll!"months"(1);
assert(st1 == SysTime(DateTime(2010, 2, 1, 12, 33, 33)));
auto st2 = SysTime(DateTime(2010, 1, 1, 12, 33, 33));
st2.roll!"months"(-1);
assert(st2 == SysTime(DateTime(2010, 12, 1, 12, 33, 33)));
auto st3 = SysTime(DateTime(1999, 1, 29, 12, 33, 33));
st3.roll!"months"(1);
assert(st3 == SysTime(DateTime(1999, 3, 1, 12, 33, 33)));
auto st4 = SysTime(DateTime(1999, 1, 29, 12, 33, 33));
st4.roll!"months"(1, AllowDayOverflow.no);
assert(st4 == SysTime(DateTime(1999, 2, 28, 12, 33, 33)));
auto st5 = SysTime(DateTime(2000, 2, 29, 12, 30, 33));
st5.roll!"years"(1);
assert(st5 == SysTime(DateTime(2001, 3, 1, 12, 30, 33)));
auto st6 = SysTime(DateTime(2000, 2, 29, 12, 30, 33));
st6.roll!"years"(1, AllowDayOverflow.no);
assert(st6 == SysTime(DateTime(2001, 2, 28, 12, 30, 33)));
}
@safe unittest
{
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
st.roll!"years"(4);
static assert(!__traits(compiles, cst.roll!"years"(4)));
//static assert(!__traits(compiles, ist.roll!"years"(4)));
}
// Shares documentation with "years" overload.
ref SysTime roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe nothrow
if (units == "months")
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto date = Date(cast(int) days);
date.roll!"months"(value, allowOverflow);
days = date.dayOfGregorianCal - 1;
if (days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
}
immutable newDaysHNSecs = convert!("days", "hnsecs")(days);
adjTime = newDaysHNSecs + hnsecs;
return this;
}
// Test roll!"months"() with AllowDayOverflow.yes
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"months"(3);
assert(sysTime == SysTime(Date(1999, 10, 6)));
sysTime.roll!"months"(-4);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"months"(6);
assert(sysTime == SysTime(Date(1999, 1, 6)));
sysTime.roll!"months"(-6);
assert(sysTime == SysTime(Date(1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"months"(27);
assert(sysTime == SysTime(Date(1999, 10, 6)));
sysTime.roll!"months"(-28);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(1999, 7, 1)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(Date(1999, 5, 1)));
}
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.roll!"months"(12);
assert(sysTime == SysTime(Date(1999, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 29));
sysTime.roll!"months"(12);
assert(sysTime == SysTime(Date(2000, 2, 29)));
}
{
auto sysTime = SysTime(Date(1999, 7, 31));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(1999, 8, 31)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(1999, 10, 1)));
}
{
auto sysTime = SysTime(Date(1998, 8, 31));
sysTime.roll!"months"(13);
assert(sysTime == SysTime(Date(1998, 10, 1)));
sysTime.roll!"months"(-13);
assert(sysTime == SysTime(Date(1998, 9, 1)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.roll!"months"(13);
assert(sysTime == SysTime(Date(1997, 1, 31)));
sysTime.roll!"months"(-13);
assert(sysTime == SysTime(Date(1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(Date(1997, 3, 3)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(Date(1997, 1, 3)));
}
{
auto sysTime = SysTime(Date(1998, 12, 31));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(Date(1998, 3, 3)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(Date(1998, 1, 3)));
}
{
auto sysTime = SysTime(Date(1999, 12, 31));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(Date(1999, 3, 3)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(Date(1999, 1, 3)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.roll!"months"(3);
assert(sysTime == SysTime(DateTime(1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.roll!"months"(-4);
assert(sysTime == SysTime(DateTime(1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(1998, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(DateTime(1998, 3, 3, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(DateTime(1998, 1, 3, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(1999, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(DateTime(1999, 3, 3, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(DateTime(1999, 1, 3, 7, 7, 7), hnsecs(422202)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"months"(3);
assert(sysTime == SysTime(Date(-1999, 10, 6)));
sysTime.roll!"months"(-4);
assert(sysTime == SysTime(Date(-1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"months"(6);
assert(sysTime == SysTime(Date(-1999, 1, 6)));
sysTime.roll!"months"(-6);
assert(sysTime == SysTime(Date(-1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"months"(-27);
assert(sysTime == SysTime(Date(-1999, 4, 6)));
sysTime.roll!"months"(28);
assert(sysTime == SysTime(Date(-1999, 8, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(-1999, 7, 1)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(Date(-1999, 5, 1)));
}
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.roll!"months"(-12);
assert(sysTime == SysTime(Date(-1999, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 29));
sysTime.roll!"months"(-12);
assert(sysTime == SysTime(Date(-2000, 2, 29)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 31));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(-1999, 8, 31)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(-1999, 10, 1)));
}
{
auto sysTime = SysTime(Date(-1998, 8, 31));
sysTime.roll!"months"(13);
assert(sysTime == SysTime(Date(-1998, 10, 1)));
sysTime.roll!"months"(-13);
assert(sysTime == SysTime(Date(-1998, 9, 1)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.roll!"months"(13);
assert(sysTime == SysTime(Date(-1997, 1, 31)));
sysTime.roll!"months"(-13);
assert(sysTime == SysTime(Date(-1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(Date(-1997, 3, 3)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(Date(-1997, 1, 3)));
}
{
auto sysTime = SysTime(Date(-2002, 12, 31));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(Date(-2002, 3, 3)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(Date(-2002, 1, 3)));
}
{
auto sysTime = SysTime(Date(-2001, 12, 31));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(Date(-2001, 3, 3)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(Date(-2001, 1, 3)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(DateTime(1, 12, 1, 0, 0, 0)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(DateTime(1, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 0, 0, 0));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(DateTime(0, 1, 1, 0, 0, 0)));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 12, 2, 7), hnsecs(5007));
sysTime.roll!"months"(3);
assert(sysTime == SysTime(DateTime(-1999, 10, 6, 12, 2, 7), hnsecs(5007)));
sysTime.roll!"months"(-4);
assert(sysTime == SysTime(DateTime(-1999, 6, 6, 12, 2, 7), hnsecs(5007)));
}
{
auto sysTime = SysTime(DateTime(-2002, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(DateTime(-2002, 3, 3, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(DateTime(-2002, 1, 3, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(-2001, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14);
assert(sysTime == SysTime(DateTime(-2001, 3, 3, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14);
assert(sysTime == SysTime(DateTime(-2001, 1, 3, 7, 7, 7), hnsecs(422202)));
}
// Test Both
{
auto sysTime = SysTime(Date(1, 1, 1));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(Date(1, 12, 1)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(1, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 1, 1));
sysTime.roll!"months"(-48);
assert(sysTime == SysTime(Date(4, 1, 1)));
sysTime.roll!"months"(48);
assert(sysTime == SysTime(Date(4, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.roll!"months"(-49);
assert(sysTime == SysTime(Date(4, 3, 2)));
sysTime.roll!"months"(49);
assert(sysTime == SysTime(Date(4, 4, 2)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.roll!"months"(-85);
assert(sysTime == SysTime(Date(4, 3, 2)));
sysTime.roll!"months"(85);
assert(sysTime == SysTime(Date(4, 4, 2)));
}
{
auto sysTime = SysTime(Date(-1, 1, 1));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(Date(-1, 12, 1)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(Date(-1, 1, 1)));
}
{
auto sysTime = SysTime(Date(-4, 1, 1));
sysTime.roll!"months"(-48);
assert(sysTime == SysTime(Date(-4, 1, 1)));
sysTime.roll!"months"(48);
assert(sysTime == SysTime(Date(-4, 1, 1)));
}
{
auto sysTime = SysTime(Date(-4, 3, 31));
sysTime.roll!"months"(-49);
assert(sysTime == SysTime(Date(-4, 3, 2)));
sysTime.roll!"months"(49);
assert(sysTime == SysTime(Date(-4, 4, 2)));
}
{
auto sysTime = SysTime(Date(-4, 3, 31));
sysTime.roll!"months"(-85);
assert(sysTime == SysTime(Date(-4, 3, 2)));
sysTime.roll!"months"(85);
assert(sysTime == SysTime(Date(-4, 4, 2)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17));
sysTime.roll!"months"(-1);
assert(sysTime == SysTime(DateTime(1, 12, 1, 0, 7, 9), hnsecs(17)));
sysTime.roll!"months"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17)));
}
{
auto sysTime = SysTime(DateTime(4, 3, 31, 12, 11, 10), msecs(9));
sysTime.roll!"months"(-85);
assert(sysTime == SysTime(DateTime(4, 3, 2, 12, 11, 10), msecs(9)));
sysTime.roll!"months"(85);
assert(sysTime == SysTime(DateTime(4, 4, 2, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.roll!"months"(85);
assert(sysTime == SysTime(DateTime(-3, 5, 1, 12, 11, 10), msecs(9)));
sysTime.roll!"months"(-85);
assert(sysTime == SysTime(DateTime(-3, 4, 1, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.roll!"months"(85).roll!"months"(-83);
assert(sysTime == SysTime(DateTime(-3, 6, 1, 12, 11, 10), msecs(9)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"months"(4)));
//static assert(!__traits(compiles, ist.roll!"months"(4)));
}
// Test roll!"months"() with AllowDayOverflow.no
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 10, 6)));
sysTime.roll!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"months"(6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 1, 6)));
sysTime.roll!"months"(-6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"months"(27, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 10, 6)));
sysTime.roll!"months"(-28, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 6, 30)));
}
{
auto sysTime = SysTime(Date(1999, 5, 31));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 4, 30)));
}
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.roll!"months"(12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 29));
sysTime.roll!"months"(12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(2000, 2, 29)));
}
{
auto sysTime = SysTime(Date(1999, 7, 31));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 8, 31)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 9, 30)));
}
{
auto sysTime = SysTime(Date(1998, 8, 31));
sysTime.roll!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1998, 9, 30)));
sysTime.roll!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1998, 8, 30)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.roll!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 1, 31)));
sysTime.roll!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(1997, 12, 31));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 2, 28)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1997, 12, 28)));
}
{
auto sysTime = SysTime(Date(1998, 12, 31));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1998, 2, 28)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1998, 12, 28)));
}
{
auto sysTime = SysTime(Date(1999, 12, 31));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 2, 28)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1999, 12, 28)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.roll!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.roll!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(1998, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1998, 2, 28, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1998, 12, 28, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(1999, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 2, 28, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1999, 12, 28, 7, 7, 7), hnsecs(422202)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 10, 6)));
sysTime.roll!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 6, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"months"(6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 1, 6)));
sysTime.roll!"months"(-6, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"months"(-27, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 4, 6)));
sysTime.roll!"months"(28, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 8, 6)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 6, 30)));
}
{
auto sysTime = SysTime(Date(-1999, 5, 31));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 4, 30)));
}
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.roll!"months"(-12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 29));
sysTime.roll!"months"(-12, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2000, 2, 29)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 31));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 8, 31)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1999, 9, 30)));
}
{
auto sysTime = SysTime(Date(-1998, 8, 31));
sysTime.roll!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1998, 9, 30)));
sysTime.roll!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1998, 8, 30)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.roll!"months"(13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 1, 31)));
sysTime.roll!"months"(-13, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 12, 31)));
}
{
auto sysTime = SysTime(Date(-1997, 12, 31));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 2, 28)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1997, 12, 28)));
}
{
auto sysTime = SysTime(Date(-2002, 12, 31));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2002, 2, 28)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2002, 12, 28)));
}
{
auto sysTime = SysTime(Date(-2001, 12, 31));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2001, 2, 28)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-2001, 12, 28)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 12, 2, 7), usecs(5007));
sysTime.roll!"months"(3, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1999, 10, 6, 12, 2, 7), usecs(5007)));
sysTime.roll!"months"(-4, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-1999, 6, 6, 12, 2, 7), usecs(5007)));
}
{
auto sysTime = SysTime(DateTime(-2002, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2002, 2, 28, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2002, 12, 28, 7, 7, 7), hnsecs(422202)));
}
{
auto sysTime = SysTime(DateTime(-2001, 12, 31, 7, 7, 7), hnsecs(422202));
sysTime.roll!"months"(14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2001, 2, 28, 7, 7, 7), hnsecs(422202)));
sysTime.roll!"months"(-14, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-2001, 12, 28, 7, 7, 7), hnsecs(422202)));
}
// Test Both
{
auto sysTime = SysTime(Date(1, 1, 1));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1, 12, 1)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(1, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 1, 1));
sysTime.roll!"months"(-48, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 1, 1)));
sysTime.roll!"months"(48, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 1, 1)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.roll!"months"(-49, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 2, 29)));
sysTime.roll!"months"(49, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 3, 29)));
}
{
auto sysTime = SysTime(Date(4, 3, 31));
sysTime.roll!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 2, 29)));
sysTime.roll!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(4, 3, 29)));
}
{
auto sysTime = SysTime(Date(-1, 1, 1));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1, 12, 1)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-1, 1, 1)));
}
{
auto sysTime = SysTime(Date(-4, 1, 1));
sysTime.roll!"months"(-48, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 1, 1)));
sysTime.roll!"months"(48, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 1, 1)));
}
{
auto sysTime = SysTime(Date(-4, 3, 31));
sysTime.roll!"months"(-49, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 2, 29)));
sysTime.roll!"months"(49, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 3, 29)));
}
{
auto sysTime = SysTime(Date(-4, 3, 31));
sysTime.roll!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 2, 29)));
sysTime.roll!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(Date(-4, 3, 29)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 12, 1, 0, 0, 0)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 0, 0, 0));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 1, 1, 0, 0, 0)));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17));
sysTime.roll!"months"(-1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 12, 1, 0, 7, 9), hnsecs(17)));
sysTime.roll!"months"(1, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 7, 9), hnsecs(17)));
}
{
auto sysTime = SysTime(DateTime(4, 3, 31, 12, 11, 10), msecs(9));
sysTime.roll!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(4, 2, 29, 12, 11, 10), msecs(9)));
sysTime.roll!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(4, 3, 29, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.roll!"months"(85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-3, 4, 30, 12, 11, 10), msecs(9)));
sysTime.roll!"months"(-85, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-3, 3, 30, 12, 11, 10), msecs(9)));
}
{
auto sysTime = SysTime(DateTime(-3, 3, 31, 12, 11, 10), msecs(9));
sysTime.roll!"months"(85, AllowDayOverflow.no).roll!"months"(-83, AllowDayOverflow.no);
assert(sysTime == SysTime(DateTime(-3, 5, 30, 12, 11, 10), msecs(9)));
}
}
/++
Adds the given number of units to this $(LREF SysTime). A negative number
will subtract.
The difference between rolling and adding is that rolling does not
affect larger units. For instance, rolling a $(LREF SysTime) one
year's worth of days gets the exact same $(LREF SysTime).
Accepted units are $(D "days"), $(D "minutes"), $(D "hours"),
$(D "minutes"), $(D "seconds"), $(D "msecs"), $(D "usecs"), and
$(D "hnsecs").
Note that when rolling msecs, usecs or hnsecs, they all add up to a
second. So, for example, rolling 1000 msecs is exactly the same as
rolling 100,000 usecs.
Params:
units = The units to add.
value = The number of $(D_PARAM units) to add to this
$(LREF SysTime).
+/
ref SysTime roll(string units)(long value) @safe nothrow
if (units == "days")
{
auto hnsecs = adjTime;
auto gdays = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--gdays;
}
auto date = Date(cast(int) gdays);
date.roll!"days"(value);
gdays = date.dayOfGregorianCal - 1;
if (gdays < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++gdays;
}
immutable newDaysHNSecs = convert!("days", "hnsecs")(gdays);
adjTime = newDaysHNSecs + hnsecs;
return this;
}
///
@safe unittest
{
import core.time : msecs, hnsecs;
import std.datetime.date : DateTime;
auto st1 = SysTime(DateTime(2010, 1, 1, 11, 23, 12));
st1.roll!"days"(1);
assert(st1 == SysTime(DateTime(2010, 1, 2, 11, 23, 12)));
st1.roll!"days"(365);
assert(st1 == SysTime(DateTime(2010, 1, 26, 11, 23, 12)));
st1.roll!"days"(-32);
assert(st1 == SysTime(DateTime(2010, 1, 25, 11, 23, 12)));
auto st2 = SysTime(DateTime(2010, 7, 4, 12, 0, 0));
st2.roll!"hours"(1);
assert(st2 == SysTime(DateTime(2010, 7, 4, 13, 0, 0)));
auto st3 = SysTime(DateTime(2010, 2, 12, 12, 0, 0));
st3.roll!"hours"(-1);
assert(st3 == SysTime(DateTime(2010, 2, 12, 11, 0, 0)));
auto st4 = SysTime(DateTime(2009, 12, 31, 0, 0, 0));
st4.roll!"minutes"(1);
assert(st4 == SysTime(DateTime(2009, 12, 31, 0, 1, 0)));
auto st5 = SysTime(DateTime(2010, 1, 1, 0, 0, 0));
st5.roll!"minutes"(-1);
assert(st5 == SysTime(DateTime(2010, 1, 1, 0, 59, 0)));
auto st6 = SysTime(DateTime(2009, 12, 31, 0, 0, 0));
st6.roll!"seconds"(1);
assert(st6 == SysTime(DateTime(2009, 12, 31, 0, 0, 1)));
auto st7 = SysTime(DateTime(2010, 1, 1, 0, 0, 0));
st7.roll!"seconds"(-1);
assert(st7 == SysTime(DateTime(2010, 1, 1, 0, 0, 59)));
auto dt = DateTime(2010, 1, 1, 0, 0, 0);
auto st8 = SysTime(dt);
st8.roll!"msecs"(1);
assert(st8 == SysTime(dt, msecs(1)));
auto st9 = SysTime(dt);
st9.roll!"msecs"(-1);
assert(st9 == SysTime(dt, msecs(999)));
auto st10 = SysTime(dt);
st10.roll!"hnsecs"(1);
assert(st10 == SysTime(dt, hnsecs(1)));
auto st11 = SysTime(dt);
st11.roll!"hnsecs"(-1);
assert(st11 == SysTime(dt, hnsecs(9_999_999)));
}
@safe unittest
{
import core.time;
// Test A.D.
{
auto sysTime = SysTime(Date(1999, 2, 28));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(1999, 2, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(1999, 2, 28)));
}
{
auto sysTime = SysTime(Date(2000, 2, 28));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(2000, 2, 29)));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(2000, 2, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(2000, 2, 29)));
}
{
auto sysTime = SysTime(Date(1999, 6, 30));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(1999, 6, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(1999, 6, 30)));
}
{
auto sysTime = SysTime(Date(1999, 7, 31));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(1999, 7, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(1999, 7, 31)));
}
{
auto sysTime = SysTime(Date(1999, 1, 1));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(1999, 1, 31)));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(1999, 1, 1)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"days"(9);
assert(sysTime == SysTime(Date(1999, 7, 15)));
sysTime.roll!"days"(-11);
assert(sysTime == SysTime(Date(1999, 7, 4)));
sysTime.roll!"days"(30);
assert(sysTime == SysTime(Date(1999, 7, 3)));
sysTime.roll!"days"(-3);
assert(sysTime == SysTime(Date(1999, 7, 31)));
}
{
auto sysTime = SysTime(Date(1999, 7, 6));
sysTime.roll!"days"(365);
assert(sysTime == SysTime(Date(1999, 7, 30)));
sysTime.roll!"days"(-365);
assert(sysTime == SysTime(Date(1999, 7, 6)));
sysTime.roll!"days"(366);
assert(sysTime == SysTime(Date(1999, 7, 31)));
sysTime.roll!"days"(730);
assert(sysTime == SysTime(Date(1999, 7, 17)));
sysTime.roll!"days"(-1096);
assert(sysTime == SysTime(Date(1999, 7, 6)));
}
{
auto sysTime = SysTime(Date(1999, 2, 6));
sysTime.roll!"days"(365);
assert(sysTime == SysTime(Date(1999, 2, 7)));
sysTime.roll!"days"(-365);
assert(sysTime == SysTime(Date(1999, 2, 6)));
sysTime.roll!"days"(366);
assert(sysTime == SysTime(Date(1999, 2, 8)));
sysTime.roll!"days"(730);
assert(sysTime == SysTime(Date(1999, 2, 10)));
sysTime.roll!"days"(-1096);
assert(sysTime == SysTime(Date(1999, 2, 6)));
}
{
auto sysTime = SysTime(DateTime(1999, 2, 28, 7, 9, 2), usecs(234578));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(DateTime(1999, 2, 1, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(DateTime(1999, 2, 28, 7, 9, 2), usecs(234578)));
}
{
auto sysTime = SysTime(DateTime(1999, 7, 6, 7, 9, 2), usecs(234578));
sysTime.roll!"days"(9);
assert(sysTime == SysTime(DateTime(1999, 7, 15, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(-11);
assert(sysTime == SysTime(DateTime(1999, 7, 4, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(30);
assert(sysTime == SysTime(DateTime(1999, 7, 3, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(-3);
assert(sysTime == SysTime(DateTime(1999, 7, 31, 7, 9, 2), usecs(234578)));
}
// Test B.C.
{
auto sysTime = SysTime(Date(-1999, 2, 28));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(-1999, 2, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(-1999, 2, 28)));
}
{
auto sysTime = SysTime(Date(-2000, 2, 28));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(-2000, 2, 29)));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(-2000, 2, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(-2000, 2, 29)));
}
{
auto sysTime = SysTime(Date(-1999, 6, 30));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(-1999, 6, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(-1999, 6, 30)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 31));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(-1999, 7, 1)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(-1999, 7, 31)));
}
{
auto sysTime = SysTime(Date(-1999, 1, 1));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(Date(-1999, 1, 31)));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(Date(-1999, 1, 1)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"days"(9);
assert(sysTime == SysTime(Date(-1999, 7, 15)));
sysTime.roll!"days"(-11);
assert(sysTime == SysTime(Date(-1999, 7, 4)));
sysTime.roll!"days"(30);
assert(sysTime == SysTime(Date(-1999, 7, 3)));
sysTime.roll!"days"(-3);
assert(sysTime == SysTime(Date(-1999, 7, 31)));
}
{
auto sysTime = SysTime(Date(-1999, 7, 6));
sysTime.roll!"days"(365);
assert(sysTime == SysTime(Date(-1999, 7, 30)));
sysTime.roll!"days"(-365);
assert(sysTime == SysTime(Date(-1999, 7, 6)));
sysTime.roll!"days"(366);
assert(sysTime == SysTime(Date(-1999, 7, 31)));
sysTime.roll!"days"(730);
assert(sysTime == SysTime(Date(-1999, 7, 17)));
sysTime.roll!"days"(-1096);
assert(sysTime == SysTime(Date(-1999, 7, 6)));
}
{
auto sysTime = SysTime(DateTime(-1999, 2, 28, 7, 9, 2), usecs(234578));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(DateTime(-1999, 2, 1, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(DateTime(-1999, 2, 28, 7, 9, 2), usecs(234578)));
}
{
auto sysTime = SysTime(DateTime(-1999, 7, 6, 7, 9, 2), usecs(234578));
sysTime.roll!"days"(9);
assert(sysTime == SysTime(DateTime(-1999, 7, 15, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(-11);
assert(sysTime == SysTime(DateTime(-1999, 7, 4, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(30);
assert(sysTime == SysTime(DateTime(-1999, 7, 3, 7, 9, 2), usecs(234578)));
sysTime.roll!"days"(-3);
}
// Test Both
{
auto sysTime = SysTime(Date(1, 7, 6));
sysTime.roll!"days"(-365);
assert(sysTime == SysTime(Date(1, 7, 13)));
sysTime.roll!"days"(365);
assert(sysTime == SysTime(Date(1, 7, 6)));
sysTime.roll!"days"(-731);
assert(sysTime == SysTime(Date(1, 7, 19)));
sysTime.roll!"days"(730);
assert(sysTime == SysTime(Date(1, 7, 5)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 31, 0, 0, 0)));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 31, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 0, 0, 0));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 0, 0, 0)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"days"(1);
assert(sysTime == SysTime(DateTime(0, 12, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"days"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(1, 7, 6, 13, 13, 9), msecs(22));
sysTime.roll!"days"(-365);
assert(sysTime == SysTime(DateTime(1, 7, 13, 13, 13, 9), msecs(22)));
sysTime.roll!"days"(365);
assert(sysTime == SysTime(DateTime(1, 7, 6, 13, 13, 9), msecs(22)));
sysTime.roll!"days"(-731);
assert(sysTime == SysTime(DateTime(1, 7, 19, 13, 13, 9), msecs(22)));
sysTime.roll!"days"(730);
assert(sysTime == SysTime(DateTime(1, 7, 5, 13, 13, 9), msecs(22)));
}
{
auto sysTime = SysTime(DateTime(0, 7, 6, 13, 13, 9), msecs(22));
sysTime.roll!"days"(-365);
assert(sysTime == SysTime(DateTime(0, 7, 13, 13, 13, 9), msecs(22)));
sysTime.roll!"days"(365);
assert(sysTime == SysTime(DateTime(0, 7, 6, 13, 13, 9), msecs(22)));
sysTime.roll!"days"(-731);
assert(sysTime == SysTime(DateTime(0, 7, 19, 13, 13, 9), msecs(22)));
sysTime.roll!"days"(730);
assert(sysTime == SysTime(DateTime(0, 7, 5, 13, 13, 9), msecs(22)));
}
{
auto sysTime = SysTime(DateTime(0, 7, 6, 13, 13, 9), msecs(22));
sysTime.roll!"days"(-365).roll!"days"(362).roll!"days"(-12).roll!"days"(730);
assert(sysTime == SysTime(DateTime(0, 7, 8, 13, 13, 9), msecs(22)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"days"(4)));
//static assert(!__traits(compiles, ist.roll!"days"(4)));
}
// Shares documentation with "days" version.
ref SysTime roll(string units)(long value) @safe nothrow
if (units == "hours" || units == "minutes" || units == "seconds")
{
try
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable second = splitUnitsFromHNSecs!"seconds"(hnsecs);
auto dateTime = DateTime(Date(cast(int) days), TimeOfDay(cast(int) hour,
cast(int) minute, cast(int) second));
dateTime.roll!units(value);
--days;
hnsecs += convert!("hours", "hnsecs")(dateTime.hour);
hnsecs += convert!("minutes", "hnsecs")(dateTime.minute);
hnsecs += convert!("seconds", "hnsecs")(dateTime.second);
if (days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
}
immutable newDaysHNSecs = convert!("days", "hnsecs")(days);
adjTime = newDaysHNSecs + hnsecs;
return this;
}
catch (Exception e)
assert(0, "Either DateTime's constructor or TimeOfDay's constructor threw.");
}
// Test roll!"hours"().
@safe unittest
{
import core.time;
static void testST(SysTime orig, int hours, in SysTime expected, size_t line = __LINE__)
{
orig.roll!"hours"(hours);
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
immutable d = msecs(45);
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), d);
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 13, 30, 33), d));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 14, 30, 33), d));
testST(beforeAD, 3, SysTime(DateTime(1999, 7, 6, 15, 30, 33), d));
testST(beforeAD, 4, SysTime(DateTime(1999, 7, 6, 16, 30, 33), d));
testST(beforeAD, 5, SysTime(DateTime(1999, 7, 6, 17, 30, 33), d));
testST(beforeAD, 6, SysTime(DateTime(1999, 7, 6, 18, 30, 33), d));
testST(beforeAD, 7, SysTime(DateTime(1999, 7, 6, 19, 30, 33), d));
testST(beforeAD, 8, SysTime(DateTime(1999, 7, 6, 20, 30, 33), d));
testST(beforeAD, 9, SysTime(DateTime(1999, 7, 6, 21, 30, 33), d));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 22, 30, 33), d));
testST(beforeAD, 11, SysTime(DateTime(1999, 7, 6, 23, 30, 33), d));
testST(beforeAD, 12, SysTime(DateTime(1999, 7, 6, 0, 30, 33), d));
testST(beforeAD, 13, SysTime(DateTime(1999, 7, 6, 1, 30, 33), d));
testST(beforeAD, 14, SysTime(DateTime(1999, 7, 6, 2, 30, 33), d));
testST(beforeAD, 15, SysTime(DateTime(1999, 7, 6, 3, 30, 33), d));
testST(beforeAD, 16, SysTime(DateTime(1999, 7, 6, 4, 30, 33), d));
testST(beforeAD, 17, SysTime(DateTime(1999, 7, 6, 5, 30, 33), d));
testST(beforeAD, 18, SysTime(DateTime(1999, 7, 6, 6, 30, 33), d));
testST(beforeAD, 19, SysTime(DateTime(1999, 7, 6, 7, 30, 33), d));
testST(beforeAD, 20, SysTime(DateTime(1999, 7, 6, 8, 30, 33), d));
testST(beforeAD, 21, SysTime(DateTime(1999, 7, 6, 9, 30, 33), d));
testST(beforeAD, 22, SysTime(DateTime(1999, 7, 6, 10, 30, 33), d));
testST(beforeAD, 23, SysTime(DateTime(1999, 7, 6, 11, 30, 33), d));
testST(beforeAD, 24, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 25, SysTime(DateTime(1999, 7, 6, 13, 30, 33), d));
testST(beforeAD, 50, SysTime(DateTime(1999, 7, 6, 14, 30, 33), d));
testST(beforeAD, 10_000, SysTime(DateTime(1999, 7, 6, 4, 30, 33), d));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 11, 30, 33), d));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 10, 30, 33), d));
testST(beforeAD, -3, SysTime(DateTime(1999, 7, 6, 9, 30, 33), d));
testST(beforeAD, -4, SysTime(DateTime(1999, 7, 6, 8, 30, 33), d));
testST(beforeAD, -5, SysTime(DateTime(1999, 7, 6, 7, 30, 33), d));
testST(beforeAD, -6, SysTime(DateTime(1999, 7, 6, 6, 30, 33), d));
testST(beforeAD, -7, SysTime(DateTime(1999, 7, 6, 5, 30, 33), d));
testST(beforeAD, -8, SysTime(DateTime(1999, 7, 6, 4, 30, 33), d));
testST(beforeAD, -9, SysTime(DateTime(1999, 7, 6, 3, 30, 33), d));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 2, 30, 33), d));
testST(beforeAD, -11, SysTime(DateTime(1999, 7, 6, 1, 30, 33), d));
testST(beforeAD, -12, SysTime(DateTime(1999, 7, 6, 0, 30, 33), d));
testST(beforeAD, -13, SysTime(DateTime(1999, 7, 6, 23, 30, 33), d));
testST(beforeAD, -14, SysTime(DateTime(1999, 7, 6, 22, 30, 33), d));
testST(beforeAD, -15, SysTime(DateTime(1999, 7, 6, 21, 30, 33), d));
testST(beforeAD, -16, SysTime(DateTime(1999, 7, 6, 20, 30, 33), d));
testST(beforeAD, -17, SysTime(DateTime(1999, 7, 6, 19, 30, 33), d));
testST(beforeAD, -18, SysTime(DateTime(1999, 7, 6, 18, 30, 33), d));
testST(beforeAD, -19, SysTime(DateTime(1999, 7, 6, 17, 30, 33), d));
testST(beforeAD, -20, SysTime(DateTime(1999, 7, 6, 16, 30, 33), d));
testST(beforeAD, -21, SysTime(DateTime(1999, 7, 6, 15, 30, 33), d));
testST(beforeAD, -22, SysTime(DateTime(1999, 7, 6, 14, 30, 33), d));
testST(beforeAD, -23, SysTime(DateTime(1999, 7, 6, 13, 30, 33), d));
testST(beforeAD, -24, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -25, SysTime(DateTime(1999, 7, 6, 11, 30, 33), d));
testST(beforeAD, -50, SysTime(DateTime(1999, 7, 6, 10, 30, 33), d));
testST(beforeAD, -10_000, SysTime(DateTime(1999, 7, 6, 20, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 30, 33), d), 1, SysTime(DateTime(1999, 7, 6, 1, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 30, 33), d), 0, SysTime(DateTime(1999, 7, 6, 0, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 30, 33), d), -1, SysTime(DateTime(1999, 7, 6, 23, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 23, 30, 33), d), 1, SysTime(DateTime(1999, 7, 6, 0, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 23, 30, 33), d), 0, SysTime(DateTime(1999, 7, 6, 23, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 23, 30, 33), d), -1, SysTime(DateTime(1999, 7, 6, 22, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 31, 23, 30, 33), d), 1, SysTime(DateTime(1999, 7, 31, 0, 30, 33), d));
testST(SysTime(DateTime(1999, 8, 1, 0, 30, 33), d), -1, SysTime(DateTime(1999, 8, 1, 23, 30, 33), d));
testST(SysTime(DateTime(1999, 12, 31, 23, 30, 33), d), 1, SysTime(DateTime(1999, 12, 31, 0, 30, 33), d));
testST(SysTime(DateTime(2000, 1, 1, 0, 30, 33), d), -1, SysTime(DateTime(2000, 1, 1, 23, 30, 33), d));
testST(SysTime(DateTime(1999, 2, 28, 23, 30, 33), d), 25, SysTime(DateTime(1999, 2, 28, 0, 30, 33), d));
testST(SysTime(DateTime(1999, 3, 2, 0, 30, 33), d), -25, SysTime(DateTime(1999, 3, 2, 23, 30, 33), d));
testST(SysTime(DateTime(2000, 2, 28, 23, 30, 33), d), 25, SysTime(DateTime(2000, 2, 28, 0, 30, 33), d));
testST(SysTime(DateTime(2000, 3, 1, 0, 30, 33), d), -25, SysTime(DateTime(2000, 3, 1, 23, 30, 33), d));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d);
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 13, 30, 33), d));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 14, 30, 33), d));
testST(beforeBC, 3, SysTime(DateTime(-1999, 7, 6, 15, 30, 33), d));
testST(beforeBC, 4, SysTime(DateTime(-1999, 7, 6, 16, 30, 33), d));
testST(beforeBC, 5, SysTime(DateTime(-1999, 7, 6, 17, 30, 33), d));
testST(beforeBC, 6, SysTime(DateTime(-1999, 7, 6, 18, 30, 33), d));
testST(beforeBC, 7, SysTime(DateTime(-1999, 7, 6, 19, 30, 33), d));
testST(beforeBC, 8, SysTime(DateTime(-1999, 7, 6, 20, 30, 33), d));
testST(beforeBC, 9, SysTime(DateTime(-1999, 7, 6, 21, 30, 33), d));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 22, 30, 33), d));
testST(beforeBC, 11, SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d));
testST(beforeBC, 12, SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d));
testST(beforeBC, 13, SysTime(DateTime(-1999, 7, 6, 1, 30, 33), d));
testST(beforeBC, 14, SysTime(DateTime(-1999, 7, 6, 2, 30, 33), d));
testST(beforeBC, 15, SysTime(DateTime(-1999, 7, 6, 3, 30, 33), d));
testST(beforeBC, 16, SysTime(DateTime(-1999, 7, 6, 4, 30, 33), d));
testST(beforeBC, 17, SysTime(DateTime(-1999, 7, 6, 5, 30, 33), d));
testST(beforeBC, 18, SysTime(DateTime(-1999, 7, 6, 6, 30, 33), d));
testST(beforeBC, 19, SysTime(DateTime(-1999, 7, 6, 7, 30, 33), d));
testST(beforeBC, 20, SysTime(DateTime(-1999, 7, 6, 8, 30, 33), d));
testST(beforeBC, 21, SysTime(DateTime(-1999, 7, 6, 9, 30, 33), d));
testST(beforeBC, 22, SysTime(DateTime(-1999, 7, 6, 10, 30, 33), d));
testST(beforeBC, 23, SysTime(DateTime(-1999, 7, 6, 11, 30, 33), d));
testST(beforeBC, 24, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 25, SysTime(DateTime(-1999, 7, 6, 13, 30, 33), d));
testST(beforeBC, 50, SysTime(DateTime(-1999, 7, 6, 14, 30, 33), d));
testST(beforeBC, 10_000, SysTime(DateTime(-1999, 7, 6, 4, 30, 33), d));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 11, 30, 33), d));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 10, 30, 33), d));
testST(beforeBC, -3, SysTime(DateTime(-1999, 7, 6, 9, 30, 33), d));
testST(beforeBC, -4, SysTime(DateTime(-1999, 7, 6, 8, 30, 33), d));
testST(beforeBC, -5, SysTime(DateTime(-1999, 7, 6, 7, 30, 33), d));
testST(beforeBC, -6, SysTime(DateTime(-1999, 7, 6, 6, 30, 33), d));
testST(beforeBC, -7, SysTime(DateTime(-1999, 7, 6, 5, 30, 33), d));
testST(beforeBC, -8, SysTime(DateTime(-1999, 7, 6, 4, 30, 33), d));
testST(beforeBC, -9, SysTime(DateTime(-1999, 7, 6, 3, 30, 33), d));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 2, 30, 33), d));
testST(beforeBC, -11, SysTime(DateTime(-1999, 7, 6, 1, 30, 33), d));
testST(beforeBC, -12, SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d));
testST(beforeBC, -13, SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d));
testST(beforeBC, -14, SysTime(DateTime(-1999, 7, 6, 22, 30, 33), d));
testST(beforeBC, -15, SysTime(DateTime(-1999, 7, 6, 21, 30, 33), d));
testST(beforeBC, -16, SysTime(DateTime(-1999, 7, 6, 20, 30, 33), d));
testST(beforeBC, -17, SysTime(DateTime(-1999, 7, 6, 19, 30, 33), d));
testST(beforeBC, -18, SysTime(DateTime(-1999, 7, 6, 18, 30, 33), d));
testST(beforeBC, -19, SysTime(DateTime(-1999, 7, 6, 17, 30, 33), d));
testST(beforeBC, -20, SysTime(DateTime(-1999, 7, 6, 16, 30, 33), d));
testST(beforeBC, -21, SysTime(DateTime(-1999, 7, 6, 15, 30, 33), d));
testST(beforeBC, -22, SysTime(DateTime(-1999, 7, 6, 14, 30, 33), d));
testST(beforeBC, -23, SysTime(DateTime(-1999, 7, 6, 13, 30, 33), d));
testST(beforeBC, -24, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -25, SysTime(DateTime(-1999, 7, 6, 11, 30, 33), d));
testST(beforeBC, -50, SysTime(DateTime(-1999, 7, 6, 10, 30, 33), d));
testST(beforeBC, -10_000, SysTime(DateTime(-1999, 7, 6, 20, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d), 1, SysTime(DateTime(-1999, 7, 6, 1, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d), 0, SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d), -1, SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d), 1, SysTime(DateTime(-1999, 7, 6, 0, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d), 0, SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 23, 30, 33), d), -1, SysTime(DateTime(-1999, 7, 6, 22, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 31, 23, 30, 33), d), 1, SysTime(DateTime(-1999, 7, 31, 0, 30, 33), d));
testST(SysTime(DateTime(-1999, 8, 1, 0, 30, 33), d), -1, SysTime(DateTime(-1999, 8, 1, 23, 30, 33), d));
testST(SysTime(DateTime(-2001, 12, 31, 23, 30, 33), d), 1, SysTime(DateTime(-2001, 12, 31, 0, 30, 33), d));
testST(SysTime(DateTime(-2000, 1, 1, 0, 30, 33), d), -1, SysTime(DateTime(-2000, 1, 1, 23, 30, 33), d));
testST(SysTime(DateTime(-2001, 2, 28, 23, 30, 33), d), 25, SysTime(DateTime(-2001, 2, 28, 0, 30, 33), d));
testST(SysTime(DateTime(-2001, 3, 2, 0, 30, 33), d), -25, SysTime(DateTime(-2001, 3, 2, 23, 30, 33), d));
testST(SysTime(DateTime(-2000, 2, 28, 23, 30, 33), d), 25, SysTime(DateTime(-2000, 2, 28, 0, 30, 33), d));
testST(SysTime(DateTime(-2000, 3, 1, 0, 30, 33), d), -25, SysTime(DateTime(-2000, 3, 1, 23, 30, 33), d));
// Test Both
testST(SysTime(DateTime(-1, 1, 1, 11, 30, 33), d), 17_546, SysTime(DateTime(-1, 1, 1, 13, 30, 33), d));
testST(SysTime(DateTime(1, 1, 1, 13, 30, 33), d), -17_546, SysTime(DateTime(1, 1, 1, 11, 30, 33), d));
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.roll!"hours"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 0, 0)));
sysTime.roll!"hours"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 59, 59), hnsecs(9_999_999));
sysTime.roll!"hours"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"hours"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 0, 0));
sysTime.roll!"hours"(1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 0, 0, 0)));
sysTime.roll!"hours"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"hours"(1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 0, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"hours"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"hours"(1).roll!"hours"(-67);
assert(sysTime == SysTime(DateTime(0, 12, 31, 5, 59, 59), hnsecs(9_999_999)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"hours"(4)));
//static assert(!__traits(compiles, ist.roll!"hours"(4)));
}
// Test roll!"minutes"().
@safe unittest
{
import core.time;
static void testST(SysTime orig, int minutes, in SysTime expected, size_t line = __LINE__)
{
orig.roll!"minutes"(minutes);
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
immutable d = usecs(7203);
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), d);
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 12, 31, 33), d));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 12, 32, 33), d));
testST(beforeAD, 3, SysTime(DateTime(1999, 7, 6, 12, 33, 33), d));
testST(beforeAD, 4, SysTime(DateTime(1999, 7, 6, 12, 34, 33), d));
testST(beforeAD, 5, SysTime(DateTime(1999, 7, 6, 12, 35, 33), d));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 12, 40, 33), d));
testST(beforeAD, 15, SysTime(DateTime(1999, 7, 6, 12, 45, 33), d));
testST(beforeAD, 29, SysTime(DateTime(1999, 7, 6, 12, 59, 33), d));
testST(beforeAD, 30, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(beforeAD, 45, SysTime(DateTime(1999, 7, 6, 12, 15, 33), d));
testST(beforeAD, 60, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 75, SysTime(DateTime(1999, 7, 6, 12, 45, 33), d));
testST(beforeAD, 90, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(beforeAD, 100, SysTime(DateTime(1999, 7, 6, 12, 10, 33), d));
testST(beforeAD, 689, SysTime(DateTime(1999, 7, 6, 12, 59, 33), d));
testST(beforeAD, 690, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(beforeAD, 691, SysTime(DateTime(1999, 7, 6, 12, 1, 33), d));
testST(beforeAD, 960, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 1439, SysTime(DateTime(1999, 7, 6, 12, 29, 33), d));
testST(beforeAD, 1440, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 1441, SysTime(DateTime(1999, 7, 6, 12, 31, 33), d));
testST(beforeAD, 2880, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 12, 29, 33), d));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 12, 28, 33), d));
testST(beforeAD, -3, SysTime(DateTime(1999, 7, 6, 12, 27, 33), d));
testST(beforeAD, -4, SysTime(DateTime(1999, 7, 6, 12, 26, 33), d));
testST(beforeAD, -5, SysTime(DateTime(1999, 7, 6, 12, 25, 33), d));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 12, 20, 33), d));
testST(beforeAD, -15, SysTime(DateTime(1999, 7, 6, 12, 15, 33), d));
testST(beforeAD, -29, SysTime(DateTime(1999, 7, 6, 12, 1, 33), d));
testST(beforeAD, -30, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(beforeAD, -45, SysTime(DateTime(1999, 7, 6, 12, 45, 33), d));
testST(beforeAD, -60, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -75, SysTime(DateTime(1999, 7, 6, 12, 15, 33), d));
testST(beforeAD, -90, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(beforeAD, -100, SysTime(DateTime(1999, 7, 6, 12, 50, 33), d));
testST(beforeAD, -749, SysTime(DateTime(1999, 7, 6, 12, 1, 33), d));
testST(beforeAD, -750, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(beforeAD, -751, SysTime(DateTime(1999, 7, 6, 12, 59, 33), d));
testST(beforeAD, -960, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -1439, SysTime(DateTime(1999, 7, 6, 12, 31, 33), d));
testST(beforeAD, -1440, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -1441, SysTime(DateTime(1999, 7, 6, 12, 29, 33), d));
testST(beforeAD, -2880, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 0, 33), d), 1, SysTime(DateTime(1999, 7, 6, 12, 1, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 0, 33), d), 0, SysTime(DateTime(1999, 7, 6, 12, 0, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 0, 33), d), -1, SysTime(DateTime(1999, 7, 6, 12, 59, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 11, 59, 33), d), 1, SysTime(DateTime(1999, 7, 6, 11, 0, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 11, 59, 33), d), 0, SysTime(DateTime(1999, 7, 6, 11, 59, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 11, 59, 33), d), -1, SysTime(DateTime(1999, 7, 6, 11, 58, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 0, 33), d), 1, SysTime(DateTime(1999, 7, 6, 0, 1, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 0, 33), d), 0, SysTime(DateTime(1999, 7, 6, 0, 0, 33), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 0, 33), d), -1, SysTime(DateTime(1999, 7, 6, 0, 59, 33), d));
testST(SysTime(DateTime(1999, 7, 5, 23, 59, 33), d), 1, SysTime(DateTime(1999, 7, 5, 23, 0, 33), d));
testST(SysTime(DateTime(1999, 7, 5, 23, 59, 33), d), 0, SysTime(DateTime(1999, 7, 5, 23, 59, 33), d));
testST(SysTime(DateTime(1999, 7, 5, 23, 59, 33), d), -1, SysTime(DateTime(1999, 7, 5, 23, 58, 33), d));
testST(SysTime(DateTime(1998, 12, 31, 23, 59, 33), d), 1, SysTime(DateTime(1998, 12, 31, 23, 0, 33), d));
testST(SysTime(DateTime(1998, 12, 31, 23, 59, 33), d), 0, SysTime(DateTime(1998, 12, 31, 23, 59, 33), d));
testST(SysTime(DateTime(1998, 12, 31, 23, 59, 33), d), -1, SysTime(DateTime(1998, 12, 31, 23, 58, 33), d));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d);
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 12, 31, 33), d));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 12, 32, 33), d));
testST(beforeBC, 3, SysTime(DateTime(-1999, 7, 6, 12, 33, 33), d));
testST(beforeBC, 4, SysTime(DateTime(-1999, 7, 6, 12, 34, 33), d));
testST(beforeBC, 5, SysTime(DateTime(-1999, 7, 6, 12, 35, 33), d));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 12, 40, 33), d));
testST(beforeBC, 15, SysTime(DateTime(-1999, 7, 6, 12, 45, 33), d));
testST(beforeBC, 29, SysTime(DateTime(-1999, 7, 6, 12, 59, 33), d));
testST(beforeBC, 30, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(beforeBC, 45, SysTime(DateTime(-1999, 7, 6, 12, 15, 33), d));
testST(beforeBC, 60, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 75, SysTime(DateTime(-1999, 7, 6, 12, 45, 33), d));
testST(beforeBC, 90, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(beforeBC, 100, SysTime(DateTime(-1999, 7, 6, 12, 10, 33), d));
testST(beforeBC, 689, SysTime(DateTime(-1999, 7, 6, 12, 59, 33), d));
testST(beforeBC, 690, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(beforeBC, 691, SysTime(DateTime(-1999, 7, 6, 12, 1, 33), d));
testST(beforeBC, 960, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 1439, SysTime(DateTime(-1999, 7, 6, 12, 29, 33), d));
testST(beforeBC, 1440, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 1441, SysTime(DateTime(-1999, 7, 6, 12, 31, 33), d));
testST(beforeBC, 2880, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 12, 29, 33), d));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 12, 28, 33), d));
testST(beforeBC, -3, SysTime(DateTime(-1999, 7, 6, 12, 27, 33), d));
testST(beforeBC, -4, SysTime(DateTime(-1999, 7, 6, 12, 26, 33), d));
testST(beforeBC, -5, SysTime(DateTime(-1999, 7, 6, 12, 25, 33), d));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 12, 20, 33), d));
testST(beforeBC, -15, SysTime(DateTime(-1999, 7, 6, 12, 15, 33), d));
testST(beforeBC, -29, SysTime(DateTime(-1999, 7, 6, 12, 1, 33), d));
testST(beforeBC, -30, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(beforeBC, -45, SysTime(DateTime(-1999, 7, 6, 12, 45, 33), d));
testST(beforeBC, -60, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -75, SysTime(DateTime(-1999, 7, 6, 12, 15, 33), d));
testST(beforeBC, -90, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(beforeBC, -100, SysTime(DateTime(-1999, 7, 6, 12, 50, 33), d));
testST(beforeBC, -749, SysTime(DateTime(-1999, 7, 6, 12, 1, 33), d));
testST(beforeBC, -750, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(beforeBC, -751, SysTime(DateTime(-1999, 7, 6, 12, 59, 33), d));
testST(beforeBC, -960, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -1439, SysTime(DateTime(-1999, 7, 6, 12, 31, 33), d));
testST(beforeBC, -1440, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -1441, SysTime(DateTime(-1999, 7, 6, 12, 29, 33), d));
testST(beforeBC, -2880, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d), 1, SysTime(DateTime(-1999, 7, 6, 12, 1, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d), 0, SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 0, 33), d), -1, SysTime(DateTime(-1999, 7, 6, 12, 59, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 11, 59, 33), d), 1, SysTime(DateTime(-1999, 7, 6, 11, 0, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 11, 59, 33), d), 0, SysTime(DateTime(-1999, 7, 6, 11, 59, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 11, 59, 33), d), -1, SysTime(DateTime(-1999, 7, 6, 11, 58, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 0, 33), d), 1, SysTime(DateTime(-1999, 7, 6, 0, 1, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 0, 33), d), 0, SysTime(DateTime(-1999, 7, 6, 0, 0, 33), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 0, 33), d), -1, SysTime(DateTime(-1999, 7, 6, 0, 59, 33), d));
testST(SysTime(DateTime(-1999, 7, 5, 23, 59, 33), d), 1, SysTime(DateTime(-1999, 7, 5, 23, 0, 33), d));
testST(SysTime(DateTime(-1999, 7, 5, 23, 59, 33), d), 0, SysTime(DateTime(-1999, 7, 5, 23, 59, 33), d));
testST(SysTime(DateTime(-1999, 7, 5, 23, 59, 33), d), -1, SysTime(DateTime(-1999, 7, 5, 23, 58, 33), d));
testST(SysTime(DateTime(-2000, 12, 31, 23, 59, 33), d), 1, SysTime(DateTime(-2000, 12, 31, 23, 0, 33), d));
testST(SysTime(DateTime(-2000, 12, 31, 23, 59, 33), d), 0, SysTime(DateTime(-2000, 12, 31, 23, 59, 33), d));
testST(SysTime(DateTime(-2000, 12, 31, 23, 59, 33), d), -1, SysTime(DateTime(-2000, 12, 31, 23, 58, 33), d));
// Test Both
testST(SysTime(DateTime(1, 1, 1, 0, 0, 0)), -1, SysTime(DateTime(1, 1, 1, 0, 59, 0)));
testST(SysTime(DateTime(0, 12, 31, 23, 59, 0)), 1, SysTime(DateTime(0, 12, 31, 23, 0, 0)));
testST(SysTime(DateTime(0, 1, 1, 0, 0, 0)), -1, SysTime(DateTime(0, 1, 1, 0, 59, 0)));
testST(SysTime(DateTime(-1, 12, 31, 23, 59, 0)), 1, SysTime(DateTime(-1, 12, 31, 23, 0, 0)));
testST(SysTime(DateTime(-1, 1, 1, 11, 30, 33), d), 1_052_760, SysTime(DateTime(-1, 1, 1, 11, 30, 33), d));
testST(SysTime(DateTime(1, 1, 1, 13, 30, 33), d), -1_052_760, SysTime(DateTime(1, 1, 1, 13, 30, 33), d));
testST(SysTime(DateTime(-1, 1, 1, 11, 30, 33), d), 1_052_782, SysTime(DateTime(-1, 1, 1, 11, 52, 33), d));
testST(SysTime(DateTime(1, 1, 1, 13, 52, 33), d), -1_052_782, SysTime(DateTime(1, 1, 1, 13, 30, 33), d));
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.roll!"minutes"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 59, 0)));
sysTime.roll!"minutes"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 59), hnsecs(9_999_999));
sysTime.roll!"minutes"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 59, 59), hnsecs(9_999_999)));
sysTime.roll!"minutes"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 0));
sysTime.roll!"minutes"(1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 0, 0)));
sysTime.roll!"minutes"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 0)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"minutes"(1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 0, 59), hnsecs(9_999_999)));
sysTime.roll!"minutes"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"minutes"(1).roll!"minutes"(-79);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 41, 59), hnsecs(9_999_999)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"minutes"(4)));
//static assert(!__traits(compiles, ist.roll!"minutes"(4)));
}
// Test roll!"seconds"().
@safe unittest
{
import core.time;
static void testST(SysTime orig, int seconds, in SysTime expected, size_t line = __LINE__)
{
orig.roll!"seconds"(seconds);
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
immutable d = msecs(274);
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), d);
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 12, 30, 34), d));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 12, 30, 35), d));
testST(beforeAD, 3, SysTime(DateTime(1999, 7, 6, 12, 30, 36), d));
testST(beforeAD, 4, SysTime(DateTime(1999, 7, 6, 12, 30, 37), d));
testST(beforeAD, 5, SysTime(DateTime(1999, 7, 6, 12, 30, 38), d));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 12, 30, 43), d));
testST(beforeAD, 15, SysTime(DateTime(1999, 7, 6, 12, 30, 48), d));
testST(beforeAD, 26, SysTime(DateTime(1999, 7, 6, 12, 30, 59), d));
testST(beforeAD, 27, SysTime(DateTime(1999, 7, 6, 12, 30, 0), d));
testST(beforeAD, 30, SysTime(DateTime(1999, 7, 6, 12, 30, 3), d));
testST(beforeAD, 59, SysTime(DateTime(1999, 7, 6, 12, 30, 32), d));
testST(beforeAD, 60, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 61, SysTime(DateTime(1999, 7, 6, 12, 30, 34), d));
testST(beforeAD, 1766, SysTime(DateTime(1999, 7, 6, 12, 30, 59), d));
testST(beforeAD, 1767, SysTime(DateTime(1999, 7, 6, 12, 30, 0), d));
testST(beforeAD, 1768, SysTime(DateTime(1999, 7, 6, 12, 30, 1), d));
testST(beforeAD, 2007, SysTime(DateTime(1999, 7, 6, 12, 30, 0), d));
testST(beforeAD, 3599, SysTime(DateTime(1999, 7, 6, 12, 30, 32), d));
testST(beforeAD, 3600, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, 3601, SysTime(DateTime(1999, 7, 6, 12, 30, 34), d));
testST(beforeAD, 7200, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 12, 30, 32), d));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 12, 30, 31), d));
testST(beforeAD, -3, SysTime(DateTime(1999, 7, 6, 12, 30, 30), d));
testST(beforeAD, -4, SysTime(DateTime(1999, 7, 6, 12, 30, 29), d));
testST(beforeAD, -5, SysTime(DateTime(1999, 7, 6, 12, 30, 28), d));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 12, 30, 23), d));
testST(beforeAD, -15, SysTime(DateTime(1999, 7, 6, 12, 30, 18), d));
testST(beforeAD, -33, SysTime(DateTime(1999, 7, 6, 12, 30, 0), d));
testST(beforeAD, -34, SysTime(DateTime(1999, 7, 6, 12, 30, 59), d));
testST(beforeAD, -35, SysTime(DateTime(1999, 7, 6, 12, 30, 58), d));
testST(beforeAD, -59, SysTime(DateTime(1999, 7, 6, 12, 30, 34), d));
testST(beforeAD, -60, SysTime(DateTime(1999, 7, 6, 12, 30, 33), d));
testST(beforeAD, -61, SysTime(DateTime(1999, 7, 6, 12, 30, 32), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 30, 0), d), 1, SysTime(DateTime(1999, 7, 6, 12, 30, 1), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 30, 0), d), 0, SysTime(DateTime(1999, 7, 6, 12, 30, 0), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 30, 0), d), -1, SysTime(DateTime(1999, 7, 6, 12, 30, 59), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 0, 0), d), 1, SysTime(DateTime(1999, 7, 6, 12, 0, 1), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 0, 0), d), 0, SysTime(DateTime(1999, 7, 6, 12, 0, 0), d));
testST(SysTime(DateTime(1999, 7, 6, 12, 0, 0), d), -1, SysTime(DateTime(1999, 7, 6, 12, 0, 59), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 0, 0), d), 1, SysTime(DateTime(1999, 7, 6, 0, 0, 1), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 0, 0), d), 0, SysTime(DateTime(1999, 7, 6, 0, 0, 0), d));
testST(SysTime(DateTime(1999, 7, 6, 0, 0, 0), d), -1, SysTime(DateTime(1999, 7, 6, 0, 0, 59), d));
testST(SysTime(DateTime(1999, 7, 5, 23, 59, 59), d), 1, SysTime(DateTime(1999, 7, 5, 23, 59, 0), d));
testST(SysTime(DateTime(1999, 7, 5, 23, 59, 59), d), 0, SysTime(DateTime(1999, 7, 5, 23, 59, 59), d));
testST(SysTime(DateTime(1999, 7, 5, 23, 59, 59), d), -1, SysTime(DateTime(1999, 7, 5, 23, 59, 58), d));
testST(SysTime(DateTime(1998, 12, 31, 23, 59, 59), d), 1, SysTime(DateTime(1998, 12, 31, 23, 59, 0), d));
testST(SysTime(DateTime(1998, 12, 31, 23, 59, 59), d), 0, SysTime(DateTime(1998, 12, 31, 23, 59, 59), d));
testST(SysTime(DateTime(1998, 12, 31, 23, 59, 59), d), -1, SysTime(DateTime(1998, 12, 31, 23, 59, 58), d));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d);
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 12, 30, 34), d));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 12, 30, 35), d));
testST(beforeBC, 3, SysTime(DateTime(-1999, 7, 6, 12, 30, 36), d));
testST(beforeBC, 4, SysTime(DateTime(-1999, 7, 6, 12, 30, 37), d));
testST(beforeBC, 5, SysTime(DateTime(-1999, 7, 6, 12, 30, 38), d));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 12, 30, 43), d));
testST(beforeBC, 15, SysTime(DateTime(-1999, 7, 6, 12, 30, 48), d));
testST(beforeBC, 26, SysTime(DateTime(-1999, 7, 6, 12, 30, 59), d));
testST(beforeBC, 27, SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d));
testST(beforeBC, 30, SysTime(DateTime(-1999, 7, 6, 12, 30, 3), d));
testST(beforeBC, 59, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), d));
testST(beforeBC, 60, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 61, SysTime(DateTime(-1999, 7, 6, 12, 30, 34), d));
testST(beforeBC, 1766, SysTime(DateTime(-1999, 7, 6, 12, 30, 59), d));
testST(beforeBC, 1767, SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d));
testST(beforeBC, 1768, SysTime(DateTime(-1999, 7, 6, 12, 30, 1), d));
testST(beforeBC, 2007, SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d));
testST(beforeBC, 3599, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), d));
testST(beforeBC, 3600, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, 3601, SysTime(DateTime(-1999, 7, 6, 12, 30, 34), d));
testST(beforeBC, 7200, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), d));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 12, 30, 31), d));
testST(beforeBC, -3, SysTime(DateTime(-1999, 7, 6, 12, 30, 30), d));
testST(beforeBC, -4, SysTime(DateTime(-1999, 7, 6, 12, 30, 29), d));
testST(beforeBC, -5, SysTime(DateTime(-1999, 7, 6, 12, 30, 28), d));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 12, 30, 23), d));
testST(beforeBC, -15, SysTime(DateTime(-1999, 7, 6, 12, 30, 18), d));
testST(beforeBC, -33, SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d));
testST(beforeBC, -34, SysTime(DateTime(-1999, 7, 6, 12, 30, 59), d));
testST(beforeBC, -35, SysTime(DateTime(-1999, 7, 6, 12, 30, 58), d));
testST(beforeBC, -59, SysTime(DateTime(-1999, 7, 6, 12, 30, 34), d));
testST(beforeBC, -60, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), d));
testST(beforeBC, -61, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d), 1, SysTime(DateTime(-1999, 7, 6, 12, 30, 1), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d), 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 30, 0), d), -1, SysTime(DateTime(-1999, 7, 6, 12, 30, 59), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 0, 0), d), 1, SysTime(DateTime(-1999, 7, 6, 12, 0, 1), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 0, 0), d), 0, SysTime(DateTime(-1999, 7, 6, 12, 0, 0), d));
testST(SysTime(DateTime(-1999, 7, 6, 12, 0, 0), d), -1, SysTime(DateTime(-1999, 7, 6, 12, 0, 59), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 0, 0), d), 1, SysTime(DateTime(-1999, 7, 6, 0, 0, 1), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 0, 0), d), 0, SysTime(DateTime(-1999, 7, 6, 0, 0, 0), d));
testST(SysTime(DateTime(-1999, 7, 6, 0, 0, 0), d), -1, SysTime(DateTime(-1999, 7, 6, 0, 0, 59), d));
testST(SysTime(DateTime(-1999, 7, 5, 23, 59, 59), d), 1, SysTime(DateTime(-1999, 7, 5, 23, 59, 0), d));
testST(SysTime(DateTime(-1999, 7, 5, 23, 59, 59), d), 0, SysTime(DateTime(-1999, 7, 5, 23, 59, 59), d));
testST(SysTime(DateTime(-1999, 7, 5, 23, 59, 59), d), -1, SysTime(DateTime(-1999, 7, 5, 23, 59, 58), d));
testST(SysTime(DateTime(-2000, 12, 31, 23, 59, 59), d), 1, SysTime(DateTime(-2000, 12, 31, 23, 59, 0), d));
testST(SysTime(DateTime(-2000, 12, 31, 23, 59, 59), d), 0, SysTime(DateTime(-2000, 12, 31, 23, 59, 59), d));
testST(SysTime(DateTime(-2000, 12, 31, 23, 59, 59), d), -1, SysTime(DateTime(-2000, 12, 31, 23, 59, 58), d));
// Test Both
testST(SysTime(DateTime(1, 1, 1, 0, 0, 0), d), -1, SysTime(DateTime(1, 1, 1, 0, 0, 59), d));
testST(SysTime(DateTime(0, 12, 31, 23, 59, 59), d), 1, SysTime(DateTime(0, 12, 31, 23, 59, 0), d));
testST(SysTime(DateTime(0, 1, 1, 0, 0, 0), d), -1, SysTime(DateTime(0, 1, 1, 0, 0, 59), d));
testST(SysTime(DateTime(-1, 12, 31, 23, 59, 59), d), 1, SysTime(DateTime(-1, 12, 31, 23, 59, 0), d));
testST(SysTime(DateTime(-1, 1, 1, 11, 30, 33), d), 63_165_600L, SysTime(DateTime(-1, 1, 1, 11, 30, 33), d));
testST(SysTime(DateTime(1, 1, 1, 13, 30, 33), d), -63_165_600L, SysTime(DateTime(1, 1, 1, 13, 30, 33), d));
testST(SysTime(DateTime(-1, 1, 1, 11, 30, 33), d), 63_165_617L, SysTime(DateTime(-1, 1, 1, 11, 30, 50), d));
testST(SysTime(DateTime(1, 1, 1, 13, 30, 50), d), -63_165_617L, SysTime(DateTime(1, 1, 1, 13, 30, 33), d));
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0));
sysTime.roll!"seconds"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 59)));
sysTime.roll!"seconds"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0)));
}
{
auto sysTime = SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(9_999_999));
sysTime.roll!"seconds"(-1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 59), hnsecs(9_999_999)));
sysTime.roll!"seconds"(1);
assert(sysTime == SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59));
sysTime.roll!"seconds"(1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 0)));
sysTime.roll!"seconds"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 59)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"seconds"(1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 0), hnsecs(9_999_999)));
sysTime.roll!"seconds"(-1);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
}
{
auto sysTime = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
sysTime.roll!"seconds"(1).roll!"seconds"(-102);
assert(sysTime == SysTime(DateTime(0, 12, 31, 23, 59, 18), hnsecs(9_999_999)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"seconds"(4)));
//static assert(!__traits(compiles, ist.roll!"seconds"(4)));
}
// Shares documentation with "days" version.
ref SysTime roll(string units)(long value) @safe nothrow
if (units == "msecs" || units == "usecs" || units == "hnsecs")
{
auto hnsecs = adjTime;
immutable days = splitUnitsFromHNSecs!"days"(hnsecs);
immutable negative = hnsecs < 0;
if (negative)
hnsecs += convert!("hours", "hnsecs")(24);
immutable seconds = splitUnitsFromHNSecs!"seconds"(hnsecs);
hnsecs += convert!(units, "hnsecs")(value);
hnsecs %= convert!("seconds", "hnsecs")(1);
if (hnsecs < 0)
hnsecs += convert!("seconds", "hnsecs")(1);
hnsecs += convert!("seconds", "hnsecs")(seconds);
if (negative)
hnsecs -= convert!("hours", "hnsecs")(24);
immutable newDaysHNSecs = convert!("days", "hnsecs")(days);
adjTime = newDaysHNSecs + hnsecs;
return this;
}
// Test roll!"msecs"().
@safe unittest
{
import core.time;
static void testST(SysTime orig, int milliseconds, in SysTime expected, size_t line = __LINE__)
{
orig.roll!"msecs"(milliseconds);
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(274));
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(275)));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(276)));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(284)));
testST(beforeAD, 100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(374)));
testST(beforeAD, 725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeAD, 726, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, 1000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeAD, 1001, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(275)));
testST(beforeAD, 2000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeAD, 26_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeAD, 26_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, 26_727, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(1)));
testST(beforeAD, 1_766_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeAD, 1_766_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(273)));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(272)));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(264)));
testST(beforeAD, -100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(174)));
testST(beforeAD, -274, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -275, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeAD, -1000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeAD, -1001, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(273)));
testST(beforeAD, -2000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeAD, -33_274, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -33_275, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeAD, -1_833_274, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -1_833_275, SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(999)));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(274));
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(275)));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(276)));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(284)));
testST(beforeBC, 100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(374)));
testST(beforeBC, 725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeBC, 726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, 1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeBC, 1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(275)));
testST(beforeBC, 2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeBC, 26_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeBC, 26_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, 26_727, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(1)));
testST(beforeBC, 1_766_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeBC, 1_766_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(273)));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(272)));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(264)));
testST(beforeBC, -100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(174)));
testST(beforeBC, -274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -275, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeBC, -1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeBC, -1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(273)));
testST(beforeBC, -2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(274)));
testST(beforeBC, -33_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -33_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(999)));
testST(beforeBC, -1_833_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -1_833_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), msecs(999)));
// Test Both
auto beforeBoth1 = SysTime(DateTime(1, 1, 1, 0, 0, 0));
testST(beforeBoth1, 1, SysTime(DateTime(1, 1, 1, 0, 0, 0), msecs(1)));
testST(beforeBoth1, 0, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -1, SysTime(DateTime(1, 1, 1, 0, 0, 0), msecs(999)));
testST(beforeBoth1, -2, SysTime(DateTime(1, 1, 1, 0, 0, 0), msecs(998)));
testST(beforeBoth1, -1000, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -2000, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -2555, SysTime(DateTime(1, 1, 1, 0, 0, 0), msecs(445)));
auto beforeBoth2 = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
testST(beforeBoth2, -1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_989_999)));
testST(beforeBoth2, 0, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9999)));
testST(beforeBoth2, 2, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(19_999)));
testST(beforeBoth2, 1000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 2000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 2555, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(5_549_999)));
{
auto st = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
st.roll!"msecs"(1202).roll!"msecs"(-703);
assert(st == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(4_989_999)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.addMSecs(4)));
//static assert(!__traits(compiles, ist.addMSecs(4)));
}
// Test roll!"usecs"().
@safe unittest
{
import core.time;
static void testST(SysTime orig, long microseconds, in SysTime expected, size_t line = __LINE__)
{
orig.roll!"usecs"(microseconds);
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274));
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(275)));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(276)));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(284)));
testST(beforeAD, 100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(374)));
testST(beforeAD, 725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(999)));
testST(beforeAD, 726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(1000)));
testST(beforeAD, 1000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(1274)));
testST(beforeAD, 1001, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(1275)));
testST(beforeAD, 2000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(2274)));
testST(beforeAD, 26_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(26_999)));
testST(beforeAD, 26_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(27_000)));
testST(beforeAD, 26_727, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(27_001)));
testST(beforeAD, 1_766_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(766_999)));
testST(beforeAD, 1_766_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(767_000)));
testST(beforeAD, 1_000_000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeAD, 60_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeAD, 3_600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(273)));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(272)));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(264)));
testST(beforeAD, -100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(174)));
testST(beforeAD, -274, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -275, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(999_999)));
testST(beforeAD, -1000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(999_274)));
testST(beforeAD, -1001, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(999_273)));
testST(beforeAD, -2000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(998_274)));
testST(beforeAD, -33_274, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(967_000)));
testST(beforeAD, -33_275, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(966_999)));
testST(beforeAD, -1_833_274, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(167_000)));
testST(beforeAD, -1_833_275, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(166_999)));
testST(beforeAD, -1_000_000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeAD, -60_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeAD, -3_600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(274)));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274));
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(275)));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(276)));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(284)));
testST(beforeBC, 100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(374)));
testST(beforeBC, 725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(999)));
testST(beforeBC, 726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(1000)));
testST(beforeBC, 1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(1274)));
testST(beforeBC, 1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(1275)));
testST(beforeBC, 2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(2274)));
testST(beforeBC, 26_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(26_999)));
testST(beforeBC, 26_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(27_000)));
testST(beforeBC, 26_727, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(27_001)));
testST(beforeBC, 1_766_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(766_999)));
testST(beforeBC, 1_766_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(767_000)));
testST(beforeBC, 1_000_000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeBC, 60_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeBC, 3_600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(273)));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(272)));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(264)));
testST(beforeBC, -100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(174)));
testST(beforeBC, -274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -275, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(999_999)));
testST(beforeBC, -1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(999_274)));
testST(beforeBC, -1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(999_273)));
testST(beforeBC, -2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(998_274)));
testST(beforeBC, -33_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(967_000)));
testST(beforeBC, -33_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(966_999)));
testST(beforeBC, -1_833_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(167_000)));
testST(beforeBC, -1_833_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(166_999)));
testST(beforeBC, -1_000_000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeBC, -60_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
testST(beforeBC, -3_600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), usecs(274)));
// Test Both
auto beforeBoth1 = SysTime(DateTime(1, 1, 1, 0, 0, 0));
testST(beforeBoth1, 1, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(1)));
testST(beforeBoth1, 0, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -1, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(999_999)));
testST(beforeBoth1, -2, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(999_998)));
testST(beforeBoth1, -1000, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(999_000)));
testST(beforeBoth1, -2000, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(998_000)));
testST(beforeBoth1, -2555, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(997_445)));
testST(beforeBoth1, -1_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -2_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -2_333_333, SysTime(DateTime(1, 1, 1, 0, 0, 0), usecs(666_667)));
auto beforeBoth2 = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
testST(beforeBoth2, -1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_989)));
testST(beforeBoth2, 0, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9)));
testST(beforeBoth2, 2, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(19)));
testST(beforeBoth2, 1000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9999)));
testST(beforeBoth2, 2000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(19_999)));
testST(beforeBoth2, 2555, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(25_549)));
testST(beforeBoth2, 1_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 2_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 2_333_333, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(3_333_329)));
{
auto st = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
st.roll!"usecs"(9_020_027);
assert(st == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(200_269)));
}
{
auto st = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
st.roll!"usecs"(9_020_027).roll!"usecs"(-70_034);
assert(st == SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_499_929)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"usecs"(4)));
//static assert(!__traits(compiles, ist.roll!"usecs"(4)));
}
// Test roll!"hnsecs"().
@safe unittest
{
import core.time;
static void testST(SysTime orig, long hnsecs, in SysTime expected, size_t line = __LINE__)
{
orig.roll!"hnsecs"(hnsecs);
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
auto dtAD = DateTime(1999, 7, 6, 12, 30, 33);
auto beforeAD = SysTime(dtAD, hnsecs(274));
testST(beforeAD, 0, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, 1, SysTime(dtAD, hnsecs(275)));
testST(beforeAD, 2, SysTime(dtAD, hnsecs(276)));
testST(beforeAD, 10, SysTime(dtAD, hnsecs(284)));
testST(beforeAD, 100, SysTime(dtAD, hnsecs(374)));
testST(beforeAD, 725, SysTime(dtAD, hnsecs(999)));
testST(beforeAD, 726, SysTime(dtAD, hnsecs(1000)));
testST(beforeAD, 1000, SysTime(dtAD, hnsecs(1274)));
testST(beforeAD, 1001, SysTime(dtAD, hnsecs(1275)));
testST(beforeAD, 2000, SysTime(dtAD, hnsecs(2274)));
testST(beforeAD, 26_725, SysTime(dtAD, hnsecs(26_999)));
testST(beforeAD, 26_726, SysTime(dtAD, hnsecs(27_000)));
testST(beforeAD, 26_727, SysTime(dtAD, hnsecs(27_001)));
testST(beforeAD, 1_766_725, SysTime(dtAD, hnsecs(1_766_999)));
testST(beforeAD, 1_766_726, SysTime(dtAD, hnsecs(1_767_000)));
testST(beforeAD, 1_000_000, SysTime(dtAD, hnsecs(1_000_274)));
testST(beforeAD, 60_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, 3_600_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, 600_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, 36_000_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, -1, SysTime(dtAD, hnsecs(273)));
testST(beforeAD, -2, SysTime(dtAD, hnsecs(272)));
testST(beforeAD, -10, SysTime(dtAD, hnsecs(264)));
testST(beforeAD, -100, SysTime(dtAD, hnsecs(174)));
testST(beforeAD, -274, SysTime(dtAD));
testST(beforeAD, -275, SysTime(dtAD, hnsecs(9_999_999)));
testST(beforeAD, -1000, SysTime(dtAD, hnsecs(9_999_274)));
testST(beforeAD, -1001, SysTime(dtAD, hnsecs(9_999_273)));
testST(beforeAD, -2000, SysTime(dtAD, hnsecs(9_998_274)));
testST(beforeAD, -33_274, SysTime(dtAD, hnsecs(9_967_000)));
testST(beforeAD, -33_275, SysTime(dtAD, hnsecs(9_966_999)));
testST(beforeAD, -1_833_274, SysTime(dtAD, hnsecs(8_167_000)));
testST(beforeAD, -1_833_275, SysTime(dtAD, hnsecs(8_166_999)));
testST(beforeAD, -1_000_000, SysTime(dtAD, hnsecs(9_000_274)));
testST(beforeAD, -60_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, -3_600_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, -600_000_000L, SysTime(dtAD, hnsecs(274)));
testST(beforeAD, -36_000_000_000L, SysTime(dtAD, hnsecs(274)));
// Test B.C.
auto dtBC = DateTime(-1999, 7, 6, 12, 30, 33);
auto beforeBC = SysTime(dtBC, hnsecs(274));
testST(beforeBC, 0, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, 1, SysTime(dtBC, hnsecs(275)));
testST(beforeBC, 2, SysTime(dtBC, hnsecs(276)));
testST(beforeBC, 10, SysTime(dtBC, hnsecs(284)));
testST(beforeBC, 100, SysTime(dtBC, hnsecs(374)));
testST(beforeBC, 725, SysTime(dtBC, hnsecs(999)));
testST(beforeBC, 726, SysTime(dtBC, hnsecs(1000)));
testST(beforeBC, 1000, SysTime(dtBC, hnsecs(1274)));
testST(beforeBC, 1001, SysTime(dtBC, hnsecs(1275)));
testST(beforeBC, 2000, SysTime(dtBC, hnsecs(2274)));
testST(beforeBC, 26_725, SysTime(dtBC, hnsecs(26_999)));
testST(beforeBC, 26_726, SysTime(dtBC, hnsecs(27_000)));
testST(beforeBC, 26_727, SysTime(dtBC, hnsecs(27_001)));
testST(beforeBC, 1_766_725, SysTime(dtBC, hnsecs(1_766_999)));
testST(beforeBC, 1_766_726, SysTime(dtBC, hnsecs(1_767_000)));
testST(beforeBC, 1_000_000, SysTime(dtBC, hnsecs(1_000_274)));
testST(beforeBC, 60_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, 3_600_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, 600_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, 36_000_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, -1, SysTime(dtBC, hnsecs(273)));
testST(beforeBC, -2, SysTime(dtBC, hnsecs(272)));
testST(beforeBC, -10, SysTime(dtBC, hnsecs(264)));
testST(beforeBC, -100, SysTime(dtBC, hnsecs(174)));
testST(beforeBC, -274, SysTime(dtBC));
testST(beforeBC, -275, SysTime(dtBC, hnsecs(9_999_999)));
testST(beforeBC, -1000, SysTime(dtBC, hnsecs(9_999_274)));
testST(beforeBC, -1001, SysTime(dtBC, hnsecs(9_999_273)));
testST(beforeBC, -2000, SysTime(dtBC, hnsecs(9_998_274)));
testST(beforeBC, -33_274, SysTime(dtBC, hnsecs(9_967_000)));
testST(beforeBC, -33_275, SysTime(dtBC, hnsecs(9_966_999)));
testST(beforeBC, -1_833_274, SysTime(dtBC, hnsecs(8_167_000)));
testST(beforeBC, -1_833_275, SysTime(dtBC, hnsecs(8_166_999)));
testST(beforeBC, -1_000_000, SysTime(dtBC, hnsecs(9_000_274)));
testST(beforeBC, -60_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, -3_600_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, -600_000_000L, SysTime(dtBC, hnsecs(274)));
testST(beforeBC, -36_000_000_000L, SysTime(dtBC, hnsecs(274)));
// Test Both
auto dtBoth1 = DateTime(1, 1, 1, 0, 0, 0);
auto beforeBoth1 = SysTime(dtBoth1);
testST(beforeBoth1, 1, SysTime(dtBoth1, hnsecs(1)));
testST(beforeBoth1, 0, SysTime(dtBoth1));
testST(beforeBoth1, -1, SysTime(dtBoth1, hnsecs(9_999_999)));
testST(beforeBoth1, -2, SysTime(dtBoth1, hnsecs(9_999_998)));
testST(beforeBoth1, -1000, SysTime(dtBoth1, hnsecs(9_999_000)));
testST(beforeBoth1, -2000, SysTime(dtBoth1, hnsecs(9_998_000)));
testST(beforeBoth1, -2555, SysTime(dtBoth1, hnsecs(9_997_445)));
testST(beforeBoth1, -1_000_000, SysTime(dtBoth1, hnsecs(9_000_000)));
testST(beforeBoth1, -2_000_000, SysTime(dtBoth1, hnsecs(8_000_000)));
testST(beforeBoth1, -2_333_333, SysTime(dtBoth1, hnsecs(7_666_667)));
testST(beforeBoth1, -10_000_000, SysTime(dtBoth1));
testST(beforeBoth1, -20_000_000, SysTime(dtBoth1));
testST(beforeBoth1, -20_888_888, SysTime(dtBoth1, hnsecs(9_111_112)));
auto dtBoth2 = DateTime(0, 12, 31, 23, 59, 59);
auto beforeBoth2 = SysTime(dtBoth2, hnsecs(9_999_999));
testST(beforeBoth2, -1, SysTime(dtBoth2, hnsecs(9_999_998)));
testST(beforeBoth2, 0, SysTime(dtBoth2, hnsecs(9_999_999)));
testST(beforeBoth2, 1, SysTime(dtBoth2));
testST(beforeBoth2, 2, SysTime(dtBoth2, hnsecs(1)));
testST(beforeBoth2, 1000, SysTime(dtBoth2, hnsecs(999)));
testST(beforeBoth2, 2000, SysTime(dtBoth2, hnsecs(1999)));
testST(beforeBoth2, 2555, SysTime(dtBoth2, hnsecs(2554)));
testST(beforeBoth2, 1_000_000, SysTime(dtBoth2, hnsecs(999_999)));
testST(beforeBoth2, 2_000_000, SysTime(dtBoth2, hnsecs(1_999_999)));
testST(beforeBoth2, 2_333_333, SysTime(dtBoth2, hnsecs(2_333_332)));
testST(beforeBoth2, 10_000_000, SysTime(dtBoth2, hnsecs(9_999_999)));
testST(beforeBoth2, 20_000_000, SysTime(dtBoth2, hnsecs(9_999_999)));
testST(beforeBoth2, 20_888_888, SysTime(dtBoth2, hnsecs(888_887)));
{
auto st = SysTime(dtBoth2, hnsecs(9_999_999));
st.roll!"hnsecs"(70_777_222).roll!"hnsecs"(-222_555_292);
assert(st == SysTime(dtBoth2, hnsecs(8_221_929)));
}
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.roll!"hnsecs"(4)));
//static assert(!__traits(compiles, ist.roll!"hnsecs"(4)));
}
/++
Gives the result of adding or subtracting a $(REF Duration, core,time)
from this $(LREF SysTime).
The legal types of arithmetic for $(LREF SysTime) using this operator
are
$(BOOKTABLE,
$(TR $(TD SysTime) $(TD +) $(TD Duration) $(TD -->) $(TD SysTime))
$(TR $(TD SysTime) $(TD -) $(TD Duration) $(TD -->) $(TD SysTime))
)
Params:
duration = The $(REF Duration, core,time) to add to or subtract from
this $(LREF SysTime).
+/
SysTime opBinary(string op)(Duration duration) @safe const pure nothrow
if (op == "+" || op == "-")
{
SysTime retval = SysTime(this._stdTime, this._timezone);
immutable hnsecs = duration.total!"hnsecs";
mixin("retval._stdTime " ~ op ~ "= hnsecs;");
return retval;
}
///
@safe unittest
{
import core.time : hours, seconds;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(2015, 12, 31, 23, 59, 59)) + seconds(1) ==
SysTime(DateTime(2016, 1, 1, 0, 0, 0)));
assert(SysTime(DateTime(2015, 12, 31, 23, 59, 59)) + hours(1) ==
SysTime(DateTime(2016, 1, 1, 0, 59, 59)));
assert(SysTime(DateTime(2016, 1, 1, 0, 0, 0)) - seconds(1) ==
SysTime(DateTime(2015, 12, 31, 23, 59, 59)));
assert(SysTime(DateTime(2016, 1, 1, 0, 59, 59)) - hours(1) ==
SysTime(DateTime(2015, 12, 31, 23, 59, 59)));
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_678));
assert(st + dur!"weeks"(7) == SysTime(DateTime(1999, 8, 24, 12, 30, 33), hnsecs(2_345_678)));
assert(st + dur!"weeks"(-7) == SysTime(DateTime(1999, 5, 18, 12, 30, 33), hnsecs(2_345_678)));
assert(st + dur!"days"(7) == SysTime(DateTime(1999, 7, 13, 12, 30, 33), hnsecs(2_345_678)));
assert(st + dur!"days"(-7) == SysTime(DateTime(1999, 6, 29, 12, 30, 33), hnsecs(2_345_678)));
assert(st + dur!"hours"(7) == SysTime(DateTime(1999, 7, 6, 19, 30, 33), hnsecs(2_345_678)));
assert(st + dur!"hours"(-7) == SysTime(DateTime(1999, 7, 6, 5, 30, 33), hnsecs(2_345_678)));
assert(st + dur!"minutes"(7) == SysTime(DateTime(1999, 7, 6, 12, 37, 33), hnsecs(2_345_678)));
assert(st + dur!"minutes"(-7) == SysTime(DateTime(1999, 7, 6, 12, 23, 33), hnsecs(2_345_678)));
assert(st + dur!"seconds"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 40), hnsecs(2_345_678)));
assert(st + dur!"seconds"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 26), hnsecs(2_345_678)));
assert(st + dur!"msecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_415_678)));
assert(st + dur!"msecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_275_678)));
assert(st + dur!"usecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_748)));
assert(st + dur!"usecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_608)));
assert(st + dur!"hnsecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_685)));
assert(st + dur!"hnsecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_671)));
assert(st - dur!"weeks"(-7) == SysTime(DateTime(1999, 8, 24, 12, 30, 33), hnsecs(2_345_678)));
assert(st - dur!"weeks"(7) == SysTime(DateTime(1999, 5, 18, 12, 30, 33), hnsecs(2_345_678)));
assert(st - dur!"days"(-7) == SysTime(DateTime(1999, 7, 13, 12, 30, 33), hnsecs(2_345_678)));
assert(st - dur!"days"(7) == SysTime(DateTime(1999, 6, 29, 12, 30, 33), hnsecs(2_345_678)));
assert(st - dur!"hours"(-7) == SysTime(DateTime(1999, 7, 6, 19, 30, 33), hnsecs(2_345_678)));
assert(st - dur!"hours"(7) == SysTime(DateTime(1999, 7, 6, 5, 30, 33), hnsecs(2_345_678)));
assert(st - dur!"minutes"(-7) == SysTime(DateTime(1999, 7, 6, 12, 37, 33), hnsecs(2_345_678)));
assert(st - dur!"minutes"(7) == SysTime(DateTime(1999, 7, 6, 12, 23, 33), hnsecs(2_345_678)));
assert(st - dur!"seconds"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 40), hnsecs(2_345_678)));
assert(st - dur!"seconds"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 26), hnsecs(2_345_678)));
assert(st - dur!"msecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_415_678)));
assert(st - dur!"msecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_275_678)));
assert(st - dur!"usecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_748)));
assert(st - dur!"usecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_608)));
assert(st - dur!"hnsecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_685)));
assert(st - dur!"hnsecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_671)));
static void testST(in SysTime orig, long hnsecs, in SysTime expected, size_t line = __LINE__)
{
auto result = orig + dur!"hnsecs"(hnsecs);
if (result != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", result, expected), __FILE__, line);
}
// Test A.D.
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(274));
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(274)));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(275)));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(276)));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(284)));
testST(beforeAD, 100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(374)));
testST(beforeAD, 725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(999)));
testST(beforeAD, 726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1000)));
testST(beforeAD, 1000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1274)));
testST(beforeAD, 1001, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1275)));
testST(beforeAD, 2000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2274)));
testST(beforeAD, 26_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(26_999)));
testST(beforeAD, 26_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(27_000)));
testST(beforeAD, 26_727, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(27_001)));
testST(beforeAD, 1_766_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1_766_999)));
testST(beforeAD, 1_766_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1_767_000)));
testST(beforeAD, 1_000_000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1_000_274)));
testST(beforeAD, 60_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 39), hnsecs(274)));
testST(beforeAD, 3_600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 36, 33), hnsecs(274)));
testST(beforeAD, 600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 31, 33), hnsecs(274)));
testST(beforeAD, 36_000_000_000L, SysTime(DateTime(1999, 7, 6, 13, 30, 33), hnsecs(274)));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(273)));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(272)));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(264)));
testST(beforeAD, -100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(174)));
testST(beforeAD, -274, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -275, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_999)));
testST(beforeAD, -1000, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_274)));
testST(beforeAD, -1001, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_273)));
testST(beforeAD, -2000, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_998_274)));
testST(beforeAD, -33_274, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_967_000)));
testST(beforeAD, -33_275, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_966_999)));
testST(beforeAD, -1_833_274, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(8_167_000)));
testST(beforeAD, -1_833_275, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(8_166_999)));
testST(beforeAD, -1_000_000, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_000_274)));
testST(beforeAD, -60_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 27), hnsecs(274)));
testST(beforeAD, -3_600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 24, 33), hnsecs(274)));
testST(beforeAD, -600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 29, 33), hnsecs(274)));
testST(beforeAD, -36_000_000_000L, SysTime(DateTime(1999, 7, 6, 11, 30, 33), hnsecs(274)));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(274));
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(274)));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(275)));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(276)));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(284)));
testST(beforeBC, 100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(374)));
testST(beforeBC, 725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(999)));
testST(beforeBC, 726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1000)));
testST(beforeBC, 1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1274)));
testST(beforeBC, 1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1275)));
testST(beforeBC, 2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(2274)));
testST(beforeBC, 26_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(26_999)));
testST(beforeBC, 26_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(27_000)));
testST(beforeBC, 26_727, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(27_001)));
testST(beforeBC, 1_766_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1_766_999)));
testST(beforeBC, 1_766_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1_767_000)));
testST(beforeBC, 1_000_000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1_000_274)));
testST(beforeBC, 60_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 39), hnsecs(274)));
testST(beforeBC, 3_600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 36, 33), hnsecs(274)));
testST(beforeBC, 600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 31, 33), hnsecs(274)));
testST(beforeBC, 36_000_000_000L, SysTime(DateTime(-1999, 7, 6, 13, 30, 33), hnsecs(274)));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(273)));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(272)));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(264)));
testST(beforeBC, -100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(174)));
testST(beforeBC, -274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -275, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_999_999)));
testST(beforeBC, -1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_999_274)));
testST(beforeBC, -1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_999_273)));
testST(beforeBC, -2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_998_274)));
testST(beforeBC, -33_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_967_000)));
testST(beforeBC, -33_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_966_999)));
testST(beforeBC, -1_833_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(8_167_000)));
testST(beforeBC, -1_833_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(8_166_999)));
testST(beforeBC, -1_000_000, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_000_274)));
testST(beforeBC, -60_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 27), hnsecs(274)));
testST(beforeBC, -3_600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 24, 33), hnsecs(274)));
testST(beforeBC, -600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 29, 33), hnsecs(274)));
testST(beforeBC, -36_000_000_000L, SysTime(DateTime(-1999, 7, 6, 11, 30, 33), hnsecs(274)));
// Test Both
auto beforeBoth1 = SysTime(DateTime(1, 1, 1, 0, 0, 0));
testST(beforeBoth1, 1, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)));
testST(beforeBoth1, 0, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth1, -2, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_998)));
testST(beforeBoth1, -1000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_000)));
testST(beforeBoth1, -2000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_998_000)));
testST(beforeBoth1, -2555, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_997_445)));
testST(beforeBoth1, -1_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_000_000)));
testST(beforeBoth1, -2_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(8_000_000)));
testST(beforeBoth1, -2_333_333, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(7_666_667)));
testST(beforeBoth1, -10_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59)));
testST(beforeBoth1, -20_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 58)));
testST(beforeBoth1, -20_888_888, SysTime(DateTime(0, 12, 31, 23, 59, 57), hnsecs(9_111_112)));
auto beforeBoth2 = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
testST(beforeBoth2, -1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_998)));
testST(beforeBoth2, 0, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 1, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth2, 2, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)));
testST(beforeBoth2, 1000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(999)));
testST(beforeBoth2, 2000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1999)));
testST(beforeBoth2, 2555, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(2554)));
testST(beforeBoth2, 1_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(999_999)));
testST(beforeBoth2, 2_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1_999_999)));
testST(beforeBoth2, 2_333_333, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(2_333_332)));
testST(beforeBoth2, 10_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
testST(beforeBoth2, 20_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 1), hnsecs(9_999_999)));
testST(beforeBoth2, 20_888_888, SysTime(DateTime(1, 1, 1, 0, 0, 2), hnsecs(888_887)));
auto duration = dur!"seconds"(12);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst + duration == SysTime(DateTime(1999, 7, 6, 12, 30, 45)));
//assert(ist + duration == SysTime(DateTime(1999, 7, 6, 12, 30, 45)));
assert(cst - duration == SysTime(DateTime(1999, 7, 6, 12, 30, 21)));
//assert(ist - duration == SysTime(DateTime(1999, 7, 6, 12, 30, 21)));
}
/++
Gives the result of adding or subtracting a $(REF Duration, core,time) from
this $(LREF SysTime), as well as assigning the result to this
$(LREF SysTime).
The legal types of arithmetic for $(LREF SysTime) using this operator are
$(BOOKTABLE,
$(TR $(TD SysTime) $(TD +) $(TD Duration) $(TD -->) $(TD SysTime))
$(TR $(TD SysTime) $(TD -) $(TD Duration) $(TD -->) $(TD SysTime))
)
Params:
duration = The $(REF Duration, core,time) to add to or subtract from
this $(LREF SysTime).
+/
ref SysTime opOpAssign(string op)(Duration duration) @safe pure nothrow
if (op == "+" || op == "-")
{
immutable hnsecs = duration.total!"hnsecs";
mixin("_stdTime " ~ op ~ "= hnsecs;");
return this;
}
@safe unittest
{
import core.time;
auto before = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(before + dur!"weeks"(7) == SysTime(DateTime(1999, 8, 24, 12, 30, 33)));
assert(before + dur!"weeks"(-7) == SysTime(DateTime(1999, 5, 18, 12, 30, 33)));
assert(before + dur!"days"(7) == SysTime(DateTime(1999, 7, 13, 12, 30, 33)));
assert(before + dur!"days"(-7) == SysTime(DateTime(1999, 6, 29, 12, 30, 33)));
assert(before + dur!"hours"(7) == SysTime(DateTime(1999, 7, 6, 19, 30, 33)));
assert(before + dur!"hours"(-7) == SysTime(DateTime(1999, 7, 6, 5, 30, 33)));
assert(before + dur!"minutes"(7) == SysTime(DateTime(1999, 7, 6, 12, 37, 33)));
assert(before + dur!"minutes"(-7) == SysTime(DateTime(1999, 7, 6, 12, 23, 33)));
assert(before + dur!"seconds"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 40)));
assert(before + dur!"seconds"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 26)));
assert(before + dur!"msecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(7)));
assert(before + dur!"msecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 32), msecs(993)));
assert(before + dur!"usecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(7)));
assert(before + dur!"usecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 32), usecs(999_993)));
assert(before + dur!"hnsecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(7)));
assert(before + dur!"hnsecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_993)));
assert(before - dur!"weeks"(-7) == SysTime(DateTime(1999, 8, 24, 12, 30, 33)));
assert(before - dur!"weeks"(7) == SysTime(DateTime(1999, 5, 18, 12, 30, 33)));
assert(before - dur!"days"(-7) == SysTime(DateTime(1999, 7, 13, 12, 30, 33)));
assert(before - dur!"days"(7) == SysTime(DateTime(1999, 6, 29, 12, 30, 33)));
assert(before - dur!"hours"(-7) == SysTime(DateTime(1999, 7, 6, 19, 30, 33)));
assert(before - dur!"hours"(7) == SysTime(DateTime(1999, 7, 6, 5, 30, 33)));
assert(before - dur!"minutes"(-7) == SysTime(DateTime(1999, 7, 6, 12, 37, 33)));
assert(before - dur!"minutes"(7) == SysTime(DateTime(1999, 7, 6, 12, 23, 33)));
assert(before - dur!"seconds"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 40)));
assert(before - dur!"seconds"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 26)));
assert(before - dur!"msecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), msecs(7)));
assert(before - dur!"msecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 32), msecs(993)));
assert(before - dur!"usecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), usecs(7)));
assert(before - dur!"usecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 32), usecs(999_993)));
assert(before - dur!"hnsecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(7)));
assert(before - dur!"hnsecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_993)));
static void testST(SysTime orig, long hnsecs, in SysTime expected, size_t line = __LINE__)
{
auto r = orig += dur!"hnsecs"(hnsecs);
if (orig != expected)
throw new AssertError(format("Failed 1. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
if (r != expected)
throw new AssertError(format("Failed 2. actual [%s] != expected [%s]", r, expected), __FILE__, line);
}
// Test A.D.
auto beforeAD = SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(274));
testST(beforeAD, 0, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(274)));
testST(beforeAD, 1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(275)));
testST(beforeAD, 2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(276)));
testST(beforeAD, 10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(284)));
testST(beforeAD, 100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(374)));
testST(beforeAD, 725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(999)));
testST(beforeAD, 726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1000)));
testST(beforeAD, 1000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1274)));
testST(beforeAD, 1001, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1275)));
testST(beforeAD, 2000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2274)));
testST(beforeAD, 26_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(26_999)));
testST(beforeAD, 26_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(27_000)));
testST(beforeAD, 26_727, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(27_001)));
testST(beforeAD, 1_766_725, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1_766_999)));
testST(beforeAD, 1_766_726, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1_767_000)));
testST(beforeAD, 1_000_000, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(1_000_274)));
testST(beforeAD, 60_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 39), hnsecs(274)));
testST(beforeAD, 3_600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 36, 33), hnsecs(274)));
testST(beforeAD, 600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 31, 33), hnsecs(274)));
testST(beforeAD, 36_000_000_000L, SysTime(DateTime(1999, 7, 6, 13, 30, 33), hnsecs(274)));
testST(beforeAD, -1, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(273)));
testST(beforeAD, -2, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(272)));
testST(beforeAD, -10, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(264)));
testST(beforeAD, -100, SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(174)));
testST(beforeAD, -274, SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
testST(beforeAD, -275, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_999)));
testST(beforeAD, -1000, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_274)));
testST(beforeAD, -1001, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_999_273)));
testST(beforeAD, -2000, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_998_274)));
testST(beforeAD, -33_274, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_967_000)));
testST(beforeAD, -33_275, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_966_999)));
testST(beforeAD, -1_833_274, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(8_167_000)));
testST(beforeAD, -1_833_275, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(8_166_999)));
testST(beforeAD, -1_000_000, SysTime(DateTime(1999, 7, 6, 12, 30, 32), hnsecs(9_000_274)));
testST(beforeAD, -60_000_000L, SysTime(DateTime(1999, 7, 6, 12, 30, 27), hnsecs(274)));
testST(beforeAD, -3_600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 24, 33), hnsecs(274)));
testST(beforeAD, -600_000_000L, SysTime(DateTime(1999, 7, 6, 12, 29, 33), hnsecs(274)));
testST(beforeAD, -36_000_000_000L, SysTime(DateTime(1999, 7, 6, 11, 30, 33), hnsecs(274)));
// Test B.C.
auto beforeBC = SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(274));
testST(beforeBC, 0, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(274)));
testST(beforeBC, 1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(275)));
testST(beforeBC, 2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(276)));
testST(beforeBC, 10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(284)));
testST(beforeBC, 100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(374)));
testST(beforeBC, 725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(999)));
testST(beforeBC, 726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1000)));
testST(beforeBC, 1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1274)));
testST(beforeBC, 1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1275)));
testST(beforeBC, 2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(2274)));
testST(beforeBC, 26_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(26_999)));
testST(beforeBC, 26_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(27_000)));
testST(beforeBC, 26_727, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(27_001)));
testST(beforeBC, 1_766_725, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1_766_999)));
testST(beforeBC, 1_766_726, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1_767_000)));
testST(beforeBC, 1_000_000, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(1_000_274)));
testST(beforeBC, 60_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 39), hnsecs(274)));
testST(beforeBC, 3_600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 36, 33), hnsecs(274)));
testST(beforeBC, 600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 31, 33), hnsecs(274)));
testST(beforeBC, 36_000_000_000L, SysTime(DateTime(-1999, 7, 6, 13, 30, 33), hnsecs(274)));
testST(beforeBC, -1, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(273)));
testST(beforeBC, -2, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(272)));
testST(beforeBC, -10, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(264)));
testST(beforeBC, -100, SysTime(DateTime(-1999, 7, 6, 12, 30, 33), hnsecs(174)));
testST(beforeBC, -274, SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
testST(beforeBC, -275, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_999_999)));
testST(beforeBC, -1000, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_999_274)));
testST(beforeBC, -1001, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_999_273)));
testST(beforeBC, -2000, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_998_274)));
testST(beforeBC, -33_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_967_000)));
testST(beforeBC, -33_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_966_999)));
testST(beforeBC, -1_833_274, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(8_167_000)));
testST(beforeBC, -1_833_275, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(8_166_999)));
testST(beforeBC, -1_000_000, SysTime(DateTime(-1999, 7, 6, 12, 30, 32), hnsecs(9_000_274)));
testST(beforeBC, -60_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 30, 27), hnsecs(274)));
testST(beforeBC, -3_600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 24, 33), hnsecs(274)));
testST(beforeBC, -600_000_000L, SysTime(DateTime(-1999, 7, 6, 12, 29, 33), hnsecs(274)));
testST(beforeBC, -36_000_000_000L, SysTime(DateTime(-1999, 7, 6, 11, 30, 33), hnsecs(274)));
// Test Both
auto beforeBoth1 = SysTime(DateTime(1, 1, 1, 0, 0, 0));
testST(beforeBoth1, 1, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)));
testST(beforeBoth1, 0, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth1, -1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth1, -2, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_998)));
testST(beforeBoth1, -1000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_000)));
testST(beforeBoth1, -2000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_998_000)));
testST(beforeBoth1, -2555, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_997_445)));
testST(beforeBoth1, -1_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_000_000)));
testST(beforeBoth1, -2_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(8_000_000)));
testST(beforeBoth1, -2_333_333, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(7_666_667)));
testST(beforeBoth1, -10_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 59)));
testST(beforeBoth1, -20_000_000, SysTime(DateTime(0, 12, 31, 23, 59, 58)));
testST(beforeBoth1, -20_888_888, SysTime(DateTime(0, 12, 31, 23, 59, 57), hnsecs(9_111_112)));
auto beforeBoth2 = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
testST(beforeBoth2, -1, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_998)));
testST(beforeBoth2, 0, SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(beforeBoth2, 1, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(beforeBoth2, 2, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)));
testST(beforeBoth2, 1000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(999)));
testST(beforeBoth2, 2000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1999)));
testST(beforeBoth2, 2555, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(2554)));
testST(beforeBoth2, 1_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(999_999)));
testST(beforeBoth2, 2_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1_999_999)));
testST(beforeBoth2, 2_333_333, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(2_333_332)));
testST(beforeBoth2, 10_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
testST(beforeBoth2, 20_000_000, SysTime(DateTime(1, 1, 1, 0, 0, 1), hnsecs(9_999_999)));
testST(beforeBoth2, 20_888_888, SysTime(DateTime(1, 1, 1, 0, 0, 2), hnsecs(888_887)));
{
auto st = SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999));
(st += dur!"hnsecs"(52)) += dur!"seconds"(-907);
assert(st == SysTime(DateTime(0, 12, 31, 23, 44, 53), hnsecs(51)));
}
auto duration = dur!"seconds"(12);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst += duration));
//static assert(!__traits(compiles, ist += duration));
static assert(!__traits(compiles, cst -= duration));
//static assert(!__traits(compiles, ist -= duration));
}
/++
Gives the difference between two $(LREF SysTime)s.
The legal types of arithmetic for $(LREF SysTime) using this operator
are
$(BOOKTABLE,
$(TR $(TD SysTime) $(TD -) $(TD SysTime) $(TD -->) $(TD duration))
)
+/
Duration opBinary(string op)(in SysTime rhs) @safe const pure nothrow
if (op == "-")
{
return dur!"hnsecs"(_stdTime - rhs._stdTime);
}
@safe unittest
{
import core.time;
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 33)) - SysTime(DateTime(1998, 7, 6, 12, 30, 33)) ==
dur!"seconds"(31_536_000));
assert(SysTime(DateTime(1998, 7, 6, 12, 30, 33)) - SysTime(DateTime(1999, 7, 6, 12, 30, 33)) ==
dur!"seconds"(-31_536_000));
assert(SysTime(DateTime(1999, 8, 6, 12, 30, 33)) - SysTime(DateTime(1999, 7, 6, 12, 30, 33)) ==
dur!"seconds"(26_78_400));
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 33)) - SysTime(DateTime(1999, 8, 6, 12, 30, 33)) ==
dur!"seconds"(-26_78_400));
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 33)) - SysTime(DateTime(1999, 7, 5, 12, 30, 33)) ==
dur!"seconds"(86_400));
assert(SysTime(DateTime(1999, 7, 5, 12, 30, 33)) - SysTime(DateTime(1999, 7, 6, 12, 30, 33)) ==
dur!"seconds"(-86_400));
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 33)) - SysTime(DateTime(1999, 7, 6, 11, 30, 33)) ==
dur!"seconds"(3600));
assert(SysTime(DateTime(1999, 7, 6, 11, 30, 33)) - SysTime(DateTime(1999, 7, 6, 12, 30, 33)) ==
dur!"seconds"(-3600));
assert(SysTime(DateTime(1999, 7, 6, 12, 31, 33)) - SysTime(DateTime(1999, 7, 6, 12, 30, 33)) ==
dur!"seconds"(60));
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 33)) - SysTime(DateTime(1999, 7, 6, 12, 31, 33)) ==
dur!"seconds"(-60));
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 34)) - SysTime(DateTime(1999, 7, 6, 12, 30, 33)) ==
dur!"seconds"(1));
assert(SysTime(DateTime(1999, 7, 6, 12, 30, 33)) - SysTime(DateTime(1999, 7, 6, 12, 30, 34)) ==
dur!"seconds"(-1));
{
auto dt = DateTime(1999, 7, 6, 12, 30, 33);
assert(SysTime(dt, msecs(532)) - SysTime(dt) == msecs(532));
assert(SysTime(dt) - SysTime(dt, msecs(532)) == msecs(-532));
assert(SysTime(dt, usecs(333_347)) - SysTime(dt) == usecs(333_347));
assert(SysTime(dt) - SysTime(dt, usecs(333_347)) == usecs(-333_347));
assert(SysTime(dt, hnsecs(1_234_567)) - SysTime(dt) == hnsecs(1_234_567));
assert(SysTime(dt) - SysTime(dt, hnsecs(1_234_567)) == hnsecs(-1_234_567));
}
assert(SysTime(DateTime(1, 1, 1, 12, 30, 33)) - SysTime(DateTime(1, 1, 1, 0, 0, 0)) == dur!"seconds"(45033));
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)) - SysTime(DateTime(1, 1, 1, 12, 30, 33)) == dur!"seconds"(-45033));
assert(SysTime(DateTime(0, 12, 31, 12, 30, 33)) - SysTime(DateTime(1, 1, 1, 0, 0, 0)) == dur!"seconds"(-41367));
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)) - SysTime(DateTime(0, 12, 31, 12, 30, 33)) == dur!"seconds"(41367));
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)) - SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)) ==
dur!"hnsecs"(1));
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)) - SysTime(DateTime(1, 1, 1, 0, 0, 0)) ==
dur!"hnsecs"(-1));
version(Posix)
{
import std.datetime.timezone : PosixTimeZone;
immutable tz = PosixTimeZone.getTimeZone("America/Los_Angeles");
}
else version(Windows)
{
import std.datetime.timezone : WindowsTimeZone;
immutable tz = WindowsTimeZone.getTimeZone("Pacific Standard Time");
}
{
auto dt = DateTime(2011, 1, 13, 8, 17, 2);
auto d = msecs(296);
assert(SysTime(dt, d, tz) - SysTime(dt, d, tz) == Duration.zero);
assert(SysTime(dt, d, tz) - SysTime(dt, d, UTC()) == hours(8));
assert(SysTime(dt, d, UTC()) - SysTime(dt, d, tz) == hours(-8));
}
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(st - st == Duration.zero);
assert(cst - st == Duration.zero);
//assert(ist - st == Duration.zero);
assert(st - cst == Duration.zero);
assert(cst - cst == Duration.zero);
//assert(ist - cst == Duration.zero);
//assert(st - ist == Duration.zero);
//assert(cst - ist == Duration.zero);
//assert(ist - ist == Duration.zero);
}
/++
Returns the difference between the two $(LREF SysTime)s in months.
To get the difference in years, subtract the year property
of two $(LREF SysTime)s. To get the difference in days or weeks,
subtract the $(LREF SysTime)s themselves and use the
$(REF Duration, core,time) that results. Because converting between
months and smaller units requires a specific date (which
$(REF Duration, core,time)s don't have), getting the difference in
months requires some math using both the year and month properties, so
this is a convenience function for getting the difference in months.
Note that the number of days in the months or how far into the month
either date is is irrelevant. It is the difference in the month property
combined with the difference in years * 12. So, for instance,
December 31st and January 1st are one month apart just as December 1st
and January 31st are one month apart.
Params:
rhs = The $(LREF SysTime) to subtract from this one.
+/
int diffMonths(in SysTime rhs) @safe const nothrow
{
return (cast(Date) this).diffMonths(cast(Date) rhs);
}
///
@safe unittest
{
import core.time;
import std.datetime.date : Date;
assert(SysTime(Date(1999, 2, 1)).diffMonths(
SysTime(Date(1999, 1, 31))) == 1);
assert(SysTime(Date(1999, 1, 31)).diffMonths(
SysTime(Date(1999, 2, 1))) == -1);
assert(SysTime(Date(1999, 3, 1)).diffMonths(
SysTime(Date(1999, 1, 1))) == 2);
assert(SysTime(Date(1999, 1, 1)).diffMonths(
SysTime(Date(1999, 3, 31))) == -2);
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(st.diffMonths(st) == 0);
assert(cst.diffMonths(st) == 0);
//assert(ist.diffMonths(st) == 0);
assert(st.diffMonths(cst) == 0);
assert(cst.diffMonths(cst) == 0);
//assert(ist.diffMonths(cst) == 0);
//assert(st.diffMonths(ist) == 0);
//assert(cst.diffMonths(ist) == 0);
//assert(ist.diffMonths(ist) == 0);
}
/++
Whether this $(LREF SysTime) is in a leap year.
+/
@property bool isLeapYear() @safe const nothrow
{
return (cast(Date) this).isLeapYear;
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(!st.isLeapYear);
assert(!cst.isLeapYear);
//assert(!ist.isLeapYear);
}
/++
Day of the week this $(LREF SysTime) is on.
+/
@property DayOfWeek dayOfWeek() @safe const nothrow
{
return getDayOfWeek(dayOfGregorianCal);
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(st.dayOfWeek == DayOfWeek.tue);
assert(cst.dayOfWeek == DayOfWeek.tue);
//assert(ist.dayOfWeek == DayOfWeek.tue);
}
/++
Day of the year this $(LREF SysTime) is on.
+/
@property ushort dayOfYear() @safe const nothrow
{
return (cast(Date) this).dayOfYear;
}
///
@safe unittest
{
import core.time;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1999, 1, 1, 12, 22, 7)).dayOfYear == 1);
assert(SysTime(DateTime(1999, 12, 31, 7, 2, 59)).dayOfYear == 365);
assert(SysTime(DateTime(2000, 12, 31, 21, 20, 0)).dayOfYear == 366);
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(st.dayOfYear == 187);
assert(cst.dayOfYear == 187);
//assert(ist.dayOfYear == 187);
}
/++
Day of the year.
Params:
day = The day of the year to set which day of the year this
$(LREF SysTime) is on.
+/
@property void dayOfYear(int day) @safe
{
immutable hnsecs = adjTime;
immutable days = convert!("hnsecs", "days")(hnsecs);
immutable theRest = hnsecs - convert!("days", "hnsecs")(days);
auto date = Date(cast(int) days);
date.dayOfYear = day;
immutable newDaysHNSecs = convert!("days", "hnsecs")(date.dayOfGregorianCal - 1);
adjTime = newDaysHNSecs + theRest;
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
st.dayOfYear = 12;
assert(st.dayOfYear == 12);
static assert(!__traits(compiles, cst.dayOfYear = 12));
//static assert(!__traits(compiles, ist.dayOfYear = 12));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF SysTime) is on.
+/
@property int dayOfGregorianCal() @safe const nothrow
{
immutable adjustedTime = adjTime;
// We have to add one because 0 would be midnight, January 1st, 1 A.D.,
// which would be the 1st day of the Gregorian Calendar, not the 0th. So,
// simply casting to days is one day off.
if (adjustedTime > 0)
return cast(int) getUnitsFromHNSecs!"days"(adjustedTime) + 1;
long hnsecs = adjustedTime;
immutable days = cast(int) splitUnitsFromHNSecs!"days"(hnsecs);
return hnsecs == 0 ? days + 1 : days;
}
///
@safe unittest
{
import core.time;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)).dayOfGregorianCal == 1);
assert(SysTime(DateTime(1, 12, 31, 23, 59, 59)).dayOfGregorianCal == 365);
assert(SysTime(DateTime(2, 1, 1, 2, 2, 2)).dayOfGregorianCal == 366);
assert(SysTime(DateTime(0, 12, 31, 7, 7, 7)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(0, 1, 1, 19, 30, 0)).dayOfGregorianCal == -365);
assert(SysTime(DateTime(-1, 12, 31, 4, 7, 0)).dayOfGregorianCal == -366);
assert(SysTime(DateTime(2000, 1, 1, 9, 30, 20)).dayOfGregorianCal == 730_120);
assert(SysTime(DateTime(2010, 12, 31, 15, 45, 50)).dayOfGregorianCal == 734_137);
}
@safe unittest
{
import core.time;
// Test A.D.
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)).dayOfGregorianCal == 1);
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)).dayOfGregorianCal == 1);
assert(SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)).dayOfGregorianCal == 1);
assert(SysTime(DateTime(1, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 1);
assert(SysTime(DateTime(1, 1, 2, 12, 2, 9), msecs(212)).dayOfGregorianCal == 2);
assert(SysTime(DateTime(1, 2, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 32);
assert(SysTime(DateTime(2, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 366);
assert(SysTime(DateTime(3, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 731);
assert(SysTime(DateTime(4, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 1096);
assert(SysTime(DateTime(5, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 1462);
assert(SysTime(DateTime(50, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 17_898);
assert(SysTime(DateTime(97, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 35_065);
assert(SysTime(DateTime(100, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 36_160);
assert(SysTime(DateTime(101, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 36_525);
assert(SysTime(DateTime(105, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 37_986);
assert(SysTime(DateTime(200, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 72_684);
assert(SysTime(DateTime(201, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 73_049);
assert(SysTime(DateTime(300, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 109_208);
assert(SysTime(DateTime(301, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 109_573);
assert(SysTime(DateTime(400, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 145_732);
assert(SysTime(DateTime(401, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 146_098);
assert(SysTime(DateTime(500, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 182_257);
assert(SysTime(DateTime(501, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 182_622);
assert(SysTime(DateTime(1000, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 364_878);
assert(SysTime(DateTime(1001, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 365_243);
assert(SysTime(DateTime(1600, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 584_023);
assert(SysTime(DateTime(1601, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 584_389);
assert(SysTime(DateTime(1900, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 693_596);
assert(SysTime(DateTime(1901, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 693_961);
assert(SysTime(DateTime(1945, 11, 12, 12, 2, 9), msecs(212)).dayOfGregorianCal == 710_347);
assert(SysTime(DateTime(1999, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 729_755);
assert(SysTime(DateTime(2000, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 730_120);
assert(SysTime(DateTime(2001, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == 730_486);
assert(SysTime(DateTime(2010, 1, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_773);
assert(SysTime(DateTime(2010, 1, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_803);
assert(SysTime(DateTime(2010, 2, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_804);
assert(SysTime(DateTime(2010, 2, 28, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_831);
assert(SysTime(DateTime(2010, 3, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_832);
assert(SysTime(DateTime(2010, 3, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_862);
assert(SysTime(DateTime(2010, 4, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_863);
assert(SysTime(DateTime(2010, 4, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_892);
assert(SysTime(DateTime(2010, 5, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_893);
assert(SysTime(DateTime(2010, 5, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_923);
assert(SysTime(DateTime(2010, 6, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_924);
assert(SysTime(DateTime(2010, 6, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_953);
assert(SysTime(DateTime(2010, 7, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_954);
assert(SysTime(DateTime(2010, 7, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_984);
assert(SysTime(DateTime(2010, 8, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 733_985);
assert(SysTime(DateTime(2010, 8, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_015);
assert(SysTime(DateTime(2010, 9, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_016);
assert(SysTime(DateTime(2010, 9, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_045);
assert(SysTime(DateTime(2010, 10, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_046);
assert(SysTime(DateTime(2010, 10, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_076);
assert(SysTime(DateTime(2010, 11, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_077);
assert(SysTime(DateTime(2010, 11, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_106);
assert(SysTime(DateTime(2010, 12, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_107);
assert(SysTime(DateTime(2010, 12, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == 734_137);
assert(SysTime(DateTime(2012, 2, 1, 0, 0, 0)).dayOfGregorianCal == 734_534);
assert(SysTime(DateTime(2012, 2, 28, 0, 0, 0)).dayOfGregorianCal == 734_561);
assert(SysTime(DateTime(2012, 2, 29, 0, 0, 0)).dayOfGregorianCal == 734_562);
assert(SysTime(DateTime(2012, 3, 1, 0, 0, 0)).dayOfGregorianCal == 734_563);
// Test B.C.
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_998)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(0, 12, 31, 0, 0, 0), hnsecs(1)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(0, 12, 31, 0, 0, 0)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(-1, 12, 31, 23, 59, 59), hnsecs(9_999_999)).dayOfGregorianCal == -366);
assert(SysTime(DateTime(-1, 12, 31, 23, 59, 59), hnsecs(9_999_998)).dayOfGregorianCal == -366);
assert(SysTime(DateTime(-1, 12, 31, 23, 59, 59)).dayOfGregorianCal == -366);
assert(SysTime(DateTime(-1, 12, 31, 0, 0, 0)).dayOfGregorianCal == -366);
assert(SysTime(DateTime(0, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == 0);
assert(SysTime(DateTime(0, 12, 30, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1);
assert(SysTime(DateTime(0, 12, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -30);
assert(SysTime(DateTime(0, 11, 30, 12, 2, 9), msecs(212)).dayOfGregorianCal == -31);
assert(SysTime(DateTime(-1, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -366);
assert(SysTime(DateTime(-1, 12, 30, 12, 2, 9), msecs(212)).dayOfGregorianCal == -367);
assert(SysTime(DateTime(-1, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -730);
assert(SysTime(DateTime(-2, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -731);
assert(SysTime(DateTime(-2, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1095);
assert(SysTime(DateTime(-3, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1096);
assert(SysTime(DateTime(-3, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1460);
assert(SysTime(DateTime(-4, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1461);
assert(SysTime(DateTime(-4, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1826);
assert(SysTime(DateTime(-5, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -1827);
assert(SysTime(DateTime(-5, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -2191);
assert(SysTime(DateTime(-9, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -3652);
assert(SysTime(DateTime(-49, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -18_262);
assert(SysTime(DateTime(-50, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -18_627);
assert(SysTime(DateTime(-97, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -35_794);
assert(SysTime(DateTime(-99, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -36_160);
assert(SysTime(DateTime(-99, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -36_524);
assert(SysTime(DateTime(-100, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -36_889);
assert(SysTime(DateTime(-101, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -37_254);
assert(SysTime(DateTime(-105, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -38_715);
assert(SysTime(DateTime(-200, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -73_413);
assert(SysTime(DateTime(-201, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -73_778);
assert(SysTime(DateTime(-300, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -109_937);
assert(SysTime(DateTime(-301, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -110_302);
assert(SysTime(DateTime(-400, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -146_097);
assert(SysTime(DateTime(-400, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -146_462);
assert(SysTime(DateTime(-401, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -146_827);
assert(SysTime(DateTime(-499, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -182_621);
assert(SysTime(DateTime(-500, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -182_986);
assert(SysTime(DateTime(-501, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -183_351);
assert(SysTime(DateTime(-1000, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -365_607);
assert(SysTime(DateTime(-1001, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -365_972);
assert(SysTime(DateTime(-1599, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -584_387);
assert(SysTime(DateTime(-1600, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -584_388);
assert(SysTime(DateTime(-1600, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -584_753);
assert(SysTime(DateTime(-1601, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -585_118);
assert(SysTime(DateTime(-1900, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -694_325);
assert(SysTime(DateTime(-1901, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -694_690);
assert(SysTime(DateTime(-1999, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -730_484);
assert(SysTime(DateTime(-2000, 12, 31, 12, 2, 9), msecs(212)).dayOfGregorianCal == -730_485);
assert(SysTime(DateTime(-2000, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -730_850);
assert(SysTime(DateTime(-2001, 1, 1, 12, 2, 9), msecs(212)).dayOfGregorianCal == -731_215);
assert(SysTime(DateTime(-2010, 1, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_502);
assert(SysTime(DateTime(-2010, 1, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_472);
assert(SysTime(DateTime(-2010, 2, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_471);
assert(SysTime(DateTime(-2010, 2, 28, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_444);
assert(SysTime(DateTime(-2010, 3, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_443);
assert(SysTime(DateTime(-2010, 3, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_413);
assert(SysTime(DateTime(-2010, 4, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_412);
assert(SysTime(DateTime(-2010, 4, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_383);
assert(SysTime(DateTime(-2010, 5, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_382);
assert(SysTime(DateTime(-2010, 5, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_352);
assert(SysTime(DateTime(-2010, 6, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_351);
assert(SysTime(DateTime(-2010, 6, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_322);
assert(SysTime(DateTime(-2010, 7, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_321);
assert(SysTime(DateTime(-2010, 7, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_291);
assert(SysTime(DateTime(-2010, 8, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_290);
assert(SysTime(DateTime(-2010, 8, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_260);
assert(SysTime(DateTime(-2010, 9, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_259);
assert(SysTime(DateTime(-2010, 9, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_230);
assert(SysTime(DateTime(-2010, 10, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_229);
assert(SysTime(DateTime(-2010, 10, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_199);
assert(SysTime(DateTime(-2010, 11, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_198);
assert(SysTime(DateTime(-2010, 11, 30, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_169);
assert(SysTime(DateTime(-2010, 12, 1, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_168);
assert(SysTime(DateTime(-2010, 12, 31, 23, 59, 59), msecs(999)).dayOfGregorianCal == -734_138);
assert(SysTime(DateTime(-2012, 2, 1, 0, 0, 0)).dayOfGregorianCal == -735_202);
assert(SysTime(DateTime(-2012, 2, 28, 0, 0, 0)).dayOfGregorianCal == -735_175);
assert(SysTime(DateTime(-2012, 2, 29, 0, 0, 0)).dayOfGregorianCal == -735_174);
assert(SysTime(DateTime(-2012, 3, 1, 0, 0, 0)).dayOfGregorianCal == -735_173);
// Start of Hebrew Calendar
assert(SysTime(DateTime(-3760, 9, 7, 0, 0, 0)).dayOfGregorianCal == -1_373_427);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.dayOfGregorianCal == 729_941);
//assert(ist.dayOfGregorianCal == 729_941);
}
// Test that the logic for the day of the Gregorian Calendar is consistent
// between Date and SysTime.
@safe unittest
{
import core.time;
void test(Date date, SysTime st, size_t line = __LINE__)
{
if (date.dayOfGregorianCal != st.dayOfGregorianCal)
{
throw new AssertError(format("Date [%s] SysTime [%s]", date.dayOfGregorianCal, st.dayOfGregorianCal),
__FILE__, line);
}
}
// Test A.D.
test(Date(1, 1, 1), SysTime(DateTime(1, 1, 1, 0, 0, 0)));
test(Date(1, 1, 2), SysTime(DateTime(1, 1, 2, 0, 0, 0), hnsecs(500)));
test(Date(1, 2, 1), SysTime(DateTime(1, 2, 1, 0, 0, 0), hnsecs(50_000)));
test(Date(2, 1, 1), SysTime(DateTime(2, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(3, 1, 1), SysTime(DateTime(3, 1, 1, 12, 13, 14)));
test(Date(4, 1, 1), SysTime(DateTime(4, 1, 1, 12, 13, 14), hnsecs(500)));
test(Date(5, 1, 1), SysTime(DateTime(5, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(50, 1, 1), SysTime(DateTime(50, 1, 1, 12, 13, 14), hnsecs(9_999_999)));
test(Date(97, 1, 1), SysTime(DateTime(97, 1, 1, 23, 59, 59)));
test(Date(100, 1, 1), SysTime(DateTime(100, 1, 1, 23, 59, 59), hnsecs(500)));
test(Date(101, 1, 1), SysTime(DateTime(101, 1, 1, 23, 59, 59), hnsecs(50_000)));
test(Date(105, 1, 1), SysTime(DateTime(105, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(200, 1, 1), SysTime(DateTime(200, 1, 1, 0, 0, 0)));
test(Date(201, 1, 1), SysTime(DateTime(201, 1, 1, 0, 0, 0), hnsecs(500)));
test(Date(300, 1, 1), SysTime(DateTime(300, 1, 1, 0, 0, 0), hnsecs(50_000)));
test(Date(301, 1, 1), SysTime(DateTime(301, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(400, 1, 1), SysTime(DateTime(400, 1, 1, 12, 13, 14)));
test(Date(401, 1, 1), SysTime(DateTime(401, 1, 1, 12, 13, 14), hnsecs(500)));
test(Date(500, 1, 1), SysTime(DateTime(500, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(501, 1, 1), SysTime(DateTime(501, 1, 1, 12, 13, 14), hnsecs(9_999_999)));
test(Date(1000, 1, 1), SysTime(DateTime(1000, 1, 1, 23, 59, 59)));
test(Date(1001, 1, 1), SysTime(DateTime(1001, 1, 1, 23, 59, 59), hnsecs(500)));
test(Date(1600, 1, 1), SysTime(DateTime(1600, 1, 1, 23, 59, 59), hnsecs(50_000)));
test(Date(1601, 1, 1), SysTime(DateTime(1601, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(1900, 1, 1), SysTime(DateTime(1900, 1, 1, 0, 0, 0)));
test(Date(1901, 1, 1), SysTime(DateTime(1901, 1, 1, 0, 0, 0), hnsecs(500)));
test(Date(1945, 11, 12), SysTime(DateTime(1945, 11, 12, 0, 0, 0), hnsecs(50_000)));
test(Date(1999, 1, 1), SysTime(DateTime(1999, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(1999, 7, 6), SysTime(DateTime(1999, 7, 6, 12, 13, 14)));
test(Date(2000, 1, 1), SysTime(DateTime(2000, 1, 1, 12, 13, 14), hnsecs(500)));
test(Date(2001, 1, 1), SysTime(DateTime(2001, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(2010, 1, 1), SysTime(DateTime(2010, 1, 1, 12, 13, 14), hnsecs(9_999_999)));
test(Date(2010, 1, 31), SysTime(DateTime(2010, 1, 31, 23, 0, 0)));
test(Date(2010, 2, 1), SysTime(DateTime(2010, 2, 1, 23, 59, 59), hnsecs(500)));
test(Date(2010, 2, 28), SysTime(DateTime(2010, 2, 28, 23, 59, 59), hnsecs(50_000)));
test(Date(2010, 3, 1), SysTime(DateTime(2010, 3, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(2010, 3, 31), SysTime(DateTime(2010, 3, 31, 0, 0, 0)));
test(Date(2010, 4, 1), SysTime(DateTime(2010, 4, 1, 0, 0, 0), hnsecs(500)));
test(Date(2010, 4, 30), SysTime(DateTime(2010, 4, 30, 0, 0, 0), hnsecs(50_000)));
test(Date(2010, 5, 1), SysTime(DateTime(2010, 5, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(2010, 5, 31), SysTime(DateTime(2010, 5, 31, 12, 13, 14)));
test(Date(2010, 6, 1), SysTime(DateTime(2010, 6, 1, 12, 13, 14), hnsecs(500)));
test(Date(2010, 6, 30), SysTime(DateTime(2010, 6, 30, 12, 13, 14), hnsecs(50_000)));
test(Date(2010, 7, 1), SysTime(DateTime(2010, 7, 1, 12, 13, 14), hnsecs(9_999_999)));
test(Date(2010, 7, 31), SysTime(DateTime(2010, 7, 31, 23, 59, 59)));
test(Date(2010, 8, 1), SysTime(DateTime(2010, 8, 1, 23, 59, 59), hnsecs(500)));
test(Date(2010, 8, 31), SysTime(DateTime(2010, 8, 31, 23, 59, 59), hnsecs(50_000)));
test(Date(2010, 9, 1), SysTime(DateTime(2010, 9, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(2010, 9, 30), SysTime(DateTime(2010, 9, 30, 12, 0, 0)));
test(Date(2010, 10, 1), SysTime(DateTime(2010, 10, 1, 0, 12, 0), hnsecs(500)));
test(Date(2010, 10, 31), SysTime(DateTime(2010, 10, 31, 0, 0, 12), hnsecs(50_000)));
test(Date(2010, 11, 1), SysTime(DateTime(2010, 11, 1, 23, 0, 0), hnsecs(9_999_999)));
test(Date(2010, 11, 30), SysTime(DateTime(2010, 11, 30, 0, 59, 0)));
test(Date(2010, 12, 1), SysTime(DateTime(2010, 12, 1, 0, 0, 59), hnsecs(500)));
test(Date(2010, 12, 31), SysTime(DateTime(2010, 12, 31, 0, 59, 59), hnsecs(50_000)));
test(Date(2012, 2, 1), SysTime(DateTime(2012, 2, 1, 23, 0, 59), hnsecs(9_999_999)));
test(Date(2012, 2, 28), SysTime(DateTime(2012, 2, 28, 23, 59, 0)));
test(Date(2012, 2, 29), SysTime(DateTime(2012, 2, 29, 7, 7, 7), hnsecs(7)));
test(Date(2012, 3, 1), SysTime(DateTime(2012, 3, 1, 7, 7, 7), hnsecs(7)));
// Test B.C.
test(Date(0, 12, 31), SysTime(DateTime(0, 12, 31, 0, 0, 0)));
test(Date(0, 12, 30), SysTime(DateTime(0, 12, 30, 0, 0, 0), hnsecs(500)));
test(Date(0, 12, 1), SysTime(DateTime(0, 12, 1, 0, 0, 0), hnsecs(50_000)));
test(Date(0, 11, 30), SysTime(DateTime(0, 11, 30, 0, 0, 0), hnsecs(9_999_999)));
test(Date(-1, 12, 31), SysTime(DateTime(-1, 12, 31, 12, 13, 14)));
test(Date(-1, 12, 30), SysTime(DateTime(-1, 12, 30, 12, 13, 14), hnsecs(500)));
test(Date(-1, 1, 1), SysTime(DateTime(-1, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(-2, 12, 31), SysTime(DateTime(-2, 12, 31, 12, 13, 14), hnsecs(9_999_999)));
test(Date(-2, 1, 1), SysTime(DateTime(-2, 1, 1, 23, 59, 59)));
test(Date(-3, 12, 31), SysTime(DateTime(-3, 12, 31, 23, 59, 59), hnsecs(500)));
test(Date(-3, 1, 1), SysTime(DateTime(-3, 1, 1, 23, 59, 59), hnsecs(50_000)));
test(Date(-4, 12, 31), SysTime(DateTime(-4, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
test(Date(-4, 1, 1), SysTime(DateTime(-4, 1, 1, 0, 0, 0)));
test(Date(-5, 12, 31), SysTime(DateTime(-5, 12, 31, 0, 0, 0), hnsecs(500)));
test(Date(-5, 1, 1), SysTime(DateTime(-5, 1, 1, 0, 0, 0), hnsecs(50_000)));
test(Date(-9, 1, 1), SysTime(DateTime(-9, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(-49, 1, 1), SysTime(DateTime(-49, 1, 1, 12, 13, 14)));
test(Date(-50, 1, 1), SysTime(DateTime(-50, 1, 1, 12, 13, 14), hnsecs(500)));
test(Date(-97, 1, 1), SysTime(DateTime(-97, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(-99, 12, 31), SysTime(DateTime(-99, 12, 31, 12, 13, 14), hnsecs(9_999_999)));
test(Date(-99, 1, 1), SysTime(DateTime(-99, 1, 1, 23, 59, 59)));
test(Date(-100, 1, 1), SysTime(DateTime(-100, 1, 1, 23, 59, 59), hnsecs(500)));
test(Date(-101, 1, 1), SysTime(DateTime(-101, 1, 1, 23, 59, 59), hnsecs(50_000)));
test(Date(-105, 1, 1), SysTime(DateTime(-105, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(-200, 1, 1), SysTime(DateTime(-200, 1, 1, 0, 0, 0)));
test(Date(-201, 1, 1), SysTime(DateTime(-201, 1, 1, 0, 0, 0), hnsecs(500)));
test(Date(-300, 1, 1), SysTime(DateTime(-300, 1, 1, 0, 0, 0), hnsecs(50_000)));
test(Date(-301, 1, 1), SysTime(DateTime(-301, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(-400, 12, 31), SysTime(DateTime(-400, 12, 31, 12, 13, 14)));
test(Date(-400, 1, 1), SysTime(DateTime(-400, 1, 1, 12, 13, 14), hnsecs(500)));
test(Date(-401, 1, 1), SysTime(DateTime(-401, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(-499, 1, 1), SysTime(DateTime(-499, 1, 1, 12, 13, 14), hnsecs(9_999_999)));
test(Date(-500, 1, 1), SysTime(DateTime(-500, 1, 1, 23, 59, 59)));
test(Date(-501, 1, 1), SysTime(DateTime(-501, 1, 1, 23, 59, 59), hnsecs(500)));
test(Date(-1000, 1, 1), SysTime(DateTime(-1000, 1, 1, 23, 59, 59), hnsecs(50_000)));
test(Date(-1001, 1, 1), SysTime(DateTime(-1001, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(-1599, 1, 1), SysTime(DateTime(-1599, 1, 1, 0, 0, 0)));
test(Date(-1600, 12, 31), SysTime(DateTime(-1600, 12, 31, 0, 0, 0), hnsecs(500)));
test(Date(-1600, 1, 1), SysTime(DateTime(-1600, 1, 1, 0, 0, 0), hnsecs(50_000)));
test(Date(-1601, 1, 1), SysTime(DateTime(-1601, 1, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(-1900, 1, 1), SysTime(DateTime(-1900, 1, 1, 12, 13, 14)));
test(Date(-1901, 1, 1), SysTime(DateTime(-1901, 1, 1, 12, 13, 14), hnsecs(500)));
test(Date(-1999, 1, 1), SysTime(DateTime(-1999, 1, 1, 12, 13, 14), hnsecs(50_000)));
test(Date(-1999, 7, 6), SysTime(DateTime(-1999, 7, 6, 12, 13, 14), hnsecs(9_999_999)));
test(Date(-2000, 12, 31), SysTime(DateTime(-2000, 12, 31, 23, 59, 59)));
test(Date(-2000, 1, 1), SysTime(DateTime(-2000, 1, 1, 23, 59, 59), hnsecs(500)));
test(Date(-2001, 1, 1), SysTime(DateTime(-2001, 1, 1, 23, 59, 59), hnsecs(50_000)));
test(Date(-2010, 1, 1), SysTime(DateTime(-2010, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(-2010, 1, 31), SysTime(DateTime(-2010, 1, 31, 0, 0, 0)));
test(Date(-2010, 2, 1), SysTime(DateTime(-2010, 2, 1, 0, 0, 0), hnsecs(500)));
test(Date(-2010, 2, 28), SysTime(DateTime(-2010, 2, 28, 0, 0, 0), hnsecs(50_000)));
test(Date(-2010, 3, 1), SysTime(DateTime(-2010, 3, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(-2010, 3, 31), SysTime(DateTime(-2010, 3, 31, 12, 13, 14)));
test(Date(-2010, 4, 1), SysTime(DateTime(-2010, 4, 1, 12, 13, 14), hnsecs(500)));
test(Date(-2010, 4, 30), SysTime(DateTime(-2010, 4, 30, 12, 13, 14), hnsecs(50_000)));
test(Date(-2010, 5, 1), SysTime(DateTime(-2010, 5, 1, 12, 13, 14), hnsecs(9_999_999)));
test(Date(-2010, 5, 31), SysTime(DateTime(-2010, 5, 31, 23, 59, 59)));
test(Date(-2010, 6, 1), SysTime(DateTime(-2010, 6, 1, 23, 59, 59), hnsecs(500)));
test(Date(-2010, 6, 30), SysTime(DateTime(-2010, 6, 30, 23, 59, 59), hnsecs(50_000)));
test(Date(-2010, 7, 1), SysTime(DateTime(-2010, 7, 1, 23, 59, 59), hnsecs(9_999_999)));
test(Date(-2010, 7, 31), SysTime(DateTime(-2010, 7, 31, 0, 0, 0)));
test(Date(-2010, 8, 1), SysTime(DateTime(-2010, 8, 1, 0, 0, 0), hnsecs(500)));
test(Date(-2010, 8, 31), SysTime(DateTime(-2010, 8, 31, 0, 0, 0), hnsecs(50_000)));
test(Date(-2010, 9, 1), SysTime(DateTime(-2010, 9, 1, 0, 0, 0), hnsecs(9_999_999)));
test(Date(-2010, 9, 30), SysTime(DateTime(-2010, 9, 30, 12, 0, 0)));
test(Date(-2010, 10, 1), SysTime(DateTime(-2010, 10, 1, 0, 12, 0), hnsecs(500)));
test(Date(-2010, 10, 31), SysTime(DateTime(-2010, 10, 31, 0, 0, 12), hnsecs(50_000)));
test(Date(-2010, 11, 1), SysTime(DateTime(-2010, 11, 1, 23, 0, 0), hnsecs(9_999_999)));
test(Date(-2010, 11, 30), SysTime(DateTime(-2010, 11, 30, 0, 59, 0)));
test(Date(-2010, 12, 1), SysTime(DateTime(-2010, 12, 1, 0, 0, 59), hnsecs(500)));
test(Date(-2010, 12, 31), SysTime(DateTime(-2010, 12, 31, 0, 59, 59), hnsecs(50_000)));
test(Date(-2012, 2, 1), SysTime(DateTime(-2012, 2, 1, 23, 0, 59), hnsecs(9_999_999)));
test(Date(-2012, 2, 28), SysTime(DateTime(-2012, 2, 28, 23, 59, 0)));
test(Date(-2012, 2, 29), SysTime(DateTime(-2012, 2, 29, 7, 7, 7), hnsecs(7)));
test(Date(-2012, 3, 1), SysTime(DateTime(-2012, 3, 1, 7, 7, 7), hnsecs(7)));
test(Date(-3760, 9, 7), SysTime(DateTime(-3760, 9, 7, 0, 0, 0)));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF SysTime) is on.
Setting this property does not affect the time portion of $(LREF SysTime).
Params:
days = The day of the Gregorian Calendar to set this $(LREF SysTime)
to.
+/
@property void dayOfGregorianCal(int days) @safe nothrow
{
auto hnsecs = adjTime;
hnsecs = removeUnitsFromHNSecs!"days"(hnsecs);
if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
if (--days < 0)
{
hnsecs -= convert!("hours", "hnsecs")(24);
++days;
}
immutable newDaysHNSecs = convert!("days", "hnsecs")(days);
adjTime = newDaysHNSecs + hnsecs;
}
///
@safe unittest
{
import core.time;
import std.datetime.date : DateTime;
auto st = SysTime(DateTime(0, 1, 1, 12, 0, 0));
st.dayOfGregorianCal = 1;
assert(st == SysTime(DateTime(1, 1, 1, 12, 0, 0)));
st.dayOfGregorianCal = 365;
assert(st == SysTime(DateTime(1, 12, 31, 12, 0, 0)));
st.dayOfGregorianCal = 366;
assert(st == SysTime(DateTime(2, 1, 1, 12, 0, 0)));
st.dayOfGregorianCal = 0;
assert(st == SysTime(DateTime(0, 12, 31, 12, 0, 0)));
st.dayOfGregorianCal = -365;
assert(st == SysTime(DateTime(-0, 1, 1, 12, 0, 0)));
st.dayOfGregorianCal = -366;
assert(st == SysTime(DateTime(-1, 12, 31, 12, 0, 0)));
st.dayOfGregorianCal = 730_120;
assert(st == SysTime(DateTime(2000, 1, 1, 12, 0, 0)));
st.dayOfGregorianCal = 734_137;
assert(st == SysTime(DateTime(2010, 12, 31, 12, 0, 0)));
}
@safe unittest
{
import core.time;
void testST(SysTime orig, int day, in SysTime expected, size_t line = __LINE__)
{
orig.dayOfGregorianCal = day;
if (orig != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", orig, expected), __FILE__, line);
}
// Test A.D.
testST(SysTime(DateTime(1, 1, 1, 0, 0, 0)), 1, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)), 1, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)));
testST(SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)), 1,
SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
// Test B.C.
testST(SysTime(DateTime(0, 1, 1, 0, 0, 0)), 0, SysTime(DateTime(0, 12, 31, 0, 0, 0)));
testST(SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(9_999_999)), 0,
SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(SysTime(DateTime(0, 1, 1, 23, 59, 59), hnsecs(1)), 0,
SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(1)));
testST(SysTime(DateTime(0, 1, 1, 23, 59, 59)), 0, SysTime(DateTime(0, 12, 31, 23, 59, 59)));
// Test Both.
testST(SysTime(DateTime(-512, 7, 20, 0, 0, 0)), 1, SysTime(DateTime(1, 1, 1, 0, 0, 0)));
testST(SysTime(DateTime(-513, 6, 6, 0, 0, 0), hnsecs(1)), 1, SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1)));
testST(SysTime(DateTime(-511, 5, 7, 23, 59, 59), hnsecs(9_999_999)), 1,
SysTime(DateTime(1, 1, 1, 23, 59, 59), hnsecs(9_999_999)));
testST(SysTime(DateTime(1607, 4, 8, 0, 0, 0)), 0, SysTime(DateTime(0, 12, 31, 0, 0, 0)));
testST(SysTime(DateTime(1500, 3, 9, 23, 59, 59), hnsecs(9_999_999)), 0,
SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
testST(SysTime(DateTime(999, 2, 10, 23, 59, 59), hnsecs(1)), 0,
SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(1)));
testST(SysTime(DateTime(2007, 12, 11, 23, 59, 59)), 0, SysTime(DateTime(0, 12, 31, 23, 59, 59)));
auto st = SysTime(DateTime(1, 1, 1, 12, 2, 9), msecs(212));
void testST2(int day, in SysTime expected, size_t line = __LINE__)
{
st.dayOfGregorianCal = day;
if (st != expected)
throw new AssertError(format("Failed. actual [%s] != expected [%s]", st, expected), __FILE__, line);
}
// Test A.D.
testST2(1, SysTime(DateTime(1, 1, 1, 12, 2, 9), msecs(212)));
testST2(2, SysTime(DateTime(1, 1, 2, 12, 2, 9), msecs(212)));
testST2(32, SysTime(DateTime(1, 2, 1, 12, 2, 9), msecs(212)));
testST2(366, SysTime(DateTime(2, 1, 1, 12, 2, 9), msecs(212)));
testST2(731, SysTime(DateTime(3, 1, 1, 12, 2, 9), msecs(212)));
testST2(1096, SysTime(DateTime(4, 1, 1, 12, 2, 9), msecs(212)));
testST2(1462, SysTime(DateTime(5, 1, 1, 12, 2, 9), msecs(212)));
testST2(17_898, SysTime(DateTime(50, 1, 1, 12, 2, 9), msecs(212)));
testST2(35_065, SysTime(DateTime(97, 1, 1, 12, 2, 9), msecs(212)));
testST2(36_160, SysTime(DateTime(100, 1, 1, 12, 2, 9), msecs(212)));
testST2(36_525, SysTime(DateTime(101, 1, 1, 12, 2, 9), msecs(212)));
testST2(37_986, SysTime(DateTime(105, 1, 1, 12, 2, 9), msecs(212)));
testST2(72_684, SysTime(DateTime(200, 1, 1, 12, 2, 9), msecs(212)));
testST2(73_049, SysTime(DateTime(201, 1, 1, 12, 2, 9), msecs(212)));
testST2(109_208, SysTime(DateTime(300, 1, 1, 12, 2, 9), msecs(212)));
testST2(109_573, SysTime(DateTime(301, 1, 1, 12, 2, 9), msecs(212)));
testST2(145_732, SysTime(DateTime(400, 1, 1, 12, 2, 9), msecs(212)));
testST2(146_098, SysTime(DateTime(401, 1, 1, 12, 2, 9), msecs(212)));
testST2(182_257, SysTime(DateTime(500, 1, 1, 12, 2, 9), msecs(212)));
testST2(182_622, SysTime(DateTime(501, 1, 1, 12, 2, 9), msecs(212)));
testST2(364_878, SysTime(DateTime(1000, 1, 1, 12, 2, 9), msecs(212)));
testST2(365_243, SysTime(DateTime(1001, 1, 1, 12, 2, 9), msecs(212)));
testST2(584_023, SysTime(DateTime(1600, 1, 1, 12, 2, 9), msecs(212)));
testST2(584_389, SysTime(DateTime(1601, 1, 1, 12, 2, 9), msecs(212)));
testST2(693_596, SysTime(DateTime(1900, 1, 1, 12, 2, 9), msecs(212)));
testST2(693_961, SysTime(DateTime(1901, 1, 1, 12, 2, 9), msecs(212)));
testST2(729_755, SysTime(DateTime(1999, 1, 1, 12, 2, 9), msecs(212)));
testST2(730_120, SysTime(DateTime(2000, 1, 1, 12, 2, 9), msecs(212)));
testST2(730_486, SysTime(DateTime(2001, 1, 1, 12, 2, 9), msecs(212)));
testST2(733_773, SysTime(DateTime(2010, 1, 1, 12, 2, 9), msecs(212)));
testST2(733_803, SysTime(DateTime(2010, 1, 31, 12, 2, 9), msecs(212)));
testST2(733_804, SysTime(DateTime(2010, 2, 1, 12, 2, 9), msecs(212)));
testST2(733_831, SysTime(DateTime(2010, 2, 28, 12, 2, 9), msecs(212)));
testST2(733_832, SysTime(DateTime(2010, 3, 1, 12, 2, 9), msecs(212)));
testST2(733_862, SysTime(DateTime(2010, 3, 31, 12, 2, 9), msecs(212)));
testST2(733_863, SysTime(DateTime(2010, 4, 1, 12, 2, 9), msecs(212)));
testST2(733_892, SysTime(DateTime(2010, 4, 30, 12, 2, 9), msecs(212)));
testST2(733_893, SysTime(DateTime(2010, 5, 1, 12, 2, 9), msecs(212)));
testST2(733_923, SysTime(DateTime(2010, 5, 31, 12, 2, 9), msecs(212)));
testST2(733_924, SysTime(DateTime(2010, 6, 1, 12, 2, 9), msecs(212)));
testST2(733_953, SysTime(DateTime(2010, 6, 30, 12, 2, 9), msecs(212)));
testST2(733_954, SysTime(DateTime(2010, 7, 1, 12, 2, 9), msecs(212)));
testST2(733_984, SysTime(DateTime(2010, 7, 31, 12, 2, 9), msecs(212)));
testST2(733_985, SysTime(DateTime(2010, 8, 1, 12, 2, 9), msecs(212)));
testST2(734_015, SysTime(DateTime(2010, 8, 31, 12, 2, 9), msecs(212)));
testST2(734_016, SysTime(DateTime(2010, 9, 1, 12, 2, 9), msecs(212)));
testST2(734_045, SysTime(DateTime(2010, 9, 30, 12, 2, 9), msecs(212)));
testST2(734_046, SysTime(DateTime(2010, 10, 1, 12, 2, 9), msecs(212)));
testST2(734_076, SysTime(DateTime(2010, 10, 31, 12, 2, 9), msecs(212)));
testST2(734_077, SysTime(DateTime(2010, 11, 1, 12, 2, 9), msecs(212)));
testST2(734_106, SysTime(DateTime(2010, 11, 30, 12, 2, 9), msecs(212)));
testST2(734_107, SysTime(DateTime(2010, 12, 1, 12, 2, 9), msecs(212)));
testST2(734_137, SysTime(DateTime(2010, 12, 31, 12, 2, 9), msecs(212)));
testST2(734_534, SysTime(DateTime(2012, 2, 1, 12, 2, 9), msecs(212)));
testST2(734_561, SysTime(DateTime(2012, 2, 28, 12, 2, 9), msecs(212)));
testST2(734_562, SysTime(DateTime(2012, 2, 29, 12, 2, 9), msecs(212)));
testST2(734_563, SysTime(DateTime(2012, 3, 1, 12, 2, 9), msecs(212)));
testST2(734_534, SysTime(DateTime(2012, 2, 1, 12, 2, 9), msecs(212)));
testST2(734_561, SysTime(DateTime(2012, 2, 28, 12, 2, 9), msecs(212)));
testST2(734_562, SysTime(DateTime(2012, 2, 29, 12, 2, 9), msecs(212)));
testST2(734_563, SysTime(DateTime(2012, 3, 1, 12, 2, 9), msecs(212)));
// Test B.C.
testST2(0, SysTime(DateTime(0, 12, 31, 12, 2, 9), msecs(212)));
testST2(-1, SysTime(DateTime(0, 12, 30, 12, 2, 9), msecs(212)));
testST2(-30, SysTime(DateTime(0, 12, 1, 12, 2, 9), msecs(212)));
testST2(-31, SysTime(DateTime(0, 11, 30, 12, 2, 9), msecs(212)));
testST2(-366, SysTime(DateTime(-1, 12, 31, 12, 2, 9), msecs(212)));
testST2(-367, SysTime(DateTime(-1, 12, 30, 12, 2, 9), msecs(212)));
testST2(-730, SysTime(DateTime(-1, 1, 1, 12, 2, 9), msecs(212)));
testST2(-731, SysTime(DateTime(-2, 12, 31, 12, 2, 9), msecs(212)));
testST2(-1095, SysTime(DateTime(-2, 1, 1, 12, 2, 9), msecs(212)));
testST2(-1096, SysTime(DateTime(-3, 12, 31, 12, 2, 9), msecs(212)));
testST2(-1460, SysTime(DateTime(-3, 1, 1, 12, 2, 9), msecs(212)));
testST2(-1461, SysTime(DateTime(-4, 12, 31, 12, 2, 9), msecs(212)));
testST2(-1826, SysTime(DateTime(-4, 1, 1, 12, 2, 9), msecs(212)));
testST2(-1827, SysTime(DateTime(-5, 12, 31, 12, 2, 9), msecs(212)));
testST2(-2191, SysTime(DateTime(-5, 1, 1, 12, 2, 9), msecs(212)));
testST2(-3652, SysTime(DateTime(-9, 1, 1, 12, 2, 9), msecs(212)));
testST2(-18_262, SysTime(DateTime(-49, 1, 1, 12, 2, 9), msecs(212)));
testST2(-18_627, SysTime(DateTime(-50, 1, 1, 12, 2, 9), msecs(212)));
testST2(-35_794, SysTime(DateTime(-97, 1, 1, 12, 2, 9), msecs(212)));
testST2(-36_160, SysTime(DateTime(-99, 12, 31, 12, 2, 9), msecs(212)));
testST2(-36_524, SysTime(DateTime(-99, 1, 1, 12, 2, 9), msecs(212)));
testST2(-36_889, SysTime(DateTime(-100, 1, 1, 12, 2, 9), msecs(212)));
testST2(-37_254, SysTime(DateTime(-101, 1, 1, 12, 2, 9), msecs(212)));
testST2(-38_715, SysTime(DateTime(-105, 1, 1, 12, 2, 9), msecs(212)));
testST2(-73_413, SysTime(DateTime(-200, 1, 1, 12, 2, 9), msecs(212)));
testST2(-73_778, SysTime(DateTime(-201, 1, 1, 12, 2, 9), msecs(212)));
testST2(-109_937, SysTime(DateTime(-300, 1, 1, 12, 2, 9), msecs(212)));
testST2(-110_302, SysTime(DateTime(-301, 1, 1, 12, 2, 9), msecs(212)));
testST2(-146_097, SysTime(DateTime(-400, 12, 31, 12, 2, 9), msecs(212)));
testST2(-146_462, SysTime(DateTime(-400, 1, 1, 12, 2, 9), msecs(212)));
testST2(-146_827, SysTime(DateTime(-401, 1, 1, 12, 2, 9), msecs(212)));
testST2(-182_621, SysTime(DateTime(-499, 1, 1, 12, 2, 9), msecs(212)));
testST2(-182_986, SysTime(DateTime(-500, 1, 1, 12, 2, 9), msecs(212)));
testST2(-183_351, SysTime(DateTime(-501, 1, 1, 12, 2, 9), msecs(212)));
testST2(-365_607, SysTime(DateTime(-1000, 1, 1, 12, 2, 9), msecs(212)));
testST2(-365_972, SysTime(DateTime(-1001, 1, 1, 12, 2, 9), msecs(212)));
testST2(-584_387, SysTime(DateTime(-1599, 1, 1, 12, 2, 9), msecs(212)));
testST2(-584_388, SysTime(DateTime(-1600, 12, 31, 12, 2, 9), msecs(212)));
testST2(-584_753, SysTime(DateTime(-1600, 1, 1, 12, 2, 9), msecs(212)));
testST2(-585_118, SysTime(DateTime(-1601, 1, 1, 12, 2, 9), msecs(212)));
testST2(-694_325, SysTime(DateTime(-1900, 1, 1, 12, 2, 9), msecs(212)));
testST2(-694_690, SysTime(DateTime(-1901, 1, 1, 12, 2, 9), msecs(212)));
testST2(-730_484, SysTime(DateTime(-1999, 1, 1, 12, 2, 9), msecs(212)));
testST2(-730_485, SysTime(DateTime(-2000, 12, 31, 12, 2, 9), msecs(212)));
testST2(-730_850, SysTime(DateTime(-2000, 1, 1, 12, 2, 9), msecs(212)));
testST2(-731_215, SysTime(DateTime(-2001, 1, 1, 12, 2, 9), msecs(212)));
testST2(-734_502, SysTime(DateTime(-2010, 1, 1, 12, 2, 9), msecs(212)));
testST2(-734_472, SysTime(DateTime(-2010, 1, 31, 12, 2, 9), msecs(212)));
testST2(-734_471, SysTime(DateTime(-2010, 2, 1, 12, 2, 9), msecs(212)));
testST2(-734_444, SysTime(DateTime(-2010, 2, 28, 12, 2, 9), msecs(212)));
testST2(-734_443, SysTime(DateTime(-2010, 3, 1, 12, 2, 9), msecs(212)));
testST2(-734_413, SysTime(DateTime(-2010, 3, 31, 12, 2, 9), msecs(212)));
testST2(-734_412, SysTime(DateTime(-2010, 4, 1, 12, 2, 9), msecs(212)));
testST2(-734_383, SysTime(DateTime(-2010, 4, 30, 12, 2, 9), msecs(212)));
testST2(-734_382, SysTime(DateTime(-2010, 5, 1, 12, 2, 9), msecs(212)));
testST2(-734_352, SysTime(DateTime(-2010, 5, 31, 12, 2, 9), msecs(212)));
testST2(-734_351, SysTime(DateTime(-2010, 6, 1, 12, 2, 9), msecs(212)));
testST2(-734_322, SysTime(DateTime(-2010, 6, 30, 12, 2, 9), msecs(212)));
testST2(-734_321, SysTime(DateTime(-2010, 7, 1, 12, 2, 9), msecs(212)));
testST2(-734_291, SysTime(DateTime(-2010, 7, 31, 12, 2, 9), msecs(212)));
testST2(-734_290, SysTime(DateTime(-2010, 8, 1, 12, 2, 9), msecs(212)));
testST2(-734_260, SysTime(DateTime(-2010, 8, 31, 12, 2, 9), msecs(212)));
testST2(-734_259, SysTime(DateTime(-2010, 9, 1, 12, 2, 9), msecs(212)));
testST2(-734_230, SysTime(DateTime(-2010, 9, 30, 12, 2, 9), msecs(212)));
testST2(-734_229, SysTime(DateTime(-2010, 10, 1, 12, 2, 9), msecs(212)));
testST2(-734_199, SysTime(DateTime(-2010, 10, 31, 12, 2, 9), msecs(212)));
testST2(-734_198, SysTime(DateTime(-2010, 11, 1, 12, 2, 9), msecs(212)));
testST2(-734_169, SysTime(DateTime(-2010, 11, 30, 12, 2, 9), msecs(212)));
testST2(-734_168, SysTime(DateTime(-2010, 12, 1, 12, 2, 9), msecs(212)));
testST2(-734_138, SysTime(DateTime(-2010, 12, 31, 12, 2, 9), msecs(212)));
testST2(-735_202, SysTime(DateTime(-2012, 2, 1, 12, 2, 9), msecs(212)));
testST2(-735_175, SysTime(DateTime(-2012, 2, 28, 12, 2, 9), msecs(212)));
testST2(-735_174, SysTime(DateTime(-2012, 2, 29, 12, 2, 9), msecs(212)));
testST2(-735_173, SysTime(DateTime(-2012, 3, 1, 12, 2, 9), msecs(212)));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
static assert(!__traits(compiles, cst.dayOfGregorianCal = 7));
//static assert(!__traits(compiles, ist.dayOfGregorianCal = 7));
}
/++
The ISO 8601 week of the year that this $(LREF SysTime) is in.
See_Also:
$(HTTP en.wikipedia.org/wiki/ISO_week_date, ISO Week Date).
+/
@property ubyte isoWeek() @safe const nothrow
{
return (cast(Date) this).isoWeek;
}
///
@safe unittest
{
import core.time;
import std.datetime.date : Date;
auto st = SysTime(Date(1999, 7, 6));
const cst = SysTime(Date(2010, 5, 1));
immutable ist = SysTime(Date(2015, 10, 10));
assert(st.isoWeek == 27);
assert(cst.isoWeek == 17);
assert(ist.isoWeek == 41);
}
/++
$(LREF SysTime) for the last day in the month that this Date is in.
The time portion of endOfMonth is always 23:59:59.9999999.
+/
@property SysTime endOfMonth() @safe const nothrow
{
immutable hnsecs = adjTime;
immutable days = getUnitsFromHNSecs!"days"(hnsecs);
auto date = Date(cast(int) days + 1).endOfMonth;
auto newDays = date.dayOfGregorianCal - 1;
long theTimeHNSecs;
if (newDays < 0)
{
theTimeHNSecs = -1;
++newDays;
}
else
theTimeHNSecs = convert!("days", "hnsecs")(1) - 1;
immutable newDaysHNSecs = convert!("days", "hnsecs")(newDays);
auto retval = SysTime(this._stdTime, this._timezone);
retval.adjTime = newDaysHNSecs + theTimeHNSecs;
return retval;
}
///
@safe unittest
{
import core.time : msecs, usecs, hnsecs;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1999, 1, 6, 0, 0, 0)).endOfMonth ==
SysTime(DateTime(1999, 1, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(DateTime(1999, 2, 7, 19, 30, 0), msecs(24)).endOfMonth ==
SysTime(DateTime(1999, 2, 28, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(DateTime(2000, 2, 7, 5, 12, 27), usecs(5203)).endOfMonth ==
SysTime(DateTime(2000, 2, 29, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(DateTime(2000, 6, 4, 12, 22, 9), hnsecs(12345)).endOfMonth ==
SysTime(DateTime(2000, 6, 30, 23, 59, 59), hnsecs(9_999_999)));
}
@safe unittest
{
import core.time;
// Test A.D.
assert(SysTime(Date(1999, 1, 1)).endOfMonth == SysTime(DateTime(1999, 1, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 2, 1)).endOfMonth == SysTime(DateTime(1999, 2, 28, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(2000, 2, 1)).endOfMonth == SysTime(DateTime(2000, 2, 29, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 3, 1)).endOfMonth == SysTime(DateTime(1999, 3, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 4, 1)).endOfMonth == SysTime(DateTime(1999, 4, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 5, 1)).endOfMonth == SysTime(DateTime(1999, 5, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 6, 1)).endOfMonth == SysTime(DateTime(1999, 6, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 7, 1)).endOfMonth == SysTime(DateTime(1999, 7, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 8, 1)).endOfMonth == SysTime(DateTime(1999, 8, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 9, 1)).endOfMonth == SysTime(DateTime(1999, 9, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 10, 1)).endOfMonth == SysTime(DateTime(1999, 10, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 11, 1)).endOfMonth == SysTime(DateTime(1999, 11, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(1999, 12, 1)).endOfMonth == SysTime(DateTime(1999, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
// Test B.C.
assert(SysTime(Date(-1999, 1, 1)).endOfMonth == SysTime(DateTime(-1999, 1, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 2, 1)).endOfMonth == SysTime(DateTime(-1999, 2, 28, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-2000, 2, 1)).endOfMonth == SysTime(DateTime(-2000, 2, 29, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 3, 1)).endOfMonth == SysTime(DateTime(-1999, 3, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 4, 1)).endOfMonth == SysTime(DateTime(-1999, 4, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 5, 1)).endOfMonth == SysTime(DateTime(-1999, 5, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 6, 1)).endOfMonth == SysTime(DateTime(-1999, 6, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 7, 1)).endOfMonth == SysTime(DateTime(-1999, 7, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 8, 1)).endOfMonth == SysTime(DateTime(-1999, 8, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 9, 1)).endOfMonth == SysTime(DateTime(-1999, 9, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 10, 1)).endOfMonth ==
SysTime(DateTime(-1999, 10, 31, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 11, 1)).endOfMonth ==
SysTime(DateTime(-1999, 11, 30, 23, 59, 59), hnsecs(9_999_999)));
assert(SysTime(Date(-1999, 12, 1)).endOfMonth ==
SysTime(DateTime(-1999, 12, 31, 23, 59, 59), hnsecs(9_999_999)));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.endOfMonth == SysTime(DateTime(1999, 7, 31, 23, 59, 59), hnsecs(9_999_999)));
//assert(ist.endOfMonth == SysTime(DateTime(1999, 7, 31, 23, 59, 59), hnsecs(9_999_999)));
}
/++
The last day in the month that this $(LREF SysTime) is in.
+/
@property ubyte daysInMonth() @safe const nothrow
{
return Date(dayOfGregorianCal).daysInMonth;
}
///
@safe unittest
{
import core.time;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1999, 1, 6, 0, 0, 0)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 2, 7, 19, 30, 0)).daysInMonth == 28);
assert(SysTime(DateTime(2000, 2, 7, 5, 12, 27)).daysInMonth == 29);
assert(SysTime(DateTime(2000, 6, 4, 12, 22, 9)).daysInMonth == 30);
}
@safe unittest
{
import core.time;
// Test A.D.
assert(SysTime(DateTime(1999, 1, 1, 12, 1, 13)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 2, 1, 17, 13, 12)).daysInMonth == 28);
assert(SysTime(DateTime(2000, 2, 1, 13, 2, 12)).daysInMonth == 29);
assert(SysTime(DateTime(1999, 3, 1, 12, 13, 12)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 4, 1, 12, 6, 13)).daysInMonth == 30);
assert(SysTime(DateTime(1999, 5, 1, 15, 13, 12)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 6, 1, 13, 7, 12)).daysInMonth == 30);
assert(SysTime(DateTime(1999, 7, 1, 12, 13, 17)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 8, 1, 12, 3, 13)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 9, 1, 12, 13, 12)).daysInMonth == 30);
assert(SysTime(DateTime(1999, 10, 1, 13, 19, 12)).daysInMonth == 31);
assert(SysTime(DateTime(1999, 11, 1, 12, 13, 17)).daysInMonth == 30);
assert(SysTime(DateTime(1999, 12, 1, 12, 52, 13)).daysInMonth == 31);
// Test B.C.
assert(SysTime(DateTime(-1999, 1, 1, 12, 1, 13)).daysInMonth == 31);
assert(SysTime(DateTime(-1999, 2, 1, 7, 13, 12)).daysInMonth == 28);
assert(SysTime(DateTime(-2000, 2, 1, 13, 2, 12)).daysInMonth == 29);
assert(SysTime(DateTime(-1999, 3, 1, 12, 13, 12)).daysInMonth == 31);
assert(SysTime(DateTime(-1999, 4, 1, 12, 6, 13)).daysInMonth == 30);
assert(SysTime(DateTime(-1999, 5, 1, 5, 13, 12)).daysInMonth == 31);
assert(SysTime(DateTime(-1999, 6, 1, 13, 7, 12)).daysInMonth == 30);
assert(SysTime(DateTime(-1999, 7, 1, 12, 13, 17)).daysInMonth == 31);
assert(SysTime(DateTime(-1999, 8, 1, 12, 3, 13)).daysInMonth == 31);
assert(SysTime(DateTime(-1999, 9, 1, 12, 13, 12)).daysInMonth == 30);
assert(SysTime(DateTime(-1999, 10, 1, 13, 19, 12)).daysInMonth == 31);
assert(SysTime(DateTime(-1999, 11, 1, 12, 13, 17)).daysInMonth == 30);
assert(SysTime(DateTime(-1999, 12, 1, 12, 52, 13)).daysInMonth == 31);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.daysInMonth == 31);
//assert(ist.daysInMonth == 31);
}
/++
Whether the current year is a date in A.D.
+/
@property bool isAD() @safe const nothrow
{
return adjTime >= 0;
}
///
@safe unittest
{
import core.time;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(1, 1, 1, 12, 7, 0)).isAD);
assert(SysTime(DateTime(2010, 12, 31, 0, 0, 0)).isAD);
assert(!SysTime(DateTime(0, 12, 31, 23, 59, 59)).isAD);
assert(!SysTime(DateTime(-2010, 1, 1, 2, 2, 2)).isAD);
}
@safe unittest
{
import core.time;
assert(SysTime(DateTime(2010, 7, 4, 12, 0, 9)).isAD);
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)).isAD);
assert(!SysTime(DateTime(0, 12, 31, 23, 59, 59)).isAD);
assert(!SysTime(DateTime(0, 1, 1, 23, 59, 59)).isAD);
assert(!SysTime(DateTime(-1, 1, 1, 23 ,59 ,59)).isAD);
assert(!SysTime(DateTime(-2010, 7, 4, 12, 2, 2)).isAD);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.isAD);
//assert(ist.isAD);
}
/++
The $(HTTP en.wikipedia.org/wiki/Julian_day, Julian day)
for this $(LREF SysTime) at the given time. For example,
prior to noon, 1996-03-31 would be the Julian day number 2_450_173, so
this function returns 2_450_173, while from noon onward, the Julian
day number would be 2_450_174, so this function returns 2_450_174.
+/
@property long julianDay() @safe const nothrow
{
immutable jd = dayOfGregorianCal + 1_721_425;
return hour < 12 ? jd - 1 : jd;
}
@safe unittest
{
import core.time;
assert(SysTime(DateTime(-4713, 11, 24, 0, 0, 0)).julianDay == -1);
assert(SysTime(DateTime(-4713, 11, 24, 12, 0, 0)).julianDay == 0);
assert(SysTime(DateTime(0, 12, 31, 0, 0, 0)).julianDay == 1_721_424);
assert(SysTime(DateTime(0, 12, 31, 12, 0, 0)).julianDay == 1_721_425);
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0)).julianDay == 1_721_425);
assert(SysTime(DateTime(1, 1, 1, 12, 0, 0)).julianDay == 1_721_426);
assert(SysTime(DateTime(1582, 10, 15, 0, 0, 0)).julianDay == 2_299_160);
assert(SysTime(DateTime(1582, 10, 15, 12, 0, 0)).julianDay == 2_299_161);
assert(SysTime(DateTime(1858, 11, 17, 0, 0, 0)).julianDay == 2_400_000);
assert(SysTime(DateTime(1858, 11, 17, 12, 0, 0)).julianDay == 2_400_001);
assert(SysTime(DateTime(1982, 1, 4, 0, 0, 0)).julianDay == 2_444_973);
assert(SysTime(DateTime(1982, 1, 4, 12, 0, 0)).julianDay == 2_444_974);
assert(SysTime(DateTime(1996, 3, 31, 0, 0, 0)).julianDay == 2_450_173);
assert(SysTime(DateTime(1996, 3, 31, 12, 0, 0)).julianDay == 2_450_174);
assert(SysTime(DateTime(2010, 8, 24, 0, 0, 0)).julianDay == 2_455_432);
assert(SysTime(DateTime(2010, 8, 24, 12, 0, 0)).julianDay == 2_455_433);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.julianDay == 2_451_366);
//assert(ist.julianDay == 2_451_366);
}
/++
The modified $(HTTP en.wikipedia.org/wiki/Julian_day, Julian day) for
any time on this date (since, the modified Julian day changes at
midnight).
+/
@property long modJulianDay() @safe const nothrow
{
return dayOfGregorianCal + 1_721_425 - 2_400_001;
}
@safe unittest
{
import core.time;
assert(SysTime(DateTime(1858, 11, 17, 0, 0, 0)).modJulianDay == 0);
assert(SysTime(DateTime(1858, 11, 17, 12, 0, 0)).modJulianDay == 0);
assert(SysTime(DateTime(2010, 8, 24, 0, 0, 0)).modJulianDay == 55_432);
assert(SysTime(DateTime(2010, 8, 24, 12, 0, 0)).modJulianDay == 55_432);
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cst.modJulianDay == 51_365);
//assert(ist.modJulianDay == 51_365);
}
/++
Returns a $(REF Date,std,datetime,date) equivalent to this $(LREF SysTime).
+/
Date opCast(T)() @safe const nothrow
if (is(Unqual!T == Date))
{
return Date(dayOfGregorianCal);
}
@safe unittest
{
import core.time;
assert(cast(Date) SysTime(Date(1999, 7, 6)) == Date(1999, 7, 6));
assert(cast(Date) SysTime(Date(2000, 12, 31)) == Date(2000, 12, 31));
assert(cast(Date) SysTime(Date(2001, 1, 1)) == Date(2001, 1, 1));
assert(cast(Date) SysTime(DateTime(1999, 7, 6, 12, 10, 9)) == Date(1999, 7, 6));
assert(cast(Date) SysTime(DateTime(2000, 12, 31, 13, 11, 10)) == Date(2000, 12, 31));
assert(cast(Date) SysTime(DateTime(2001, 1, 1, 14, 12, 11)) == Date(2001, 1, 1));
assert(cast(Date) SysTime(Date(-1999, 7, 6)) == Date(-1999, 7, 6));
assert(cast(Date) SysTime(Date(-2000, 12, 31)) == Date(-2000, 12, 31));
assert(cast(Date) SysTime(Date(-2001, 1, 1)) == Date(-2001, 1, 1));
assert(cast(Date) SysTime(DateTime(-1999, 7, 6, 12, 10, 9)) == Date(-1999, 7, 6));
assert(cast(Date) SysTime(DateTime(-2000, 12, 31, 13, 11, 10)) == Date(-2000, 12, 31));
assert(cast(Date) SysTime(DateTime(-2001, 1, 1, 14, 12, 11)) == Date(-2001, 1, 1));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cast(Date) cst != Date.init);
//assert(cast(Date) ist != Date.init);
}
/++
Returns a $(REF DateTime,std,datetime,date) equivalent to this
$(LREF SysTime).
+/
DateTime opCast(T)() @safe const nothrow
if (is(Unqual!T == DateTime))
{
try
{
auto hnsecs = adjTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable second = getUnitsFromHNSecs!"seconds"(hnsecs);
return DateTime(Date(cast(int) days), TimeOfDay(cast(int) hour, cast(int) minute, cast(int) second));
}
catch (Exception e)
assert(0, "Either DateTime's constructor or TimeOfDay's constructor threw.");
}
@safe unittest
{
import core.time;
assert(cast(DateTime) SysTime(DateTime(1, 1, 6, 7, 12, 22)) == DateTime(1, 1, 6, 7, 12, 22));
assert(cast(DateTime) SysTime(DateTime(1, 1, 6, 7, 12, 22), msecs(22)) == DateTime(1, 1, 6, 7, 12, 22));
assert(cast(DateTime) SysTime(Date(1999, 7, 6)) == DateTime(1999, 7, 6, 0, 0, 0));
assert(cast(DateTime) SysTime(Date(2000, 12, 31)) == DateTime(2000, 12, 31, 0, 0, 0));
assert(cast(DateTime) SysTime(Date(2001, 1, 1)) == DateTime(2001, 1, 1, 0, 0, 0));
assert(cast(DateTime) SysTime(DateTime(1999, 7, 6, 12, 10, 9)) == DateTime(1999, 7, 6, 12, 10, 9));
assert(cast(DateTime) SysTime(DateTime(2000, 12, 31, 13, 11, 10)) == DateTime(2000, 12, 31, 13, 11, 10));
assert(cast(DateTime) SysTime(DateTime(2001, 1, 1, 14, 12, 11)) == DateTime(2001, 1, 1, 14, 12, 11));
assert(cast(DateTime) SysTime(DateTime(-1, 1, 6, 7, 12, 22)) == DateTime(-1, 1, 6, 7, 12, 22));
assert(cast(DateTime) SysTime(DateTime(-1, 1, 6, 7, 12, 22), msecs(22)) == DateTime(-1, 1, 6, 7, 12, 22));
assert(cast(DateTime) SysTime(Date(-1999, 7, 6)) == DateTime(-1999, 7, 6, 0, 0, 0));
assert(cast(DateTime) SysTime(Date(-2000, 12, 31)) == DateTime(-2000, 12, 31, 0, 0, 0));
assert(cast(DateTime) SysTime(Date(-2001, 1, 1)) == DateTime(-2001, 1, 1, 0, 0, 0));
assert(cast(DateTime) SysTime(DateTime(-1999, 7, 6, 12, 10, 9)) == DateTime(-1999, 7, 6, 12, 10, 9));
assert(cast(DateTime) SysTime(DateTime(-2000, 12, 31, 13, 11, 10)) == DateTime(-2000, 12, 31, 13, 11, 10));
assert(cast(DateTime) SysTime(DateTime(-2001, 1, 1, 14, 12, 11)) == DateTime(-2001, 1, 1, 14, 12, 11));
assert(cast(DateTime) SysTime(DateTime(2011, 1, 13, 8, 17, 2), msecs(296), LocalTime()) ==
DateTime(2011, 1, 13, 8, 17, 2));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cast(DateTime) cst != DateTime.init);
//assert(cast(DateTime) ist != DateTime.init);
}
/++
Returns a $(REF TimeOfDay,std,datetime,date) equivalent to this
$(LREF SysTime).
+/
TimeOfDay opCast(T)() @safe const nothrow
if (is(Unqual!T == TimeOfDay))
{
try
{
auto hnsecs = adjTime;
hnsecs = removeUnitsFromHNSecs!"days"(hnsecs);
if (hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable second = getUnitsFromHNSecs!"seconds"(hnsecs);
return TimeOfDay(cast(int) hour, cast(int) minute, cast(int) second);
}
catch (Exception e)
assert(0, "TimeOfDay's constructor threw.");
}
@safe unittest
{
import core.time;
assert(cast(TimeOfDay) SysTime(Date(1999, 7, 6)) == TimeOfDay(0, 0, 0));
assert(cast(TimeOfDay) SysTime(Date(2000, 12, 31)) == TimeOfDay(0, 0, 0));
assert(cast(TimeOfDay) SysTime(Date(2001, 1, 1)) == TimeOfDay(0, 0, 0));
assert(cast(TimeOfDay) SysTime(DateTime(1999, 7, 6, 12, 10, 9)) == TimeOfDay(12, 10, 9));
assert(cast(TimeOfDay) SysTime(DateTime(2000, 12, 31, 13, 11, 10)) == TimeOfDay(13, 11, 10));
assert(cast(TimeOfDay) SysTime(DateTime(2001, 1, 1, 14, 12, 11)) == TimeOfDay(14, 12, 11));
assert(cast(TimeOfDay) SysTime(Date(-1999, 7, 6)) == TimeOfDay(0, 0, 0));
assert(cast(TimeOfDay) SysTime(Date(-2000, 12, 31)) == TimeOfDay(0, 0, 0));
assert(cast(TimeOfDay) SysTime(Date(-2001, 1, 1)) == TimeOfDay(0, 0, 0));
assert(cast(TimeOfDay) SysTime(DateTime(-1999, 7, 6, 12, 10, 9)) == TimeOfDay(12, 10, 9));
assert(cast(TimeOfDay) SysTime(DateTime(-2000, 12, 31, 13, 11, 10)) == TimeOfDay(13, 11, 10));
assert(cast(TimeOfDay) SysTime(DateTime(-2001, 1, 1, 14, 12, 11)) == TimeOfDay(14, 12, 11));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cast(TimeOfDay) cst != TimeOfDay.init);
//assert(cast(TimeOfDay) ist != TimeOfDay.init);
}
// Temporary hack until bug http://d.puremagic.com/issues/show_bug.cgi?id=4867 is fixed.
// This allows assignment from const(SysTime) to SysTime.
// It may be a good idea to keep it though, since casting from a type to itself
// should be allowed, and it doesn't work without this opCast() since opCast()
// has already been defined for other types.
SysTime opCast(T)() @safe const pure nothrow
if (is(Unqual!T == SysTime))
{
return SysTime(_stdTime, _timezone);
}
/++
Converts this $(LREF SysTime) to a string with the format
YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds and TZ is time
zone).
Note that the number of digits in the fractional seconds varies with the
number of fractional seconds. It's a maximum of 7 (which would be
hnsecs), but only has as many as are necessary to hold the correct value
(so no trailing zeroes), and if there are no fractional seconds, then
there is no decimal point.
If this $(LREF SysTime)'s time zone is
$(REF LocalTime,std,datetime,timezone), then TZ is empty. If its time
zone is $(D UTC), then it is "Z". Otherwise, it is the offset from UTC
(e.g. +0100 or -0700). Note that the offset from UTC is $(I not) enough
to uniquely identify the time zone.
Time zone offsets will be in the form +HHMM or -HHMM.
$(RED Warning:
Previously, toISOString did the same as $(LREF toISOExtString) and
generated +HH:MM or -HH:MM for the time zone when it was not
$(REF LocalTime,std,datetime,timezone) or
$(REF UTC,std,datetime,timezone), which is not in conformance with
ISO 8601 for the non-extended string format. This has now been
fixed. However, for now, fromISOString will continue to accept the
extended format for the time zone so that any code which has been
writing out the result of toISOString to read in later will continue
to work. The current behavior will be kept until July 2019 at which
point, fromISOString will be fixed to be standards compliant.)
Params:
writer = A `char` accepting
$(REF_ALTTEXT output range, isOutputRange, std, range, primitives)
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toISOString() @safe const nothrow
{
import std.array : appender;
auto app = appender!string();
app.reserve(30);
try
toISOString(app);
catch (Exception e)
assert(0, "toISOString() threw.");
return app.data;
}
/// ditto
void toISOString(W)(ref W writer) const
if (isOutputRange!(W, char))
{
immutable adjustedTime = adjTime;
long hnsecs = adjustedTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable second = splitUnitsFromHNSecs!"seconds"(hnsecs);
auto dateTime = DateTime(Date(cast(int) days), TimeOfDay(cast(int) hour,
cast(int) minute, cast(int) second));
if (_timezone is LocalTime())
{
dateTime.toISOString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
return;
}
if (_timezone is UTC())
{
dateTime.toISOString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
put(writer, 'Z');
return;
}
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
dateTime.toISOString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
SimpleTimeZone.toISOExtString(writer, utcOffset);
}
///
@safe unittest
{
import core.time : msecs, hnsecs;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(2010, 7, 4, 7, 6, 12)).toISOString() ==
"20100704T070612");
assert(SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(24)).toISOString() ==
"19981225T021500.024");
assert(SysTime(DateTime(0, 1, 5, 23, 9, 59)).toISOString() ==
"00000105T230959");
assert(SysTime(DateTime(-4, 1, 5, 0, 0, 2), hnsecs(520_920)).toISOString() ==
"-00040105T000002.052092");
}
@safe unittest
{
import core.time;
// Test A.D.
assert(SysTime(DateTime.init, UTC()).toISOString() == "00010101T000000Z");
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1), UTC()).toISOString() == "00010101T000000.0000001Z");
assert(SysTime(DateTime(9, 12, 4, 0, 0, 0)).toISOString() == "00091204T000000");
assert(SysTime(DateTime(99, 12, 4, 5, 6, 12)).toISOString() == "00991204T050612");
assert(SysTime(DateTime(999, 12, 4, 13, 44, 59)).toISOString() == "09991204T134459");
assert(SysTime(DateTime(9999, 7, 4, 23, 59, 59)).toISOString() == "99990704T235959");
assert(SysTime(DateTime(10000, 10, 20, 1, 1, 1)).toISOString() == "+100001020T010101");
assert(SysTime(DateTime(9, 12, 4, 0, 0, 0), msecs(42)).toISOString() == "00091204T000000.042");
assert(SysTime(DateTime(99, 12, 4, 5, 6, 12), msecs(100)).toISOString() == "00991204T050612.1");
assert(SysTime(DateTime(999, 12, 4, 13, 44, 59), usecs(45020)).toISOString() == "09991204T134459.04502");
assert(SysTime(DateTime(9999, 7, 4, 23, 59, 59), hnsecs(12)).toISOString() == "99990704T235959.0000012");
assert(SysTime(DateTime(10000, 10, 20, 1, 1, 1), hnsecs(507890)).toISOString() == "+100001020T010101.050789");
assert(SysTime(DateTime(2012, 12, 21, 12, 12, 12),
new immutable SimpleTimeZone(dur!"minutes"(-360))).toISOString() ==
"20121221T121212-06:00");
assert(SysTime(DateTime(2012, 12, 21, 12, 12, 12),
new immutable SimpleTimeZone(dur!"minutes"(420))).toISOString() ==
"20121221T121212+07:00");
// Test B.C.
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toISOString() ==
"00001231T235959.9999999Z");
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(1), UTC()).toISOString() == "00001231T235959.0000001Z");
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), UTC()).toISOString() == "00001231T235959Z");
assert(SysTime(DateTime(0, 12, 4, 0, 12, 4)).toISOString() == "00001204T001204");
assert(SysTime(DateTime(-9, 12, 4, 0, 0, 0)).toISOString() == "-00091204T000000");
assert(SysTime(DateTime(-99, 12, 4, 5, 6, 12)).toISOString() == "-00991204T050612");
assert(SysTime(DateTime(-999, 12, 4, 13, 44, 59)).toISOString() == "-09991204T134459");
assert(SysTime(DateTime(-9999, 7, 4, 23, 59, 59)).toISOString() == "-99990704T235959");
assert(SysTime(DateTime(-10000, 10, 20, 1, 1, 1)).toISOString() == "-100001020T010101");
assert(SysTime(DateTime(0, 12, 4, 0, 0, 0), msecs(7)).toISOString() == "00001204T000000.007");
assert(SysTime(DateTime(-9, 12, 4, 0, 0, 0), msecs(42)).toISOString() == "-00091204T000000.042");
assert(SysTime(DateTime(-99, 12, 4, 5, 6, 12), msecs(100)).toISOString() == "-00991204T050612.1");
assert(SysTime(DateTime(-999, 12, 4, 13, 44, 59), usecs(45020)).toISOString() == "-09991204T134459.04502");
assert(SysTime(DateTime(-9999, 7, 4, 23, 59, 59), hnsecs(12)).toISOString() == "-99990704T235959.0000012");
assert(SysTime(DateTime(-10000, 10, 20, 1, 1, 1), hnsecs(507890)).toISOString() == "-100001020T010101.050789");
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cast(TimeOfDay) cst != TimeOfDay.init);
//assert(cast(TimeOfDay) ist != TimeOfDay.init);
}
/++
Converts this $(LREF SysTime) to a string with the format
YYYY-MM-DDTHH:MM:SS.FFFFFFFTZ (where F is fractional seconds and TZ
is the time zone).
Note that the number of digits in the fractional seconds varies with the
number of fractional seconds. It's a maximum of 7 (which would be
hnsecs), but only has as many as are necessary to hold the correct value
(so no trailing zeroes), and if there are no fractional seconds, then
there is no decimal point.
If this $(LREF SysTime)'s time zone is
$(REF LocalTime,std,datetime,timezone), then TZ is empty. If its time
zone is $(D UTC), then it is "Z". Otherwise, it is the offset from UTC
(e.g. +01:00 or -07:00). Note that the offset from UTC is $(I not)
enough to uniquely identify the time zone.
Time zone offsets will be in the form +HH:MM or -HH:MM.
Params:
writer = A `char` accepting
$(REF_ALTTEXT output range, isOutputRange, std, range, primitives)
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toISOExtString() @safe const nothrow
{
import std.array : appender;
auto app = appender!string();
app.reserve(35);
try
toISOExtString(app);
catch (Exception e)
assert(0, "toISOExtString() threw.");
return app.data;
}
/// ditto
void toISOExtString(W)(ref W writer) const
if (isOutputRange!(W, char))
{
immutable adjustedTime = adjTime;
long hnsecs = adjustedTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable second = splitUnitsFromHNSecs!"seconds"(hnsecs);
immutable dateTime = DateTime(Date(cast(int) days), TimeOfDay(cast(int) hour,
cast(int) minute, cast(int) second));
if (_timezone is LocalTime())
{
dateTime.toISOExtString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
return;
}
if (_timezone is UTC())
{
dateTime.toISOExtString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
put(writer, 'Z');
return;
}
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
dateTime.toISOExtString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
SimpleTimeZone.toISOExtString(writer, utcOffset);
}
///
@safe unittest
{
import core.time : msecs, hnsecs;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(2010, 7, 4, 7, 6, 12)).toISOExtString() ==
"2010-07-04T07:06:12");
assert(SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(24)).toISOExtString() ==
"1998-12-25T02:15:00.024");
assert(SysTime(DateTime(0, 1, 5, 23, 9, 59)).toISOExtString() ==
"0000-01-05T23:09:59");
assert(SysTime(DateTime(-4, 1, 5, 0, 0, 2), hnsecs(520_920)).toISOExtString() ==
"-0004-01-05T00:00:02.052092");
}
@safe unittest
{
import core.time;
// Test A.D.
assert(SysTime(DateTime.init, UTC()).toISOExtString() == "0001-01-01T00:00:00Z");
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1), UTC()).toISOExtString() ==
"0001-01-01T00:00:00.0000001Z");
assert(SysTime(DateTime(9, 12, 4, 0, 0, 0)).toISOExtString() == "0009-12-04T00:00:00");
assert(SysTime(DateTime(99, 12, 4, 5, 6, 12)).toISOExtString() == "0099-12-04T05:06:12");
assert(SysTime(DateTime(999, 12, 4, 13, 44, 59)).toISOExtString() == "0999-12-04T13:44:59");
assert(SysTime(DateTime(9999, 7, 4, 23, 59, 59)).toISOExtString() == "9999-07-04T23:59:59");
assert(SysTime(DateTime(10000, 10, 20, 1, 1, 1)).toISOExtString() == "+10000-10-20T01:01:01");
assert(SysTime(DateTime(9, 12, 4, 0, 0, 0), msecs(42)).toISOExtString() == "0009-12-04T00:00:00.042");
assert(SysTime(DateTime(99, 12, 4, 5, 6, 12), msecs(100)).toISOExtString() == "0099-12-04T05:06:12.1");
assert(SysTime(DateTime(999, 12, 4, 13, 44, 59), usecs(45020)).toISOExtString() == "0999-12-04T13:44:59.04502");
assert(SysTime(DateTime(9999, 7, 4, 23, 59, 59), hnsecs(12)).toISOExtString() == "9999-07-04T23:59:59.0000012");
assert(SysTime(DateTime(10000, 10, 20, 1, 1, 1), hnsecs(507890)).toISOExtString() ==
"+10000-10-20T01:01:01.050789");
assert(SysTime(DateTime(2012, 12, 21, 12, 12, 12),
new immutable SimpleTimeZone(dur!"minutes"(-360))).toISOExtString() ==
"2012-12-21T12:12:12-06:00");
assert(SysTime(DateTime(2012, 12, 21, 12, 12, 12),
new immutable SimpleTimeZone(dur!"minutes"(420))).toISOExtString() ==
"2012-12-21T12:12:12+07:00");
// Test B.C.
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toISOExtString() ==
"0000-12-31T23:59:59.9999999Z");
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(1), UTC()).toISOExtString() ==
"0000-12-31T23:59:59.0000001Z");
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), UTC()).toISOExtString() == "0000-12-31T23:59:59Z");
assert(SysTime(DateTime(0, 12, 4, 0, 12, 4)).toISOExtString() == "0000-12-04T00:12:04");
assert(SysTime(DateTime(-9, 12, 4, 0, 0, 0)).toISOExtString() == "-0009-12-04T00:00:00");
assert(SysTime(DateTime(-99, 12, 4, 5, 6, 12)).toISOExtString() == "-0099-12-04T05:06:12");
assert(SysTime(DateTime(-999, 12, 4, 13, 44, 59)).toISOExtString() == "-0999-12-04T13:44:59");
assert(SysTime(DateTime(-9999, 7, 4, 23, 59, 59)).toISOExtString() == "-9999-07-04T23:59:59");
assert(SysTime(DateTime(-10000, 10, 20, 1, 1, 1)).toISOExtString() == "-10000-10-20T01:01:01");
assert(SysTime(DateTime(0, 12, 4, 0, 0, 0), msecs(7)).toISOExtString() == "0000-12-04T00:00:00.007");
assert(SysTime(DateTime(-9, 12, 4, 0, 0, 0), msecs(42)).toISOExtString() == "-0009-12-04T00:00:00.042");
assert(SysTime(DateTime(-99, 12, 4, 5, 6, 12), msecs(100)).toISOExtString() == "-0099-12-04T05:06:12.1");
assert(SysTime(DateTime(-999, 12, 4, 13, 44, 59), usecs(45020)).toISOExtString() ==
"-0999-12-04T13:44:59.04502");
assert(SysTime(DateTime(-9999, 7, 4, 23, 59, 59), hnsecs(12)).toISOExtString() ==
"-9999-07-04T23:59:59.0000012");
assert(SysTime(DateTime(-10000, 10, 20, 1, 1, 1), hnsecs(507890)).toISOExtString() ==
"-10000-10-20T01:01:01.050789");
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cast(TimeOfDay) cst != TimeOfDay.init);
//assert(cast(TimeOfDay) ist != TimeOfDay.init);
}
/++
Converts this $(LREF SysTime) to a string with the format
YYYY-Mon-DD HH:MM:SS.FFFFFFFTZ (where F is fractional seconds and TZ
is the time zone).
Note that the number of digits in the fractional seconds varies with the
number of fractional seconds. It's a maximum of 7 (which would be
hnsecs), but only has as many as are necessary to hold the correct value
(so no trailing zeroes), and if there are no fractional seconds, then
there is no decimal point.
If this $(LREF SysTime)'s time zone is
$(REF LocalTime,std,datetime,timezone), then TZ is empty. If its time
zone is $(D UTC), then it is "Z". Otherwise, it is the offset from UTC
(e.g. +01:00 or -07:00). Note that the offset from UTC is $(I not)
enough to uniquely identify the time zone.
Time zone offsets will be in the form +HH:MM or -HH:MM.
Params:
writer = A `char` accepting
$(REF_ALTTEXT output range, isOutputRange, std, range, primitives)
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toSimpleString() @safe const nothrow
{
import std.array : appender;
auto app = appender!string();
app.reserve(35);
try
toSimpleString(app);
catch (Exception e)
assert(0, "toSimpleString() threw.");
return app.data;
}
/// ditto
void toSimpleString(W)(ref W writer) const
if (isOutputRange!(W, char))
{
immutable adjustedTime = adjTime;
long hnsecs = adjustedTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if (hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
immutable hour = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable second = splitUnitsFromHNSecs!"seconds"(hnsecs);
immutable dateTime = DateTime(Date(cast(int) days), TimeOfDay(cast(int) hour,
cast(int) minute, cast(int) second));
if (_timezone is LocalTime())
{
dateTime.toSimpleString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
return;
}
if (_timezone is UTC())
{
dateTime.toSimpleString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
put(writer, 'Z');
return;
}
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
dateTime.toSimpleString(writer);
fracSecsToISOString(writer, cast(int) hnsecs);
SimpleTimeZone.toISOExtString(writer, utcOffset);
}
///
@safe unittest
{
import core.time : msecs, hnsecs;
import std.datetime.date : DateTime;
assert(SysTime(DateTime(2010, 7, 4, 7, 6, 12)).toSimpleString() ==
"2010-Jul-04 07:06:12");
assert(SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(24)).toSimpleString() ==
"1998-Dec-25 02:15:00.024");
assert(SysTime(DateTime(0, 1, 5, 23, 9, 59)).toSimpleString() ==
"0000-Jan-05 23:09:59");
assert(SysTime(DateTime(-4, 1, 5, 0, 0, 2), hnsecs(520_920)).toSimpleString() ==
"-0004-Jan-05 00:00:02.052092");
}
@safe unittest
{
import core.time;
// Test A.D.
assert(SysTime(DateTime.init, UTC()).toString() == "0001-Jan-01 00:00:00Z");
assert(SysTime(DateTime(1, 1, 1, 0, 0, 0), hnsecs(1), UTC()).toString() == "0001-Jan-01 00:00:00.0000001Z");
assert(SysTime(DateTime(9, 12, 4, 0, 0, 0)).toSimpleString() == "0009-Dec-04 00:00:00");
assert(SysTime(DateTime(99, 12, 4, 5, 6, 12)).toSimpleString() == "0099-Dec-04 05:06:12");
assert(SysTime(DateTime(999, 12, 4, 13, 44, 59)).toSimpleString() == "0999-Dec-04 13:44:59");
assert(SysTime(DateTime(9999, 7, 4, 23, 59, 59)).toSimpleString() == "9999-Jul-04 23:59:59");
assert(SysTime(DateTime(10000, 10, 20, 1, 1, 1)).toSimpleString() == "+10000-Oct-20 01:01:01");
assert(SysTime(DateTime(9, 12, 4, 0, 0, 0), msecs(42)).toSimpleString() == "0009-Dec-04 00:00:00.042");
assert(SysTime(DateTime(99, 12, 4, 5, 6, 12), msecs(100)).toSimpleString() == "0099-Dec-04 05:06:12.1");
assert(SysTime(DateTime(999, 12, 4, 13, 44, 59), usecs(45020)).toSimpleString() ==
"0999-Dec-04 13:44:59.04502");
assert(SysTime(DateTime(9999, 7, 4, 23, 59, 59), hnsecs(12)).toSimpleString() ==
"9999-Jul-04 23:59:59.0000012");
assert(SysTime(DateTime(10000, 10, 20, 1, 1, 1), hnsecs(507890)).toSimpleString() ==
"+10000-Oct-20 01:01:01.050789");
assert(SysTime(DateTime(2012, 12, 21, 12, 12, 12),
new immutable SimpleTimeZone(dur!"minutes"(-360))).toSimpleString() ==
"2012-Dec-21 12:12:12-06:00");
assert(SysTime(DateTime(2012, 12, 21, 12, 12, 12),
new immutable SimpleTimeZone(dur!"minutes"(420))).toSimpleString() ==
"2012-Dec-21 12:12:12+07:00");
// Test B.C.
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(9_999_999), UTC()).toSimpleString() ==
"0000-Dec-31 23:59:59.9999999Z");
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), hnsecs(1), UTC()).toSimpleString() ==
"0000-Dec-31 23:59:59.0000001Z");
assert(SysTime(DateTime(0, 12, 31, 23, 59, 59), UTC()).toSimpleString() == "0000-Dec-31 23:59:59Z");
assert(SysTime(DateTime(0, 12, 4, 0, 12, 4)).toSimpleString() == "0000-Dec-04 00:12:04");
assert(SysTime(DateTime(-9, 12, 4, 0, 0, 0)).toSimpleString() == "-0009-Dec-04 00:00:00");
assert(SysTime(DateTime(-99, 12, 4, 5, 6, 12)).toSimpleString() == "-0099-Dec-04 05:06:12");
assert(SysTime(DateTime(-999, 12, 4, 13, 44, 59)).toSimpleString() == "-0999-Dec-04 13:44:59");
assert(SysTime(DateTime(-9999, 7, 4, 23, 59, 59)).toSimpleString() == "-9999-Jul-04 23:59:59");
assert(SysTime(DateTime(-10000, 10, 20, 1, 1, 1)).toSimpleString() == "-10000-Oct-20 01:01:01");
assert(SysTime(DateTime(0, 12, 4, 0, 0, 0), msecs(7)).toSimpleString() == "0000-Dec-04 00:00:00.007");
assert(SysTime(DateTime(-9, 12, 4, 0, 0, 0), msecs(42)).toSimpleString() == "-0009-Dec-04 00:00:00.042");
assert(SysTime(DateTime(-99, 12, 4, 5, 6, 12), msecs(100)).toSimpleString() == "-0099-Dec-04 05:06:12.1");
assert(SysTime(DateTime(-999, 12, 4, 13, 44, 59), usecs(45020)).toSimpleString() ==
"-0999-Dec-04 13:44:59.04502");
assert(SysTime(DateTime(-9999, 7, 4, 23, 59, 59), hnsecs(12)).toSimpleString() ==
"-9999-Jul-04 23:59:59.0000012");
assert(SysTime(DateTime(-10000, 10, 20, 1, 1, 1), hnsecs(507890)).toSimpleString() ==
"-10000-Oct-20 01:01:01.050789");
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(cast(TimeOfDay) cst != TimeOfDay.init);
//assert(cast(TimeOfDay) ist != TimeOfDay.init);
}
/++
Converts this $(LREF SysTime) to a string.
This function exists to make it easy to convert a $(LREF SysTime) to a
string for code that does not care what the exact format is - just that
it presents the information in a clear manner. It also makes it easy to
simply convert a $(LREF SysTime) to a string when using functions such
as `to!string`, `format`, or `writeln` which use toString to convert
user-defined types. So, it is unlikely that much code will call
toString directly.
The format of the string is purposefully unspecified, and code that
cares about the format of the string should use `toISOString`,
`toISOExtString`, `toSimpleString`, or some other custom formatting
function that explicitly generates the format that the code needs. The
reason is that the code is then clear about what format it's using,
making it less error-prone to maintain the code and interact with other
software that consumes the generated strings. It's for this same reason
that $(LREF SysTime) has no `fromString` function, whereas it does have
`fromISOString`, `fromISOExtString`, and `fromSimpleString`.
The format returned by toString may or may not change in the future.
Params:
writer = A `char` accepting
$(REF_ALTTEXT output range, isOutputRange, std, range, primitives)
Returns:
A `string` when not using an output range; `void` otherwise.
+/
string toString() @safe const nothrow
{
return toSimpleString();
}
/// ditto
void toString(W)(ref W writer) const
if (isOutputRange!(W, char))
{
toSimpleString(writer);
}
@safe unittest
{
import core.time;
auto st = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
const cst = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
//immutable ist = SysTime(DateTime(1999, 7, 6, 12, 30, 33));
assert(st.toString());
assert(cst.toString());
//assert(ist.toString());
}
/++
Creates a $(LREF SysTime) from a string with the format
YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds is the time
zone). Whitespace is stripped from the given string.
The exact format is exactly as described in $(D toISOString) except that
trailing zeroes are permitted - including having fractional seconds with
all zeroes. However, a decimal point with nothing following it is
invalid. Also, while $(LREF toISOString) will never generate a string
with more than 7 digits in the fractional seconds (because that's the
limit with hecto-nanosecond precision), it will allow more than 7 digits
in order to read strings from other sources that have higher precision
(however, any digits beyond 7 will be truncated).
If there is no time zone in the string, then
$(REF LocalTime,std,datetime,timezone) is used. If the time zone is "Z",
then $(D UTC) is used. Otherwise, a
$(REF SimpleTimeZone,std,datetime,timezone) which corresponds to the
given offset from UTC is used. To get the returned $(LREF SysTime) to be
a particular time zone, pass in that time zone and the $(LREF SysTime)
to be returned will be converted to that time zone (though it will still
be read in as whatever time zone is in its string).
The accepted formats for time zone offsets are +HH, -HH, +HHMM, and
-HHMM.
$(RED Warning:
Previously, $(LREF toISOString) did the same as
$(LREF toISOExtString) and generated +HH:MM or -HH:MM for the time
zone when it was not $(REF LocalTime,std,datetime,timezone) or
$(REF UTC,std,datetime,timezone), which is not in conformance with
ISO 8601 for the non-extended string format. This has now been
fixed. However, for now, fromISOString will continue to accept the
extended format for the time zone so that any code which has been
writing out the result of toISOString to read in later will continue
to work. The current behavior will be kept until July 2019 at which
point, fromISOString will be fixed to be standards compliant.)
Params:
isoString = A string formatted in the ISO format for dates and times.
tz = The time zone to convert the given time to (no
conversion occurs if null).
Throws:
$(REF DateTimeException,std,datetime,date) if the given string is
not in the ISO format or if the resulting $(LREF SysTime) would not
be valid.
+/
static SysTime fromISOString(S)(in S isoString, immutable TimeZone tz = null) @safe
if (isSomeString!S)
{
import std.algorithm.searching : startsWith, find;
import std.conv : to;
import std.string : strip;
import std.utf : byCodeUnit;
auto str = strip(isoString);
immutable skipFirst = str.startsWith('+', '-');
auto found = (skipFirst ? str[1..$] : str).byCodeUnit.find('.', 'Z', '+', '-');
auto dateTimeStr = str[0 .. $ - found[0].length];
typeof(str) fracSecStr;
typeof(str) zoneStr;
if (found[1] != 0)
{
if (found[1] == 1)
{
auto foundTZ = found[0].find('Z', '+', '-');
if (foundTZ[1] != 0)
{
static if (isNarrowString!S)
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length].source;
zoneStr = foundTZ[0].source;
}
else
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length];
zoneStr = foundTZ[0];
}
}
else
{
static if (isNarrowString!S)
fracSecStr = found[0].source;
else
fracSecStr = found[0];
}
}
else
{
static if (isNarrowString!S)
zoneStr = found[0].source;
else
zoneStr = found[0];
}
}
try
{
auto dateTime = DateTime.fromISOString(dateTimeStr);
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
if (zoneStr.empty)
parsedZone = LocalTime();
else if (zoneStr == "Z")
parsedZone = UTC();
else
{
try
parsedZone = SimpleTimeZone.fromISOString(zoneStr);
catch (DateTimeException dte)
parsedZone = SimpleTimeZone.fromISOExtString(zoneStr);
}
auto retval = SysTime(dateTime, fracSec, parsedZone);
if (tz !is null)
retval.timezone = tz;
return retval;
}
catch (DateTimeException dte)
throw new DateTimeException(format("Invalid ISO String: %s", isoString));
}
///
@safe unittest
{
import core.time : hours, msecs, usecs, hnsecs;
import std.datetime.date : DateTime;
import std.datetime.timezone : SimpleTimeZone, UTC;
assert(SysTime.fromISOString("20100704T070612") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12)));
assert(SysTime.fromISOString("19981225T021500.007") ==
SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(7)));
assert(SysTime.fromISOString("00000105T230959.00002") ==
SysTime(DateTime(0, 1, 5, 23, 9, 59), usecs(20)));
assert(SysTime.fromISOString("20130207T043937.000050392") ==
SysTime(DateTime(2013, 2, 7, 4, 39, 37), hnsecs(503)));
assert(SysTime.fromISOString("-00040105T000002") ==
SysTime(DateTime(-4, 1, 5, 0, 0, 2)));
assert(SysTime.fromISOString(" 20100704T070612 ") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12)));
assert(SysTime.fromISOString("20100704T070612Z") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12), UTC()));
assert(SysTime.fromISOString("20100704T070612-0800") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(hours(-8))));
assert(SysTime.fromISOString("20100704T070612+0800") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(hours(8))));
}
@safe unittest
{
import core.time;
foreach (str; ["", "20100704000000", "20100704 000000", "20100704t000000",
"20100704T000000.", "20100704T000000.A", "20100704T000000.Z",
"20100704T000000.0000000A", "20100704T000000.00000000A",
"20100704T000000+", "20100704T000000-", "20100704T000000:",
"20100704T000000-:", "20100704T000000+:", "20100704T000000-1:",
"20100704T000000+1:", "20100704T000000+1:0",
"20100704T000000-12.00", "20100704T000000+12.00",
"20100704T000000-8", "20100704T000000+8",
"20100704T000000-800", "20100704T000000+800",
"20100704T000000-080", "20100704T000000+080",
"20100704T000000-2400", "20100704T000000+2400",
"20100704T000000-1260", "20100704T000000+1260",
"20100704T000000.0-8", "20100704T000000.0+8",
"20100704T000000.0-800", "20100704T000000.0+800",
"20100704T000000.0-080", "20100704T000000.0+080",
"20100704T000000.0-2400", "20100704T000000.0+2400",
"20100704T000000.0-1260", "20100704T000000.0+1260",
"20100704T000000-8:00", "20100704T000000+8:00",
"20100704T000000-08:0", "20100704T000000+08:0",
"20100704T000000-24:00", "20100704T000000+24:00",
"20100704T000000-12:60", "20100704T000000+12:60",
"20100704T000000.0-8:00", "20100704T000000.0+8:00",
"20100704T000000.0-08:0", "20100704T000000.0+08:0",
"20100704T000000.0-24:00", "20100704T000000.0+24:00",
"20100704T000000.0-12:60", "20100704T000000.0+12:60",
"2010-07-0400:00:00", "2010-07-04 00:00:00",
"2010-07-04t00:00:00", "2010-07-04T00:00:00.",
"2010-Jul-0400:00:00", "2010-Jul-04 00:00:00", "2010-Jul-04t00:00:00",
"2010-Jul-04T00:00:00", "2010-Jul-04 00:00:00.",
"2010-12-22T172201", "2010-Dec-22 17:22:01"])
{
assertThrown!DateTimeException(SysTime.fromISOString(str), format("[%s]", str));
}
static void test(string str, SysTime st, size_t line = __LINE__)
{
if (SysTime.fromISOString(str) != st)
throw new AssertError("unittest failure", __FILE__, line);
}
test("20101222T172201", SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
test("19990706T123033", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("-19990706T123033", SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
test("+019990706T123033", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("19990706T123033 ", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test(" 19990706T123033", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test(" 19990706T123033 ", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("19070707T121212.0", SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
test("19070707T121212.0000000", SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
test("19070707T121212.0000001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), hnsecs(1)));
test("20100704T000000.00000000", SysTime(Date(2010, 07, 04)));
test("20100704T000000.00000009", SysTime(Date(2010, 07, 04)));
test("20100704T000000.00000019", SysTime(DateTime(2010, 07, 04), hnsecs(1)));
test("19070707T121212.000001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
test("19070707T121212.0000010", SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
test("19070707T121212.001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
test("19070707T121212.0010000", SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
auto west60 = new immutable SimpleTimeZone(hours(-1));
auto west90 = new immutable SimpleTimeZone(minutes(-90));
auto west480 = new immutable SimpleTimeZone(hours(-8));
auto east60 = new immutable SimpleTimeZone(hours(1));
auto east90 = new immutable SimpleTimeZone(minutes(90));
auto east480 = new immutable SimpleTimeZone(hours(8));
test("20101222T172201Z", SysTime(DateTime(2010, 12, 22, 17, 22, 01), UTC()));
test("20101222T172201-0100", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("20101222T172201-01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("20101222T172201-0130", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west90));
test("20101222T172201-0800", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west480));
test("20101222T172201+0100", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("20101222T172201+01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("20101222T172201+0130", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("20101222T172201+0800", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east480));
test("20101103T065106.57159Z", SysTime(DateTime(2010, 11, 3, 6, 51, 6), hnsecs(5715900), UTC()));
test("20101222T172201.23412Z", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_341_200), UTC()));
test("20101222T172201.23112-0100", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200), west60));
test("20101222T172201.45-01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), west60));
test("20101222T172201.1-0130", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000), west90));
test("20101222T172201.55-0800", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000), west480));
test("20101222T172201.1234567+0100", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567), east60));
test("20101222T172201.0+01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("20101222T172201.0000000+0130", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("20101222T172201.45+0800", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), east480));
// for dstring coverage
assert(SysTime.fromISOString("20101222T172201.23112-0100"d) == SysTime(
DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200), west60));
assert(SysTime.fromISOString("19070707T121212.0010000"d) == SysTime(
DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
// @@@DEPRECATED_2019-07@@@
// This isn't deprecated per se, but that text will make it so that it
// pops up when deprecations are moved along around July 2019. At that
// time, we will update fromISOString so that it is conformant with ISO
// 8601, and it will no longer accept ISO extended time zones (it does
// currently because of issue #15654 - toISOString used to incorrectly
// use the ISO extended time zone format). These tests will then start
// failing will need to be updated accordingly. Also, the notes about
// this issue in toISOString and fromISOString's documentation will need
// to be removed.
test("20101222T172201-01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("20101222T172201-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west90));
test("20101222T172201-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west480));
test("20101222T172201+01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("20101222T172201+01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("20101222T172201+08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east480));
test("20101222T172201.23112-01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200), west60));
test("20101222T172201.1-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000), west90));
test("20101222T172201.55-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000), west480));
test("20101222T172201.1234567+01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567), east60));
test("20101222T172201.0000000+01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("20101222T172201.45+08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), east480));
}
// bug# 17801
@safe unittest
{
import std.conv : to;
import std.meta : AliasSeq;
static foreach (C; AliasSeq!(char, wchar, dchar))
{
static foreach (S; AliasSeq!(C[], const(C)[], immutable(C)[]))
{
assert(SysTime.fromISOString(to!S("20121221T141516Z")) ==
SysTime(DateTime(2012, 12, 21, 14, 15, 16), UTC()));
}
}
}
/++
Creates a $(LREF SysTime) from a string with the format
YYYY-MM-DDTHH:MM:SS.FFFFFFFTZ (where F is fractional seconds is the
time zone). Whitespace is stripped from the given string.
The exact format is exactly as described in $(D toISOExtString)
except that trailing zeroes are permitted - including having fractional
seconds with all zeroes. However, a decimal point with nothing following
it is invalid. Also, while $(LREF toISOExtString) will never generate a
string with more than 7 digits in the fractional seconds (because that's
the limit with hecto-nanosecond precision), it will allow more than 7
digits in order to read strings from other sources that have higher
precision (however, any digits beyond 7 will be truncated).
If there is no time zone in the string, then
$(REF LocalTime,std,datetime,timezone) is used. If the time zone is "Z",
then $(D UTC) is used. Otherwise, a
$(REF SimpleTimeZone,std,datetime,timezone) which corresponds to the
given offset from UTC is used. To get the returned $(LREF SysTime) to be
a particular time zone, pass in that time zone and the $(LREF SysTime)
to be returned will be converted to that time zone (though it will still
be read in as whatever time zone is in its string).
The accepted formats for time zone offsets are +HH, -HH, +HH:MM, and
-HH:MM.
Params:
isoExtString = A string formatted in the ISO Extended format for
dates and times.
tz = The time zone to convert the given time to (no
conversion occurs if null).
Throws:
$(REF DateTimeException,std,datetime,date) if the given string is
not in the ISO format or if the resulting $(LREF SysTime) would not
be valid.
+/
static SysTime fromISOExtString(S)(in S isoExtString, immutable TimeZone tz = null) @safe
if (isSomeString!(S))
{
import std.algorithm.searching : countUntil, find;
import std.conv : to;
import std.string : strip, indexOf;
auto str = strip(isoExtString);
auto tIndex = str.indexOf('T');
enforce(tIndex != -1, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
auto found = str[tIndex + 1 .. $].find('.', 'Z', '+', '-');
auto dateTimeStr = str[0 .. $ - found[0].length];
typeof(str) fracSecStr;
typeof(str) zoneStr;
if (found[1] != 0)
{
if (found[1] == 1)
{
auto foundTZ = found[0].find('Z', '+', '-');
if (foundTZ[1] != 0)
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length];
zoneStr = foundTZ[0];
}
else
fracSecStr = found[0];
}
else
zoneStr = found[0];
}
try
{
auto dateTime = DateTime.fromISOExtString(dateTimeStr);
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
if (zoneStr.empty)
parsedZone = LocalTime();
else if (zoneStr == "Z")
parsedZone = UTC();
else
parsedZone = SimpleTimeZone.fromISOExtString(zoneStr);
auto retval = SysTime(dateTime, fracSec, parsedZone);
if (tz !is null)
retval.timezone = tz;
return retval;
}
catch (DateTimeException dte)
throw new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString));
}
///
@safe unittest
{
import core.time : hours, msecs, usecs, hnsecs;
import std.datetime.date : DateTime;
import std.datetime.timezone : SimpleTimeZone, UTC;
assert(SysTime.fromISOExtString("2010-07-04T07:06:12") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12)));
assert(SysTime.fromISOExtString("1998-12-25T02:15:00.007") ==
SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(7)));
assert(SysTime.fromISOExtString("0000-01-05T23:09:59.00002") ==
SysTime(DateTime(0, 1, 5, 23, 9, 59), usecs(20)));
assert(SysTime.fromISOExtString("2013-02-07T04:39:37.000050392") ==
SysTime(DateTime(2013, 2, 7, 4, 39, 37), hnsecs(503)));
assert(SysTime.fromISOExtString("-0004-01-05T00:00:02") ==
SysTime(DateTime(-4, 1, 5, 0, 0, 2)));
assert(SysTime.fromISOExtString(" 2010-07-04T07:06:12 ") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12)));
assert(SysTime.fromISOExtString("2010-07-04T07:06:12Z") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12), UTC()));
assert(SysTime.fromISOExtString("2010-07-04T07:06:12-08:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(hours(-8))));
assert(SysTime.fromISOExtString("2010-07-04T07:06:12+08:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(hours(8))));
}
@safe unittest
{
import core.time;
foreach (str; ["", "20100704000000", "20100704 000000",
"20100704t000000", "20100704T000000.", "20100704T000000.0",
"2010-07:0400:00:00", "2010-07-04 00:00:00",
"2010-07-04 00:00:00", "2010-07-04t00:00:00",
"2010-07-04T00:00:00.", "2010-07-04T00:00:00.A", "2010-07-04T00:00:00.Z",
"2010-07-04T00:00:00.0000000A", "2010-07-04T00:00:00.00000000A",
"2010-07-04T00:00:00+", "2010-07-04T00:00:00-",
"2010-07-04T00:00:00:", "2010-07-04T00:00:00-:", "2010-07-04T00:00:00+:",
"2010-07-04T00:00:00-1:", "2010-07-04T00:00:00+1:", "2010-07-04T00:00:00+1:0",
"2010-07-04T00:00:00-12.00", "2010-07-04T00:00:00+12.00",
"2010-07-04T00:00:00-8", "2010-07-04T00:00:00+8",
"20100704T000000-800", "20100704T000000+800",
"20100704T000000-080", "20100704T000000+080",
"20100704T000000-2400", "20100704T000000+2400",
"20100704T000000-1260", "20100704T000000+1260",
"20100704T000000.0-800", "20100704T000000.0+800",
"20100704T000000.0-8", "20100704T000000.0+8",
"20100704T000000.0-080", "20100704T000000.0+080",
"20100704T000000.0-2400", "20100704T000000.0+2400",
"20100704T000000.0-1260", "20100704T000000.0+1260",
"2010-07-04T00:00:00-8:00", "2010-07-04T00:00:00+8:00",
"2010-07-04T00:00:00-24:00", "2010-07-04T00:00:00+24:00",
"2010-07-04T00:00:00-12:60", "2010-07-04T00:00:00+12:60",
"2010-07-04T00:00:00.0-8:00", "2010-07-04T00:00:00.0+8:00",
"2010-07-04T00:00:00.0-8", "2010-07-04T00:00:00.0+8",
"2010-07-04T00:00:00.0-24:00", "2010-07-04T00:00:00.0+24:00",
"2010-07-04T00:00:00.0-12:60", "2010-07-04T00:00:00.0+12:60",
"2010-Jul-0400:00:00", "2010-Jul-04t00:00:00",
"2010-Jul-04 00:00:00.", "2010-Jul-04 00:00:00.0",
"20101222T172201", "2010-Dec-22 17:22:01"])
{
assertThrown!DateTimeException(SysTime.fromISOExtString(str), format("[%s]", str));
}
static void test(string str, SysTime st, size_t line = __LINE__)
{
if (SysTime.fromISOExtString(str) != st)
throw new AssertError("unittest failure", __FILE__, line);
}
test("2010-12-22T17:22:01", SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
test("1999-07-06T12:30:33", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("-1999-07-06T12:30:33", SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
test("+01999-07-06T12:30:33", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("1999-07-06T12:30:33 ", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test(" 1999-07-06T12:30:33", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test(" 1999-07-06T12:30:33 ", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("1907-07-07T12:12:12.0", SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
test("1907-07-07T12:12:12.0000000", SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
test("1907-07-07T12:12:12.0000001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), hnsecs(1)));
test("2010-07-04T00:00:00.00000000", SysTime(Date(2010, 07, 04)));
test("2010-07-04T00:00:00.00000009", SysTime(Date(2010, 07, 04)));
test("2010-07-04T00:00:00.00000019", SysTime(DateTime(2010, 07, 04), hnsecs(1)));
test("1907-07-07T12:12:12.000001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
test("1907-07-07T12:12:12.0000010", SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
test("1907-07-07T12:12:12.001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
test("1907-07-07T12:12:12.0010000", SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
auto west60 = new immutable SimpleTimeZone(hours(-1));
auto west90 = new immutable SimpleTimeZone(minutes(-90));
auto west480 = new immutable SimpleTimeZone(hours(-8));
auto east60 = new immutable SimpleTimeZone(hours(1));
auto east90 = new immutable SimpleTimeZone(minutes(90));
auto east480 = new immutable SimpleTimeZone(hours(8));
test("2010-12-22T17:22:01Z", SysTime(DateTime(2010, 12, 22, 17, 22, 01), UTC()));
test("2010-12-22T17:22:01-01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("2010-12-22T17:22:01-01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("2010-12-22T17:22:01-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west90));
test("2010-12-22T17:22:01-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west480));
test("2010-12-22T17:22:01+01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("2010-12-22T17:22:01+01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("2010-12-22T17:22:01+01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("2010-12-22T17:22:01+08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east480));
test("2010-11-03T06:51:06.57159Z", SysTime(DateTime(2010, 11, 3, 6, 51, 6), hnsecs(5715900), UTC()));
test("2010-12-22T17:22:01.23412Z", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_341_200), UTC()));
test("2010-12-22T17:22:01.23112-01:00",
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200), west60));
test("2010-12-22T17:22:01.45-01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), west60));
test("2010-12-22T17:22:01.1-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000), west90));
test("2010-12-22T17:22:01.55-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000), west480));
test("2010-12-22T17:22:01.1234567+01:00",
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567), east60));
test("2010-12-22T17:22:01.0+01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("2010-12-22T17:22:01.0000000+01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("2010-12-22T17:22:01.45+08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), east480));
}
// bug# 17801
@safe unittest
{
import core.time;
import std.conv : to;
import std.meta : AliasSeq;
static foreach (C; AliasSeq!(char, wchar, dchar))
{
static foreach (S; AliasSeq!(C[], const(C)[], immutable(C)[]))
{
assert(SysTime.fromISOExtString(to!S("2012-12-21T14:15:16Z")) ==
SysTime(DateTime(2012, 12, 21, 14, 15, 16), UTC()));
}
}
}
/++
Creates a $(LREF SysTime) from a string with the format
YYYY-MM-DD HH:MM:SS.FFFFFFFTZ (where F is fractional seconds is the
time zone). Whitespace is stripped from the given string.
The exact format is exactly as described in $(D toSimpleString) except
that trailing zeroes are permitted - including having fractional seconds
with all zeroes. However, a decimal point with nothing following it is
invalid. Also, while $(LREF toSimpleString) will never generate a
string with more than 7 digits in the fractional seconds (because that's
the limit with hecto-nanosecond precision), it will allow more than 7
digits in order to read strings from other sources that have higher
precision (however, any digits beyond 7 will be truncated).
If there is no time zone in the string, then
$(REF LocalTime,std,datetime,timezone) is used. If the time zone is "Z",
then $(D UTC) is used. Otherwise, a
$(REF SimpleTimeZone,std,datetime,timezone) which corresponds to the
given offset from UTC is used. To get the returned $(LREF SysTime) to be
a particular time zone, pass in that time zone and the $(LREF SysTime)
to be returned will be converted to that time zone (though it will still
be read in as whatever time zone is in its string).
The accepted formats for time zone offsets are +HH, -HH, +HH:MM, and
-HH:MM.
Params:
simpleString = A string formatted in the way that
$(D toSimpleString) formats dates and times.
tz = The time zone to convert the given time to (no
conversion occurs if null).
Throws:
$(REF DateTimeException,std,datetime,date) if the given string is
not in the ISO format or if the resulting $(LREF SysTime) would not
be valid.
+/
static SysTime fromSimpleString(S)(in S simpleString, immutable TimeZone tz = null) @safe
if (isSomeString!(S))
{
import std.algorithm.searching : find;
import std.conv : to;
import std.string : strip, indexOf;
auto str = strip(simpleString);
auto spaceIndex = str.indexOf(' ');
enforce(spaceIndex != -1, new DateTimeException(format("Invalid Simple String: %s", simpleString)));
auto found = str[spaceIndex + 1 .. $].find('.', 'Z', '+', '-');
auto dateTimeStr = str[0 .. $ - found[0].length];
typeof(str) fracSecStr;
typeof(str) zoneStr;
if (found[1] != 0)
{
if (found[1] == 1)
{
auto foundTZ = found[0].find('Z', '+', '-');
if (foundTZ[1] != 0)
{
fracSecStr = found[0][0 .. $ - foundTZ[0].length];
zoneStr = foundTZ[0];
}
else
fracSecStr = found[0];
}
else
zoneStr = found[0];
}
try
{
auto dateTime = DateTime.fromSimpleString(dateTimeStr);
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
if (zoneStr.empty)
parsedZone = LocalTime();
else if (zoneStr == "Z")
parsedZone = UTC();
else
parsedZone = SimpleTimeZone.fromISOExtString(zoneStr);
auto retval = SysTime(dateTime, fracSec, parsedZone);
if (tz !is null)
retval.timezone = tz;
return retval;
}
catch (DateTimeException dte)
throw new DateTimeException(format("Invalid Simple String: %s", simpleString));
}
///
@safe unittest
{
import core.time : hours, msecs, usecs, hnsecs;
import std.datetime.date : DateTime;
import std.datetime.timezone : SimpleTimeZone, UTC;
assert(SysTime.fromSimpleString("2010-Jul-04 07:06:12") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12)));
assert(SysTime.fromSimpleString("1998-Dec-25 02:15:00.007") ==
SysTime(DateTime(1998, 12, 25, 2, 15, 0), msecs(7)));
assert(SysTime.fromSimpleString("0000-Jan-05 23:09:59.00002") ==
SysTime(DateTime(0, 1, 5, 23, 9, 59), usecs(20)));
assert(SysTime.fromSimpleString("2013-Feb-07 04:39:37.000050392") ==
SysTime(DateTime(2013, 2, 7, 4, 39, 37), hnsecs(503)));
assert(SysTime.fromSimpleString("-0004-Jan-05 00:00:02") ==
SysTime(DateTime(-4, 1, 5, 0, 0, 2)));
assert(SysTime.fromSimpleString(" 2010-Jul-04 07:06:12 ") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12)));
assert(SysTime.fromSimpleString("2010-Jul-04 07:06:12Z") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12), UTC()));
assert(SysTime.fromSimpleString("2010-Jul-04 07:06:12-08:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(hours(-8))));
assert(SysTime.fromSimpleString("2010-Jul-04 07:06:12+08:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(hours(8))));
}
@safe unittest
{
import core.time;
foreach (str; ["", "20100704000000", "20100704 000000",
"20100704t000000", "20100704T000000.", "20100704T000000.0",
"2010-07-0400:00:00", "2010-07-04 00:00:00", "2010-07-04t00:00:00",
"2010-07-04T00:00:00.", "2010-07-04T00:00:00.0",
"2010-Jul-0400:00:00", "2010-Jul-04t00:00:00", "2010-Jul-04T00:00:00",
"2010-Jul-04 00:00:00.", "2010-Jul-04 00:00:00.A", "2010-Jul-04 00:00:00.Z",
"2010-Jul-04 00:00:00.0000000A", "2010-Jul-04 00:00:00.00000000A",
"2010-Jul-04 00:00:00+", "2010-Jul-04 00:00:00-",
"2010-Jul-04 00:00:00:", "2010-Jul-04 00:00:00-:",
"2010-Jul-04 00:00:00+:", "2010-Jul-04 00:00:00-1:",
"2010-Jul-04 00:00:00+1:", "2010-Jul-04 00:00:00+1:0",
"2010-Jul-04 00:00:00-12.00", "2010-Jul-04 00:00:00+12.00",
"2010-Jul-04 00:00:00-8", "2010-Jul-04 00:00:00+8",
"20100704T000000-800", "20100704T000000+800",
"20100704T000000-080", "20100704T000000+080",
"20100704T000000-2400", "20100704T000000+2400",
"20100704T000000-1260", "20100704T000000+1260",
"20100704T000000.0-800", "20100704T000000.0+800",
"20100704T000000.0-8", "20100704T000000.0+8",
"20100704T000000.0-080", "20100704T000000.0+080",
"20100704T000000.0-2400", "20100704T000000.0+2400",
"20100704T000000.0-1260", "20100704T000000.0+1260",
"2010-Jul-04 00:00:00-8:00", "2010-Jul-04 00:00:00+8:00",
"2010-Jul-04 00:00:00-08:0", "2010-Jul-04 00:00:00+08:0",
"2010-Jul-04 00:00:00-24:00", "2010-Jul-04 00:00:00+24:00",
"2010-Jul-04 00:00:00-12:60", "2010-Jul-04 00:00:00+24:60",
"2010-Jul-04 00:00:00.0-8:00", "2010-Jul-04 00:00:00+8:00",
"2010-Jul-04 00:00:00.0-8", "2010-Jul-04 00:00:00.0+8",
"2010-Jul-04 00:00:00.0-08:0", "2010-Jul-04 00:00:00.0+08:0",
"2010-Jul-04 00:00:00.0-24:00", "2010-Jul-04 00:00:00.0+24:00",
"2010-Jul-04 00:00:00.0-12:60", "2010-Jul-04 00:00:00.0+24:60",
"20101222T172201", "2010-12-22T172201"])
{
assertThrown!DateTimeException(SysTime.fromSimpleString(str), format("[%s]", str));
}
static void test(string str, SysTime st, size_t line = __LINE__)
{
if (SysTime.fromSimpleString(str) != st)
throw new AssertError("unittest failure", __FILE__, line);
}
test("2010-Dec-22 17:22:01", SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
test("1999-Jul-06 12:30:33", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("-1999-Jul-06 12:30:33", SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
test("+01999-Jul-06 12:30:33", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("1999-Jul-06 12:30:33 ", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test(" 1999-Jul-06 12:30:33", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test(" 1999-Jul-06 12:30:33 ", SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
test("1907-Jul-07 12:12:12.0", SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
test("1907-Jul-07 12:12:12.0000000", SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
test("2010-Jul-04 00:00:00.00000000", SysTime(Date(2010, 07, 04)));
test("2010-Jul-04 00:00:00.00000009", SysTime(Date(2010, 07, 04)));
test("2010-Jul-04 00:00:00.00000019", SysTime(DateTime(2010, 07, 04), hnsecs(1)));
test("1907-Jul-07 12:12:12.0000001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), hnsecs(1)));
test("1907-Jul-07 12:12:12.000001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
test("1907-Jul-07 12:12:12.0000010", SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
test("1907-Jul-07 12:12:12.001", SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
test("1907-Jul-07 12:12:12.0010000", SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
auto west60 = new immutable SimpleTimeZone(hours(-1));
auto west90 = new immutable SimpleTimeZone(minutes(-90));
auto west480 = new immutable SimpleTimeZone(hours(-8));
auto east60 = new immutable SimpleTimeZone(hours(1));
auto east90 = new immutable SimpleTimeZone(minutes(90));
auto east480 = new immutable SimpleTimeZone(hours(8));
test("2010-Dec-22 17:22:01Z", SysTime(DateTime(2010, 12, 22, 17, 22, 01), UTC()));
test("2010-Dec-22 17:22:01-01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("2010-Dec-22 17:22:01-01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60));
test("2010-Dec-22 17:22:01-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west90));
test("2010-Dec-22 17:22:01-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west480));
test("2010-Dec-22 17:22:01+01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("2010-Dec-22 17:22:01+01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("2010-Dec-22 17:22:01+01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("2010-Dec-22 17:22:01+08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east480));
test("2010-Nov-03 06:51:06.57159Z", SysTime(DateTime(2010, 11, 3, 6, 51, 6), hnsecs(5715900), UTC()));
test("2010-Dec-22 17:22:01.23412Z", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_341_200), UTC()));
test("2010-Dec-22 17:22:01.23112-01:00",
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200), west60));
test("2010-Dec-22 17:22:01.45-01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), west60));
test("2010-Dec-22 17:22:01.1-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000), west90));
test("2010-Dec-22 17:22:01.55-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000), west480));
test("2010-Dec-22 17:22:01.1234567+01:00",
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567), east60));
test("2010-Dec-22 17:22:01.0+01", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east60));
test("2010-Dec-22 17:22:01.0000000+01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), east90));
test("2010-Dec-22 17:22:01.45+08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000), east480));
}
// bug# 17801
@safe unittest
{
import core.time;
import std.conv : to;
import std.meta : AliasSeq;
static foreach (C; AliasSeq!(char, wchar, dchar))
{
static foreach (S; AliasSeq!(C[], const(C)[], immutable(C)[]))
{
assert(SysTime.fromSimpleString(to!S("2012-Dec-21 14:15:16Z")) ==
SysTime(DateTime(2012, 12, 21, 14, 15, 16), UTC()));
}
}
}
/++
Returns the $(LREF SysTime) farthest in the past which is representable
by $(LREF SysTime).
The $(LREF SysTime) which is returned is in UTC.
+/
@property static SysTime min() @safe pure nothrow
{
return SysTime(long.min, UTC());
}
@safe unittest
{
assert(SysTime.min.year < 0);
assert(SysTime.min < SysTime.max);
}
/++
Returns the $(LREF SysTime) farthest in the future which is representable
by $(LREF SysTime).
The $(LREF SysTime) which is returned is in UTC.
+/
@property static SysTime max() @safe pure nothrow
{
return SysTime(long.max, UTC());
}
@safe unittest
{
assert(SysTime.max.year > 0);
assert(SysTime.max > SysTime.min);
}
private:
/+
Returns $(D stdTime) converted to $(LREF SysTime)'s time zone.
+/
@property long adjTime() @safe const nothrow scope
{
return _timezone.utcToTZ(_stdTime);
}
/+
Converts the given hnsecs from $(LREF SysTime)'s time zone to std time.
+/
@property void adjTime(long adjTime) @safe nothrow scope
{
_stdTime = _timezone.tzToUTC(adjTime);
}
// Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=5058
/+
invariant()
{
assert(_timezone !is null, "Invariant Failure: timezone is null. Were you foolish enough to use " ~
"SysTime.init? (since timezone for SysTime.init can't be set at compile time).");
}
+/
long _stdTime;
Rebindable!(immutable TimeZone) _timezone;
}
/++
Converts from unix time (which uses midnight, January 1st, 1970 UTC as its
epoch and seconds as its units) to "std time" (which uses midnight,
January 1st, 1 A.D. UTC and hnsecs as its units).
The C standard does not specify the representation of time_t, so it is
implementation defined. On POSIX systems, unix time is equivalent to
time_t, but that's not necessarily true on other systems (e.g. it is
not true for the Digital Mars C runtime). So, be careful when using unix
time with C functions on non-POSIX systems.
"std time"'s epoch is based on the Proleptic Gregorian Calendar per ISO
8601 and is what $(LREF SysTime) uses internally. However, holding the time
as an integer in hnsecs since that epoch technically isn't actually part of
the standard, much as it's based on it, so the name "std time" isn't
particularly good, but there isn't an official name for it. C# uses "ticks"
for the same thing, but they aren't actually clock ticks, and the term
"ticks" $(I is) used for actual clock ticks for $(REF MonoTime, core,time),
so it didn't make sense to use the term ticks here. So, for better or worse,
std.datetime uses the term "std time" for this.
Params:
unixTime = The unix time to convert.
See_Also:
SysTime.fromUnixTime
+/
long unixTimeToStdTime(long unixTime) @safe pure nothrow
{
return 621_355_968_000_000_000L + convert!("seconds", "hnsecs")(unixTime);
}
///
@safe unittest
{
import std.datetime.date : DateTime;
import std.datetime.timezone : UTC;
// Midnight, January 1st, 1970
assert(unixTimeToStdTime(0) == 621_355_968_000_000_000L);
assert(SysTime(unixTimeToStdTime(0)) ==
SysTime(DateTime(1970, 1, 1), UTC()));
assert(unixTimeToStdTime(int.max) == 642_830_804_470_000_000L);
assert(SysTime(unixTimeToStdTime(int.max)) ==
SysTime(DateTime(2038, 1, 19, 3, 14, 07), UTC()));
assert(unixTimeToStdTime(-127_127) == 621_354_696_730_000_000L);
assert(SysTime(unixTimeToStdTime(-127_127)) ==
SysTime(DateTime(1969, 12, 30, 12, 41, 13), UTC()));
}
@safe unittest
{
// Midnight, January 2nd, 1970
assert(unixTimeToStdTime(86_400) == 621_355_968_000_000_000L + 864_000_000_000L);
// Midnight, December 31st, 1969
assert(unixTimeToStdTime(-86_400) == 621_355_968_000_000_000L - 864_000_000_000L);
assert(unixTimeToStdTime(0) == (Date(1970, 1, 1) - Date(1, 1, 1)).total!"hnsecs");
assert(unixTimeToStdTime(0) == (DateTime(1970, 1, 1) - DateTime(1, 1, 1)).total!"hnsecs");
foreach (dt; [DateTime(2010, 11, 1, 19, 5, 22), DateTime(1952, 7, 6, 2, 17, 9)])
assert(unixTimeToStdTime((dt - DateTime(1970, 1, 1)).total!"seconds") == (dt - DateTime.init).total!"hnsecs");
}
/++
Converts std time (which uses midnight, January 1st, 1 A.D. UTC as its epoch
and hnsecs as its units) to unix time (which uses midnight, January 1st,
1970 UTC as its epoch and seconds as its units).
The C standard does not specify the representation of time_t, so it is
implementation defined. On POSIX systems, unix time is equivalent to
time_t, but that's not necessarily true on other systems (e.g. it is
not true for the Digital Mars C runtime). So, be careful when using unix
time with C functions on non-POSIX systems.
"std time"'s epoch is based on the Proleptic Gregorian Calendar per ISO
8601 and is what $(LREF SysTime) uses internally. However, holding the time
as an integer in hnescs since that epoch technically isn't actually part of
the standard, much as it's based on it, so the name "std time" isn't
particularly good, but there isn't an official name for it. C# uses "ticks"
for the same thing, but they aren't actually clock ticks, and the term
"ticks" $(I is) used for actual clock ticks for $(REF MonoTime, core,time),
so it didn't make sense to use the term ticks here. So, for better or worse,
std.datetime uses the term "std time" for this.
By default, the return type is time_t (which is normally an alias for
int on 32-bit systems and long on 64-bit systems), but if a different
size is required than either int or long can be passed as a template
argument to get the desired size.
If the return type is int, and the result can't fit in an int, then the
closest value that can be held in 32 bits will be used (so $(D int.max)
if it goes over and $(D int.min) if it goes under). However, no attempt
is made to deal with integer overflow if the return type is long.
Params:
T = The return type (int or long). It defaults to time_t, which is
normally 32 bits on a 32-bit system and 64 bits on a 64-bit
system.
stdTime = The std time to convert.
Returns:
A signed integer representing the unix time which is equivalent to
the given std time.
See_Also:
SysTime.toUnixTime
+/
T stdTimeToUnixTime(T = time_t)(long stdTime) @safe pure nothrow
if (is(T == int) || is(T == long))
{
immutable unixTime = convert!("hnsecs", "seconds")(stdTime - 621_355_968_000_000_000L);
static assert(is(time_t == int) || is(time_t == long),
"Currently, std.datetime only supports systems where time_t is int or long");
static if (is(T == long))
return unixTime;
else static if (is(T == int))
{
if (unixTime > int.max)
return int.max;
return unixTime < int.min ? int.min : cast(int) unixTime;
}
else
static assert(0, "Bug in template constraint. Only int and long allowed.");
}
///
@safe unittest
{
// Midnight, January 1st, 1970 UTC
assert(stdTimeToUnixTime(621_355_968_000_000_000L) == 0);
// 2038-01-19 03:14:07 UTC
assert(stdTimeToUnixTime(642_830_804_470_000_000L) == int.max);
}
@safe unittest
{
enum unixEpochAsStdTime = (Date(1970, 1, 1) - Date.init).total!"hnsecs";
assert(stdTimeToUnixTime(unixEpochAsStdTime) == 0); // Midnight, January 1st, 1970
assert(stdTimeToUnixTime(unixEpochAsStdTime + 864_000_000_000L) == 86_400); // Midnight, January 2nd, 1970
assert(stdTimeToUnixTime(unixEpochAsStdTime - 864_000_000_000L) == -86_400); // Midnight, December 31st, 1969
assert(stdTimeToUnixTime((Date(1970, 1, 1) - Date(1, 1, 1)).total!"hnsecs") == 0);
assert(stdTimeToUnixTime((DateTime(1970, 1, 1) - DateTime(1, 1, 1)).total!"hnsecs") == 0);
foreach (dt; [DateTime(2010, 11, 1, 19, 5, 22), DateTime(1952, 7, 6, 2, 17, 9)])
assert(stdTimeToUnixTime((dt - DateTime.init).total!"hnsecs") == (dt - DateTime(1970, 1, 1)).total!"seconds");
enum max = convert!("seconds", "hnsecs")(int.max);
enum min = convert!("seconds", "hnsecs")(int.min);
enum one = convert!("seconds", "hnsecs")(1);
assert(stdTimeToUnixTime!long(unixEpochAsStdTime + max) == int.max);
assert(stdTimeToUnixTime!int(unixEpochAsStdTime + max) == int.max);
assert(stdTimeToUnixTime!long(unixEpochAsStdTime + max + one) == int.max + 1L);
assert(stdTimeToUnixTime!int(unixEpochAsStdTime + max + one) == int.max);
assert(stdTimeToUnixTime!long(unixEpochAsStdTime + max + 9_999_999) == int.max);
assert(stdTimeToUnixTime!int(unixEpochAsStdTime + max + 9_999_999) == int.max);
assert(stdTimeToUnixTime!long(unixEpochAsStdTime + min) == int.min);
assert(stdTimeToUnixTime!int(unixEpochAsStdTime + min) == int.min);
assert(stdTimeToUnixTime!long(unixEpochAsStdTime + min - one) == int.min - 1L);
assert(stdTimeToUnixTime!int(unixEpochAsStdTime + min - one) == int.min);
assert(stdTimeToUnixTime!long(unixEpochAsStdTime + min - 9_999_999) == int.min);
assert(stdTimeToUnixTime!int(unixEpochAsStdTime + min - 9_999_999) == int.min);
}
version(StdDdoc)
{
version(Windows)
{}
else
{
alias SYSTEMTIME = void*;
alias FILETIME = void*;
}
/++
$(BLUE This function is Windows-Only.)
Converts a $(D SYSTEMTIME) struct to a $(LREF SysTime).
Params:
st = The $(D SYSTEMTIME) struct to convert.
tz = The time zone that the time in the $(D SYSTEMTIME) struct is
assumed to be (if the $(D SYSTEMTIME) was supplied by a Windows
system call, the $(D SYSTEMTIME) will either be in local time
or UTC, depending on the call).
Throws:
$(REF DateTimeException,std,datetime,date) if the given
$(D SYSTEMTIME) will not fit in a $(LREF SysTime), which is highly
unlikely to happen given that $(D SysTime.max) is in 29,228 A.D. and
the maximum $(D SYSTEMTIME) is in 30,827 A.D.
+/
SysTime SYSTEMTIMEToSysTime(const SYSTEMTIME* st, immutable TimeZone tz = LocalTime()) @safe;
/++
$(BLUE This function is Windows-Only.)
Converts a $(LREF SysTime) to a $(D SYSTEMTIME) struct.
The $(D SYSTEMTIME) which is returned will be set using the given
$(LREF SysTime)'s time zone, so to get the $(D SYSTEMTIME) in
UTC, set the $(LREF SysTime)'s time zone to UTC.
Params:
sysTime = The $(LREF SysTime) to convert.
Throws:
$(REF DateTimeException,std,datetime,date) if the given
$(LREF SysTime) will not fit in a $(D SYSTEMTIME). This will only
happen if the $(LREF SysTime)'s date is prior to 1601 A.D.
+/
SYSTEMTIME SysTimeToSYSTEMTIME(in SysTime sysTime) @safe;
/++
$(BLUE This function is Windows-Only.)
Converts a $(D FILETIME) struct to the number of hnsecs since midnight,
January 1st, 1 A.D.
Params:
ft = The $(D FILETIME) struct to convert.
Throws:
$(REF DateTimeException,std,datetime,date) if the given
$(D FILETIME) cannot be represented as the return value.
+/
long FILETIMEToStdTime(scope const FILETIME* ft) @safe;
/++
$(BLUE This function is Windows-Only.)
Converts a $(D FILETIME) struct to a $(LREF SysTime).
Params:
ft = The $(D FILETIME) struct to convert.
tz = The time zone that the $(LREF SysTime) will be in
($(D FILETIME)s are in UTC).
Throws:
$(REF DateTimeException,std,datetime,date) if the given
$(D FILETIME) will not fit in a $(LREF SysTime).
+/
SysTime FILETIMEToSysTime(scope const FILETIME* ft, immutable TimeZone tz = LocalTime()) @safe;
/++
$(BLUE This function is Windows-Only.)
Converts a number of hnsecs since midnight, January 1st, 1 A.D. to a
$(D FILETIME) struct.
Params:
stdTime = The number of hnsecs since midnight, January 1st, 1 A.D.
UTC.
Throws:
$(REF DateTimeException,std,datetime,date) if the given value will
not fit in a $(D FILETIME).
+/
FILETIME stdTimeToFILETIME(long stdTime) @safe;
/++
$(BLUE This function is Windows-Only.)
Converts a $(LREF SysTime) to a $(D FILETIME) struct.
$(D FILETIME)s are always in UTC.
Params:
sysTime = The $(LREF SysTime) to convert.
Throws:
$(REF DateTimeException,std,datetime,date) if the given
$(LREF SysTime) will not fit in a $(D FILETIME).
+/
FILETIME SysTimeToFILETIME(SysTime sysTime) @safe;
}
else version(Windows)
{
SysTime SYSTEMTIMEToSysTime(const SYSTEMTIME* st, immutable TimeZone tz = LocalTime()) @safe
{
const max = SysTime.max;
static void throwLaterThanMax()
{
throw new DateTimeException("The given SYSTEMTIME is for a date greater than SysTime.max.");
}
if (st.wYear > max.year)
throwLaterThanMax();
else if (st.wYear == max.year)
{
if (st.wMonth > max.month)
throwLaterThanMax();
else if (st.wMonth == max.month)
{
if (st.wDay > max.day)
throwLaterThanMax();
else if (st.wDay == max.day)
{
if (st.wHour > max.hour)
throwLaterThanMax();
else if (st.wHour == max.hour)
{
if (st.wMinute > max.minute)
throwLaterThanMax();
else if (st.wMinute == max.minute)
{
if (st.wSecond > max.second)
throwLaterThanMax();
else if (st.wSecond == max.second)
{
if (st.wMilliseconds > max.fracSecs.total!"msecs")
throwLaterThanMax();
}
}
}
}
}
}
auto dt = DateTime(st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
import core.time : msecs;
return SysTime(dt, msecs(st.wMilliseconds), tz);
}
@system unittest
{
auto sysTime = Clock.currTime(UTC());
SYSTEMTIME st = void;
GetSystemTime(&st);
auto converted = SYSTEMTIMEToSysTime(&st, UTC());
import core.time : abs;
assert(abs((converted - sysTime)) <= dur!"seconds"(2));
}
SYSTEMTIME SysTimeToSYSTEMTIME(in SysTime sysTime) @safe
{
immutable dt = cast(DateTime) sysTime;
if (dt.year < 1601)
throw new DateTimeException("SYSTEMTIME cannot hold dates prior to the year 1601.");
SYSTEMTIME st;
st.wYear = dt.year;
st.wMonth = dt.month;
st.wDayOfWeek = dt.dayOfWeek;
st.wDay = dt.day;
st.wHour = dt.hour;
st.wMinute = dt.minute;
st.wSecond = dt.second;
st.wMilliseconds = cast(ushort) sysTime.fracSecs.total!"msecs";
return st;
}
@system unittest
{
SYSTEMTIME st = void;
GetSystemTime(&st);
auto sysTime = SYSTEMTIMEToSysTime(&st, UTC());
SYSTEMTIME result = SysTimeToSYSTEMTIME(sysTime);
assert(st.wYear == result.wYear);
assert(st.wMonth == result.wMonth);
assert(st.wDayOfWeek == result.wDayOfWeek);
assert(st.wDay == result.wDay);
assert(st.wHour == result.wHour);
assert(st.wMinute == result.wMinute);
assert(st.wSecond == result.wSecond);
assert(st.wMilliseconds == result.wMilliseconds);
}
private enum hnsecsFrom1601 = 504_911_232_000_000_000L;
long FILETIMEToStdTime(scope const FILETIME* ft) @safe
{
ULARGE_INTEGER ul;
ul.HighPart = ft.dwHighDateTime;
ul.LowPart = ft.dwLowDateTime;
ulong tempHNSecs = ul.QuadPart;
if (tempHNSecs > long.max - hnsecsFrom1601)
throw new DateTimeException("The given FILETIME cannot be represented as a stdTime value.");
return cast(long) tempHNSecs + hnsecsFrom1601;
}
SysTime FILETIMEToSysTime(scope const FILETIME* ft, immutable TimeZone tz = LocalTime()) @safe
{
auto sysTime = SysTime(FILETIMEToStdTime(ft), UTC());
sysTime.timezone = tz;
return sysTime;
}
@system unittest
{
auto sysTime = Clock.currTime(UTC());
SYSTEMTIME st = void;
GetSystemTime(&st);
FILETIME ft = void;
SystemTimeToFileTime(&st, &ft);
auto converted = FILETIMEToSysTime(&ft);
import core.time : abs;
assert(abs((converted - sysTime)) <= dur!"seconds"(2));
}
FILETIME stdTimeToFILETIME(long stdTime) @safe
{
if (stdTime < hnsecsFrom1601)
throw new DateTimeException("The given stdTime value cannot be represented as a FILETIME.");
ULARGE_INTEGER ul;
ul.QuadPart = cast(ulong) stdTime - hnsecsFrom1601;
FILETIME ft;
ft.dwHighDateTime = ul.HighPart;
ft.dwLowDateTime = ul.LowPart;
return ft;
}
FILETIME SysTimeToFILETIME(SysTime sysTime) @safe
{
return stdTimeToFILETIME(sysTime.stdTime);
}
@system unittest
{
SYSTEMTIME st = void;
GetSystemTime(&st);
FILETIME ft = void;
SystemTimeToFileTime(&st, &ft);
auto sysTime = FILETIMEToSysTime(&ft, UTC());
FILETIME result = SysTimeToFILETIME(sysTime);
assert(ft.dwLowDateTime == result.dwLowDateTime);
assert(ft.dwHighDateTime == result.dwHighDateTime);
}
}
/++
Type representing the DOS file date/time format.
+/
alias DosFileTime = uint;
/++
Converts from DOS file date/time to $(LREF SysTime).
Params:
dft = The DOS file time to convert.
tz = The time zone which the DOS file time is assumed to be in.
Throws:
$(REF DateTimeException,std,datetime,date) if the $(D DosFileTime) is
invalid.
+/
SysTime DosFileTimeToSysTime(DosFileTime dft, immutable TimeZone tz = LocalTime()) @safe
{
uint dt = cast(uint) dft;
if (dt == 0)
throw new DateTimeException("Invalid DosFileTime.");
int year = ((dt >> 25) & 0x7F) + 1980;
int month = ((dt >> 21) & 0x0F); // 1 .. 12
int dayOfMonth = ((dt >> 16) & 0x1F); // 1 .. 31
int hour = (dt >> 11) & 0x1F; // 0 .. 23
int minute = (dt >> 5) & 0x3F; // 0 .. 59
int second = (dt << 1) & 0x3E; // 0 .. 58 (in 2 second increments)
try
return SysTime(DateTime(year, month, dayOfMonth, hour, minute, second), tz);
catch (DateTimeException dte)
throw new DateTimeException("Invalid DosFileTime", __FILE__, __LINE__, dte);
}
@safe unittest
{
assert(DosFileTimeToSysTime(0b00000000001000010000000000000000) == SysTime(DateTime(1980, 1, 1, 0, 0, 0)));
assert(DosFileTimeToSysTime(0b11111111100111111011111101111101) == SysTime(DateTime(2107, 12, 31, 23, 59, 58)));
assert(DosFileTimeToSysTime(0x3E3F8456) == SysTime(DateTime(2011, 1, 31, 16, 34, 44)));
}
/++
Converts from $(LREF SysTime) to DOS file date/time.
Params:
sysTime = The $(LREF SysTime) to convert.
Throws:
$(REF DateTimeException,std,datetime,date) if the given
$(LREF SysTime) cannot be converted to a $(D DosFileTime).
+/
DosFileTime SysTimeToDosFileTime(SysTime sysTime) @safe
{
auto dateTime = cast(DateTime) sysTime;
if (dateTime.year < 1980)
throw new DateTimeException("DOS File Times cannot hold dates prior to 1980.");
if (dateTime.year > 2107)
throw new DateTimeException("DOS File Times cannot hold dates past 2107.");
uint retval = 0;
retval = (dateTime.year - 1980) << 25;
retval |= (dateTime.month & 0x0F) << 21;
retval |= (dateTime.day & 0x1F) << 16;
retval |= (dateTime.hour & 0x1F) << 11;
retval |= (dateTime.minute & 0x3F) << 5;
retval |= (dateTime.second >> 1) & 0x1F;
return cast(DosFileTime) retval;
}
@safe unittest
{
assert(SysTimeToDosFileTime(SysTime(DateTime(1980, 1, 1, 0, 0, 0))) == 0b00000000001000010000000000000000);
assert(SysTimeToDosFileTime(SysTime(DateTime(2107, 12, 31, 23, 59, 58))) == 0b11111111100111111011111101111101);
assert(SysTimeToDosFileTime(SysTime(DateTime(2011, 1, 31, 16, 34, 44))) == 0x3E3F8456);
}
/++
The given array of $(D char) or random-access range of $(D char) or
$(D ubyte) is expected to be in the format specified in
$(HTTP tools.ietf.org/html/rfc5322, RFC 5322) section 3.3 with the
grammar rule $(I date-time). It is the date-time format commonly used in
internet messages such as e-mail and HTTP. The corresponding
$(LREF SysTime) will be returned.
RFC 822 was the original spec (hence the function's name), whereas RFC 5322
is the current spec.
The day of the week is ignored beyond verifying that it's a valid day of the
week, as the day of the week can be inferred from the date. It is not
checked whether the given day of the week matches the actual day of the week
of the given date (though it is technically invalid per the spec if the
day of the week doesn't match the actual day of the week of the given date).
If the time zone is $(D "-0000") (or considered to be equivalent to
$(D "-0000") by section 4.3 of the spec), a
$(REF SimpleTimeZone,std,datetime,timezone) with a utc offset of $(D 0) is
used rather than $(REF UTC,std,datetime,timezone), whereas $(D "+0000") uses
$(REF UTC,std,datetime,timezone).
Note that because $(LREF SysTime) does not currently support having a second
value of 60 (as is sometimes done for leap seconds), if the date-time value
does have a value of 60 for the seconds, it is treated as 59.
The one area in which this function violates RFC 5322 is that it accepts
$(D "\n") in folding whitespace in the place of $(D "\r\n"), because the
HTTP spec requires it.
Throws:
$(REF DateTimeException,std,datetime,date) if the given string doesn't
follow the grammar for a date-time field or if the resulting
$(LREF SysTime) is invalid.
+/
SysTime parseRFC822DateTime()(in char[] value) @safe
{
import std.string : representation;
return parseRFC822DateTime(value.representation);
}
/++ Ditto +/
SysTime parseRFC822DateTime(R)(R value) @safe
if (isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
(is(Unqual!(ElementType!R) == char) || is(Unqual!(ElementType!R) == ubyte)))
{
import std.algorithm.searching : find, all;
import std.ascii : isDigit, isAlpha, isPrintable;
import std.conv : to;
import std.functional : not;
import std.string : capitalize, format;
import std.traits : EnumMembers, isArray;
import std.typecons : Rebindable;
void stripAndCheckLen(R valueBefore, size_t minLen, size_t line = __LINE__)
{
value = _stripCFWS(valueBefore);
if (value.length < minLen)
throw new DateTimeException("date-time value too short", __FILE__, line);
}
stripAndCheckLen(value, "7Dec1200:00A".length);
static if (isArray!R && (is(ElementEncodingType!R == char) || is(ElementEncodingType!R == ubyte)))
{
static string sliceAsString(R str) @trusted
{
return cast(string) str;
}
}
else
{
char[4] temp;
char[] sliceAsString(R str) @trusted
{
size_t i = 0;
foreach (c; str)
temp[i++] = cast(char) c;
return temp[0 .. str.length];
}
}
// day-of-week
if (isAlpha(value[0]))
{
auto dowStr = sliceAsString(value[0 .. 3]);
switch (dowStr)
{
foreach (dow; EnumMembers!DayOfWeek)
{
enum dowC = capitalize(to!string(dow));
case dowC:
goto afterDoW;
}
default: throw new DateTimeException(format("Invalid day-of-week: %s", dowStr));
}
afterDoW: stripAndCheckLen(value[3 .. value.length], ",7Dec1200:00A".length);
if (value[0] != ',')
throw new DateTimeException("day-of-week missing comma");
stripAndCheckLen(value[1 .. value.length], "7Dec1200:00A".length);
}
// day
immutable digits = isDigit(value[1]) ? 2 : 1;
immutable day = _convDigits!short(value[0 .. digits]);
if (day == -1)
throw new DateTimeException("Invalid day");
stripAndCheckLen(value[digits .. value.length], "Dec1200:00A".length);
// month
Month month;
{
auto monStr = sliceAsString(value[0 .. 3]);
switch (monStr)
{
foreach (mon; EnumMembers!Month)
{
enum monC = capitalize(to!string(mon));
case monC:
{
month = mon;
goto afterMon;
}
}
default: throw new DateTimeException(format("Invalid month: %s", monStr));
}
afterMon: stripAndCheckLen(value[3 .. value.length], "1200:00A".length);
}
// year
auto found = value[2 .. value.length].find!(not!(std.ascii.isDigit))();
size_t yearLen = value.length - found.length;
if (found.length == 0)
throw new DateTimeException("Invalid year");
if (found[0] == ':')
yearLen -= 2;
auto year = _convDigits!short(value[0 .. yearLen]);
if (year < 1900)
{
if (year == -1)
throw new DateTimeException("Invalid year");
if (yearLen < 4)
{
if (yearLen == 3)
year += 1900;
else if (yearLen == 2)
year += year < 50 ? 2000 : 1900;
else
throw new DateTimeException("Invalid year. Too few digits.");
}
else
throw new DateTimeException("Invalid year. Cannot be earlier than 1900.");
}
stripAndCheckLen(value[yearLen .. value.length], "00:00A".length);
// hour
immutable hour = _convDigits!short(value[0 .. 2]);
stripAndCheckLen(value[2 .. value.length], ":00A".length);
if (value[0] != ':')
throw new DateTimeException("Invalid hour");
stripAndCheckLen(value[1 .. value.length], "00A".length);
// minute
immutable minute = _convDigits!short(value[0 .. 2]);
stripAndCheckLen(value[2 .. value.length], "A".length);
// second
short second;
if (value[0] == ':')
{
stripAndCheckLen(value[1 .. value.length], "00A".length);
second = _convDigits!short(value[0 .. 2]);
// this is just if/until SysTime is sorted out to fully support leap seconds
if (second == 60)
second = 59;
stripAndCheckLen(value[2 .. value.length], "A".length);
}
immutable(TimeZone) parseTZ(int sign)
{
if (value.length < 5)
throw new DateTimeException("Invalid timezone");
immutable zoneHours = _convDigits!short(value[1 .. 3]);
immutable zoneMinutes = _convDigits!short(value[3 .. 5]);
if (zoneHours == -1 || zoneMinutes == -1 || zoneMinutes > 59)
throw new DateTimeException("Invalid timezone");
value = value[5 .. value.length];
immutable utcOffset = (dur!"hours"(zoneHours) + dur!"minutes"(zoneMinutes)) * sign;
if (utcOffset == Duration.zero)
{
return sign == 1 ? cast(immutable(TimeZone))UTC()
: cast(immutable(TimeZone))new immutable SimpleTimeZone(Duration.zero);
}
return new immutable(SimpleTimeZone)(utcOffset);
}
// zone
Rebindable!(immutable TimeZone) tz;
if (value[0] == '-')
tz = parseTZ(-1);
else if (value[0] == '+')
tz = parseTZ(1);
else
{
// obs-zone
immutable tzLen = value.length - find(value, ' ', '\t', '(')[0].length;
switch (sliceAsString(value[0 .. tzLen <= 4 ? tzLen : 4]))
{
case "UT": case "GMT": tz = UTC(); break;
case "EST": tz = new immutable SimpleTimeZone(dur!"hours"(-5)); break;
case "EDT": tz = new immutable SimpleTimeZone(dur!"hours"(-4)); break;
case "CST": tz = new immutable SimpleTimeZone(dur!"hours"(-6)); break;
case "CDT": tz = new immutable SimpleTimeZone(dur!"hours"(-5)); break;
case "MST": tz = new immutable SimpleTimeZone(dur!"hours"(-7)); break;
case "MDT": tz = new immutable SimpleTimeZone(dur!"hours"(-6)); break;
case "PST": tz = new immutable SimpleTimeZone(dur!"hours"(-8)); break;
case "PDT": tz = new immutable SimpleTimeZone(dur!"hours"(-7)); break;
case "J": case "j": throw new DateTimeException("Invalid timezone");
default:
{
if (all!(std.ascii.isAlpha)(value[0 .. tzLen]))
{
tz = new immutable SimpleTimeZone(Duration.zero);
break;
}
throw new DateTimeException("Invalid timezone");
}
}
value = value[tzLen .. value.length];
}
// This is kind of arbitrary. Technically, nothing but CFWS is legal past
// the end of the timezone, but we don't want to be picky about that in a
// function that's just parsing rather than validating. So, the idea here is
// that if the next character is printable (and not part of CFWS), then it
// might be part of the timezone and thus affect what the timezone was
// supposed to be, so we'll throw, but otherwise, we'll just ignore it.
if (!value.empty && isPrintable(value[0]) && value[0] != ' ' && value[0] != '(')
throw new DateTimeException("Invalid timezone");
try
return SysTime(DateTime(year, month, day, hour, minute, second), tz);
catch (DateTimeException dte)
throw new DateTimeException("date-time format is correct, but the resulting SysTime is invalid.", dte);
}
///
@safe unittest
{
import core.time : hours;
import std.datetime.date : DateTime, DateTimeException;
import std.datetime.timezone : SimpleTimeZone, UTC;
import std.exception : assertThrown;
auto tz = new immutable SimpleTimeZone(hours(-8));
assert(parseRFC822DateTime("Sat, 6 Jan 1990 12:14:19 -0800") ==
SysTime(DateTime(1990, 1, 6, 12, 14, 19), tz));
assert(parseRFC822DateTime("9 Jul 2002 13:11 +0000") ==
SysTime(DateTime(2002, 7, 9, 13, 11, 0), UTC()));
auto badStr = "29 Feb 2001 12:17:16 +0200";
assertThrown!DateTimeException(parseRFC822DateTime(badStr));
}
version(unittest) void testParse822(alias cr)(string str, SysTime expected, size_t line = __LINE__)
{
import std.format : format;
auto value = cr(str);
auto result = parseRFC822DateTime(value);
if (result != expected)
throw new AssertError(format("wrong result. expected [%s], actual[%s]", expected, result), __FILE__, line);
}
version(unittest) void testBadParse822(alias cr)(string str, size_t line = __LINE__)
{
try
parseRFC822DateTime(cr(str));
catch (DateTimeException)
return;
throw new AssertError("No DateTimeException was thrown", __FILE__, line);
}
@system unittest
{
import core.time;
import std.algorithm.iteration : filter, map;
import std.algorithm.searching : canFind;
import std.array : array;
import std.ascii : letters;
import std.format : format;
import std.meta : AliasSeq;
import std.range : chain, iota, take;
import std.stdio : writefln, writeln;
import std.string : representation;
static struct Rand3Letters
{
enum empty = false;
@property auto front() { return _mon; }
void popFront()
{
import std.exception : assumeUnique;
import std.random : rndGen;
_mon = rndGen.map!(a => letters[a % letters.length])().take(3).array().assumeUnique();
}
string _mon;
static auto start() { Rand3Letters retval; retval.popFront(); return retval; }
}
static foreach (cr; AliasSeq!(function(string a){return cast(char[]) a;},
function(string a){return cast(ubyte[]) a;},
function(string a){return a;},
function(string a){return map!(b => cast(char) b)(a.representation);}))
{{
scope(failure) writeln(typeof(cr).stringof);
alias test = testParse822!cr;
alias testBad = testBadParse822!cr;
immutable std1 = DateTime(2012, 12, 21, 13, 14, 15);
immutable std2 = DateTime(2012, 12, 21, 13, 14, 0);
immutable dst1 = DateTime(1976, 7, 4, 5, 4, 22);
immutable dst2 = DateTime(1976, 7, 4, 5, 4, 0);
test("21 Dec 2012 13:14:15 +0000", SysTime(std1, UTC()));
test("21 Dec 2012 13:14 +0000", SysTime(std2, UTC()));
test("Fri, 21 Dec 2012 13:14 +0000", SysTime(std2, UTC()));
test("Fri, 21 Dec 2012 13:14:15 +0000", SysTime(std1, UTC()));
test("04 Jul 1976 05:04:22 +0000", SysTime(dst1, UTC()));
test("04 Jul 1976 05:04 +0000", SysTime(dst2, UTC()));
test("Sun, 04 Jul 1976 05:04 +0000", SysTime(dst2, UTC()));
test("Sun, 04 Jul 1976 05:04:22 +0000", SysTime(dst1, UTC()));
test("4 Jul 1976 05:04:22 +0000", SysTime(dst1, UTC()));
test("4 Jul 1976 05:04 +0000", SysTime(dst2, UTC()));
test("Sun, 4 Jul 1976 05:04 +0000", SysTime(dst2, UTC()));
test("Sun, 4 Jul 1976 05:04:22 +0000", SysTime(dst1, UTC()));
auto badTZ = new immutable SimpleTimeZone(Duration.zero);
test("21 Dec 2012 13:14:15 -0000", SysTime(std1, badTZ));
test("21 Dec 2012 13:14 -0000", SysTime(std2, badTZ));
test("Fri, 21 Dec 2012 13:14 -0000", SysTime(std2, badTZ));
test("Fri, 21 Dec 2012 13:14:15 -0000", SysTime(std1, badTZ));
test("04 Jul 1976 05:04:22 -0000", SysTime(dst1, badTZ));
test("04 Jul 1976 05:04 -0000", SysTime(dst2, badTZ));
test("Sun, 04 Jul 1976 05:04 -0000", SysTime(dst2, badTZ));
test("Sun, 04 Jul 1976 05:04:22 -0000", SysTime(dst1, badTZ));
test("4 Jul 1976 05:04:22 -0000", SysTime(dst1, badTZ));
test("4 Jul 1976 05:04 -0000", SysTime(dst2, badTZ));
test("Sun, 4 Jul 1976 05:04 -0000", SysTime(dst2, badTZ));
test("Sun, 4 Jul 1976 05:04:22 -0000", SysTime(dst1, badTZ));
auto pst = new immutable SimpleTimeZone(dur!"hours"(-8));
auto pdt = new immutable SimpleTimeZone(dur!"hours"(-7));
test("21 Dec 2012 13:14:15 -0800", SysTime(std1, pst));
test("21 Dec 2012 13:14 -0800", SysTime(std2, pst));
test("Fri, 21 Dec 2012 13:14 -0800", SysTime(std2, pst));
test("Fri, 21 Dec 2012 13:14:15 -0800", SysTime(std1, pst));
test("04 Jul 1976 05:04:22 -0700", SysTime(dst1, pdt));
test("04 Jul 1976 05:04 -0700", SysTime(dst2, pdt));
test("Sun, 04 Jul 1976 05:04 -0700", SysTime(dst2, pdt));
test("Sun, 04 Jul 1976 05:04:22 -0700", SysTime(dst1, pdt));
test("4 Jul 1976 05:04:22 -0700", SysTime(dst1, pdt));
test("4 Jul 1976 05:04 -0700", SysTime(dst2, pdt));
test("Sun, 4 Jul 1976 05:04 -0700", SysTime(dst2, pdt));
test("Sun, 4 Jul 1976 05:04:22 -0700", SysTime(dst1, pdt));
auto cet = new immutable SimpleTimeZone(dur!"hours"(1));
auto cest = new immutable SimpleTimeZone(dur!"hours"(2));
test("21 Dec 2012 13:14:15 +0100", SysTime(std1, cet));
test("21 Dec 2012 13:14 +0100", SysTime(std2, cet));
test("Fri, 21 Dec 2012 13:14 +0100", SysTime(std2, cet));
test("Fri, 21 Dec 2012 13:14:15 +0100", SysTime(std1, cet));
test("04 Jul 1976 05:04:22 +0200", SysTime(dst1, cest));
test("04 Jul 1976 05:04 +0200", SysTime(dst2, cest));
test("Sun, 04 Jul 1976 05:04 +0200", SysTime(dst2, cest));
test("Sun, 04 Jul 1976 05:04:22 +0200", SysTime(dst1, cest));
test("4 Jul 1976 05:04:22 +0200", SysTime(dst1, cest));
test("4 Jul 1976 05:04 +0200", SysTime(dst2, cest));
test("Sun, 4 Jul 1976 05:04 +0200", SysTime(dst2, cest));
test("Sun, 4 Jul 1976 05:04:22 +0200", SysTime(dst1, cest));
// dst and std times are switched in the Southern Hemisphere which is why the
// time zone names and DateTime variables don't match.
auto cstStd = new immutable SimpleTimeZone(dur!"hours"(9) + dur!"minutes"(30));
auto cstDST = new immutable SimpleTimeZone(dur!"hours"(10) + dur!"minutes"(30));
test("21 Dec 2012 13:14:15 +1030", SysTime(std1, cstDST));
test("21 Dec 2012 13:14 +1030", SysTime(std2, cstDST));
test("Fri, 21 Dec 2012 13:14 +1030", SysTime(std2, cstDST));
test("Fri, 21 Dec 2012 13:14:15 +1030", SysTime(std1, cstDST));
test("04 Jul 1976 05:04:22 +0930", SysTime(dst1, cstStd));
test("04 Jul 1976 05:04 +0930", SysTime(dst2, cstStd));
test("Sun, 04 Jul 1976 05:04 +0930", SysTime(dst2, cstStd));
test("Sun, 04 Jul 1976 05:04:22 +0930", SysTime(dst1, cstStd));
test("4 Jul 1976 05:04:22 +0930", SysTime(dst1, cstStd));
test("4 Jul 1976 05:04 +0930", SysTime(dst2, cstStd));
test("Sun, 4 Jul 1976 05:04 +0930", SysTime(dst2, cstStd));
test("Sun, 4 Jul 1976 05:04:22 +0930", SysTime(dst1, cstStd));
foreach (int i, mon; _monthNames)
{
test(format("17 %s 2012 00:05:02 +0000", mon), SysTime(DateTime(2012, i + 1, 17, 0, 5, 2), UTC()));
test(format("17 %s 2012 00:05 +0000", mon), SysTime(DateTime(2012, i + 1, 17, 0, 5, 0), UTC()));
}
import std.uni : toLower, toUpper;
foreach (mon; chain(_monthNames[].map!(a => toLower(a))(),
_monthNames[].map!(a => toUpper(a))(),
["Jam", "Jen", "Fec", "Fdb", "Mas", "Mbr", "Aps", "Aqr", "Mai", "Miy",
"Jum", "Jbn", "Jup", "Jal", "Aur", "Apg", "Sem", "Sap", "Ocm", "Odt",
"Nom", "Nav", "Dem", "Dac"],
Rand3Letters.start().filter!(a => !_monthNames[].canFind(a)).take(20)))
{
scope(failure) writefln("Month: %s", mon);
testBad(format("17 %s 2012 00:05:02 +0000", mon));
testBad(format("17 %s 2012 00:05 +0000", mon));
}
immutable string[7] daysOfWeekNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
{
auto start = SysTime(DateTime(2012, 11, 11, 9, 42, 0), UTC());
int day = 11;
foreach (int i, dow; daysOfWeekNames)
{
auto curr = start + dur!"days"(i);
test(format("%s, %s Nov 2012 09:42:00 +0000", dow, day), curr);
test(format("%s, %s Nov 2012 09:42 +0000", dow, day++), curr);
// Whether the day of the week matches the date is ignored.
test(format("%s, 11 Nov 2012 09:42:00 +0000", dow), start);
test(format("%s, 11 Nov 2012 09:42 +0000", dow), start);
}
}
foreach (dow; chain(daysOfWeekNames[].map!(a => toLower(a))(),
daysOfWeekNames[].map!(a => toUpper(a))(),
["Sum", "Spn", "Mom", "Man", "Tuf", "Tae", "Wem", "Wdd", "The", "Tur",
"Fro", "Fai", "San", "Sut"],
Rand3Letters.start().filter!(a => !daysOfWeekNames[].canFind(a)).take(20)))
{
scope(failure) writefln("Day of Week: %s", dow);
testBad(format("%s, 11 Nov 2012 09:42:00 +0000", dow));
testBad(format("%s, 11 Nov 2012 09:42 +0000", dow));
}
testBad("31 Dec 1899 23:59:59 +0000");
test("01 Jan 1900 00:00:00 +0000", SysTime(Date(1900, 1, 1), UTC()));
test("01 Jan 1900 00:00:00 -0000", SysTime(Date(1900, 1, 1),
new immutable SimpleTimeZone(Duration.zero)));
test("01 Jan 1900 00:00:00 -0700", SysTime(Date(1900, 1, 1),
new immutable SimpleTimeZone(dur!"hours"(-7))));
{
auto st1 = SysTime(Date(1900, 1, 1), UTC());
auto st2 = SysTime(Date(1900, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-11)));
foreach (i; 1900 .. 2102)
{
test(format("1 Jan %05d 00:00 +0000", i), st1);
test(format("1 Jan %05d 00:00 -1100", i), st2);
st1.add!"years"(1);
st2.add!"years"(1);
}
st1.year = 9998;
st2.year = 9998;
foreach (i; 9998 .. 11_002)
{
test(format("1 Jan %05d 00:00 +0000", i), st1);
test(format("1 Jan %05d 00:00 -1100", i), st2);
st1.add!"years"(1);
st2.add!"years"(1);
}
}
testBad("12 Feb 1907 23:17:09 0000");
testBad("12 Feb 1907 23:17:09 +000");
testBad("12 Feb 1907 23:17:09 -000");
testBad("12 Feb 1907 23:17:09 +00000");
testBad("12 Feb 1907 23:17:09 -00000");
testBad("12 Feb 1907 23:17:09 +A");
testBad("12 Feb 1907 23:17:09 +PST");
testBad("12 Feb 1907 23:17:09 -A");
testBad("12 Feb 1907 23:17:09 -PST");
// test trailing stuff that gets ignored
{
foreach (c; chain(iota(0, 33), ['('], iota(127, ubyte.max + 1)))
{
scope(failure) writefln("c: %d", c);
test(format("21 Dec 2012 13:14:15 +0000%c", cast(char) c), SysTime(std1, UTC()));
test(format("21 Dec 2012 13:14:15 +0000%c ", cast(char) c), SysTime(std1, UTC()));
test(format("21 Dec 2012 13:14:15 +0000%chello", cast(char) c), SysTime(std1, UTC()));
}
}
// test trailing stuff that doesn't get ignored
{
foreach (c; chain(iota(33, '('), iota('(' + 1, 127)))
{
scope(failure) writefln("c: %d", c);
testBad(format("21 Dec 2012 13:14:15 +0000%c", cast(char) c));
testBad(format("21 Dec 2012 13:14:15 +0000%c ", cast(char) c));
testBad(format("21 Dec 2012 13:14:15 +0000%chello", cast(char) c));
}
}
testBad("32 Jan 2012 12:13:14 -0800");
testBad("31 Jan 2012 24:13:14 -0800");
testBad("31 Jan 2012 12:60:14 -0800");
testBad("31 Jan 2012 12:13:61 -0800");
testBad("31 Jan 2012 12:13:14 -0860");
test("31 Jan 2012 12:13:14 -0859",
SysTime(DateTime(2012, 1, 31, 12, 13, 14),
new immutable SimpleTimeZone(dur!"hours"(-8) + dur!"minutes"(-59))));
// leap-seconds
test("21 Dec 2012 15:59:60 -0800", SysTime(DateTime(2012, 12, 21, 15, 59, 59), pst));
// FWS
test("Sun,4 Jul 1976 05:04 +0930", SysTime(dst2, cstStd));
test("Sun,4 Jul 1976 05:04:22 +0930", SysTime(dst1, cstStd));
test("Sun,4 Jul 1976 05:04 +0930 (foo)", SysTime(dst2, cstStd));
test("Sun,4 Jul 1976 05:04:22 +0930 (foo)", SysTime(dst1, cstStd));
test("Sun,4 \r\n Jul \r\n 1976 \r\n 05:04 \r\n +0930 \r\n (foo)", SysTime(dst2, cstStd));
test("Sun,4 \r\n Jul \r\n 1976 \r\n 05:04:22 \r\n +0930 \r\n (foo)", SysTime(dst1, cstStd));
auto str = "01 Jan 2012 12:13:14 -0800 ";
test(str, SysTime(DateTime(2012, 1, 1, 12, 13, 14), new immutable SimpleTimeZone(hours(-8))));
foreach (i; 0 .. str.length)
{
auto currStr = str.dup;
currStr[i] = 'x';
scope(failure) writefln("failed: %s", currStr);
testBad(cast(string) currStr);
}
foreach (i; 2 .. str.length)
{
auto currStr = str[0 .. $ - i];
scope(failure) writefln("failed: %s", currStr);
testBad(cast(string) currStr);
testBad((cast(string) currStr) ~ " ");
}
}}
}
// Obsolete Format per section 4.3 of RFC 5322.
@system unittest
{
import std.algorithm.iteration : filter, map;
import std.ascii : letters;
import std.exception : collectExceptionMsg;
import std.format : format;
import std.meta : AliasSeq;
import std.range : chain, iota;
import std.stdio : writefln, writeln;
import std.string : representation;
auto std1 = SysTime(DateTime(2012, 12, 21, 13, 14, 15), UTC());
auto std2 = SysTime(DateTime(2012, 12, 21, 13, 14, 0), UTC());
auto std3 = SysTime(DateTime(1912, 12, 21, 13, 14, 15), UTC());
auto std4 = SysTime(DateTime(1912, 12, 21, 13, 14, 0), UTC());
auto dst1 = SysTime(DateTime(1976, 7, 4, 5, 4, 22), UTC());
auto dst2 = SysTime(DateTime(1976, 7, 4, 5, 4, 0), UTC());
auto tooLate1 = SysTime(Date(10_000, 1, 1), UTC());
auto tooLate2 = SysTime(DateTime(12_007, 12, 31, 12, 22, 19), UTC());
static foreach (cr; AliasSeq!(function(string a){return cast(char[]) a;},
function(string a){return cast(ubyte[]) a;},
function(string a){return a;},
function(string a){return map!(b => cast(char) b)(a.representation);}))
{{
scope(failure) writeln(typeof(cr).stringof);
alias test = testParse822!cr;
{
auto list = ["", " ", " \r\n\t", "\t\r\n (hello world( frien(dog)) silly \r\n ) \t\t \r\n ()",
" \n ", "\t\n\t", " \n\t (foo) \n (bar) \r\n (baz) \n "];
foreach (i, cfws; list)
{
scope(failure) writefln("i: %s", i);
test(format("%1$s21%1$sDec%1$s2012%1$s13:14:15%1$s+0000%1$s", cfws), std1);
test(format("%1$s21%1$sDec%1$s2012%1$s13:14%1$s+0000%1$s", cfws), std2);
test(format("%1$sFri%1$s,%1$s21%1$sDec%1$s2012%1$s13:14%1$s+0000%1$s", cfws), std2);
test(format("%1$sFri%1$s,%1$s21%1$sDec%1$s2012%1$s13:14:15%1$s+0000%1$s", cfws), std1);
test(format("%1$s04%1$sJul%1$s1976%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s04%1$sJul%1$s1976%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s04%1$sJul%1$s1976%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s04%1$sJul%1$s1976%1$s05:04:22 +0000%1$s", cfws), dst1);
test(format("%1$s4%1$sJul%1$s1976%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s4%1$sJul%1$s1976%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s4%1$sJul%1$s1976%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s4%1$sJul%1$s1976%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s21%1$sDec%1$s12%1$s13:14:15%1$s+0000%1$s", cfws), std1);
test(format("%1$s21%1$sDec%1$s12%1$s13:14%1$s+0000%1$s", cfws), std2);
test(format("%1$sFri%1$s,%1$s21%1$sDec%1$s12%1$s13:14%1$s+0000%1$s", cfws), std2);
test(format("%1$sFri%1$s,%1$s21%1$sDec%1$s12%1$s13:14:15%1$s+0000%1$s", cfws), std1);
test(format("%1$s04%1$sJul%1$s76%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s04%1$sJul%1$s76%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s04%1$sJul%1$s76%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s04%1$sJul%1$s76%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s4%1$sJul%1$s76 05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s4%1$sJul%1$s76 05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s4%1$sJul%1$s76%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s4%1$sJul%1$s76%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s21%1$sDec%1$s012%1$s13:14:15%1$s+0000%1$s", cfws), std3);
test(format("%1$s21%1$sDec%1$s012%1$s13:14%1$s+0000%1$s", cfws), std4);
test(format("%1$sFri%1$s,%1$s21%1$sDec%1$s012%1$s13:14%1$s+0000%1$s", cfws), std4);
test(format("%1$sFri%1$s,%1$s21%1$sDec%1$s012%1$s13:14:15%1$s+0000%1$s", cfws), std3);
test(format("%1$s04%1$sJul%1$s076%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s04%1$sJul%1$s076%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s04%1$sJul%1$s076%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s04%1$sJul%1$s076%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s4%1$sJul%1$s076%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s4%1$sJul%1$s076%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s4%1$sJul%1$s076%1$s05:04%1$s+0000%1$s", cfws), dst2);
test(format("%1$sSun%1$s,%1$s4%1$sJul%1$s076%1$s05:04:22%1$s+0000%1$s", cfws), dst1);
test(format("%1$s1%1$sJan%1$s10000%1$s00:00:00%1$s+0000%1$s", cfws), tooLate1);
test(format("%1$s31%1$sDec%1$s12007%1$s12:22:19%1$s+0000%1$s", cfws), tooLate2);
test(format("%1$sSat%1$s,%1$s1%1$sJan%1$s10000%1$s00:00:00%1$s+0000%1$s", cfws), tooLate1);
test(format("%1$sSun%1$s,%1$s31%1$sDec%1$s12007%1$s12:22:19%1$s+0000%1$s", cfws), tooLate2);
}
}
// test years of 1, 2, and 3 digits.
{
auto st1 = SysTime(Date(2000, 1, 1), UTC());
auto st2 = SysTime(Date(2000, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-12)));
foreach (i; 0 .. 50)
{
test(format("1 Jan %02d 00:00 GMT", i), st1);
test(format("1 Jan %02d 00:00 -1200", i), st2);
st1.add!"years"(1);
st2.add!"years"(1);
}
}
{
auto st1 = SysTime(Date(1950, 1, 1), UTC());
auto st2 = SysTime(Date(1950, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-12)));
foreach (i; 50 .. 100)
{
test(format("1 Jan %02d 00:00 GMT", i), st1);
test(format("1 Jan %02d 00:00 -1200", i), st2);
st1.add!"years"(1);
st2.add!"years"(1);
}
}
{
auto st1 = SysTime(Date(1900, 1, 1), UTC());
auto st2 = SysTime(Date(1900, 1, 1), new immutable SimpleTimeZone(dur!"hours"(-11)));
foreach (i; 0 .. 1000)
{
test(format("1 Jan %03d 00:00 GMT", i), st1);
test(format("1 Jan %03d 00:00 -1100", i), st2);
st1.add!"years"(1);
st2.add!"years"(1);
}
}
foreach (i; 0 .. 10)
{
auto str1 = cr(format("1 Jan %d 00:00 GMT", i));
auto str2 = cr(format("1 Jan %d 00:00 -1200", i));
assertThrown!DateTimeException(parseRFC822DateTime(str1));
assertThrown!DateTimeException(parseRFC822DateTime(str1));
}
// test time zones
{
auto dt = DateTime(1982, 05, 03, 12, 22, 04);
test("Wed, 03 May 1982 12:22:04 UT", SysTime(dt, UTC()));
test("Wed, 03 May 1982 12:22:04 GMT", SysTime(dt, UTC()));
test("Wed, 03 May 1982 12:22:04 EST", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-5))));
test("Wed, 03 May 1982 12:22:04 EDT", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-4))));
test("Wed, 03 May 1982 12:22:04 CST", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-6))));
test("Wed, 03 May 1982 12:22:04 CDT", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-5))));
test("Wed, 03 May 1982 12:22:04 MST", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-7))));
test("Wed, 03 May 1982 12:22:04 MDT", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-6))));
test("Wed, 03 May 1982 12:22:04 PST", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-8))));
test("Wed, 03 May 1982 12:22:04 PDT", SysTime(dt, new immutable SimpleTimeZone(dur!"hours"(-7))));
auto badTZ = new immutable SimpleTimeZone(Duration.zero);
foreach (dchar c; filter!(a => a != 'j' && a != 'J')(letters))
{
scope(failure) writefln("c: %s", c);
test(format("Wed, 03 May 1982 12:22:04 %s", c), SysTime(dt, badTZ));
test(format("Wed, 03 May 1982 12:22:04%s", c), SysTime(dt, badTZ));
}
foreach (dchar c; ['j', 'J'])
{
scope(failure) writefln("c: %s", c);
assertThrown!DateTimeException(parseRFC822DateTime(cr(format("Wed, 03 May 1982 12:22:04 %s", c))));
assertThrown!DateTimeException(parseRFC822DateTime(cr(format("Wed, 03 May 1982 12:22:04%s", c))));
}
foreach (string s; ["AAA", "GQW", "DDT", "PDA", "GT", "GM"])
{
scope(failure) writefln("s: %s", s);
test(format("Wed, 03 May 1982 12:22:04 %s", s), SysTime(dt, badTZ));
}
// test trailing stuff that gets ignored
{
foreach (c; chain(iota(0, 33), ['('], iota(127, ubyte.max + 1)))
{
scope(failure) writefln("c: %d", c);
test(format("21Dec1213:14:15+0000%c", cast(char) c), std1);
test(format("21Dec1213:14:15+0000%c ", cast(char) c), std1);
test(format("21Dec1213:14:15+0000%chello", cast(char) c), std1);
}
}
// test trailing stuff that doesn't get ignored
{
foreach (c; chain(iota(33, '('), iota('(' + 1, 127)))
{
scope(failure) writefln("c: %d", c);
assertThrown!DateTimeException(
parseRFC822DateTime(cr(format("21Dec1213:14:15+0000%c", cast(char) c))));
assertThrown!DateTimeException(
parseRFC822DateTime(cr(format("21Dec1213:14:15+0000%c ", cast(char) c))));
assertThrown!DateTimeException(
parseRFC822DateTime(cr(format("21Dec1213:14:15+0000%chello", cast(char) c))));
}
}
}
// test that the checks for minimum length work correctly and avoid
// any RangeErrors.
test("7Dec1200:00A", SysTime(DateTime(2012, 12, 7, 00, 00, 00),
new immutable SimpleTimeZone(Duration.zero)));
test("Fri,7Dec1200:00A", SysTime(DateTime(2012, 12, 7, 00, 00, 00),
new immutable SimpleTimeZone(Duration.zero)));
test("7Dec1200:00:00A", SysTime(DateTime(2012, 12, 7, 00, 00, 00),
new immutable SimpleTimeZone(Duration.zero)));
test("Fri,7Dec1200:00:00A", SysTime(DateTime(2012, 12, 7, 00, 00, 00),
new immutable SimpleTimeZone(Duration.zero)));
auto tooShortMsg = collectExceptionMsg!DateTimeException(parseRFC822DateTime(""));
foreach (str; ["Fri,7Dec1200:00:00", "7Dec1200:00:00"])
{
foreach (i; 0 .. str.length)
{
auto value = str[0 .. $ - i];
scope(failure) writeln(value);
assert(collectExceptionMsg!DateTimeException(parseRFC822DateTime(value)) == tooShortMsg);
}
}
}}
}
private:
/+
Returns the given hnsecs as an ISO string of fractional seconds.
+/
string fracSecsToISOString(int hnsecs) @safe pure nothrow
{
import std.array : appender;
auto w = appender!string();
try
fracSecsToISOString(w, hnsecs);
catch (Exception e)
assert(0, "fracSecsToISOString() threw.");
return w.data;
}
void fracSecsToISOString(W)(ref W writer, int hnsecs)
{
import std.conv : toChars;
import std.range : padLeft;
assert(hnsecs >= 0);
if (hnsecs == 0)
return;
put(writer, '.');
auto chars = hnsecs.toChars.padLeft('0', 7);
while (chars.back == '0')
chars.popBack();
put(writer, chars);
}
@safe unittest
{
assert(fracSecsToISOString(0) == "");
assert(fracSecsToISOString(1) == ".0000001");
assert(fracSecsToISOString(10) == ".000001");
assert(fracSecsToISOString(100) == ".00001");
assert(fracSecsToISOString(1000) == ".0001");
assert(fracSecsToISOString(10_000) == ".001");
assert(fracSecsToISOString(100_000) == ".01");
assert(fracSecsToISOString(1_000_000) == ".1");
assert(fracSecsToISOString(1_000_001) == ".1000001");
assert(fracSecsToISOString(1_001_001) == ".1001001");
assert(fracSecsToISOString(1_071_601) == ".1071601");
assert(fracSecsToISOString(1_271_641) == ".1271641");
assert(fracSecsToISOString(9_999_999) == ".9999999");
assert(fracSecsToISOString(9_999_990) == ".999999");
assert(fracSecsToISOString(9_999_900) == ".99999");
assert(fracSecsToISOString(9_999_000) == ".9999");
assert(fracSecsToISOString(9_990_000) == ".999");
assert(fracSecsToISOString(9_900_000) == ".99");
assert(fracSecsToISOString(9_000_000) == ".9");
assert(fracSecsToISOString(999) == ".0000999");
assert(fracSecsToISOString(9990) == ".000999");
assert(fracSecsToISOString(99_900) == ".00999");
assert(fracSecsToISOString(999_000) == ".0999");
}
/+
Returns a Duration corresponding to to the given ISO string of
fractional seconds.
+/
static Duration fracSecsFromISOString(S)(in S isoString) @trusted pure
if (isSomeString!S)
{
import std.algorithm.searching : all;
import std.ascii : isDigit;
import std.conv : to;
import std.string : representation;
if (isoString.empty)
return Duration.zero;
auto str = isoString.representation;
enforce(str[0] == '.', new DateTimeException("Invalid ISO String"));
str.popFront();
enforce(!str.empty && all!isDigit(str), new DateTimeException("Invalid ISO String"));
dchar[7] fullISOString = void;
foreach (i, ref dchar c; fullISOString)
{
if (i < str.length)
c = str[i];
else
c = '0';
}
return hnsecs(to!int(fullISOString[]));
}
@safe unittest
{
import core.time;
static void testFSInvalid(string isoString)
{
fracSecsFromISOString(isoString);
}
assertThrown!DateTimeException(testFSInvalid("."));
assertThrown!DateTimeException(testFSInvalid("0."));
assertThrown!DateTimeException(testFSInvalid("0"));
assertThrown!DateTimeException(testFSInvalid("0000000"));
assertThrown!DateTimeException(testFSInvalid("T"));
assertThrown!DateTimeException(testFSInvalid("T."));
assertThrown!DateTimeException(testFSInvalid(".T"));
assertThrown!DateTimeException(testFSInvalid(".00000Q0"));
assertThrown!DateTimeException(testFSInvalid(".000000Q"));
assertThrown!DateTimeException(testFSInvalid(".0000000Q"));
assertThrown!DateTimeException(testFSInvalid(".0000000000Q"));
assert(fracSecsFromISOString("") == Duration.zero);
assert(fracSecsFromISOString(".0000001") == hnsecs(1));
assert(fracSecsFromISOString(".000001") == hnsecs(10));
assert(fracSecsFromISOString(".00001") == hnsecs(100));
assert(fracSecsFromISOString(".0001") == hnsecs(1000));
assert(fracSecsFromISOString(".001") == hnsecs(10_000));
assert(fracSecsFromISOString(".01") == hnsecs(100_000));
assert(fracSecsFromISOString(".1") == hnsecs(1_000_000));
assert(fracSecsFromISOString(".1000001") == hnsecs(1_000_001));
assert(fracSecsFromISOString(".1001001") == hnsecs(1_001_001));
assert(fracSecsFromISOString(".1071601") == hnsecs(1_071_601));
assert(fracSecsFromISOString(".1271641") == hnsecs(1_271_641));
assert(fracSecsFromISOString(".9999999") == hnsecs(9_999_999));
assert(fracSecsFromISOString(".9999990") == hnsecs(9_999_990));
assert(fracSecsFromISOString(".999999") == hnsecs(9_999_990));
assert(fracSecsFromISOString(".9999900") == hnsecs(9_999_900));
assert(fracSecsFromISOString(".99999") == hnsecs(9_999_900));
assert(fracSecsFromISOString(".9999000") == hnsecs(9_999_000));
assert(fracSecsFromISOString(".9999") == hnsecs(9_999_000));
assert(fracSecsFromISOString(".9990000") == hnsecs(9_990_000));
assert(fracSecsFromISOString(".999") == hnsecs(9_990_000));
assert(fracSecsFromISOString(".9900000") == hnsecs(9_900_000));
assert(fracSecsFromISOString(".9900") == hnsecs(9_900_000));
assert(fracSecsFromISOString(".99") == hnsecs(9_900_000));
assert(fracSecsFromISOString(".9000000") == hnsecs(9_000_000));
assert(fracSecsFromISOString(".9") == hnsecs(9_000_000));
assert(fracSecsFromISOString(".0000999") == hnsecs(999));
assert(fracSecsFromISOString(".0009990") == hnsecs(9990));
assert(fracSecsFromISOString(".000999") == hnsecs(9990));
assert(fracSecsFromISOString(".0099900") == hnsecs(99_900));
assert(fracSecsFromISOString(".00999") == hnsecs(99_900));
assert(fracSecsFromISOString(".0999000") == hnsecs(999_000));
assert(fracSecsFromISOString(".0999") == hnsecs(999_000));
assert(fracSecsFromISOString(".00000000") == Duration.zero);
assert(fracSecsFromISOString(".00000001") == Duration.zero);
assert(fracSecsFromISOString(".00000009") == Duration.zero);
assert(fracSecsFromISOString(".1234567890") == hnsecs(1_234_567));
assert(fracSecsFromISOString(".12345678901234567890") == hnsecs(1_234_567));
}
/+
This function is used to split out the units without getting the remaining
hnsecs.
Params:
units = The units to split out.
hnsecs = The current total hnsecs.
Returns:
The split out value.
+/
long getUnitsFromHNSecs(string units)(long hnsecs) @safe pure nothrow
if (validTimeUnits(units) &&
CmpTimeUnits!(units, "months") < 0)
{
return convert!("hnsecs", units)(hnsecs);
}
@safe unittest
{
auto hnsecs = 2595000000007L;
immutable days = getUnitsFromHNSecs!"days"(hnsecs);
assert(days == 3);
assert(hnsecs == 2595000000007L);
}
/+
This function is used to split out the units without getting the units but
just the remaining hnsecs.
Params:
units = The units to split out.
hnsecs = The current total hnsecs.
Returns:
The remaining hnsecs.
+/
long removeUnitsFromHNSecs(string units)(long hnsecs) @safe pure nothrow
if (validTimeUnits(units) &&
CmpTimeUnits!(units, "months") < 0)
{
immutable value = convert!("hnsecs", units)(hnsecs);
return hnsecs - convert!(units, "hnsecs")(value);
}
@safe unittest
{
auto hnsecs = 2595000000007L;
auto returned = removeUnitsFromHNSecs!"days"(hnsecs);
assert(returned == 3000000007);
assert(hnsecs == 2595000000007L);
}
/+
Strips what RFC 5322, section 3.2.2 refers to as CFWS from the left-hand
side of the given range (it strips comments delimited by $(D '(') and
$(D ')') as well as folding whitespace).
It is assumed that the given range contains the value of a header field and
no terminating CRLF for the line (though the CRLF for folding whitespace is
of course expected and stripped) and thus that the only case of CR or LF is
in folding whitespace.
If a comment does not terminate correctly (e.g. mismatched parens) or if the
the FWS is malformed, then the range will be empty when stripCWFS is done.
However, only minimal validation of the content is done (e.g. quoted pairs
within a comment aren't validated beyond \$LPAREN or \$RPAREN, because
they're inside a comment, and thus their value doesn't matter anyway). It's
only when the content does not conform to the grammar rules for FWS and thus
literally cannot be parsed that content is considered invalid, and an empty
range is returned.
Note that _stripCFWS is eager, not lazy. It does not create a new range.
Rather, it pops off the CFWS from the range and returns it.
+/
R _stripCFWS(R)(R range)
if (isRandomAccessRange!R && hasSlicing!R && hasLength!R &&
(is(Unqual!(ElementType!R) == char) || is(Unqual!(ElementType!R) == ubyte)))
{
immutable e = range.length;
outer: for (size_t i = 0; i < e; )
{
switch (range[i])
{
case ' ': case '\t':
{
++i;
break;
}
case '\r':
{
if (i + 2 < e && range[i + 1] == '\n' && (range[i + 2] == ' ' || range[i + 2] == '\t'))
{
i += 3;
break;
}
break outer;
}
case '\n':
{
if (i + 1 < e && (range[i + 1] == ' ' || range[i + 1] == '\t'))
{
i += 2;
break;
}
break outer;
}
case '(':
{
++i;
size_t commentLevel = 1;
while (i < e)
{
if (range[i] == '(')
++commentLevel;
else if (range[i] == ')')
{
++i;
if (--commentLevel == 0)
continue outer;
continue;
}
else if (range[i] == '\\')
{
if (++i == e)
break outer;
}
++i;
}
break outer;
}
default: return range[i .. e];
}
}
return range[e .. e];
}
@system unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
import std.meta : AliasSeq;
import std.stdio : writeln;
import std.string : representation;
static foreach (cr; AliasSeq!(function(string a){return cast(ubyte[]) a;},
function(string a){return map!(b => cast(char) b)(a.representation);}))
{
scope(failure) writeln(typeof(cr).stringof);
assert(_stripCFWS(cr("")).empty);
assert(_stripCFWS(cr("\r")).empty);
assert(_stripCFWS(cr("\r\n")).empty);
assert(_stripCFWS(cr("\r\n ")).empty);
assert(_stripCFWS(cr(" \t\r\n")).empty);
assert(equal(_stripCFWS(cr(" \t\r\n hello")), cr("hello")));
assert(_stripCFWS(cr(" \t\r\nhello")).empty);
assert(_stripCFWS(cr(" \t\r\n\v")).empty);
assert(equal(_stripCFWS(cr("\v \t\r\n\v")), cr("\v \t\r\n\v")));
assert(_stripCFWS(cr("()")).empty);
assert(_stripCFWS(cr("(hello world)")).empty);
assert(_stripCFWS(cr("(hello world)(hello world)")).empty);
assert(_stripCFWS(cr("(hello world\r\n foo\r where's\nwaldo)")).empty);
assert(_stripCFWS(cr(" \t (hello \tworld\r\n foo\r where's\nwaldo)\t\t ")).empty);
assert(_stripCFWS(cr(" ")).empty);
assert(_stripCFWS(cr("\t\t\t")).empty);
assert(_stripCFWS(cr("\t \r\n\r \n")).empty);
assert(_stripCFWS(cr("(hello world) (can't find waldo) (he's lost)")).empty);
assert(_stripCFWS(cr("(hello\\) world) (can't \\(find waldo) (he's \\(\\)lost)")).empty);
assert(_stripCFWS(cr("(((((")).empty);
assert(_stripCFWS(cr("(((()))")).empty);
assert(_stripCFWS(cr("(((())))")).empty);
assert(equal(_stripCFWS(cr("(((()))))")), cr(")")));
assert(equal(_stripCFWS(cr(")))))")), cr(")))))")));
assert(equal(_stripCFWS(cr("()))))")), cr("))))")));
assert(equal(_stripCFWS(cr(" hello hello ")), cr("hello hello ")));
assert(equal(_stripCFWS(cr("\thello (world)")), cr("hello (world)")));
assert(equal(_stripCFWS(cr(" \r\n \\((\\)) foo")), cr("\\((\\)) foo")));
assert(equal(_stripCFWS(cr(" \r\n (\\((\\))) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" \r\n (\\(())) foo")), cr(") foo")));
assert(_stripCFWS(cr(" \r\n (((\\))) foo")).empty);
assert(_stripCFWS(cr("(hello)(hello)")).empty);
assert(_stripCFWS(cr(" \r\n (hello)\r\n (hello)")).empty);
assert(_stripCFWS(cr(" \r\n (hello) \r\n (hello) \r\n ")).empty);
assert(_stripCFWS(cr("\t\t\t\t(hello)\t\t\t\t(hello)\t\t\t\t")).empty);
assert(equal(_stripCFWS(cr(" \r\n (hello)\r\n (hello) \r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \r\n (hello) \r\n (hello) \r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr("\t\r\n\t(hello)\r\n\t(hello)\t\r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr("\t\r\n\t(hello)\t\r\n\t(hello)\t\r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \r\n (hello) \r\n \r\n (hello) \r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \r\n (hello) \r\n (hello) \r\n \r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \r\n \r\n (hello)\t\r\n (hello) \r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \r\n\t\r\n\t(hello)\t\r\n (hello) \r\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" (\r\n ( \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\t\r\n ( \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\r\n\t( \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n (\t\r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n (\r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n (\r\n\t) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n )\t\r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n )\r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n ) \r\n) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n ) \r\n\t) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n ) \r\n ) \r\n foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n ) \r\n )\t\r\n foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n ( \r\n ) \r\n )\r\n foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n \r\n ( \r\n \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n \r\n ( \r\n \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\t\r\n \r\n ( \r\n \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\r\n \r\n\t( \r\n \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\r\n \r\n( \r\n \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\r\n \r\n ( \r\n \r\n\t) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\r\n \r\n ( \r\n \r\n )\t\r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" (\r\n \r\n ( \r\n \r\n )\r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n bar \r\n ( \r\n bar \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n () \r\n ( \r\n () \r\n ) \r\n ) foo")), cr("foo")));
assert(equal(_stripCFWS(cr(" ( \r\n \\\\ \r\n ( \r\n \\\\ \r\n ) \r\n ) foo")), cr("foo")));
assert(_stripCFWS(cr("(hello)(hello)")).empty);
assert(_stripCFWS(cr(" \n (hello)\n (hello) \n ")).empty);
assert(_stripCFWS(cr(" \n (hello) \n (hello) \n ")).empty);
assert(equal(_stripCFWS(cr(" \n (hello)\n (hello) \n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \n (hello) \n (hello) \n hello")), cr("hello")));
assert(equal(_stripCFWS(cr("\t\n\t(hello)\n\t(hello)\t\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr("\t\n\t(hello)\t\n\t(hello)\t\n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \n (hello) \n \n (hello) \n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \n (hello) \n (hello) \n \n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \n \n (hello)\t\n (hello) \n hello")), cr("hello")));
assert(equal(_stripCFWS(cr(" \n\t\n\t(hello)\t\n (hello) \n hello")), cr("hello")));
}
}
// This is so that we don't have to worry about std.conv.to throwing. It also
// doesn't have to worry about quite as many cases as std.conv.to, since it
// doesn't have to worry about a sign on the value or about whether it fits.
T _convDigits(T, R)(R str)
if (isIntegral!T && isSigned!T) // The constraints on R were already covered by parseRFC822DateTime.
{
import std.ascii : isDigit;
assert(!str.empty);
T num = 0;
foreach (i; 0 .. str.length)
{
if (i != 0)
num *= 10;
if (!isDigit(str[i]))
return -1;
num += str[i] - '0';
}
return num;
}
@safe unittest
{
import std.conv : to;
import std.range : chain, iota;
import std.stdio : writeln;
foreach (i; chain(iota(0, 101), [250, 999, 1000, 1001, 2345, 9999]))
{
scope(failure) writeln(i);
assert(_convDigits!int(to!string(i)) == i);
}
foreach (str; ["-42", "+42", "1a", "1 ", " ", " 42 "])
{
scope(failure) writeln(str);
assert(_convDigits!int(str) == -1);
}
}
version(unittest)
{
// Variables to help in testing.
Duration currLocalDiffFromUTC;
immutable (TimeZone)[] testTZs;
// All of these helper arrays are sorted in ascending order.
auto testYearsBC = [-1999, -1200, -600, -4, -1, 0];
auto testYearsAD = [1, 4, 1000, 1999, 2000, 2012];
// I'd use a Tuple, but I get forward reference errors if I try.
struct MonthDay
{
Month month;
short day;
this(int m, short d)
{
month = cast(Month) m;
day = d;
}
}
MonthDay[] testMonthDays = [MonthDay(1, 1),
MonthDay(1, 2),
MonthDay(3, 17),
MonthDay(7, 4),
MonthDay(10, 27),
MonthDay(12, 30),
MonthDay(12, 31)];
auto testDays = [1, 2, 9, 10, 16, 20, 25, 28, 29, 30, 31];
auto testTODs = [TimeOfDay(0, 0, 0),
TimeOfDay(0, 0, 1),
TimeOfDay(0, 1, 0),
TimeOfDay(1, 0, 0),
TimeOfDay(13, 13, 13),
TimeOfDay(23, 59, 59)];
auto testHours = [0, 1, 12, 22, 23];
auto testMinSecs = [0, 1, 30, 58, 59];
// Throwing exceptions is incredibly expensive, so we want to use a smaller
// set of values for tests using assertThrown.
auto testTODsThrown = [TimeOfDay(0, 0, 0),
TimeOfDay(13, 13, 13),
TimeOfDay(23, 59, 59)];
Date[] testDatesBC;
Date[] testDatesAD;
DateTime[] testDateTimesBC;
DateTime[] testDateTimesAD;
Duration[] testFracSecs;
SysTime[] testSysTimesBC;
SysTime[] testSysTimesAD;
// I'd use a Tuple, but I get forward reference errors if I try.
struct GregDay { int day; Date date; }
auto testGregDaysBC = [GregDay(-1_373_427, Date(-3760, 9, 7)), // Start of the Hebrew Calendar
GregDay(-735_233, Date(-2012, 1, 1)),
GregDay(-735_202, Date(-2012, 2, 1)),
GregDay(-735_175, Date(-2012, 2, 28)),
GregDay(-735_174, Date(-2012, 2, 29)),
GregDay(-735_173, Date(-2012, 3, 1)),
GregDay(-734_502, Date(-2010, 1, 1)),
GregDay(-734_472, Date(-2010, 1, 31)),
GregDay(-734_471, Date(-2010, 2, 1)),
GregDay(-734_444, Date(-2010, 2, 28)),
GregDay(-734_443, Date(-2010, 3, 1)),
GregDay(-734_413, Date(-2010, 3, 31)),
GregDay(-734_412, Date(-2010, 4, 1)),
GregDay(-734_383, Date(-2010, 4, 30)),
GregDay(-734_382, Date(-2010, 5, 1)),
GregDay(-734_352, Date(-2010, 5, 31)),
GregDay(-734_351, Date(-2010, 6, 1)),
GregDay(-734_322, Date(-2010, 6, 30)),
GregDay(-734_321, Date(-2010, 7, 1)),
GregDay(-734_291, Date(-2010, 7, 31)),
GregDay(-734_290, Date(-2010, 8, 1)),
GregDay(-734_260, Date(-2010, 8, 31)),
GregDay(-734_259, Date(-2010, 9, 1)),
GregDay(-734_230, Date(-2010, 9, 30)),
GregDay(-734_229, Date(-2010, 10, 1)),
GregDay(-734_199, Date(-2010, 10, 31)),
GregDay(-734_198, Date(-2010, 11, 1)),
GregDay(-734_169, Date(-2010, 11, 30)),
GregDay(-734_168, Date(-2010, 12, 1)),
GregDay(-734_139, Date(-2010, 12, 30)),
GregDay(-734_138, Date(-2010, 12, 31)),
GregDay(-731_215, Date(-2001, 1, 1)),
GregDay(-730_850, Date(-2000, 1, 1)),
GregDay(-730_849, Date(-2000, 1, 2)),
GregDay(-730_486, Date(-2000, 12, 30)),
GregDay(-730_485, Date(-2000, 12, 31)),
GregDay(-730_484, Date(-1999, 1, 1)),
GregDay(-694_690, Date(-1901, 1, 1)),
GregDay(-694_325, Date(-1900, 1, 1)),
GregDay(-585_118, Date(-1601, 1, 1)),
GregDay(-584_753, Date(-1600, 1, 1)),
GregDay(-584_388, Date(-1600, 12, 31)),
GregDay(-584_387, Date(-1599, 1, 1)),
GregDay(-365_972, Date(-1001, 1, 1)),
GregDay(-365_607, Date(-1000, 1, 1)),
GregDay(-183_351, Date(-501, 1, 1)),
GregDay(-182_986, Date(-500, 1, 1)),
GregDay(-182_621, Date(-499, 1, 1)),
GregDay(-146_827, Date(-401, 1, 1)),
GregDay(-146_462, Date(-400, 1, 1)),
GregDay(-146_097, Date(-400, 12, 31)),
GregDay(-110_302, Date(-301, 1, 1)),
GregDay(-109_937, Date(-300, 1, 1)),
GregDay(-73_778, Date(-201, 1, 1)),
GregDay(-73_413, Date(-200, 1, 1)),
GregDay(-38_715, Date(-105, 1, 1)),
GregDay(-37_254, Date(-101, 1, 1)),
GregDay(-36_889, Date(-100, 1, 1)),
GregDay(-36_524, Date(-99, 1, 1)),
GregDay(-36_160, Date(-99, 12, 31)),
GregDay(-35_794, Date(-97, 1, 1)),
GregDay(-18_627, Date(-50, 1, 1)),
GregDay(-18_262, Date(-49, 1, 1)),
GregDay(-3652, Date(-9, 1, 1)),
GregDay(-2191, Date(-5, 1, 1)),
GregDay(-1827, Date(-5, 12, 31)),
GregDay(-1826, Date(-4, 1, 1)),
GregDay(-1825, Date(-4, 1, 2)),
GregDay(-1462, Date(-4, 12, 30)),
GregDay(-1461, Date(-4, 12, 31)),
GregDay(-1460, Date(-3, 1, 1)),
GregDay(-1096, Date(-3, 12, 31)),
GregDay(-1095, Date(-2, 1, 1)),
GregDay(-731, Date(-2, 12, 31)),
GregDay(-730, Date(-1, 1, 1)),
GregDay(-367, Date(-1, 12, 30)),
GregDay(-366, Date(-1, 12, 31)),
GregDay(-365, Date(0, 1, 1)),
GregDay(-31, Date(0, 11, 30)),
GregDay(-30, Date(0, 12, 1)),
GregDay(-1, Date(0, 12, 30)),
GregDay(0, Date(0, 12, 31))];
auto testGregDaysAD = [GregDay(1, Date(1, 1, 1)),
GregDay(2, Date(1, 1, 2)),
GregDay(32, Date(1, 2, 1)),
GregDay(365, Date(1, 12, 31)),
GregDay(366, Date(2, 1, 1)),
GregDay(731, Date(3, 1, 1)),
GregDay(1096, Date(4, 1, 1)),
GregDay(1097, Date(4, 1, 2)),
GregDay(1460, Date(4, 12, 30)),
GregDay(1461, Date(4, 12, 31)),
GregDay(1462, Date(5, 1, 1)),
GregDay(17_898, Date(50, 1, 1)),
GregDay(35_065, Date(97, 1, 1)),
GregDay(36_160, Date(100, 1, 1)),
GregDay(36_525, Date(101, 1, 1)),
GregDay(37_986, Date(105, 1, 1)),
GregDay(72_684, Date(200, 1, 1)),
GregDay(73_049, Date(201, 1, 1)),
GregDay(109_208, Date(300, 1, 1)),
GregDay(109_573, Date(301, 1, 1)),
GregDay(145_732, Date(400, 1, 1)),
GregDay(146_098, Date(401, 1, 1)),
GregDay(182_257, Date(500, 1, 1)),
GregDay(182_622, Date(501, 1, 1)),
GregDay(364_878, Date(1000, 1, 1)),
GregDay(365_243, Date(1001, 1, 1)),
GregDay(584_023, Date(1600, 1, 1)),
GregDay(584_389, Date(1601, 1, 1)),
GregDay(693_596, Date(1900, 1, 1)),
GregDay(693_961, Date(1901, 1, 1)),
GregDay(729_755, Date(1999, 1, 1)),
GregDay(730_120, Date(2000, 1, 1)),
GregDay(730_121, Date(2000, 1, 2)),
GregDay(730_484, Date(2000, 12, 30)),
GregDay(730_485, Date(2000, 12, 31)),
GregDay(730_486, Date(2001, 1, 1)),
GregDay(733_773, Date(2010, 1, 1)),
GregDay(733_774, Date(2010, 1, 2)),
GregDay(733_803, Date(2010, 1, 31)),
GregDay(733_804, Date(2010, 2, 1)),
GregDay(733_831, Date(2010, 2, 28)),
GregDay(733_832, Date(2010, 3, 1)),
GregDay(733_862, Date(2010, 3, 31)),
GregDay(733_863, Date(2010, 4, 1)),
GregDay(733_892, Date(2010, 4, 30)),
GregDay(733_893, Date(2010, 5, 1)),
GregDay(733_923, Date(2010, 5, 31)),
GregDay(733_924, Date(2010, 6, 1)),
GregDay(733_953, Date(2010, 6, 30)),
GregDay(733_954, Date(2010, 7, 1)),
GregDay(733_984, Date(2010, 7, 31)),
GregDay(733_985, Date(2010, 8, 1)),
GregDay(734_015, Date(2010, 8, 31)),
GregDay(734_016, Date(2010, 9, 1)),
GregDay(734_045, Date(2010, 9, 30)),
GregDay(734_046, Date(2010, 10, 1)),
GregDay(734_076, Date(2010, 10, 31)),
GregDay(734_077, Date(2010, 11, 1)),
GregDay(734_106, Date(2010, 11, 30)),
GregDay(734_107, Date(2010, 12, 1)),
GregDay(734_136, Date(2010, 12, 30)),
GregDay(734_137, Date(2010, 12, 31)),
GregDay(734_503, Date(2012, 1, 1)),
GregDay(734_534, Date(2012, 2, 1)),
GregDay(734_561, Date(2012, 2, 28)),
GregDay(734_562, Date(2012, 2, 29)),
GregDay(734_563, Date(2012, 3, 1)),
GregDay(734_858, Date(2012, 12, 21))];
// I'd use a Tuple, but I get forward reference errors if I try.
struct DayOfYear { int day; MonthDay md; }
auto testDaysOfYear = [DayOfYear(1, MonthDay(1, 1)),
DayOfYear(2, MonthDay(1, 2)),
DayOfYear(3, MonthDay(1, 3)),
DayOfYear(31, MonthDay(1, 31)),
DayOfYear(32, MonthDay(2, 1)),
DayOfYear(59, MonthDay(2, 28)),
DayOfYear(60, MonthDay(3, 1)),
DayOfYear(90, MonthDay(3, 31)),
DayOfYear(91, MonthDay(4, 1)),
DayOfYear(120, MonthDay(4, 30)),
DayOfYear(121, MonthDay(5, 1)),
DayOfYear(151, MonthDay(5, 31)),
DayOfYear(152, MonthDay(6, 1)),
DayOfYear(181, MonthDay(6, 30)),
DayOfYear(182, MonthDay(7, 1)),
DayOfYear(212, MonthDay(7, 31)),
DayOfYear(213, MonthDay(8, 1)),
DayOfYear(243, MonthDay(8, 31)),
DayOfYear(244, MonthDay(9, 1)),
DayOfYear(273, MonthDay(9, 30)),
DayOfYear(274, MonthDay(10, 1)),
DayOfYear(304, MonthDay(10, 31)),
DayOfYear(305, MonthDay(11, 1)),
DayOfYear(334, MonthDay(11, 30)),
DayOfYear(335, MonthDay(12, 1)),
DayOfYear(363, MonthDay(12, 29)),
DayOfYear(364, MonthDay(12, 30)),
DayOfYear(365, MonthDay(12, 31))];
auto testDaysOfLeapYear = [DayOfYear(1, MonthDay(1, 1)),
DayOfYear(2, MonthDay(1, 2)),
DayOfYear(3, MonthDay(1, 3)),
DayOfYear(31, MonthDay(1, 31)),
DayOfYear(32, MonthDay(2, 1)),
DayOfYear(59, MonthDay(2, 28)),
DayOfYear(60, MonthDay(2, 29)),
DayOfYear(61, MonthDay(3, 1)),
DayOfYear(91, MonthDay(3, 31)),
DayOfYear(92, MonthDay(4, 1)),
DayOfYear(121, MonthDay(4, 30)),
DayOfYear(122, MonthDay(5, 1)),
DayOfYear(152, MonthDay(5, 31)),
DayOfYear(153, MonthDay(6, 1)),
DayOfYear(182, MonthDay(6, 30)),
DayOfYear(183, MonthDay(7, 1)),
DayOfYear(213, MonthDay(7, 31)),
DayOfYear(214, MonthDay(8, 1)),
DayOfYear(244, MonthDay(8, 31)),
DayOfYear(245, MonthDay(9, 1)),
DayOfYear(274, MonthDay(9, 30)),
DayOfYear(275, MonthDay(10, 1)),
DayOfYear(305, MonthDay(10, 31)),
DayOfYear(306, MonthDay(11, 1)),
DayOfYear(335, MonthDay(11, 30)),
DayOfYear(336, MonthDay(12, 1)),
DayOfYear(364, MonthDay(12, 29)),
DayOfYear(365, MonthDay(12, 30)),
DayOfYear(366, MonthDay(12, 31))];
void initializeTests() @safe
{
import std.algorithm.sorting : sort;
import std.typecons : Rebindable;
immutable lt = LocalTime().utcToTZ(0);
currLocalDiffFromUTC = dur!"hnsecs"(lt);
version(Posix)
{
import std.datetime.timezone : PosixTimeZone;
immutable otherTZ = lt < 0 ? PosixTimeZone.getTimeZone("Australia/Sydney")
: PosixTimeZone.getTimeZone("America/Denver");
}
else version(Windows)
{
import std.datetime.timezone : WindowsTimeZone;
immutable otherTZ = lt < 0 ? WindowsTimeZone.getTimeZone("AUS Eastern Standard Time")
: WindowsTimeZone.getTimeZone("Mountain Standard Time");
}
immutable ot = otherTZ.utcToTZ(0);
auto diffs = [0L, lt, ot];
auto diffAA = [0L : Rebindable!(immutable TimeZone)(UTC())];
diffAA[lt] = Rebindable!(immutable TimeZone)(LocalTime());
diffAA[ot] = Rebindable!(immutable TimeZone)(otherTZ);
sort(diffs);
testTZs = [diffAA[diffs[0]], diffAA[diffs[1]], diffAA[diffs[2]]];
testFracSecs = [Duration.zero, hnsecs(1), hnsecs(5007), hnsecs(9_999_999)];
foreach (year; testYearsBC)
{
foreach (md; testMonthDays)
testDatesBC ~= Date(year, md.month, md.day);
}
foreach (year; testYearsAD)
{
foreach (md; testMonthDays)
testDatesAD ~= Date(year, md.month, md.day);
}
foreach (dt; testDatesBC)
{
foreach (tod; testTODs)
testDateTimesBC ~= DateTime(dt, tod);
}
foreach (dt; testDatesAD)
{
foreach (tod; testTODs)
testDateTimesAD ~= DateTime(dt, tod);
}
foreach (dt; testDateTimesBC)
{
foreach (tz; testTZs)
{
foreach (fs; testFracSecs)
testSysTimesBC ~= SysTime(dt, fs, tz);
}
}
foreach (dt; testDateTimesAD)
{
foreach (tz; testTZs)
{
foreach (fs; testFracSecs)
testSysTimesAD ~= SysTime(dt, fs, tz);
}
}
}
}
|
D
|
import kratos;
import std.math;
import kratos.input;
import kratos.component.physics;
import kratos.component.meshrenderer;
import kratos.component.time;
import kratos.ecs.entity;
import kratos.ecs.component : optional, ignore, dependency;
import kratos.graphics.shadervariable : UniformRef;
import kgl3n.vector;
public class Flashy : Component
{
@optional:
private @dependency MeshRenderer meshRenderer;
private @dependency Time time;
float speed = 1;
vec3 color = vec3(1, 0, 0);
float offset = 0;
private ShaderVars shaderVars;
public void initialize()
{
shaderVars = meshRenderer.mesh.renderState.shader.getRefs!ShaderVars;
}
public void frameUpdate()
{
shaderVars.color = color * (sin((time.total + offset) * speed) * 0.5 + 0.5);
}
private static struct ShaderVars
{
UniformRef!vec3 color;
}
}
public class Thruster : Component
{
private @dependency RigidBody rigidBody;
public vec3 force;
void frameUpdate()
{
if(keyboard["Space"].pressed)
{
rigidBody.addForce(force);
}
}
}
static this()
{
registerComponent!Flashy;
registerComponent!Thruster;
}
|
D
|
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module flow.bpmn.model.HasExecutionListeners;
import hunt.collection.List;
import flow.bpmn.model.FlowableListener;
/**
* Interface indicating an element has execution-listeners
*
* @author Frederik Heremans
*/
interface HasExecutionListeners {
List!FlowableListener getExecutionListeners();
void setExecutionListeners(List!FlowableListener executionListeners);
}
|
D
|
CHAIN IF ~InParty("C0Drake")
See("C0Drake")
!StateCheck("C0Aura",CD_STATE_NOTVALID)
!StateCheck("C0Drake",CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("C0AuraDrake1","GLOBAL",0)~ THEN BC0Drake C0AuraDrake1
~A question for you, little lady of miracles. Do you believe in the theory of life beyond our world? Not the planes, I mean literal worlds.~
DO ~SetGlobal("C0AuraDrake1","GLOBAL",1)~
== BC0Aura ~Life in the stars, you mean? I didn't think you'd know about such theories, Drake. You must have studied.~
== BC0Drake ~Not studied, per se. Rather, I came across the topic while doing some light reading in the holy libraries of home. 'A Study of Celestial Visions and Ventures'... I believe it was called, or something like that. Written by some astrologist a little less than a hundred years ago. Are you familiar with the text?~
== BC0Aura ~Oh, yes. It was someone from my homeland that wrote it. That was before I was born, though. The facts we've found have changed our perspective greatly since then.~
== BC0Drake ~So do you believe it? The parts about beings in the stars, living in worlds parallel to ours? I must admit, it was a little too fantastical for me to believe, especially for such a scholarly work.~
== BC0Aura ~Mmm, I'd say it's definitely possible... but we've no way to be certain so far. The only way to know for sure would be to find those worlds and see for ourselves, you know? *sigh* But that'll be long past our lifetimes, I'm sure.~
== BC0Drake ~Perhaps. Though with a mind like yours...~
== BC0Aura ~Hahaha, no. I'm not that good... not yet, anyway. Besides, I've got a thousand other things I want to do in my life first, and those won't take a lifetime to accomplish.~
EXIT
CHAIN IF ~InParty("C0Drake")
See("C0Drake")
!StateCheck("C0Aura",CD_STATE_NOTVALID)
!StateCheck("C0Drake",CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("C0AuraDrake1","GLOBAL",1)~ THEN BC0Aura C0AuraDrake2
~I was wondering, Drake, does your god ever speak to you? I mean... have you ever heard his voice?~
DO ~SetGlobal("C0AuraDrake1","GLOBAL",2)~
== BC0Drake ~Tyr's voice? Can't say I have.~
== BC0Aura ~You haven't? Then... how do you know he really exists? Do you have any proof?~
== BC0Drake ~I don't, no. But I do believe he exists. It's hard to explain. I can... feel it, in a way.~
== BC0Aura ~Feel it? What do you mean?~
== BC0Drake ~When you become a servant of the gods like I am, you just... know. I don't know about anyone else, but to me it's like... like a presence looming over me, every time I whisper a prayer.~
== BC0Drake ~But what brought this question to your mind? Do you not believe in the gods?~
== BC0Aura ~I do. I just... don't understand the gods in this land at all. When I lived in Kozakura, what the people knew as gods were... different.~
== BC0Aura ~Sometimes I thought I could see them, even though they don't seem to care about us mortals at all. They were more like spirits of nature, acting as they pleased. Would you call them gods as well?~
== BC0Drake ~Maybe. I don't know what a god is. I don't think anyone who lives and dies on this earth does, really.~
== BC0Drake ~Anything greater than us that we don't understand could be called a god by somebody. The sky above and the wind around us - are those gods? I've met those who claimed it, and I couldn't argue with them.~
== BC0Drake ~It could be that there's no real meaning to the word, only beings that we choose to attach it to. Who knows?~
== BC0Aura ~You're probably right. I've sought and solved many mysteries, but the gods... I doubt I'll ever be able to solve that one.~
EXIT
|
D
|
# FIXED
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/rom/r2/rom_init.c
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/bcomdef.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/comdef.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/../_common/cc26xx/_hal_types.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdint.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdbool.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/inc/hal_defs.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/../inc/hw_chip_def.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/rom/rom_jt.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/rom/map_direct.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/common/cc26xx/onboard.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/sys_ctrl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_memmap.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ints.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_sysctl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_prcm.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_nvic.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aon_ioc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ddi_0_osc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_rfc_pwr.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_adi_3_refsys.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aon_pmctl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aon_rtc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_fcfg1.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/interrupt.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/debug.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/cpu.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_cpu_scs.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../driverlib/rom.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/pwr_ctrl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_adi_2_refsys.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/osc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ddi.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/ddi.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aux_smph.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/prcm.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/aon_ioc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/adi.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_uart.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_adi.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/vims.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_vims.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_mcu.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_gpio.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/systick.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/uart.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/gpio.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/flash.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_flash.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/ioc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ioc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/src/inc/icall.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdlib.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/linkage.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/inc/hal_assert.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/inc/hal_sleep.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/limits.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_memory.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_timers.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_pwrmgr.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_bufmgr.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_cbtimer.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_tl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_data.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_event.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_tl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_trng_wrapper.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/trng.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_trng.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/cc26xx/mb.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_rfc_dbell.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/cc26xx/rf_hal.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_config.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_user_config.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/inc/ble_user_config.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/src/inc/icall_user_config.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/drivers/rf/RF.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/drivers/dpl/ClockP.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stddef.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/drivers/dpl/SemaphoreP.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stddef.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/DeviceFamily.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_common_cmd.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_mailbox.h
ROM/rom_init.obj: C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/string.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_prop_cmd.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_ble_cmd.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/inc/ble_dispatch.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_common.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_scheduler.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/ecc_rom.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/linkdb.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/l2cap.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/att.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gatt.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gattservapp.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gatt_uuid.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gap.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/sm.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_ae.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ble.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_wl.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gap_internal.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_enc.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_timer_drift.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_rat.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_rfc_rat.h
ROM/rom_init.obj: C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_privacy.h
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/rom/r2/rom_init.c:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/bcomdef.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/comdef.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/../_common/cc26xx/_hal_types.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdint.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdbool.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/inc/hal_defs.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/../inc/hw_chip_def.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/rom/rom_jt.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/rom/map_direct.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/common/cc26xx/onboard.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/sys_ctrl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_memmap.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ints.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_sysctl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_prcm.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_nvic.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aon_ioc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ddi_0_osc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_rfc_pwr.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_adi_3_refsys.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aon_pmctl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aon_rtc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_fcfg1.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/interrupt.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/debug.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/cpu.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_cpu_scs.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../driverlib/rom.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/pwr_ctrl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_adi_2_refsys.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/osc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ddi.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/ddi.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_aux_smph.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/prcm.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/aon_ioc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/adi.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_uart.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_adi.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/vims.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_vims.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_mcu.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_gpio.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/systick.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/uart.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/gpio.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/flash.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_flash.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/ioc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_ioc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/src/inc/icall.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stdlib.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/linkage.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/inc/hal_assert.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/inc/hal_sleep.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/limits.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_memory.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_timers.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_pwrmgr.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_bufmgr.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/osal/src/inc/osal_cbtimer.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_tl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_data.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_event.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/hci_tl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_trng_wrapper.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/trng.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/../inc/hw_trng.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/cc26xx/mb.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_rfc_dbell.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/cc26xx/rf_hal.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/hal/src/target/_common/hal_types.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_config.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_user_config.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/inc/ble_user_config.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/src/inc/icall_user_config.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/drivers/rf/RF.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/drivers/dpl/ClockP.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stddef.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/drivers/dpl/SemaphoreP.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/stddef.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/DeviceFamily.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_common_cmd.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_mailbox.h:
C:/ti/ccs730/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include/string.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_prop_cmd.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/driverlib/rf_ble_cmd.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/icall/inc/ble_dispatch.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_common.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_scheduler.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/ecc_rom.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/linkdb.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/l2cap.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/att.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gatt.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gattservapp.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gatt_uuid.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gap.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/sm.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_ae.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ble.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_wl.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/inc/gap_internal.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_enc.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_timer_drift.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_rat.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/devices/cc13x2_cc26x2/inc/hw_rfc_rat.h:
C:/ti/simplelink_cc26x2_sdk_1_60_00_04_eng/source/ti/ble5stack/controller/cc26xx/inc/ll_privacy.h:
|
D
|
/**
* Salsa20 / XSalsa20
*
* Copyright:
* (C) 1999-2010 Jack Lloyd
* (C) 2014-2015 Etienne Cimon
*
* License:
* Botan is released under the Simplified BSD License (see LICENSE.md)
*/
module botan.stream.salsa20;
import botan.constants;
static if (BOTAN_HAS_SALSA20):
import botan.stream.stream_cipher;
import botan.utils.loadstor;
import botan.utils.rotate;
import botan.utils.xor_buf;
import botan.utils.types;
import botan.utils.mem_ops;
/**
* DJB's Salsa20 (and XSalsa20)
*/
final class Salsa20 : StreamCipher, SymmetricAlgorithm
{
public:
/*
* Combine cipher stream with message
*/
override void cipher(const(ubyte)* input, ubyte* output, size_t length)
{
while (length >= m_buffer.length - m_position)
{
xorBuf(output, input, &m_buffer[m_position], m_buffer.length - m_position);
length -= (m_buffer.length - m_position);
input += (m_buffer.length - m_position);
output += (m_buffer.length - m_position);
salsa20(*cast(ubyte[64]*) m_buffer.ptr, *cast(uint[16]*) m_state.ptr);
++m_state[8];
m_state[9] += (m_state[8] == 0);
m_position = 0;
}
xorBuf(output, input, &m_buffer[m_position], length);
m_position += length;
}
/*
* Return the name of this type
*/
override void setIv(const(ubyte)* iv, size_t length)
{
if (!validIvLength(length))
throw new InvalidIVLength(name(), length);
if (length == 8)
{
// Salsa20
m_state[6] = loadLittleEndian!uint(iv, 0);
m_state[7] = loadLittleEndian!uint(iv, 1);
}
else
{
// XSalsa20
m_state[6] = loadLittleEndian!uint(iv, 0);
m_state[7] = loadLittleEndian!uint(iv, 1);
m_state[8] = loadLittleEndian!uint(iv, 2);
m_state[9] = loadLittleEndian!uint(iv, 3);
SecureVector!uint hsalsa = SecureVector!uint(8);
hsalsa20(*cast(uint[8]*) hsalsa.ptr, *cast(uint[16]*) m_state.ptr);
m_state[ 1] = hsalsa[0];
m_state[ 2] = hsalsa[1];
m_state[ 3] = hsalsa[2];
m_state[ 4] = hsalsa[3];
m_state[ 6] = loadLittleEndian!uint(iv, 4);
m_state[ 7] = loadLittleEndian!uint(iv, 5);
m_state[11] = hsalsa[4];
m_state[12] = hsalsa[5];
m_state[13] = hsalsa[6];
m_state[14] = hsalsa[7];
}
m_state[8] = 0;
m_state[9] = 0;
salsa20(*cast(ubyte[64]*) m_buffer.ptr, *cast(uint[16]*) m_state.ptr);
++m_state[8];
m_state[9] += (m_state[8] == 0);
m_position = 0;
}
override bool validIvLength(size_t iv_len) const
{ return (iv_len == 8 || iv_len == 24); }
KeyLengthSpecification keySpec() const
{
return KeyLengthSpecification(16, 32, 16);
}
/*
* Clear memory of sensitive data
*/
void clear()
{
zap(m_state);
zap(m_buffer);
m_position = 0;
}
/*
* Return the name of this type
*/
@property string name() const
{
return "Salsa20";
}
override Salsa20 clone() const { return new Salsa20; }
protected:
/*
* Salsa20 Key Schedule
*/
override void keySchedule(const(ubyte)* key, size_t length)
{
__gshared immutable uint[] TAU = [ 0x61707865, 0x3120646e, 0x79622d36, 0x6b206574 ];
__gshared immutable uint[] SIGMA = [ 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574 ];
const uint[] CONSTANTS = (length == 16) ? TAU : SIGMA;
m_state.resize(16);
m_buffer.resize(64);
m_state[0] = CONSTANTS[0];
m_state[5] = CONSTANTS[1];
m_state[10] = CONSTANTS[2];
m_state[15] = CONSTANTS[3];
m_state[1] = loadLittleEndian!uint(key, 0);
m_state[2] = loadLittleEndian!uint(key, 1);
m_state[3] = loadLittleEndian!uint(key, 2);
m_state[4] = loadLittleEndian!uint(key, 3);
if (length == 32)
key += 16;
m_state[11] = loadLittleEndian!uint(key, 0);
m_state[12] = loadLittleEndian!uint(key, 1);
m_state[13] = loadLittleEndian!uint(key, 2);
m_state[14] = loadLittleEndian!uint(key, 3);
m_position = 0;
const ubyte[8] ZERO;
setIv(ZERO.ptr, ZERO.length);
}
SecureVector!uint m_state;
SecureVector!ubyte m_buffer;
size_t m_position;
}
private:
/*
* Generate HSalsa20 cipher stream (for XSalsa20 IV setup)
*/
void hsalsa20(ref uint[8] output, in uint[16] input)
{
uint x00 = input[ 0], x01 = input[ 1], x02 = input[ 2], x03 = input[ 3],
x04 = input[ 4], x05 = input[ 5], x06 = input[ 6], x07 = input[ 7],
x08 = input[ 8], x09 = input[ 9], x10 = input[10], x11 = input[11],
x12 = input[12], x13 = input[13], x14 = input[14], x15 = input[15];
foreach (size_t i; 0 .. 10)
{
mixin( SALSA20_QUARTER_ROUND!(x00, x04, x08, x12)() ~
SALSA20_QUARTER_ROUND!(x05, x09, x13, x01)() ~
SALSA20_QUARTER_ROUND!(x10, x14, x02, x06)() ~
SALSA20_QUARTER_ROUND!(x15, x03, x07, x11)() ~
SALSA20_QUARTER_ROUND!(x00, x01, x02, x03)() ~
SALSA20_QUARTER_ROUND!(x05, x06, x07, x04)() ~
SALSA20_QUARTER_ROUND!(x10, x11, x08, x09)() ~
SALSA20_QUARTER_ROUND!(x15, x12, x13, x14)()
);
}
output[0] = x00;
output[1] = x05;
output[2] = x10;
output[3] = x15;
output[4] = x06;
output[5] = x07;
output[6] = x08;
output[7] = x09;
}
/*
* Generate Salsa20 cipher stream
*/
void salsa20(ref ubyte[64] output, in uint[16] input)
{
uint x00 = input[ 0], x01 = input[ 1], x02 = input[ 2], x03 = input[ 3],
x04 = input[ 4], x05 = input[ 5], x06 = input[ 6], x07 = input[ 7],
x08 = input[ 8], x09 = input[ 9], x10 = input[10], x11 = input[11],
x12 = input[12], x13 = input[13], x14 = input[14], x15 = input[15];
foreach (size_t i; 0 .. 10)
{
mixin( SALSA20_QUARTER_ROUND!(x00, x04, x08, x12)() ~
SALSA20_QUARTER_ROUND!(x05, x09, x13, x01)() ~
SALSA20_QUARTER_ROUND!(x10, x14, x02, x06)() ~
SALSA20_QUARTER_ROUND!(x15, x03, x07, x11)() ~
SALSA20_QUARTER_ROUND!(x00, x01, x02, x03)() ~
SALSA20_QUARTER_ROUND!(x05, x06, x07, x04)() ~
SALSA20_QUARTER_ROUND!(x10, x11, x08, x09)() ~
SALSA20_QUARTER_ROUND!(x15, x12, x13, x14)()
);
}
storeLittleEndian(x00 + input[ 0], output.ptr + 4 * 0);
storeLittleEndian(x01 + input[ 1], output.ptr + 4 * 1);
storeLittleEndian(x02 + input[ 2], output.ptr + 4 * 2);
storeLittleEndian(x03 + input[ 3], output.ptr + 4 * 3);
storeLittleEndian(x04 + input[ 4], output.ptr + 4 * 4);
storeLittleEndian(x05 + input[ 5], output.ptr + 4 * 5);
storeLittleEndian(x06 + input[ 6], output.ptr + 4 * 6);
storeLittleEndian(x07 + input[ 7], output.ptr + 4 * 7);
storeLittleEndian(x08 + input[ 8], output.ptr + 4 * 8);
storeLittleEndian(x09 + input[ 9], output.ptr + 4 * 9);
storeLittleEndian(x10 + input[10], output.ptr + 4 * 10);
storeLittleEndian(x11 + input[11], output.ptr + 4 * 11);
storeLittleEndian(x12 + input[12], output.ptr + 4 * 12);
storeLittleEndian(x13 + input[13], output.ptr + 4 * 13);
storeLittleEndian(x14 + input[14], output.ptr + 4 * 14);
storeLittleEndian(x15 + input[15], output.ptr + 4 * 15);
}
string SALSA20_QUARTER_ROUND(alias _x1, alias _x2, alias _x3, alias _x4)()
{
enum x1 = __traits(identifier, _x1);
enum x2 = __traits(identifier, _x2);
enum x3 = __traits(identifier, _x3);
enum x4 = __traits(identifier, _x4);
return x2 ~ ` ^= rotateLeft(` ~ x1 ~ ` + ` ~ x4 ~ `, 7);
` ~ x3 ~ ` ^= rotateLeft(` ~ x2 ~ ` + ` ~ x1 ~ `, 9);
` ~ x4 ~ ` ^= rotateLeft(` ~ x3 ~ ` + ` ~ x2 ~ `, 13);
` ~ x1 ~ ` ^= rotateLeft(` ~ x4 ~ ` + ` ~ x3 ~ `, 18);`;
}
|
D
|
/afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/obj/x86_64-slc6-gcc48-opt/QuickAna/obj/OptimizerTool.o /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/obj/x86_64-slc6-gcc48-opt/QuickAna/obj/OptimizerTool.d : /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/Root/OptimizerTool.cxx /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/PATInterfaces/SystematicSet.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/PATInterfaces/SystematicCode.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/PATInterfaces/SystematicVariation.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/PATInterfaces/Global.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/OptimizerTool.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/Global.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/xAODFwd.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/ReleaseVersion.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/RootCore/QuickAna_config.h /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/root/6.02.05-x86_64-slc6-gcc48-opt/include/RVersion.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/RootCoreUtils/Assert.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/RootCoreUtils/Global.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/IAnaTool.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/PATInterfaces/ISystematicsTool.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/IAsgTool.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/AsgToolsConf.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/AsgToolMacros.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/StatusCode.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/Check.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/MsgStreamMacros.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/MsgLevel.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/MessageCheck.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/AthenaSupport.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/ToolHandle.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/ToolHandle.icc /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/ToolStore.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/AsgTools/MsgStream.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/ObjectTypeInfo.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/ObjectTypeInfo.icc /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/OptimizerObjects.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/IEventObjects.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/IEventObjects.icc /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/RootCoreUtils/ThrowMsg.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/RootCoreUtils/PrintMsg.h /afs/cern.ch/user/a/abrennan/testarea/CxAODTestFramework/RootCoreBin/include/RootCoreUtils/MessageType.h /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisBase/2.1.29/QuickAna/QuickAna/OptimizerStore.h
|
D
|
/*
Copyright (c) 2019, DUNEX Contributors
Use, modification and distribution are subject to the
Boost Software License, Version 1.0. (See accompanying file
COPYING or copy at http://www.boost.org/LICENSE_1_0.txt)
uname: Print information about the operating system.
Written by: chaomodus
*/
import std.stdio;
import std.string;
import std.algorithm : canFind;
import core.stdc.errno;
import core.sys.posix.sys.utsname;
import core.stdc.stdio : perror;
int main(string[] args) {
utsname info;
int result = core.sys.posix.sys.utsname.uname(&info);
if (result == 0) {
// Handle cases for no arguments and for -a argument.
if (args.length == 1)
args = ["", "-s"];
if (args.canFind("-a"))
args = ["", "-s", "-n", "-r", "-v", "-m"];
foreach (idx, arg; args[1 .. $]) {
switch (arg) {
case "-o", "-s":
stdout.write(info.sysname);
break;
case "-n":
stdout.write(info.nodename);
break;
case "-r":
stdout.write(info.release);
break;
case "-v":
stdout.write(info.version_);
break;
case "-m":
stdout.write(info.machine);
break;
default:
stdout.writeln("unknown argument: ", arg);
return 1;
}
if (idx != args.length - 2) {
stdout.write(" ");
}
}
} else {
perror(null);
return 1;
}
stdout.write("\n");
return 0;
}
|
D
|
a relatively long dagger with a straight blade
|
D
|
# FIXED
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/timers.c
timers.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdlib.h
timers.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/linkage.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/FreeRTOS.h
timers.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stddef.h
timers.obj: C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdint.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/projdefs.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/FreeRTOSConfig.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/portable.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/portable/CCS/ARM_CM3/portmacro.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/mpu_wrappers.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/task.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/list.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/queue.h
timers.obj: C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/timers.h
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/timers.c:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdlib.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/linkage.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/FreeRTOS.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stddef.h:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include/stdint.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/projdefs.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/FreeRTOSConfig.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/portable.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/portable/CCS/ARM_CM3/portmacro.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/mpu_wrappers.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/task.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/list.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/queue.h:
C:/ti/CC3200SDK_1.2.0/cc3200-sdk/third_party/FreeRTOS/source/include/timers.h:
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/mtype.d, _mtype.d)
* Documentation: https://dlang.org/phobos/dmd_mtype.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/mtype.d
*/
module dmd.mtype;
import core.checkedint;
import core.stdc.stdarg;
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.aggregate;
import dmd.arraytypes;
import dmd.attrib;
import dmd.ast_node;
import dmd.gluelayer;
import dmd.dclass;
import dmd.declaration;
import dmd.denum;
import dmd.dmangle;
import dmd.dscope;
import dmd.dstruct;
import dmd.dsymbol;
import dmd.dsymbolsem;
import dmd.dtemplate;
import dmd.errors;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.hdrgen;
import dmd.id;
import dmd.identifier;
import dmd.init;
import dmd.opover;
import dmd.root.ctfloat;
import dmd.root.outbuffer;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.root.stringtable;
import dmd.target;
import dmd.tokens;
import dmd.typesem;
import dmd.visitor;
enum LOGDOTEXP = 0; // log ::dotExp()
enum LOGDEFAULTINIT = 0; // log ::defaultInit()
enum SIZE_INVALID = (~cast(d_uns64)0); // error return from size() functions
/***************************
* Return !=0 if modfrom can be implicitly converted to modto
*/
bool MODimplicitConv(MOD modfrom, MOD modto) pure nothrow @nogc @safe
{
if (modfrom == modto)
return true;
//printf("MODimplicitConv(from = %x, to = %x)\n", modfrom, modto);
auto X(T, U)(T m, U n)
{
return ((m << 4) | n);
}
switch (X(modfrom & ~MODFlags.shared_, modto & ~MODFlags.shared_))
{
case X(0, MODFlags.const_):
case X(MODFlags.wild, MODFlags.const_):
case X(MODFlags.wild, MODFlags.wildconst):
case X(MODFlags.wildconst, MODFlags.const_):
return (modfrom & MODFlags.shared_) == (modto & MODFlags.shared_);
case X(MODFlags.immutable_, MODFlags.const_):
case X(MODFlags.immutable_, MODFlags.wildconst):
return true;
default:
return false;
}
}
/***************************
* Return MATCH.exact or MATCH.constant if a method of type '() modfrom' can call a method of type '() modto'.
*/
MATCH MODmethodConv(MOD modfrom, MOD modto) pure nothrow @nogc @safe
{
if (modfrom == modto)
return MATCH.exact;
if (MODimplicitConv(modfrom, modto))
return MATCH.constant;
auto X(T, U)(T m, U n)
{
return ((m << 4) | n);
}
switch (X(modfrom, modto))
{
case X(0, MODFlags.wild):
case X(MODFlags.immutable_, MODFlags.wild):
case X(MODFlags.const_, MODFlags.wild):
case X(MODFlags.wildconst, MODFlags.wild):
case X(MODFlags.shared_, MODFlags.shared_ | MODFlags.wild):
case X(MODFlags.shared_ | MODFlags.immutable_, MODFlags.shared_ | MODFlags.wild):
case X(MODFlags.shared_ | MODFlags.const_, MODFlags.shared_ | MODFlags.wild):
case X(MODFlags.shared_ | MODFlags.wildconst, MODFlags.shared_ | MODFlags.wild):
return MATCH.constant;
default:
return MATCH.nomatch;
}
}
/***************************
* Merge mod bits to form common mod.
*/
MOD MODmerge(MOD mod1, MOD mod2) pure nothrow @nogc @safe
{
if (mod1 == mod2)
return mod1;
//printf("MODmerge(1 = %x, 2 = %x)\n", mod1, mod2);
MOD result = 0;
if ((mod1 | mod2) & MODFlags.shared_)
{
// If either type is shared, the result will be shared
result |= MODFlags.shared_;
mod1 &= ~MODFlags.shared_;
mod2 &= ~MODFlags.shared_;
}
if (mod1 == 0 || mod1 == MODFlags.mutable || mod1 == MODFlags.const_ || mod2 == 0 || mod2 == MODFlags.mutable || mod2 == MODFlags.const_)
{
// If either type is mutable or const, the result will be const.
result |= MODFlags.const_;
}
else
{
// MODFlags.immutable_ vs MODFlags.wild
// MODFlags.immutable_ vs MODFlags.wildconst
// MODFlags.wild vs MODFlags.wildconst
assert(mod1 & MODFlags.wild || mod2 & MODFlags.wild);
result |= MODFlags.wildconst;
}
return result;
}
/*********************************
* Store modifier name into buf.
*/
void MODtoBuffer(OutBuffer* buf, MOD mod) nothrow
{
buf.writestring(MODtoString(mod));
}
/*********************************
* Returns:
* a human readable representation of `mod`,
* which is the token `mod` corresponds to
*/
const(char)* MODtoChars(MOD mod) nothrow pure
{
/// Works because we return a literal
return MODtoString(mod).ptr;
}
/// Ditto
string MODtoString(MOD mod) nothrow pure
{
final switch (mod)
{
case 0:
return "";
case MODFlags.immutable_:
return "immutable";
case MODFlags.shared_:
return "shared";
case MODFlags.shared_ | MODFlags.const_:
return "shared const";
case MODFlags.const_:
return "const";
case MODFlags.shared_ | MODFlags.wild:
return "shared inout";
case MODFlags.wild:
return "inout";
case MODFlags.shared_ | MODFlags.wildconst:
return "shared inout const";
case MODFlags.wildconst:
return "inout const";
}
}
/************************************
* Convert MODxxxx to STCxxx
*/
StorageClass ModToStc(uint mod) pure nothrow @nogc @safe
{
StorageClass stc = 0;
if (mod & MODFlags.immutable_)
stc |= STC.immutable_;
if (mod & MODFlags.const_)
stc |= STC.const_;
if (mod & MODFlags.wild)
stc |= STC.wild;
if (mod & MODFlags.shared_)
stc |= STC.shared_;
return stc;
}
private enum TFlags
{
integral = 1,
floating = 2,
unsigned = 4,
real_ = 8,
imaginary = 0x10,
complex = 0x20,
char_ = 0x40,
}
enum ENUMTY : int
{
Tarray, // slice array, aka T[]
Tsarray, // static array, aka T[dimension]
Taarray, // associative array, aka T[type]
Tpointer,
Treference,
Tfunction,
Tident,
Tclass,
Tstruct,
Tenum,
Tdelegate,
Tnone,
Tvoid,
Tint8,
Tuns8,
Tint16,
Tuns16,
Tint32,
Tuns32,
Tint64,
Tuns64,
Tfloat32,
Tfloat64,
Tfloat80,
Timaginary32,
Timaginary64,
Timaginary80,
Tcomplex32,
Tcomplex64,
Tcomplex80,
Tbool,
Tchar,
Twchar,
Tdchar,
Terror,
Tinstance,
Ttypeof,
Ttuple,
Tslice,
Treturn,
Tnull,
Tvector,
Tint128,
Tuns128,
TTraits,
Tmixin,
TMAX,
}
alias Tarray = ENUMTY.Tarray;
alias Tsarray = ENUMTY.Tsarray;
alias Taarray = ENUMTY.Taarray;
alias Tpointer = ENUMTY.Tpointer;
alias Treference = ENUMTY.Treference;
alias Tfunction = ENUMTY.Tfunction;
alias Tident = ENUMTY.Tident;
alias Tclass = ENUMTY.Tclass;
alias Tstruct = ENUMTY.Tstruct;
alias Tenum = ENUMTY.Tenum;
alias Tdelegate = ENUMTY.Tdelegate;
alias Tnone = ENUMTY.Tnone;
alias Tvoid = ENUMTY.Tvoid;
alias Tint8 = ENUMTY.Tint8;
alias Tuns8 = ENUMTY.Tuns8;
alias Tint16 = ENUMTY.Tint16;
alias Tuns16 = ENUMTY.Tuns16;
alias Tint32 = ENUMTY.Tint32;
alias Tuns32 = ENUMTY.Tuns32;
alias Tint64 = ENUMTY.Tint64;
alias Tuns64 = ENUMTY.Tuns64;
alias Tfloat32 = ENUMTY.Tfloat32;
alias Tfloat64 = ENUMTY.Tfloat64;
alias Tfloat80 = ENUMTY.Tfloat80;
alias Timaginary32 = ENUMTY.Timaginary32;
alias Timaginary64 = ENUMTY.Timaginary64;
alias Timaginary80 = ENUMTY.Timaginary80;
alias Tcomplex32 = ENUMTY.Tcomplex32;
alias Tcomplex64 = ENUMTY.Tcomplex64;
alias Tcomplex80 = ENUMTY.Tcomplex80;
alias Tbool = ENUMTY.Tbool;
alias Tchar = ENUMTY.Tchar;
alias Twchar = ENUMTY.Twchar;
alias Tdchar = ENUMTY.Tdchar;
alias Terror = ENUMTY.Terror;
alias Tinstance = ENUMTY.Tinstance;
alias Ttypeof = ENUMTY.Ttypeof;
alias Ttuple = ENUMTY.Ttuple;
alias Tslice = ENUMTY.Tslice;
alias Treturn = ENUMTY.Treturn;
alias Tnull = ENUMTY.Tnull;
alias Tvector = ENUMTY.Tvector;
alias Tint128 = ENUMTY.Tint128;
alias Tuns128 = ENUMTY.Tuns128;
alias Ttraits = ENUMTY.TTraits;
alias Tmixin = ENUMTY.Tmixin;
alias TMAX = ENUMTY.TMAX;
alias TY = ubyte;
enum MODFlags : int
{
const_ = 1, // type is const
immutable_ = 4, // type is immutable
shared_ = 2, // type is shared
wild = 8, // type is wild
wildconst = (MODFlags.wild | MODFlags.const_), // type is wild const
mutable = 0x10, // type is mutable (only used in wildcard matching)
}
alias MOD = ubyte;
/****************
* dotExp() bit flags
*/
enum DotExpFlag
{
gag = 1, // don't report "not a property" error and just return null
noDeref = 2, // the use of the expression will not attempt a dereference
}
/***************
* Variadic argument lists
* https://dlang.org/spec/function.html#variadic
*/
enum VarArg
{
none = 0, /// fixed number of arguments
variadic = 1, /// (T t, ...) can be C-style (core.stdc.stdarg) or D-style (core.vararg)
typesafe = 2, /// (T t ...) typesafe https://dlang.org/spec/function.html#typesafe_variadic_functions
/// or https://dlang.org/spec/function.html#typesafe_variadic_functions
}
/***********************************************************
*/
extern (C++) abstract class Type : ASTNode
{
TY ty;
MOD mod; // modifiers MODxxxx
char* deco;
/* These are cached values that are lazily evaluated by constOf(), immutableOf(), etc.
* They should not be referenced by anybody but mtype.c.
* They can be NULL if not lazily evaluated yet.
* Note that there is no "shared immutable", because that is just immutable
* Naked == no MOD bits
*/
Type cto; // MODFlags.const_ ? naked version of this type : const version
Type ito; // MODFlags.immutable_ ? naked version of this type : immutable version
Type sto; // MODFlags.shared_ ? naked version of this type : shared mutable version
Type scto; // MODFlags.shared_ | MODFlags.const_ ? naked version of this type : shared const version
Type wto; // MODFlags.wild ? naked version of this type : wild version
Type wcto; // MODFlags.wildconst ? naked version of this type : wild const version
Type swto; // MODFlags.shared_ | MODFlags.wild ? naked version of this type : shared wild version
Type swcto; // MODFlags.shared_ | MODFlags.wildconst ? naked version of this type : shared wild const version
Type pto; // merged pointer to this type
Type rto; // reference to this type
Type arrayof; // array of this type
TypeInfoDeclaration vtinfo; // TypeInfo object for this Type
type* ctype; // for back end
extern (C++) __gshared Type tvoid;
extern (C++) __gshared Type tint8;
extern (C++) __gshared Type tuns8;
extern (C++) __gshared Type tint16;
extern (C++) __gshared Type tuns16;
extern (C++) __gshared Type tint32;
extern (C++) __gshared Type tuns32;
extern (C++) __gshared Type tint64;
extern (C++) __gshared Type tuns64;
extern (C++) __gshared Type tint128;
extern (C++) __gshared Type tuns128;
extern (C++) __gshared Type tfloat32;
extern (C++) __gshared Type tfloat64;
extern (C++) __gshared Type tfloat80;
extern (C++) __gshared Type timaginary32;
extern (C++) __gshared Type timaginary64;
extern (C++) __gshared Type timaginary80;
extern (C++) __gshared Type tcomplex32;
extern (C++) __gshared Type tcomplex64;
extern (C++) __gshared Type tcomplex80;
extern (C++) __gshared Type tbool;
extern (C++) __gshared Type tchar;
extern (C++) __gshared Type twchar;
extern (C++) __gshared Type tdchar;
// Some special types
extern (C++) __gshared Type tshiftcnt;
extern (C++) __gshared Type tvoidptr; // void*
extern (C++) __gshared Type tstring; // immutable(char)[]
extern (C++) __gshared Type twstring; // immutable(wchar)[]
extern (C++) __gshared Type tdstring; // immutable(dchar)[]
extern (C++) __gshared Type tvalist; // va_list alias
extern (C++) __gshared Type terror; // for error recovery
extern (C++) __gshared Type tnull; // for null type
extern (C++) __gshared Type tsize_t; // matches size_t alias
extern (C++) __gshared Type tptrdiff_t; // matches ptrdiff_t alias
extern (C++) __gshared Type thash_t; // matches hash_t alias
extern (C++) __gshared ClassDeclaration dtypeinfo;
extern (C++) __gshared ClassDeclaration typeinfoclass;
extern (C++) __gshared ClassDeclaration typeinfointerface;
extern (C++) __gshared ClassDeclaration typeinfostruct;
extern (C++) __gshared ClassDeclaration typeinfopointer;
extern (C++) __gshared ClassDeclaration typeinfoarray;
extern (C++) __gshared ClassDeclaration typeinfostaticarray;
extern (C++) __gshared ClassDeclaration typeinfoassociativearray;
extern (C++) __gshared ClassDeclaration typeinfovector;
extern (C++) __gshared ClassDeclaration typeinfoenum;
extern (C++) __gshared ClassDeclaration typeinfofunction;
extern (C++) __gshared ClassDeclaration typeinfodelegate;
extern (C++) __gshared ClassDeclaration typeinfotypelist;
extern (C++) __gshared ClassDeclaration typeinfoconst;
extern (C++) __gshared ClassDeclaration typeinfoinvariant;
extern (C++) __gshared ClassDeclaration typeinfoshared;
extern (C++) __gshared ClassDeclaration typeinfowild;
extern (C++) __gshared TemplateDeclaration rtinfo;
extern (C++) __gshared Type[TMAX] basic;
extern (D) __gshared StringTable!Type stringtable;
extern (D) private __gshared ubyte[TMAX] sizeTy = ()
{
ubyte[TMAX] sizeTy = __traits(classInstanceSize, TypeBasic);
sizeTy[Tsarray] = __traits(classInstanceSize, TypeSArray);
sizeTy[Tarray] = __traits(classInstanceSize, TypeDArray);
sizeTy[Taarray] = __traits(classInstanceSize, TypeAArray);
sizeTy[Tpointer] = __traits(classInstanceSize, TypePointer);
sizeTy[Treference] = __traits(classInstanceSize, TypeReference);
sizeTy[Tfunction] = __traits(classInstanceSize, TypeFunction);
sizeTy[Tdelegate] = __traits(classInstanceSize, TypeDelegate);
sizeTy[Tident] = __traits(classInstanceSize, TypeIdentifier);
sizeTy[Tinstance] = __traits(classInstanceSize, TypeInstance);
sizeTy[Ttypeof] = __traits(classInstanceSize, TypeTypeof);
sizeTy[Tenum] = __traits(classInstanceSize, TypeEnum);
sizeTy[Tstruct] = __traits(classInstanceSize, TypeStruct);
sizeTy[Tclass] = __traits(classInstanceSize, TypeClass);
sizeTy[Ttuple] = __traits(classInstanceSize, TypeTuple);
sizeTy[Tslice] = __traits(classInstanceSize, TypeSlice);
sizeTy[Treturn] = __traits(classInstanceSize, TypeReturn);
sizeTy[Terror] = __traits(classInstanceSize, TypeError);
sizeTy[Tnull] = __traits(classInstanceSize, TypeNull);
sizeTy[Tvector] = __traits(classInstanceSize, TypeVector);
sizeTy[Ttraits] = __traits(classInstanceSize, TypeTraits);
sizeTy[Tmixin] = __traits(classInstanceSize, TypeMixin);
return sizeTy;
}();
final extern (D) this(TY ty)
{
this.ty = ty;
}
const(char)* kind() const nothrow pure @nogc @safe
{
assert(false); // should be overridden
}
final Type copy() nothrow const
{
Type t = cast(Type)mem.xmalloc(sizeTy[ty]);
memcpy(cast(void*)t, cast(void*)this, sizeTy[ty]);
return t;
}
Type syntaxCopy()
{
fprintf(stderr, "this = %s, ty = %d\n", toChars(), ty);
assert(0);
}
override bool equals(const RootObject o) const
{
Type t = cast(Type)o;
//printf("Type::equals(%s, %s)\n", toChars(), t.toChars());
// deco strings are unique
// and semantic() has been run
if (this == o || ((t && deco == t.deco) && deco !is null))
{
//printf("deco = '%s', t.deco = '%s'\n", deco, t.deco);
return true;
}
//if (deco && t && t.deco) printf("deco = '%s', t.deco = '%s'\n", deco, t.deco);
return false;
}
final bool equivalent(Type t)
{
return immutableOf().equals(t.immutableOf());
}
// kludge for template.isType()
override final DYNCAST dyncast() const
{
return DYNCAST.type;
}
/*******************************
* Covariant means that 'this' can substitute for 't',
* i.e. a pure function is a match for an impure type.
* Params:
* t = type 'this' is covariant with
* pstc = if not null, store STCxxxx which would make it covariant
* fix17349 = enable fix https://issues.dlang.org/show_bug.cgi?id=17349
* Returns:
* 0 types are distinct
* 1 this is covariant with t
* 2 arguments match as far as overloading goes,
* but types are not covariant
* 3 cannot determine covariance because of forward references
* *pstc STCxxxx which would make it covariant
*/
final int covariant(Type t, StorageClass* pstc = null, bool fix17349 = true)
{
version (none)
{
printf("Type::covariant(t = %s) %s\n", t.toChars(), toChars());
printf("deco = %p, %p\n", deco, t.deco);
// printf("ty = %d\n", next.ty);
printf("mod = %x, %x\n", mod, t.mod);
}
if (pstc)
*pstc = 0;
StorageClass stc = 0;
bool notcovariant = false;
if (equals(t))
return 1; // covariant
TypeFunction t1 = this.isTypeFunction();
TypeFunction t2 = t.isTypeFunction();
if (!t1 || !t2)
goto Ldistinct;
if (t1.parameterList.varargs != t2.parameterList.varargs)
goto Ldistinct;
if (t1.parameterList.parameters && t2.parameterList.parameters)
{
size_t dim = t1.parameterList.length;
if (dim != t2.parameterList.length)
goto Ldistinct;
for (size_t i = 0; i < dim; i++)
{
Parameter fparam1 = t1.parameterList[i];
Parameter fparam2 = t2.parameterList[i];
if (!fparam1.type.equals(fparam2.type))
{
if (!fix17349)
goto Ldistinct;
Type tp1 = fparam1.type;
Type tp2 = fparam2.type;
if (tp1.ty == tp2.ty)
{
if (auto tc1 = tp1.isTypeClass())
{
if (tc1.sym == (cast(TypeClass)tp2).sym && MODimplicitConv(tp2.mod, tp1.mod))
goto Lcov;
}
else if (auto ts1 = tp1.isTypeStruct())
{
if (ts1.sym == (cast(TypeStruct)tp2).sym && MODimplicitConv(tp2.mod, tp1.mod))
goto Lcov;
}
else if (tp1.ty == Tpointer)
{
if (tp2.implicitConvTo(tp1))
goto Lcov;
}
else if (tp1.ty == Tarray)
{
if (tp2.implicitConvTo(tp1))
goto Lcov;
}
else if (tp1.ty == Tdelegate)
{
if (tp1.implicitConvTo(tp2))
goto Lcov;
}
}
goto Ldistinct;
}
Lcov:
notcovariant |= !fparam1.isCovariant(t1.isref, fparam2);
}
}
else if (t1.parameterList.parameters != t2.parameterList.parameters)
{
if (t1.parameterList.length || t2.parameterList.length)
goto Ldistinct;
}
// The argument lists match
if (notcovariant)
goto Lnotcovariant;
if (t1.linkage != t2.linkage)
goto Lnotcovariant;
{
// Return types
Type t1n = t1.next;
Type t2n = t2.next;
if (!t1n || !t2n) // happens with return type inference
goto Lnotcovariant;
if (t1n.equals(t2n))
goto Lcovariant;
if (t1n.ty == Tclass && t2n.ty == Tclass)
{
/* If same class type, but t2n is const, then it's
* covariant. Do this test first because it can work on
* forward references.
*/
if ((cast(TypeClass)t1n).sym == (cast(TypeClass)t2n).sym && MODimplicitConv(t1n.mod, t2n.mod))
goto Lcovariant;
// If t1n is forward referenced:
ClassDeclaration cd = (cast(TypeClass)t1n).sym;
if (cd.semanticRun < PASS.semanticdone && !cd.isBaseInfoComplete())
cd.dsymbolSemantic(null);
if (!cd.isBaseInfoComplete())
{
return 3; // forward references
}
}
if (t1n.ty == Tstruct && t2n.ty == Tstruct)
{
if ((cast(TypeStruct)t1n).sym == (cast(TypeStruct)t2n).sym && MODimplicitConv(t1n.mod, t2n.mod))
goto Lcovariant;
}
else if (t1n.ty == t2n.ty && t1n.implicitConvTo(t2n))
goto Lcovariant;
else if (t1n.ty == Tnull)
{
// NULL is covariant with any pointer type, but not with any
// dynamic arrays, associative arrays or delegates.
// https://issues.dlang.org/show_bug.cgi?id=8589
// https://issues.dlang.org/show_bug.cgi?id=19618
Type t2bn = t2n.toBasetype();
if (t2bn.ty == Tnull || t2bn.ty == Tpointer || t2bn.ty == Tclass)
goto Lcovariant;
}
}
goto Lnotcovariant;
Lcovariant:
if (t1.isref != t2.isref)
goto Lnotcovariant;
if (!t1.isref && (t1.isscope || t2.isscope))
{
StorageClass stc1 = t1.isscope ? STC.scope_ : 0;
StorageClass stc2 = t2.isscope ? STC.scope_ : 0;
if (t1.isreturn)
{
stc1 |= STC.return_;
if (!t1.isscope)
stc1 |= STC.ref_;
}
if (t2.isreturn)
{
stc2 |= STC.return_;
if (!t2.isscope)
stc2 |= STC.ref_;
}
if (!Parameter.isCovariantScope(t1.isref, stc1, stc2))
goto Lnotcovariant;
}
// We can subtract 'return ref' from 'this', but cannot add it
else if (t1.isreturn && !t2.isreturn)
goto Lnotcovariant;
/* Can convert mutable to const
*/
if (!MODimplicitConv(t2.mod, t1.mod))
{
version (none)
{
//stop attribute inference with const
// If adding 'const' will make it covariant
if (MODimplicitConv(t2.mod, MODmerge(t1.mod, MODFlags.const_)))
stc |= STC.const_;
else
goto Lnotcovariant;
}
else
{
goto Ldistinct;
}
}
/* Can convert pure to impure, nothrow to throw, and nogc to gc
*/
if (!t1.purity && t2.purity)
stc |= STC.pure_;
if (!t1.isnothrow && t2.isnothrow)
stc |= STC.nothrow_;
if (!t1.isnogc && t2.isnogc)
stc |= STC.nogc;
/* Can convert safe/trusted to system
*/
if (t1.trust <= TRUST.system && t2.trust >= TRUST.trusted)
{
// Should we infer trusted or safe? Go with safe.
stc |= STC.safe;
}
if (stc)
{
if (pstc)
*pstc = stc;
goto Lnotcovariant;
}
//printf("\tcovaraint: 1\n");
return 1;
Ldistinct:
//printf("\tcovaraint: 0\n");
return 0;
Lnotcovariant:
//printf("\tcovaraint: 2\n");
return 2;
}
/********************************
* For pretty-printing a type.
*/
final override const(char)* toChars() const
{
OutBuffer buf;
buf.reserve(16);
HdrGenState hgs;
hgs.fullQual = (ty == Tclass && !mod);
.toCBuffer(this, &buf, null, &hgs);
return buf.extractChars();
}
/// ditto
final char* toPrettyChars(bool QualifyTypes = false)
{
OutBuffer buf;
buf.reserve(16);
HdrGenState hgs;
hgs.fullQual = QualifyTypes;
.toCBuffer(this, &buf, null, &hgs);
return buf.extractChars();
}
static void _init()
{
stringtable._init(14000);
// Set basic types
__gshared TY* basetab =
[
Tvoid,
Tint8,
Tuns8,
Tint16,
Tuns16,
Tint32,
Tuns32,
Tint64,
Tuns64,
Tint128,
Tuns128,
Tfloat32,
Tfloat64,
Tfloat80,
Timaginary32,
Timaginary64,
Timaginary80,
Tcomplex32,
Tcomplex64,
Tcomplex80,
Tbool,
Tchar,
Twchar,
Tdchar,
Terror
];
for (size_t i = 0; basetab[i] != Terror; i++)
{
Type t = new TypeBasic(basetab[i]);
t = t.merge();
basic[basetab[i]] = t;
}
basic[Terror] = new TypeError();
tvoid = basic[Tvoid];
tint8 = basic[Tint8];
tuns8 = basic[Tuns8];
tint16 = basic[Tint16];
tuns16 = basic[Tuns16];
tint32 = basic[Tint32];
tuns32 = basic[Tuns32];
tint64 = basic[Tint64];
tuns64 = basic[Tuns64];
tint128 = basic[Tint128];
tuns128 = basic[Tuns128];
tfloat32 = basic[Tfloat32];
tfloat64 = basic[Tfloat64];
tfloat80 = basic[Tfloat80];
timaginary32 = basic[Timaginary32];
timaginary64 = basic[Timaginary64];
timaginary80 = basic[Timaginary80];
tcomplex32 = basic[Tcomplex32];
tcomplex64 = basic[Tcomplex64];
tcomplex80 = basic[Tcomplex80];
tbool = basic[Tbool];
tchar = basic[Tchar];
twchar = basic[Twchar];
tdchar = basic[Tdchar];
tshiftcnt = tint32;
terror = basic[Terror];
tnull = basic[Tnull];
tnull = new TypeNull();
tnull.deco = tnull.merge().deco;
tvoidptr = tvoid.pointerTo();
tstring = tchar.immutableOf().arrayOf();
twstring = twchar.immutableOf().arrayOf();
tdstring = tdchar.immutableOf().arrayOf();
tvalist = target.va_listType();
const isLP64 = global.params.isLP64;
tsize_t = basic[isLP64 ? Tuns64 : Tuns32];
tptrdiff_t = basic[isLP64 ? Tint64 : Tint32];
thash_t = tsize_t;
}
/**
* Deinitializes the global state of the compiler.
*
* This can be used to restore the state set by `_init` to its original
* state.
*/
static void deinitialize()
{
stringtable = stringtable.init;
}
final d_uns64 size()
{
return size(Loc.initial);
}
d_uns64 size(const ref Loc loc)
{
error(loc, "no size for type `%s`", toChars());
return SIZE_INVALID;
}
uint alignsize()
{
return cast(uint)size(Loc.initial);
}
final Type trySemantic(const ref Loc loc, Scope* sc)
{
//printf("+trySemantic(%s) %d\n", toChars(), global.errors);
// Needed to display any deprecations that were gagged
auto tcopy = this.syntaxCopy();
const errors = global.startGagging();
Type t = typeSemantic(this, loc, sc);
if (global.endGagging(errors) || t.ty == Terror) // if any errors happened
{
t = null;
}
else
{
// If `typeSemantic` succeeded, there may have been deprecations that
// were gagged due the the `startGagging` above. Run again to display
// those deprecations. https://issues.dlang.org/show_bug.cgi?id=19107
if (global.gaggedWarnings > 0)
typeSemantic(tcopy, loc, sc);
}
//printf("-trySemantic(%s) %d\n", toChars(), global.errors);
return t;
}
/*************************************
* This version does a merge even if the deco is already computed.
* Necessary for types that have a deco, but are not merged.
*/
final Type merge2()
{
//printf("merge2(%s)\n", toChars());
Type t = this;
assert(t);
if (!t.deco)
return t.merge();
auto sv = stringtable.lookup(t.deco, strlen(t.deco));
if (sv && sv.value)
{
t = sv.value;
assert(t.deco);
}
else
assert(0);
return t;
}
/*********************************
* Store this type's modifier name into buf.
*/
final void modToBuffer(OutBuffer* buf) nothrow const
{
if (mod)
{
buf.writeByte(' ');
MODtoBuffer(buf, mod);
}
}
/*********************************
* Return this type's modifier name.
*/
final char* modToChars() nothrow const
{
OutBuffer buf;
buf.reserve(16);
modToBuffer(&buf);
return buf.extractChars();
}
bool isintegral()
{
return false;
}
// real, imaginary, or complex
bool isfloating()
{
return false;
}
bool isreal()
{
return false;
}
bool isimaginary()
{
return false;
}
bool iscomplex()
{
return false;
}
bool isscalar()
{
return false;
}
bool isunsigned()
{
return false;
}
bool ischar()
{
return false;
}
bool isscope()
{
return false;
}
bool isString()
{
return false;
}
/**************************
* When T is mutable,
* Given:
* T a, b;
* Can we bitwise assign:
* a = b;
* ?
*/
bool isAssignable()
{
return true;
}
/**************************
* Returns true if T can be converted to boolean value.
*/
bool isBoolean()
{
return isscalar();
}
/*********************************
* Check type to see if it is based on a deprecated symbol.
*/
void checkDeprecated(const ref Loc loc, Scope* sc)
{
if (Dsymbol s = toDsymbol(sc))
{
s.checkDeprecated(loc, sc);
}
}
final bool isConst() const nothrow pure @nogc @safe
{
return (mod & MODFlags.const_) != 0;
}
final bool isImmutable() const nothrow pure @nogc @safe
{
return (mod & MODFlags.immutable_) != 0;
}
final bool isMutable() const nothrow pure @nogc @safe
{
return (mod & (MODFlags.const_ | MODFlags.immutable_ | MODFlags.wild)) == 0;
}
final bool isShared() const nothrow pure @nogc @safe
{
return (mod & MODFlags.shared_) != 0;
}
final bool isSharedConst() const nothrow pure @nogc @safe
{
return (mod & (MODFlags.shared_ | MODFlags.const_)) == (MODFlags.shared_ | MODFlags.const_);
}
final bool isWild() const nothrow pure @nogc @safe
{
return (mod & MODFlags.wild) != 0;
}
final bool isWildConst() const nothrow pure @nogc @safe
{
return (mod & MODFlags.wildconst) == MODFlags.wildconst;
}
final bool isSharedWild() const nothrow pure @nogc @safe
{
return (mod & (MODFlags.shared_ | MODFlags.wild)) == (MODFlags.shared_ | MODFlags.wild);
}
final bool isNaked() const nothrow pure @nogc @safe
{
return mod == 0;
}
/********************************
* Return a copy of this type with all attributes null-initialized.
* Useful for creating a type with different modifiers.
*/
final Type nullAttributes() nothrow const
{
uint sz = sizeTy[ty];
Type t = cast(Type)mem.xmalloc(sz);
memcpy(cast(void*)t, cast(void*)this, sz);
// t.mod = NULL; // leave mod unchanged
t.deco = null;
t.arrayof = null;
t.pto = null;
t.rto = null;
t.cto = null;
t.ito = null;
t.sto = null;
t.scto = null;
t.wto = null;
t.wcto = null;
t.swto = null;
t.swcto = null;
t.vtinfo = null;
t.ctype = null;
if (t.ty == Tstruct)
(cast(TypeStruct)t).att = AliasThisRec.fwdref;
if (t.ty == Tclass)
(cast(TypeClass)t).att = AliasThisRec.fwdref;
return t;
}
/********************************
* Convert to 'const'.
*/
final Type constOf()
{
//printf("Type::constOf() %p %s\n", this, toChars());
if (mod == MODFlags.const_)
return this;
if (cto)
{
assert(cto.mod == MODFlags.const_);
return cto;
}
Type t = makeConst();
t = t.merge();
t.fixTo(this);
//printf("-Type::constOf() %p %s\n", t, t.toChars());
return t;
}
/********************************
* Convert to 'immutable'.
*/
final Type immutableOf()
{
//printf("Type::immutableOf() %p %s\n", this, toChars());
if (isImmutable())
return this;
if (ito)
{
assert(ito.isImmutable());
return ito;
}
Type t = makeImmutable();
t = t.merge();
t.fixTo(this);
//printf("\t%p\n", t);
return t;
}
/********************************
* Make type mutable.
*/
final Type mutableOf()
{
//printf("Type::mutableOf() %p, %s\n", this, toChars());
Type t = this;
if (isImmutable())
{
t = ito; // immutable => naked
assert(!t || (t.isMutable() && !t.isShared()));
}
else if (isConst())
{
if (isShared())
{
if (isWild())
t = swcto; // shared wild const -> shared
else
t = sto; // shared const => shared
}
else
{
if (isWild())
t = wcto; // wild const -> naked
else
t = cto; // const => naked
}
assert(!t || t.isMutable());
}
else if (isWild())
{
if (isShared())
t = sto; // shared wild => shared
else
t = wto; // wild => naked
assert(!t || t.isMutable());
}
if (!t)
{
t = makeMutable();
t = t.merge();
t.fixTo(this);
}
else
t = t.merge();
assert(t.isMutable());
return t;
}
final Type sharedOf()
{
//printf("Type::sharedOf() %p, %s\n", this, toChars());
if (mod == MODFlags.shared_)
return this;
if (sto)
{
assert(sto.mod == MODFlags.shared_);
return sto;
}
Type t = makeShared();
t = t.merge();
t.fixTo(this);
//printf("\t%p\n", t);
return t;
}
final Type sharedConstOf()
{
//printf("Type::sharedConstOf() %p, %s\n", this, toChars());
if (mod == (MODFlags.shared_ | MODFlags.const_))
return this;
if (scto)
{
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
return scto;
}
Type t = makeSharedConst();
t = t.merge();
t.fixTo(this);
//printf("\t%p\n", t);
return t;
}
/********************************
* Make type unshared.
* 0 => 0
* const => const
* immutable => immutable
* shared => 0
* shared const => const
* wild => wild
* wild const => wild const
* shared wild => wild
* shared wild const => wild const
*/
final Type unSharedOf()
{
//printf("Type::unSharedOf() %p, %s\n", this, toChars());
Type t = this;
if (isShared())
{
if (isWild())
{
if (isConst())
t = wcto; // shared wild const => wild const
else
t = wto; // shared wild => wild
}
else
{
if (isConst())
t = cto; // shared const => const
else
t = sto; // shared => naked
}
assert(!t || !t.isShared());
}
if (!t)
{
t = this.nullAttributes();
t.mod = mod & ~MODFlags.shared_;
t.ctype = ctype;
t = t.merge();
t.fixTo(this);
}
else
t = t.merge();
assert(!t.isShared());
return t;
}
/********************************
* Convert to 'wild'.
*/
final Type wildOf()
{
//printf("Type::wildOf() %p %s\n", this, toChars());
if (mod == MODFlags.wild)
return this;
if (wto)
{
assert(wto.mod == MODFlags.wild);
return wto;
}
Type t = makeWild();
t = t.merge();
t.fixTo(this);
//printf("\t%p %s\n", t, t.toChars());
return t;
}
final Type wildConstOf()
{
//printf("Type::wildConstOf() %p %s\n", this, toChars());
if (mod == MODFlags.wildconst)
return this;
if (wcto)
{
assert(wcto.mod == MODFlags.wildconst);
return wcto;
}
Type t = makeWildConst();
t = t.merge();
t.fixTo(this);
//printf("\t%p %s\n", t, t.toChars());
return t;
}
final Type sharedWildOf()
{
//printf("Type::sharedWildOf() %p, %s\n", this, toChars());
if (mod == (MODFlags.shared_ | MODFlags.wild))
return this;
if (swto)
{
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
return swto;
}
Type t = makeSharedWild();
t = t.merge();
t.fixTo(this);
//printf("\t%p %s\n", t, t.toChars());
return t;
}
final Type sharedWildConstOf()
{
//printf("Type::sharedWildConstOf() %p, %s\n", this, toChars());
if (mod == (MODFlags.shared_ | MODFlags.wildconst))
return this;
if (swcto)
{
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
return swcto;
}
Type t = makeSharedWildConst();
t = t.merge();
t.fixTo(this);
//printf("\t%p %s\n", t, t.toChars());
return t;
}
/**********************************
* For our new type 'this', which is type-constructed from t,
* fill in the cto, ito, sto, scto, wto shortcuts.
*/
final void fixTo(Type t)
{
// If fixing this: immutable(T*) by t: immutable(T)*,
// cache t to this.xto won't break transitivity.
Type mto = null;
Type tn = nextOf();
if (!tn || ty != Tsarray && tn.mod == t.nextOf().mod)
{
switch (t.mod)
{
case 0:
mto = t;
break;
case MODFlags.const_:
cto = t;
break;
case MODFlags.wild:
wto = t;
break;
case MODFlags.wildconst:
wcto = t;
break;
case MODFlags.shared_:
sto = t;
break;
case MODFlags.shared_ | MODFlags.const_:
scto = t;
break;
case MODFlags.shared_ | MODFlags.wild:
swto = t;
break;
case MODFlags.shared_ | MODFlags.wildconst:
swcto = t;
break;
case MODFlags.immutable_:
ito = t;
break;
default:
break;
}
}
assert(mod != t.mod);
auto X(T, U)(T m, U n)
{
return ((m << 4) | n);
}
switch (mod)
{
case 0:
break;
case MODFlags.const_:
cto = mto;
t.cto = this;
break;
case MODFlags.wild:
wto = mto;
t.wto = this;
break;
case MODFlags.wildconst:
wcto = mto;
t.wcto = this;
break;
case MODFlags.shared_:
sto = mto;
t.sto = this;
break;
case MODFlags.shared_ | MODFlags.const_:
scto = mto;
t.scto = this;
break;
case MODFlags.shared_ | MODFlags.wild:
swto = mto;
t.swto = this;
break;
case MODFlags.shared_ | MODFlags.wildconst:
swcto = mto;
t.swcto = this;
break;
case MODFlags.immutable_:
t.ito = this;
if (t.cto)
t.cto.ito = this;
if (t.sto)
t.sto.ito = this;
if (t.scto)
t.scto.ito = this;
if (t.wto)
t.wto.ito = this;
if (t.wcto)
t.wcto.ito = this;
if (t.swto)
t.swto.ito = this;
if (t.swcto)
t.swcto.ito = this;
break;
default:
assert(0);
}
check();
t.check();
//printf("fixTo: %s, %s\n", toChars(), t.toChars());
}
/***************************
* Look for bugs in constructing types.
*/
final void check()
{
switch (mod)
{
case 0:
if (cto)
assert(cto.mod == MODFlags.const_);
if (ito)
assert(ito.mod == MODFlags.immutable_);
if (sto)
assert(sto.mod == MODFlags.shared_);
if (scto)
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
if (wto)
assert(wto.mod == MODFlags.wild);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.const_:
if (cto)
assert(cto.mod == 0);
if (ito)
assert(ito.mod == MODFlags.immutable_);
if (sto)
assert(sto.mod == MODFlags.shared_);
if (scto)
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
if (wto)
assert(wto.mod == MODFlags.wild);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.wild:
if (cto)
assert(cto.mod == MODFlags.const_);
if (ito)
assert(ito.mod == MODFlags.immutable_);
if (sto)
assert(sto.mod == MODFlags.shared_);
if (scto)
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
if (wto)
assert(wto.mod == 0);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.wildconst:
assert(!cto || cto.mod == MODFlags.const_);
assert(!ito || ito.mod == MODFlags.immutable_);
assert(!sto || sto.mod == MODFlags.shared_);
assert(!scto || scto.mod == (MODFlags.shared_ | MODFlags.const_));
assert(!wto || wto.mod == MODFlags.wild);
assert(!wcto || wcto.mod == 0);
assert(!swto || swto.mod == (MODFlags.shared_ | MODFlags.wild));
assert(!swcto || swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.shared_:
if (cto)
assert(cto.mod == MODFlags.const_);
if (ito)
assert(ito.mod == MODFlags.immutable_);
if (sto)
assert(sto.mod == 0);
if (scto)
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
if (wto)
assert(wto.mod == MODFlags.wild);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.shared_ | MODFlags.const_:
if (cto)
assert(cto.mod == MODFlags.const_);
if (ito)
assert(ito.mod == MODFlags.immutable_);
if (sto)
assert(sto.mod == MODFlags.shared_);
if (scto)
assert(scto.mod == 0);
if (wto)
assert(wto.mod == MODFlags.wild);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.shared_ | MODFlags.wild:
if (cto)
assert(cto.mod == MODFlags.const_);
if (ito)
assert(ito.mod == MODFlags.immutable_);
if (sto)
assert(sto.mod == MODFlags.shared_);
if (scto)
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
if (wto)
assert(wto.mod == MODFlags.wild);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == 0);
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
case MODFlags.shared_ | MODFlags.wildconst:
assert(!cto || cto.mod == MODFlags.const_);
assert(!ito || ito.mod == MODFlags.immutable_);
assert(!sto || sto.mod == MODFlags.shared_);
assert(!scto || scto.mod == (MODFlags.shared_ | MODFlags.const_));
assert(!wto || wto.mod == MODFlags.wild);
assert(!wcto || wcto.mod == MODFlags.wildconst);
assert(!swto || swto.mod == (MODFlags.shared_ | MODFlags.wild));
assert(!swcto || swcto.mod == 0);
break;
case MODFlags.immutable_:
if (cto)
assert(cto.mod == MODFlags.const_);
if (ito)
assert(ito.mod == 0);
if (sto)
assert(sto.mod == MODFlags.shared_);
if (scto)
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
if (wto)
assert(wto.mod == MODFlags.wild);
if (wcto)
assert(wcto.mod == MODFlags.wildconst);
if (swto)
assert(swto.mod == (MODFlags.shared_ | MODFlags.wild));
if (swcto)
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
break;
default:
assert(0);
}
Type tn = nextOf();
if (tn && ty != Tfunction && tn.ty != Tfunction && ty != Tenum)
{
// Verify transitivity
switch (mod)
{
case 0:
case MODFlags.const_:
case MODFlags.wild:
case MODFlags.wildconst:
case MODFlags.shared_:
case MODFlags.shared_ | MODFlags.const_:
case MODFlags.shared_ | MODFlags.wild:
case MODFlags.shared_ | MODFlags.wildconst:
case MODFlags.immutable_:
assert(tn.mod == MODFlags.immutable_ || (tn.mod & mod) == mod);
break;
default:
assert(0);
}
tn.check();
}
}
/*************************************
* Apply STCxxxx bits to existing type.
* Use *before* semantic analysis is run.
*/
final Type addSTC(StorageClass stc)
{
Type t = this;
if (t.isImmutable())
{
}
else if (stc & STC.immutable_)
{
t = t.makeImmutable();
}
else
{
if ((stc & STC.shared_) && !t.isShared())
{
if (t.isWild())
{
if (t.isConst())
t = t.makeSharedWildConst();
else
t = t.makeSharedWild();
}
else
{
if (t.isConst())
t = t.makeSharedConst();
else
t = t.makeShared();
}
}
if ((stc & STC.const_) && !t.isConst())
{
if (t.isShared())
{
if (t.isWild())
t = t.makeSharedWildConst();
else
t = t.makeSharedConst();
}
else
{
if (t.isWild())
t = t.makeWildConst();
else
t = t.makeConst();
}
}
if ((stc & STC.wild) && !t.isWild())
{
if (t.isShared())
{
if (t.isConst())
t = t.makeSharedWildConst();
else
t = t.makeSharedWild();
}
else
{
if (t.isConst())
t = t.makeWildConst();
else
t = t.makeWild();
}
}
}
return t;
}
/************************************
* Apply MODxxxx bits to existing type.
*/
final Type castMod(MOD mod)
{
Type t;
switch (mod)
{
case 0:
t = unSharedOf().mutableOf();
break;
case MODFlags.const_:
t = unSharedOf().constOf();
break;
case MODFlags.wild:
t = unSharedOf().wildOf();
break;
case MODFlags.wildconst:
t = unSharedOf().wildConstOf();
break;
case MODFlags.shared_:
t = mutableOf().sharedOf();
break;
case MODFlags.shared_ | MODFlags.const_:
t = sharedConstOf();
break;
case MODFlags.shared_ | MODFlags.wild:
t = sharedWildOf();
break;
case MODFlags.shared_ | MODFlags.wildconst:
t = sharedWildConstOf();
break;
case MODFlags.immutable_:
t = immutableOf();
break;
default:
assert(0);
}
return t;
}
/************************************
* Add MODxxxx bits to existing type.
* We're adding, not replacing, so adding const to
* a shared type => "shared const"
*/
final Type addMod(MOD mod)
{
/* Add anything to immutable, and it remains immutable
*/
Type t = this;
if (!t.isImmutable())
{
//printf("addMod(%x) %s\n", mod, toChars());
switch (mod)
{
case 0:
break;
case MODFlags.const_:
if (isShared())
{
if (isWild())
t = sharedWildConstOf();
else
t = sharedConstOf();
}
else
{
if (isWild())
t = wildConstOf();
else
t = constOf();
}
break;
case MODFlags.wild:
if (isShared())
{
if (isConst())
t = sharedWildConstOf();
else
t = sharedWildOf();
}
else
{
if (isConst())
t = wildConstOf();
else
t = wildOf();
}
break;
case MODFlags.wildconst:
if (isShared())
t = sharedWildConstOf();
else
t = wildConstOf();
break;
case MODFlags.shared_:
if (isWild())
{
if (isConst())
t = sharedWildConstOf();
else
t = sharedWildOf();
}
else
{
if (isConst())
t = sharedConstOf();
else
t = sharedOf();
}
break;
case MODFlags.shared_ | MODFlags.const_:
if (isWild())
t = sharedWildConstOf();
else
t = sharedConstOf();
break;
case MODFlags.shared_ | MODFlags.wild:
if (isConst())
t = sharedWildConstOf();
else
t = sharedWildOf();
break;
case MODFlags.shared_ | MODFlags.wildconst:
t = sharedWildConstOf();
break;
case MODFlags.immutable_:
t = immutableOf();
break;
default:
assert(0);
}
}
return t;
}
/************************************
* Add storage class modifiers to type.
*/
Type addStorageClass(StorageClass stc)
{
/* Just translate to MOD bits and let addMod() do the work
*/
MOD mod = 0;
if (stc & STC.immutable_)
mod = MODFlags.immutable_;
else
{
if (stc & (STC.const_ | STC.in_))
mod |= MODFlags.const_;
if (stc & STC.wild)
mod |= MODFlags.wild;
if (stc & STC.shared_)
mod |= MODFlags.shared_;
}
return addMod(mod);
}
final Type pointerTo()
{
if (ty == Terror)
return this;
if (!pto)
{
Type t = new TypePointer(this);
if (ty == Tfunction)
{
t.deco = t.merge().deco;
pto = t;
}
else
pto = t.merge();
}
return pto;
}
final Type referenceTo()
{
if (ty == Terror)
return this;
if (!rto)
{
Type t = new TypeReference(this);
rto = t.merge();
}
return rto;
}
final Type arrayOf()
{
if (ty == Terror)
return this;
if (!arrayof)
{
Type t = new TypeDArray(this);
arrayof = t.merge();
}
return arrayof;
}
// Make corresponding static array type without semantic
final Type sarrayOf(dinteger_t dim)
{
assert(deco);
Type t = new TypeSArray(this, new IntegerExp(Loc.initial, dim, Type.tsize_t));
// according to TypeSArray::semantic()
t = t.addMod(mod);
t = t.merge();
return t;
}
final Type aliasthisOf()
{
auto ad = isAggregate(this);
if (!ad || !ad.aliasthis)
return null;
auto s = ad.aliasthis.sym;
if (s.isAliasDeclaration())
s = s.toAlias();
if (s.isTupleDeclaration())
return null;
if (auto vd = s.isVarDeclaration())
{
auto t = vd.type;
if (vd.needThis())
t = t.addMod(this.mod);
return t;
}
if (auto fd = s.isFuncDeclaration())
{
fd = resolveFuncCall(Loc.initial, null, fd, null, this, null, FuncResolveFlag.quiet);
if (!fd || fd.errors || !fd.functionSemantic())
return Type.terror;
auto t = fd.type.nextOf();
if (!t) // issue 14185
return Type.terror;
t = t.substWildTo(mod == 0 ? MODFlags.mutable : mod);
return t;
}
if (auto d = s.isDeclaration())
{
assert(d.type);
return d.type;
}
if (auto ed = s.isEnumDeclaration())
{
return ed.type;
}
if (auto td = s.isTemplateDeclaration())
{
assert(td._scope);
auto fd = resolveFuncCall(Loc.initial, null, td, null, this, null, FuncResolveFlag.quiet);
if (!fd || fd.errors || !fd.functionSemantic())
return Type.terror;
auto t = fd.type.nextOf();
if (!t)
return Type.terror;
t = t.substWildTo(mod == 0 ? MODFlags.mutable : mod);
return t;
}
//printf("%s\n", s.kind());
return null;
}
extern (D) final bool checkAliasThisRec()
{
Type tb = toBasetype();
AliasThisRec* pflag;
if (tb.ty == Tstruct)
pflag = &(cast(TypeStruct)tb).att;
else if (tb.ty == Tclass)
pflag = &(cast(TypeClass)tb).att;
else
return false;
AliasThisRec flag = cast(AliasThisRec)(*pflag & AliasThisRec.typeMask);
if (flag == AliasThisRec.fwdref)
{
Type att = aliasthisOf();
flag = att && att.implicitConvTo(this) ? AliasThisRec.yes : AliasThisRec.no;
}
*pflag = cast(AliasThisRec)(flag | (*pflag & ~AliasThisRec.typeMask));
return flag == AliasThisRec.yes;
}
Type makeConst()
{
//printf("Type::makeConst() %p, %s\n", this, toChars());
if (cto)
return cto;
Type t = this.nullAttributes();
t.mod = MODFlags.const_;
//printf("-Type::makeConst() %p, %s\n", t, toChars());
return t;
}
Type makeImmutable()
{
if (ito)
return ito;
Type t = this.nullAttributes();
t.mod = MODFlags.immutable_;
return t;
}
Type makeShared()
{
if (sto)
return sto;
Type t = this.nullAttributes();
t.mod = MODFlags.shared_;
return t;
}
Type makeSharedConst()
{
if (scto)
return scto;
Type t = this.nullAttributes();
t.mod = MODFlags.shared_ | MODFlags.const_;
return t;
}
Type makeWild()
{
if (wto)
return wto;
Type t = this.nullAttributes();
t.mod = MODFlags.wild;
return t;
}
Type makeWildConst()
{
if (wcto)
return wcto;
Type t = this.nullAttributes();
t.mod = MODFlags.wildconst;
return t;
}
Type makeSharedWild()
{
if (swto)
return swto;
Type t = this.nullAttributes();
t.mod = MODFlags.shared_ | MODFlags.wild;
return t;
}
Type makeSharedWildConst()
{
if (swcto)
return swcto;
Type t = this.nullAttributes();
t.mod = MODFlags.shared_ | MODFlags.wildconst;
return t;
}
Type makeMutable()
{
Type t = this.nullAttributes();
t.mod = mod & MODFlags.shared_;
return t;
}
Dsymbol toDsymbol(Scope* sc)
{
return null;
}
/*******************************
* If this is a shell around another type,
* get that other type.
*/
Type toBasetype()
{
return this;
}
bool isBaseOf(Type t, int* poffset)
{
return 0; // assume not
}
/********************************
* Determine if 'this' can be implicitly converted
* to type 'to'.
* Returns:
* MATCH.nomatch, MATCH.convert, MATCH.constant, MATCH.exact
*/
MATCH implicitConvTo(Type to)
{
//printf("Type::implicitConvTo(this=%p, to=%p)\n", this, to);
//printf("from: %s\n", toChars());
//printf("to : %s\n", to.toChars());
if (this.equals(to))
return MATCH.exact;
return MATCH.nomatch;
}
/*******************************
* Determine if converting 'this' to 'to' is an identity operation,
* a conversion to const operation, or the types aren't the same.
* Returns:
* MATCH.exact 'this' == 'to'
* MATCH.constant 'to' is const
* MATCH.nomatch conversion to mutable or invariant
*/
MATCH constConv(Type to)
{
//printf("Type::constConv(this = %s, to = %s)\n", toChars(), to.toChars());
if (equals(to))
return MATCH.exact;
if (ty == to.ty && MODimplicitConv(mod, to.mod))
return MATCH.constant;
return MATCH.nomatch;
}
/***************************************
* Compute MOD bits matching `this` argument type to wild parameter type.
* Params:
* t = corresponding parameter type
* isRef = parameter is `ref` or `out`
* Returns:
* MOD bits
*/
MOD deduceWild(Type t, bool isRef)
{
//printf("Type::deduceWild this = '%s', tprm = '%s'\n", toChars(), tprm.toChars());
if (t.isWild())
{
if (isImmutable())
return MODFlags.immutable_;
else if (isWildConst())
{
if (t.isWildConst())
return MODFlags.wild;
else
return MODFlags.wildconst;
}
else if (isWild())
return MODFlags.wild;
else if (isConst())
return MODFlags.const_;
else if (isMutable())
return MODFlags.mutable;
else
assert(0);
}
return 0;
}
Type substWildTo(uint mod)
{
//printf("+Type::substWildTo this = %s, mod = x%x\n", toChars(), mod);
Type t;
if (Type tn = nextOf())
{
// substitution has no effect on function pointer type.
if (ty == Tpointer && tn.ty == Tfunction)
{
t = this;
goto L1;
}
t = tn.substWildTo(mod);
if (t == tn)
t = this;
else
{
if (ty == Tpointer)
t = t.pointerTo();
else if (ty == Tarray)
t = t.arrayOf();
else if (ty == Tsarray)
t = new TypeSArray(t, (cast(TypeSArray)this).dim.syntaxCopy());
else if (ty == Taarray)
{
t = new TypeAArray(t, (cast(TypeAArray)this).index.syntaxCopy());
(cast(TypeAArray)t).sc = (cast(TypeAArray)this).sc; // duplicate scope
}
else if (ty == Tdelegate)
{
t = new TypeDelegate(t);
}
else
assert(0);
t = t.merge();
}
}
else
t = this;
L1:
if (isWild())
{
if (mod == MODFlags.immutable_)
{
t = t.immutableOf();
}
else if (mod == MODFlags.wildconst)
{
t = t.wildConstOf();
}
else if (mod == MODFlags.wild)
{
if (isWildConst())
t = t.wildConstOf();
else
t = t.wildOf();
}
else if (mod == MODFlags.const_)
{
t = t.constOf();
}
else
{
if (isWildConst())
t = t.constOf();
else
t = t.mutableOf();
}
}
if (isConst())
t = t.addMod(MODFlags.const_);
if (isShared())
t = t.addMod(MODFlags.shared_);
//printf("-Type::substWildTo t = %s\n", t.toChars());
return t;
}
final Type unqualify(uint m)
{
Type t = mutableOf().unSharedOf();
Type tn = ty == Tenum ? null : nextOf();
if (tn && tn.ty != Tfunction)
{
Type utn = tn.unqualify(m);
if (utn != tn)
{
if (ty == Tpointer)
t = utn.pointerTo();
else if (ty == Tarray)
t = utn.arrayOf();
else if (ty == Tsarray)
t = new TypeSArray(utn, (cast(TypeSArray)this).dim);
else if (ty == Taarray)
{
t = new TypeAArray(utn, (cast(TypeAArray)this).index);
(cast(TypeAArray)t).sc = (cast(TypeAArray)this).sc; // duplicate scope
}
else
assert(0);
t = t.merge();
}
}
t = t.addMod(mod & ~m);
return t;
}
/**************************
* Return type with the top level of it being mutable.
*/
inout(Type) toHeadMutable() inout
{
if (!mod)
return this;
Type unqualThis = cast(Type) this;
// `mutableOf` needs a mutable `this` only for caching
return cast(inout(Type)) unqualThis.mutableOf();
}
inout(ClassDeclaration) isClassHandle() inout
{
return null;
}
/************************************
* Return alignment to use for this type.
*/
structalign_t alignment()
{
return STRUCTALIGN_DEFAULT;
}
/***************************************
* Use when we prefer the default initializer to be a literal,
* rather than a global immutable variable.
*/
Expression defaultInitLiteral(const ref Loc loc)
{
static if (LOGDEFAULTINIT)
{
printf("Type::defaultInitLiteral() '%s'\n", toChars());
}
return defaultInit(this, loc);
}
// if initializer is 0
bool isZeroInit(const ref Loc loc)
{
return false; // assume not
}
final Identifier getTypeInfoIdent()
{
// _init_10TypeInfo_%s
OutBuffer buf;
buf.reserve(32);
mangleToBuffer(this, &buf);
const slice = buf[];
// Allocate buffer on stack, fail over to using malloc()
char[128] namebuf;
const namelen = 19 + size_t.sizeof * 3 + slice.length + 1;
auto name = namelen <= namebuf.length ? namebuf.ptr : cast(char*)Mem.check(malloc(namelen));
const length = sprintf(name, "_D%lluTypeInfo_%.*s6__initZ",
cast(ulong)(9 + slice.length), cast(int)slice.length, slice.ptr);
//printf("%p %s, deco = %s, name = %s\n", this, toChars(), deco, name);
assert(0 < length && length < namelen); // don't overflow the buffer
auto id = Identifier.idPool(name, length);
if (name != namebuf.ptr)
free(name);
return id;
}
/***************************************
* Return !=0 if the type or any of its subtypes is wild.
*/
int hasWild() const
{
return mod & MODFlags.wild;
}
/***************************************
* Return !=0 if type has pointers that need to
* be scanned by the GC during a collection cycle.
*/
bool hasPointers()
{
//printf("Type::hasPointers() %s, %d\n", toChars(), ty);
return false;
}
/*************************************
* Detect if type has pointer fields that are initialized to void.
* Local stack variables with such void fields can remain uninitialized,
* leading to pointer bugs.
* Returns:
* true if so
*/
bool hasVoidInitPointers()
{
return false;
}
/*************************************
* If this is a type of something, return that something.
*/
Type nextOf()
{
return null;
}
/*************************************
* If this is a type of static array, return its base element type.
*/
final Type baseElemOf()
{
Type t = toBasetype();
TypeSArray tsa;
while ((tsa = t.isTypeSArray()) !is null)
t = tsa.next.toBasetype();
return t;
}
/*******************************************
* Compute number of elements for a (possibly multidimensional) static array,
* or 1 for other types.
* Params:
* loc = for error message
* Returns:
* number of elements, uint.max on overflow
*/
final uint numberOfElems(const ref Loc loc)
{
//printf("Type::numberOfElems()\n");
uinteger_t n = 1;
Type tb = this;
while ((tb = tb.toBasetype()).ty == Tsarray)
{
bool overflow = false;
n = mulu(n, (cast(TypeSArray)tb).dim.toUInteger(), overflow);
if (overflow || n >= uint.max)
{
error(loc, "static array `%s` size overflowed to %llu", toChars(), cast(ulong)n);
return uint.max;
}
tb = (cast(TypeSArray)tb).next;
}
return cast(uint)n;
}
/****************************************
* Return the mask that an integral type will
* fit into.
*/
final uinteger_t sizemask()
{
uinteger_t m;
switch (toBasetype().ty)
{
case Tbool:
m = 1;
break;
case Tchar:
case Tint8:
case Tuns8:
m = 0xFF;
break;
case Twchar:
case Tint16:
case Tuns16:
m = 0xFFFFU;
break;
case Tdchar:
case Tint32:
case Tuns32:
m = 0xFFFFFFFFU;
break;
case Tint64:
case Tuns64:
m = 0xFFFFFFFFFFFFFFFFUL;
break;
default:
assert(0);
}
return m;
}
/********************************
* true if when type goes out of scope, it needs a destructor applied.
* Only applies to value types, not ref types.
*/
bool needsDestruction()
{
return false;
}
/*********************************
*
*/
bool needsNested()
{
return false;
}
/*************************************
* https://issues.dlang.org/show_bug.cgi?id=14488
* Check if the inner most base type is complex or imaginary.
* Should only give alerts when set to emit transitional messages.
* Params:
* loc = The source location.
* sc = scope of the type
*/
extern (D) final bool checkComplexTransition(const ref Loc loc, Scope* sc)
{
if (sc.isDeprecated())
return false;
Type t = baseElemOf();
while (t.ty == Tpointer || t.ty == Tarray)
t = t.nextOf().baseElemOf();
// Basetype is an opaque enum, nothing to check.
if (t.ty == Tenum && !(cast(TypeEnum)t).sym.memtype)
return false;
if (t.isimaginary() || t.iscomplex())
{
Type rt;
switch (t.ty)
{
case Tcomplex32:
case Timaginary32:
rt = Type.tfloat32;
break;
case Tcomplex64:
case Timaginary64:
rt = Type.tfloat64;
break;
case Tcomplex80:
case Timaginary80:
rt = Type.tfloat80;
break;
default:
assert(0);
}
if (t.iscomplex())
{
deprecation(loc, "use of complex type `%s` is deprecated, use `std.complex.Complex!(%s)` instead",
toChars(), rt.toChars());
return true;
}
else
{
deprecation(loc, "use of imaginary type `%s` is deprecated, use `%s` instead",
toChars(), rt.toChars());
return true;
}
}
return false;
}
// For eliminating dynamic_cast
TypeBasic isTypeBasic()
{
return null;
}
final pure inout nothrow @nogc
{
inout(TypeError) isTypeError() { return ty == Terror ? cast(typeof(return))this : null; }
inout(TypeVector) isTypeVector() { return ty == Tvector ? cast(typeof(return))this : null; }
inout(TypeSArray) isTypeSArray() { return ty == Tsarray ? cast(typeof(return))this : null; }
inout(TypeDArray) isTypeDArray() { return ty == Tarray ? cast(typeof(return))this : null; }
inout(TypeAArray) isTypeAArray() { return ty == Taarray ? cast(typeof(return))this : null; }
inout(TypePointer) isTypePointer() { return ty == Tpointer ? cast(typeof(return))this : null; }
inout(TypeReference) isTypeReference() { return ty == Treference ? cast(typeof(return))this : null; }
inout(TypeFunction) isTypeFunction() { return ty == Tfunction ? cast(typeof(return))this : null; }
inout(TypeDelegate) isTypeDelegate() { return ty == Tdelegate ? cast(typeof(return))this : null; }
inout(TypeIdentifier) isTypeIdentifier() { return ty == Tident ? cast(typeof(return))this : null; }
inout(TypeInstance) isTypeInstance() { return ty == Tinstance ? cast(typeof(return))this : null; }
inout(TypeTypeof) isTypeTypeof() { return ty == Ttypeof ? cast(typeof(return))this : null; }
inout(TypeReturn) isTypeReturn() { return ty == Treturn ? cast(typeof(return))this : null; }
inout(TypeStruct) isTypeStruct() { return ty == Tstruct ? cast(typeof(return))this : null; }
inout(TypeEnum) isTypeEnum() { return ty == Tenum ? cast(typeof(return))this : null; }
inout(TypeClass) isTypeClass() { return ty == Tclass ? cast(typeof(return))this : null; }
inout(TypeTuple) isTypeTuple() { return ty == Ttuple ? cast(typeof(return))this : null; }
inout(TypeSlice) isTypeSlice() { return ty == Tslice ? cast(typeof(return))this : null; }
inout(TypeNull) isTypeNull() { return ty == Tnull ? cast(typeof(return))this : null; }
inout(TypeMixin) isTypeMixin() { return ty == Tmixin ? cast(typeof(return))this : null; }
inout(TypeTraits) isTypeTraits() { return ty == Ttraits ? cast(typeof(return))this : null; }
}
override void accept(Visitor v)
{
v.visit(this);
}
final TypeFunction toTypeFunction()
{
if (ty != Tfunction)
assert(0);
return cast(TypeFunction)this;
}
}
/***********************************************************
*/
extern (C++) final class TypeError : Type
{
extern (D) this()
{
super(Terror);
}
override Type syntaxCopy()
{
// No semantic analysis done, no need to copy
return this;
}
override d_uns64 size(const ref Loc loc)
{
return SIZE_INVALID;
}
override Expression defaultInitLiteral(const ref Loc loc)
{
return new ErrorExp();
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) abstract class TypeNext : Type
{
Type next;
final extern (D) this(TY ty, Type next)
{
super(ty);
this.next = next;
}
override final void checkDeprecated(const ref Loc loc, Scope* sc)
{
Type.checkDeprecated(loc, sc);
if (next) // next can be NULL if TypeFunction and auto return type
next.checkDeprecated(loc, sc);
}
override final int hasWild() const
{
if (ty == Tfunction)
return 0;
if (ty == Tdelegate)
return Type.hasWild();
return mod & MODFlags.wild || (next && next.hasWild());
}
/*******************************
* For TypeFunction, nextOf() can return NULL if the function return
* type is meant to be inferred, and semantic() hasn't yet ben run
* on the function. After semantic(), it must no longer be NULL.
*/
override final Type nextOf()
{
return next;
}
override final Type makeConst()
{
//printf("TypeNext::makeConst() %p, %s\n", this, toChars());
if (cto)
{
assert(cto.mod == MODFlags.const_);
return cto;
}
TypeNext t = cast(TypeNext)Type.makeConst();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
if (next.isShared())
{
if (next.isWild())
t.next = next.sharedWildConstOf();
else
t.next = next.sharedConstOf();
}
else
{
if (next.isWild())
t.next = next.wildConstOf();
else
t.next = next.constOf();
}
}
//printf("TypeNext::makeConst() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeImmutable()
{
//printf("TypeNext::makeImmutable() %s\n", toChars());
if (ito)
{
assert(ito.isImmutable());
return ito;
}
TypeNext t = cast(TypeNext)Type.makeImmutable();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
t.next = next.immutableOf();
}
return t;
}
override final Type makeShared()
{
//printf("TypeNext::makeShared() %s\n", toChars());
if (sto)
{
assert(sto.mod == MODFlags.shared_);
return sto;
}
TypeNext t = cast(TypeNext)Type.makeShared();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
if (next.isWild())
{
if (next.isConst())
t.next = next.sharedWildConstOf();
else
t.next = next.sharedWildOf();
}
else
{
if (next.isConst())
t.next = next.sharedConstOf();
else
t.next = next.sharedOf();
}
}
//printf("TypeNext::makeShared() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeSharedConst()
{
//printf("TypeNext::makeSharedConst() %s\n", toChars());
if (scto)
{
assert(scto.mod == (MODFlags.shared_ | MODFlags.const_));
return scto;
}
TypeNext t = cast(TypeNext)Type.makeSharedConst();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
if (next.isWild())
t.next = next.sharedWildConstOf();
else
t.next = next.sharedConstOf();
}
//printf("TypeNext::makeSharedConst() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeWild()
{
//printf("TypeNext::makeWild() %s\n", toChars());
if (wto)
{
assert(wto.mod == MODFlags.wild);
return wto;
}
TypeNext t = cast(TypeNext)Type.makeWild();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
if (next.isShared())
{
if (next.isConst())
t.next = next.sharedWildConstOf();
else
t.next = next.sharedWildOf();
}
else
{
if (next.isConst())
t.next = next.wildConstOf();
else
t.next = next.wildOf();
}
}
//printf("TypeNext::makeWild() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeWildConst()
{
//printf("TypeNext::makeWildConst() %s\n", toChars());
if (wcto)
{
assert(wcto.mod == MODFlags.wildconst);
return wcto;
}
TypeNext t = cast(TypeNext)Type.makeWildConst();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
if (next.isShared())
t.next = next.sharedWildConstOf();
else
t.next = next.wildConstOf();
}
//printf("TypeNext::makeWildConst() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeSharedWild()
{
//printf("TypeNext::makeSharedWild() %s\n", toChars());
if (swto)
{
assert(swto.isSharedWild());
return swto;
}
TypeNext t = cast(TypeNext)Type.makeSharedWild();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
if (next.isConst())
t.next = next.sharedWildConstOf();
else
t.next = next.sharedWildOf();
}
//printf("TypeNext::makeSharedWild() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeSharedWildConst()
{
//printf("TypeNext::makeSharedWildConst() %s\n", toChars());
if (swcto)
{
assert(swcto.mod == (MODFlags.shared_ | MODFlags.wildconst));
return swcto;
}
TypeNext t = cast(TypeNext)Type.makeSharedWildConst();
if (ty != Tfunction && next.ty != Tfunction && !next.isImmutable())
{
t.next = next.sharedWildConstOf();
}
//printf("TypeNext::makeSharedWildConst() returns %p, %s\n", t, t.toChars());
return t;
}
override final Type makeMutable()
{
//printf("TypeNext::makeMutable() %p, %s\n", this, toChars());
TypeNext t = cast(TypeNext)Type.makeMutable();
if (ty == Tsarray)
{
t.next = next.mutableOf();
}
//printf("TypeNext::makeMutable() returns %p, %s\n", t, t.toChars());
return t;
}
override MATCH constConv(Type to)
{
//printf("TypeNext::constConv from = %s, to = %s\n", toChars(), to.toChars());
if (equals(to))
return MATCH.exact;
if (!(ty == to.ty && MODimplicitConv(mod, to.mod)))
return MATCH.nomatch;
Type tn = to.nextOf();
if (!(tn && next.ty == tn.ty))
return MATCH.nomatch;
MATCH m;
if (to.isConst()) // whole tail const conversion
{
// Recursive shared level check
m = next.constConv(tn);
if (m == MATCH.exact)
m = MATCH.constant;
}
else
{
//printf("\tnext => %s, to.next => %s\n", next.toChars(), tn.toChars());
m = next.equals(tn) ? MATCH.constant : MATCH.nomatch;
}
return m;
}
override final MOD deduceWild(Type t, bool isRef)
{
if (ty == Tfunction)
return 0;
ubyte wm;
Type tn = t.nextOf();
if (!isRef && (ty == Tarray || ty == Tpointer) && tn)
{
wm = next.deduceWild(tn, true);
if (!wm)
wm = Type.deduceWild(t, true);
}
else
{
wm = Type.deduceWild(t, isRef);
if (!wm && tn)
wm = next.deduceWild(tn, true);
}
return wm;
}
final void transitive()
{
/* Invoke transitivity of type attributes
*/
next = next.addMod(mod);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeBasic : Type
{
const(char)* dstring;
uint flags;
extern (D) this(TY ty)
{
super(ty);
const(char)* d;
uint flags = 0;
switch (ty)
{
case Tvoid:
d = Token.toChars(TOK.void_);
break;
case Tint8:
d = Token.toChars(TOK.int8);
flags |= TFlags.integral;
break;
case Tuns8:
d = Token.toChars(TOK.uns8);
flags |= TFlags.integral | TFlags.unsigned;
break;
case Tint16:
d = Token.toChars(TOK.int16);
flags |= TFlags.integral;
break;
case Tuns16:
d = Token.toChars(TOK.uns16);
flags |= TFlags.integral | TFlags.unsigned;
break;
case Tint32:
d = Token.toChars(TOK.int32);
flags |= TFlags.integral;
break;
case Tuns32:
d = Token.toChars(TOK.uns32);
flags |= TFlags.integral | TFlags.unsigned;
break;
case Tfloat32:
d = Token.toChars(TOK.float32);
flags |= TFlags.floating | TFlags.real_;
break;
case Tint64:
d = Token.toChars(TOK.int64);
flags |= TFlags.integral;
break;
case Tuns64:
d = Token.toChars(TOK.uns64);
flags |= TFlags.integral | TFlags.unsigned;
break;
case Tint128:
d = Token.toChars(TOK.int128);
flags |= TFlags.integral;
break;
case Tuns128:
d = Token.toChars(TOK.uns128);
flags |= TFlags.integral | TFlags.unsigned;
break;
case Tfloat64:
d = Token.toChars(TOK.float64);
flags |= TFlags.floating | TFlags.real_;
break;
case Tfloat80:
d = Token.toChars(TOK.float80);
flags |= TFlags.floating | TFlags.real_;
break;
case Timaginary32:
d = Token.toChars(TOK.imaginary32);
flags |= TFlags.floating | TFlags.imaginary;
break;
case Timaginary64:
d = Token.toChars(TOK.imaginary64);
flags |= TFlags.floating | TFlags.imaginary;
break;
case Timaginary80:
d = Token.toChars(TOK.imaginary80);
flags |= TFlags.floating | TFlags.imaginary;
break;
case Tcomplex32:
d = Token.toChars(TOK.complex32);
flags |= TFlags.floating | TFlags.complex;
break;
case Tcomplex64:
d = Token.toChars(TOK.complex64);
flags |= TFlags.floating | TFlags.complex;
break;
case Tcomplex80:
d = Token.toChars(TOK.complex80);
flags |= TFlags.floating | TFlags.complex;
break;
case Tbool:
d = "bool";
flags |= TFlags.integral | TFlags.unsigned;
break;
case Tchar:
d = Token.toChars(TOK.char_);
flags |= TFlags.integral | TFlags.unsigned | TFlags.char_;
break;
case Twchar:
d = Token.toChars(TOK.wchar_);
flags |= TFlags.integral | TFlags.unsigned | TFlags.char_;
break;
case Tdchar:
d = Token.toChars(TOK.dchar_);
flags |= TFlags.integral | TFlags.unsigned | TFlags.char_;
break;
default:
assert(0);
}
this.dstring = d;
this.flags = flags;
merge(this);
}
override const(char)* kind() const
{
return dstring;
}
override Type syntaxCopy()
{
// No semantic analysis done on basic types, no need to copy
return this;
}
override d_uns64 size(const ref Loc loc) const
{
uint size;
//printf("TypeBasic::size()\n");
switch (ty)
{
case Tint8:
case Tuns8:
size = 1;
break;
case Tint16:
case Tuns16:
size = 2;
break;
case Tint32:
case Tuns32:
case Tfloat32:
case Timaginary32:
size = 4;
break;
case Tint64:
case Tuns64:
case Tfloat64:
case Timaginary64:
size = 8;
break;
case Tfloat80:
case Timaginary80:
size = target.realsize;
break;
case Tcomplex32:
size = 8;
break;
case Tcomplex64:
case Tint128:
case Tuns128:
size = 16;
break;
case Tcomplex80:
size = target.realsize * 2;
break;
case Tvoid:
//size = Type::size(); // error message
size = 1;
break;
case Tbool:
size = 1;
break;
case Tchar:
size = 1;
break;
case Twchar:
size = 2;
break;
case Tdchar:
size = 4;
break;
default:
assert(0);
}
//printf("TypeBasic::size() = %d\n", size);
return size;
}
override uint alignsize()
{
return target.alignsize(this);
}
override bool isintegral()
{
//printf("TypeBasic::isintegral('%s') x%x\n", toChars(), flags);
return (flags & TFlags.integral) != 0;
}
override bool isfloating() const
{
return (flags & TFlags.floating) != 0;
}
override bool isreal() const
{
return (flags & TFlags.real_) != 0;
}
override bool isimaginary() const
{
return (flags & TFlags.imaginary) != 0;
}
override bool iscomplex() const
{
return (flags & TFlags.complex) != 0;
}
override bool isscalar() const
{
return (flags & (TFlags.integral | TFlags.floating)) != 0;
}
override bool isunsigned() const
{
return (flags & TFlags.unsigned) != 0;
}
override bool ischar() const
{
return (flags & TFlags.char_) != 0;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeBasic::implicitConvTo(%s) from %s\n", to.toChars(), toChars());
if (this == to)
return MATCH.exact;
if (ty == to.ty)
{
if (mod == to.mod)
return MATCH.exact;
else if (MODimplicitConv(mod, to.mod))
return MATCH.constant;
else if (!((mod ^ to.mod) & MODFlags.shared_)) // for wild matching
return MATCH.constant;
else
return MATCH.convert;
}
if (ty == Tvoid || to.ty == Tvoid)
return MATCH.nomatch;
if (to.ty == Tbool)
return MATCH.nomatch;
TypeBasic tob;
if (to.ty == Tvector && to.deco)
{
TypeVector tv = cast(TypeVector)to;
tob = tv.elementType();
}
else if (auto te = to.isTypeEnum())
{
EnumDeclaration ed = te.sym;
if (ed.isSpecial())
{
/* Special enums that allow implicit conversions to them
* with a MATCH.convert
*/
tob = to.toBasetype().isTypeBasic();
}
else
return MATCH.nomatch;
}
else
tob = to.isTypeBasic();
if (!tob)
return MATCH.nomatch;
if (flags & TFlags.integral)
{
// Disallow implicit conversion of integers to imaginary or complex
if (tob.flags & (TFlags.imaginary | TFlags.complex))
return MATCH.nomatch;
// If converting from integral to integral
if (tob.flags & TFlags.integral)
{
d_uns64 sz = size(Loc.initial);
d_uns64 tosz = tob.size(Loc.initial);
/* Can't convert to smaller size
*/
if (sz > tosz)
return MATCH.nomatch;
/* Can't change sign if same size
*/
//if (sz == tosz && (flags ^ tob.flags) & TFlags.unsigned)
// return MATCH.nomatch;
}
}
else if (flags & TFlags.floating)
{
// Disallow implicit conversion of floating point to integer
if (tob.flags & TFlags.integral)
return MATCH.nomatch;
assert(tob.flags & TFlags.floating || to.ty == Tvector);
// Disallow implicit conversion from complex to non-complex
if (flags & TFlags.complex && !(tob.flags & TFlags.complex))
return MATCH.nomatch;
// Disallow implicit conversion of real or imaginary to complex
if (flags & (TFlags.real_ | TFlags.imaginary) && tob.flags & TFlags.complex)
return MATCH.nomatch;
// Disallow implicit conversion to-from real and imaginary
if ((flags & (TFlags.real_ | TFlags.imaginary)) != (tob.flags & (TFlags.real_ | TFlags.imaginary)))
return MATCH.nomatch;
}
return MATCH.convert;
}
override bool isZeroInit(const ref Loc loc) const
{
switch (ty)
{
case Tchar:
case Twchar:
case Tdchar:
case Timaginary32:
case Timaginary64:
case Timaginary80:
case Tfloat32:
case Tfloat64:
case Tfloat80:
case Tcomplex32:
case Tcomplex64:
case Tcomplex80:
return false; // no
default:
return true; // yes
}
}
// For eliminating dynamic_cast
override TypeBasic isTypeBasic()
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* The basetype must be one of:
* byte[16],ubyte[16],short[8],ushort[8],int[4],uint[4],long[2],ulong[2],float[4],double[2]
* For AVX:
* byte[32],ubyte[32],short[16],ushort[16],int[8],uint[8],long[4],ulong[4],float[8],double[4]
*/
extern (C++) final class TypeVector : Type
{
Type basetype;
extern (D) this(Type basetype)
{
super(Tvector);
this.basetype = basetype;
}
static TypeVector create(Type basetype)
{
return new TypeVector(basetype);
}
override const(char)* kind() const
{
return "vector";
}
override Type syntaxCopy()
{
return new TypeVector(basetype.syntaxCopy());
}
override d_uns64 size(const ref Loc loc)
{
return basetype.size();
}
override uint alignsize()
{
return cast(uint)basetype.size();
}
override bool isintegral()
{
//printf("TypeVector::isintegral('%s') x%x\n", toChars(), flags);
return basetype.nextOf().isintegral();
}
override bool isfloating()
{
return basetype.nextOf().isfloating();
}
override bool isscalar()
{
return basetype.nextOf().isscalar();
}
override bool isunsigned()
{
return basetype.nextOf().isunsigned();
}
override bool isBoolean() const
{
return false;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeVector::implicitConvTo(%s) from %s\n", to.toChars(), toChars());
if (this == to)
return MATCH.exact;
if (ty == to.ty)
return MATCH.convert;
return MATCH.nomatch;
}
override Expression defaultInitLiteral(const ref Loc loc)
{
//printf("TypeVector::defaultInitLiteral()\n");
assert(basetype.ty == Tsarray);
Expression e = basetype.defaultInitLiteral(loc);
auto ve = new VectorExp(loc, e, this);
ve.type = this;
ve.dim = cast(int)(basetype.size(loc) / elementType().size(loc));
return ve;
}
TypeBasic elementType()
{
assert(basetype.ty == Tsarray);
TypeSArray t = cast(TypeSArray)basetype;
TypeBasic tb = t.nextOf().isTypeBasic();
assert(tb);
return tb;
}
override bool isZeroInit(const ref Loc loc)
{
return basetype.isZeroInit(loc);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) abstract class TypeArray : TypeNext
{
final extern (D) this(TY ty, Type next)
{
super(ty, next);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Static array, one with a fixed dimension
*/
extern (C++) final class TypeSArray : TypeArray
{
Expression dim;
extern (D) this(Type t, Expression dim)
{
super(Tsarray, t);
//printf("TypeSArray(%s)\n", dim.toChars());
this.dim = dim;
}
override const(char)* kind() const
{
return "sarray";
}
override Type syntaxCopy()
{
Type t = next.syntaxCopy();
Expression e = dim.syntaxCopy();
t = new TypeSArray(t, e);
t.mod = mod;
return t;
}
override d_uns64 size(const ref Loc loc)
{
//printf("TypeSArray::size()\n");
const n = numberOfElems(loc);
const elemsize = baseElemOf().size(loc);
bool overflow = false;
const sz = mulu(n, elemsize, overflow);
if (overflow || sz >= uint.max)
{
if (elemsize != SIZE_INVALID && n != uint.max)
error(loc, "static array `%s` size overflowed to %lld", toChars(), cast(long)sz);
return SIZE_INVALID;
}
return sz;
}
override uint alignsize()
{
return next.alignsize();
}
override bool isString()
{
TY nty = next.toBasetype().ty;
return nty == Tchar || nty == Twchar || nty == Tdchar;
}
override bool isZeroInit(const ref Loc loc)
{
return next.isZeroInit(loc);
}
override structalign_t alignment()
{
return next.alignment();
}
override MATCH constConv(Type to)
{
if (auto tsa = to.isTypeSArray())
{
if (!dim.equals(tsa.dim))
return MATCH.nomatch;
}
return TypeNext.constConv(to);
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeSArray::implicitConvTo(to = %s) this = %s\n", to.toChars(), toChars());
if (auto ta = to.isTypeDArray())
{
if (!MODimplicitConv(next.mod, ta.next.mod))
return MATCH.nomatch;
/* Allow conversion to void[]
*/
if (ta.next.ty == Tvoid)
{
return MATCH.convert;
}
MATCH m = next.constConv(ta.next);
if (m > MATCH.nomatch)
{
return MATCH.convert;
}
return MATCH.nomatch;
}
if (auto tsa = to.isTypeSArray())
{
if (this == to)
return MATCH.exact;
if (dim.equals(tsa.dim))
{
/* Since static arrays are value types, allow
* conversions from const elements to non-const
* ones, just like we allow conversion from const int
* to int.
*/
MATCH m = next.implicitConvTo(tsa.next);
if (m >= MATCH.constant)
{
if (mod != to.mod)
m = MATCH.constant;
return m;
}
}
}
return MATCH.nomatch;
}
override Expression defaultInitLiteral(const ref Loc loc)
{
static if (LOGDEFAULTINIT)
{
printf("TypeSArray::defaultInitLiteral() '%s'\n", toChars());
}
size_t d = cast(size_t)dim.toInteger();
Expression elementinit;
if (next.ty == Tvoid)
elementinit = tuns8.defaultInitLiteral(loc);
else
elementinit = next.defaultInitLiteral(loc);
auto elements = new Expressions(d);
foreach (ref e; *elements)
e = null;
auto ae = new ArrayLiteralExp(Loc.initial, this, elementinit, elements);
return ae;
}
override bool hasPointers()
{
/* Don't want to do this, because:
* struct S { T* array[0]; }
* may be a variable length struct.
*/
//if (dim.toInteger() == 0)
// return false;
if (next.ty == Tvoid)
{
// Arrays of void contain arbitrary data, which may include pointers
return true;
}
else
return next.hasPointers();
}
override bool needsDestruction()
{
return next.needsDestruction();
}
/*********************************
*
*/
override bool needsNested()
{
return next.needsNested();
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Dynamic array, no dimension
*/
extern (C++) final class TypeDArray : TypeArray
{
extern (D) this(Type t)
{
super(Tarray, t);
//printf("TypeDArray(t = %p)\n", t);
}
override const(char)* kind() const
{
return "darray";
}
override Type syntaxCopy()
{
Type t = next.syntaxCopy();
if (t == next)
t = this;
else
{
t = new TypeDArray(t);
t.mod = mod;
}
return t;
}
override d_uns64 size(const ref Loc loc) const
{
//printf("TypeDArray::size()\n");
return target.ptrsize * 2;
}
override uint alignsize() const
{
// A DArray consists of two ptr-sized values, so align it on pointer size
// boundary
return target.ptrsize;
}
override bool isString()
{
TY nty = next.toBasetype().ty;
return nty == Tchar || nty == Twchar || nty == Tdchar;
}
override bool isZeroInit(const ref Loc loc) const
{
return true;
}
override bool isBoolean() const
{
return true;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeDArray::implicitConvTo(to = %s) this = %s\n", to.toChars(), toChars());
if (equals(to))
return MATCH.exact;
if (auto ta = to.isTypeDArray())
{
if (!MODimplicitConv(next.mod, ta.next.mod))
return MATCH.nomatch; // not const-compatible
/* Allow conversion to void[]
*/
if (next.ty != Tvoid && ta.next.ty == Tvoid)
{
return MATCH.convert;
}
MATCH m = next.constConv(ta.next);
if (m > MATCH.nomatch)
{
if (m == MATCH.exact && mod != to.mod)
m = MATCH.constant;
return m;
}
}
return Type.implicitConvTo(to);
}
override bool hasPointers() const
{
return true;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeAArray : TypeArray
{
Type index; // key type
Loc loc;
Scope* sc;
extern (D) this(Type t, Type index)
{
super(Taarray, t);
this.index = index;
}
static TypeAArray create(Type t, Type index)
{
return new TypeAArray(t, index);
}
override const(char)* kind() const
{
return "aarray";
}
override Type syntaxCopy()
{
Type t = next.syntaxCopy();
Type ti = index.syntaxCopy();
if (t == next && ti == index)
t = this;
else
{
t = new TypeAArray(t, ti);
t.mod = mod;
}
return t;
}
override d_uns64 size(const ref Loc loc) const
{
return target.ptrsize;
}
override bool isZeroInit(const ref Loc loc) const
{
return true;
}
override bool isBoolean() const
{
return true;
}
override bool hasPointers() const
{
return true;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeAArray::implicitConvTo(to = %s) this = %s\n", to.toChars(), toChars());
if (equals(to))
return MATCH.exact;
if (auto ta = to.isTypeAArray())
{
if (!MODimplicitConv(next.mod, ta.next.mod))
return MATCH.nomatch; // not const-compatible
if (!MODimplicitConv(index.mod, ta.index.mod))
return MATCH.nomatch; // not const-compatible
MATCH m = next.constConv(ta.next);
MATCH mi = index.constConv(ta.index);
if (m > MATCH.nomatch && mi > MATCH.nomatch)
{
return MODimplicitConv(mod, to.mod) ? MATCH.constant : MATCH.nomatch;
}
}
return Type.implicitConvTo(to);
}
override MATCH constConv(Type to)
{
if (auto taa = to.isTypeAArray())
{
MATCH mindex = index.constConv(taa.index);
MATCH mkey = next.constConv(taa.next);
// Pick the worst match
return mkey < mindex ? mkey : mindex;
}
return Type.constConv(to);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypePointer : TypeNext
{
extern (D) this(Type t)
{
super(Tpointer, t);
}
static TypePointer create(Type t)
{
return new TypePointer(t);
}
override const(char)* kind() const
{
return "pointer";
}
override Type syntaxCopy()
{
Type t = next.syntaxCopy();
if (t == next)
t = this;
else
{
t = new TypePointer(t);
t.mod = mod;
}
return t;
}
override d_uns64 size(const ref Loc loc) const
{
return target.ptrsize;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypePointer::implicitConvTo(to = %s) %s\n", to.toChars(), toChars());
if (equals(to))
return MATCH.exact;
if (next.ty == Tfunction)
{
if (auto tp = to.isTypePointer())
{
if (tp.next.ty == Tfunction)
{
if (next.equals(tp.next))
return MATCH.constant;
if (next.covariant(tp.next) == 1)
{
Type tret = this.next.nextOf();
Type toret = tp.next.nextOf();
if (tret.ty == Tclass && toret.ty == Tclass)
{
/* https://issues.dlang.org/show_bug.cgi?id=10219
* Check covariant interface return with offset tweaking.
* interface I {}
* class C : Object, I {}
* I function() dg = function C() {} // should be error
*/
int offset = 0;
if (toret.isBaseOf(tret, &offset) && offset != 0)
return MATCH.nomatch;
}
return MATCH.convert;
}
}
else if (tp.next.ty == Tvoid)
{
// Allow conversions to void*
return MATCH.convert;
}
}
return MATCH.nomatch;
}
else if (auto tp = to.isTypePointer())
{
assert(tp.next);
if (!MODimplicitConv(next.mod, tp.next.mod))
return MATCH.nomatch; // not const-compatible
/* Alloc conversion to void*
*/
if (next.ty != Tvoid && tp.next.ty == Tvoid)
{
return MATCH.convert;
}
MATCH m = next.constConv(tp.next);
if (m > MATCH.nomatch)
{
if (m == MATCH.exact && mod != to.mod)
m = MATCH.constant;
return m;
}
}
return MATCH.nomatch;
}
override MATCH constConv(Type to)
{
if (next.ty == Tfunction)
{
if (to.nextOf() && next.equals((cast(TypeNext)to).next))
return Type.constConv(to);
else
return MATCH.nomatch;
}
return TypeNext.constConv(to);
}
override bool isscalar() const
{
return true;
}
override bool isZeroInit(const ref Loc loc) const
{
return true;
}
override bool hasPointers() const
{
return true;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeReference : TypeNext
{
extern (D) this(Type t)
{
super(Treference, t);
// BUG: what about references to static arrays?
}
override const(char)* kind() const
{
return "reference";
}
override Type syntaxCopy()
{
Type t = next.syntaxCopy();
if (t == next)
t = this;
else
{
t = new TypeReference(t);
t.mod = mod;
}
return t;
}
override d_uns64 size(const ref Loc loc) const
{
return target.ptrsize;
}
override bool isZeroInit(const ref Loc loc) const
{
return true;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
enum RET : int
{
regs = 1, // returned in registers
stack = 2, // returned on stack
}
enum TRUST : int
{
default_ = 0,
system = 1, // @system (same as TRUST.default)
trusted = 2, // @trusted
safe = 3, // @safe
}
enum TRUSTformat : int
{
TRUSTformatDefault, // do not emit @system when trust == TRUST.default_
TRUSTformatSystem, // emit @system when trust == TRUST.default_
}
alias TRUSTformatDefault = TRUSTformat.TRUSTformatDefault;
alias TRUSTformatSystem = TRUSTformat.TRUSTformatSystem;
enum PURE : int
{
impure = 0, // not pure at all
fwdref = 1, // it's pure, but not known which level yet
weak = 2, // no mutable globals are read or written
const_ = 3, // parameters are values or const
strong = 4, // parameters are values or immutable
}
/***********************************************************
*/
extern (C++) final class TypeFunction : TypeNext
{
// .next is the return type
ParameterList parameterList; // function parameters
bool isnothrow; // true: nothrow
bool isnogc; // true: is @nogc
bool isproperty; // can be called without parentheses
bool isref; // true: returns a reference
bool isreturn; // true: 'this' is returned by ref
bool isscope; // true: 'this' is scope
bool isreturninferred; // true: 'this' is return from inference
bool isscopeinferred; // true: 'this' is scope from inference
LINK linkage; // calling convention
TRUST trust; // level of trust
PURE purity = PURE.impure;
ubyte iswild; // bit0: inout on params, bit1: inout on qualifier
Expressions* fargs; // function arguments
int inuse;
bool incomplete; // return type or default arguments removed
extern (D) this(ParameterList pl, Type treturn, LINK linkage, StorageClass stc = 0)
{
super(Tfunction, treturn);
//if (!treturn) *(char*)0=0;
// assert(treturn);
assert(VarArg.none <= pl.varargs && pl.varargs <= VarArg.typesafe);
this.parameterList = pl;
this.linkage = linkage;
if (stc & STC.pure_)
this.purity = PURE.fwdref;
if (stc & STC.nothrow_)
this.isnothrow = true;
if (stc & STC.nogc)
this.isnogc = true;
if (stc & STC.property)
this.isproperty = true;
if (stc & STC.ref_)
this.isref = true;
if (stc & STC.return_)
this.isreturn = true;
if (stc & STC.returninferred)
this.isreturninferred = true;
if (stc & STC.scope_)
this.isscope = true;
if (stc & STC.scopeinferred)
this.isscopeinferred = true;
this.trust = TRUST.default_;
if (stc & STC.safe)
this.trust = TRUST.safe;
if (stc & STC.system)
this.trust = TRUST.system;
if (stc & STC.trusted)
this.trust = TRUST.trusted;
}
static TypeFunction create(Parameters* parameters, Type treturn, VarArg varargs, LINK linkage, StorageClass stc = 0)
{
return new TypeFunction(ParameterList(parameters, varargs), treturn, linkage, stc);
}
override const(char)* kind() const
{
return "function";
}
override Type syntaxCopy()
{
Type treturn = next ? next.syntaxCopy() : null;
Parameters* params = Parameter.arraySyntaxCopy(parameterList.parameters);
auto t = new TypeFunction(ParameterList(params, parameterList.varargs), treturn, linkage);
t.mod = mod;
t.isnothrow = isnothrow;
t.isnogc = isnogc;
t.purity = purity;
t.isproperty = isproperty;
t.isref = isref;
t.isreturn = isreturn;
t.isscope = isscope;
t.isreturninferred = isreturninferred;
t.isscopeinferred = isscopeinferred;
t.iswild = iswild;
t.trust = trust;
t.fargs = fargs;
return t;
}
/********************************************
* Set 'purity' field of 'this'.
* Do this lazily, as the parameter types might be forward referenced.
*/
void purityLevel()
{
TypeFunction tf = this;
if (tf.purity != PURE.fwdref)
return;
/* Determine purity level based on mutability of t
* and whether it is a 'ref' type or not.
*/
static PURE purityOfType(bool isref, Type t)
{
if (isref)
{
if (t.mod & MODFlags.immutable_)
return PURE.strong;
if (t.mod & (MODFlags.const_ | MODFlags.wild))
return PURE.const_;
return PURE.weak;
}
t = t.baseElemOf();
if (!t.hasPointers() || t.mod & MODFlags.immutable_)
return PURE.strong;
/* Accept immutable(T)[] and immutable(T)* as being strongly pure
*/
if (t.ty == Tarray || t.ty == Tpointer)
{
Type tn = t.nextOf().toBasetype();
if (tn.mod & MODFlags.immutable_)
return PURE.strong;
if (tn.mod & (MODFlags.const_ | MODFlags.wild))
return PURE.const_;
}
/* The rest of this is too strict; fix later.
* For example, the only pointer members of a struct may be immutable,
* which would maintain strong purity.
* (Just like for dynamic arrays and pointers above.)
*/
if (t.mod & (MODFlags.const_ | MODFlags.wild))
return PURE.const_;
/* Should catch delegates and function pointers, and fold in their purity
*/
return PURE.weak;
}
purity = PURE.strong; // assume strong until something weakens it
/* Evaluate what kind of purity based on the modifiers for the parameters
*/
const dim = tf.parameterList.length;
Lloop: foreach (i; 0 .. dim)
{
Parameter fparam = tf.parameterList[i];
Type t = fparam.type;
if (!t)
continue;
if (fparam.storageClass & (STC.lazy_ | STC.out_))
{
purity = PURE.weak;
break;
}
switch (purityOfType((fparam.storageClass & STC.ref_) != 0, t))
{
case PURE.weak:
purity = PURE.weak;
break Lloop; // since PURE.weak, no need to check further
case PURE.const_:
purity = PURE.const_;
continue;
case PURE.strong:
continue;
default:
assert(0);
}
}
if (purity > PURE.weak && tf.nextOf())
{
/* Adjust purity based on mutability of return type.
* https://issues.dlang.org/show_bug.cgi?id=15862
*/
const purity2 = purityOfType(tf.isref, tf.nextOf());
if (purity2 < purity)
purity = purity2;
}
tf.purity = purity;
}
/********************************************
* Return true if there are lazy parameters.
*/
bool hasLazyParameters()
{
size_t dim = parameterList.length;
for (size_t i = 0; i < dim; i++)
{
Parameter fparam = parameterList[i];
if (fparam.storageClass & STC.lazy_)
return true;
}
return false;
}
/***************************
* Examine function signature for parameter p and see if
* the value of p can 'escape' the scope of the function.
* This is useful to minimize the needed annotations for the parameters.
* Params:
* tthis = type of `this` parameter, null if none
* p = parameter to this function
* Returns:
* true if escapes via assignment to global or through a parameter
*/
bool parameterEscapes(Type tthis, Parameter p)
{
/* Scope parameters do not escape.
* Allow 'lazy' to imply 'scope' -
* lazy parameters can be passed along
* as lazy parameters to the next function, but that isn't
* escaping.
*/
if (parameterStorageClass(tthis, p) & (STC.scope_ | STC.lazy_))
return false;
return true;
}
/************************************
* Take the specified storage class for p,
* and use the function signature to infer whether
* STC.scope_ and STC.return_ should be OR'd in.
* (This will not affect the name mangling.)
* Params:
* tthis = type of `this` parameter, null if none
* p = parameter to this function
* Returns:
* storage class with STC.scope_ or STC.return_ OR'd in
*/
StorageClass parameterStorageClass(Type tthis, Parameter p)
{
//printf("parameterStorageClass(p: %s)\n", p.toChars());
auto stc = p.storageClass;
if (!global.params.vsafe)
return stc;
if (stc & (STC.scope_ | STC.return_ | STC.lazy_) || purity == PURE.impure)
return stc;
/* If haven't inferred the return type yet, can't infer storage classes
*/
if (!nextOf())
return stc;
purityLevel();
// See if p can escape via any of the other parameters
if (purity == PURE.weak)
{
// Check escaping through parameters
const dim = parameterList.length;
foreach (const i; 0 .. dim)
{
Parameter fparam = parameterList[i];
if (fparam == p)
continue;
Type t = fparam.type;
if (!t)
continue;
t = t.baseElemOf();
if (t.isMutable() && t.hasPointers())
{
if (fparam.storageClass & (STC.ref_ | STC.out_))
{
}
else if (t.ty == Tarray || t.ty == Tpointer)
{
Type tn = t.nextOf().toBasetype();
if (!(tn.isMutable() && tn.hasPointers()))
continue;
}
return stc;
}
}
// Check escaping through `this`
if (tthis && tthis.isMutable())
{
auto tb = tthis.toBasetype();
AggregateDeclaration ad;
if (auto tc = tb.isTypeClass())
ad = tc.sym;
else if (auto ts = tb.isTypeStruct())
ad = ts.sym;
else
assert(0);
foreach (VarDeclaration v; ad.fields)
{
if (v.hasPointers())
return stc;
}
}
}
stc |= STC.scope_;
/* Inferring STC.return_ here has false positives
* for pure functions, producing spurious error messages
* about escaping references.
* Give up on it for now.
*/
version (none)
{
Type tret = nextOf().toBasetype();
if (isref || tret.hasPointers())
{
/* The result has references, so p could be escaping
* that way.
*/
stc |= STC.return_;
}
}
return stc;
}
override Type addStorageClass(StorageClass stc)
{
//printf("addStorageClass(%llx) %d\n", stc, (stc & STC.scope_) != 0);
TypeFunction t = Type.addStorageClass(stc).toTypeFunction();
if ((stc & STC.pure_ && !t.purity) ||
(stc & STC.nothrow_ && !t.isnothrow) ||
(stc & STC.nogc && !t.isnogc) ||
(stc & STC.scope_ && !t.isscope) ||
(stc & STC.safe && t.trust < TRUST.trusted))
{
// Klunky to change these
auto tf = new TypeFunction(t.parameterList, t.next, t.linkage, 0);
tf.mod = t.mod;
tf.fargs = fargs;
tf.purity = t.purity;
tf.isnothrow = t.isnothrow;
tf.isnogc = t.isnogc;
tf.isproperty = t.isproperty;
tf.isref = t.isref;
tf.isreturn = t.isreturn;
tf.isscope = t.isscope;
tf.isreturninferred = t.isreturninferred;
tf.isscopeinferred = t.isscopeinferred;
tf.trust = t.trust;
tf.iswild = t.iswild;
if (stc & STC.pure_)
tf.purity = PURE.fwdref;
if (stc & STC.nothrow_)
tf.isnothrow = true;
if (stc & STC.nogc)
tf.isnogc = true;
if (stc & STC.safe)
tf.trust = TRUST.safe;
if (stc & STC.scope_)
{
tf.isscope = true;
if (stc & STC.scopeinferred)
tf.isscopeinferred = true;
}
tf.deco = tf.merge().deco;
t = tf;
}
return t;
}
override Type substWildTo(uint)
{
if (!iswild && !(mod & MODFlags.wild))
return this;
// Substitude inout qualifier of function type to mutable or immutable
// would break type system. Instead substitude inout to the most weak
// qualifer - const.
uint m = MODFlags.const_;
assert(next);
Type tret = next.substWildTo(m);
Parameters* params = parameterList.parameters;
if (mod & MODFlags.wild)
params = parameterList.parameters.copy();
for (size_t i = 0; i < params.dim; i++)
{
Parameter p = (*params)[i];
Type t = p.type.substWildTo(m);
if (t == p.type)
continue;
if (params == parameterList.parameters)
params = parameterList.parameters.copy();
(*params)[i] = new Parameter(p.storageClass, t, null, null, null);
}
if (next == tret && params == parameterList.parameters)
return this;
// Similar to TypeFunction::syntaxCopy;
auto t = new TypeFunction(ParameterList(params, parameterList.varargs), tret, linkage);
t.mod = ((mod & MODFlags.wild) ? (mod & ~MODFlags.wild) | MODFlags.const_ : mod);
t.isnothrow = isnothrow;
t.isnogc = isnogc;
t.purity = purity;
t.isproperty = isproperty;
t.isref = isref;
t.isreturn = isreturn;
t.isscope = isscope;
t.isreturninferred = isreturninferred;
t.isscopeinferred = isscopeinferred;
t.iswild = 0;
t.trust = trust;
t.fargs = fargs;
return t.merge();
}
// arguments get specially formatted
private const(char)* getParamError(Expression arg, Parameter par)
{
if (global.gag && !global.params.showGaggedErrors)
return null;
// show qualification when toChars() is the same but types are different
auto at = arg.type.toChars();
bool qual = !arg.type.equals(par.type) && strcmp(at, par.type.toChars()) == 0;
if (qual)
at = arg.type.toPrettyChars(true);
OutBuffer buf;
// only mention rvalue if it's relevant
const rv = !arg.isLvalue() && par.storageClass & (STC.ref_ | STC.out_);
buf.printf("cannot pass %sargument `%s` of type `%s` to parameter `%s`",
rv ? "rvalue ".ptr : "".ptr, arg.toChars(), at,
parameterToChars(par, this, qual));
return buf.extractChars();
}
private extern(D) const(char)* getMatchError(A...)(const(char)* format, A args)
{
if (global.gag && !global.params.showGaggedErrors)
return null;
OutBuffer buf;
buf.printf(format, args);
return buf.extractChars();
}
/********************************
* 'args' are being matched to function 'this'
* Determine match level.
* Params:
* tthis = type of `this` pointer, null if not member function
* args = array of function arguments
* flag = 1: performing a partial ordering match
* pMessage = address to store error message, or null
* sc = context
* Returns:
* MATCHxxxx
*/
extern (D) MATCH callMatch(Type tthis, Expression[] args, int flag = 0, const(char)** pMessage = null, Scope* sc = null)
{
//printf("TypeFunction::callMatch() %s\n", toChars());
MATCH match = MATCH.exact; // assume exact match
ubyte wildmatch = 0;
if (tthis)
{
Type t = tthis;
if (t.toBasetype().ty == Tpointer)
t = t.toBasetype().nextOf(); // change struct* to struct
if (t.mod != mod)
{
if (MODimplicitConv(t.mod, mod))
match = MATCH.constant;
else if ((mod & MODFlags.wild) && MODimplicitConv(t.mod, (mod & ~MODFlags.wild) | MODFlags.const_))
{
match = MATCH.constant;
}
else
return MATCH.nomatch;
}
if (isWild())
{
if (t.isWild())
wildmatch |= MODFlags.wild;
else if (t.isConst())
wildmatch |= MODFlags.const_;
else if (t.isImmutable())
wildmatch |= MODFlags.immutable_;
else
wildmatch |= MODFlags.mutable;
}
}
size_t nparams = parameterList.length;
size_t nargs = args.length;
if (nargs > nparams)
{
if (parameterList.varargs == VarArg.none)
{
// suppress early exit if an error message is wanted,
// so we can check any matching args are valid
if (!pMessage)
goto Nomatch;
}
// too many args; no match
match = MATCH.convert; // match ... with a "conversion" match level
}
for (size_t u = 0; u < nargs; u++)
{
if (u >= nparams)
break;
Parameter p = parameterList[u];
Expression arg = args[u];
assert(arg);
Type tprm = p.type;
Type targ = arg.type;
if (!(p.storageClass & STC.lazy_ && tprm.ty == Tvoid && targ.ty != Tvoid))
{
bool isRef = (p.storageClass & (STC.ref_ | STC.out_)) != 0;
wildmatch |= targ.deduceWild(tprm, isRef);
}
}
if (wildmatch)
{
/* Calculate wild matching modifier
*/
if (wildmatch & MODFlags.const_ || wildmatch & (wildmatch - 1))
wildmatch = MODFlags.const_;
else if (wildmatch & MODFlags.immutable_)
wildmatch = MODFlags.immutable_;
else if (wildmatch & MODFlags.wild)
wildmatch = MODFlags.wild;
else
{
assert(wildmatch & MODFlags.mutable);
wildmatch = MODFlags.mutable;
}
}
for (size_t u = 0; u < nparams; u++)
{
MATCH m;
Parameter p = parameterList[u];
assert(p);
if (u >= nargs)
{
if (p.defaultArg)
continue;
// try typesafe variadics
goto L1;
}
{
Expression arg = args[u];
assert(arg);
//printf("arg: %s, type: %s\n", arg.toChars(), arg.type.toChars());
Type targ = arg.type;
Type tprm = wildmatch ? p.type.substWildTo(wildmatch) : p.type;
if (p.storageClass & STC.lazy_ && tprm.ty == Tvoid && targ.ty != Tvoid)
m = MATCH.convert;
else
{
//printf("%s of type %s implicitConvTo %s\n", arg.toChars(), targ.toChars(), tprm.toChars());
if (flag)
{
// for partial ordering, value is an irrelevant mockup, just look at the type
m = targ.implicitConvTo(tprm);
}
else
{
const isRef = (p.storageClass & (STC.ref_ | STC.out_)) != 0;
StructDeclaration argStruct, prmStruct;
// first look for a copy constructor
if (arg.isLvalue() && !isRef && targ.ty == Tstruct && tprm.ty == Tstruct)
{
// if the argument and the parameter are of the same unqualified struct type
argStruct = (cast(TypeStruct)targ).sym;
prmStruct = (cast(TypeStruct)tprm).sym;
}
// check if the copy constructor may be called to copy the argument
if (argStruct && argStruct == prmStruct && argStruct.hasCopyCtor)
{
/* this is done by seeing if a call to the copy constructor can be made:
*
* typeof(tprm) __copytmp;
* copytmp.__copyCtor(arg);
*/
auto tmp = new VarDeclaration(arg.loc, tprm, Identifier.generateId("__copytmp"), null);
tmp.dsymbolSemantic(sc);
Expression ve = new VarExp(arg.loc, tmp);
Expression e = new DotIdExp(arg.loc, ve, Id.ctor);
e = new CallExp(arg.loc, e, arg);
//printf("e = %s\n", e.toChars());
if(.trySemantic(e, sc))
m = MATCH.exact;
else
{
m = MATCH.nomatch;
if (pMessage)
{
OutBuffer buf;
buf.printf("`struct %s` does not define a copy constructor for `%s` to `%s` copies",
argStruct.toChars(), targ.toChars(), tprm.toChars());
*pMessage = buf.extractChars();
}
goto Nomatch;
}
}
else
m = arg.implicitConvTo(tprm);
}
//printf("match %d\n", m);
}
// Non-lvalues do not match ref or out parameters
if (p.storageClass & (STC.ref_ | STC.out_))
{
// https://issues.dlang.org/show_bug.cgi?id=13783
// Don't use toBasetype() to handle enum types.
Type ta = targ;
Type tp = tprm;
//printf("fparam[%d] ta = %s, tp = %s\n", u, ta.toChars(), tp.toChars());
if (m && !arg.isLvalue())
{
if (p.storageClass & STC.out_)
{
if (pMessage) *pMessage = getParamError(arg, p);
goto Nomatch;
}
if (arg.op == TOK.string_ && tp.ty == Tsarray)
{
if (ta.ty != Tsarray)
{
Type tn = tp.nextOf().castMod(ta.nextOf().mod);
dinteger_t dim = (cast(StringExp)arg).len;
ta = tn.sarrayOf(dim);
}
}
else if (arg.op == TOK.slice && tp.ty == Tsarray)
{
// Allow conversion from T[lwr .. upr] to ref T[upr-lwr]
if (ta.ty != Tsarray)
{
Type tn = ta.nextOf();
dinteger_t dim = (cast(TypeSArray)tp).dim.toUInteger();
ta = tn.sarrayOf(dim);
}
}
else if (!global.params.rvalueRefParam ||
p.storageClass & STC.out_ ||
!arg.type.isCopyable()) // can't copy to temp for ref parameter
{
if (pMessage) *pMessage = getParamError(arg, p);
goto Nomatch;
}
else
{
/* in functionParameters() we'll convert this
* rvalue into a temporary
*/
m = MATCH.convert;
}
}
/* Find most derived alias this type being matched.
* https://issues.dlang.org/show_bug.cgi?id=15674
* Allow on both ref and out parameters.
*/
while (1)
{
Type tab = ta.toBasetype();
Type tat = tab.aliasthisOf();
if (!tat || !tat.implicitConvTo(tprm))
break;
if (tat == tab)
break;
ta = tat;
}
/* A ref variable should work like a head-const reference.
* e.g. disallows:
* ref T <- an lvalue of const(T) argument
* ref T[dim] <- an lvalue of const(T[dim]) argument
*/
if (!ta.constConv(tp))
{
if (pMessage) *pMessage = getParamError(arg, p);
goto Nomatch;
}
}
}
/* prefer matching the element type rather than the array
* type when more arguments are present with T[]...
*/
if (parameterList.varargs == VarArg.typesafe && u + 1 == nparams && nargs > nparams)
goto L1;
//printf("\tm = %d\n", m);
if (m == MATCH.nomatch) // if no match
{
L1:
if (parameterList.varargs == VarArg.typesafe && u + 1 == nparams) // if last varargs param
{
Type tb = p.type.toBasetype();
TypeSArray tsa;
dinteger_t sz;
switch (tb.ty)
{
case Tsarray:
tsa = cast(TypeSArray)tb;
sz = tsa.dim.toInteger();
if (sz != nargs - u)
{
if (pMessage)
// Windows (Vista) OutBuffer.vprintf issue? 2nd argument always zero
//*pMessage = getMatchError("expected %d variadic argument(s), not %d", sz, nargs - u);
if (!global.gag || global.params.showGaggedErrors)
{
OutBuffer buf;
buf.printf("expected %d variadic argument(s)", sz);
buf.printf(", not %d", nargs - u);
*pMessage = buf.extractChars();
}
goto Nomatch;
}
goto case Tarray;
case Tarray:
{
TypeArray ta = cast(TypeArray)tb;
foreach (arg; args[u .. nargs])
{
assert(arg);
/* If lazy array of delegates,
* convert arg(s) to delegate(s)
*/
Type tret = p.isLazyArray();
if (tret)
{
if (ta.next.equals(arg.type))
m = MATCH.exact;
else if (tret.toBasetype().ty == Tvoid)
m = MATCH.convert;
else
{
m = arg.implicitConvTo(tret);
if (m == MATCH.nomatch)
m = arg.implicitConvTo(ta.next);
}
}
else
m = arg.implicitConvTo(ta.next);
if (m == MATCH.nomatch)
{
if (pMessage) *pMessage = getParamError(arg, p);
goto Nomatch;
}
if (m < match)
match = m;
}
goto Ldone;
}
case Tclass:
// Should see if there's a constructor match?
// Or just leave it ambiguous?
goto Ldone;
default:
break;
}
}
if (pMessage && u < nargs)
*pMessage = getParamError(args[u], p);
else if (pMessage)
*pMessage = getMatchError("missing argument for parameter #%d: `%s`",
u + 1, parameterToChars(p, this, false));
goto Nomatch;
}
if (m < match)
match = m; // pick worst match
}
Ldone:
if (pMessage && !parameterList.varargs && nargs > nparams)
{
// all parameters had a match, but there are surplus args
*pMessage = getMatchError("expected %d argument(s), not %d", nparams, nargs);
goto Nomatch;
}
//printf("match = %d\n", match);
return match;
Nomatch:
//printf("no match\n");
return MATCH.nomatch;
}
extern (D) bool checkRetType(const ref Loc loc)
{
Type tb = next.toBasetype();
if (tb.ty == Tfunction)
{
error(loc, "functions cannot return a function");
next = Type.terror;
}
if (tb.ty == Ttuple)
{
error(loc, "functions cannot return a tuple");
next = Type.terror;
}
if (!isref && (tb.ty == Tstruct || tb.ty == Tsarray))
{
if (auto ts = tb.baseElemOf().isTypeStruct())
{
if (!ts.sym.members)
{
error(loc, "functions cannot return opaque type `%s` by value", tb.toChars());
next = Type.terror;
}
}
}
if (tb.ty == Terror)
return true;
return false;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeDelegate : TypeNext
{
// .next is a TypeFunction
extern (D) this(Type t)
{
super(Tfunction, t);
ty = Tdelegate;
}
static TypeDelegate create(Type t)
{
return new TypeDelegate(t);
}
override const(char)* kind() const
{
return "delegate";
}
override Type syntaxCopy()
{
Type t = next.syntaxCopy();
if (t == next)
t = this;
else
{
t = new TypeDelegate(t);
t.mod = mod;
}
return t;
}
override Type addStorageClass(StorageClass stc)
{
TypeDelegate t = cast(TypeDelegate)Type.addStorageClass(stc);
if (!global.params.vsafe)
return t;
/* The rest is meant to add 'scope' to a delegate declaration if it is of the form:
* alias dg_t = void* delegate();
* scope dg_t dg = ...;
*/
if(stc & STC.scope_)
{
auto n = t.next.addStorageClass(STC.scope_ | STC.scopeinferred);
if (n != t.next)
{
t.next = n;
t.deco = t.merge().deco; // mangling supposed to not be changed due to STC.scope_inferrred
}
}
return t;
}
override d_uns64 size(const ref Loc loc) const
{
return target.ptrsize * 2;
}
override uint alignsize() const
{
return target.ptrsize;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeDelegate.implicitConvTo(this=%p, to=%p)\n", this, to);
//printf("from: %s\n", toChars());
//printf("to : %s\n", to.toChars());
if (this == to)
return MATCH.exact;
version (all)
{
// not allowing covariant conversions because it interferes with overriding
if (to.ty == Tdelegate && this.nextOf().covariant(to.nextOf()) == 1)
{
Type tret = this.next.nextOf();
Type toret = (cast(TypeDelegate)to).next.nextOf();
if (tret.ty == Tclass && toret.ty == Tclass)
{
/* https://issues.dlang.org/show_bug.cgi?id=10219
* Check covariant interface return with offset tweaking.
* interface I {}
* class C : Object, I {}
* I delegate() dg = delegate C() {} // should be error
*/
int offset = 0;
if (toret.isBaseOf(tret, &offset) && offset != 0)
return MATCH.nomatch;
}
return MATCH.convert;
}
}
return MATCH.nomatch;
}
override bool isZeroInit(const ref Loc loc) const
{
return true;
}
override bool isBoolean() const
{
return true;
}
override bool hasPointers() const
{
return true;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/**
* This is a shell containing a TraitsExp that can be
* either resolved to a type or to a symbol.
*
* The point is to allow AliasDeclarationY to use `__traits()`, see issue 7804.
*/
extern (C++) final class TypeTraits : Type
{
Loc loc;
/// The expression to resolve as type or symbol.
TraitsExp exp;
/// After `typeSemantic` the symbol when `exp` doesn't represent a type.
Dsymbol sym;
final extern (D) this(const ref Loc loc, TraitsExp exp)
{
super(Ttraits);
this.loc = loc;
this.exp = exp;
}
override Type syntaxCopy()
{
TraitsExp te = cast(TraitsExp) exp.syntaxCopy();
TypeTraits tt = new TypeTraits(loc, te);
tt.mod = mod;
return tt;
}
override void accept(Visitor v)
{
v.visit(this);
}
override d_uns64 size(const ref Loc loc)
{
return SIZE_INVALID;
}
}
/******
* Implements mixin types.
*
* Semantic analysis will convert it to a real type.
*/
extern (C++) final class TypeMixin : Type
{
Expressions* exps;
extern (D) this(Expressions* exps)
{
super(Tmixin);
this.exps = exps;
}
override const(char)* kind() const
{
return "mixin";
}
override Type syntaxCopy()
{
return new TypeMixin(Expression.arraySyntaxCopy(exps));
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) abstract class TypeQualified : Type
{
Loc loc;
// array of Identifier and TypeInstance,
// representing ident.ident!tiargs.ident. ... etc.
Objects idents;
final extern (D) this(TY ty, Loc loc)
{
super(ty);
this.loc = loc;
}
final void syntaxCopyHelper(TypeQualified t)
{
//printf("TypeQualified::syntaxCopyHelper(%s) %s\n", t.toChars(), toChars());
idents.setDim(t.idents.dim);
for (size_t i = 0; i < idents.dim; i++)
{
RootObject id = t.idents[i];
if (id.dyncast() == DYNCAST.dsymbol)
{
TemplateInstance ti = cast(TemplateInstance)id;
ti = cast(TemplateInstance)ti.syntaxCopy(null);
id = ti;
}
else if (id.dyncast() == DYNCAST.expression)
{
Expression e = cast(Expression)id;
e = e.syntaxCopy();
id = e;
}
else if (id.dyncast() == DYNCAST.type)
{
Type tx = cast(Type)id;
tx = tx.syntaxCopy();
id = tx;
}
idents[i] = id;
}
}
final void addIdent(Identifier ident)
{
idents.push(ident);
}
final void addInst(TemplateInstance inst)
{
idents.push(inst);
}
final void addIndex(RootObject e)
{
idents.push(e);
}
override d_uns64 size(const ref Loc loc)
{
error(this.loc, "size of type `%s` is not known", toChars());
return SIZE_INVALID;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeIdentifier : TypeQualified
{
Identifier ident;
// The symbol representing this identifier, before alias resolution
Dsymbol originalSymbol;
extern (D) this(const ref Loc loc, Identifier ident)
{
super(Tident, loc);
this.ident = ident;
}
override const(char)* kind() const
{
return "identifier";
}
override Type syntaxCopy()
{
auto t = new TypeIdentifier(loc, ident);
t.syntaxCopyHelper(this);
t.mod = mod;
return t;
}
/*****************************************
* See if type resolves to a symbol, if so,
* return that symbol.
*/
override Dsymbol toDsymbol(Scope* sc)
{
//printf("TypeIdentifier::toDsymbol('%s')\n", toChars());
if (!sc)
return null;
Type t;
Expression e;
Dsymbol s;
resolve(this, loc, sc, &e, &t, &s);
if (t && t.ty != Tident)
s = t.toDsymbol(sc);
if (e)
s = getDsymbol(e);
return s;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Similar to TypeIdentifier, but with a TemplateInstance as the root
*/
extern (C++) final class TypeInstance : TypeQualified
{
TemplateInstance tempinst;
extern (D) this(const ref Loc loc, TemplateInstance tempinst)
{
super(Tinstance, loc);
this.tempinst = tempinst;
}
override const(char)* kind() const
{
return "instance";
}
override Type syntaxCopy()
{
//printf("TypeInstance::syntaxCopy() %s, %d\n", toChars(), idents.dim);
auto t = new TypeInstance(loc, cast(TemplateInstance)tempinst.syntaxCopy(null));
t.syntaxCopyHelper(this);
t.mod = mod;
return t;
}
override Dsymbol toDsymbol(Scope* sc)
{
Type t;
Expression e;
Dsymbol s;
//printf("TypeInstance::semantic(%s)\n", toChars());
resolve(this, loc, sc, &e, &t, &s);
if (t && t.ty != Tinstance)
s = t.toDsymbol(sc);
return s;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeTypeof : TypeQualified
{
Expression exp;
int inuse;
extern (D) this(const ref Loc loc, Expression exp)
{
super(Ttypeof, loc);
this.exp = exp;
}
override const(char)* kind() const
{
return "typeof";
}
override Type syntaxCopy()
{
//printf("TypeTypeof::syntaxCopy() %s\n", toChars());
auto t = new TypeTypeof(loc, exp.syntaxCopy());
t.syntaxCopyHelper(this);
t.mod = mod;
return t;
}
override Dsymbol toDsymbol(Scope* sc)
{
//printf("TypeTypeof::toDsymbol('%s')\n", toChars());
Expression e;
Type t;
Dsymbol s;
resolve(this, loc, sc, &e, &t, &s);
return s;
}
override d_uns64 size(const ref Loc loc)
{
if (exp.type)
return exp.type.size(loc);
else
return TypeQualified.size(loc);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeReturn : TypeQualified
{
extern (D) this(const ref Loc loc)
{
super(Treturn, loc);
}
override const(char)* kind() const
{
return "return";
}
override Type syntaxCopy()
{
auto t = new TypeReturn(loc);
t.syntaxCopyHelper(this);
t.mod = mod;
return t;
}
override Dsymbol toDsymbol(Scope* sc)
{
Expression e;
Type t;
Dsymbol s;
resolve(this, loc, sc, &e, &t, &s);
return s;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
// Whether alias this dependency is recursive or not.
enum AliasThisRec : int
{
no = 0, // no alias this recursion
yes = 1, // alias this has recursive dependency
fwdref = 2, // not yet known
typeMask = 3, // mask to read no/yes/fwdref
tracing = 0x4, // mark in progress of implicitConvTo/deduceWild
tracingDT = 0x8, // mark in progress of deduceType
}
/***********************************************************
*/
extern (C++) final class TypeStruct : Type
{
StructDeclaration sym;
AliasThisRec att = AliasThisRec.fwdref;
CPPMANGLE cppmangle = CPPMANGLE.def;
extern (D) this(StructDeclaration sym)
{
super(Tstruct);
this.sym = sym;
}
static TypeStruct create(StructDeclaration sym)
{
return new TypeStruct(sym);
}
override const(char)* kind() const
{
return "struct";
}
override d_uns64 size(const ref Loc loc)
{
return sym.size(loc);
}
override uint alignsize()
{
sym.size(Loc.initial); // give error for forward references
return sym.alignsize;
}
override Type syntaxCopy()
{
return this;
}
override Dsymbol toDsymbol(Scope* sc)
{
return sym;
}
override structalign_t alignment()
{
if (sym.alignment == 0)
sym.size(sym.loc);
return sym.alignment;
}
/***************************************
* Use when we prefer the default initializer to be a literal,
* rather than a global immutable variable.
*/
override Expression defaultInitLiteral(const ref Loc loc)
{
static if (LOGDEFAULTINIT)
{
printf("TypeStruct::defaultInitLiteral() '%s'\n", toChars());
}
sym.size(loc);
if (sym.sizeok != Sizeok.done)
return new ErrorExp();
auto structelems = new Expressions(sym.nonHiddenFields());
uint offset = 0;
foreach (j; 0 .. structelems.dim)
{
VarDeclaration vd = sym.fields[j];
Expression e;
if (vd.inuse)
{
error(loc, "circular reference to `%s`", vd.toPrettyChars());
return new ErrorExp();
}
if (vd.offset < offset || vd.type.size() == 0)
e = null;
else if (vd._init)
{
if (vd._init.isVoidInitializer())
e = null;
else
e = vd.getConstInitializer(false);
}
else
e = vd.type.defaultInitLiteral(loc);
if (e && e.op == TOK.error)
return e;
if (e)
offset = vd.offset + cast(uint)vd.type.size();
(*structelems)[j] = e;
}
auto structinit = new StructLiteralExp(loc, sym, structelems);
/* Copy from the initializer symbol for larger symbols,
* otherwise the literals expressed as code get excessively large.
*/
if (size(loc) > target.ptrsize * 4 && !needsNested())
structinit.useStaticInit = true;
structinit.type = this;
return structinit;
}
override bool isZeroInit(const ref Loc loc) const
{
return sym.zeroInit;
}
override bool isAssignable()
{
bool assignable = true;
uint offset = ~0; // dead-store initialize to prevent spurious warning
sym.determineSize(sym.loc);
/* If any of the fields are const or immutable,
* then one cannot assign this struct.
*/
for (size_t i = 0; i < sym.fields.dim; i++)
{
VarDeclaration v = sym.fields[i];
//printf("%s [%d] v = (%s) %s, v.offset = %d, v.parent = %s\n", sym.toChars(), i, v.kind(), v.toChars(), v.offset, v.parent.kind());
if (i == 0)
{
}
else if (v.offset == offset)
{
/* If any fields of anonymous union are assignable,
* then regard union as assignable.
* This is to support unsafe things like Rebindable templates.
*/
if (assignable)
continue;
}
else
{
if (!assignable)
return false;
}
assignable = v.type.isMutable() && v.type.isAssignable();
offset = v.offset;
//printf(" -> assignable = %d\n", assignable);
}
return assignable;
}
override bool isBoolean() const
{
return false;
}
override bool needsDestruction() const
{
return sym.dtor !is null;
}
override bool needsNested()
{
if (sym.isNested())
return true;
for (size_t i = 0; i < sym.fields.dim; i++)
{
VarDeclaration v = sym.fields[i];
if (!v.isDataseg() && v.type.needsNested())
return true;
}
return false;
}
override bool hasPointers()
{
// Probably should cache this information in sym rather than recompute
StructDeclaration s = sym;
if (sym.members && !sym.determineFields() && sym.type != Type.terror)
error(sym.loc, "no size because of forward references");
foreach (VarDeclaration v; s.fields)
{
if (v.storage_class & STC.ref_ || v.hasPointers())
return true;
}
return false;
}
override bool hasVoidInitPointers()
{
// Probably should cache this information in sym rather than recompute
StructDeclaration s = sym;
sym.size(Loc.initial); // give error for forward references
foreach (VarDeclaration v; s.fields)
{
if (v._init && v._init.isVoidInitializer() && v.type.hasPointers())
return true;
if (!v._init && v.type.hasVoidInitPointers())
return true;
}
return false;
}
extern (D) MATCH implicitConvToWithoutAliasThis(Type to)
{
MATCH m;
if (ty == to.ty && sym == (cast(TypeStruct)to).sym)
{
m = MATCH.exact; // exact match
if (mod != to.mod)
{
m = MATCH.constant;
if (MODimplicitConv(mod, to.mod))
{
}
else
{
/* Check all the fields. If they can all be converted,
* allow the conversion.
*/
uint offset = ~0; // dead-store to prevent spurious warning
for (size_t i = 0; i < sym.fields.dim; i++)
{
VarDeclaration v = sym.fields[i];
if (i == 0)
{
}
else if (v.offset == offset)
{
if (m > MATCH.nomatch)
continue;
}
else
{
if (m <= MATCH.nomatch)
return m;
}
// 'from' type
Type tvf = v.type.addMod(mod);
// 'to' type
Type tv = v.type.addMod(to.mod);
// field match
MATCH mf = tvf.implicitConvTo(tv);
//printf("\t%s => %s, match = %d\n", v.type.toChars(), tv.toChars(), mf);
if (mf <= MATCH.nomatch)
return mf;
if (mf < m) // if field match is worse
m = mf;
offset = v.offset;
}
}
}
}
return m;
}
extern (D) MATCH implicitConvToThroughAliasThis(Type to)
{
MATCH m;
if (!(ty == to.ty && sym == (cast(TypeStruct)to).sym) && sym.aliasthis && !(att & AliasThisRec.tracing))
{
if (auto ato = aliasthisOf())
{
att = cast(AliasThisRec)(att | AliasThisRec.tracing);
m = ato.implicitConvTo(to);
att = cast(AliasThisRec)(att & ~AliasThisRec.tracing);
}
else
m = MATCH.nomatch; // no match
}
return m;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeStruct::implicitConvTo(%s => %s)\n", toChars(), to.toChars());
MATCH m = implicitConvToWithoutAliasThis(to);
return m ? m : implicitConvToThroughAliasThis(to);
}
override MATCH constConv(Type to)
{
if (equals(to))
return MATCH.exact;
if (ty == to.ty && sym == (cast(TypeStruct)to).sym && MODimplicitConv(mod, to.mod))
return MATCH.constant;
return MATCH.nomatch;
}
override MOD deduceWild(Type t, bool isRef)
{
if (ty == t.ty && sym == (cast(TypeStruct)t).sym)
return Type.deduceWild(t, isRef);
ubyte wm = 0;
if (t.hasWild() && sym.aliasthis && !(att & AliasThisRec.tracing))
{
if (auto ato = aliasthisOf())
{
att = cast(AliasThisRec)(att | AliasThisRec.tracing);
wm = ato.deduceWild(t, isRef);
att = cast(AliasThisRec)(att & ~AliasThisRec.tracing);
}
}
return wm;
}
override inout(Type) toHeadMutable() inout
{
return this;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeEnum : Type
{
EnumDeclaration sym;
extern (D) this(EnumDeclaration sym)
{
super(Tenum);
this.sym = sym;
}
override const(char)* kind() const
{
return "enum";
}
override Type syntaxCopy()
{
return this;
}
override d_uns64 size(const ref Loc loc)
{
return sym.getMemtype(loc).size(loc);
}
Type memType(const ref Loc loc = Loc.initial)
{
return sym.getMemtype(loc);
}
override uint alignsize()
{
Type t = memType();
if (t.ty == Terror)
return 4;
return t.alignsize();
}
override Dsymbol toDsymbol(Scope* sc)
{
return sym;
}
override bool isintegral()
{
return memType().isintegral();
}
override bool isfloating()
{
return memType().isfloating();
}
override bool isreal()
{
return memType().isreal();
}
override bool isimaginary()
{
return memType().isimaginary();
}
override bool iscomplex()
{
return memType().iscomplex();
}
override bool isscalar()
{
return memType().isscalar();
}
override bool isunsigned()
{
return memType().isunsigned();
}
override bool ischar()
{
return memType().ischar();
}
override bool isBoolean()
{
return memType().isBoolean();
}
override bool isString()
{
return memType().isString();
}
override bool isAssignable()
{
return memType().isAssignable();
}
override bool needsDestruction()
{
return memType().needsDestruction();
}
override bool needsNested()
{
return memType().needsNested();
}
override MATCH implicitConvTo(Type to)
{
MATCH m;
//printf("TypeEnum::implicitConvTo() %s to %s\n", toChars(), to.toChars());
if (ty == to.ty && sym == (cast(TypeEnum)to).sym)
m = (mod == to.mod) ? MATCH.exact : MATCH.constant;
else if (sym.getMemtype(Loc.initial).implicitConvTo(to))
m = MATCH.convert; // match with conversions
else
m = MATCH.nomatch; // no match
return m;
}
override MATCH constConv(Type to)
{
if (equals(to))
return MATCH.exact;
if (ty == to.ty && sym == (cast(TypeEnum)to).sym && MODimplicitConv(mod, to.mod))
return MATCH.constant;
return MATCH.nomatch;
}
override Type toBasetype()
{
if (!sym.members && !sym.memtype)
return this;
auto tb = sym.getMemtype(Loc.initial).toBasetype();
return tb.castMod(mod); // retain modifier bits from 'this'
}
override bool isZeroInit(const ref Loc loc)
{
return sym.getDefaultValue(loc).isBool(false);
}
override bool hasPointers()
{
return memType().hasPointers();
}
override bool hasVoidInitPointers()
{
return memType().hasVoidInitPointers();
}
override Type nextOf()
{
return memType().nextOf();
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeClass : Type
{
ClassDeclaration sym;
AliasThisRec att = AliasThisRec.fwdref;
CPPMANGLE cppmangle = CPPMANGLE.def;
extern (D) this(ClassDeclaration sym)
{
super(Tclass);
this.sym = sym;
}
override const(char)* kind() const
{
return "class";
}
override d_uns64 size(const ref Loc loc) const
{
return target.ptrsize;
}
override Type syntaxCopy()
{
return this;
}
override Dsymbol toDsymbol(Scope* sc)
{
return sym;
}
override inout(ClassDeclaration) isClassHandle() inout
{
return sym;
}
override bool isBaseOf(Type t, int* poffset)
{
if (t && t.ty == Tclass)
{
ClassDeclaration cd = (cast(TypeClass)t).sym;
if (sym.isBaseOf(cd, poffset))
return true;
}
return false;
}
extern (D) MATCH implicitConvToWithoutAliasThis(Type to)
{
MATCH m = constConv(to);
if (m > MATCH.nomatch)
return m;
ClassDeclaration cdto = to.isClassHandle();
if (cdto)
{
//printf("TypeClass::implicitConvTo(to = '%s') %s, isbase = %d %d\n", to.toChars(), toChars(), cdto.isBaseInfoComplete(), sym.isBaseInfoComplete());
if (cdto.semanticRun < PASS.semanticdone && !cdto.isBaseInfoComplete())
cdto.dsymbolSemantic(null);
if (sym.semanticRun < PASS.semanticdone && !sym.isBaseInfoComplete())
sym.dsymbolSemantic(null);
if (cdto.isBaseOf(sym, null) && MODimplicitConv(mod, to.mod))
{
//printf("'to' is base\n");
return MATCH.convert;
}
}
return MATCH.nomatch;
}
extern (D) MATCH implicitConvToThroughAliasThis(Type to)
{
MATCH m;
if (sym.aliasthis && !(att & AliasThisRec.tracing))
{
if (auto ato = aliasthisOf())
{
att = cast(AliasThisRec)(att | AliasThisRec.tracing);
m = ato.implicitConvTo(to);
att = cast(AliasThisRec)(att & ~AliasThisRec.tracing);
}
}
return m;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeClass::implicitConvTo(to = '%s') %s\n", to.toChars(), toChars());
MATCH m = implicitConvToWithoutAliasThis(to);
return m ? m : implicitConvToThroughAliasThis(to);
}
override MATCH constConv(Type to)
{
if (equals(to))
return MATCH.exact;
if (ty == to.ty && sym == (cast(TypeClass)to).sym && MODimplicitConv(mod, to.mod))
return MATCH.constant;
/* Conversion derived to const(base)
*/
int offset = 0;
if (to.isBaseOf(this, &offset) && offset == 0 && MODimplicitConv(mod, to.mod))
{
// Disallow:
// derived to base
// inout(derived) to inout(base)
if (!to.isMutable() && !to.isWild())
return MATCH.convert;
}
return MATCH.nomatch;
}
override MOD deduceWild(Type t, bool isRef)
{
ClassDeclaration cd = t.isClassHandle();
if (cd && (sym == cd || cd.isBaseOf(sym, null)))
return Type.deduceWild(t, isRef);
ubyte wm = 0;
if (t.hasWild() && sym.aliasthis && !(att & AliasThisRec.tracing))
{
if (auto ato = aliasthisOf())
{
att = cast(AliasThisRec)(att | AliasThisRec.tracing);
wm = ato.deduceWild(t, isRef);
att = cast(AliasThisRec)(att & ~AliasThisRec.tracing);
}
}
return wm;
}
override inout(Type) toHeadMutable() inout
{
return this;
}
override bool isZeroInit(const ref Loc loc) const
{
return true;
}
override bool isscope() const
{
return sym.stack;
}
override bool isBoolean() const
{
return true;
}
override bool hasPointers() const
{
return true;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeTuple : Type
{
Parameters* arguments; // types making up the tuple
extern (D) this(Parameters* arguments)
{
super(Ttuple);
//printf("TypeTuple(this = %p)\n", this);
this.arguments = arguments;
//printf("TypeTuple() %p, %s\n", this, toChars());
debug
{
if (arguments)
{
for (size_t i = 0; i < arguments.dim; i++)
{
Parameter arg = (*arguments)[i];
assert(arg && arg.type);
}
}
}
}
/****************
* Form TypeTuple from the types of the expressions.
* Assume exps[] is already tuple expanded.
*/
extern (D) this(Expressions* exps)
{
super(Ttuple);
auto arguments = new Parameters();
if (exps)
{
arguments.setDim(exps.dim);
for (size_t i = 0; i < exps.dim; i++)
{
Expression e = (*exps)[i];
if (e.type.ty == Ttuple)
e.error("cannot form tuple of tuples");
auto arg = new Parameter(STC.undefined_, e.type, null, null, null);
(*arguments)[i] = arg;
}
}
this.arguments = arguments;
//printf("TypeTuple() %p, %s\n", this, toChars());
}
static TypeTuple create(Parameters* arguments)
{
return new TypeTuple(arguments);
}
/*******************************************
* Type tuple with 0, 1 or 2 types in it.
*/
extern (D) this()
{
super(Ttuple);
arguments = new Parameters();
}
extern (D) this(Type t1)
{
super(Ttuple);
arguments = new Parameters();
arguments.push(new Parameter(0, t1, null, null, null));
}
extern (D) this(Type t1, Type t2)
{
super(Ttuple);
arguments = new Parameters();
arguments.push(new Parameter(0, t1, null, null, null));
arguments.push(new Parameter(0, t2, null, null, null));
}
static TypeTuple create()
{
return new TypeTuple();
}
static TypeTuple create(Type t1)
{
return new TypeTuple(t1);
}
static TypeTuple create(Type t1, Type t2)
{
return new TypeTuple(t1, t2);
}
override const(char)* kind() const
{
return "tuple";
}
override Type syntaxCopy()
{
Parameters* args = Parameter.arraySyntaxCopy(arguments);
Type t = new TypeTuple(args);
t.mod = mod;
return t;
}
override bool equals(const RootObject o) const
{
Type t = cast(Type)o;
//printf("TypeTuple::equals(%s, %s)\n", toChars(), t.toChars());
if (this == t)
return true;
if (auto tt = t.isTypeTuple())
{
if (arguments.dim == tt.arguments.dim)
{
for (size_t i = 0; i < tt.arguments.dim; i++)
{
const Parameter arg1 = (*arguments)[i];
Parameter arg2 = (*tt.arguments)[i];
if (!arg1.type.equals(arg2.type))
return false;
}
return true;
}
}
return false;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* This is so we can slice a TypeTuple
*/
extern (C++) final class TypeSlice : TypeNext
{
Expression lwr;
Expression upr;
extern (D) this(Type next, Expression lwr, Expression upr)
{
super(Tslice, next);
//printf("TypeSlice[%s .. %s]\n", lwr.toChars(), upr.toChars());
this.lwr = lwr;
this.upr = upr;
}
override const(char)* kind() const
{
return "slice";
}
override Type syntaxCopy()
{
Type t = new TypeSlice(next.syntaxCopy(), lwr.syntaxCopy(), upr.syntaxCopy());
t.mod = mod;
return t;
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
*/
extern (C++) final class TypeNull : Type
{
extern (D) this()
{
//printf("TypeNull %p\n", this);
super(Tnull);
}
override const(char)* kind() const
{
return "null";
}
override Type syntaxCopy()
{
// No semantic analysis done, no need to copy
return this;
}
override MATCH implicitConvTo(Type to)
{
//printf("TypeNull::implicitConvTo(this=%p, to=%p)\n", this, to);
//printf("from: %s\n", toChars());
//printf("to : %s\n", to.toChars());
MATCH m = Type.implicitConvTo(to);
if (m != MATCH.nomatch)
return m;
// NULL implicitly converts to any pointer type or dynamic array
//if (type.ty == Tpointer && type.nextOf().ty == Tvoid)
{
Type tb = to.toBasetype();
if (tb.ty == Tnull || tb.ty == Tpointer || tb.ty == Tarray || tb.ty == Taarray || tb.ty == Tclass || tb.ty == Tdelegate)
return MATCH.constant;
}
return MATCH.nomatch;
}
override bool hasPointers()
{
/* Although null isn't dereferencable, treat it as a pointer type for
* attribute inference, generic code, etc.
*/
return true;
}
override bool isBoolean() const
{
return true;
}
override d_uns64 size(const ref Loc loc) const
{
return tvoidptr.size(loc);
}
override void accept(Visitor v)
{
v.visit(this);
}
}
/***********************************************************
* Encapsulate Parameters* so .length and [i] can be used on it.
* https://dlang.org/spec/function.html#ParameterList
*/
extern (C++) struct ParameterList
{
Parameters* parameters;
VarArg varargs = VarArg.none;
size_t length()
{
return Parameter.dim(parameters);
}
Parameter opIndex(size_t i)
{
return Parameter.getNth(parameters, i);
}
alias parameters this;
}
/***********************************************************
*/
extern (C++) final class Parameter : ASTNode
{
import dmd.attrib : UserAttributeDeclaration;
StorageClass storageClass;
Type type;
Identifier ident;
Expression defaultArg;
UserAttributeDeclaration userAttribDecl; // user defined attributes
extern (D) this(StorageClass storageClass, Type type, Identifier ident, Expression defaultArg, UserAttributeDeclaration userAttribDecl)
{
this.type = type;
this.ident = ident;
this.storageClass = storageClass;
this.defaultArg = defaultArg;
this.userAttribDecl = userAttribDecl;
}
static Parameter create(StorageClass storageClass, Type type, Identifier ident, Expression defaultArg, UserAttributeDeclaration userAttribDecl)
{
return new Parameter(storageClass, type, ident, defaultArg, userAttribDecl);
}
Parameter syntaxCopy()
{
return new Parameter(storageClass, type ? type.syntaxCopy() : null, ident, defaultArg ? defaultArg.syntaxCopy() : null, userAttribDecl ? cast(UserAttributeDeclaration) userAttribDecl.syntaxCopy(null) : null);
}
/****************************************************
* Determine if parameter is a lazy array of delegates.
* If so, return the return type of those delegates.
* If not, return NULL.
*
* Returns T if the type is one of the following forms:
* T delegate()[]
* T delegate()[dim]
*/
Type isLazyArray()
{
Type tb = type.toBasetype();
if (tb.ty == Tsarray || tb.ty == Tarray)
{
Type tel = (cast(TypeArray)tb).next.toBasetype();
if (auto td = tel.isTypeDelegate())
{
TypeFunction tf = td.next.toTypeFunction();
if (tf.parameterList.varargs == VarArg.none && tf.parameterList.length == 0)
{
return tf.next; // return type of delegate
}
}
}
return null;
}
// kludge for template.isType()
override DYNCAST dyncast() const
{
return DYNCAST.parameter;
}
override void accept(Visitor v)
{
v.visit(this);
}
extern (D) static Parameters* arraySyntaxCopy(Parameters* parameters)
{
Parameters* params = null;
if (parameters)
{
params = new Parameters(parameters.dim);
for (size_t i = 0; i < params.dim; i++)
(*params)[i] = (*parameters)[i].syntaxCopy();
}
return params;
}
/***************************************
* Determine number of arguments, folding in tuples.
*/
static size_t dim(Parameters* parameters)
{
size_t nargs = 0;
int dimDg(size_t n, Parameter p)
{
++nargs;
return 0;
}
_foreach(parameters, &dimDg);
return nargs;
}
/***************************************
* Get nth Parameter, folding in tuples.
* Returns:
* Parameter* nth Parameter
* NULL not found, *pn gets incremented by the number
* of Parameters
*/
static Parameter getNth(Parameters* parameters, size_t nth, size_t* pn = null)
{
Parameter param;
int getNthParamDg(size_t n, Parameter p)
{
if (n == nth)
{
param = p;
return 1;
}
return 0;
}
int res = _foreach(parameters, &getNthParamDg);
return res ? param : null;
}
alias ForeachDg = extern (D) int delegate(size_t paramidx, Parameter param);
/***************************************
* Expands tuples in args in depth first order. Calls
* dg(void *ctx, size_t argidx, Parameter *arg) for each Parameter.
* If dg returns !=0, stops and returns that value else returns 0.
* Use this function to avoid the O(N + N^2/2) complexity of
* calculating dim and calling N times getNth.
*/
extern (D) static int _foreach(Parameters* parameters, scope ForeachDg dg, size_t* pn = null)
{
assert(dg);
if (!parameters)
return 0;
size_t n = pn ? *pn : 0; // take over index
int result = 0;
foreach (i; 0 .. parameters.dim)
{
Parameter p = (*parameters)[i];
Type t = p.type.toBasetype();
if (auto tu = t.isTypeTuple())
{
result = _foreach(tu.arguments, dg, &n);
}
else
result = dg(n++, p);
if (result)
break;
}
if (pn)
*pn = n; // update index
return result;
}
override const(char)* toChars() const
{
return ident ? ident.toChars() : "__anonymous_param";
}
/*********************************
* Compute covariance of parameters `this` and `p`
* as determined by the storage classes of both.
* Params:
* returnByRef = true if the function returns by ref
* p = Parameter to compare with
* Returns:
* true = `this` can be used in place of `p`
* false = nope
*/
bool isCovariant(bool returnByRef, const Parameter p) const pure nothrow @nogc @safe
{
enum stc = STC.ref_ | STC.in_ | STC.out_ | STC.lazy_;
if ((this.storageClass & stc) != (p.storageClass & stc))
return false;
return isCovariantScope(returnByRef, this.storageClass, p.storageClass);
}
extern (D) private static bool isCovariantScope(bool returnByRef, StorageClass from, StorageClass to) pure nothrow @nogc @safe
{
if (from == to)
return true;
/* Shrinking the representation is necessary because StorageClass is so wide
* Params:
* returnByRef = true if the function returns by ref
* stc = storage class of parameter
*/
static uint buildSR(bool returnByRef, StorageClass stc) pure nothrow @nogc @safe
{
uint result;
final switch (stc & (STC.ref_ | STC.scope_ | STC.return_))
{
case 0: result = SR.None; break;
case STC.ref_: result = SR.Ref; break;
case STC.scope_: result = SR.Scope; break;
case STC.return_ | STC.ref_: result = SR.ReturnRef; break;
case STC.return_ | STC.scope_: result = SR.ReturnScope; break;
case STC.ref_ | STC.scope_: result = SR.RefScope; break;
case STC.return_ | STC.ref_ | STC.scope_:
result = returnByRef ? SR.ReturnRef_Scope : SR.Ref_ReturnScope;
break;
}
return result;
}
/* result is true if the 'from' can be used as a 'to'
*/
if ((from ^ to) & STC.ref_) // differing in 'ref' means no covariance
return false;
return covariant[buildSR(returnByRef, from)][buildSR(returnByRef, to)];
}
/* Classification of 'scope-return-ref' possibilities
*/
private enum SR
{
None,
Scope,
ReturnScope,
Ref,
ReturnRef,
RefScope,
ReturnRef_Scope,
Ref_ReturnScope,
}
extern (D) private static bool[SR.max + 1][SR.max + 1] covariantInit() pure nothrow @nogc @safe
{
/* Initialize covariant[][] with this:
From\To n rs s
None X
ReturnScope X X
Scope X X X
From\To r rr rs rr-s r-rs
Ref X X
ReturnRef X
RefScope X X X X X
ReturnRef-Scope X X
Ref-ReturnScope X X X
*/
bool[SR.max + 1][SR.max + 1] covariant;
foreach (i; 0 .. SR.max + 1)
{
covariant[i][i] = true;
covariant[SR.RefScope][i] = true;
}
covariant[SR.ReturnScope][SR.None] = true;
covariant[SR.Scope ][SR.None] = true;
covariant[SR.Scope ][SR.ReturnScope] = true;
covariant[SR.Ref ][SR.ReturnRef] = true;
covariant[SR.ReturnRef_Scope][SR.ReturnRef] = true;
covariant[SR.Ref_ReturnScope][SR.Ref ] = true;
covariant[SR.Ref_ReturnScope][SR.ReturnRef] = true;
return covariant;
}
extern (D) private static immutable bool[SR.max + 1][SR.max + 1] covariant = covariantInit();
}
/*************************************************************
* For printing two types with qualification when necessary.
* Params:
* t1 = The first type to receive the type name for
* t2 = The second type to receive the type name for
* Returns:
* The fully-qualified names of both types if the two type names are not the same,
* or the unqualified names of both types if the two type names are the same.
*/
const(char*)[2] toAutoQualChars(Type t1, Type t2)
{
auto s1 = t1.toChars();
auto s2 = t2.toChars();
// show qualification only if it's different
if (!t1.equals(t2) && strcmp(s1, s2) == 0)
{
s1 = t1.toPrettyChars(true);
s2 = t2.toPrettyChars(true);
}
return [s1, s2];
}
/**
* For each active modifier (MODFlags.const_, MODFlags.immutable_, etc) call `fp` with a
* void* for the work param and a string representation of the attribute.
*/
void modifiersApply(const TypeFunction tf, void delegate(string) dg)
{
immutable ubyte[4] modsArr = [MODFlags.const_, MODFlags.immutable_, MODFlags.wild, MODFlags.shared_];
foreach (modsarr; modsArr)
{
if (tf.mod & modsarr)
{
dg(MODtoString(modsarr));
}
}
}
/**
* For each active attribute (ref/const/nogc/etc) call `fp` with a void* for the
* work param and a string representation of the attribute.
*/
void attributesApply(const TypeFunction tf, void delegate(string) dg, TRUSTformat trustFormat = TRUSTformatDefault)
{
if (tf.purity)
dg("pure");
if (tf.isnothrow)
dg("nothrow");
if (tf.isnogc)
dg("@nogc");
if (tf.isproperty)
dg("@property");
if (tf.isref)
dg("ref");
if (tf.isreturn && !tf.isreturninferred)
dg("return");
if (tf.isscope && !tf.isscopeinferred)
dg("scope");
TRUST trustAttrib = tf.trust;
if (trustAttrib == TRUST.default_)
{
if (trustFormat == TRUSTformatSystem)
trustAttrib = TRUST.system;
else
return; // avoid calling with an empty string
}
dg(trustToString(trustAttrib));
}
/**
* If the type is a class or struct, returns the symbol for it,
* else null.
*/
extern (C++) AggregateDeclaration isAggregate(Type t)
{
t = t.toBasetype();
if (t.ty == Tclass)
return (cast(TypeClass)t).sym;
if (t.ty == Tstruct)
return (cast(TypeStruct)t).sym;
return null;
}
/***************************************************
* Determine if type t can be indexed or sliced given that it is not an
* aggregate with operator overloads.
* Params:
* t = type to check
* Returns:
* true if an expression of type t can be e1 in an array expression
*/
bool isIndexableNonAggregate(Type t)
{
t = t.toBasetype();
return (t.ty == Tpointer || t.ty == Tsarray || t.ty == Tarray || t.ty == Taarray ||
t.ty == Ttuple || t.ty == Tvector);
}
/***************************************************
* Determine if type t is copyable.
* Params:
* t = type to check
* Returns:
* true if we can copy it
*/
bool isCopyable(const Type t) pure nothrow @nogc
{
//printf("isCopyable() %s\n", t.toChars());
if (auto ts = t.isTypeStruct())
{
if (ts.sym.postblit &&
ts.sym.postblit.storage_class & STC.disable)
return false;
}
return true;
}
|
D
|
module tdc.stdc.stdlib;
// for self-host subset libc binding.
extern (C) @nogc nothrow:
void* calloc(size_t nmemb, size_t size);
long strtol(scope inout(char)* nptr, scope inout(char)** endptr, int base);
|
D
|
module util.visualizer;
import std.math;
import std.stdio;
import std.string;
import util.point;
import util.size;
/++
+ Class containing information on a frame in the visualization. Purposefully
+ has no fields; designed to be subclassed.
+/
class FrameData {
}
/++
+ A color with red, green, blue, and alpha channels.
+/
struct Color {
double r; /// Red component
double g; /// Green component
double b; /// Blue component
double a = 1.0; /// Alpha component
}
/++
+ A transformation matrix
+
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-matrix.html#cairo-matrix-t
+/
struct Matrix {
double xx;
double yx;
double xy;
double yy;
double x0;
double y0;
}
/++
+ The style used to draw the ends of lines
+
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-line-cap-t
+/
enum LineCap {
Butt, /// No extra ending to the line
Round, /// Rounded cap to the line
Square /// Squared cap to the line
}
/++
+ The style used to join lines
+
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-line-cap-t
+/
enum LineJoin {
Miter, /// Edges are extended to form sharp corners
Round, /// Edges are rounded
Bevel /// Edges are chopped
}
/++
+ Slant of the font
+
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-text.html#cairo-font-slant-t
+/
enum FontSlant {
Normal,
Italic,
Oblique
}
/++
+ Weight of the font
+
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-text.html#cairo-font-weight-t
+/
enum FontWeight {
Normal,
Bold
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-surface.html#cairo-content-t
+/
enum Content {
Color = 0x1000, /// Surface holds only color content
Alpha = 0x2000, /// Surface holds only alpha content
ColorAlpha = 0x3000 /// Surface holds color and alpha content
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-antialias-t
+/
enum Antialias {
Default, /// Default antialiasing
None, /// No antialiasing
Gray, /// Single-color antialising
Subpixel /// Subpixel antialiasing
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-fill-rule-t
+/
enum FillRule {
Winding, /// Takes path direction into account when filling
EvenOdd /// Does not take orientation into account when filling
}
/++
+ See_Also:
+ http://cairographics.org/operators/
+/
enum Operator {
Clear, /// Clear destination layer
Source, /// Replace destination layer
Over, /// Draw source on top of destination
In, /// Draw source where there was destination
Out, /// Draw source where there was no destination
Atop, /// Draw source on top of destination
Dest, /// Ignore source
DestOver, /// Draw destination on top of source
DestIn, /// Leave destination only where there was source
DestOut, /// Leave destination only where there was no source
DestAtop, /// Leave destination on top of source
Xor, /// Source and destination are shown where there's only one
Add, /// Source and destination are accumulated
Saturate /// Assumes source and dest are disjoint
}
struct TextExtents {
double xBearing;
double yBearing;
double width;
double height;
double xAdvance;
double yAdvance;
};
/++
+ All drawing operations are performed via the canvas. The canvas uses logical coordinates to simplify
+ scaling the image. By default the logical size is 100x100, with (0, 0) being the center of the screen.
+ So the far left of the screen is at x = -50, and the right side is at x = +50.
+/
class Canvas {
private:
/**************************************
* Internal State
*************************************/
cairo_t _cr;
int _imageWidth;
int _imageHeight;
public:
/**************************************
* Constructor
*************************************/
/++
+ Constructor
+/
this(cairo_t cr, int imageWidth, int imageHeight) {
_cr = cr;
logicalWidth = 100;
logicalHeight = 100;
translateX = 0;
translateY = 0;
_imageWidth = imageWidth;
_imageHeight = imageHeight;
}
/**************************************
* Properties
*************************************/
/++
+ The logical width of the image.
+/
int logicalWidth;
/++
+ The logical height of the image
+/
int logicalHeight;
/++
+ X Translation
+/
double translateX;
/++
+ Y Translation
+/
double translateY;
/++
+ The physical width of the image
+/
int imageWidth() {
return _imageWidth;
}
/++
+ The physical height of the image
+/
int imageHeight() {
return _imageHeight;
}
/**************************************
* Base Cairo functions
*************************************/
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-save
+/
void cairoSave() {
cairo_save(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-restore
+/
void cairoRestore() {
cairo_restore(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-push-group
+/
void cairoPushGroup() {
cairo_push_group(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-push-group-with-content
+/
void cairoPushGroupWithContent(Content content) {
cairo_push_group_with_content(_cr, content);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-pop-group
+/
Pattern cairoPopGroup() {
return cairo_pop_group(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-pop-group-to-source
+/
void cairoPopGroupToSource() {
cairo_pop_group_to_source(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-source-rgb
+/
void cairoSetSourceRgb(Color color) {
cairo_set_source_rgb(_cr, color.r, color.g, color.b);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-source-rgba
+/
void cairoSetSourceRgba(Color color) {
cairo_set_source_rgba(_cr, color.r, color.g, color.b, color.a);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-source
+/
void cairoSetSource(Pattern source) {
cairo_set_source(_cr, source);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-get-source
+/
Pattern cairoGetSource() {
return cairo_get_source(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-antialias
+/
void cairoSetAntialias(Antialias a) {
cairo_set_antialias(_cr, a);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-dash
+/
void cairoSetDash(double[] dash) {
if(dash.length > 0) {
cairo_set_dash(_cr, &dash[0], dash.length, 0);
} else {
cairo_set_dash(_cr, null, 0, 0);
}
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-fill-rule
+/
void cairoSetFillRule(FillRule fr) {
cairo_set_fill_rule(_cr, fr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-line-cap
+/
void cairoSetLineCap(LineCap lc) {
cairo_set_line_cap(_cr, lc);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-line-join
+/
void cairoSetLineJoin(LineJoin lj) {
cairo_set_line_join(_cr, lj);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-line-width
+/
void cairoSetLineWidth(double width) {
cairo_set_line_width(_cr, width);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-miter-limit
+/
void cairoSetMiterLimit(double lim) {
cairo_set_miter_limit(_cr, lim);
}
/++
+ See_Also
+ http://cairographics.org/operators/
+/
void cairoSetOperator(Operator op) {
cairo_set_operator(_cr, op);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-tolerance
+/
void cairoSetTolerance(double tolerance) {
cairo_set_tolerance(_cr, tolerance);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-fill
+/
void cairoFill() {
cairo_fill(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-fill-preserve
+/
void cairoFillPreserve() {
cairo_fill_preserve(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-paint
+/
void cairoPaint() {
cairo_paint(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-paint-with-alpha
+/
void cairoPaintWithAlpha(double a) {
cairo_paint_with_alpha(_cr, a);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-stroke
+/
void cairoStroke() {
cairo_stroke(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-stroke-preserve
+/
void cairoStrokePreserve() {
cairo_stroke_preserve(_cr);
}
/++
+ See_Also:
+ http://library.gnome.org/devel/cairo/stable/cairo-text.html#cairo-text-extents
+/
TextExtents cairoTextExtents(string str) {
TextExtents te;
cairo_text_extents(_cr, toStringz(str), &te);
return te;
}
/**************************************
* Higher Level Functions
*************************************/
/++
+ Uses window coordinate system, rather than physical
+/
void useWindowCoordinates() {
translateX = - cast(real) logicalWidth / 2.0;
translateY = - cast(real) logicalHeight / 2.0;
}
/++
+ Converts a point from its logical coordinates to a physical point on the screen.
+/
Point logicalToImage(Point p) {
auto scale = fmin(cast(real) imageWidth / cast(real) logicalWidth,
cast(real) imageHeight / cast(real) logicalHeight);
return new Point((p.x + translateX) * scale + cast(real) imageWidth / 2.0,
(p.y + translateY) * scale + cast(real) imageHeight / 2.0);
}
/++
+ Scales a scalar value based on the scale of the image
+/
double scaleScalar(double v) {
auto scale = fmin(cast(real) imageWidth / cast(real) logicalWidth,
cast(real) imageHeight / cast(real) logicalHeight);
return v * scale;
}
/++
+ Draws a line.
+
+ Params:
+ p1 = First point of the line
+ p2 = Second point of the line
+ color = Color of the line; defaults to black
+ width = Width of the line; defaults to 0.5
+ lineCap = Style of line capping
+ dash = Style of dashes
+/
void drawLine(Point p1, Point p2,
Color color = Color(0.0, 0.0, 0.0),
double width = 0.5,
LineCap lineCap = LineCap.Round,
double[] dash = [])
{
cairo_set_source_rgba(_cr, color.r, color.g, color.b, color.a);
cairo_set_line_width(_cr, scaleScalar(width));
cairo_set_line_cap(_cr, lineCap);
if(dash.length > 0) {
cairo_set_dash(_cr, &dash[0], dash.length, 0);
}
auto ip1 = logicalToImage(p1);
auto ip2 = logicalToImage(p2);
cairo_move_to(_cr, ip1.x, ip1.y);
cairo_line_to(_cr, ip2.x, ip2.y);
cairo_stroke(_cr);
}
/++
+ Draws a circle by specifying the center and a radius
+
+ Params:
+ center = Center of the circle
+ radius = Radius of the circle
+ edgeColor = Color of the circle outline; defaults to black
+ fillColor = Color of the fill of the circle; defaults to transparent
+ edgeWidth = Width of the edge; defaults to 0.5
+ edgeDash = Style of dashes for outside line
+/
void drawCircle(Point center, double radius,
Color edgeColor = Color(0.0, 0.0, 0.0, 1.0),
Color fillColor = Color(0.0, 0.0, 0.0, 0.0),
double edgeWidth = 0.5,
double[] edgeDash = [])
{
cairo_set_source_rgba(_cr, edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a);
cairo_set_line_width(_cr, scaleScalar(edgeWidth));
if(edgeDash.length > 0) {
cairo_set_dash(_cr, &edgeDash[0], edgeDash.length, 0);
}
auto icenter = logicalToImage(center);
cairo_arc(_cr, icenter.x, icenter.y, scaleScalar(radius), 0, 2 * PI);
cairo_stroke_preserve(_cr);
cairo_set_source_rgba(_cr, fillColor.r, fillColor.g, fillColor.b, fillColor.a);
cairo_fill(_cr);
}
/++
+ Draws a circle by specifying the upper-left-hand corner and lower-right-hand corner coordinates.
+
+ Params:
+ ul = Coordinate of the upper-left-hand corner of the circle
+ lr = Coordinate of the lower-right-hand corner of the circle
+ edgeColor = Color of the circle outline; defaults to black
+ fillColor = Color of the fill of the circle; defaults to transparent
+ edgeWidth = Width of the edge; defaults to 0.5
+ edgeDash = Style of dashes for outside line
+/
void drawCircle(Point ul, Point lr,
Color edgeColor = Color(0.0, 0.0, 0.0, 1.0),
Color fillColor = Color(0.0, 0.0, 0.0, 0.0),
double edgeWidth = 0.5,
double[] edgeDash = [])
{
cairo_set_source_rgba(_cr, edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a);
cairo_set_line_width(_cr, scaleScalar(edgeWidth));
if(edgeDash.length > 0) {
cairo_set_dash(_cr, &edgeDash[0], edgeDash.length, 0);
}
auto iul = logicalToImage(ul);
auto ilr = logicalToImage(lr);
auto radius = fmin((ilr.x - iul.x) / 2.0, (ilr.y - iul.y) / 2.0);
cairo_arc(_cr,
iul.x + radius, iul.y + radius,
radius,
0, 2 * PI);
cairo_stroke_preserve(_cr);
cairo_set_source_rgba(_cr, fillColor.r, fillColor.g, fillColor.b, fillColor.a);
cairo_fill(_cr);
}
/++
+ Draws a rectangle by specifying the upper-left-hand corner and the size
+
+ Params:
+ ul = Coordinate of the upper-left-hand corner of the circle
+ size = Size of the rectangle
+ edgeColor = Color of the circle outline; defaults to black
+ fillColor = Color of the fill of the circle; defaults to transparent
+ edgeWidth = Width of the edge; defaults to 0.5
+ edgeDash = Style of dashes for outside line
+/
void drawRectangle(Point ul, Size size,
Color edgeColor = Color(0.0, 0.0, 0.0, 1.0),
Color fillColor = Color(0.0, 0.0, 0.0, 0.0),
double edgeWidth = 0.5,
double[] edgeDash = [],
LineJoin lineJoin = LineJoin.Round)
{
cairo_set_source_rgba(_cr, edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a);
cairo_set_line_width(_cr, scaleScalar(edgeWidth));
if(edgeDash.length > 0) {
cairo_set_dash(_cr, &edgeDash[0], edgeDash.length, 0);
}
cairo_set_line_join(_cr, lineJoin);
auto iul = logicalToImage(ul);
cairo_rectangle(_cr, iul.x, iul.y, scaleScalar(size.width), scaleScalar(size.height));
cairo_stroke_preserve(_cr);
cairo_set_source_rgba(_cr, fillColor.r, fillColor.g, fillColor.b, fillColor.a);
cairo_fill(_cr);
}
/++
+ Draws a rectangle by specifying the upper-left-hand and lower-right-hand corner coordinates
+
+ Params:
+ ul = Coordinate of the upper-left-hand corner of the rectangle
+ lr = Coordinate of the lower-right-hand corner of the rectangle
+ edgeColor = Color of the circle outline; defaults to black
+ fillColor = Color of the fill of the circle; defaults to transparent
+ edgeWidth = Width of the edge; defaults to 0.5
+ edgeDash = Style of dashes for outside line
+/
void drawRectangle(Point ul, Point lr,
Color edgeColor = Color(0.0, 0.0, 0.0, 1.0),
Color fillColor = Color(0.0, 0.0, 0.0, 0.0),
double edgeWidth = 0.5,
double[] edgeDash = [],
LineJoin lineJoin = LineJoin.Round)
{
cairo_set_source_rgba(_cr, edgeColor.r, edgeColor.g, edgeColor.b, edgeColor.a);
cairo_set_line_width(_cr, scaleScalar(edgeWidth));
if(edgeDash.length > 0) {
cairo_set_dash(_cr, &edgeDash[0], edgeDash.length, 0);
}
cairo_set_line_join(_cr, lineJoin);
auto iul = logicalToImage(ul);
auto ilr = logicalToImage(lr);
cairo_rectangle(_cr, iul.x, iul.y, ilr.x - iul.x, ilr.y - iul.y);
cairo_stroke_preserve(_cr);
cairo_set_source_rgba(_cr, fillColor.r, fillColor.g, fillColor.b, fillColor.a);
cairo_fill(_cr);
}
/++
+ Draws some text
+
+ Params:
+ text = Text to draw
+ loc = Location to draw at
+ size = Size of the text
+ family = Font family
+ slant = Font slant
+ weight = Font weight
+ color = Color to draw the text
+/
void drawText(string text, Point loc,
int size, string family = "Sans",
FontSlant slant = FontSlant.Normal, FontWeight weight = FontWeight.Normal,
Color color = Color(0.0, 0.0, 0.0, 1.0))
{
auto iloc = logicalToImage(loc);
cairo_set_source_rgba(_cr, color.r, color.g, color.b, color.a);
cairo_move_to(_cr, iloc.x, iloc.y);
cairo_select_font_face(_cr, toStringz(family), slant, weight);
cairo_set_font_size(_cr, scaleScalar(size));
cairo_show_text(_cr, toStringz(text));
}
void drawCenteredText(string text, Point ul, Point lr,
int size, string family = "Sans",
FontSlant slant = FontSlant.Normal, FontWeight weight = FontWeight.Normal,
Color color = Color(0.0, 0.0, 0.0, 1.0))
{
cairo_set_source_rgba(_cr, color.r, color.g, color.b, color.a);
cairo_select_font_face(_cr, toStringz(family), slant, weight);
cairo_set_font_size(_cr, scaleScalar(size));
auto iul = logicalToImage(ul);
auto ilr = logicalToImage(lr);
auto extents = cairoTextExtents(text);
auto textSize = new Size(ilr.x - iul.x, ilr.y - iul.y);
auto gapSize = new Size((textSize.width - (extents.width)) / 2.0, (textSize.height - (extents.height)) / 2.0);
auto offset = new Point(iul.x + gapSize.width - extents.xBearing, iul.y + gapSize.height - extents.yBearing);
cairo_move_to(_cr, offset.x, offset.y);
cairo_show_text(_cr, toStringz(text));
}
/++
+ Fills the canvas with a solid color.
+
+ Params:
+ color = Color to fill with
+/
void fill(Color color) {
drawRectangle(new Point(- cast(real) logicalWidth / 2.0, - cast(real) logicalHeight / 2.0),
new Size(logicalWidth, logicalHeight),
color, color);
}
}
/++
+ A callback function which does the drawing.
+/
typedef void function(Canvas, int, FrameData) DrawFunction;
class DrawingInfo {
public:
gpointer win;
DrawFunction fn;
FrameData[] frames;
int numFrames;
int curFrame;
bool paused;
}
extern(C) {
void *visualization_draw_handler(gpointer w, gpointer e, gpointer data) {
auto info = *(cast(DrawingInfo*) data);
int width;
int height;
gdk_drawable_get_size(gtk_widget_get_window(w), &width, &height);
auto context = gdk_cairo_create(gtk_widget_get_window(w));
cairo_rectangle(context, 0, 0, width, height);
cairo_clip(context);
auto surface = cairo_get_target(context);
info.fn(new Canvas(context, width, height), info.curFrame, info.frames[cast(int) fmin(info.curFrame, info.frames.length - 1)]);
cairo_destroy(context);
return null;
}
int visualization_timeout_handler(gpointer data) {
auto info = *(cast(DrawingInfo*) data);
if(info.paused) {
return 0;
}
if(info.curFrame < info.numFrames - 1) {
info.curFrame += 1;
int width;
int height;
gdk_drawable_get_size(gtk_widget_get_window(info.win), &width, &height);
gtk_widget_queue_draw_area(info.win, 0, 0, width, height);
return 1;
} else {
return 0;
}
}
int visualization_keypress_handler(gpointer widget, GdkKeyEvent *event, gpointer data) {
auto info = *(cast(DrawingInfo*) data);
if(event.keyval == 65361 && info.curFrame > 0) {
info.paused = true;
info.curFrame -= 1;
int width;
int height;
gdk_drawable_get_size(gtk_widget_get_window(info.win), &width, &height);
gtk_widget_queue_draw_area(info.win, 0, 0, width, height);
} else if (event.keyval == 65363 && info.curFrame < info.numFrames - 1) {
info.paused = true;
info.curFrame += 1;
int width;
int height;
gdk_drawable_get_size(gtk_widget_get_window(info.win), &width, &height);
gtk_widget_queue_draw_area(info.win, 0, 0, width, height);
}
return 0;
}
}
/++
+ Creates a drawing
+
+ Params:
+ title = Title of the drawing
+ fn = Function used to perform the drawing
+ size = Initial drawing size
+/
void createVisualization(string title, DrawFunction fn, int frameLength, FrameData[] frames = [ new FrameData() ], int numFrames = 1, Size size = new Size(200, 200)) {
gtk_init(0, null);
auto window = gtk_window_new(0);
auto da = gtk_drawing_area_new();
auto info = new DrawingInfo();
info.win = da;
info.fn = fn;
info.frames = frames;
info.numFrames = numFrames;
info.curFrame = 0;
gtk_widget_add_events(window, 1 << 10);
g_signal_connect_data(da, toStringz("expose-event"), cast(gpointer) &visualization_draw_handler, cast(gpointer) &info, null, 0);
g_signal_connect_data(window, toStringz("key-press-event"), cast(gpointer) &visualization_keypress_handler, cast(gpointer) &info, null, 0);
g_signal_connect_data(window, toStringz("destroy"), cast(gpointer) >k_main_quit, null, null, 0);
gtk_container_add(window, da);
gtk_window_set_title(window, toStringz(title));
gtk_window_set_default_size(window, cast(int) size.width, cast(int) size.height);
g_timeout_add(frameLength, cast(gpointer) &visualization_timeout_handler, cast(gpointer) &info);
gtk_widget_show_all(window);
gtk_main();
}
extern(C) {
// Basic types
typedef void *gpointer;
typedef void *cairo_t;
typedef void *cairo_surface_t;
typedef void *Pattern; /// A pattern used to draw with
struct GdkKeyEvent {
int type;
gpointer window;
byte send_event;
uint time;
uint state;
uint keyval;
int length;
char *string;
ushort hardware_keycode;
byte group;
uint is_modifier;
};
// Core GTK functions
void gtk_container_add(void*, void*);
void gtk_init(int, char**);
void gtk_main();
void gtk_main_quit();
void gtk_widget_show_all(gpointer);
// GTK Widget functions
gpointer gtk_window_new(int);
void gtk_widget_add_events(gpointer, int);
gpointer gtk_drawing_area_new();
gpointer gtk_widget_get_window(gpointer);
void gdk_drawable_get_size(gpointer, int*, int*);
void gtk_window_set_title(gpointer, const char*);
void gtk_window_set_default_size(gpointer, int, int);
void gtk_widget_queue_draw_area(gpointer, int, int, int, int);
// GTK Signal Functions
void g_signal_connect_data(gpointer, const char*, gpointer, gpointer, gpointer, int);
void g_timeout_add(uint, gpointer, gpointer);
// Cairo Functions
cairo_t gdk_cairo_create(gpointer);
void cairo_arc(cairo_t, double, double, double, double, double);
void cairo_clip(cairo_t);
void cairo_destroy(cairo_t);
void cairo_fill(cairo_t);
void cairo_fill_preserve(cairo_t);
Pattern cairo_get_source(cairo_t);
cairo_surface_t cairo_get_target(cairo_t);
int cairo_image_surface_get_width(cairo_surface_t);
int cairo_image_surface_get_height(cairo_surface_t);
void cairo_line_to(cairo_t, double, double);
void cairo_move_to(cairo_t, double, double);
void cairo_paint(cairo_t);
void cairo_paint_with_alpha(cairo_t, double);
Pattern cairo_pop_group(cairo_t);
void cairo_pop_group_to_source(cairo_t);
void cairo_push_group(cairo_t);
void cairo_push_group_with_content(cairo_t, Content);
void cairo_rectangle(cairo_t, double, double, double, double);
void cairo_restore(cairo_t);
void cairo_save(cairo_t);
void cairo_select_font_face(cairo_t, const char*, int, int);
void cairo_set_antialias(cairo_t, int);
void cairo_set_dash(cairo_t, double*, int, int);
void cairo_set_fill_rule(cairo_t, int);
void cairo_set_font_size(cairo_t, double);
void cairo_set_miter_limit(cairo_t, double);
void cairo_set_source(cairo_t, Pattern);
void cairo_set_source_rgb(cairo_t, double, double, double);
void cairo_set_source_rgba(cairo_t, double, double, double, double);
void cairo_set_line_cap(cairo_t, int);
void cairo_set_line_join(cairo_t, int);
void cairo_set_line_width(cairo_t, double);
void cairo_set_operator(cairo_t, int);
void cairo_set_tolerance(cairo_t, double);
void cairo_show_text(cairo_t, const char *);
void cairo_stroke(cairo_t);
void cairo_stroke_preserve(cairo_t);
void cairo_text_extents(cairo_t, const char *, TextExtents*);
}
|
D
|
/+
This is a DHDL test circuit. You generally wouldn't write this D code by hand.
Instead, you would write DHDL code and the DHDL compiler would generate the
code you see in this module.
+/
module dhdl.tests.memories;
import std.stdio;
import dhdl;
import dhdl.testing;
class Memories : Circuit
{
@out_ UInt!8 readVal;
@in_ UInt!2 readAddr;
@in_ UInt!8 writeVal;
@in_ UInt!2 writeAddr;
@in_ Bool we;
this()
{
this.instantiate!readVal;
this.instantiate!readAddr;
this.instantiate!writeVal;
this.instantiate!writeAddr;
this.instantiate!we;
Mem mem;
this.instantiate!mem(new UInt!8, 3, false);
when(we,
{
this.connect(mem[writeAddr], writeVal);
});
this.connect(readVal, mem[readAddr]);
}
}
version(HWTests) unittest
{
auto c = peekPokeTester!Memories;
c.we = true;
foreach(i; 0 .. 3)
{
c.writeVal = 42 + i;
c.writeAddr = i;
c.step();
}
c.we = false;
foreach(i; 0 .. 3)
{
c.readAddr = i;
c.step();
assert(c.readVal == 42 + i);
}
}
|
D
|
instance DJG_702_Rod (Npc_Default)
{
// ------ NSC ------
name = "Rod";
guild = GIL_DJG;
id = 702;
voice = 6;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_FRIEND;
// ------ Attribute ------
B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_MASTER; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_1h_Sld_Sword);
// ------ Inventory ------
B_CreateAmbientInv (self);
CreateInvItems (self, ItPo_Health_02, 6);
CreateInvItems (self, ItMi_OldCoin, 1); //Joly: damit man seine Leiche findet, wenn er im Kampf stirbt!
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_FatBald", Face_N_ToughBart01, BodyTex_N, ITAR_DJG_l);
Mdl_SetModelFatness (self, 2);
Mdl_ApplyOverlayMds (self, "Humans_Militia.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 70); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_702;
};
FUNC VOID Rtn_Start_702 ()
{
TA_Sit_Bench (08,00,23,00,"OW_DJG_SWAMPCAMP_01");
TA_Sit_Bench (23,00,08,00,"OW_DJG_SWAMPCAMP_01");
};
FUNC VOID Rtn_SwampWait1_702 ()
{
TA_Guide_Player (08,00,23,00,"OW_DJG_SWAMP_WAIT1_02");
TA_Guide_Player (23,00,08,00,"OW_DJG_SWAMP_WAIT1_02");
};
FUNC VOID Rtn_SwampWait2_702 ()
{
TA_RunToWP (08,00,23,00,"OW_DJG_SWAMP_WAIT2_02"); //Joly: TA_RunToWP!! Sonst folgt er SC zum Drachen, ohne dass SC mit ihm gesprochen hat
TA_RunToWP (23,00,08,00,"OW_DJG_SWAMP_WAIT2_02");
};
FUNC VOID Rtn_SwampDragon_702 ()
{
TA_RunToWP (08,00,23,00,"OW_SWAMPDRAGON_01");
TA_RunToWP (23,00,08,00,"OW_SWAMPDRAGON_01");
};
|
D
|
.source T_rem_double_2addr_1.java
.class public dot.junit.opcodes.rem_double_2addr.d.T_rem_double_2addr_1
.super java/lang/Object
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run(DD)D
.limit regs 14
rem-double/2addr v10, v12
return-wide v10
.end method
|
D
|
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Fluent.build/Model/Model.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Fluent.build/Model/Model~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Fluent.build/Model/Model~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XPC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/IOKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Command.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Console.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Logging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/XPC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/IOKit.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/xpc/XPC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
/** Pegged Generated Ada Parser. */
module lang_Ada;
import pegged.grammar;
/** Pegged Ada Grammar. */
enum grammar_Ada = `
Ada:
TranslationUnit <- ExternalDeclaration (:Spacing ExternalDeclaration)*
ExternalDeclaration < FunctionDefinition / Declaration
FunctionDefinition < DeclarationSpecifiers? Declarator DeclarationList? CompoundStatement
PrimaryExpression < Identifier
/ CharLiteral
/ StringLiteral
/ FloatLiteral
/ IntegerLiteral
/ '(' Expression ')'
PostfixExpression < PrimaryExpression ( '[' Expression ']'
/ '(' ')'
/ '(' ArgumentExpressionList ')'
/ '.' Identifier
/ "->" Identifier
/ "++"
/ "--"
)*
ArgumentExpressionList < AssignmentExpression (',' AssignmentExpression)*
UnaryExpression < PostfixExpression
/ IncrementExpression
/ DecrementExpression
/ UnaryOperator CastExpression
/ "sizeof" UnaryExpression
/ "sizeof" '(' TypeName ')'
IncrementExpression < PlusPlus UnaryExpression
PlusPlus <- "++"
DecrementExpression < "--" UnaryExpression
UnaryOperator <- [-&*+~!]
CastExpression < UnaryExpression
/ '(' TypeName ')' CastExpression
MultiplicativeExpression < CastExpression ([*%/] MultiplicativeExpression)*
AdditiveExpression < MultiplicativeExpression ([-+] AdditiveExpression)*
ShiftExpression < AdditiveExpression (("<<" / ">>") ShiftExpression)*
RelationalExpression < ShiftExpression (("<=" / ">=" / "<" / ">") RelationalExpression)*
EqualityExpression < RelationalExpression (("==" / "!=") EqualityExpression)*
ANDExpression < EqualityExpression ('&' ANDExpression)*
ExclusiveORExpression < ANDExpression ('^' ExclusiveORExpression)*
InclusiveORExpression < ExclusiveORExpression ('|' InclusiveORExpression)*
LogicalANDExpression < InclusiveORExpression ("&&" LogicalANDExpression)*
LogicalORExpression < LogicalANDExpression ("||" LogicalORExpression)*
ConditionalExpression < LogicalORExpression ('?' Expression ':' ConditionalExpression)?
AssignmentExpression < UnaryExpression AssignmentOperator AssignmentExpression
/ ConditionalExpression
AssignmentOperator <- "=" / "*=" / "/=" / "%=" / "+=" / "-=" / "<<=" / ">>=" / "&=" / "^=" / "|="
Expression < AssignmentExpression (',' AssignmentExpression)*
ConstantExpression <- ConditionalExpression
#
# C declaration rules
#
Declaration < DeclarationSpecifiers InitDeclaratorList? ';'
DeclarationSpecifiers < ( StorageClassSpecifier
/ TypeSpecifier
/ TypeQualifier
) DeclarationSpecifiers?
InitDeclaratorList < InitDeclarator (',' InitDeclarator)*
InitDeclarator < Declarator ('=' Initializer)?
StorageClassSpecifier <- "typedef" / "extern" / "static" / "auto" / "register"
TypeSpecifier <- "void"
/ "char" / "short" / "int" / "long"
/ "float" / "double"
/ "signed" / "unsigned"
/ StructOrUnionSpecifier
/ EnumSpecifier
#/ TypedefName # To reactivate with an associated semantic action:
# - keep a list of typedef'd names
# - and verify that the read identifier is already defined
StructOrUnionSpecifier < ("struct" / "union") ( Identifier ('{' StructDeclarationList '}')?
/ '{' StructDeclarationList '}')
StructDeclarationList <- StructDeclaration (:Spacing StructDeclaration)*
StructDeclaration < SpecifierQualifierList StructDeclaratorList ';'
SpecifierQualifierList <- (TypeQualifier / TypeSpecifier) (:Spacing (TypeQualifier / TypeSpecifier))*
StructDeclaratorList < StructDeclarator (',' StructDeclarator)*
StructDeclarator < ( Declarator ConstantExpression?
/ ConstantExpression)
EnumSpecifier < "enum" ( Identifier ('{' EnumeratorList '}')?
/ '{' EnumeratorList '}')
EnumeratorList < Enumerator (',' Enumerator)*
Enumerator < EnumerationConstant ('=' ConstantExpression)?
EnumerationConstant <- Identifier
TypeQualifier <- "const" / "volatile"
Declarator < Pointer? DirectDeclarator
DirectDeclarator < (Identifier / '(' Declarator ')') ( '[' ']'
/ '[' ConstantExpression ']'
/ '(' ')'
/ '(' ParameterTypeList ')'
/ '(' IdentifierList ')'
)*
Pointer < ('*' TypeQualifier*)*
TypeQualifierList <- TypeQualifier (:Spacing TypeQualifier)*
ParameterTypeList < ParameterList (',' "...")?
ParameterList < ParameterDeclaration (',' ParameterDeclaration)*
ParameterDeclaration < DeclarationSpecifiers (Declarator / AbstractDeclarator)?
IdentifierList < Identifier (',' Identifier)*
TypeName < SpecifierQualifierList AbstractDeclarator?
AbstractDeclarator < Pointer DirectAbstractDeclarator
/ DirectAbstractDeclarator
/ Pointer
DirectAbstractDeclarator < ('(' AbstractDeclarator ')'
/ '[' ']'
/ '[' ConstantExpression ']'
/ '(' ')'
/ '(' ParameterTypeList ')'
)
( '[' ']'
/ '[' ConstantExpression ']'
/ '(' ')'
/ '(' ParameterTypeList ')'
)*
TypedefName <- Identifier
Initializer < AssignmentExpression
/ '{' InitializerList ','? '}'
InitializerList < Initializer (',' Initializer)*
#
# C statement rules
#
Statement < LabeledStatement
/ CompoundStatement
/ ExpressionStatement
/ IfStatement
/ SwitchStatement
/ IterationStatement
/ GotoStatement
/ ContinueStatement
/ BreakStatement
/ ReturnStatement
LabeledStatement < Identifier ':' Statement
/ 'case' ConstantExpression ':' Statement
/ 'default' ':' Statement
CompoundStatement < '{' '}'
/ '{' DeclarationList '}'
/ '{' StatementList '}'
/ '{' DeclarationList StatementList '}'
DeclarationList <- Declaration (:Spacing Declaration)*
StatementList <- Statement (:Spacing Statement)*
ExpressionStatement < Expression? ';'
IfStatement < "if" '(' Expression ')' Statement ('else' Statement)?
SwitchStatement < "switch" '(' Expression ')' Statement
IterationStatement < WhileStatement / DoStatement / ForStatement
WhileStatement < "while" '(' Expression ')' Statement
DoStatement < "do" Statement "while" '(' Expression ')' ';'
ForStatement < "for" '(' Expression? ';' Expression? ';' Expression? ')' Statement
GotoStatement < "goto" Identifier ';'
ContinueStatement < "continue" ';'
BreakStatement < "break" ';'
ReturnStatement < Return Expression? :';'
Return <- "return"
# The following comes from me, not an official C grammar
Identifier <~ !Keyword [a-zA-Z_] [a-zA-Z0-9_]*
Keyword <- "auto" / "break" / "case" / "char" / "const" / "continue"
/ "default" / "double" / "do" / "else" / "enum" / "extern"
/ "float" / "for" / "goto" / "if" / "inline" / "int" / "long"
/ "register" / "restrict" / "return" / "short" / "signed"
/ "sizeof" / "static" / "struct" / "switch" / "typedef" / "union"
/ "unsigned" / "void" / "volatile" / "while"
/ "_Bool" / "_Adaomplex" / "_Imaginary"
Spacing <~ (space / endOfLine / Comment)*
Comment <~ "//" (!endOfLine .)* endOfLine
StringLiteral <~ doublequote (DQChar)* doublequote
DQChar <- EscapeSequence
/ !doublequote .
EscapeSequence <~ backslash ( quote
/ doublequote
/ backslash
/ [abfnrtv]
)
CharLiteral <~ quote (!quote (EscapeSequence / .)) quote
IntegerLiteral <~ Sign? Integer IntegerSuffix?
Integer <~ digit+
IntegerSuffix <- "Lu" / "LU" / "uL" / "UL"
/ "L" / "u" / "U"
FloatLiteral <~ Sign? Integer "." Integer? (("e" / "E") Sign? Integer)?
Sign <- "-" / "+"
`;
enum parserPath_Ada = "parser_Ada.d";
enum grammarPath_Ada = "grammar_Ada.peg";
static if (__traits(compiles, { enum string _ = import(parserPath_Ada); })) // TODO faster way?
{
pragma(msg, "Loaded cached parser " ~ parserPath_Ada);
enum parserCached_Ada = import(parserPath_Ada);
}
else
{
pragma(msg, "Skipped cached parser " ~ parserPath_Ada);
enum parserCached_Ada = [];
}
static if (__traits(compiles, { enum string _ = import(grammarPath_Ada); })) // TODO faster way?
{
pragma(msg, "Loaded cached grammar " ~ grammarPath_Ada);
enum grammarCached_Ada = import(grammarPath_Ada);
}
else
{
pragma(msg, "Skipped cached grammar " ~ grammarPath_Ada);
enum grammarCached_Ada = [];
}
static if (grammar_Ada == grammarCached_Ada)
{
pragma(msg, "Unchanged grammar " ~ grammarPath_Ada ~ ", reusing existing cached parser");
enum parser_Ada = parserCached_Ada;
}
else
{
pragma(msg, "Grammar " ~ grammarPath_Ada ~ " has changed, regenerating parser");
enum parser_Ada = grammar(grammar_Ada);
}
mixin(parser_Ada);
shared static this()
{
import std.file: write;
import std.path: buildNormalizedPath;
write(buildNormalizedPath("generated_source", parserPath_Ada), parser_Ada);
write(buildNormalizedPath("generated_source/", grammarPath_Ada), grammar_Ada);
}
|
D
|
module emul.vdp.vdpstate;
import gamelib.debugout;
enum VdpFlags
{
PalMode = 1 << 0,
DmaInProgress = 1 << 1,
HBlank = 1 << 2,
VBlank = 1 << 3,
OddFrame = 1 << 4,
SpriteCollision = 1 << 5,
SpriteOverflow = 1 << 6,
VInterruptPending = 1 << 7,
FIFOFull = 1 << 8,
FIFIEmpty = 1 << 9
}
enum VdpCodeRegState
{
VRamRead = 0b0000,
VRamWrite = 0b0001,
CRamWrite = 0b0011,
VSRamRead = 0b0100,
VSRamWrite = 0b0101,
CRamRead = 0b1000
}
enum DmaType
{
Transfer,
Fill,
Copy
}
enum HScrollMode
{
FullScreen = 0x0,
FirstEightLines = 0x1,
EveryRow = 0x2,
EveryLine = 0x3,
}
enum VScrollMode
{
FullScreen = 0x0,
TwoCell = 0x1,
}
struct UserSettings
{
pure nothrow @nogc @safe:
bool isAplaneVisible = true;
bool isBplaneVisible = true;
bool isWindowVisible = true;
}
struct VdpState
{
pure nothrow @nogc @safe:
UserSettings user;
ubyte[24] R;
ushort Status = 0x3600;
uint AddressReg;
VdpCodeRegState CodeReg = VdpCodeRegState.VRamRead;
int TotalWidth;
int TotalHeight;
int StartLine;
int EndLine;
int CellWidth;
int CellHeight;
int Width;
int Height;
int TicksPerFrame;
int TicksPerScan;
int TicksPerRetrace;
uint CurrentFrame = 0;
int CurrentLine = 0;
uint FrameStart = 0;
int HInterruptCounter = 0;
bool HBlankScheduled = false;
bool VBlankScheduled = false;
@property const
{
bool displayEnable() { return 0x0 == (R[0] & 0x1); }
bool displayBlank() { return 0x0 == (R[1] & (1 << 6));}
bool hInterruptEnabled() { return 0x0 != (R[0] & (1 << 4)); }
bool vInterruptEnabled() { return 0x0 != (R[1] & (1 << 5)); }
uint patternNameTableLayerA() { return (R[2] & 0b111000) << 10; }
uint patternNameTableWindow() { return (R[3] & 0b111110) << 10;}
uint patternnameTableLayerB() { return (R[4] & 0b111) << 13; }
int layerWidth()
{
return 32 + 32 * (R[16] & 0b11);
}
int layerHeight()
{
return 32 + 32 * ((R[16] >> 4) & 0b11);
}
uint hScrollTableAddress() { return (R[13] & 0b111111) << 10; }
HScrollMode hscrollMode() { return cast(HScrollMode)(R[11] & 0b11); }
VScrollMode vscrollMode() { return cast(VScrollMode)((R[11] >> 3) & 0x1); }
uint spriteAttributeTable() { return (R[5] & 0x7f) << 9;}
auto backdropColor() { return cast(ubyte)(R[7] & 0b111_111); }
auto interruptCounter() { return R[10]; }
bool dmaEnabled() { return 0x0 != (R[1] & (1 << 4)); }
bool wideDisplayMode() { return 0x0 != (R[12] & 1); }
bool tallDisplayMode() { return 0x0 != (R[1] & (1 << 3));}
auto autoIncrement() { return R[15]; }
auto dmaType()
{
if(0x0 == (R[23] & 0x80)) return DmaType.Transfer;
else if(0x0 == (R[23] & 0x40)) return DmaType.Fill;
else return DmaType.Copy;
}
auto dmaLen() { return R[19] | (R[20] << 8); }
auto dmaSrcAddress()
{
assert(0x0 == (R[23] & 0x80));
return (R[21] | (R[22] << 8) | (R[23] << 16)) << 1;
}
bool planeAVisible() { return user.isAplaneVisible; }
bool planeBVisible() { return user.isBplaneVisible; }
bool windowEnabled() { return 0x0 != R[17] && 0x0 != R[18] && user.isWindowVisible; }
bool windowIsRight() { return 0x0 != (R[17] & (1 << 7)); }
auto windowHPos() { return (R[17] & 0b11111) << 1; }
bool windowIsDown() { return 0x0 != (R[18] & (1 << 7)); }
auto windowVPos() { return R[18] & 0b11111; }
}
void setFlags(VdpFlags flags)() { Status |= flags; }
void clearFlags(VdpFlags flags)() { Status &= ~flags; }
bool testFlags(VdpFlags flags)() const { return 0x0 != (Status & flags); }
void setFlags(VdpFlags flags)(bool set) { if(set) setFlags!flags; else clearFlags!flags; }
}
|
D
|
// ************************************************************************************************
// Heilwirkung und Kosten von Nahrung
// ************************************************************************************************
// Mana_: Gibt an wieviel Manapunkte das Kraut beim Essen wiedergibt
// HP_: Gibt an wieviel Lebenspunkte das Kraut beim Essen wiedergibt
// ************************************************************************************************
const int Value_Weed = 0;
const int Value_Beet = 3; const int HP_Beet = 2;
const int Value_SwampHerb = 10;
const int Value_Mana_Herb_01 = 10; const int Mana_Mana_Herb_01 = 10;
const int Value_Mana_Herb_02 = 20; const int Mana_Mana_Herb_02 = 15;
const int Value_Mana_Herb_03 = 40; const int Mana_Mana_Herb_03 = 20;
const int Value_Health_Herb_01 = 20; const int HP_Health_Herb_01 = 10;
const int Value_Health_Herb_02 = 40; const int HP_Health_Herb_02 = 20;
const int Value_Health_Herb_03 = 60; const int HP_Health_Herb_03 = 30;
const int Value_Dex_Herb_01 = 250;
const int Value_Strength_Herb_01 = 500;
const int Value_Speed_Herb_01 = 100; const int Speed_Boost = 15000; //15 Sekunden
const int Value_Mushroom_01 = 10; const int HP_Mushroom_01 = 5;
const int Value_Mushroom_02 = 30; const int HP_Mushroom_02 = 15;
const int Value_Forestberry = 10; const int HP_Forestberry = 5;
const int Value_Blueplant = 10; const int HP_Blueplant = 5;
const int Mana_Blueplant = 5;
const int Value_Planeberry = 10; const int HP_Planeberry = 5;
const int Value_Temp_Herb = 100; const int HP_Temp_Herb = 5;
const int Value_Perm_Herb = 500; const int HP_Perm_Herb = 5;
/******************************************************************************************/
INSTANCE ItPl_Weed(C_Item)
{
name = "Tráva";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Weed;
visual = "ItPl_Weed.3ds";
material = MAT_LEATHER;
scemeName = "FOOD";
description = name;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Weed;
};
/******************************************************************************************/
INSTANCE ItPl_Beet (C_Item)
{
name = "Tuâín";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Beet;
visual = "ItPl_Beet.3ds";
material = MAT_LEATHER;
on_state[0] = Use_Beet;
scemeName = "FOOD";
description = name;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Beet;
};
func void Use_Beet ()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Beet);
};
/******************************************************************************************/
INSTANCE ItPl_SwampHerb(C_Item)
{
name = "Tráva z bažin";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_SwampHerb;
visual = "ItPl_SwampHerb.3ds";
material = MAT_LEATHER;
on_state[0] = Use_SwampHerb;
scemeName = "FOOD";
description = name;
TEXT[5] = NAME_Value;
COUNT[5] = Value_SwampHerb;
};
func void Use_SwampHerb ()
{
if (Npc_IsPlayer (self))
{
Wld_PlayEffect ("SLOW_TIME", self, self, 0, 0, 0, FALSE);
};
};
/******************************************************************************************/
INSTANCE ItPl_Mana_Herb_01(C_Item)
{
name = "Ohnivá kopâiva";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Mana_Herb_01;
visual = "ItPl_Mana_Herb_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Mana_Herb_01;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_Mana;
COUNT[1] = Mana_Mana_Herb_01;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Mana_Herb_01;
};
func void Use_Mana_Herb_01 ()
{
Npc_ChangeAttribute (self, ATR_MANA, Mana_Mana_Herb_01);
};
/******************************************************************************************/
INSTANCE ItPl_Mana_Herb_02(C_Item)
{
name = "Ohnivé býlí";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Mana_Herb_02;
visual = "ItPl_Mana_Herb_02.3ds";
material = MAT_LEATHER;
on_state[0] = Use_Mana_Herb_02;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_Mana;
COUNT[1] = Mana_Mana_Herb_02;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Mana_Herb_02;
};
func void Use_Mana_Herb_02 ()
{
Npc_ChangeAttribute (self, ATR_MANA, Mana_Mana_Herb_02);
};
/******************************************************************************************/
INSTANCE ItPl_Mana_Herb_03(C_Item)
{
name = "Ohnivý koâen";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Mana_Herb_03;
visual = "ItPl_Mana_Herb_03.3ds";
material = MAT_LEATHER;
on_state[0] = Use_Mana_Herb_03;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_Mana;
COUNT[1] = Mana_Mana_Herb_03;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Mana_Herb_03;
};
func void Use_Mana_Herb_03 ()
{
Npc_ChangeAttribute (self, ATR_MANA, Mana_Mana_Herb_03);
};
/******************************************************************************************/
INSTANCE ItPl_Health_Herb_01(C_Item)
{
name = "Léčivá rostlina";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Health_Herb_01;
visual = "ItPl_Health_Herb_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Health_Herb_01;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Health_Herb_01;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Health_Herb_01;
};
func void Use_Health_Herb_01 ()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Health_Herb_01);
};
/******************************************************************************************/
INSTANCE ItPl_Health_Herb_02(C_Item)
{
name = "Léčivá bylina";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Health_Herb_02;
visual = "ItPl_Health_Herb_02.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Health_Herb_02;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Health_Herb_02;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Health_Herb_02;
};
func void Use_Health_Herb_02 ()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Health_Herb_02);
};
/******************************************************************************************/
INSTANCE ItPl_Health_Herb_03(C_Item)
{
name = "Léčivý koâen";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Health_Herb_03;
visual = "ItPl_Health_Herb_03.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Health_Herb_03;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_HP; COUNT[1] = HP_Health_Herb_03;
TEXT[5] = NAME_Value; COUNT[5] = Value_Health_Herb_03;
};
func void Use_Health_Herb_03 ()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Health_Herb_03);
};
/******************************************************************************************/
INSTANCE ItPl_Dex_Herb_01(C_Item)
{
name = "Gobliní bobule";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Dex_Herb_01;
visual = "ItPl_Dex_Herb_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Dex_Herb_01;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_Dex;
COUNT[1] = 1;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Dex_Herb_01;
};
FUNC VOID USE_Dex_Herb_01 ()
{
B_RaiseAttribute (self, ATR_DEXTERITY ,1);
};
/******************************************************************************************/
INSTANCE ItPl_Strength_Herb_01(C_Item)
{
name = "Dračí koâen";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Strength_Herb_01;
visual = "ItPl_Strength_Herb_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Strength_Herb_01;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_Str;
COUNT[1] = 1;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Strength_Herb_01;
};
FUNC VOID USE_Strength_Herb_01 ()
{
B_RaiseAttribute (self, ATR_STRENGTH,1);
};
/******************************************************************************************/
INSTANCE ItPl_Speed_Herb_01(C_Item)
{
name = "Chŕapavčí býlí";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Speed_Herb_01;
visual = "ItPl_Speed_Herb_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Speed_Herb_01;
scemeName = "FOOD";
TEXT[3] = NAME_Sec_Duration;
COUNT[3] = Speed_Boost /1000;
description = name;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Speed_Herb_01;
};
func void Use_Speed_Herb_01 ()
{
Mdl_ApplyOverlayMDSTimed (self, "HUMANS_SPRINT.MDS", Speed_Boost);
};
/******************************************************************************************/
INSTANCE ItPl_Mushroom_01(C_Item)
{
name = "Tmavá houba";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Mushroom_01;
visual = "ItPl_Mushroom_01.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Mushroom_01;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Mushroom_01;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Mushroom_01;
};
func void Use_Mushroom_01 ()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Mushroom_01);
if (Npc_IsPlayer (self))
{
Dunkelpilz_Bonus = Dunkelpilz_Bonus + 1;
if (Dunkelpilz_Bonus == 50)
{
B_RaiseAttribute (self, ATR_MANA_MAX, 5);
Npc_ChangeAttribute (self, ATR_MANA, 5);
Snd_Play ("LevelUp");
Dunkelpilz_Bonus = 0;
};
};
};
/******************************************************************************************/
INSTANCE ItPl_Mushroom_02(C_Item)
{
name = "Otrokův chléb";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Mushroom_02;
visual = "ItPl_Mushroom_02.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Mushroom_02;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Mushroom_02;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Mushroom_02;
};
func void Use_Mushroom_02 ()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Mushroom_02);
};
/******************************************************************************************/
INSTANCE ItPl_Blueplant(C_Item)
{
name = "Borůvky";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Blueplant;
visual = "ItPl_Blueplant.3DS";
material = MAT_LEATHER;
on_state[0] = Use_Blueplant;
scemeName = "FOOD";
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Blueplant;
TEXT[2] = NAME_Bonus_Mana;
COUNT[2] = Mana_Blueplant;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Blueplant;
};
func void Use_Blueplant ()
{
Npc_ChangeAttribute (self, ATR_MANA, Mana_Blueplant);
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Blueplant);
};
/******************************************************************************************/
INSTANCE ItPl_Forestberry (C_Item)
{
name = "Lesní bobule";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Forestberry;
visual = "ItPl_Forestberry.3DS";
material = MAT_LEATHER;
scemeName = "FOOD";
on_state[0] = Use_Forestberry;
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Forestberry;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Forestberry;
};
FUNC VOID Use_Forestberry()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Forestberry);
};
/******************************************************************************************/
INSTANCE ItPl_Planeberry (C_Item)
{
name = "Luční bobule";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = Value_Planeberry;
visual = "ItPl_Planeberry.3DS";
material = MAT_LEATHER;
scemeName = "FOOD";
on_state[0] = Use_Planeberry;
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Planeberry;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Planeberry;
};
FUNC VOID Use_Planeberry()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Planeberry);
};
/******************************************************************************************/
//******************************************************************************************
// Pflanze zum brauen von temporären und permanten Tränken
//******************************************************************************************
INSTANCE ItPl_Temp_Herb(C_Item)
{
name = "Luční pohanka";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI|ITEM_MISSION;
value = Value_Temp_Herb;
visual = "ItPl_Temp_Herb.3ds";
material = MAT_LEATHER;
scemeName = "FOOD";
on_state[0] = Use_Temp_Herb;
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Temp_Herb;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Temp_Herb;
};
FUNC VOID Use_Temp_Herb()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Temp_Herb);
};
INSTANCE ItPl_Perm_Herb(C_Item)
{
name = "Královský šăovík";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI|ITEM_MISSION;
value = Value_Perm_Herb;
visual = "ItPl_Perm_Herb.3ds";
material = MAT_LEATHER;
scemeName = "FOOD";
on_state[0] = Use_Perm_Herb;
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = HP_Perm_Herb;
TEXT[5] = NAME_Value;
COUNT[5] = Value_Perm_Herb;
};
FUNC VOID Use_Perm_Herb()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, HP_Perm_Herb);
};
|
D
|
// REQUIRED_ARGS:
// PERMUTE_ARGS: -w -d -de -dw
extern(C) int printf(const char*, ...);
/***************************************************/
// mutable field
struct S1A
{
int v;
this(int)
{
v = 1;
v = 2; // multiple initialization
}
}
struct S1B
{
int v;
this(int)
{
if (true) v = 1; else v = 2;
v = 3; // multiple initialization
}
this(long)
{
if (true) v = 1;
v = 3; // multiple initialization
}
this(string)
{
if (true) {} else v = 2;
v = 3; // multiple initialization
}
}
struct S1C
{
int v;
this(int)
{
true ? (v = 1) : (v = 2);
v = 3; // multiple initialization
}
this(long)
{
auto x = true ? (v = 1) : 2;
v = 3; // multiple initialization
}
this(string)
{
auto x = true ? 1 : (v = 2);
v = 3; // multiple initialization
}
}
/***************************************************/
// with control flow
struct S2
{
immutable int v;
immutable int w;
int x;
this(int)
{
if (true) v = 1;
else v = 2;
true ? (w = 1) : (w = 2);
x = 1; // initialization
L: x = 2; // assignment after labels
}
this(long n)
{
if (n > 0)
return;
v = 1; // skipped initialization
// w skipped initialization
x = 1; // initialization
foreach (i; 0..1) x = 2; // assignment in loops
}
}
/***************************************************/
// with immutable constructor
struct S3
{
int v;
int w;
this(int) immutable
{
if (true) v = 1;
else v = 2;
true ? (w = 1) : (w = 2);
}
}
/***************************************************/
// in typeof
struct S4
{
immutable int v;
this(int)
{
static assert(is(typeof(v = 1)));
v = 1;
}
}
/***************************************************/
// 8117
struct S8117
{
@disable this();
this(int) {}
}
class C8117
{
S8117 s = S8117(1);
}
void test8117()
{
auto t = new C8117();
}
/***************************************************/
// 9665
struct X9665
{
static uint count;
ulong payload;
this(int n) { payload = n; count += 1; }
this(string s) immutable { payload = s.length; count += 10; }
void opAssign(X9665 x) { payload = 100; count += 100; }
}
struct S9665
{
X9665 mval;
immutable X9665 ival;
this(int n)
{
X9665.count = 0;
mval = X9665(n); // 1st, initializing
ival = immutable X9665("hi"); // 1st, initializing
mval = X9665(1); // 2nd, assignment
static assert(!__traits(compiles, ival = immutable X9665(1))); // 2nd, assignment
//printf("X9665.count = %d\n", X9665.count);
assert(X9665.count == 112);
}
this(int[])
{
X9665.count = 0;
mval = 1; // 1st, initializing (implicit constructor call)
ival = "hoo"; // ditto
assert(X9665.count == 11);
}
}
void test9665()
{
S9665 s1 = S9665(1);
assert(s1.mval.payload == 100);
assert(s1.ival.payload == 2);
S9665 s2 = S9665([]);
assert(s2.mval.payload == 1);
assert(s2.ival.payload == 3);
}
/***************************************************/
// 11246
struct Foo11246
{
static int ctor = 0;
static int dtor = 0;
this(int i)
{
++ctor;
}
~this()
{
++dtor;
}
}
struct Bar11246
{
Foo11246 foo;
this(int)
{
foo = Foo11246(5);
assert(Foo11246.ctor == 1);
assert(Foo11246.dtor == 0);
}
}
void test11246()
{
{
auto bar = Bar11246(1);
assert(Foo11246.ctor == 1);
assert(Foo11246.dtor == 0);
}
assert(Foo11246.ctor == 1);
assert(Foo11246.dtor == 1);
}
/***************************************************/
int main()
{
test8117();
test9665();
test11246();
printf("Success\n");
return 0;
}
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Frank Benoit <benoit@tionex.de>
*******************************************************************************/
module dwtx.jface.text.ITextDoubleClickStrategy;
import dwtx.jface.text.IDocumentPartitioningListener; // packageimport
import dwtx.jface.text.DefaultTextHover; // packageimport
import dwtx.jface.text.AbstractInformationControl; // packageimport
import dwtx.jface.text.TextUtilities; // packageimport
import dwtx.jface.text.IInformationControlCreatorExtension; // packageimport
import dwtx.jface.text.AbstractInformationControlManager; // packageimport
import dwtx.jface.text.ITextViewerExtension2; // packageimport
import dwtx.jface.text.IDocumentPartitioner; // packageimport
import dwtx.jface.text.DefaultIndentLineAutoEditStrategy; // packageimport
import dwtx.jface.text.ITextSelection; // packageimport
import dwtx.jface.text.Document; // packageimport
import dwtx.jface.text.FindReplaceDocumentAdapterContentProposalProvider; // packageimport
import dwtx.jface.text.ITextListener; // packageimport
import dwtx.jface.text.BadPartitioningException; // packageimport
import dwtx.jface.text.ITextViewerExtension5; // packageimport
import dwtx.jface.text.IDocumentPartitionerExtension3; // packageimport
import dwtx.jface.text.IUndoManager; // packageimport
import dwtx.jface.text.ITextHoverExtension2; // packageimport
import dwtx.jface.text.IRepairableDocument; // packageimport
import dwtx.jface.text.IRewriteTarget; // packageimport
import dwtx.jface.text.DefaultPositionUpdater; // packageimport
import dwtx.jface.text.RewriteSessionEditProcessor; // packageimport
import dwtx.jface.text.TextViewerHoverManager; // packageimport
import dwtx.jface.text.DocumentRewriteSession; // packageimport
import dwtx.jface.text.TextViewer; // packageimport
import dwtx.jface.text.ITextViewerExtension8; // packageimport
import dwtx.jface.text.RegExMessages; // packageimport
import dwtx.jface.text.IDelayedInputChangeProvider; // packageimport
import dwtx.jface.text.ITextOperationTargetExtension; // packageimport
import dwtx.jface.text.IWidgetTokenOwner; // packageimport
import dwtx.jface.text.IViewportListener; // packageimport
import dwtx.jface.text.GapTextStore; // packageimport
import dwtx.jface.text.MarkSelection; // packageimport
import dwtx.jface.text.IDocumentPartitioningListenerExtension; // packageimport
import dwtx.jface.text.IDocumentAdapterExtension; // packageimport
import dwtx.jface.text.IInformationControlExtension; // packageimport
import dwtx.jface.text.IDocumentPartitioningListenerExtension2; // packageimport
import dwtx.jface.text.DefaultDocumentAdapter; // packageimport
import dwtx.jface.text.ITextViewerExtension3; // packageimport
import dwtx.jface.text.IInformationControlCreator; // packageimport
import dwtx.jface.text.TypedRegion; // packageimport
import dwtx.jface.text.ISynchronizable; // packageimport
import dwtx.jface.text.IMarkRegionTarget; // packageimport
import dwtx.jface.text.TextViewerUndoManager; // packageimport
import dwtx.jface.text.IRegion; // packageimport
import dwtx.jface.text.IInformationControlExtension2; // packageimport
import dwtx.jface.text.IDocumentExtension4; // packageimport
import dwtx.jface.text.IDocumentExtension2; // packageimport
import dwtx.jface.text.IDocumentPartitionerExtension2; // packageimport
import dwtx.jface.text.Assert; // packageimport
import dwtx.jface.text.DefaultInformationControl; // packageimport
import dwtx.jface.text.IWidgetTokenOwnerExtension; // packageimport
import dwtx.jface.text.DocumentClone; // packageimport
import dwtx.jface.text.DefaultUndoManager; // packageimport
import dwtx.jface.text.IFindReplaceTarget; // packageimport
import dwtx.jface.text.IAutoEditStrategy; // packageimport
import dwtx.jface.text.ILineTrackerExtension; // packageimport
import dwtx.jface.text.IUndoManagerExtension; // packageimport
import dwtx.jface.text.TextSelection; // packageimport
import dwtx.jface.text.DefaultAutoIndentStrategy; // packageimport
import dwtx.jface.text.IAutoIndentStrategy; // packageimport
import dwtx.jface.text.IPainter; // packageimport
import dwtx.jface.text.IInformationControl; // packageimport
import dwtx.jface.text.IInformationControlExtension3; // packageimport
import dwtx.jface.text.ITextViewerExtension6; // packageimport
import dwtx.jface.text.IInformationControlExtension4; // packageimport
import dwtx.jface.text.DefaultLineTracker; // packageimport
import dwtx.jface.text.IDocumentInformationMappingExtension; // packageimport
import dwtx.jface.text.IRepairableDocumentExtension; // packageimport
import dwtx.jface.text.ITextHover; // packageimport
import dwtx.jface.text.FindReplaceDocumentAdapter; // packageimport
import dwtx.jface.text.ILineTracker; // packageimport
import dwtx.jface.text.Line; // packageimport
import dwtx.jface.text.ITextViewerExtension; // packageimport
import dwtx.jface.text.IDocumentAdapter; // packageimport
import dwtx.jface.text.TextEvent; // packageimport
import dwtx.jface.text.BadLocationException; // packageimport
import dwtx.jface.text.AbstractDocument; // packageimport
import dwtx.jface.text.AbstractLineTracker; // packageimport
import dwtx.jface.text.TreeLineTracker; // packageimport
import dwtx.jface.text.ITextPresentationListener; // packageimport
import dwtx.jface.text.Region; // packageimport
import dwtx.jface.text.ITextViewer; // packageimport
import dwtx.jface.text.IDocumentInformationMapping; // packageimport
import dwtx.jface.text.MarginPainter; // packageimport
import dwtx.jface.text.IPaintPositionManager; // packageimport
import dwtx.jface.text.TextPresentation; // packageimport
import dwtx.jface.text.IFindReplaceTargetExtension; // packageimport
import dwtx.jface.text.ISlaveDocumentManagerExtension; // packageimport
import dwtx.jface.text.ISelectionValidator; // packageimport
import dwtx.jface.text.IDocumentExtension; // packageimport
import dwtx.jface.text.PropagatingFontFieldEditor; // packageimport
import dwtx.jface.text.ConfigurableLineTracker; // packageimport
import dwtx.jface.text.SlaveDocumentEvent; // packageimport
import dwtx.jface.text.IDocumentListener; // packageimport
import dwtx.jface.text.PaintManager; // packageimport
import dwtx.jface.text.IFindReplaceTargetExtension3; // packageimport
import dwtx.jface.text.IDocumentExtension3; // packageimport
import dwtx.jface.text.Position; // packageimport
import dwtx.jface.text.TextMessages; // packageimport
import dwtx.jface.text.CopyOnWriteTextStore; // packageimport
import dwtx.jface.text.WhitespaceCharacterPainter; // packageimport
import dwtx.jface.text.IPositionUpdater; // packageimport
import dwtx.jface.text.DefaultTextDoubleClickStrategy; // packageimport
import dwtx.jface.text.ListLineTracker; // packageimport
import dwtx.jface.text.ITextInputListener; // packageimport
import dwtx.jface.text.BadPositionCategoryException; // packageimport
import dwtx.jface.text.IWidgetTokenKeeperExtension; // packageimport
import dwtx.jface.text.IInputChangedListener; // packageimport
import dwtx.jface.text.ITextOperationTarget; // packageimport
import dwtx.jface.text.IDocumentInformationMappingExtension2; // packageimport
import dwtx.jface.text.ITextViewerExtension7; // packageimport
import dwtx.jface.text.IInformationControlExtension5; // packageimport
import dwtx.jface.text.IDocumentRewriteSessionListener; // packageimport
import dwtx.jface.text.JFaceTextUtil; // packageimport
import dwtx.jface.text.AbstractReusableInformationControlCreator; // packageimport
import dwtx.jface.text.TabsToSpacesConverter; // packageimport
import dwtx.jface.text.CursorLinePainter; // packageimport
import dwtx.jface.text.ITextHoverExtension; // packageimport
import dwtx.jface.text.IEventConsumer; // packageimport
import dwtx.jface.text.IDocument; // packageimport
import dwtx.jface.text.IWidgetTokenKeeper; // packageimport
import dwtx.jface.text.DocumentCommand; // packageimport
import dwtx.jface.text.TypedPosition; // packageimport
import dwtx.jface.text.IEditingSupportRegistry; // packageimport
import dwtx.jface.text.IDocumentPartitionerExtension; // packageimport
import dwtx.jface.text.AbstractHoverInformationControlManager; // packageimport
import dwtx.jface.text.IEditingSupport; // packageimport
import dwtx.jface.text.IMarkSelection; // packageimport
import dwtx.jface.text.ISlaveDocumentManager; // packageimport
import dwtx.jface.text.DocumentEvent; // packageimport
import dwtx.jface.text.DocumentPartitioningChangedEvent; // packageimport
import dwtx.jface.text.ITextStore; // packageimport
import dwtx.jface.text.JFaceTextMessages; // packageimport
import dwtx.jface.text.DocumentRewriteSessionEvent; // packageimport
import dwtx.jface.text.SequentialRewriteTextStore; // packageimport
import dwtx.jface.text.DocumentRewriteSessionType; // packageimport
import dwtx.jface.text.TextAttribute; // packageimport
import dwtx.jface.text.ITextViewerExtension4; // packageimport
import dwtx.jface.text.ITypedRegion; // packageimport
import dwt.dwthelper.utils;
/**
* A text double click strategy defines the reaction of a text viewer to mouse
* double click events. The strategy must be installed on an
* {@link dwtx.jface.text.ITextViewer}.
* <p>
* Clients may implement this interface or use the standard implementation
* <code>DefaultTextDoubleClickStrategy</code>.</p>
*
* @see dwtx.jface.text.ITextViewer
* @see dwt.events.MouseListener#mouseDoubleClick(dwt.events.MouseEvent)
*/
public interface ITextDoubleClickStrategy {
/**
* The mouse has been double clicked on the given text viewer.
*
* @param viewer the viewer into which has been double clicked
*/
void doubleClicked(ITextViewer viewer);
}
|
D
|
/**
A package manager.
Copyright: © 2012-2013 Matthias Dondorff, 2012-2016 Sönke Ludwig
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Matthias Dondorff, Sönke Ludwig
*/
module dub.dub;
import dub.compilers.compiler;
import dub.dependency;
import dub.dependencyresolver;
import dub.internal.utils;
import dub.internal.vibecompat.core.file;
import dub.internal.vibecompat.core.log;
import dub.internal.vibecompat.data.json;
import dub.internal.vibecompat.inet.url;
import dub.package_;
import dub.packagemanager;
import dub.packagesuppliers;
import dub.project;
import dub.generators.generator;
import dub.init;
import std.algorithm;
import std.array : array, replace;
import std.conv : to;
import std.exception : enforce;
import std.file;
import std.process : environment;
import std.range : assumeSorted, empty;
import std.string;
import std.encoding : sanitize;
// Workaround for libcurl liker errors when building with LDC
version (LDC) pragma(lib, "curl");
// Set output path and options for coverage reports
version (DigitalMars) version (D_Coverage) static if (__VERSION__ >= 2068)
{
shared static this()
{
import core.runtime, std.file, std.path, std.stdio;
dmd_coverSetMerge(true);
auto path = buildPath(dirName(thisExePath()), "../cov");
if (!path.exists)
mkdir(path);
dmd_coverDestPath(path);
}
}
static this()
{
import dub.compilers.dmd : DMDCompiler;
import dub.compilers.gdc : GDCCompiler;
import dub.compilers.ldc : LDCCompiler;
registerCompiler(new DMDCompiler);
registerCompiler(new GDCCompiler);
registerCompiler(new LDCCompiler);
}
deprecated("use defaultRegistryURLs") enum defaultRegistryURL = defaultRegistryURLs[0];
/// The URL to the official package registry and it's default fallback registries.
enum defaultRegistryURLs = [
"https://code.dlang.org/",
"https://code-mirror.dlang.io/",
"https://dub-registry.herokuapp.com/",
];
/** Returns a default list of package suppliers.
This will contain a single package supplier that points to the official
package registry.
See_Also: `defaultRegistryURLs`
*/
PackageSupplier[] defaultPackageSuppliers()
{
logDiagnostic("Using dub registry url '%s'", defaultRegistryURLs[0]);
return [new FallbackPackageSupplier(defaultRegistryURLs.map!getRegistryPackageSupplier.array)];
}
/** Returns a registry package supplier according to protocol.
Allowed protocols are dub+http(s):// and maven+http(s)://.
*/
PackageSupplier getRegistryPackageSupplier(string url)
{
switch (url.startsWith("dub+", "mvn+", "file://"))
{
case 1:
return new RegistryPackageSupplier(URL(url[4..$]));
case 2:
return new MavenRegistryPackageSupplier(URL(url[4..$]));
case 3:
return new FileSystemPackageSupplier(NativePath(url[7..$]));
default:
return new RegistryPackageSupplier(URL(url));
}
}
unittest
{
auto dubRegistryPackageSupplier = getRegistryPackageSupplier("dub+https://code.dlang.org");
assert(dubRegistryPackageSupplier.description.canFind(" https://code.dlang.org"));
dubRegistryPackageSupplier = getRegistryPackageSupplier("https://code.dlang.org");
assert(dubRegistryPackageSupplier.description.canFind(" https://code.dlang.org"));
auto mavenRegistryPackageSupplier = getRegistryPackageSupplier("mvn+http://localhost:8040/maven/libs-release/dubpackages");
assert(mavenRegistryPackageSupplier.description.canFind(" http://localhost:8040/maven/libs-release/dubpackages"));
auto fileSystemPackageSupplier = getRegistryPackageSupplier("file:///etc/dubpackages");
assert(fileSystemPackageSupplier.description.canFind(" " ~ NativePath("/etc/dubpackages").toNativeString));
}
/** Provides a high-level entry point for DUB's functionality.
This class provides means to load a certain project (a root package with
all of its dependencies) and to perform high-level operations as found in
the command line interface.
*/
class Dub {
private {
bool m_dryRun = false;
PackageManager m_packageManager;
PackageSupplier[] m_packageSuppliers;
NativePath m_rootPath;
SpecialDirs m_dirs;
DubConfig m_config;
NativePath m_projectPath;
Project m_project;
NativePath m_overrideSearchPath;
string m_defaultCompiler;
string m_defaultArchitecture;
}
/** The default placement location of fetched packages.
This property can be altered, so that packages which are downloaded as part
of the normal upgrade process are stored in a certain location. This is
how the "--local" and "--system" command line switches operate.
*/
PlacementLocation defaultPlacementLocation = PlacementLocation.user;
/** Initializes the instance for use with a specific root package.
Note that a package still has to be loaded using one of the
`loadPackage` overloads.
Params:
root_path = Path to the root package
additional_package_suppliers = A list of package suppliers to try
before the suppliers found in the configurations files and the
`defaultPackageSuppliers`.
skip_registry = Can be used to skip using the configured package
suppliers, as well as the default suppliers.
*/
this(string root_path = ".", PackageSupplier[] additional_package_suppliers = null,
SkipPackageSuppliers skip_registry = SkipPackageSuppliers.none)
{
m_rootPath = NativePath(root_path);
if (!m_rootPath.absolute) m_rootPath = NativePath(getcwd()) ~ m_rootPath;
init();
if (skip_registry == SkipPackageSuppliers.none)
m_packageSuppliers = getPackageSuppliers(additional_package_suppliers);
else
m_packageSuppliers = getPackageSuppliers(additional_package_suppliers, skip_registry);
m_packageManager = new PackageManager(m_dirs.localRepository, m_dirs.systemSettings);
auto ccps = m_config.customCachePaths;
if (ccps.length)
m_packageManager.customCachePaths = ccps;
updatePackageSearchPath();
}
unittest
{
scope (exit) environment.remove("DUB_REGISTRY");
auto dub = new Dub(".", null, SkipPackageSuppliers.configured);
assert(dub.m_packageSuppliers.length == 0);
environment["DUB_REGISTRY"] = "http://example.com/";
dub = new Dub(".", null, SkipPackageSuppliers.configured);
assert(dub.m_packageSuppliers.length == 1);
environment["DUB_REGISTRY"] = "http://example.com/;http://foo.com/";
dub = new Dub(".", null, SkipPackageSuppliers.configured);
assert(dub.m_packageSuppliers.length == 2);
dub = new Dub(".", [new RegistryPackageSupplier(URL("http://bar.com/"))], SkipPackageSuppliers.configured);
assert(dub.m_packageSuppliers.length == 3);
}
/** Get the list of package suppliers.
Params:
additional_package_suppliers = A list of package suppliers to try
before the suppliers found in the configurations files and the
`defaultPackageSuppliers`.
skip_registry = Can be used to skip using the configured package
suppliers, as well as the default suppliers.
*/
public PackageSupplier[] getPackageSuppliers(PackageSupplier[] additional_package_suppliers, SkipPackageSuppliers skip_registry)
{
PackageSupplier[] ps = additional_package_suppliers;
if (skip_registry < SkipPackageSuppliers.all)
{
ps ~= environment.get("DUB_REGISTRY", null)
.splitter(";")
.map!(url => getRegistryPackageSupplier(url))
.array;
}
if (skip_registry < SkipPackageSuppliers.configured)
{
ps ~= m_config.registryURLs
.map!(url => getRegistryPackageSupplier(url))
.array;
}
if (skip_registry < SkipPackageSuppliers.standard)
ps ~= defaultPackageSuppliers();
return ps;
}
/// ditto
public PackageSupplier[] getPackageSuppliers(PackageSupplier[] additional_package_suppliers)
{
return getPackageSuppliers(additional_package_suppliers, m_config.skipRegistry);
}
unittest
{
scope (exit) environment.remove("DUB_REGISTRY");
auto dub = new Dub(".", null, SkipPackageSuppliers.none);
dub.m_config = new DubConfig(Json(["skipRegistry": Json("none")]), null);
assert(dub.getPackageSuppliers(null).length == 1);
dub.m_config = new DubConfig(Json(["skipRegistry": Json("configured")]), null);
assert(dub.getPackageSuppliers(null).length == 0);
dub.m_config = new DubConfig(Json(["skipRegistry": Json("standard")]), null);
assert(dub.getPackageSuppliers(null).length == 0);
environment["DUB_REGISTRY"] = "http://example.com/";
assert(dub.getPackageSuppliers(null).length == 1);
}
/** Initializes the instance with a single package search path, without
loading a package.
This constructor corresponds to the "--bare" option of the command line
interface. Use
*/
this(NativePath override_path)
{
init();
m_overrideSearchPath = override_path;
m_packageManager = new PackageManager(NativePath(), NativePath(), false);
updatePackageSearchPath();
}
private void init()
{
import std.file : tempDir;
version(Windows) {
m_dirs.systemSettings = NativePath(environment.get("ProgramData")) ~ "dub/";
immutable appDataDir = environment.get("APPDATA");
m_dirs.userSettings = NativePath(appDataDir) ~ "dub/";
m_dirs.localRepository = NativePath(environment.get("LOCALAPPDATA", appDataDir)) ~ "dub";
migrateRepositoryFromRoaming(m_dirs.userSettings ~"\\packages", m_dirs.localRepository ~ "\\packages");
} else version(Posix){
m_dirs.systemSettings = NativePath("/var/lib/dub/");
m_dirs.userSettings = NativePath(environment.get("HOME")) ~ ".dub/";
if (!m_dirs.userSettings.absolute)
m_dirs.userSettings = NativePath(getcwd()) ~ m_dirs.userSettings;
m_dirs.localRepository = m_dirs.userSettings;
}
m_dirs.temp = NativePath(tempDir);
m_config = new DubConfig(jsonFromFile(m_dirs.systemSettings ~ "settings.json", true), m_config);
m_config = new DubConfig(jsonFromFile(NativePath(thisExePath).parentPath ~ "../etc/dub/settings.json", true), m_config);
m_config = new DubConfig(jsonFromFile(m_dirs.userSettings ~ "settings.json", true), m_config);
determineDefaultCompiler();
m_defaultArchitecture = m_config.defaultArchitecture;
}
version(Windows)
private void migrateRepositoryFromRoaming(NativePath roamingDir, NativePath localDir)
{
immutable roamingDirPath = roamingDir.toNativeString();
if (!existsDirectory(roamingDir)) return;
immutable localDirPath = localDir.toNativeString();
logInfo("Detected a package cache in " ~ roamingDirPath ~ ". This will be migrated to " ~ localDirPath ~ ". Please wait...");
if (!existsDirectory(localDir))
{
mkdirRecurse(localDirPath);
}
runCommand(`xcopy /s /e /y "` ~ roamingDirPath ~ `" "` ~ localDirPath ~ `" > NUL`);
rmdirRecurse(roamingDirPath);
}
@property void dryRun(bool v) { m_dryRun = v; }
/** Returns the root path (usually the current working directory).
*/
@property NativePath rootPath() const { return m_rootPath; }
/// ditto
@property void rootPath(NativePath root_path)
{
m_rootPath = root_path;
if (!m_rootPath.absolute) m_rootPath = NativePath(getcwd()) ~ m_rootPath;
}
/// Returns the name listed in the dub.json of the current
/// application.
@property string projectName() const { return m_project.name; }
@property NativePath projectPath() const { return m_projectPath; }
@property string[] configurations() const { return m_project.configurations; }
@property inout(PackageManager) packageManager() inout { return m_packageManager; }
@property inout(Project) project() inout { return m_project; }
/** Returns the default compiler binary to use for building D code.
If set, the "defaultCompiler" field of the DUB user or system
configuration file will be used. Otherwise the PATH environment variable
will be searched for files named "dmd", "gdc", "gdmd", "ldc2", "ldmd2"
(in that order, taking into account operating system specific file
extensions) and the first match is returned. If no match is found, "dmd"
will be used.
*/
@property string defaultCompiler() const { return m_defaultCompiler; }
/** Returns the default architecture to use for building D code.
If set, the "defaultArchitecture" field of the DUB user or system
configuration file will be used. Otherwise null will be returned.
*/
@property string defaultArchitecture() const { return m_defaultArchitecture; }
/** Loads the package that resides within the configured `rootPath`.
*/
void loadPackage()
{
loadPackage(m_rootPath);
}
/// Loads the package from the specified path as the main project package.
void loadPackage(NativePath path)
{
m_projectPath = path;
updatePackageSearchPath();
m_project = new Project(m_packageManager, m_projectPath);
}
/// Loads a specific package as the main project package (can be a sub package)
void loadPackage(Package pack)
{
m_projectPath = pack.path;
updatePackageSearchPath();
m_project = new Project(m_packageManager, pack);
}
/** Loads a single file package.
Single-file packages are D files that contain a package receipe comment
at their top. A recipe comment must be a nested `/+ ... +/` style
comment, containing the virtual recipe file name and a colon, followed by the
recipe contents (what would normally be in dub.sdl/dub.json).
Example:
---
/+ dub.sdl:
name "test"
dependency "vibe-d" version="~>0.7.29"
+/
import vibe.http.server;
void main()
{
auto settings = new HTTPServerSettings;
settings.port = 8080;
listenHTTP(settings, &hello);
}
void hello(HTTPServerRequest req, HTTPServerResponse res)
{
res.writeBody("Hello, World!");
}
---
The script above can be invoked with "dub --single test.d".
*/
void loadSingleFilePackage(NativePath path)
{
import dub.recipe.io : parsePackageRecipe;
import std.file : mkdirRecurse, readText;
import std.path : baseName, stripExtension;
path = makeAbsolute(path);
string file_content = readText(path.toNativeString());
if (file_content.startsWith("#!")) {
auto idx = file_content.indexOf('\n');
enforce(idx > 0, "The source fine doesn't contain anything but a shebang line.");
file_content = file_content[idx+1 .. $];
}
file_content = file_content.strip();
string recipe_content;
if (file_content.startsWith("/+")) {
file_content = file_content[2 .. $];
auto idx = file_content.indexOf("+/");
enforce(idx >= 0, "Missing \"+/\" to close comment.");
recipe_content = file_content[0 .. idx].strip();
} else throw new Exception("The source file must start with a recipe comment.");
auto nidx = recipe_content.indexOf('\n');
auto idx = recipe_content.indexOf(':');
enforce(idx > 0 && (nidx < 0 || nidx > idx),
"The first line of the recipe comment must list the recipe file name followed by a colon (e.g. \"/+ dub.sdl:\").");
auto recipe_filename = recipe_content[0 .. idx];
recipe_content = recipe_content[idx+1 .. $];
auto recipe_default_package_name = path.toString.baseName.stripExtension.strip;
auto recipe = parsePackageRecipe(recipe_content, recipe_filename, null, recipe_default_package_name);
enforce(recipe.buildSettings.sourceFiles.length == 0, "Single-file packages are not allowed to specify source files.");
enforce(recipe.buildSettings.sourcePaths.length == 0, "Single-file packages are not allowed to specify source paths.");
enforce(recipe.buildSettings.importPaths.length == 0, "Single-file packages are not allowed to specify import paths.");
recipe.buildSettings.sourceFiles[""] = [path.toNativeString()];
recipe.buildSettings.sourcePaths[""] = [];
recipe.buildSettings.importPaths[""] = [];
recipe.buildSettings.mainSourceFile = path.toNativeString();
if (recipe.buildSettings.targetType == TargetType.autodetect)
recipe.buildSettings.targetType = TargetType.executable;
auto pack = new Package(recipe, path.parentPath, null, "~master");
loadPackage(pack);
}
/// ditto
void loadSingleFilePackage(string path)
{
loadSingleFilePackage(NativePath(path));
}
/** Disables the default search paths and only searches a specific directory
for packages.
*/
void overrideSearchPath(NativePath path)
{
if (!path.absolute) path = NativePath(getcwd()) ~ path;
m_overrideSearchPath = path;
updatePackageSearchPath();
}
/** Gets the default configuration for a particular build platform.
This forwards to `Project.getDefaultConfiguration` and requires a
project to be loaded.
*/
string getDefaultConfiguration(BuildPlatform platform, bool allow_non_library_configs = true) const { return m_project.getDefaultConfiguration(platform, allow_non_library_configs); }
/** Attempts to upgrade the dependency selection of the loaded project.
Params:
options = Flags that control how the upgrade is carried out
packages_to_upgrade = Optional list of packages. If this list
contains one or more packages, only those packages will
be upgraded. Otherwise, all packages will be upgraded at
once.
*/
void upgrade(UpgradeOptions options, string[] packages_to_upgrade = null)
{
// clear non-existent version selections
if (!(options & UpgradeOptions.upgrade)) {
next_pack:
foreach (p; m_project.selections.selectedPackages) {
auto dep = m_project.selections.getSelectedVersion(p);
if (!dep.path.empty) {
auto path = dep.path;
if (!path.absolute) path = this.rootPath ~ path;
try if (m_packageManager.getOrLoadPackage(path)) continue;
catch (Exception e) { logDebug("Failed to load path based selection: %s", e.toString().sanitize); }
} else {
if (m_packageManager.getPackage(p, dep.version_)) continue;
foreach (ps; m_packageSuppliers) {
try {
auto versions = ps.getVersions(p);
if (versions.canFind!(v => dep.matches(v)))
continue next_pack;
} catch (Exception e) {
logWarn("Error querying versions for %s, %s: %s", p, ps.description, e.msg);
logDebug("Full error: %s", e.toString().sanitize());
}
}
}
logWarn("Selected package %s %s doesn't exist. Using latest matching version instead.", p, dep);
m_project.selections.deselectVersion(p);
}
}
Dependency[string] versions;
auto resolver = new DependencyVersionResolver(this, options);
foreach (p; packages_to_upgrade)
resolver.addPackageToUpgrade(p);
versions = resolver.resolve(m_project.rootPackage, m_project.selections);
if (options & UpgradeOptions.dryRun) {
bool any = false;
string rootbasename = getBasePackageName(m_project.rootPackage.name);
foreach (p, ver; versions) {
if (!ver.path.empty) continue;
auto basename = getBasePackageName(p);
if (basename == rootbasename) continue;
if (!m_project.selections.hasSelectedVersion(basename)) {
logInfo("Package %s would be selected with version %s.",
basename, ver);
any = true;
continue;
}
auto sver = m_project.selections.getSelectedVersion(basename);
if (!sver.path.empty) continue;
if (ver.version_ <= sver.version_) continue;
logInfo("Package %s would be upgraded from %s to %s.",
basename, sver, ver);
any = true;
}
if (any) logInfo("Use \"dub upgrade\" to perform those changes.");
return;
}
foreach (p; versions.byKey) {
auto ver = versions[p]; // Workaround for DMD 2.070.0 AA issue (crashes in aaApply2 if iterating by key+value)
assert(!p.canFind(":"), "Resolved packages contain a sub package!?: "~p);
Package pack;
if (!ver.path.empty) {
try pack = m_packageManager.getOrLoadPackage(ver.path);
catch (Exception e) {
logDebug("Failed to load path based selection: %s", e.toString().sanitize);
continue;
}
} else {
pack = m_packageManager.getBestPackage(p, ver);
if (pack && m_packageManager.isManagedPackage(pack)
&& ver.version_.isBranch && (options & UpgradeOptions.upgrade) != 0)
{
// TODO: only re-install if there is actually a new commit available
logInfo("Re-installing branch based dependency %s %s", p, ver.toString());
m_packageManager.remove(pack);
pack = null;
}
}
FetchOptions fetchOpts;
fetchOpts |= (options & UpgradeOptions.preRelease) != 0 ? FetchOptions.usePrerelease : FetchOptions.none;
if (!pack) fetch(p, ver, defaultPlacementLocation, fetchOpts, "getting selected version");
if ((options & UpgradeOptions.select) && p != m_project.rootPackage.name) {
if (ver.path.empty) m_project.selections.selectVersion(p, ver.version_);
else {
NativePath relpath = ver.path;
if (relpath.absolute) relpath = relpath.relativeTo(m_project.rootPackage.path);
m_project.selections.selectVersion(p, relpath);
}
}
}
string[] missingDependenciesBeforeReinit = m_project.missingDependencies;
m_project.reinit();
if (!m_project.hasAllDependencies) {
auto resolvedDependencies = setDifference(
assumeSorted(missingDependenciesBeforeReinit),
assumeSorted(m_project.missingDependencies)
);
if (!resolvedDependencies.empty)
upgrade(options, m_project.missingDependencies);
}
if ((options & UpgradeOptions.select) && !(options & (UpgradeOptions.noSaveSelections | UpgradeOptions.dryRun)))
m_project.saveSelections();
}
/** Generate project files for a specified generator.
Any existing project files will be overridden.
*/
void generateProject(string ide, GeneratorSettings settings)
{
auto generator = createProjectGenerator(ide, m_project);
if (m_dryRun) return; // TODO: pass m_dryRun to the generator
generator.generate(settings);
}
/** Executes tests on the current project.
Throws an exception, if unittests failed.
*/
void testProject(GeneratorSettings settings, string config, NativePath custom_main_file)
{
if (!custom_main_file.empty && !custom_main_file.absolute) custom_main_file = getWorkingDirectory() ~ custom_main_file;
if (config.length == 0) {
// if a custom main file was given, favor the first library configuration, so that it can be applied
if (!custom_main_file.empty) config = m_project.getDefaultConfiguration(settings.platform, false);
// else look for a "unittest" configuration
if (!config.length && m_project.rootPackage.configurations.canFind("unittest")) config = "unittest";
// if not found, fall back to the first "library" configuration
if (!config.length) config = m_project.getDefaultConfiguration(settings.platform, false);
// if still nothing found, use the first executable configuration
if (!config.length) config = m_project.getDefaultConfiguration(settings.platform, true);
}
auto generator = createProjectGenerator("build", m_project);
auto test_config = format("%s-test-%s", m_project.rootPackage.name.replace(".", "-").replace(":", "-"), config);
BuildSettings lbuildsettings = settings.buildSettings;
m_project.addBuildSettings(lbuildsettings, settings, config, null, true);
if (lbuildsettings.targetType == TargetType.none) {
logInfo(`Configuration '%s' has target type "none". Skipping test.`, config);
return;
}
if (lbuildsettings.targetType == TargetType.executable && config == "unittest") {
logInfo("Running custom 'unittest' configuration.", config);
if (!custom_main_file.empty) logWarn("Ignoring custom main file.");
settings.config = config;
} else if (lbuildsettings.sourceFiles.empty) {
logInfo(`No source files found in configuration '%s'. Falling back to "dub -b unittest".`, config);
if (!custom_main_file.empty) logWarn("Ignoring custom main file.");
settings.config = m_project.getDefaultConfiguration(settings.platform);
} else {
import std.algorithm : remove;
logInfo(`Generating test runner configuration '%s' for '%s' (%s).`, test_config, config, lbuildsettings.targetType);
BuildSettingsTemplate tcinfo = m_project.rootPackage.recipe.getConfiguration(config).buildSettings;
tcinfo.targetType = TargetType.executable;
tcinfo.targetName = test_config;
// HACK for vibe.d's legacy main() behavior:
tcinfo.versions[""] ~= "VibeCustomMain";
m_project.rootPackage.recipe.buildSettings.versions[""] = m_project.rootPackage.recipe.buildSettings.versions.get("", null).remove!(v => v == "VibeDefaultMain");
// TODO: remove this ^ once vibe.d has removed the default main implementation
auto mainfil = tcinfo.mainSourceFile;
if (!mainfil.length) mainfil = m_project.rootPackage.recipe.buildSettings.mainSourceFile;
string custommodname;
if (!custom_main_file.empty) {
import std.path;
tcinfo.sourceFiles[""] ~= custom_main_file.relativeTo(m_project.rootPackage.path).toNativeString();
tcinfo.importPaths[""] ~= custom_main_file.parentPath.toNativeString();
custommodname = custom_main_file.head.toString().baseName(".d");
}
// prepare the list of tested modules
string[] import_modules;
foreach (file; lbuildsettings.sourceFiles) {
if (file.endsWith(".d")) {
auto fname = NativePath(file).head.toString();
if (NativePath(file).relativeTo(m_project.rootPackage.path) == NativePath(mainfil)) {
logWarn("Excluding main source file %s from test.", mainfil);
tcinfo.excludedSourceFiles[""] ~= mainfil;
continue;
}
if (fname == "package.d") {
logWarn("Excluding package.d file from test due to https://issues.dlang.org/show_bug.cgi?id=11847");
continue;
}
import_modules ~= dub.internal.utils.determineModuleName(lbuildsettings, NativePath(file), m_project.rootPackage.path);
}
}
// generate main file
NativePath mainfile = getTempFile("dub_test_root", ".d");
tcinfo.sourceFiles[""] ~= mainfile.toNativeString();
tcinfo.mainSourceFile = mainfile.toNativeString();
if (!m_dryRun) {
auto fil = openFile(mainfile, FileMode.createTrunc);
scope(exit) fil.close();
fil.write("module dub_test_root;\n");
fil.write("import std.typetuple;\n");
foreach (mod; import_modules) fil.write(format("static import %s;\n", mod));
fil.write("alias allModules = TypeTuple!(");
foreach (i, mod; import_modules) {
if (i > 0) fil.write(", ");
fil.write(mod);
}
fil.write(");\n");
if (custommodname.length) {
fil.write(format("import %s;\n", custommodname));
} else {
fil.write(q{
import std.stdio;
import core.runtime;
void main() { writeln("All unit tests have been run successfully."); }
shared static this() {
version (Have_tested) {
import tested;
import core.runtime;
import std.exception;
Runtime.moduleUnitTester = () => true;
//runUnitTests!app(new JsonTestResultWriter("results.json"));
enforce(runUnitTests!allModules(new ConsoleTestResultWriter), "Unit tests failed.");
}
}
});
}
}
m_project.rootPackage.recipe.configurations ~= ConfigurationInfo(test_config, tcinfo);
m_project = new Project(m_packageManager, m_project.rootPackage);
settings.config = test_config;
}
generator.generate(settings);
}
/** Prints the specified build settings necessary for building the root package.
*/
void listProjectData(GeneratorSettings settings, string[] requestedData, ListBuildSettingsFormat list_type)
{
import std.stdio;
import std.ascii : newline;
// Split comma-separated lists
string[] requestedDataSplit =
requestedData
.map!(a => a.splitter(",").map!strip)
.joiner()
.array();
auto data = m_project.listBuildSettings(settings, requestedDataSplit, list_type);
string delimiter;
final switch (list_type) with (ListBuildSettingsFormat) {
case list: delimiter = newline ~ newline; break;
case listNul: delimiter = "\0\0"; break;
case commandLine: delimiter = " "; break;
case commandLineNul: delimiter = "\0\0"; break;
}
write(data.joiner(delimiter));
if (delimiter != "\0\0") writeln();
}
/// Cleans intermediate/cache files of the given package
void cleanPackage(NativePath path)
{
logInfo("Cleaning package at %s...", path.toNativeString());
enforce(!Package.findPackageFile(path).empty, "No package found.", path.toNativeString());
// TODO: clear target files and copy files
if (existsFile(path ~ ".dub/build")) rmdirRecurse((path ~ ".dub/build").toNativeString());
if (existsFile(path ~ ".dub/obj")) rmdirRecurse((path ~ ".dub/obj").toNativeString());
if (existsFile(path ~ ".dub/metadata_cache.json")) std.file.remove((path ~ ".dub/metadata_cache.json").toNativeString());
auto p = Package.load(path);
if (p.getBuildSettings().targetType == TargetType.none) {
foreach (sp; p.subPackages.filter!(sp => !sp.path.empty)) {
cleanPackage(path ~ sp.path);
}
}
}
/// Fetches the package matching the dependency and places it in the specified location.
Package fetch(string packageId, const Dependency dep, PlacementLocation location, FetchOptions options, string reason = "")
{
Json pinfo;
PackageSupplier supplier;
foreach(ps; m_packageSuppliers){
try {
pinfo = ps.fetchPackageRecipe(packageId, dep, (options & FetchOptions.usePrerelease) != 0);
if (pinfo.type == Json.Type.null_)
continue;
supplier = ps;
break;
} catch(Exception e) {
logWarn("Package %s not found for %s: %s", packageId, ps.description, e.msg);
logDebug("Full error: %s", e.toString().sanitize());
}
}
enforce(pinfo.type != Json.Type.undefined, "No package "~packageId~" was found matching the dependency "~dep.toString());
string ver = pinfo["version"].get!string;
NativePath placement;
final switch (location) {
case PlacementLocation.local: placement = m_rootPath; break;
case PlacementLocation.user: placement = m_dirs.localRepository ~ "packages/"; break;
case PlacementLocation.system: placement = m_dirs.systemSettings ~ "packages/"; break;
}
// always upgrade branch based versions - TODO: actually check if there is a new commit available
Package existing;
try existing = m_packageManager.getPackage(packageId, ver, placement);
catch (Exception e) {
logWarn("Failed to load existing package %s: %s", ver, e.msg);
logDiagnostic("Full error: %s", e.toString().sanitize);
}
if (options & FetchOptions.printOnly) {
if (existing && existing.version_ != Version(ver))
logInfo("A new version for %s is available (%s -> %s). Run \"dub upgrade %s\" to switch.",
packageId, existing.version_, ver, packageId);
return null;
}
if (existing) {
if (!ver.startsWith("~") || !(options & FetchOptions.forceBranchUpgrade) || location == PlacementLocation.local) {
// TODO: support git working trees by performing a "git pull" instead of this
logDiagnostic("Package %s %s (%s) is already present with the latest version, skipping upgrade.",
packageId, ver, placement);
return existing;
} else {
logInfo("Removing %s %s to prepare replacement with a new version.", packageId, ver);
if (!m_dryRun) m_packageManager.remove(existing);
}
}
if (reason.length) logInfo("Fetching %s %s (%s)...", packageId, ver, reason);
else logInfo("Fetching %s %s...", packageId, ver);
if (m_dryRun) return null;
logDebug("Acquiring package zip file");
auto clean_package_version = ver[ver.startsWith("~") ? 1 : 0 .. $];
clean_package_version = clean_package_version.replace("+", "_"); // + has special meaning for Optlink
if (!placement.existsFile())
mkdirRecurse(placement.toNativeString());
NativePath dstpath = placement ~ (packageId ~ "-" ~ clean_package_version);
if (!dstpath.existsFile())
mkdirRecurse(dstpath.toNativeString());
// Support libraries typically used with git submodules like ae.
// Such libraries need to have ".." as import path but this can create
// import path leakage.
dstpath = dstpath ~ packageId;
import std.datetime : seconds;
auto lock = lockFile(dstpath.toNativeString() ~ ".lock", 30.seconds); // possibly wait for other dub instance
if (dstpath.existsFile())
{
m_packageManager.refresh(false);
return m_packageManager.getPackage(packageId, ver, dstpath);
}
// repeat download on corrupted zips, see #1336
foreach_reverse (i; 0..3)
{
import std.zip : ZipException;
auto path = getTempFile(packageId, ".zip");
supplier.fetchPackage(path, packageId, dep, (options & FetchOptions.usePrerelease) != 0); // Q: continue on fail?
scope(exit) std.file.remove(path.toNativeString());
logDiagnostic("Placing to %s...", placement.toNativeString());
try {
return m_packageManager.storeFetchedPackage(path, pinfo, dstpath);
} catch (ZipException e) {
logInfo("Failed to extract zip archive for %s %s...", packageId, ver);
// rethrow the exception at the end of the loop
if (i == 0)
throw e;
}
}
assert(0, "Should throw a ZipException instead.");
}
/** Removes a specific locally cached package.
This will delete the package files from disk and removes the
corresponding entry from the list of known packages.
Params:
pack = Package instance to remove
*/
void remove(in Package pack)
{
logInfo("Removing %s in %s", pack.name, pack.path.toNativeString());
if (!m_dryRun) m_packageManager.remove(pack);
}
/// Compatibility overload. Use the version without a `force_remove` argument instead.
void remove(in Package pack, bool force_remove)
{
remove(pack);
}
/// @see remove(string, string, RemoveLocation)
enum RemoveVersionWildcard = "*";
/** Removes one or more versions of a locally cached package.
This will remove a given package with a specified version from the
given location. It will remove at most one package, unless `version_`
is set to `RemoveVersionWildcard`.
Params:
package_id = Name of the package to be removed
location_ = Specifies the location to look for the given package
name/version.
resolve_version = Callback to select package version.
*/
void remove(string package_id, PlacementLocation location,
scope size_t delegate(in Package[] packages) resolve_version)
{
enforce(!package_id.empty);
if (location == PlacementLocation.local) {
logInfo("To remove a locally placed package, make sure you don't have any data"
~ "\nleft in it's directory and then simply remove the whole directory.");
throw new Exception("dub cannot remove locally installed packages.");
}
Package[] packages;
// Retrieve packages to be removed.
foreach(pack; m_packageManager.getPackageIterator(package_id))
if (m_packageManager.isManagedPackage(pack))
packages ~= pack;
// Check validity of packages to be removed.
if(packages.empty) {
throw new Exception("Cannot find package to remove. ("
~ "id: '" ~ package_id ~ "', location: '" ~ to!string(location) ~ "'"
~ ")");
}
// Sort package list in ascending version order
packages.sort!((a, b) => a.version_ < b.version_);
immutable idx = resolve_version(packages);
if (idx == size_t.max)
return;
else if (idx != packages.length)
packages = packages[idx .. idx + 1];
logDebug("Removing %s packages.", packages.length);
foreach(pack; packages) {
try {
remove(pack);
logInfo("Removed %s, version %s.", package_id, pack.version_);
} catch (Exception e) {
logError("Failed to remove %s %s: %s", package_id, pack.version_, e.msg);
logInfo("Continuing with other packages (if any).");
}
}
}
/// Compatibility overload. Use the version without a `force_remove` argument instead.
void remove(string package_id, PlacementLocation location, bool force_remove,
scope size_t delegate(in Package[] packages) resolve_version)
{
remove(package_id, location, resolve_version);
}
/** Removes a specific version of a package.
Params:
package_id = Name of the package to be removed
version_ = Identifying a version or a wild card. If an empty string
is passed, the package will be removed from the location, if
there is only one version retrieved. This will throw an
exception, if there are multiple versions retrieved.
location_ = Specifies the location to look for the given package
name/version.
*/
void remove(string package_id, string version_, PlacementLocation location)
{
remove(package_id, location, (in packages) {
if (version_ == RemoveVersionWildcard)
return packages.length;
if (version_.empty && packages.length > 1) {
logError("Cannot remove package '" ~ package_id ~ "', there are multiple possibilities at location\n"
~ "'" ~ to!string(location) ~ "'.");
logError("Available versions:");
foreach(pack; packages)
logError(" %s", pack.version_);
throw new Exception("Please specify a individual version using --version=... or use the"
~ " wildcard --version=" ~ RemoveVersionWildcard ~ " to remove all versions.");
}
foreach (i, p; packages) {
if (p.version_ == Version(version_))
return i;
}
throw new Exception("Cannot find package to remove. ("
~ "id: '" ~ package_id ~ "', version: '" ~ version_ ~ "', location: '" ~ to!string(location) ~ "'"
~ ")");
});
}
/// Compatibility overload. Use the version without a `force_remove` argument instead.
void remove(string package_id, string version_, PlacementLocation location, bool force_remove)
{
remove(package_id, version_, location);
}
/** Adds a directory to the list of locally known packages.
Forwards to `PackageManager.addLocalPackage`.
Params:
path = Path to the package
ver = Optional version to associate with the package (can be left
empty)
system = Make the package known system wide instead of user wide
(requires administrator privileges).
See_Also: `removeLocalPackage`
*/
void addLocalPackage(string path, string ver, bool system)
{
if (m_dryRun) return;
m_packageManager.addLocalPackage(makeAbsolute(path), ver, system ? LocalPackageType.system : LocalPackageType.user);
}
/** Removes a directory from the list of locally known packages.
Forwards to `PackageManager.removeLocalPackage`.
Params:
path = Path to the package
system = Make the package known system wide instead of user wide
(requires administrator privileges).
See_Also: `addLocalPackage`
*/
void removeLocalPackage(string path, bool system)
{
if (m_dryRun) return;
m_packageManager.removeLocalPackage(makeAbsolute(path), system ? LocalPackageType.system : LocalPackageType.user);
}
/** Registers a local directory to search for packages to use for satisfying
dependencies.
Params:
path = Path to a directory containing package directories
system = Make the package known system wide instead of user wide
(requires administrator privileges).
See_Also: `removeSearchPath`
*/
void addSearchPath(string path, bool system)
{
if (m_dryRun) return;
m_packageManager.addSearchPath(makeAbsolute(path), system ? LocalPackageType.system : LocalPackageType.user);
}
/** Unregisters a local directory search path.
Params:
path = Path to a directory containing package directories
system = Make the package known system wide instead of user wide
(requires administrator privileges).
See_Also: `addSearchPath`
*/
void removeSearchPath(string path, bool system)
{
if (m_dryRun) return;
m_packageManager.removeSearchPath(makeAbsolute(path), system ? LocalPackageType.system : LocalPackageType.user);
}
/** Queries all package suppliers with the given query string.
Returns a list of tuples, where the first entry is the human readable
name of the package supplier and the second entry is the list of
matched packages.
See_Also: `PackageSupplier.searchPackages`
*/
auto searchPackages(string query)
{
import std.typecons : Tuple, tuple;
Tuple!(string, PackageSupplier.SearchResult[])[] results;
foreach (ps; this.m_packageSuppliers) {
try
results ~= tuple(ps.description, ps.searchPackages(query));
catch (Exception e) {
logWarn("Searching %s for '%s' failed: %s", ps.description, query, e.msg);
}
}
return results.filter!(tup => tup[1].length);
}
/** Returns a list of all available versions (including branches) for a
particular package.
The list returned is based on the registered package suppliers. Local
packages are not queried in the search for versions.
See_also: `getLatestVersion`
*/
Version[] listPackageVersions(string name)
{
Version[] versions;
foreach (ps; this.m_packageSuppliers) {
try versions ~= ps.getVersions(name);
catch (Exception e) {
logWarn("Failed to get versions for package %s on provider %s: %s", name, ps.description, e.msg);
}
}
return versions.sort().uniq.array;
}
/** Returns the latest available version for a particular package.
This function returns the latest numbered version of a package. If no
numbered versions are available, it will return an available branch,
preferring "~master".
Params:
package_name: The name of the package in question.
prefer_stable: If set to `true` (the default), returns the latest
stable version, even if there are newer pre-release versions.
See_also: `listPackageVersions`
*/
Version getLatestVersion(string package_name, bool prefer_stable = true)
{
auto vers = listPackageVersions(package_name);
enforce(!vers.empty, "Failed to find any valid versions for a package name of '"~package_name~"'.");
auto final_versions = vers.filter!(v => !v.isBranch && !v.isPreRelease).array;
if (prefer_stable && final_versions.length) return final_versions[$-1];
else if (vers[$-1].isBranch) return vers[$-1];
else return vers[$-1];
}
/** Initializes a directory with a package skeleton.
Params:
path = Path of the directory to create the new package in. The
directory will be created if it doesn't exist.
deps = List of dependencies to add to the package recipe.
type = Specifies the type of the application skeleton to use.
format = Determines the package recipe format to use.
recipe_callback = Optional callback that can be used to
customize the recipe before it gets written.
*/
void createEmptyPackage(NativePath path, string[] deps, string type,
PackageFormat format = PackageFormat.sdl,
scope void delegate(ref PackageRecipe, ref PackageFormat) recipe_callback = null)
{
if (!path.absolute) path = m_rootPath ~ path;
path.normalize();
string[string] depVers;
string[] notFound; // keep track of any failed packages in here
foreach (dep; deps) {
Version ver;
try {
ver = getLatestVersion(dep);
depVers[dep] = ver.isBranch ? ver.toString() : "~>" ~ ver.toString();
} catch (Exception e) {
notFound ~= dep;
}
}
if(notFound.length > 1){
throw new Exception(.format("Couldn't find packages: %-(%s, %).", notFound));
}
else if(notFound.length == 1){
throw new Exception(.format("Couldn't find package: %-(%s, %).", notFound));
}
if (m_dryRun) return;
initPackage(path, depVers, type, format, recipe_callback);
//Act smug to the user.
logInfo("Successfully created an empty project in '%s'.", path.toNativeString());
}
/** Converts the package recipe of the loaded root package to the given format.
Params:
destination_file_ext = The file extension matching the desired
format. Possible values are "json" or "sdl".
print_only = Print the converted recipe instead of writing to disk
*/
void convertRecipe(string destination_file_ext, bool print_only = false)
{
import std.path : extension;
import std.stdio : stdout;
import dub.recipe.io : serializePackageRecipe, writePackageRecipe;
if (print_only) {
auto dst = stdout.lockingTextWriter;
serializePackageRecipe(dst, m_project.rootPackage.rawRecipe, "dub."~destination_file_ext);
return;
}
auto srcfile = m_project.rootPackage.recipePath;
auto srcext = srcfile.head.toString().extension;
if (srcext == "."~destination_file_ext) {
logInfo("Package format is already %s.", destination_file_ext);
return;
}
writePackageRecipe(srcfile.parentPath ~ ("dub."~destination_file_ext), m_project.rootPackage.rawRecipe);
removeFile(srcfile);
}
/** Runs DDOX to generate or serve documentation.
Params:
run = If set to true, serves documentation on a local web server.
Otherwise generates actual HTML files.
generate_args = Additional command line arguments to pass to
"ddox generate-html" or "ddox serve-html".
*/
void runDdox(bool run, string[] generate_args = null)
{
import std.process : browse;
if (m_dryRun) return;
// allow to choose a custom ddox tool
auto tool = m_project.rootPackage.recipe.ddoxTool;
if (tool.empty) tool = "ddox";
auto tool_pack = m_packageManager.getBestPackage(tool, ">=0.0.0");
if (!tool_pack) tool_pack = m_packageManager.getBestPackage(tool, "~master");
if (!tool_pack) {
logInfo("%s is not present, getting and storing it user wide", tool);
tool_pack = fetch(tool, Dependency(">=0.0.0"), defaultPlacementLocation, FetchOptions.none);
}
auto ddox_dub = new Dub(null, m_packageSuppliers);
ddox_dub.loadPackage(tool_pack.path);
ddox_dub.upgrade(UpgradeOptions.select);
auto compiler_binary = this.defaultCompiler;
GeneratorSettings settings;
settings.config = "application";
settings.compiler = getCompiler(compiler_binary); // TODO: not using --compiler ???
settings.platform = settings.compiler.determinePlatform(settings.buildSettings, compiler_binary, m_defaultArchitecture);
settings.buildType = "debug";
settings.run = true;
auto filterargs = m_project.rootPackage.recipe.ddoxFilterArgs.dup;
if (filterargs.empty) filterargs = ["--min-protection=Protected", "--only-documented"];
settings.runArgs = "filter" ~ filterargs ~ "docs.json";
ddox_dub.generateProject("build", settings);
auto p = tool_pack.path;
p.endsWithSlash = true;
auto tool_path = p.toNativeString();
if (run) {
settings.runArgs = ["serve-html", "--navigation-type=ModuleTree", "docs.json", "--web-file-dir="~tool_path~"public"] ~ generate_args;
browse("http://127.0.0.1:8080/");
} else {
settings.runArgs = ["generate-html", "--navigation-type=ModuleTree", "docs.json", "docs"] ~ generate_args;
}
ddox_dub.generateProject("build", settings);
if (!run) {
// TODO: ddox should copy those files itself
version(Windows) runCommand(`xcopy /S /D "`~tool_path~`public\*" docs\`);
else runCommand("rsync -ru '"~tool_path~"public/' docs/");
}
}
private void updatePackageSearchPath()
{
if (!m_overrideSearchPath.empty) {
m_packageManager.disableDefaultSearchPaths = true;
m_packageManager.searchPath = [m_overrideSearchPath];
} else {
auto p = environment.get("DUBPATH");
NativePath[] paths;
version(Windows) enum pathsep = ";";
else enum pathsep = ":";
if (p.length) paths ~= p.split(pathsep).map!(p => NativePath(p))().array();
m_packageManager.disableDefaultSearchPaths = false;
m_packageManager.searchPath = paths;
}
}
private void determineDefaultCompiler()
{
import std.file : thisExePath;
import std.path : buildPath, dirName, expandTilde, isAbsolute, isDirSeparator;
import std.process : environment;
import std.range : front;
m_defaultCompiler = m_config.defaultCompiler.expandTilde;
if (m_defaultCompiler.length && m_defaultCompiler.isAbsolute)
return;
static immutable BinaryPrefix = `$DUB_BINARY_PATH`;
if(m_defaultCompiler.startsWith(BinaryPrefix))
{
m_defaultCompiler = thisExePath().dirName() ~ m_defaultCompiler[BinaryPrefix.length .. $];
return;
}
if (!find!isDirSeparator(m_defaultCompiler).empty)
throw new Exception("defaultCompiler specified in a DUB config file cannot use an unqualified relative path:\n\n" ~ m_defaultCompiler ~
"\n\nUse \"$DUB_BINARY_PATH/../path/you/want\" instead.");
version (Windows) enum sep = ";", exe = ".exe";
version (Posix) enum sep = ":", exe = "";
auto compilers = ["dmd", "gdc", "gdmd", "ldc2", "ldmd2"];
// If a compiler name is specified, look for it next to dub.
// Otherwise, look for any of the common compilers adjacent to dub.
if (m_defaultCompiler.length)
{
string compilerPath = buildPath(thisExePath().dirName(), m_defaultCompiler ~ exe);
if (existsFile(compilerPath))
{
m_defaultCompiler = compilerPath;
return;
}
}
else
{
auto nextFound = compilers.find!(bin => existsFile(buildPath(thisExePath().dirName(), bin ~ exe)));
if (!nextFound.empty)
{
m_defaultCompiler = buildPath(thisExePath().dirName(), nextFound.front ~ exe);
return;
}
}
// If nothing found next to dub, search the user's PATH, starting
// with the compiler name from their DUB config file, if specified.
if (m_defaultCompiler.length)
compilers = m_defaultCompiler ~ compilers;
auto paths = environment.get("PATH", "").splitter(sep).map!NativePath;
auto res = compilers.find!(bin => paths.canFind!(p => existsFile(p ~ (bin~exe))));
m_defaultCompiler = res.empty ? compilers[0] : res.front;
}
private NativePath makeAbsolute(NativePath p) const { return p.absolute ? p : m_rootPath ~ p; }
private NativePath makeAbsolute(string p) const { return makeAbsolute(NativePath(p)); }
}
/// Option flags for `Dub.fetch`
enum FetchOptions
{
none = 0,
forceBranchUpgrade = 1<<0,
usePrerelease = 1<<1,
forceRemove = 1<<2, /// Deprecated, does nothing.
printOnly = 1<<3,
}
/// Option flags for `Dub.upgrade`
enum UpgradeOptions
{
none = 0,
upgrade = 1<<1, /// Upgrade existing packages
preRelease = 1<<2, /// inclde pre-release versions in upgrade
forceRemove = 1<<3, /// Deprecated, does nothing.
select = 1<<4, /// Update the dub.selections.json file with the upgraded versions
dryRun = 1<<5, /// Instead of downloading new packages, just print a message to notify the user of their existence
/*deprecated*/ printUpgradesOnly = dryRun, /// deprecated, use dryRun instead
/*deprecated*/ useCachedResult = 1<<6, /// deprecated, has no effect
noSaveSelections = 1<<7, /// Don't store updated selections on disk
}
/// Determines which of the default package suppliers are queried for packages.
enum SkipPackageSuppliers {
none, /// Uses all configured package suppliers.
standard, /// Does not use the default package suppliers (`defaultPackageSuppliers`).
configured, /// Does not use default suppliers or suppliers configured in DUB's configuration file
all /// Uses only manually specified package suppliers.
}
private class DependencyVersionResolver : DependencyResolver!(Dependency, Dependency) {
protected {
Dub m_dub;
UpgradeOptions m_options;
Dependency[][string] m_packageVersions;
Package[string] m_remotePackages;
SelectedVersions m_selectedVersions;
Package m_rootPackage;
bool[string] m_packagesToUpgrade;
Package[PackageDependency] m_packages;
TreeNodes[][TreeNode] m_children;
}
this(Dub dub, UpgradeOptions options)
{
m_dub = dub;
m_options = options;
}
void addPackageToUpgrade(string name)
{
m_packagesToUpgrade[name] = true;
}
Dependency[string] resolve(Package root, SelectedVersions selected_versions)
{
m_rootPackage = root;
m_selectedVersions = selected_versions;
return super.resolve(TreeNode(root.name, Dependency(root.version_)), (m_options & UpgradeOptions.printUpgradesOnly) == 0);
}
protected bool isFixedPackage(string pack)
{
return m_packagesToUpgrade !is null && pack !in m_packagesToUpgrade;
}
protected override Dependency[] getAllConfigs(string pack)
{
if (auto pvers = pack in m_packageVersions)
return *pvers;
if ((!(m_options & UpgradeOptions.upgrade) || isFixedPackage(pack)) && m_selectedVersions.hasSelectedVersion(pack)) {
auto ret = [m_selectedVersions.getSelectedVersion(pack)];
logDiagnostic("Using fixed selection %s %s", pack, ret[0]);
m_packageVersions[pack] = ret;
return ret;
}
logDiagnostic("Search for versions of %s (%s package suppliers)", pack, m_dub.m_packageSuppliers.length);
Version[] versions;
foreach (p; m_dub.packageManager.getPackageIterator(pack))
versions ~= p.version_;
foreach (ps; m_dub.m_packageSuppliers) {
try {
auto vers = ps.getVersions(pack);
vers.reverse();
if (!vers.length) {
logDiagnostic("No versions for %s for %s", pack, ps.description);
continue;
}
versions ~= vers;
break;
} catch (Exception e) {
logWarn("Package %s not found in %s: %s", pack, ps.description, e.msg);
logDebug("Full error: %s", e.toString().sanitize);
}
}
// sort by version, descending, and remove duplicates
versions = versions.sort!"a>b".uniq.array;
// move pre-release versions to the back of the list if no preRelease flag is given
if (!(m_options & UpgradeOptions.preRelease))
versions = versions.filter!(v => !v.isPreRelease).array ~ versions.filter!(v => v.isPreRelease).array;
// filter out invalid/unreachable dependency specs
versions = versions.filter!((v) {
bool valid = getPackage(pack, Dependency(v)) !is null;
if (!valid) logDiagnostic("Excluding invalid dependency specification %s %s from dependency resolution process.", pack, v);
return valid;
}).array;
if (!versions.length) logDiagnostic("Nothing found for %s", pack);
else logDiagnostic("Return for %s: %s", pack, versions);
auto ret = versions.map!(v => Dependency(v)).array;
m_packageVersions[pack] = ret;
return ret;
}
protected override Dependency[] getSpecificConfigs(string pack, TreeNodes nodes)
{
if (!nodes.configs.path.empty && getPackage(pack, nodes.configs)) return [nodes.configs];
else return null;
}
protected override TreeNodes[] getChildren(TreeNode node)
{
if (auto pc = node in m_children)
return *pc;
auto ret = getChildrenRaw(node);
m_children[node] = ret;
return ret;
}
private final TreeNodes[] getChildrenRaw(TreeNode node)
{
import std.array : appender;
auto ret = appender!(TreeNodes[]);
auto pack = getPackage(node.pack, node.config);
if (!pack) {
// this can hapen when the package description contains syntax errors
logDebug("Invalid package in dependency tree: %s %s", node.pack, node.config);
return null;
}
auto basepack = pack.basePackage;
foreach (d; pack.getAllDependenciesRange()) {
auto dbasename = getBasePackageName(d.name);
// detect dependencies to the root package (or sub packages thereof)
if (dbasename == basepack.name) {
auto absdeppath = d.spec.mapToPath(pack.path).path;
absdeppath.endsWithSlash = true;
auto subpack = m_dub.m_packageManager.getSubPackage(basepack, getSubPackageName(d.name), true);
if (subpack) {
auto desireddeppath = d.name == dbasename ? basepack.path : subpack.path;
desireddeppath.endsWithSlash = true;
enforce(d.spec.path.empty || absdeppath == desireddeppath,
format("Dependency from %s to root package references wrong path: %s vs. %s",
node.pack, absdeppath.toNativeString(), desireddeppath.toNativeString()));
}
ret ~= TreeNodes(d.name, node.config);
continue;
}
DependencyType dt;
if (d.spec.optional) {
if (d.spec.default_) dt = DependencyType.optionalDefault;
else dt = DependencyType.optional;
} else dt = DependencyType.required;
Dependency dspec = d.spec.mapToPath(pack.path);
// if not upgrading, use the selected version
if (!(m_options & UpgradeOptions.upgrade) && m_selectedVersions && m_selectedVersions.hasSelectedVersion(dbasename))
dspec = m_selectedVersions.getSelectedVersion(dbasename);
// keep selected optional dependencies and avoid non-selected optional-default dependencies by default
if (m_selectedVersions && !m_selectedVersions.bare) {
if (dt == DependencyType.optionalDefault && !m_selectedVersions.hasSelectedVersion(dbasename))
dt = DependencyType.optional;
else if (dt == DependencyType.optional && m_selectedVersions.hasSelectedVersion(dbasename))
dt = DependencyType.optionalDefault;
}
ret ~= TreeNodes(d.name, dspec, dt);
}
return ret.data;
}
protected override bool matches(Dependency configs, Dependency config)
{
if (!configs.path.empty) return configs.path == config.path;
return configs.merge(config).valid;
}
private Package getPackage(string name, Dependency dep)
{
auto key = PackageDependency(name, dep);
if (auto pp = key in m_packages)
return *pp;
auto p = getPackageRaw(name, dep);
m_packages[key] = p;
return p;
}
private Package getPackageRaw(string name, Dependency dep)
{
auto basename = getBasePackageName(name);
// for sub packages, first try to get them from the base package
if (basename != name) {
auto subname = getSubPackageName(name);
auto basepack = getPackage(basename, dep);
if (!basepack) return null;
if (auto sp = m_dub.m_packageManager.getSubPackage(basepack, subname, true)) {
return sp;
} else if (!basepack.subPackages.canFind!(p => p.path.length)) {
// note: external sub packages are handled further below
auto spr = basepack.getInternalSubPackage(subname);
if (!spr.isNull) {
auto sp = new Package(spr, basepack.path, basepack);
m_remotePackages[sp.name] = sp;
return sp;
} else {
logDiagnostic("Sub package %s doesn't exist in %s %s.", name, basename, dep.version_);
return null;
}
} else if (auto ret = m_dub.m_packageManager.getBestPackage(name, dep)) {
return ret;
} else {
logDiagnostic("External sub package %s %s not found.", name, dep.version_);
return null;
}
}
// shortcut if the referenced package is the root package
if (basename == m_rootPackage.basePackage.name)
return m_rootPackage.basePackage;
if (!dep.path.empty) {
try {
auto ret = m_dub.packageManager.getOrLoadPackage(dep.path);
if (dep.matches(ret.version_)) return ret;
} catch (Exception e) {
logDiagnostic("Failed to load path based dependency %s: %s", name, e.msg);
logDebug("Full error: %s", e.toString().sanitize);
return null;
}
}
if (auto ret = m_dub.m_packageManager.getBestPackage(name, dep))
return ret;
auto key = name ~ ":" ~ dep.version_.toString();
if (auto ret = key in m_remotePackages)
return *ret;
auto prerelease = (m_options & UpgradeOptions.preRelease) != 0;
auto rootpack = name.split(":")[0];
foreach (ps; m_dub.m_packageSuppliers) {
if (rootpack == name) {
try {
auto desc = ps.fetchPackageRecipe(name, dep, prerelease);
if (desc.type == Json.Type.null_)
continue;
auto ret = new Package(desc);
m_remotePackages[key] = ret;
return ret;
} catch (Exception e) {
logDiagnostic("Metadata for %s %s could not be downloaded from %s: %s", name, dep, ps.description, e.msg);
logDebug("Full error: %s", e.toString().sanitize);
}
} else {
logDiagnostic("Package %s not found in base package description (%s). Downloading whole package.", name, dep.version_.toString());
try {
FetchOptions fetchOpts;
fetchOpts |= prerelease ? FetchOptions.usePrerelease : FetchOptions.none;
m_dub.fetch(rootpack, dep, m_dub.defaultPlacementLocation, fetchOpts, "need sub package description");
auto ret = m_dub.m_packageManager.getBestPackage(name, dep);
if (!ret) {
logWarn("Package %s %s doesn't have a sub package %s", rootpack, dep.version_, name);
return null;
}
m_remotePackages[key] = ret;
return ret;
} catch (Exception e) {
logDiagnostic("Package %s could not be downloaded from %s: %s", rootpack, ps.description, e.msg);
logDebug("Full error: %s", e.toString().sanitize);
}
}
}
m_remotePackages[key] = null;
logWarn("Package %s %s could not be loaded either locally, or from the configured package registries.", name, dep);
return null;
}
}
private struct SpecialDirs {
NativePath temp;
NativePath userSettings;
NativePath systemSettings;
NativePath localRepository;
}
private class DubConfig {
private {
DubConfig m_parentConfig;
Json m_data;
}
this(Json data, DubConfig parent_config)
{
m_data = data;
m_parentConfig = parent_config;
}
@property string[] registryURLs()
{
string[] ret;
if (auto pv = "registryUrls" in m_data)
ret = (*pv).deserializeJson!(string[]);
if (m_parentConfig) ret ~= m_parentConfig.registryURLs;
return ret;
}
@property SkipPackageSuppliers skipRegistry()
{
if(auto pv = "skipRegistry" in m_data)
return to!SkipPackageSuppliers((*pv).get!string);
if (m_parentConfig)
return m_parentConfig.skipRegistry;
return SkipPackageSuppliers.none;
}
@property NativePath[] customCachePaths()
{
import std.algorithm.iteration : map;
import std.array : array;
NativePath[] ret;
if (auto pv = "customCachePaths" in m_data)
ret = (*pv).deserializeJson!(string[])
.map!(s => NativePath(s))
.array;
if (m_parentConfig)
ret ~= m_parentConfig.customCachePaths;
return ret;
}
@property string defaultCompiler()
const {
if (auto pv = "defaultCompiler" in m_data)
return pv.get!string;
if (m_parentConfig) return m_parentConfig.defaultCompiler;
return null;
}
@property string defaultArchitecture()
const {
if(auto pv = "defaultArchitecture" in m_data)
return (*pv).get!string;
if (m_parentConfig) return m_parentConfig.defaultArchitecture;
return null;
}
}
|
D
|
# FIXED
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Config_ADC.c
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Inc_Drivers.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/COM_cpu01/Include/DEF_Global.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Init_HW.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_GPIO.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_PWM.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Inc_drivers.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_ADC.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/MEM.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_CAN.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/driverlib/can.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/FIFO.h
Comun/Drivers/Config_ADC.obj: C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Config_ADC.c:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Inc_Drivers.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/COM_cpu01/Include/DEF_Global.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Init_HW.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_GPIO.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_PWM.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Inc_drivers.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_ADC.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/MEM.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/Config_CAN.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/driverlib/can.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/Comun/Drivers/Include/FIFO.h:
C:/Users/jeniher/PROYECTOS/Workspace_CCS7/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/string.h:
|
D
|
/Users/doriankinoocrutcher/Documents/blockheads/blockbop/blockbop/contract/target/release/build/num-integer-493b2de1bd428ab3/build_script_build-493b2de1bd428ab3: /Users/doriankinoocrutcher/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.43/build.rs
/Users/doriankinoocrutcher/Documents/blockheads/blockbop/blockbop/contract/target/release/build/num-integer-493b2de1bd428ab3/build_script_build-493b2de1bd428ab3.d: /Users/doriankinoocrutcher/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.43/build.rs
/Users/doriankinoocrutcher/.cargo/registry/src/github.com-1ecc6299db9ec823/num-integer-0.1.43/build.rs:
|
D
|
/**
Contains routines for high level path handling.
Copyright: © 2012-2019 Sönke Ludwig
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig
*/
module vibe.core.path;
import std.algorithm.searching : commonPrefix, endsWith, startsWith;
import std.algorithm.comparison : equal, min;
import std.algorithm.iteration : map;
import std.exception : enforce;
import std.range : empty, front, popFront, popFrontExactly, takeExactly;
import std.range.primitives : ElementType, isInputRange, isOutputRange;
import std.traits : isInstanceOf;
/** Computes the relative path from `base_path` to this path.
Params:
path = The destination path
base_path = The path from which the relative path starts
See_also: `relativeToWeb`
*/
Path relativeTo(Path)(Path path, Path base_path) @safe
if (isInstanceOf!(GenericPath, Path))
{
import std.array : array, replicate;
import std.range : chain, drop, take;
assert(base_path.absolute, "Base path must be absolute for relativeTo.");
assert(path.absolute, "Path must be absolute for relativeTo.");
if (is(Path == WindowsPath)) { // FIXME: this shouldn't be a special case here!
bool samePrefix(size_t n)
{
return path.bySegment2.map!(n => n.encodedName).take(n).equal(base_path.bySegment2.map!(n => n.encodedName).take(n));
}
// a path such as ..\C:\windows is not valid, so force the path to stay absolute in this case
auto pref = path.bySegment2;
if (!pref.empty && pref.front.encodedName == "") {
pref.popFront();
if (!pref.empty) {
// different drive?
if (pref.front.encodedName.endsWith(':') && !samePrefix(2))
return path;
// different UNC path?
if (pref.front.encodedName == "" && !samePrefix(4))
return path;
}
}
}
auto nodes = path.bySegment2;
auto base_nodes = base_path.bySegment2;
// skip and count common prefix
size_t base = 0;
while (!nodes.empty && !base_nodes.empty && equal(nodes.front.name, base_nodes.front.name)) {
nodes.popFront();
base_nodes.popFront();
base++;
}
enum up = Path.Segment2("..", Path.defaultSeparator);
auto ret = Path(base_nodes.map!(p => up).chain(nodes));
if (path.endsWithSlash) {
if (ret.empty) return Path("." ~ path.toString()[$-1]);
else ret.endsWithSlash = true;
}
return ret;
}
///
unittest {
import std.array : array;
import std.conv : to;
assert(PosixPath("/some/path").relativeTo(PosixPath("/")) == PosixPath("some/path"));
assert(PosixPath("/some/path/").relativeTo(PosixPath("/some/other/path/")) == PosixPath("../../path/"));
assert(PosixPath("/some/path/").relativeTo(PosixPath("/some/other/path")) == PosixPath("../../path/"));
assert(WindowsPath("C:\\some\\path").relativeTo(WindowsPath("C:\\")) == WindowsPath("some\\path"));
assert(WindowsPath("C:\\some\\path\\").relativeTo(WindowsPath("C:\\some\\other\\path/")) == WindowsPath("..\\..\\path\\"));
assert(WindowsPath("C:\\some\\path\\").relativeTo(WindowsPath("C:\\some\\other\\path")) == WindowsPath("..\\..\\path\\"));
assert(WindowsPath("\\\\server\\share\\some\\path").relativeTo(WindowsPath("\\\\server\\share\\")) == WindowsPath("some\\path"));
assert(WindowsPath("\\\\server\\share\\some\\path\\").relativeTo(WindowsPath("\\\\server\\share\\some\\other\\path/")) == WindowsPath("..\\..\\path\\"));
assert(WindowsPath("\\\\server\\share\\some\\path\\").relativeTo(WindowsPath("\\\\server\\share\\some\\other\\path")) == WindowsPath("..\\..\\path\\"));
assert(WindowsPath("C:\\some\\path").relativeTo(WindowsPath("D:\\")) == WindowsPath("C:\\some\\path"));
assert(WindowsPath("C:\\some\\path\\").relativeTo(WindowsPath("\\\\server\\share")) == WindowsPath("C:\\some\\path\\"));
assert(WindowsPath("\\\\server\\some\\path\\").relativeTo(WindowsPath("C:\\some\\other\\path")) == WindowsPath("\\\\server\\some\\path\\"));
assert(WindowsPath("\\\\server\\some\\path\\").relativeTo(WindowsPath("\\\\otherserver\\path")) == WindowsPath("\\\\server\\some\\path\\"));
assert(WindowsPath("\\some\\path\\").relativeTo(WindowsPath("\\other\\path")) == WindowsPath("..\\..\\some\\path\\"));
assert(WindowsPath("\\\\server\\share\\path1").relativeTo(WindowsPath("\\\\server\\share\\path2")) == WindowsPath("..\\path1"));
assert(WindowsPath("\\\\server\\share\\path1").relativeTo(WindowsPath("\\\\server\\share2\\path2")) == WindowsPath("\\\\server\\share\\path1"));
assert(WindowsPath("\\\\server\\share\\path1").relativeTo(WindowsPath("\\\\server2\\share2\\path2")) == WindowsPath("\\\\server\\share\\path1"));
}
unittest {
{
auto parentpath = "/path/to/parent";
auto parentpathp = PosixPath(parentpath);
auto subpath = "/path/to/parent/sub/";
auto subpathp = PosixPath(subpath);
auto subpath_rel = "sub/";
assert(subpathp.relativeTo(parentpathp).toString() == subpath_rel);
auto subfile = "/path/to/parent/child";
auto subfilep = PosixPath(subfile);
auto subfile_rel = "child";
assert(subfilep.relativeTo(parentpathp).toString() == subfile_rel);
}
{ // relative paths across Windows devices are not allowed
auto p1 = WindowsPath("\\\\server\\share"); assert(p1.absolute);
auto p2 = WindowsPath("\\\\server\\othershare"); assert(p2.absolute);
auto p3 = WindowsPath("\\\\otherserver\\share"); assert(p3.absolute);
auto p4 = WindowsPath("C:\\somepath"); assert(p4.absolute);
auto p5 = WindowsPath("C:\\someotherpath"); assert(p5.absolute);
auto p6 = WindowsPath("D:\\somepath"); assert(p6.absolute);
auto p7 = WindowsPath("\\\\server\\share\\path"); assert(p7.absolute);
auto p8 = WindowsPath("\\\\server\\share\\otherpath"); assert(p8.absolute);
assert(p4.relativeTo(p5) == WindowsPath("..\\somepath"));
assert(p4.relativeTo(p6) == WindowsPath("C:\\somepath"));
assert(p4.relativeTo(p1) == WindowsPath("C:\\somepath"));
assert(p1.relativeTo(p2) == WindowsPath("\\\\server\\share"));
assert(p1.relativeTo(p3) == WindowsPath("\\\\server\\share"));
assert(p1.relativeTo(p4) == WindowsPath("\\\\server\\share"));
assert(p7.relativeTo(p1) == WindowsPath("path"));
assert(p7.relativeTo(p8) == WindowsPath("..\\path"));
}
{ // relative path, trailing slash
auto p1 = PosixPath("/some/path");
auto p2 = PosixPath("/some/path/");
assert(p1.relativeTo(p1).toString() == "");
assert(p1.relativeTo(p2).toString() == "");
assert(p2.relativeTo(p2).toString() == "./");
}
}
/** Computes the relative path to this path from `base_path` using web path rules.
The difference to `relativeTo` is that a path not ending in a slash
will not be considered as a path to a directory and the parent path
will instead be used.
Params:
path = The destination path
base_path = The path from which the relative path starts
See_also: `relativeTo`
*/
Path relativeToWeb(Path)(Path path, Path base_path) @safe
if (isInstanceOf!(GenericPath, Path))
{
if (!base_path.endsWithSlash) {
assert(base_path.absolute, "Base path must be absolute for relativeToWeb.");
if (base_path.hasParentPath) base_path = base_path.parentPath;
else base_path = Path("/");
assert(base_path.absolute);
}
return path.relativeTo(base_path);
}
///
/+unittest {
assert(InetPath("/some/path").relativeToWeb(InetPath("/")) == InetPath("some/path"));
assert(InetPath("/some/path/").relativeToWeb(InetPath("/some/other/path/")) == InetPath("../../path/"));
assert(InetPath("/some/path/").relativeToWeb(InetPath("/some/other/path")) == InetPath("../path/"));
}+/
/** Converts a path to its system native string representation.
*/
string toNativeString(P)(P path)
{
return (cast(NativePath)path).toString();
}
/// Represents a path on Windows operating systems.
alias WindowsPath = GenericPath!WindowsPathFormat;
/// Represents a path on Unix/Posix systems.
alias PosixPath = GenericPath!PosixPathFormat;
/// Represents a path as part of an URI.
alias InetPath = GenericPath!InetPathFormat;
/// The path type native to the target operating system.
version (Windows) alias NativePath = WindowsPath;
else alias NativePath = PosixPath;
deprecated("Use NativePath or one the specific path types instead.")
alias Path = NativePath;
deprecated("Use NativePath.Segment or one the specific path types instead.")
alias PathEntry = Path.Segment;
/// Provides a common interface to operate on paths of various kinds.
struct GenericPath(F) {
@safe:
alias Format = F;
/** A single path segment.
*/
static struct Segment {
@safe:
private {
string m_name;
char m_separator = 0;
}
/** Constructs a new path segment including an optional trailing
separator.
Params:
name = The raw (unencoded) name of the path segment
separator = Optional trailing path separator (e.g. `'/'`)
Throws:
A `PathValidationException` is thrown if the name contains
characters that are invalid for the path type. In particular,
any path separator characters may not be part of the name.
*/
this(string name, char separator = '\0')
{
import std.algorithm.searching : any;
enforce!PathValidationException(separator == '\0' || Format.isSeparator(separator),
"Invalid path separator.");
auto err = Format.validateDecodedSegment(name);
enforce!PathValidationException(err is null, err);
m_name = name;
m_separator = separator;
}
/** Constructs a path segment without performing validation.
Note that in debug builds, there are still assertions in place
that verify that the provided values are valid.
Params:
name = The raw (unencoded) name of the path segment
separator = Optional trailing path separator (e.g. `'/'`)
*/
static Segment fromTrustedString(string name, char separator = '\0')
nothrow @nogc pure {
import std.algorithm.searching : any;
assert(separator == '\0' || Format.isSeparator(separator));
assert(Format.validateDecodedSegment(name) is null, "Invalid path segment.");
Segment ret;
ret.m_name = name;
ret.m_separator = separator;
return ret;
}
deprecated("Use the constructor instead.")
static Segment validateFilename(string name)
{
return Segment(name);
}
/// The (file/directory) name of the path segment.
@property string name() const nothrow @nogc { return m_name; }
/// The trailing separator (e.g. `'/'`) or `'\0'`.
@property char separator() const nothrow @nogc { return m_separator; }
/// ditto
@property void separator(char ch) {
enforce!PathValidationException(ch == '\0' || Format.isSeparator(ch),
"Character is not a valid path separator.");
m_separator = ch;
}
/// Returns `true` $(I iff) the segment has a trailing path separator.
@property bool hasSeparator() const nothrow @nogc { return m_separator != '\0'; }
deprecated("Use .name instead.")
string toString() const nothrow @nogc { return m_name; }
/** Converts the segment to another path type.
The segment name will be re-validated during the conversion. The
separator, if any, will be adopted or replaced by the default
separator of the target path type.
Throws:
A `PathValidationException` is thrown if the segment name cannot
be represented in the target path format.
*/
GenericPath!F.Segment opCast(T : GenericPath!F.Segment, F)()
{
char dsep = '\0';
if (m_separator) {
if (F.isSeparator(m_separator)) dsep = m_separator;
else dsep = F.defaultSeparator;
}
return GenericPath!F.Segment(m_name, dsep);
}
/// Compares two path segment names
bool opEquals(Segment other) const nothrow @nogc { return this.name == other.name && this.hasSeparator == other.hasSeparator; }
/// ditto
bool opEquals(string name) const nothrow @nogc { return this.name == name; }
}
/** Represents a path as an forward range of `Segment`s.
*/
static struct PathRange {
import std.traits : ReturnType;
private {
string m_path;
Segment m_front;
}
private this(string path)
{
m_path = path;
if (m_path.length) {
auto ap = Format.getAbsolutePrefix(m_path);
if (ap.length && !Format.isSeparator(ap[0]))
m_front = Segment.fromTrustedString(null, '/');
else readFront();
}
}
@property bool empty() const nothrow @nogc { return m_path.length == 0 && m_front == Segment.init; }
@property PathRange save() { return this; }
@property Segment front() { return m_front; }
void popFront()
nothrow {
assert(m_front != Segment.init);
if (m_path.length) readFront();
else m_front = Segment.init;
}
private void readFront()
nothrow {
import std.array : array;
auto n = Format.getFrontNode(m_path);
m_path = m_path[n.length .. $];
char sep = '\0';
if (Format.isSeparator(n[$-1])) {
sep = n[$-1];
n = n[0 .. $-1];
}
static if (is(typeof(Format.decodeSingleSegment(n)) == string))
string ndec = Format.decodeSingleSegment(n);
else
string ndec = Format.decodeSingleSegment(n).array;
m_front = Segment.fromTrustedString(ndec, sep);
assert(m_front != Segment.init);
}
}
/** A single path segment.
*/
static struct Segment2 {
@safe:
private {
string m_encodedName;
char m_separator = 0;
}
/** Constructs a new path segment including an optional trailing
separator.
Params:
name = The raw (unencoded) name of the path segment
separator = Optional trailing path separator (e.g. `'/'`)
Throws:
A `PathValidationException` is thrown if the name contains
characters that are invalid for the path type. In particular,
any path separator characters may not be part of the name.
*/
this(string name, char separator = '\0')
{
import std.algorithm.searching : any;
enforce!PathValidationException(separator == '\0' || Format.isSeparator(separator),
"Invalid path separator.");
auto err = Format.validateDecodedSegment(name);
enforce!PathValidationException(err is null, err);
m_encodedName = Format.encodeSegment(name);
m_separator = separator;
}
/** Constructs a path segment without performing validation.
Note that in debug builds, there are still assertions in place
that verify that the provided values are valid.
Params:
name = The raw (unencoded) name of the path segment
separator = Optional trailing path separator (e.g. `'/'`)
*/
static Segment2 fromTrustedString(string name, char separator = '\0')
nothrow pure {
import std.algorithm.searching : any;
assert(separator == '\0' || Format.isSeparator(separator));
assert(Format.validateDecodedSegment(name) is null, "Invalid path segment.");
return fromTrustedEncodedString(Format.encodeSegment(name), separator);
}
/** Constructs a path segment without performing validation.
Note that in debug builds, there are still assertions in place
that verify that the provided values are valid.
Params:
encoded_name = The encoded name of the path segment
separator = Optional trailing path separator (e.g. `'/'`)
*/
static Segment2 fromTrustedEncodedString(string encoded_name, char separator = '\0')
nothrow @nogc pure {
import std.algorithm.searching : any;
import std.utf : byCodeUnit;
assert(separator == '\0' || Format.isSeparator(separator));
assert(!encoded_name.byCodeUnit.any!(c => Format.isSeparator(c)));
assert(Format.validatePath(encoded_name) is null, "Invalid path segment.");
Segment2 ret;
ret.m_encodedName = encoded_name;
ret.m_separator = separator;
return ret;
}
/** The (file/directory) name of the path segment.
Note: Depending on the path type, this may return a generic range
type instead of `string`. Use `name.to!string` in that
case if you need an actual `string`.
*/
@property auto name() const nothrow @nogc { return Format.decodeSingleSegment(m_encodedName); }
/// The encoded representation of the path segment name
@property string encodedName() const nothrow @nogc { return m_encodedName; }
/// The trailing separator (e.g. `'/'`) or `'\0'`.
@property char separator() const nothrow @nogc { return m_separator; }
/// ditto
@property void separator(char ch) {
enforce!PathValidationException(ch == '\0' || Format.isSeparator(ch),
"Character is not a valid path separator.");
m_separator = ch;
}
/// Returns `true` $(I iff) the segment has a trailing path separator.
@property bool hasSeparator() const nothrow @nogc { return m_separator != '\0'; }
/** Converts the segment to another path type.
The segment name will be re-validated during the conversion. The
separator, if any, will be adopted or replaced by the default
separator of the target path type.
Throws:
A `PathValidationException` is thrown if the segment name cannot
be represented in the target path format.
*/
GenericPath!F.Segment2 opCast(T : GenericPath!F.Segment2, F)()
{
import std.array : array;
char dsep = '\0';
if (m_separator) {
if (F.isSeparator(m_separator)) dsep = m_separator;
else dsep = F.defaultSeparator;
}
static if (is(typeof(this.name) == string))
string n = this.name;
else
string n = this.name.array;
return GenericPath!F.Segment2(n, dsep);
}
/// Compares two path segment names
bool opEquals(Segment2 other)
const nothrow @nogc {
try return equal(this.name, other.name) && this.hasSeparator == other.hasSeparator;
catch (Exception e) assert(false, e.msg);
}
/// ditto
bool opEquals(string name)
const nothrow @nogc {
import std.utf : byCodeUnit;
try return equal(this.name, name.byCodeUnit);
catch (Exception e) assert(false, e.msg);
}
}
private {
string m_path;
}
/// The default path segment separator character.
enum char defaultSeparator = Format.defaultSeparator;
/** Constructs a path from its string representation.
Throws:
A `PathValidationException` is thrown if the given path string
is not valid.
*/
this(string p)
{
auto err = Format.validatePath(p);
enforce!PathValidationException(err is null, err);
m_path = p;
}
/** Constructs a path from a single path segment.
This is equivalent to calling the range based constructor with a
single-element range.
*/
this(Segment segment)
{
import std.range : only;
this(only(segment));
}
/// ditto
this(Segment2 segment)
{
import std.range : only;
this(only(segment));
}
/** Constructs a path from an input range of `Segment`s.
Throws:
Since path segments are pre-validated, this constructor does not
throw an exception.
*/
this(R)(R segments)
if (isInputRange!R && is(ElementType!R : Segment))
{
import std.array : appender;
auto dst = appender!string;
Format.toString(segments, dst);
m_path = dst.data;
}
/// ditto
this(R)(R segments)
if (isInputRange!R && is(ElementType!R : Segment2))
{
import std.array : appender;
auto dst = appender!string;
Format.toString(segments, dst);
m_path = dst.data;
}
/** Constructs a path from its string representation.
This is equivalent to calling the string based constructor.
*/
static GenericPath fromString(string p)
{
return GenericPath(p);
}
/** Constructs a path from its string representation, skipping the
validation.
Note that it is required to pass a pre-validated path string
to this function. Debug builds will enforce this with an assertion.
*/
static GenericPath fromTrustedString(string p)
nothrow @nogc {
assert(Format.validatePath(p) is null, "Invalid trusted path.");
GenericPath ret;
ret.m_path = p;
return ret;
}
/// Tests if a certain character is a path segment separator.
static bool isSeparator(dchar ch) { return ch < 0x80 && Format.isSeparator(cast(char)ch); }
/// Tests if the path is represented by an empty string.
@property bool empty() const nothrow @nogc { return m_path.length == 0; }
/// Tests if the path is absolute.
@property bool absolute() const nothrow @nogc { return Format.getAbsolutePrefix(m_path).length > 0; }
/// Determines whether the path ends with a path separator (i.e. represents a folder specifically).
@property bool endsWithSlash() const nothrow @nogc { return m_path.length > 0 && Format.isSeparator(m_path[$-1]); }
/// ditto
@property void endsWithSlash(bool v)
nothrow {
bool ews = this.endsWithSlash;
if (!ews && v) m_path ~= Format.defaultSeparator;
else if (ews && !v) m_path = m_path[0 .. $-1]; // FIXME?: "/test//" -> "/test/"
}
/// Iterates over the path by `Segment`.
@property PathRange bySegment() const { return PathRange(m_path); }
/** Iterates over the individual segments of the path.
Returns a forward range of `Segment2`s.
*/
@property auto bySegment2()
const {
static struct R {
import std.traits : ReturnType;
private {
string m_path;
Segment2 m_front;
}
private this(string path)
{
m_path = path;
if (m_path.length) {
auto ap = Format.getAbsolutePrefix(m_path);
if (ap.length && !Format.isSeparator(ap[0]))
m_front = Segment2.fromTrustedEncodedString(null, '/');
else readFront();
}
}
@property bool empty() const nothrow @nogc { return m_path.length == 0 && m_front == Segment2.init; }
@property R save() { return this; }
@property Segment2 front() { return m_front; }
void popFront()
nothrow {
assert(m_front != Segment2.init);
if (m_path.length) readFront();
else m_front = Segment2.init;
}
private void readFront()
{
auto n = Format.getFrontNode(m_path);
m_path = m_path[n.length .. $];
char sep = '\0';
if (Format.isSeparator(n[$-1])) {
sep = n[$-1];
n = n[0 .. $-1];
}
m_front = Segment2.fromTrustedEncodedString(n, sep);
assert(m_front != Segment2.init);
}
}
return R(m_path);
}
///
unittest {
InetPath p = "foo/bar/baz";
assert(p.bySegment2.equal([
InetPath.Segment2("foo", '/'),
InetPath.Segment2("bar", '/'),
InetPath.Segment2("baz")
]));
}
/** Iterates over the path by segment, each time returning the sub path
leading to that segment.
*/
@property auto byPrefix()
const nothrow @nogc {
static struct R {
import std.traits : ReturnType;
private {
string m_path;
string m_remainder;
}
private this(string path)
{
m_path = path;
m_remainder = path;
if (m_path.length) {
auto ap = Format.getAbsolutePrefix(m_path);
if (ap.length && !Format.isSeparator(ap[0]))
m_remainder = m_remainder[ap.length .. $];
else popFront();
}
}
@property bool empty() const nothrow @nogc
{
return m_path.length == 0;
}
@property R save() { return this; }
@property GenericPath front()
{
return GenericPath.fromTrustedString(m_path[0 .. $-m_remainder.length]);
}
void popFront()
nothrow {
assert(m_remainder.length > 0 || m_path.length > 0);
if (m_remainder.length) readFront();
else m_path = "";
}
private void readFront()
{
auto n = Format.getFrontNode(m_remainder);
m_remainder = m_remainder[n.length .. $];
}
}
return R(m_path);
}
///
unittest {
assert(InetPath("foo/bar/baz").byPrefix
.equal([
InetPath("foo/"),
InetPath("foo/bar/"),
InetPath("foo/bar/baz")
]));
assert(InetPath("/foo/bar").byPrefix
.equal([
InetPath("/"),
InetPath("/foo/"),
InetPath("/foo/bar"),
]));
}
/// Returns the trailing segment of the path.
@property Segment head()
const {
import std.array : array;
auto n = Format.getBackNode(m_path);
char sep = '\0';
if (n.length > 0 && Format.isSeparator(n[$-1])) {
sep = n[$-1];
n = n[0 .. $-1];
}
static if (is(typeof(Format.decodeSingleSegment(n)) == string))
string ndec = Format.decodeSingleSegment(n);
else
string ndec = Format.decodeSingleSegment(n).array;
return Segment.fromTrustedString(ndec, sep);
}
/// Returns the trailing segment of the path.
@property Segment2 head2()
const @nogc {
auto n = Format.getBackNode(m_path);
char sep = '\0';
if (n.length > 0 && Format.isSeparator(n[$-1])) {
sep = n[$-1];
n = n[0 .. $-1];
}
return Segment2.fromTrustedEncodedString(n, sep);
}
/** Determines if the `parentPath` property is valid.
*/
bool hasParentPath()
const @nogc {
auto b = Format.getBackNode(m_path);
return b.length < m_path.length;
}
/** Returns a prefix of this path, where the last segment has been dropped.
Throws:
An `Exception` is thrown if this path has no parent path. Use
`hasParentPath` to test this upfront.
*/
GenericPath parentPath()
const @nogc {
auto b = Format.getBackNode(m_path);
static immutable Exception e = new Exception("Path has no parent path");
if (b.length >= m_path.length) throw e;
return GenericPath.fromTrustedString(m_path[0 .. $ - b.length]);
}
/** Removes any redundant path segments and replaces all separators by the
default one.
The resulting path representation is suitable for basic semantic
comparison to other normalized paths.
Note that there are still ways for different normalized paths to
represent the same file. Examples of this are the tilde shortcut to the
home directory on Unix and Linux operating systems, symbolic or hard
links, and possibly environment variables are examples of this.
Throws:
Throws an `Exception` if an absolute path contains parent directory
segments ("..") that lead to a path that is a parent path of the
root path.
*/
void normalize()
{
import std.array : appender, join;
Segment2[] newnodes;
bool got_non_sep = false;
foreach (n; this.bySegment2) {
if (n.hasSeparator) n.separator = Format.defaultSeparator;
if (!got_non_sep) {
if (n.encodedName == "") newnodes ~= n;
else got_non_sep = true;
}
switch (n.encodedName) {
default: newnodes ~= n; break;
case "", ".": break;
case "..":
enforce(!this.absolute || newnodes.length > 0, "Path goes below root node.");
if (newnodes.length > 0 && newnodes[$-1].encodedName != "..") newnodes = newnodes[0 .. $-1];
else newnodes ~= n;
break;
}
}
auto dst = appender!string;
Format.toString(newnodes, dst);
m_path = dst.data;
}
///
unittest {
auto path = WindowsPath("C:\\test/foo/./bar///../baz");
path.normalize();
assert(path.toString() == "C:\\test\\foo\\baz", path.toString());
path = WindowsPath("foo/../../bar/");
path.normalize();
assert(path.toString() == "..\\bar\\");
}
/// Returns the string representation of the path.
string toString() const nothrow @nogc { return m_path; }
/// Computes a hash sum, enabling storage within associative arrays.
size_t toHash() const nothrow @trusted
{
try return typeid(string).getHash(&m_path);
catch (Exception e) assert(false, "getHash for string throws!?");
}
/** Compares two path objects.
Note that the exact string representation of the two paths will be
compared. To get a basic semantic comparison, the paths must be
normalized first.
*/
bool opEquals(GenericPath other) const @nogc { return this.m_path == other.m_path; }
/** Converts the path to a different path format.
Throws:
A `PathValidationException` will be thrown if the path is not
representable in the requested path format. This can happen
especially when converting Posix or Internet paths to windows paths,
since Windows paths cannot contain a number of characters that the
other representations can, in theory.
*/
P opCast(P)() const if (isInstanceOf!(.GenericPath, P)) {
static if (is(P == GenericPath)) return this;
else return P(this.bySegment2.map!(n => cast(P.Segment2)n));
}
/** Concatenates two paths.
The right hand side must represent a relative path.
*/
GenericPath opBinary(string op : "~")(string subpath) const { return this ~ GenericPath(subpath); }
/// ditto
GenericPath opBinary(string op : "~")(Segment subpath) const { return this ~ GenericPath(subpath); }
/// ditto
GenericPath opBinary(string op : "~")(Segment2 subpath) const { return this ~ GenericPath(subpath); }
/// ditto
GenericPath opBinary(string op : "~", F)(GenericPath!F.Segment subpath) const { return this ~ cast(Segment)(subpath); }
/// ditto
GenericPath opBinary(string op : "~", F)(GenericPath!F.Segment2 subpath) const { return this ~ cast(Segment2)(subpath); }
/// ditto
GenericPath opBinary(string op : "~")(GenericPath subpath) const nothrow {
assert(!subpath.absolute || m_path.length == 0, "Cannot append absolute path.");
if (endsWithSlash || empty) return GenericPath.fromTrustedString(m_path ~ subpath.m_path);
else return GenericPath.fromTrustedString(m_path ~ Format.defaultSeparator ~ subpath.m_path);
}
/// ditto
GenericPath opBinary(string op : "~", F)(GenericPath!F subpath) const if (!is(F == Format)) { return this ~ cast(GenericPath)subpath; }
/// ditto
GenericPath opBinary(string op : "~", R)(R entries) const nothrow
if (isInputRange!R && is(ElementType!R : Segment))
{
return this ~ GenericPath(entries);
}
/// ditto
GenericPath opBinary(string op : "~", R)(R entries) const nothrow
if (isInputRange!R && is(ElementType!R : Segment2))
{
return this ~ GenericPath(entries);
}
/// Appends a relative path to this path.
void opOpAssign(string op : "~", T)(T op) { this = this ~ op; }
/** Tests whether the given path is a prefix of this path.
Any path separators will be ignored during the comparison.
*/
bool startsWith(GenericPath prefix)
const nothrow {
return bySegment2.map!(n => n.name).startsWith(prefix.bySegment2.map!(n => n.name));
}
}
unittest {
assert(PosixPath("hello/world").bySegment.equal([PosixPath.Segment("hello",'/'), PosixPath.Segment("world")]));
assert(PosixPath("/hello/world/").bySegment.equal([PosixPath.Segment("",'/'), PosixPath.Segment("hello",'/'), PosixPath.Segment("world",'/')]));
assert(PosixPath("hello\\world").bySegment.equal([PosixPath.Segment("hello\\world")]));
assert(WindowsPath("hello/world").bySegment.equal([WindowsPath.Segment("hello",'/'), WindowsPath.Segment("world")]));
assert(WindowsPath("/hello/world/").bySegment.equal([WindowsPath.Segment("",'/'), WindowsPath.Segment("hello",'/'), WindowsPath.Segment("world",'/')]));
assert(WindowsPath("hello\\w/orld").bySegment.equal([WindowsPath.Segment("hello",'\\'), WindowsPath.Segment("w",'/'), WindowsPath.Segment("orld")]));
assert(WindowsPath("hello/w\\orld").bySegment.equal([WindowsPath.Segment("hello",'/'), WindowsPath.Segment("w",'\\'), WindowsPath.Segment("orld")]));
}
unittest {
assert(PosixPath("hello/world").bySegment2.equal([PosixPath.Segment2("hello",'/'), PosixPath.Segment2("world")]));
assert(PosixPath("/hello/world/").bySegment2.equal([PosixPath.Segment2("",'/'), PosixPath.Segment2("hello",'/'), PosixPath.Segment2("world",'/')]));
assert(PosixPath("hello\\world").bySegment2.equal([PosixPath.Segment2("hello\\world")]));
assert(WindowsPath("hello/world").bySegment2.equal([WindowsPath.Segment2("hello",'/'), WindowsPath.Segment2("world")]));
assert(WindowsPath("/hello/world/").bySegment2.equal([WindowsPath.Segment2("",'/'), WindowsPath.Segment2("hello",'/'), WindowsPath.Segment2("world",'/')]));
assert(WindowsPath("hello\\w/orld").bySegment2.equal([WindowsPath.Segment2("hello",'\\'), WindowsPath.Segment2("w",'/'), WindowsPath.Segment2("orld")]));
assert(WindowsPath("hello/w\\orld").bySegment2.equal([WindowsPath.Segment2("hello",'/'), WindowsPath.Segment2("w",'\\'), WindowsPath.Segment2("orld")]));
assert(PosixPath("hello/world").byPrefix.equal([PosixPath("hello/"), PosixPath("hello/world")]));
assert(PosixPath("/hello/world/").byPrefix.equal([PosixPath("/"), PosixPath("/hello/"), PosixPath("/hello/world/")]));
assert(WindowsPath("C:\\Windows").byPrefix.equal([WindowsPath("C:\\"), WindowsPath("C:\\Windows")]));
}
unittest
{
{
auto unc = "\\\\server\\share\\path";
auto uncp = WindowsPath(unc);
assert(uncp.absolute);
uncp.normalize();
version(Windows) assert(uncp.toNativeString() == unc);
assert(uncp.absolute);
assert(!uncp.endsWithSlash);
}
{
auto abspath = "/test/path/";
auto abspathp = PosixPath(abspath);
assert(abspathp.toString() == abspath);
version(Windows) {} else assert(abspathp.toNativeString() == abspath);
assert(abspathp.absolute);
assert(abspathp.endsWithSlash);
alias S = PosixPath.Segment;
assert(abspathp.bySegment.equal([S("", '/'), S("test", '/'), S("path", '/')]));
}
{
auto relpath = "test/path/";
auto relpathp = PosixPath(relpath);
assert(relpathp.toString() == relpath);
version(Windows) assert(relpathp.toNativeString() == "test/path/");
else assert(relpathp.toNativeString() == relpath);
assert(!relpathp.absolute);
assert(relpathp.endsWithSlash);
alias S = PosixPath.Segment;
assert(relpathp.bySegment.equal([S("test", '/'), S("path", '/')]));
}
{
auto winpath = "C:\\windows\\test";
auto winpathp = WindowsPath(winpath);
assert(winpathp.toString() == "C:\\windows\\test");
assert((cast(PosixPath)winpathp).toString() == "/C:/windows/test", (cast(PosixPath)winpathp).toString());
version(Windows) assert(winpathp.toNativeString() == winpath);
else assert(winpathp.toNativeString() == "/C:/windows/test");
assert(winpathp.absolute);
assert(!winpathp.endsWithSlash);
alias S = WindowsPath.Segment;
assert(winpathp.bySegment.equal([S("", '/'), S("C:", '\\'), S("windows", '\\'), S("test")]));
}
{
auto dotpath = "/test/../test2/././x/y";
auto dotpathp = PosixPath(dotpath);
assert(dotpathp.toString() == "/test/../test2/././x/y");
dotpathp.normalize();
assert(dotpathp.toString() == "/test2/x/y", dotpathp.toString());
}
{
auto dotpath = "/test/..////test2//./x/y";
auto dotpathp = PosixPath(dotpath);
assert(dotpathp.toString() == "/test/..////test2//./x/y");
dotpathp.normalize();
assert(dotpathp.toString() == "/test2/x/y");
}
assert(WindowsPath("C:\\Windows").absolute);
assert((cast(InetPath)WindowsPath("C:\\Windows")).toString() == "/C:/Windows");
assert((WindowsPath("C:\\Windows") ~ InetPath("test/this")).toString() == "C:\\Windows\\test/this");
assert(InetPath("/C:/Windows").absolute);
assert((cast(WindowsPath)InetPath("/C:/Windows")).toString() == "C:/Windows");
assert((InetPath("/C:/Windows") ~ WindowsPath("test\\this")).toString() == "/C:/Windows/test/this");
assert((InetPath("") ~ WindowsPath("foo\\bar")).toString() == "foo/bar");
assert((cast(InetPath)WindowsPath("C:\\Windows\\")).toString() == "/C:/Windows/");
assert(NativePath("").empty);
assert(PosixPath("/") ~ NativePath("foo/bar") == PosixPath("/foo/bar"));
assert(PosixPath("") ~ NativePath("foo/bar") == PosixPath("foo/bar"));
assert(PosixPath("foo") ~ NativePath("bar") == PosixPath("foo/bar"));
assert(PosixPath("foo/") ~ NativePath("bar") == PosixPath("foo/bar"));
}
unittest
{
{
auto unc = "\\\\server\\share\\path";
auto uncp = WindowsPath(unc);
assert(uncp.absolute);
uncp.normalize();
version(Windows) assert(uncp.toNativeString() == unc);
assert(uncp.absolute);
assert(!uncp.endsWithSlash);
}
{
auto abspath = "/test/path/";
auto abspathp = PosixPath(abspath);
assert(abspathp.toString() == abspath);
version(Windows) {} else assert(abspathp.toNativeString() == abspath);
assert(abspathp.absolute);
assert(abspathp.endsWithSlash);
alias S = PosixPath.Segment2;
assert(abspathp.bySegment2.equal([S("", '/'), S("test", '/'), S("path", '/')]));
}
{
auto relpath = "test/path/";
auto relpathp = PosixPath(relpath);
assert(relpathp.toString() == relpath);
version(Windows) assert(relpathp.toNativeString() == "test/path/");
else assert(relpathp.toNativeString() == relpath);
assert(!relpathp.absolute);
assert(relpathp.endsWithSlash);
alias S = PosixPath.Segment2;
assert(relpathp.bySegment2.equal([S("test", '/'), S("path", '/')]));
}
{
auto winpath = "C:\\windows\\test";
auto winpathp = WindowsPath(winpath);
assert(winpathp.toString() == "C:\\windows\\test");
assert((cast(PosixPath)winpathp).toString() == "/C:/windows/test", (cast(PosixPath)winpathp).toString());
version(Windows) assert(winpathp.toNativeString() == winpath);
else assert(winpathp.toNativeString() == "/C:/windows/test");
assert(winpathp.absolute);
assert(!winpathp.endsWithSlash);
alias S = WindowsPath.Segment2;
assert(winpathp.bySegment2.equal([S("", '/'), S("C:", '\\'), S("windows", '\\'), S("test")]));
}
}
@safe unittest {
import std.array : appender;
auto app = appender!(PosixPath[]);
void test1(PosixPath p) { app.put(p); }
void test2(PosixPath[] ps) { app.put(ps); }
//void test3(const(PosixPath) p) { app.put(p); } // DMD issue 17251
//void test4(const(PosixPath)[] ps) { app.put(ps); }
}
unittest {
import std.exception : assertThrown, assertNotThrown;
assertThrown!PathValidationException(WindowsPath.Segment("foo/bar"));
assertThrown!PathValidationException(PosixPath.Segment("foo/bar"));
assertNotThrown!PathValidationException(InetPath.Segment("foo/bar"));
auto p = InetPath("/foo%2fbar/");
assert(p.bySegment.equal([InetPath.Segment("",'/'), InetPath.Segment("foo/bar",'/')]));
p ~= InetPath.Segment("baz/bam");
assert(p.toString() == "/foo%2fbar/baz%2Fbam", p.toString);
}
unittest {
import std.exception : assertThrown, assertNotThrown;
assertThrown!PathValidationException(WindowsPath.Segment2("foo/bar"));
assertThrown!PathValidationException(PosixPath.Segment2("foo/bar"));
assertNotThrown!PathValidationException(InetPath.Segment2("foo/bar"));
auto p = InetPath("/foo%2fbar/");
import std.conv : to;
assert(p.bySegment2.equal([InetPath.Segment2("",'/'), InetPath.Segment2("foo/bar",'/')]), p.bySegment2.to!string);
p ~= InetPath.Segment2("baz/bam");
assert(p.toString() == "/foo%2fbar/baz%2Fbam", p.toString);
}
unittest {
assert(!PosixPath("").hasParentPath);
assert(!PosixPath("/").hasParentPath);
assert(!PosixPath("foo\\bar").hasParentPath);
assert(PosixPath("foo/bar").parentPath.toString() == "foo/");
assert(PosixPath("./foo").parentPath.toString() == "./");
assert(PosixPath("./foo").parentPath.toString() == "./");
assert(!WindowsPath("").hasParentPath);
assert(!WindowsPath("/").hasParentPath);
assert(WindowsPath("foo\\bar").parentPath.toString() == "foo\\");
assert(WindowsPath("foo/bar").parentPath.toString() == "foo/");
assert(WindowsPath("./foo").parentPath.toString() == "./");
assert(WindowsPath("./foo").parentPath.toString() == "./");
assert(!InetPath("").hasParentPath);
assert(!InetPath("/").hasParentPath);
assert(InetPath("foo/bar").parentPath.toString() == "foo/");
assert(InetPath("foo/bar%2Fbaz").parentPath.toString() == "foo/");
assert(InetPath("./foo").parentPath.toString() == "./");
assert(InetPath("./foo").parentPath.toString() == "./");
}
unittest {
assert(WindowsPath([WindowsPath.Segment("foo"), WindowsPath.Segment("bar")]).toString() == "foo\\bar");
}
unittest {
assert(WindowsPath([WindowsPath.Segment2("foo"), WindowsPath.Segment2("bar")]).toString() == "foo\\bar");
}
/// Thrown when an invalid string representation of a path is detected.
class PathValidationException : Exception {
this(string text, string file = __FILE__, size_t line = cast(size_t)__LINE__, Throwable next = null)
pure nothrow @nogc @safe
{
super(text, file, line, next);
}
}
/** Implements Windows path semantics.
See_also: `WindowsPath`
*/
struct WindowsPathFormat {
static void toString(I, O)(I segments, O dst)
if (isInputRange!I && isOutputRange!(O, char))
{
char sep(char s) { return isSeparator(s) ? s : defaultSeparator; }
if (segments.empty) return;
if (segments.front.name == "" && segments.front.separator) {
auto s = segments.front.separator;
segments.popFront();
if (segments.empty || !segments.front.name.endsWith(":"))
dst.put(sep(s));
}
char lastsep = '\0';
bool first = true;
foreach (s; segments) {
if (!first || lastsep) dst.put(sep(lastsep));
else first = false;
dst.put(s.name);
lastsep = s.separator;
}
if (lastsep) dst.put(sep(lastsep));
}
unittest {
import std.array : appender;
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
string str(Segment[] segs...) { auto ret = appender!string; toString(segs, ret); return ret.data; }
assert(str() == "");
assert(str(Segment("",'/')) == "/");
assert(str(Segment("",'/'), Segment("foo")) == "/foo");
assert(str(Segment("",'\\')) == "\\");
assert(str(Segment("foo",'/'), Segment("bar",'/')) == "foo/bar/");
assert(str(Segment("",'/'), Segment("foo",'\0')) == "/foo");
assert(str(Segment("",'\\'), Segment("foo",'\\')) == "\\foo\\");
assert(str(Segment("f oo")) == "f oo");
assert(str(Segment("",'\\'), Segment("C:")) == "C:");
assert(str(Segment("",'\\'), Segment("C:", '/')) == "C:/");
assert(str(Segment("foo",'\\'), Segment("C:")) == "foo\\C:");
assert(str(Segment("foo"), Segment("bar")) == "foo\\bar");
}
@safe nothrow pure:
enum defaultSeparator = '\\';
static bool isSeparator(dchar ch)
@nogc {
import std.algorithm.comparison : among;
return ch.among!('\\', '/') != 0;
}
static string getAbsolutePrefix(string path)
@nogc {
if (!path.length) return null;
if (isSeparator(path[0])) {
return path[0 .. 1];
}
foreach (i; 1 .. path.length)
if (isSeparator(path[i])) {
if (path[i-1] == ':') return path[0 .. i+1];
break;
}
return path[$-1] == ':' ? path : null;
}
unittest {
assert(getAbsolutePrefix("test") == "");
assert(getAbsolutePrefix("test/") == "");
assert(getAbsolutePrefix("/test") == "/");
assert(getAbsolutePrefix("\\test") == "\\");
assert(getAbsolutePrefix("C:\\") == "C:\\");
assert(getAbsolutePrefix("C:") == "C:");
assert(getAbsolutePrefix("C:\\test") == "C:\\");
assert(getAbsolutePrefix("C:\\test\\") == "C:\\");
assert(getAbsolutePrefix("C:/") == "C:/");
assert(getAbsolutePrefix("C:/test") == "C:/");
assert(getAbsolutePrefix("C:/test/") == "C:/");
assert(getAbsolutePrefix("\\\\server") == "\\");
assert(getAbsolutePrefix("\\\\server\\") == "\\");
assert(getAbsolutePrefix("\\\\.\\") == "\\");
assert(getAbsolutePrefix("\\\\?\\") == "\\");
}
static string getFrontNode(string path)
@nogc {
foreach (i; 0 .. path.length)
if (isSeparator(path[i]))
return path[0 .. i+1];
return path;
}
unittest {
assert(getFrontNode("") == "");
assert(getFrontNode("/bar") == "/");
assert(getFrontNode("foo/bar") == "foo/");
assert(getFrontNode("foo/") == "foo/");
assert(getFrontNode("foo") == "foo");
assert(getFrontNode("\\bar") == "\\");
assert(getFrontNode("foo\\bar") == "foo\\");
assert(getFrontNode("foo\\") == "foo\\");
}
static string getBackNode(string path)
@nogc {
if (!path.length) return path;
foreach_reverse (i; 0 .. path.length-1)
if (isSeparator(path[i]))
return path[i+1 .. $];
return path;
}
unittest {
assert(getBackNode("") == "");
assert(getBackNode("/bar") == "bar");
assert(getBackNode("foo/bar") == "bar");
assert(getBackNode("foo/") == "foo/");
assert(getBackNode("foo") == "foo");
assert(getBackNode("\\bar") == "bar");
assert(getBackNode("foo\\bar") == "bar");
assert(getBackNode("foo\\") == "foo\\");
}
deprecated("Use decodeSingleSegment instead.")
static auto decodeSegment(S)(string segment)
{
static struct R {
S[2] items;
size_t i = items.length;
this(S s) { i = 1; items[i] = s; }
this(S a, S b) { i = 0; items[0] = a; items[1] = b; }
@property ref S front() { return items[i]; }
@property bool empty() const { return i >= items.length; }
void popFront() { i++; }
}
assert(segment.length > 0, "Path segment string must not be empty.");
char sep = '\0';
if (!segment.length) return R(S.fromTrustedString(null));
if (isSeparator(segment[$-1])) {
sep = segment[$-1];
segment = segment[0 .. $-1];
}
// output an absolute marker segment for "C:\" style absolute segments
if (segment.length > 0 && segment[$-1] == ':')
return R(S.fromTrustedString("", '/'), S.fromTrustedString(segment, sep));
return R(S.fromTrustedString(segment, sep));
}
deprecated unittest {
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
assert(decodeSegment!Segment("foo").equal([Segment("foo")]));
assert(decodeSegment!Segment("foo/").equal([Segment("foo", '/')]));
assert(decodeSegment!Segment("fo%20o\\").equal([Segment("fo%20o", '\\')]));
assert(decodeSegment!Segment("C:\\").equal([Segment("",'/'), Segment("C:", '\\')]));
assert(decodeSegment!Segment("bar:\\").equal([Segment("",'/'), Segment("bar:", '\\')]));
}
static string decodeSingleSegment(string segment)
@nogc {
assert(segment.length == 0 || segment[$-1] != '/');
return segment;
}
unittest {
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
assert(decodeSingleSegment("foo") == "foo");
assert(decodeSingleSegment("fo%20o") == "fo%20o");
assert(decodeSingleSegment("C:") == "C:");
assert(decodeSingleSegment("bar:") == "bar:");
}
static string validatePath(string path)
@nogc {
import std.algorithm.comparison : among;
// skip UNC prefix
if (path.startsWith("\\\\")) {
path = path[2 .. $];
while (path.length && !isSeparator(path[0])) {
if (path[0] < 32 || path[0].among('<', '>', '|'))
return "Invalid character in UNC host name.";
path = path[1 .. $];
}
if (path.length) path = path[1 .. $];
}
// stricter validation for the rest
bool had_sep = false;
foreach (i, char c; path) {
if (c < 32 || c.among!('<', '>', '|', '?'))
return "Invalid character in path.";
if (isSeparator(c)) had_sep = true;
else if (c == ':' && (had_sep || i+1 < path.length && !isSeparator(path[i+1])))
return "Colon in path that is not part of a drive name.";
}
return null;
}
static string validateDecodedSegment(string segment)
@nogc {
auto pe = validatePath(segment);
if (pe) return pe;
foreach (char c; segment)
if (isSeparator(c))
return "Path segment contains separator character.";
return null;
}
unittest {
assert(validatePath("c:\\foo") is null);
assert(validatePath("\\\\?\\c:\\foo") is null);
assert(validatePath("//?\\c:\\foo") !is null);
assert(validatePath("-foo/bar\\*\\baz") is null);
assert(validatePath("foo\0bar") !is null);
assert(validatePath("foo\tbar") !is null);
assert(validatePath("\\c:\\foo") !is null);
assert(validatePath("c:d\\foo") !is null);
assert(validatePath("foo\\b:ar") !is null);
assert(validatePath("foo\\bar:\\baz") !is null);
}
static string encodeSegment(string segment)
{
assert(segment.length == 0 || segment[$-1] != '/');
return segment;
}
}
/** Implements Unix/Linux path semantics.
See_also: `WindowsPath`
*/
struct PosixPathFormat {
static void toString(I, O)(I segments, O dst)
{
char lastsep = '\0';
bool first = true;
foreach (s; segments) {
if (!first || lastsep) dst.put('/');
else first = false;
dst.put(s.name);
lastsep = s.separator;
}
if (lastsep) dst.put('/');
}
unittest {
import std.array : appender;
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
string str(Segment[] segs...) { auto ret = appender!string; toString(segs, ret); return ret.data; }
assert(str() == "");
assert(str(Segment("",'/')) == "/");
assert(str(Segment("foo",'/'), Segment("bar",'/')) == "foo/bar/");
assert(str(Segment("",'/'), Segment("foo",'\0')) == "/foo");
assert(str(Segment("",'\\'), Segment("foo",'\\')) == "/foo/");
assert(str(Segment("f oo")) == "f oo");
assert(str(Segment("foo"), Segment("bar")) == "foo/bar");
}
@safe nothrow pure:
enum defaultSeparator = '/';
static bool isSeparator(dchar ch)
@nogc {
return ch == '/';
}
static string getAbsolutePrefix(string path)
@nogc {
if (path.length > 0 && path[0] == '/')
return path[0 .. 1];
return null;
}
unittest {
assert(getAbsolutePrefix("/") == "/");
assert(getAbsolutePrefix("/test") == "/");
assert(getAbsolutePrefix("/test/") == "/");
assert(getAbsolutePrefix("test/") == "");
assert(getAbsolutePrefix("") == "");
assert(getAbsolutePrefix("./") == "");
}
static string getFrontNode(string path)
@nogc {
import std.string : indexOf;
auto idx = path.indexOf('/');
return idx < 0 ? path : path[0 .. idx+1];
}
unittest {
assert(getFrontNode("") == "");
assert(getFrontNode("/bar") == "/");
assert(getFrontNode("foo/bar") == "foo/");
assert(getFrontNode("foo/") == "foo/");
assert(getFrontNode("foo") == "foo");
}
static string getBackNode(string path)
@nogc {
if (!path.length) return path;
foreach_reverse (i; 0 .. path.length-1)
if (path[i] == '/')
return path[i+1 .. $];
return path;
}
unittest {
assert(getBackNode("") == "");
assert(getBackNode("/bar") == "bar");
assert(getBackNode("foo/bar") == "bar");
assert(getBackNode("foo/") == "foo/");
assert(getBackNode("foo") == "foo");
}
static string validatePath(string path)
@nogc {
foreach (char c; path)
if (c == '\0')
return "Invalid NUL character in file name";
return null;
}
static string validateDecodedSegment(string segment)
@nogc {
auto pe = validatePath(segment);
if (pe) return pe;
foreach (char c; segment)
if (isSeparator(c))
return "Path segment contains separator character.";
return null;
}
unittest {
assert(validatePath("-foo/bar*/baz?") is null);
assert(validatePath("foo\0bar") !is null);
}
deprecated("Use decodeSingleSegment instead.")
static auto decodeSegment(S)(string segment)
{
assert(segment.length > 0, "Path segment string must not be empty.");
import std.range : only;
if (!segment.length) return only(S.fromTrustedString(null, '/'));
if (segment[$-1] == '/')
return only(S.fromTrustedString(segment[0 .. $-1], '/'));
return only(S.fromTrustedString(segment));
}
deprecated unittest {
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
assert(decodeSegment!Segment("foo").equal([Segment("foo")]));
assert(decodeSegment!Segment("foo/").equal([Segment("foo", '/')]));
assert(decodeSegment!Segment("fo%20o\\").equal([Segment("fo%20o\\")]));
}
static string decodeSingleSegment(string segment)
@nogc {
assert(segment.length == 0 || segment[$-1] != '/');
return segment;
}
unittest {
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
assert(decodeSingleSegment("foo") == "foo");
assert(decodeSingleSegment("fo%20o\\") == "fo%20o\\");
}
static string encodeSegment(string segment)
{
assert(segment.length == 0 || segment[$-1] != '/');
return segment;
}
}
/** Implements URI/Internet path semantics.
See_also: `WindowsPath`
*/
struct InetPathFormat {
static void toString(I, O)(I segments, O dst)
{
char lastsep = '\0';
bool first = true;
foreach (e; segments) {
if (!first || lastsep) dst.put('/');
else first = false;
static if (is(typeof(e.encodedName)))
dst.put(e.encodedName);
else encodeSegment(dst, e.name);
lastsep = e.separator;
}
if (lastsep) dst.put('/');
}
unittest {
import std.array : appender;
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
string str(Segment[] segs...) { auto ret = appender!string; toString(segs, ret); return ret.data; }
assert(str() == "");
assert(str(Segment("",'/')) == "/");
assert(str(Segment("foo",'/'), Segment("bar",'/')) == "foo/bar/");
assert(str(Segment("",'/'), Segment("foo",'\0')) == "/foo");
assert(str(Segment("",'\\'), Segment("foo",'\\')) == "/foo/");
assert(str(Segment("f oo")) == "f%20oo");
assert(str(Segment("foo"), Segment("bar")) == "foo/bar");
}
@safe pure nothrow:
enum defaultSeparator = '/';
static bool isSeparator(dchar ch)
@nogc {
return ch == '/';
}
static string getAbsolutePrefix(string path)
@nogc {
if (path.length > 0 && path[0] == '/')
return path[0 .. 1];
return null;
}
unittest {
assert(getAbsolutePrefix("/") == "/");
assert(getAbsolutePrefix("/test") == "/");
assert(getAbsolutePrefix("/test/") == "/");
assert(getAbsolutePrefix("test/") == "");
assert(getAbsolutePrefix("") == "");
assert(getAbsolutePrefix("./") == "");
}
static string getFrontNode(string path)
@nogc {
import std.string : indexOf;
auto idx = path.indexOf('/');
return idx < 0 ? path : path[0 .. idx+1];
}
unittest {
assert(getFrontNode("") == "");
assert(getFrontNode("/bar") == "/");
assert(getFrontNode("foo/bar") == "foo/");
assert(getFrontNode("foo/") == "foo/");
assert(getFrontNode("foo") == "foo");
}
static string getBackNode(string path)
@nogc {
import std.string : lastIndexOf;
if (!path.length) return path;
ptrdiff_t idx;
try idx = path[0 .. $-1].lastIndexOf('/');
catch (Exception e) assert(false, e.msg);
if (idx >= 0) return path[idx+1 .. $];
return path;
}
unittest {
assert(getBackNode("") == "");
assert(getBackNode("/bar") == "bar");
assert(getBackNode("foo/bar") == "bar");
assert(getBackNode("foo/") == "foo/");
assert(getBackNode("foo") == "foo");
}
static string validatePath(string path)
@nogc {
for (size_t i = 0; i < path.length; i++) {
switch (path[i]) {
default:
return "Invalid character in internet path.";
// unreserved
case 'A': .. case 'Z':
case 'a': .. case 'z':
case '0': .. case '9':
case '-', '.', '_', '~':
// subdelims
case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=':
// additional delims
case ':', '@':
// segment delimiter
case '/':
break;
case '%': // pct encoding
if (path.length < i+3)
return "Unterminated percent encoding sequence in internet path.";
foreach (j; 0 .. 2) {
switch (path[++i]) {
default: return "Invalid percent encoding sequence in internet path.";
case '0': .. case '9':
case 'a': .. case 'f':
case 'A': .. case 'F':
break;
}
}
break;
}
}
return null;
}
static string validateDecodedSegment(string seg)
@nogc {
return null;
}
unittest {
assert(validatePath("") is null);
assert(validatePath("/") is null);
assert(validatePath("/test") is null);
assert(validatePath("test") is null);
assert(validatePath("/C:/test") is null);
assert(validatePath("/test%ab") is null);
assert(validatePath("/test%ag") !is null);
assert(validatePath("/test%a") !is null);
assert(validatePath("/test%") !is null);
assert(validatePath("/test§") !is null);
assert(validatePath("föö") !is null);
}
deprecated("Use decodeSingleSegment instead.")
static auto decodeSegment(S)(string segment)
{
import std.algorithm.searching : any;
import std.array : array;
import std.exception : assumeUnique;
import std.range : only;
import std.utf : byCodeUnit;
if (!segment.length) return only(S.fromTrustedString(null));
char sep = '\0';
if (segment[$-1] == '/') {
sep = '/';
segment = segment[0 .. $-1];
}
if (!segment.byCodeUnit.any!(c => c == '%'))
return only(S(segment, sep));
string n = decodeSingleSegment(segment).array;
return only(S(n, sep));
}
deprecated unittest {
struct Segment { string name; char separator = 0; static Segment fromTrustedString(string str, char sep = 0) pure nothrow @nogc { return Segment(str, sep); }}
assert(decodeSegment!Segment("foo").equal([Segment("foo")]));
assert(decodeSegment!Segment("foo/").equal([Segment("foo", '/')]));
assert(decodeSegment!Segment("fo%20o\\").equal([Segment("fo o\\")]));
assert(decodeSegment!Segment("foo%20").equal([Segment("foo ")]));
}
static auto decodeSingleSegment(string segment)
@nogc {
import std.string : indexOf;
static int hexDigit(char ch) @safe nothrow @nogc {
assert(ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f');
if (ch >= '0' && ch <= '9') return ch - '0';
else if (ch >= 'a' && ch <= 'f') return ch - 'a' + 10;
else return ch - 'A' + 10;
}
static struct R {
@safe pure nothrow @nogc:
private {
string m_str;
size_t m_index;
}
this(string s)
{
m_str = s;
}
@property bool empty() const { return m_index >= m_str.length; }
@property char front()
const {
auto ch = m_str[m_index];
if (ch != '%') return ch;
auto a = m_str[m_index+1];
auto b = m_str[m_index+2];
return cast(char)(16 * hexDigit(a) + hexDigit(b));
}
@property void popFront()
{
assert(!empty);
if (m_str[m_index] == '%') m_index += 3;
else m_index++;
}
}
return R(segment);
}
unittest {
scope (failure) assert(false);
assert(decodeSingleSegment("foo").equal("foo"));
assert(decodeSingleSegment("fo%20o\\").equal("fo o\\"));
assert(decodeSingleSegment("foo%20").equal("foo "));
}
static string encodeSegment(string segment)
{
import std.array : appender;
foreach (i, char c; segment) {
switch (c) {
default:
auto ret = appender!string;
ret.put(segment[0 .. i]);
encodeSegment(ret, segment[i .. $]);
return ret.data;
case 'a': .. case 'z':
case 'A': .. case 'Z':
case '0': .. case '9':
case '-', '.', '_', '~':
case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=':
case ':', '@':
break;
}
}
return segment;
}
unittest {
assert(encodeSegment("foo") == "foo");
assert(encodeSegment("foo bar") == "foo%20bar");
}
static void encodeSegment(R)(ref R dst, string segment)
{
static immutable char[16] digit = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
foreach (char c; segment) {
switch (c) {
default:
dst.put('%');
dst.put(digit[uint(c) / 16]);
dst.put(digit[uint(c) % 16]);
break;
case 'a': .. case 'z':
case 'A': .. case 'Z':
case '0': .. case '9':
case '-', '.', '_', '~':
case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=':
case ':', '@':
dst.put(c);
break;
}
}
}
}
unittest { // regression tests
assert(NativePath("").bySegment.empty);
assert(NativePath("").bySegment2.empty);
}
|
D
|
module owlchain.xdr.xdrDataInputStream;
import std.string;
import std.conv;
import owlchain.core.stream;
import owlchain.xdr.type;
class XdrDataInputStream : InputStream
{
ubyte[] data;
size_t offset;
this(ubyte[] source)
{
data = source.dup();
offset = 0;
}
this()
{
data.length = 0;
offset = 0;
}
void assign(ubyte[] source)
{
data = source.dup();
offset = 0;
}
bool empty()
{
return data.length == 0;
}
ulong leastSize()
{
return 0;
}
bool dataAvailableForRead()
{
return data.length - 1 > offset;
}
bool dataAvailableForRead(int size)
{
return data.length >= (offset + size);
}
bool dataAvailableForRead(ulong size)
{
return data.length >= (offset + size);
}
const(ubyte)[] peek()
{
return data;
}
void read(ubyte[] dst)
{
if (dataAvailableForRead(dst.length))
{
dst[0 .. dst.length] = data[offset .. offset + dst.length];
offset += dst.length;
}
}
void read(byte[] dst)
{
read(cast(ubyte[]) dst);
}
int readInt()
{
int value;
if (dataAvailableForRead(int.sizeof))
{
value = *cast(int*)&data[offset];
offset += int.sizeof;
}
else
{
value = 0;
}
return value;
}
long readLong()
{
long value;
if (dataAvailableForRead(long.sizeof))
{
value = *cast(long*)&data[offset];
offset += long.sizeof;
}
else
{
value = 0;
}
return value;
}
uint readUint()
{
uint value;
if (dataAvailableForRead(uint.sizeof))
{
value = *cast(uint*)&data[offset];
offset += uint.sizeof;
}
else
{
value = 0;
}
return value;
}
ulong readUlong()
{
ulong value;
if (dataAvailableForRead(ulong.sizeof))
{
value = *cast(ulong*)&data[offset];
offset += ulong.sizeof;
}
else
{
value = 0;
}
return value;
}
int32 readInt32()
{
int32 value;
if (dataAvailableForRead(int32.sizeof))
{
value = *cast(int32*)&data[offset];
offset += int32.sizeof;
}
else
{
value = 0;
}
return value;
}
int64 readInt64()
{
int64 value;
if (dataAvailableForRead(int64.sizeof))
{
value = *cast(int64*)&data[offset];
offset += int64.sizeof;
}
else
{
value = 0;
}
return value;
}
uint32 readUint32()
{
uint32 value;
if (dataAvailableForRead(uint32.sizeof))
{
value = *cast(uint32*)&data[offset];
offset += uint32.sizeof;
}
else
{
value = 0;
}
return value;
}
uint64 readUint64()
{
uint64 value;
if (dataAvailableForRead(uint64.sizeof))
{
value = *cast(uint64*)&data[offset];
offset += uint64.sizeof;
}
else
{
value = 0;
}
return value;
}
uint256 readUint256()
{
uint256 value;
if (dataAvailableForRead(uint256.sizeof))
{
value = *cast(uint256*)&data[offset];
offset += uint256.sizeof;
}
else
{
value = 0;
}
return value;
}
uint512 readUint512()
{
uint512 value;
if (dataAvailableForRead(uint512.sizeof))
{
value = *cast(uint512*)&data[offset];
offset += uint512.sizeof;
}
else
{
value = 0;
}
return value;
}
string readString()
{
int32 size = readInt32();
byte[] ascii = new byte[size];
read(ascii);
string p = cast(string)(ascii);
return p;
}
}
|
D
|
/Users/antonimuller/WebstormProjects/WebAssemblyPerformance/sortAlgorithm/target/release/build/libm-b04b0c56bc357600/build_script_build-b04b0c56bc357600: /Users/antonimuller/.cargo/registry/src/github.com-1ecc6299db9ec823/libm-0.2.1/build.rs
/Users/antonimuller/WebstormProjects/WebAssemblyPerformance/sortAlgorithm/target/release/build/libm-b04b0c56bc357600/build_script_build-b04b0c56bc357600.d: /Users/antonimuller/.cargo/registry/src/github.com-1ecc6299db9ec823/libm-0.2.1/build.rs
/Users/antonimuller/.cargo/registry/src/github.com-1ecc6299db9ec823/libm-0.2.1/build.rs:
|
D
|
/**
* Authors: Frank Benoit <keinfarbton@googlemail.com>
*/
module java.lang.System;
import java.lang.util;
import java.lang.exceptions;
import java.io.PrintStream;
version(Tango){
static import tango.sys.Environment;
static import tango.core.Exception;
static import tango.io.model.IFile;
static import tango.time.Clock;
static import tango.stdc.stdlib;
} else { // Phobos
static import std.c.stdlib;
static import std.datetime;
static import std.path;
}
template SimpleType(T) {
debug{
static void validCheck(uint SrcLen, uint DestLen, uint copyLen){
if(SrcLen < copyLen || DestLen < copyLen|| SrcLen < 0 || DestLen < 0){
//Util.trace("Error : SimpleType.arraycopy(), out of bounds.");
assert(0);
}
}
}
static void remove(ref T[] items, int index) {
if(items.length == 0)
return;
if(index < 0 || index >= items.length){
throw new ArrayIndexOutOfBoundsException(__FILE__, __LINE__);
}
T element = items[index];
int length = items.length;
if(length == 1){
items.length = 0;
return;// element;
}
if(index == 0)
items = items[1 .. $];
else if(index == length - 1)
items = items[0 .. index];
else
items = items[0 .. index] ~ items[index + 1 .. $];
}
static void insert(ref T[] items, T item, int index = -1) {
if(index == -1)
index = items.length;
if(index < 0 || index > items.length ){
throw new ArrayIndexOutOfBoundsException(__FILE__, __LINE__);
}
if(index == items.length){
items ~= item;
}else if(index == 0){
T[] newVect;
newVect ~= item;
items = newVect ~ items;
}else if(index < items.length ){
T[] arr1 = items[0 .. index];
T[] arr2 = items[index .. $];
// Important : if you write like the following commented,
// you get wrong data
// code: T[] arr1 = items[0..index];
// T[] arr2 = items[index..$];
// items = arr1 ~ item; // error, !!!
// items ~= arr2; // item replace the arrr2[0] here
items = arr1 ~ item ~ arr2;
}
}
static void arraycopy(in T[] src, uint srcPos, T[] dest, uint destPos, uint len)
{
if(len == 0) return;
assert(src);
assert(dest);
debug{validCheck(src.length - srcPos, dest.length - destPos, len);}
// overlapping?
if((src.ptr <= dest.ptr && src.ptr + len > dest.ptr)
||(src.ptr >= dest.ptr && src.ptr < dest.ptr + len)){
if( destPos < srcPos ){
for(int i=0; i<len; ++i){
dest[destPos+i] = cast(T)src[srcPos+i];
}
}
else{
for(int i=len-1; i>=0; --i){
dest[destPos+i] = cast(T)src[srcPos+i];
}
}
}else{
dest[destPos..(len+destPos)] = cast(T[])src[srcPos..(len+srcPos)];
}
}
}
class System {
static void arraycopy(T)(in T[] src, uint srcPos, T[] dest, uint destPos, uint len) {
if(len == 0) return;
assert(src);
assert(dest);
debug{SimpleType!(T).validCheck(src.length - srcPos, dest.length - destPos, len);}
// overlapping?
if((src.ptr <= dest.ptr && src.ptr + len > dest.ptr)
||(src.ptr >= dest.ptr && src.ptr < dest.ptr + len)){
if( destPos < srcPos ){
for(int i=0; i<len; ++i){
dest[destPos+i] = cast(T)src[srcPos+i];
}
}
else{
for(int i=len-1; i>=0; --i){
dest[destPos+i] = cast(T)src[srcPos+i];
}
}
}else{
dest[destPos..(len+destPos)] = cast(T[])src[srcPos..(len+srcPos)];
}
}
static long currentTimeMillis(){
version(Tango) return tango.time.Clock.Clock.now().ticks() / 10000;
else return std.datetime.Clock.currStdTime() / 10000;
}
static void exit( int code ){
version(Tango) tango.stdc.stdlib.exit(code);
else std.c.stdlib.exit(code);
}
public static int identityHashCode(Object x){
if( x is null ){
return 0;
}
return (*cast(Object *)&x).toHash();
}
public static String getProperty( String key, String defval ){
String res = getProperty(key);
if( res ){
return res;
}
return defval;
}
public static String getProperty( String key ){
/* Get values for local org.eclipse.swt specific keys */
String* p;
if (key[0..3] == "org.eclipse.swt") {
return ((p = key in localProperties) != null) ? *p : null;
/* else get values for global system keys (environment) */
} else {
switch( key ){
case "os.name": return "linux";
case "user.name": return "";
case "user.home": return "";
case "user.dir" : return "";
case "file.separator" :
version(Tango) return tango.io.model.IFile.FileConst.PathSeparatorString ;
else return std.path.dirSeparator;
default: return null;
}
}
}
public static void setProperty ( String key, String value ) {
/* set property for local org.eclipse.swt keys */
if (key[0..3] == "org.eclipse.swt") {
if (key !is null && value !is null)
localProperties[ key ] = value;
/* else set properties for global system keys (environment) */
} else {
}
}
private static PrintStream err__;
public static PrintStream err(){
if( err__ is null ){
err__ = new PrintStream(null);
}
return err__;
}
private static PrintStream out__;
public static PrintStream out_(){
if( out__ is null ){
out__ = new PrintStream(null);
}
return out__;
}
private static String[String] localProperties;
}
|
D
|
man with strong sexual desires
one of a class of woodland deities
|
D
|
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Port to the D programming language:
* Bill Baxter
*******************************************************************************/
module coolbar.Snippet140;
/*
* CoolBar example snippet: drop-down a chevron menu containing hidden tool items
*
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
*/
import dwt.DWT;
import dwt.graphics.Point;
import dwt.graphics.Rectangle;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import dwt.widgets.Menu;
import dwt.widgets.MenuItem;
import dwt.widgets.ToolBar;
import dwt.widgets.ToolItem;
import dwt.widgets.CoolBar;
import dwt.widgets.CoolItem;
import dwt.events.SelectionEvent;
import dwt.events.SelectionAdapter;
import dwt.layout.GridLayout;
import dwt.layout.GridData;
import tango.util.Convert;
static Display display;
static Shell shell;
static CoolBar coolBar;
static Menu chevronMenu = null;
void main () {
display = new Display ();
shell = new Shell (display);
shell.setLayout(new GridLayout());
coolBar = new CoolBar(shell, DWT.FLAT | DWT.BORDER);
coolBar.setLayoutData(new GridData(GridData.FILL_BOTH));
ToolBar toolBar = new ToolBar(coolBar, DWT.FLAT | DWT.WRAP);
int minWidth = 0;
for (int j = 0; j < 5; j++) {
int width = 0;
ToolItem item = new ToolItem(toolBar, DWT.PUSH);
item.setText("B" ~ to!(char[])(j));
width = item.getWidth();
/* find the width of the widest tool */
if (width > minWidth) minWidth = width;
}
CoolItem coolItem = new CoolItem(coolBar, DWT.DROP_DOWN);
coolItem.setControl(toolBar);
Point size = toolBar.computeSize(DWT.DEFAULT, DWT.DEFAULT);
Point coolSize = coolItem.computeSize (size.x, size.y);
coolItem.setMinimumSize(minWidth, coolSize.y);
coolItem.setPreferredSize(coolSize);
coolItem.setSize(coolSize);
coolItem.addSelectionListener(new class() SelectionAdapter {
public void widgetSelected(SelectionEvent event) {
if (event.detail == DWT.ARROW) {
CoolItem item = cast(CoolItem) event.widget;
Rectangle itemBounds = item.getBounds ();
Point pt = coolBar.toDisplay(new Point(itemBounds.x, itemBounds.y));
itemBounds.x = pt.x;
itemBounds.y = pt.y;
ToolBar bar = cast(ToolBar) item.getControl ();
ToolItem[] tools = bar.getItems ();
int i = 0;
while (i < tools.length) {
Rectangle toolBounds = tools[i].getBounds ();
pt = bar.toDisplay(new Point(toolBounds.x, toolBounds.y));
toolBounds.x = pt.x;
toolBounds.y = pt.y;
/* Figure out the visible portion of the tool by looking at the
* intersection of the tool bounds with the cool item bounds.
*/
Rectangle intersection = itemBounds.intersection (toolBounds);
/* If the tool is not completely within the cool item bounds, then it
* is partially hidden, and all remaining tools are completely hidden.
*/
if (intersection != toolBounds) break;
i++;
}
/* Create a menu with items for each of the completely hidden buttons. */
if (chevronMenu !is null) chevronMenu.dispose();
chevronMenu = new Menu (coolBar);
for (int j = i; j < tools.length; j++) {
MenuItem menuItem = new MenuItem (chevronMenu, DWT.PUSH);
menuItem.setText (tools[j].getText());
}
/* Drop down the menu below the chevron, with the left edges aligned. */
pt = coolBar.toDisplay(new Point(event.x, event.y));
chevronMenu.setLocation (pt.x, pt.y);
chevronMenu.setVisible (true);
}
}
});
shell.pack();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
|
D
|
/**
Abstract representation of a package description file.
Copyright: © 2012-2014 rejectedsoftware e.K.
License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Authors: Sönke Ludwig, Matthias Dondorff
*/
module dub.recipe.packagerecipe;
import dub.compilers.compiler;
import dub.compilers.utils : warnOnSpecialCompilerFlags;
import dub.dependency;
import dub.internal.vibecompat.core.file;
import dub.internal.vibecompat.core.log;
import dub.internal.vibecompat.inet.url;
import std.algorithm : findSplit, sort;
import std.array : join, split;
import std.exception : enforce;
import std.file;
import std.range;
import std.process : environment;
/**
Returns the individual parts of a qualified package name.
Sub qualified package names are lists of package names separated by ":". For
example, "packa:packb:packc" references a package named "packc" that is a
sub package of "packb", which in turn is a sub package of "packa".
*/
string[] getSubPackagePath(string package_name) @safe pure
{
return package_name.split(":");
}
/**
Returns the name of the top level package for a given (sub) package name.
In case of a top level package, the qualified name is returned unmodified.
*/
string getBasePackageName(string package_name) @safe pure
{
return package_name.findSplit(":")[0];
}
/**
Returns the qualified sub package part of the given package name.
This is the part of the package name excluding the base package
name. See also $(D getBasePackageName).
*/
string getSubPackageName(string package_name) @safe pure
{
return package_name.findSplit(":")[2];
}
@safe unittest
{
assert(getSubPackagePath("packa:packb:packc") == ["packa", "packb", "packc"]);
assert(getSubPackagePath("pack") == ["pack"]);
assert(getBasePackageName("packa:packb:packc") == "packa");
assert(getBasePackageName("pack") == "pack");
assert(getSubPackageName("packa:packb:packc") == "packb:packc");
assert(getSubPackageName("pack") == "");
}
/**
Represents the contents of a package recipe file (dub.json/dub.sdl) in an abstract way.
This structure is used to reason about package descriptions in isolation.
For higher level package handling, see the $(D Package) class.
*/
struct PackageRecipe {
string name;
string version_;
string description;
string homepage;
string[] authors;
string copyright;
string license;
string[] ddoxFilterArgs;
string ddoxTool;
BuildSettingsTemplate buildSettings;
ConfigurationInfo[] configurations;
BuildSettingsTemplate[string] buildTypes;
SubPackage[] subPackages;
inout(ConfigurationInfo) getConfiguration(string name)
inout {
foreach (c; configurations)
if (c.name == name)
return c;
throw new Exception("Unknown configuration: "~name);
}
/** Clones the package recipe recursively.
*/
PackageRecipe clone() const { return .clone(this); }
}
struct SubPackage
{
string path;
PackageRecipe recipe;
}
/// Bundles information about a build configuration.
struct ConfigurationInfo {
string name;
string[] platforms;
BuildSettingsTemplate buildSettings;
this(string name, BuildSettingsTemplate build_settings)
{
enforce(!name.empty, "Configuration name is empty.");
this.name = name;
this.buildSettings = build_settings;
}
bool matchesPlatform(in BuildPlatform platform)
const {
if( platforms.empty ) return true;
foreach(p; platforms)
if( platform.matchesSpecification("-"~p) )
return true;
return false;
}
}
/// This keeps general information about how to build a package.
/// It contains functions to create a specific BuildSetting, targeted at
/// a certain BuildPlatform.
struct BuildSettingsTemplate {
Dependency[string] dependencies;
string systemDependencies;
TargetType targetType = TargetType.autodetect;
string targetPath;
string targetName;
string workingDirectory;
string mainSourceFile;
string[string] subConfigurations;
string[][string] dflags;
string[][string] lflags;
string[][string] libs;
string[][string] sourceFiles;
string[][string] sourcePaths;
string[][string] excludedSourceFiles;
string[][string] copyFiles;
string[][string] versions;
string[][string] debugVersions;
string[][string] importPaths;
string[][string] stringImportPaths;
string[][string] preGenerateCommands;
string[][string] postGenerateCommands;
string[][string] preBuildCommands;
string[][string] postBuildCommands;
BuildRequirements[string] buildRequirements;
BuildOptions[string] buildOptions;
/// Constructs a BuildSettings object from this template.
void getPlatformSettings(ref BuildSettings dst, in BuildPlatform platform, NativePath base_path)
const {
dst.targetType = this.targetType;
if (!this.targetPath.empty) dst.targetPath = this.targetPath;
if (!this.targetName.empty) dst.targetName = this.targetName;
if (!this.workingDirectory.empty) dst.workingDirectory = this.workingDirectory;
if (!this.mainSourceFile.empty) {
auto p = NativePath(this.mainSourceFile);
p.normalize();
dst.mainSourceFile = p.toNativeString();
dst.addSourceFiles(dst.mainSourceFile);
}
string[] collectFiles(in string[][string] paths_map, string pattern)
{
auto files = appender!(string[]);
import dub.project : buildSettingsVars;
auto envVars = environment.toAA();
foreach (suffix, paths; paths_map) {
if (!platform.matchesSpecification(suffix))
continue;
foreach (spath; paths) {
enforce(!spath.empty, "Paths must not be empty strings.");
auto path = NativePath(spath);
if (!path.absolute) path = base_path ~ path;
if (!existsFile(path) || !isDir(path.toNativeString())) {
import std.algorithm : any, find;
const hasVar = chain(buildSettingsVars, envVars.byKey).any!((string var) {
return spath.find("$"~var).length > 0 || spath.find("${"~var~"}").length > 0;
});
if (!hasVar)
logWarn("Invalid source/import path: %s", path.toNativeString());
continue;
}
foreach (d; dirEntries(path.toNativeString(), pattern, SpanMode.depth)) {
import std.path : baseName;
if (baseName(d.name)[0] == '.' || d.isDir) continue;
auto src = NativePath(d.name).relativeTo(base_path);
files ~= src.toNativeString();
}
}
}
return files.data;
}
// collect source files
dst.addSourceFiles(collectFiles(sourcePaths, "*.d"));
auto sourceFiles = dst.sourceFiles.sort();
// collect import files and remove sources
import std.algorithm : copy, setDifference;
auto importFiles = collectFiles(importPaths, "*.{d,di}").sort();
immutable nremoved = importFiles.setDifference(sourceFiles).copy(importFiles.release).length;
importFiles = importFiles[0 .. $ - nremoved];
dst.addImportFiles(importFiles.release);
dst.addStringImportFiles(collectFiles(stringImportPaths, "*"));
getPlatformSetting!("dflags", "addDFlags")(dst, platform);
getPlatformSetting!("lflags", "addLFlags")(dst, platform);
getPlatformSetting!("libs", "addLibs")(dst, platform);
getPlatformSetting!("sourceFiles", "addSourceFiles")(dst, platform);
getPlatformSetting!("excludedSourceFiles", "removeSourceFiles")(dst, platform);
getPlatformSetting!("copyFiles", "addCopyFiles")(dst, platform);
getPlatformSetting!("versions", "addVersions")(dst, platform);
getPlatformSetting!("debugVersions", "addDebugVersions")(dst, platform);
getPlatformSetting!("importPaths", "addImportPaths")(dst, platform);
getPlatformSetting!("stringImportPaths", "addStringImportPaths")(dst, platform);
getPlatformSetting!("preGenerateCommands", "addPreGenerateCommands")(dst, platform);
getPlatformSetting!("postGenerateCommands", "addPostGenerateCommands")(dst, platform);
getPlatformSetting!("preBuildCommands", "addPreBuildCommands")(dst, platform);
getPlatformSetting!("postBuildCommands", "addPostBuildCommands")(dst, platform);
getPlatformSetting!("buildRequirements", "addRequirements")(dst, platform);
getPlatformSetting!("buildOptions", "addOptions")(dst, platform);
}
void getPlatformSetting(string name, string addname)(ref BuildSettings dst, in BuildPlatform platform)
const {
foreach(suffix, values; __traits(getMember, this, name)){
if( platform.matchesSpecification(suffix) )
__traits(getMember, dst, addname)(values);
}
}
void warnOnSpecialCompilerFlags(string package_name, string config_name)
{
auto nodef = false;
auto noprop = false;
foreach (req; this.buildRequirements) {
if (req & BuildRequirement.noDefaultFlags) nodef = true;
if (req & BuildRequirement.relaxProperties) noprop = true;
}
if (noprop) {
logWarn(`Warning: "buildRequirements": ["relaxProperties"] is deprecated and is now the default behavior. Note that the -property switch will probably be removed in future versions of DMD.`);
logWarn("");
}
if (nodef) {
logWarn("Warning: This package uses the \"noDefaultFlags\" build requirement. Please use only for development purposes and not for released packages.");
logWarn("");
} else {
string[] all_dflags;
BuildOptions all_options;
foreach (flags; this.dflags) all_dflags ~= flags;
foreach (options; this.buildOptions) all_options |= options;
.warnOnSpecialCompilerFlags(all_dflags, all_options, package_name, config_name);
}
}
}
private T clone(T)(ref const(T) val)
{
import std.traits : isSomeString, isDynamicArray, isAssociativeArray, isBasicType, ValueType;
static if (is(T == immutable)) return val;
else static if (isBasicType!T) return val;
else static if (isDynamicArray!T) {
alias V = typeof(T.init[0]);
static if (is(V == immutable)) return val;
else {
T ret = new V[val.length];
foreach (i, ref f; val)
ret[i] = clone!V(f);
return ret;
}
} else static if (isAssociativeArray!T) {
alias V = ValueType!T;
T ret;
foreach (k, ref f; val)
ret[k] = clone!V(f);
return ret;
} else static if (is(T == struct)) {
T ret;
foreach (i, M; typeof(T.tupleof))
ret.tupleof[i] = clone!M(val.tupleof[i]);
return ret;
} else static assert(false, "Unsupported type: "~T.stringof);
}
unittest { // issue #1407 - duplicate main source file
{
BuildSettingsTemplate t;
t.mainSourceFile = "./foo.d";
t.sourceFiles[""] = ["foo.d"];
BuildSettings bs;
t.getPlatformSettings(bs, BuildPlatform.init, NativePath("/"));
assert(bs.sourceFiles == ["foo.d"]);
}
version (Windows) {{
BuildSettingsTemplate t;
t.mainSourceFile = "src/foo.d";
t.sourceFiles[""] = ["src\\foo.d"];
BuildSettings bs;
t.getPlatformSettings(bs, BuildPlatform.init, NativePath("/"));
assert(bs.sourceFiles == ["src\\foo.d"]);
}}
}
|
D
|
/*
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module hunt.stomp.support.GenericMessage;
import hunt.stomp.Message;
import hunt.stomp.MessageHeaders;
import hunt.collection.Map;
import hunt.text.Common;
import hunt.text.StringBuilder;
import hunt.util.ObjectUtils;
/**
* An implementation of {@link Message} with a generic payload.
* Once created, a GenericMessage is immutable.
*
* @author Mark Fisher
* @since 4.0
* @param (T) the payload type
* @see MessageBuilder
*/
class GenericMessage(T) : Message!(T) {
private T payload;
private MessageHeaders headers;
/**
* Create a new message with the given payload.
* @param payload the message payload (never {@code null})
*/
this(T payload) {
this(payload, new MessageHeaders(null));
}
/**
* Create a new message with the given payload and headers.
* The content of the given header map is copied.
* @param payload the message payload (never {@code null})
* @param headers message headers to use for initialization
*/
this(T payload, Map!(string, Object) headers) {
this(payload, new MessageHeaders(headers));
}
/**
* A constructor with the {@link MessageHeaders} instance to use.
* <p><strong>Note:</strong> the given {@code MessageHeaders} instance is used
* directly in the new message, i.e. it is not copied.
* @param payload the message payload (never {@code null})
* @param headers message headers
*/
this(T payload, MessageHeaders headers) {
// assert(payload, "Payload must not be null");
assert(headers, "MessageHeaders must not be null");
this.payload = payload;
this.headers = headers;
}
TypeInfo payloadType() {
return typeid(T);
}
T getPayload() {
return this.payload;
}
MessageHeaders getHeaders() {
return this.headers;
}
override bool opEquals(Object other) {
if (this is other) {
return true;
}
GenericMessage!T otherMsg = cast(GenericMessage!T) other;
if (otherMsg is null) {
return false;
}
return this.payload == otherMsg.payload && this.headers == otherMsg.headers;
}
override size_t toHash() @trusted nothrow {
// Using nullSafeHashCode for proper array toHash handling
return hashOf(this.payload) * 23 + this.headers.toHash();
}
override string toString() {
StringBuilder sb = new StringBuilder(typeid(this).name);
sb.append(" [payload=");
static if(is(T == class)) {
sb.append(this.payload.toString());
} else static if(is(T == interface)) {
sb.append((cast(Object)this.payload).toString());
} else {
sb.append("byte[").append((cast(byte[]) this.payload).length).append("]");
}
// static if(is(T == byte[])) {
// sb.append("byte[").append((cast(byte[]) this.payload).length).append("]");
// } else {
// sb.append(this.payload.toString());
// }
sb.append(", headers=").append(this.headers.toString()).append("]");
return sb.toString();
}
}
|
D
|
auto str = "hello"; // UTF-8
auto str2 = "hello"c; // UTF-8
auto str3 = "hello"w; // UTF-16
auto str4 = "hello"d; // UTF-32
|
D
|
/home/ghasshee/Programs/hs/Haskell/Parser/satun/06/Rust/target/release/deps/assembler-ab8aa4f59b49a176: src/main.rs
/home/ghasshee/Programs/hs/Haskell/Parser/satun/06/Rust/target/release/deps/assembler-ab8aa4f59b49a176.d: src/main.rs
src/main.rs:
|
D
|
import std.conv;
import std.algorithm: canFind;
import std.array;
import std.stdio;
final class BasicBlock {
BasicBlock[] inEdges;
BasicBlock[] outEdges;
int name;
this(int _name) pure @safe { name = _name; }
}
struct BasicBlockEdge {
BasicBlock from;
BasicBlock to;
@safe pure:
this(CFG cfg, int fromName, int toName) {
from = cfg.createNode(fromName);
to = cfg.createNode(toName);
from.outEdges ~= to;
to.inEdges ~= from;
cfg.addEdge(this);
}
}
final class CFG {
BasicBlock[int] basicBlockMap;
BasicBlockEdge[] edgeList;
BasicBlock startNode;
pure @safe:
BasicBlock createNode(int name) {
BasicBlock node = basicBlockMap.get(name, null);
if (node is null) {
node = new BasicBlock(name);
basicBlockMap[name] = node;
}
if (startNode is null) startNode = node;
return node;
}
void addEdge(BasicBlockEdge edge) { edgeList ~= edge; }
int getNumNodes() { return to!int(basicBlockMap.length); }
}
final class SimpleLoop {
bool[BasicBlock] basicBlocks;
bool[SimpleLoop] children;
bool isRoot;
bool isReducible;
int counter;
int nestingLevel;
int depthLevel;
SimpleLoop parent;
BasicBlock header;
pure @safe:
this() {
parent = null;
header = null;
counter = 0;
depthLevel = 0;
nestingLevel = 0;
isRoot = false;
isReducible = true;
}
void addNode(BasicBlock bb) { basicBlocks[bb] = true; }
void addChildLoop(SimpleLoop loop) { children[loop] = true; }
void setParent(SimpleLoop p) {
parent = p;
parent.addChildLoop(this);
}
void setHeader(BasicBlock bb) {
basicBlocks[bb] = true;
header = bb;
}
void setNestingLevel(int level) {
nestingLevel = level;
if (level == 0) isRoot = true;
}
}
static int loopCounter = 0;
final class LSG {
SimpleLoop[] loops;
SimpleLoop root;
@safe:
this() {
root = createNewLoop();
root.setNestingLevel(0);
addLoop(root);
}
SimpleLoop createNewLoop() {
SimpleLoop s = new SimpleLoop;
loopCounter += 1;
s.counter = loopCounter;
return s;
}
@safe pure:
void addLoop(SimpleLoop loop) { loops ~= loop; }
int getNumLoops() { return to!int(loops.length); }
}
class UnionFindNode {
UnionFindNode parent;
BasicBlock bb;
SimpleLoop loop;
int dfsNumber;
UnionFindNode findSet() {
UnionFindNode[] nodeList;
UnionFindNode node = this;
while (node != node.parent) {
parent = node.parent;
if (parent != parent.parent) { nodeList ~= node; }
node = parent;
}
foreach(iter; nodeList) { iter.parent = node.parent; }
return node;
}
@safe pure nothrow:
this() {
bb = null;
parent = null;
loop = null;
dfsNumber = 0;
}
void initNode(BasicBlock _bb, int dfs) {
parent = this;
bb = _bb;
dfsNumber = dfs;
}
void union_parent(UnionFindNode ufn) {
parent = ufn;
}
}
final class HavlakLoopFinder {
CFG cfg;
LSG lsg;
enum UNVISITED = -1;
enum BB_TOP = 0;
enum BB_NONHEADER = 1;
enum BB_REDUCIBLE = 2;
enum BB_SELF = 3;
enum BB_IRREDUCIBLE = 4;
enum BB_DEAD = 5;
enum BB_LAST = 6;
enum MAXNONBACKPREDS = (32 * 1024);
pure nothrow
{
this(CFG _cfg, LSG _lsg) {
cfg = _cfg;
lsg = _lsg;
}
bool isAncestor(int w, int v, int[] last) {
return (w <= v) && (v <= last[w]);
}
int DSF(BasicBlock currentNode, UnionFindNode[] nodes, int[BasicBlock] number, int []last, int current) {
nodes[current].initNode(currentNode, current);
number[currentNode] = current;
int lastid = current;
foreach(target; currentNode.outEdges) {
if (number[target] == UNVISITED) {
lastid = DSF(target, nodes, number, last, lastid + 1);
}
}
last[number[currentNode]] = lastid;
return lastid;
}
}
int findLoops() {
BasicBlock startNode = cfg.startNode;
if (!startNode) return 0;
int size = cfg.getNumNodes();
bool[int][] non_back_preds;
int[][] back_preds;
int[] header;
int[] types;
int[] last;
UnionFindNode[] nodes;
int[BasicBlock] number;
foreach (_; 0..size) {
bool[int] newset;
non_back_preds ~= newset;
int[] newarr;
back_preds ~= newarr;
header ~= 0;
types ~= 0;
last ~= 0;
nodes ~= new UnionFindNode();
}
foreach( k, v; cfg.basicBlockMap) { number[v] = UNVISITED; }
DSF(startNode, nodes, number, last, 0);
foreach (w; 0..size) {
header[w] = 0;
types[w] = BB_NONHEADER;
auto nodeW = nodes[w].bb;
if (nodeW) {
foreach (nodeV; nodeW.inEdges) {
auto v = number[nodeV];
if (v != UNVISITED) {
if (isAncestor(w, v, last)) {
back_preds[w] ~= v;
} else {
non_back_preds[w][v] = true;
}
}
}
} else {
types[w] = BB_DEAD;
}
}
header[0] = 0;
foreach_reverse (w; 0 .. size) {
UnionFindNode[] nodePool;
auto nodeW = nodes[w].bb;
if (nodeW) {
foreach(v; back_preds[w]) {
if (v != w)
nodePool ~= nodes[v].findSet;
else
types[w] = BB_SELF;
}
auto workList = nodePool.dup;
if (nodePool.length != 0) types[w] = BB_REDUCIBLE;
while (!workList.empty) {
auto x = workList[0];
workList.popFront();
auto nonBackSize = non_back_preds[x.dfsNumber].length;
if (nonBackSize > MAXNONBACKPREDS) return 0;
foreach(iter; non_back_preds[x.dfsNumber]) {
auto y = nodes[iter];
auto ydash = y.findSet;
if (!isAncestor(w, ydash.dfsNumber, last)) {
types[w] = BB_IRREDUCIBLE;
non_back_preds[w][ydash.dfsNumber] = true;
} else {
if (ydash.dfsNumber != w && !nodePool.canFind(ydash)) {
workList ~= ydash;
nodePool ~= ydash;
}
}
}
}
if ((nodePool.length > 0) || (types[w] == BB_SELF)) {
auto loop = lsg.createNewLoop;
loop.setHeader(nodeW);
loop.isReducible = (types[w] != BB_IRREDUCIBLE);
nodes[w].loop = loop;
foreach(node; nodePool) {
header[node.dfsNumber] = w;
node.union_parent(nodes[w]);
if (node.loop) node.loop.setParent(loop); else loop.addNode(node.bb);
}
lsg.addLoop(loop);
}
}
}
return lsg.getNumLoops();
}
}
int findHavlakLoops(CFG cfg, LSG lsg)
{
scope h = new HavlakLoopFinder(cfg, lsg);
return h.findLoops();
}
int findHavlakLoops(CFG cfg)
{
scope lsg = new LSG();
return findHavlakLoops(cfg, lsg);
}
final class LoopTesterApp {
CFG cfg;
LSG lsg;
this() @safe {
cfg = new CFG();
lsg = new LSG();
}
@safe pure
{
int buildDiamond(int start) {
int bb0 = start;
new BasicBlockEdge(cfg, bb0, bb0 + 1);
new BasicBlockEdge(cfg, bb0, bb0 + 2);
new BasicBlockEdge(cfg, bb0 + 1, bb0 + 3);
new BasicBlockEdge(cfg, bb0 + 2, bb0 + 3);
return bb0 + 3;
}
void buildConnect(int _start, int _end) {
new BasicBlockEdge(cfg, _start, _end);
}
int buildStraight(int start, int n) {
foreach(i; 0..n) {
buildConnect(start + i, start + i + 1);
}
return start + n;
}
int buildBaseLoop(int from) {
auto header = buildStraight(from, 1);
auto diamond1 = buildDiamond(header);
auto d11 = buildStraight(diamond1, 1);
auto diamond2 = buildDiamond(d11);
auto footer = buildStraight(diamond2, 1);
buildConnect(diamond2, d11);
buildConnect(diamond1, header);
buildConnect(footer, from);
return buildStraight(footer, 1);
}
}
void run() {
cfg.createNode(0);
buildBaseLoop(0);
cfg.createNode(1);
buildConnect(0, 2);
foreach(_; 0..15000) findHavlakLoops(cfg);
int n = 2;
foreach(parlooptrees; 0..10) {
cfg.createNode(n + 1);
buildConnect(2, n + 1);
n = n + 1;
foreach(i; 0..100) {
int top = n;
n = buildStraight(n, 1);
foreach(_; 0..25) { n = buildBaseLoop(n); }
int bottom = buildStraight(n, 1);
buildConnect(n, top);
n = bottom;
}
buildConnect(n, 1);
}
int loops = findHavlakLoops(cfg);
int sum = 0;
foreach (_; 0..50) {
write(".");
stdout.flush();
sum += findHavlakLoops(cfg);
}
writefln("\nFound %d loops (including artificial root node) (%d)", loops, sum);
}
}
int main() {
auto l = new LoopTesterApp();
l.run();
return 0;
}
|
D
|
// Copyright 2009 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Original author: ericv@google.com (Eric Veach)
// Converted to D: madric@gmail.com (Vijay Nayar)
module s2.util.math.exactfloat;
// ExactFloat is a multiple-precision floating point type based on the OpenSSL
// Bignum library. It has the same interface as the built-in "float" and
// "double" types, but only supports the subset of operators and intrinsics
// where it is possible to compute the result exactly. So for example,
// ExactFloat supports addition and multiplication but not division (since in
// general, the quotient of two floating-point numbers cannot be represented
// exactly). Exact arithmetic is useful for geometric algorithms, especially
// for disambiguating cases where ordinary double-precision arithmetic yields
// an uncertain result.
//
// ExactFloat is a subset of the faster and more capable MPFloat class (which
// is based on the GNU MPFR library). The main reason to use this class
// rather than MPFloat is that it is subject to a BSD-style license rather
// than the much more restrictive LGPL license.
//
// It has the following features:
//
// - ExactFloat uses the same syntax as the built-in "float" and "double"
// types, for example: x += 4 + fabs(2*y*y - z*z). There are a few
// differences (see below), but the syntax is compatible enough so that
// ExactFloat can be used as a template argument to templatized classes
// such as Vector2, VectorN, Matrix3x3, etc.
//
// - Results are not rounded; instead, precision is increased so that the
// result can be represented exactly. An inexact result is returned only
// in the case of underflow or overflow (yielding signed zero or infinity
// respectively), or if the maximum allowed precision is exceeded (yielding
// NaN). ExactFloat uses IEEE 754-2008 rules for handling infinities, NaN,
// rounding to integers, etc.
//
// - ExactFloat only supports calculations where the result can be
// represented exactly. Therefore it supports intrinsics such as fabs()
// but not transcendentals such as sin(), sqrt(), etc.
//
// Syntax Compatibility with "float" and "double"
// ----------------------------------------------
//
// ExactFloat supports a subset of the operators and intrinsics for the
// built-in "double" type. (Thus it supports fabs() but not fabsf(), for
// example.) The syntax is different only in the following cases:
//
// - Casts and implicit conversions to built-in types (including "bool") are
// not supported. So for example, the following will not compile:
//
// ExactFloat x = 7.5;
// double y = x; // ERROR: use x.ToDouble() instead
// long z = x; // ERROR: use x.ToDouble() or lround(trunc(x))
// q = static_cast<int>(x); // ERROR: use x.ToDouble() or lround(trunc(x))
// if (x) { ... } // ERROR: use (x != 0) instead
//
// - The glibc floating-point classification macros (fpclassify, isfinite,
// isnormal, isnan, isinf) are not supported. Instead there are
// zero-argument methods:
//
// ExactFloat x;
// if (isnan(x)) { ... } // ERROR: use (x.is_nan()) instead
// if (isinf(x)) { ... } // ERROR: use (x.is_inf()) instead
//
// Using ExactFloat with Vector3, etc.
// -----------------------------------
//
// ExactFloat can be used with templatized classes such as Vector2 and Vector3
// (see "util/math/vector.h"), with the following limitations:
//
// - Cast() can be used to convert other vector types to an ExactFloat vector
// type, but not the other way around. This is because there are no
// implicit conversions from ExactFloat to built-in types. You can work
// around this by calling an explicit conversion method such as
// ToDouble(). For example:
//
// typedef Vector3<ExactFloat> Vector3_xf;
// Vector3_xf x;
// Vector3_d y;
// x = Vector3_xf::Cast(y); // This works.
// y = Vector3_d::Cast(x); // This doesn't.
// y = Vector3_d(x[0].ToDouble(), x[1].ToDouble(), x[2].ToDouble()); // OK
//
// - IsNaN() is not supported because it calls isnan(), which is defined as a
// macro in <math.h> and therefore can't easily be overrided.
//
// Precision Semantics
// -------------------
//
// Unlike MPFloat, ExactFloat does not allow a maximum precision to be
// specified (it is always unbounded). Therefore it does not have any of the
// corresponding constructors.
//
// The current precision of an ExactFloat (i.e., the number of bits in its
// mantissa) is returned by prec(). The precision is increased as necessary
// so that the result of every operation can be represented exactly.
import algorithm = std.algorithm;
import format = std.format;
import math = std.math;
import s2.util.hash.mix;
import std.bigint;
import std.range;
import traits = std.traits;
struct ExactFloat {
public:
// The following limits are imposed by OpenSSL.
// The maximum exponent supported. If a value has an exponent larger than
// this, it is replaced by infinity (with the appropriate sign).
static immutable int MAX_EXP = 200*1000*1000; // About 10**(60 million)
// The minimum exponent supported. If a value has an exponent less than
// this, it is replaced by zero (with the appropriate sign).
static immutable int MIN_EXP = -MAX_EXP; // About 10**(-60 million)
// The maximum number of mantissa bits supported. If a value has more
// mantissa bits than this, it is replaced with NaN. (It is expected that
// users of this class will never want this much precision.)
static immutable int MAX_PREC = 64 << 20; // About 20 million digits
// Rounding modes. kRoundTiesToEven and kRoundTiesAwayFromZero both round
// to the nearest representable value unless two values are equally close.
// In that case kRoundTiesToEven rounds to the nearest even value, while
// kRoundTiesAwayFromZero always rounds away from zero.
enum RoundingMode {
ROUND_TIES_TO_EVEN,
ROUND_TIES_AWAY_FROM_ZERO,
ROUND_TOWARD_ZERO,
ROUND_AWAY_FROM_ZERO,
ROUND_TOWARD_POSITIVE,
ROUND_TOWARD_NEGATIVE
}
/////////////////////////////////////////////////////////////////////////////
// Constructors
// Copy constructor.
this(in ExactFloat b) {
_sign = b._sign;
_bnExp = b._bnExp;
_bn = b._bn;
}
this(T)(T v) {
this = v;
}
// Construct an ExactFloat from a "double". The constructor is implicit so
// that this class can be used as a replacement for "float" or "double" in
// templatized libraries. (With an explicit constructor, code such as
// "ExactFloat f = 2.5;" would not compile.) All double-precision values are
// supported, including denormalized numbers, infinities, and NaNs.
void opAssign(T)(T v)
if (traits.isFloatingPoint!T) {
_bn = BigInt();
_sign = math.signbit(v) ? -1 : 1;
if (math.isNaN(v)) {
setNan();
} else if (math.isInfinity(v)) {
setInf(_sign);
} else {
// The following code is much simpler than messing about with bit masks,
// has the advantage of handling denormalized numbers and zero correctly,
// and is actually quite efficient (at least compared to the rest of this
// code). "f" is a fraction in the range [0.5, 1), so if we shift it left
// by the number of mantissa bits in a double (53, including the leading
// "1") then the result is always an integer.
int exp;
T f = math.frexp(math.fabs(v), exp);
_bn = cast(ulong) math.ldexp(f, DOUBLE_MANTISSA_BITS);
_bnExp = exp - DOUBLE_MANTISSA_BITS;
canonicalize();
}
}
// Construct an ExactFloat from an "int". Note that in general, ints are
// automatically converted to doubles and so would be handled by the
// constructor above. However, the particular argument (0) would be
// ambiguous; the compiler wouldn't know whether to treat it as a "double" or
// "const char*" (since 0 is a valid null pointer constant). Adding an "int"
// constructor solves this problem.
//
// We do not provide constructors for "unsigned", "long", "unsigned long",
// "long long", or "unsigned long long", since these types are not typically
// used in floating-point calculations and it is safer to require them to be
// explicitly cast.
void opAssign(T)(T v)
if (traits.isIntegral!T) {
_sign = (v >= 0) ? 1 : -1;
_bn = math.abs(v);
_bnExp = 0;
canonicalize();
}
// Construct an ExactFloat from a string (such as "1.2e50"). Requires that
// the value is exactly representable as a floating-point number (so for
// example, "0.125" is allowed but "0.1" is not).
void opAssign(T)(T s)
if (traits.isSomeString!T) {
ExactFloat.unimplemented();
}
/////////////////////////////////////////////////////////////////////
// Constants
//
// As an alternative to the constants below, you can also just use the
// constants defined in <math.h>, for example:
//
// ExactFloat x = NAN, y = -INFINITY;
// Return an ExactFloat equal to positive zero (if sign >= 0) or
// negative zero (if sign < 0).
static ExactFloat signedZero(int sign) {
ExactFloat r;
r.setZero(sign);
return r;
}
// Return an ExactFloat equal to positive infinity (if sign >= 0) or
// negative infinity (if sign < 0).
static ExactFloat infinity(int sign) {
ExactFloat r;
r.setInf(sign);
return r;
}
// Return an ExactFloat that is NaN (Not-a-Number).
static ExactFloat nan() {
ExactFloat r;
r.setNan();
return r;
}
/////////////////////////////////////////////////////////////////////////////
// Accessor Methods
// Return the maximum precision of the ExactFloat. This method exists only
// for compatibility with MPFloat.
@property
int maxPrec() const {
return MAX_PREC;
}
// Return the actual precision of this ExactFloat (the current number of
// bits in its mantissa). Returns 0 for non-normal numbers such as NaN.
@property
int prec() const {
// TODO: BUG Fix this to get the exact number of used bits.
int totalBits = cast(int) (_bn.uintLength() - 1) * 32;
uint lastDigit = _bn.getDigit!uint(_bn.uintLength() - 1);
while (lastDigit != 0) {
lastDigit >>= 1;
totalBits++;
}
return totalBits;
}
// Return the exponent of this ExactFloat given that the mantissa is in the
// range [0.5, 1). It is an error to call this method if the value is zero,
// infinity, or NaN.
int exp() const
in {
assert(isNormal());
} do {
return _bnExp + prec();
}
// Set the value of the ExactFloat to +0 (if sign >= 0) or -0 (if sign < 0).
void setZero(int sign) {
_sign = sign;
_bnExp = EXP_ZERO;
if (_bn != 0) {
_bn = 0;
}
}
// Set the value of the ExactFloat to positive infinity (if sign >= 0) or
// negative infinity (if sign < 0).
void setInf(int sign) {
_sign = sign;
_bnExp = EXP_INFINITY;
if (_bn != 0) {
_bn = 0;
}
}
// Set the value of the ExactFloat to NaN (Not-a-Number).
void setNan() {
_sign = 1;
_bnExp = EXP_NAN;
if (_bn != 0) {
_bn = 0;
}
}
// Unfortunately, isinf(x), isnan(x), isnormal(x), and isfinite(x) are
// defined as macros in <math.h>. Therefore we can't easily extend them
// here. Instead we provide methods with underscores in their names that do
// the same thing: x.is_inf(), etc.
//
// These macros are not implemented: signbit(x), fpclassify(x).
// Return true if this value is zero (including negative zero).
bool isZero() const {
return _bnExp == EXP_ZERO;
}
// Return true if this value is infinity (positive or negative).
bool isInf() const {
return _bnExp == EXP_INFINITY;
}
// Return true if this value is NaN (Not-a-Number).
bool isNan() const {
return _bnExp == EXP_NAN;
}
// Return true if this value is a normal floating-point number. Non-normal
// values (zero, infinity, and NaN) often need to be handled separately
// because they are represented using special exponent values and their
// mantissa is not defined.
bool isNormal() const {
return _bnExp < EXP_ZERO;
}
// Return true if this value is a normal floating-point number or zero,
// i.e. it is not infinity or NaN.
bool isFinite() const {
return _bnExp <= EXP_ZERO;
}
// Return true if the sign bit is set (this includes negative zero).
@property
bool signBit() const {
return _sign < 0;
}
// Return +1 if this ExactFloat is positive, -1 if it is negative, and 0
// if it is zero or NaN. Note that unlike sign_bit(), sgn() returns 0 for
// both positive and negative zero.
@property
int sign() const {
return (isNan() || isZero()) ? 0 : _sign;
}
/////////////////////////////////////////////////////////////////////////////
// Conversion Methods
//
// Note that some conversions are defined as functions further below,
// e.g. to convert to an integer you can use lround(), llrint(), etc.
// Round to double precision. Note that since doubles have a much smaller
// exponent range than ExactFloats, very small values may be rounded to
// (positive or negative) zero, and very large values may be rounded to
// infinity.
//
// It is very important to make this a named method rather than an implicit
// conversion, because otherwise there would be a silent loss of precision
// whenever some desired operator or function happens not to be implemented.
// For example, if fabs() were not implemented and "x" and "y" were
// ExactFloats, then x = fabs(y) would silently convert "y" to a "double",
// take its absolute value, and convert it back to an ExactFloat.
double toDouble() const {
// If the mantissa has too many bits, we need to round it.
if (prec() <= DOUBLE_MANTISSA_BITS) {
return toDoubleHelper();
} else {
ExactFloat r = roundToMaxPrec(DOUBLE_MANTISSA_BITS, RoundingMode.ROUND_TIES_TO_EVEN);
return r.toDoubleHelper();
}
}
// Return a human-readable string such that if two values with the same
// precision are different, then their string representations are different.
// The format is similar to printf("%g"), except that the number of
// significant digits depends on the precision (with a minimum of 10).
// Trailing zeros are stripped (just like "%g").
//
// Note that if two values have different precisions, they may have the same
// ToString() value even though their values are slightly different. If you
// need to distinguish such values, use ToUniqueString() intead.
string toString() const {
int max_digits = algorithm.max(MIN_SIGNIFICANT_DIGITS,
numSignificantDigitsForPrec(prec()));
return toStringWithMaxDigits(max_digits);
}
// Return a string formatted according to printf("%Ng") where N is the given
// maximum number of significant digits.
string toStringWithMaxDigits(int max_digits) const
in {
assert(max_digits >= 0);
} do {
if (!isNormal()) {
if (isNan()) return "nan";
if (isZero()) return (_sign < 0) ? "-0" : "0";
return (_sign < 0) ? "-inf" : "inf";
}
char[] digits;
int exp10 = getDecimalDigits(max_digits, digits);
string str;
if (_sign < 0) str ~= "-";
// We use the standard '%g' formatting rules. If the exponent is less than
// -4 or greater than or equal to the requested precision (i.e., max_digits)
// then we use exponential notation.
//
// But since "exp10" is the base-10 exponent corresponding to a mantissa in
// the range [0.1, 1), whereas the '%g' rules assume a mantissa in the range
// [1.0, 10), we need to adjust these parameters by 1.
if (exp10 <= -4 || exp10 > max_digits) {
// Use exponential format.
str ~= digits[0];
if (digits.length > 1) {
str ~= ".";
str ~= digits[1 .. $];
}
char[20] exp_buf;
format.sformat(exp_buf, "e%+02d", exp10 - 1);
str ~= exp_buf;
} else {
// Use fixed format. We split this into two cases depending on whether
// the integer portion is non-zero or not.
if (exp10 > 0) {
if (exp10 >= digits.length) {
str ~= digits;
for (ulong i = exp10 - digits.length; i > 0; --i) {
str ~= "0";
}
} else {
str ~= digits[0 .. exp10];
str ~= ".";
str ~= digits[exp10 .. $];
}
} else {
str ~= "0.";
for (int i = exp10; i < 0; ++i) {
str ~= "0";
}
str ~= digits;
}
}
return str;
}
// Return a human-readable string such that if two ExactFloats have different
// values, then their string representations are always different. This
// method is useful for debugging. The string has the form "value<prec>",
// where "prec" is the actual precision of the ExactFloat (e.g., "0.215<50>").
string toUniqueString() const {
string precStr = format.format("<%d>", prec());
return toString() ~ precStr;
}
size_t toHash() const nothrow @safe {
return HashMix(_bn.toHash())
.mix(cast(size_t) _bnExp)
.mix(cast(size_t) _sign)
.get();
}
// Return an upper bound on the number of significant digits required to
// distinguish any two floating-point numbers with the given precision when
// they are formatted as decimal strings in exponential format.
static int numSignificantDigitsForPrec(int prec) {
// The simplest bound is
//
// d <= 1 + ceil(prec * log10(2))
//
// The following bound is tighter by 0.5 digits on average, but requires
// the exponent to be known as well:
//
// d <= ceil(exp * log10(2)) - floor((exp - prec) * log10(2))
//
// Since either of these bounds can be too large by 0, 1, or 2 digits, we
// stick with the simpler first bound.
return cast(int) (1 + math.ceil(prec * (math.LN2 / math.LN10)));
}
/////////////////////////////////////////////////////////////////////////////
// Other Methods
// Round the ExactFloat so that its mantissa has at most "max_prec" bits
// using the given rounding mode. Requires "max_prec" to be at least 2
// (since kRoundTiesToEven doesn't make sense with fewer bits than this).
ExactFloat roundToMaxPrec(int max_prec, RoundingMode mode) const
in {
// The "kRoundTiesToEven" mode requires at least 2 bits of precision
// (otherwise both adjacent representable values may be odd).
assert(max_prec >= 2);
assert(max_prec <= MAX_PREC);
} do {
// The following test also catches zero, infinity, and NaN.
int shift = prec() - max_prec;
if (shift <= 0) {
return this;
}
// Round by removing the appropriate number of bits from the mantissa. Note
// that if the value is rounded up to a power of 2, the high-order bit
// position may increase, but in that case Canonicalize() will remove at
// least one zero bit and so the output will still have prec() <= max_prec.
return roundToPowerOf2(_bnExp + shift, mode);
}
/////////////////////////////////////////////////////////////////////////////
// Operators
// Unary plus.
ExactFloat opUnary(string op)() const
if (op == "+") {
return *this;
}
// Unary minus.
ExactFloat opUnary(string op)() const
if (op == "-") {
return copyWithSign(-_sign);
}
// Addition.
ExactFloat opBinary(string op)(in ExactFloat b) const
if (op == "+") {
return signedSum(_sign, this, b._sign, b);
}
// Subtraction.
ExactFloat opBinary(string op)(in ExactFloat b) const
if (op == "-") {
return signedSum(_sign, this, -b._sign, b);
}
// Multiplication.
ExactFloat opBinary(string op)(in ExactFloat b) const
if (op == "*") {
int result_sign = _sign * b._sign;
if (!isNormal() || !b.isNormal()) {
// Handle zero, infinity, and NaN according to IEEE 754-2008.
if (isNan()) return this;
if (b.isNan()) return b;
if (isInf()) {
// Infinity times zero yields NaN.
if (b.isZero()) return ExactFloat.nan();
return ExactFloat.infinity(result_sign);
}
if (b.isInf()) {
if (isZero()) return ExactFloat.nan();
return ExactFloat.infinity(result_sign);
}
assert(isZero() || b.isZero());
return ExactFloat.signedZero(result_sign);
}
ExactFloat r;
r._sign = result_sign;
r._bnExp = _bnExp + b._bnExp;
r._bn = _bn * b._bn;
r.canonicalize();
return r;
}
// Support operations with any convertable types.
ExactFloat opBinary(string op, T)(in T b) const {
return opBinary!op(ExactFloat(b));
}
// Support operations with any convertable types.
ExactFloat opBinaryRight(string op, T)(in T a) const {
ExactFloat axf = ExactFloat(a);
return axf.opBinary!op(this);
}
// Division is not implemented because the result cannot be represented
// exactly in general. Doing this properly would require extending all the
// operations to support rounding to a specified precision.
// Arithmetic assignment operators (+=, -=, *=).
ref ExactFloat opOpAssign(string op)(in ExactFloat b)
if (op == "+" || op == "-" || op == "*") {
return mixin("this = this " ~ op ~ " b");
}
// Comparison operators (==, !=).
bool opEquals(in ExactFloat b) const {
// NaN is not equal to anything, not even itself.
if (isNan() || b.isNan()) return false;
// Since Canonicalize() strips low-order zero bits, all other cases
// (including non-normal values) require bn_exp_ to be equal.
if (_bnExp != b._bnExp) return false;
// Positive and negative zero are equal.
if (isZero() && b.isZero()) return true;
// Otherwise, the signs and mantissas must match. Note that non-normal
// values such as infinity have a mantissa of zero.
return _sign == b._sign && _bn == b._bn;
}
// Support operations with any convertable types.
bool opEquals(T)(in T b) const {
return opEquals(ExactFloat(b));
}
int scaleAndCompare(in ExactFloat b) const
in {
assert(isNormal() && b.isNormal() && _bnExp >= b._bnExp);
} do {
ExactFloat tmp = this;
tmp._bnExp <<= _bnExp - b._bnExp;
if (tmp._bn > b._bn) return 1;
else if (tmp._bn < b._bn) return -1;
else return 0;
}
bool unsignedLess(in ExactFloat b) const {
// Handle the zero/infinity cases (NaN has already been done).
if (isInf() || b.isZero()) return false;
if (isZero() || b.isInf()) return true;
// If the high-order bit positions differ, we are done.
int cmp = exp() - b.exp();
if (cmp != 0) return cmp < 0;
// Otherwise shift one of the two values so that they both have the same
// bn_exp_ and then compare the mantissas.
return (_bnExp >= b._bnExp ?
scaleAndCompare(b) < 0 : b.scaleAndCompare(this) > 0);
}
// Comparison operators (<, <=, >, >=).
int opCmp(in ExactFloat b) const {
// NaN is unordered compared to everything, including itself.
if (isNan() || b.isNan()) return -1;
// Positive and negative zero are equal.
if (isZero() && b.isZero()) return 0;
// Otherwise, anything negative is less than anything positive.
if (_sign != b._sign) return _sign > b._sign ? 1 : -1;
// Now we just compare absolute values.
bool isLess = (_sign > 0) ? unsignedLess(b) : b.unsignedLess(this);
if (isLess) return -1;
else if (this == b) return 0;
return 1;
}
// Support operations with any convertable types.
int opCmp(T)(in T b) const {
return opCmp(ExactFloat(b));
}
private:
// Numbers are always formatted with at least this many significant digits.
// This prevents small integers from being formatted in exponential notation
// (e.g. 1024 formatted as 1e+03), and also avoids the confusion of having
// supposedly "high precision" numbers formatted with just 1 or 2 digits
// (e.g. 1/512 == 0.001953125 formatted as 0.002).
static const int MIN_SIGNIFICANT_DIGITS = 10;
// Non-normal numbers are represented using special exponent values and a
// mantissa of zero. Do not change these values; methods such as
// is_normal() make assumptions about their ordering. Non-normal numbers
// can have either a positive or negative sign (including zero and NaN).
static immutable int EXP_NAN = int.max;
static immutable int EXP_INFINITY = int.max - 1;
static immutable int EXP_ZERO = int.max - 2;
// Normal numbers are represented as (sign_ * bn_ * (2 ** bn_exp_)), where:
// - _sign is either +1 or -1
// - _bn is a BIGNUM with a positive value
// - _bnExp is the base-2 exponent applied to _bn.
int _sign = 1;
int _bnExp = EXP_ZERO;
BigInt _bn = BigInt();
// A standard IEEE "double" has a 53-bit mantissa consisting of a 52-bit
// fraction plus an implicit leading "1" bit.
static immutable int DOUBLE_MANTISSA_BITS = 53;
// Convert an ExactFloat with no more than 53 bits in its mantissa to a
// "double". This method handles non-normal values (NaN, etc).
double toDoubleHelper() const
in {
assert(prec() <= DOUBLE_MANTISSA_BITS);
} do {
if (!isNormal()) {
if (isZero()) {
return math.copysign(0, cast(double) _sign);
}
if (isInf()) {
return math.copysign(double.infinity, cast(double) _sign);
}
return math.copysign(double.nan, cast(double) _sign);
}
long d_mantissa = _bn.toLong();
// We rely on ldexp() to handle overflow and underflow. (It will return a
// signed zero or infinity if the result is too small or too large.)
return _sign * math.ldexp(cast(double) d_mantissa, _bnExp);
}
// Round an ExactFloat so that it is a multiple of (2 ** bit_exp), using the
// given rounding mode.
ExactFloat roundToPowerOf2(int bit_exp, RoundingMode mode) const
in {
assert(bit_exp >= MIN_EXP - MAX_PREC);
assert(bit_exp <= MAX_EXP);
} do {
// If the exponent is already large enough, or the value is zero, infinity,
// or NaN, then there is nothing to do.
int shift = bit_exp - _bnExp;
if (shift <= 0) return this;
assert(isNormal());
// Convert rounding up/down to toward/away from zero, so that we don't need
// to consider the sign of the number from this point onward.
if (mode == RoundingMode.ROUND_TOWARD_POSITIVE) {
mode = (_sign > 0) ? RoundingMode.ROUND_AWAY_FROM_ZERO : RoundingMode.ROUND_TOWARD_ZERO;
} else if (mode == RoundingMode.ROUND_TOWARD_NEGATIVE) {
mode = (_sign > 0) ? RoundingMode.ROUND_TOWARD_ZERO : RoundingMode.ROUND_AWAY_FROM_ZERO;
}
// Rounding consists of right-shifting the mantissa by "shift", and then
// possibly incrementing the result (depending on the rounding mode, the
// bits that were discarded, and sometimes the lowest kept bit). The
// following code figures out whether we need to increment.
ExactFloat r;
bool increment = false;
if (mode == RoundingMode.ROUND_TOWARD_ZERO) {
// Never increment.
} else if (mode == RoundingMode.ROUND_TIES_AWAY_FROM_ZERO) {
// Increment if the highest discarded bit is 1.
if (isBitSet(_bn, shift - 1))
increment = true;
} else if (mode == RoundingMode.ROUND_AWAY_FROM_ZERO) {
// Increment unless all discarded bits are zero.
if (extCountLowZeroBits(_bn) < shift)
increment = true;
} else {
assert(mode == RoundingMode.ROUND_TIES_TO_EVEN);
// Let "w/xyz" denote a mantissa where "w" is the lowest kept bit and
// "xyz" are the discarded bits. Then using regexp notation:
// ./0.* -> Don't increment (fraction < 1/2)
// 0/10* -> Don't increment (fraction = 1/2, kept part even)
// 1/10* -> Increment (fraction = 1/2, kept part odd)
// ./1.*1.* -> Increment (fraction > 1/2)
if (isBitSet(_bn, shift - 1)
&& ((isBitSet(_bn, shift)
|| extCountLowZeroBits(_bn) < shift - 1))) {
increment = true;
}
}
r._bnExp = _bnExp + shift;
r._bn = _bn >> shift;
if (increment) {
r._bn += 1;
}
r._sign = _sign;
r.canonicalize();
return r;
}
private static bool isBitSet(in BigInt bn, int bitNum) {
size_t digitNum = bitNum / (8 * ulong.sizeof);
size_t shift = bitNum % (8 * ulong.sizeof);
ulong digit = bn.getDigit!ulong(digitNum);
return (digit & (1uL << shift)) != 0;
}
// Count the number of low-order zero bits in the given BIGNUM (ignoring its
// sign). Returns 0 if the argument is zero.
private static int extCountLowZeroBits(in BigInt bn) {
int count = 0;
for (int i = 0; i < bn.ulongLength(); ++i) {
ulong w = bn.getDigit!ulong(i);
if (w == 0) {
count += 8 * ulong.sizeof;
} else {
for (; (w & 1) == 0; w >>= 1) {
++count;
}
break;
}
}
return count;
}
// Convert the ExactFloat to a decimal value of the form 0.ddd * (10 ** x),
// with at most "max_digits" significant digits (trailing zeros are removed).
// Set (*digits) to the ASCII digits and return the decimal exponent "x".
int getDecimalDigits(int max_digits, out char[] digits) const
in {
assert(isNormal());
} do {
// Convert the value to the form (bn * (10 ** bn_exp10)) where "bn" is a
// positive integer (BIGNUM).
BigInt bn = BigInt();
int bn_exp10;
if (_bnExp >= 0) {
// The easy case: bn = bn_ * (2 ** bn_exp_)), bn_exp10 = 0.
bn = _bn << _bnExp;
bn_exp10 = 0;
} else {
// Set bn = bn_ * (5 ** -bn_exp_) and bn_exp10 = bn_exp_. This is
// equivalent to the original value of (bn_ * (2 ** bn_exp_)).
bn = 5;
bn ^^= -_bnExp;
bn *= _bn;
bn_exp10 = _bnExp;
}
// Now convert "bn" to a decimal string.
string all_digits = format.format("%d", bn);
assert(all_digits != null);
// Check whether we have too many digits and round if necessary.
size_t num_digits = all_digits.length;
if (num_digits <= max_digits) {
digits = all_digits.dup;
} else {
digits = all_digits[0 .. max_digits].dup;
// Standard "printf" formatting rounds ties to an even number. This means
// that we round up (away from zero) if highest discarded digit is '5' or
// more, unless all other discarded digits are zero in which case we round
// up only if the lowest kept digit is odd.
if (all_digits[max_digits] >= '5' &&
((all_digits[max_digits-1] & 1) == 1 ||
!algorithm.findAmong(all_digits[max_digits + 1 .. $], "123456789").empty)) {
// This can increase the number of digits by 1, but in that case at
// least one trailing zero will be stripped off below.
incrementDecimalDigits(digits);
}
// Adjust the base-10 exponent to reflect the digits we have removed.
bn_exp10 += num_digits - max_digits;
}
// Now strip any trailing zeros.
assert(digits[0] != '0');
size_t pos = digits.length - 1;
while (digits[pos] == '0') {
--pos;
}
if (pos < digits.length - 1) {
bn_exp10 += digits.length - pos;
digits.length = pos + 1;
}
assert(digits.length <= max_digits);
// Finally, we adjust the base-10 exponent so that the mantissa is a
// fraction in the range [0.1, 1) rather than an integer.
return bn_exp10 + cast(int) digits.length;
}
// Increment an unsigned integer represented as a string of ASCII digits.
private static void incrementDecimalDigits(char[] digits) {
size_t pos = digits.length;
while (--pos >= 0) {
if (digits[pos] < '9') {
++digits[pos];
return;
}
digits[pos] = '0';
}
digits = "1" ~ digits;
}
// Return a_sign * fabs(a) + b_sign * fabs(b). Used to implement addition
// and subtraction.
static ExactFloat signedSum(int a_sign, ExactFloat a, int b_sign, ExactFloat b) {
if (!a.isNormal() || !b.isNormal()) {
// Handle zero, infinity, and NaN according to IEEE 754-2008.
if (a.isNan()) return a;
if (b.isNan()) return b;
if (a.isInf()) {
// Adding two infinities with opposite sign yields NaN.
if (b.isInf() && a_sign != b_sign) return ExactFloat.nan();
return infinity(a_sign);
}
if (b.isInf()) return infinity(b_sign);
if (a.isZero()) {
if (!b.isZero()) return b.copyWithSign(b_sign);
// Adding two zeros with the same sign preserves the sign.
if (a_sign == b_sign) return signedZero(a_sign);
// Adding two zeros of opposite sign produces +0.
return signedZero(+1);
}
assert(b.isZero());
return a.copyWithSign(a_sign);
}
// Swap the numbers if necessary so that "a" has the larger bn_exp_.
if (a._bnExp < b._bnExp) {
algorithm.swap(a_sign, b_sign);
algorithm.swap(a, b);
}
// Shift "a" if necessary so that both values have the same bn_exp_.
ExactFloat r;
if (a._bnExp > b._bnExp) {
r._bn = a._bn << (a._bnExp - b._bnExp);
a = r; // The only field of "a" used below is bn_.
}
r._bnExp = b._bnExp;
if (a_sign == b_sign) {
r._bn = a._bn + b._bn;
r._sign = a_sign;
} else {
// Note that the BIGNUM documentation is out of date -- all methods now
// allow the result to be the same as any input argument, so it is okay if
// (a == &r) due to the shift above.
r._bn = a._bn - b._bn;
if (r._bn == 0) {
r._sign = +1;
} else if (r._bn < 0) {
// The magnitude of "b" was larger.
r._sign = b_sign;
r._bn = -r._bn;
} else {
// They were equal, or the magnitude of "a" was larger.
r._sign = a_sign;
}
}
r.canonicalize();
return r;
}
// Convert an ExactFloat to its canonical form. Underflow results in signed
// zero, overflow results in signed infinity, and precision overflow results
// in NaN. A zero mantissa is converted to the canonical zero value with
// the given sign; otherwise the mantissa is normalized so that its low bit
// is 1. Non-normal numbers are left unchanged.
void canonicalize() {
if (!isNormal()) return;
// Underflow/overflow occurs if exp() is not in [kMinExp, kMaxExp].
// We also convert a zero mantissa to signed zero.
int my_exp = exp();
if (my_exp < MIN_EXP || _bn == 0) {
setZero(_sign);
} else if (my_exp > MAX_EXP) {
setInf(_sign);
} else if (_bn % 2 == 1) {
// Remove any low-order zero bits from the mantissa.
assert(_bn != 0);
int shift = countLowZeroBits(_bn);
if (shift > 0) {
_bn = _bn >> shift;
_bnExp += shift;
}
}
// If the mantissa has too many bits, we replace it by NaN to indicate
// that an inexact calculation has occurred.
if (prec() > MAX_PREC) {
setNan();
}
}
// Count the number of low-order zero bits in the given BIGNUM (ignoring its
// sign). Returns 0 if the argument is zero.
private static int countLowZeroBits(in BigInt bn) {
int count = 0;
for (int i = 0; i < bn.ulongLength(); ++i) {
ulong w = bn.getDigit!ulong(i);
if (w == 0) {
count += 8 * ulong.sizeof;
} else {
for (; (w & 1) == 0; w >>= 1) {
++count;
}
break;
}
}
return count;
}
// Return an ExactFloat with the magnitude of this ExactFloat and the given
// sign. (Similar to copysign, except that the sign is given explicitly
// rather than being copied from another ExactFloat.)
ExactFloat copyWithSign(int sign) const {
ExactFloat r = this;
r._sign = sign;
return r;
}
// Convert an ExactFloat to an integer of type "T" using the given rounding
// mode. The type "T" must be signed. Returns the largest possible integer
// for NaN, and clamps out of range values to the largest or smallest
// possible values.
T toInteger(T)(RoundingMode mode) const
if (traits.isIntegral!T && traits.isSigned!T) {
ExactFloat r = roundToPowerOf2(0, mode);
if (r.isNan()) return T.min;
if (r.isZero()) return 0;
if (!r.isInf()) {
// If the unsigned value has more than 63 bits it is always clamped.
if (r.exp() < 64) {
long value = r._bn.toLong() << r._bnExp;
if (r._sign < 0) value = -value;
return algorithm.max(T.min, algorithm.min(T.max, value));
}
}
return (r._sign < 0) ? T.min : T.max;
}
// Log a fatal error message (used for unimplemented methods).
static ExactFloat unimplemented() {
assert(false, "Unimplemented ExactFloat method called.");
}
}
//////////////////////////////////////////////////////////////////////
// Math Intrinsics
//
// The math intrinsics currently supported by ExactFloat are listed below.
// Except as noted, they behave identically to the usual glibc intrinsics
// except that they have greater precision. See the man pages for more
// information.
//
// They can be used in a consistent manner with functions used for double
// and real with Uniform Function Call Syntax.
//
// For example:
// double dval = 5.4;
// ExactFloat xfval = 5.4; // Consistent, no problem.
//
// import math = std.math;
// math.fabs(dval);
// math.fabs(xfval); // Error: Does not exist!
//
// import std.math;
// import s2.util.math.exactfloat;
// fabs(dval); // OK, but symbol fabs is in the main namespace.
// dval.fabs(); // OK, uses UFCS.
// fabs(xfval); // OK as well, but function comes from exactfloat.
// xfval.fabs(); // OK, uses UFCS.
//////// Miscellaneous simple arithmetic functions.
// Absolute value.
ExactFloat fabs(in ExactFloat a) {
return abs(a);
}
ExactFloat abs(in ExactFloat a) {
return a.copyWithSign(+1);
}
// Maximum of two values.
ExactFloat fmax(in ExactFloat a, in ExactFloat b) {
// If one argument is NaN, return the other argument.
if (a.isNan()) return b;
if (b.isNan()) return a;
// Not required by IEEE 754, but we prefer +0 over -0.
if (a.sign != b.sign) {
return (a.sign() < b.sign()) ? b : a;
}
return (a < b) ? b : a;
}
// Minimum of two values.
ExactFloat fmin(in ExactFloat a, in ExactFloat b) {
// If one argument is NaN, return the other argument.
if (a.isNan()) return b;
if (b.isNan()) return a;
// Not required by IEEE 754, but we prefer -0 over +0.
if (a.sign != b.sign) {
return (a.sign < b.sign) ? a : b;
}
return (a < b) ? a : b;
}
// Positive difference: max(a - b, 0).
ExactFloat fdim(in ExactFloat a, in ExactFloat b) {
// This formulation has the correct behavior for NaNs.
return (a <= b) ? ExactFloat(0) : (a - b);
}
//////// Integer rounding functions that return ExactFloat values.
// Round up to the nearest integer.
ExactFloat ceil(in ExactFloat a) {
return a.roundToPowerOf2(0, ExactFloat.RoundingMode.ROUND_TOWARD_POSITIVE);
}
// Round down to the nearest integer.
ExactFloat floor(in ExactFloat a) {
return a.roundToPowerOf2(0, ExactFloat.RoundingMode.ROUND_TOWARD_NEGATIVE);
}
// Round to the nearest integer not larger in absolute value.
// For example: f(-1.9) = -1, f(2.9) = 2.
ExactFloat trunc(in ExactFloat a) {
return a.roundToPowerOf2(0, ExactFloat.RoundingMode.ROUND_TOWARD_ZERO);
}
// Round to the nearest integer, rounding halfway cases away from zero.
// For example: f(-0.5) = -1, f(0.5) = 1, f(1.5) = 2, f(2.5) = 3.
ExactFloat round(in ExactFloat a) {
return a.roundToPowerOf2(0, ExactFloat.RoundingMode.ROUND_TIES_AWAY_FROM_ZERO);
}
// Round to the nearest integer, rounding halfway cases to an even integer.
// For example: f(-0.5) = 0, f(0.5) = 0, f(1.5) = 2, f(2.5) = 2.
ExactFloat rint(in ExactFloat a) {
return a.roundToPowerOf2(0, ExactFloat.RoundingMode.ROUND_TIES_TO_EVEN);
}
// A synonym for rint().
ExactFloat nearbyint(in ExactFloat a) { return rint(a); }
//////// Integer rounding functions that return C++ integer types.
// Like rint(), but rounds to the nearest "long" value. Returns the
// minimum/maximum possible integer if the value is out of range.
long lrint(in ExactFloat a) {
return a.toInteger!long(ExactFloat.RoundingMode.ROUND_TIES_TO_EVEN);
}
// Like round(), but rounds to the nearest "long" value. Returns the
// minimum/maximum possible integer if the value is out of range.
long lround(in ExactFloat a) {
return a.toInteger!long(ExactFloat.RoundingMode.ROUND_TIES_AWAY_FROM_ZERO);
}
//////// Remainder functions.
// The remainder of dividing "a" by "b", where the quotient is rounded toward
// zero to the nearest integer. Similar to (a - trunc(a / b) * b).
ExactFloat fmod(in ExactFloat a, in ExactFloat b) {
// Note that it is possible to implement this operation exactly, it just
// hasn't been done.
return ExactFloat.unimplemented();
}
// The remainder of dividing "a" by "b", where the quotient is rounded to the
// nearest integer, rounding halfway cases to an even integer. Similar to
// (a - rint(a / b) * b).
ExactFloat remainder(in ExactFloat a, in ExactFloat b) {
// Note that it is possible to implement this operation exactly, it just
// hasn't been done.
return ExactFloat.unimplemented();
}
// A synonym for remainder().
ExactFloat drem(in ExactFloat a, in ExactFloat b) {
return remainder(a, b);
}
// Break the argument "a" into integer and fractional parts, each of which
// has the same sign as "a". The fractional part is returned, and the
// integer part is stored in the output parameter "i_ptr". Both output
// values are set to have the same maximum precision as "a".
ExactFloat modf(in ExactFloat a, out ExactFloat i_ptr) {
// Note that it is possible to implement this operation exactly, it just
// hasn't been done.
return ExactFloat.unimplemented();
}
//////// Floating-point manipulation functions.
// Return an ExactFloat with the magnitude of "a" and the sign bit of "b".
// (Note that an IEEE zero can be either positive or negative.)
ExactFloat copysign(in ExactFloat a, in ExactFloat b) {
return a.copyWithSign(b.sign);
}
// Convert "a" to a normalized fraction in the range [0.5, 1) times a power
// of two. Return the fraction and set "exp" to the exponent. If "a" is
// zero, infinity, or NaN then return "a" and set "exp" to zero.
ExactFloat frexp(in ExactFloat a, out int exp) {
if (!a.isNormal()) {
// If a == 0, exp should be zero. If a.is_inf() or a.is_nan(), exp is not
// defined but the glibc implementation returns zero.
exp = 0;
return a;
}
exp = a.exp();
return ldexp(a, -a.exp());
}
// Return "a" multiplied by 2 raised to the power "exp".
ExactFloat ldexp(in ExactFloat a, int exp) {
if (!a.isNormal()) return a;
// To prevent integer overflow, we first clamp "exp" so that
// (kMinExp - 1) <= (a_exp + exp) <= (kMaxExp + 1).
int a_exp = a.exp();
exp = algorithm.min(ExactFloat.MAX_EXP + 1 - a_exp,
algorithm.max(ExactFloat.MIN_EXP - 1 + a_exp, exp));
// Now modify the exponent and check for overflow/underflow.
ExactFloat r = a;
r._bnExp += exp;
r.canonicalize();
return r;
}
// A synonym for ldexp().
ExactFloat scalbn(in ExactFloat a, int exp) {
return ldexp(a, exp);
}
// A version of ldexp() where "exp" is a long integer.
ExactFloat scalbln(in ExactFloat a, long exp) {
// Clamp the exponent to the range of "int" in order to avoid truncation.
exp = algorithm.max(cast(long) int.min, algorithm.min(cast(long) int.max, exp));
return ldexp(a, cast(int) exp);
}
// Convert "a" to a normalized fraction in the range [1,2) times a power of
// two, and return the exponent value as an integer. This is equivalent to
// lrint(floor(log2(fabs(a)))) but it is computed more efficiently. Returns
// the constants documented in the man page for zero, infinity, or NaN.
int ilogb(in ExactFloat a) {
if (a.isZero()) return math.FP_ILOGB0;
if (a.isInf()) return int.max;
if (a.isNan()) return math.FP_ILOGBNAN;
// a.exp() assumes the significand is in the range [0.5, 1).
return a.exp() - 1;
}
// Convert "a" to a normalized fraction in the range [1,2) times a power of
// two, and return the exponent value as an ExactFloat. This is equivalent to
// floor(log2(fabs(a))) but it is computed more efficiently.
ExactFloat logb(in ExactFloat a) {
if (a.isZero()) return ExactFloat.infinity(-1);
if (a.isInf()) return ExactFloat.infinity(+1); // Even if a < 0.
if (a.isNan()) return a;
// exp() assumes the significand is in the range [0.5,1).
return ExactFloat(a.exp() - 1);
}
|
D
|
INSTANCE Info_Mod_Brandick_Hi (C_INFO)
{
npc = Mod_7799_SMK_Brandick_OM;
nr = 1;
condition = Info_Mod_Brandick_Hi_Condition;
information = Info_Mod_Brandick_Hi_Info;
permanent = 0;
important = 0;
description = "Und wie läuft die Arbeit in der Mine?";
};
FUNC INT Info_Mod_Brandick_Hi_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Brandick_Hi_Info()
{
AI_Output(hero, self, "Info_Mod_Brandick_Hi_15_00"); //Und wie läuft die Arbeit in der Mine?
AI_Output(self, hero, "Info_Mod_Brandick_Hi_11_01"); //Ach, war schon mal besser. Früher hatte ich mehr Erz in der Tasche ... als Aleph noch da war ...
AI_Output(hero, self, "Info_Mod_Brandick_Hi_15_02"); //Was meinst du?
AI_Output(self, hero, "Info_Mod_Brandick_Hi_11_03"); //Nunja ... er war ... ziemlich geschickt in einigen Dingen und hat mir gutes Erz dafür gezahlt, dass ich mal ein Auge zugedrückt, wenn er nicht geackert hat. Aber beim Beben hat es ihn dann erwischt.
AI_Output(hero, self, "Info_Mod_Brandick_Hi_15_04"); //Was ist passiert.
AI_Output(self, hero, "Info_Mod_Brandick_Hi_11_05"); //Nur paar Meter von uns entfernt ist er hinabgestürzt. Muss sofort tot gewesen sein ... sein Glück. Blieb im einiges erspart ...
AI_Output(self, hero, "Info_Mod_Brandick_Hi_11_06"); //Nur schade, dass ich nicht einen Tag vorher bei ihm abkassiert hatte ... und mit dem verschwundenen Schlüssel von Santino habe ich auch so meinen Verdacht.
};
INSTANCE Info_Mod_Brandick_Pickpocket (C_INFO)
{
npc = Mod_7799_SMK_Brandick_OM;
nr = 1;
condition = Info_Mod_Brandick_Pickpocket_Condition;
information = Info_Mod_Brandick_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_90;
};
FUNC INT Info_Mod_Brandick_Pickpocket_Condition()
{
C_Beklauen (66, ItMi_Nugget, 5);
};
FUNC VOID Info_Mod_Brandick_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
Info_AddChoice (Info_Mod_Brandick_Pickpocket, DIALOG_BACK, Info_Mod_Brandick_Pickpocket_BACK);
Info_AddChoice (Info_Mod_Brandick_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Brandick_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_Brandick_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
};
FUNC VOID Info_Mod_Brandick_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
Info_AddChoice (Info_Mod_Brandick_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Brandick_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_Brandick_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Brandick_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_Brandick_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Brandick_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_Brandick_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_Brandick_Pickpocket_Bestechung()
{
B_Say (hero, self, "$PICKPOCKET_BESTECHUNG");
var int rnd; rnd = r_max(99);
if (rnd < 25)
|| ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50))
|| ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100))
|| ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200))
{
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
}
else
{
if (rnd >= 75)
{
B_GiveInvItems (hero, self, ItMi_Gold, 200);
}
else if (rnd >= 50)
{
B_GiveInvItems (hero, self, ItMi_Gold, 100);
}
else if (rnd >= 25)
{
B_GiveInvItems (hero, self, ItMi_Gold, 50);
};
B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01");
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_Brandick_Pickpocket_Herausreden()
{
B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN");
if (r_max(99) < Mod_Verhandlungsgeschick)
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01");
Info_ClearChoices (Info_Mod_Brandick_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
INSTANCE Info_Mod_Brandick_EXIT (C_INFO)
{
npc = Mod_7799_SMK_Brandick_OM;
nr = 1;
condition = Info_Mod_Brandick_EXIT_Condition;
information = Info_Mod_Brandick_EXIT_Info;
permanent = 1;
important = 0;
description = DIALOG_ENDE;
};
FUNC INT Info_Mod_Brandick_EXIT_Condition()
{
return 1;
};
FUNC VOID Info_Mod_Brandick_EXIT_Info()
{
AI_StopProcessInfos (self);
};
|
D
|
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.build/Socket.swift.o : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.build/Socket~partial.swiftmodule : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
/Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIO.build/Socket~partial.swiftdoc : /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IOData.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Codec.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Thread.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Embedded.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Selectable.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileHandle.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelPipeline.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PriorityQueue.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Channel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/DeadChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/MulticastChannel.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BlockingIOThreadPool.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/System.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileRegion.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ContiguousCollection.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Heap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/EventLoop.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/CircularBuffer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelHandler.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Resolver.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/CompositeError.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Selector.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/FileDescriptor.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Interfaces.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Utilities.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/IntegerTypes.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/SocketAddresses.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Socket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ServerSocket.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/Linux.swift /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/NIO/NIOAny.swift /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-macos.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Combine.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/Swift.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/weirujian/Desktop/WeiRuJian/Vapor/AuthServer/.build/checkouts/swift-nio-zlib-support/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/Darwin.apinotes
|
D
|
class C : Exception
{
this() { super(""); }
}
version (DLL)
{
version (Windows)
{
import core.sys.windows.dll;
mixin SimpleDllMain;
}
pragma(mangle, "foo")
export Object foo(Object o)
{
assert(cast(C) o);
return new C;
}
pragma(mangle, "bar")
export void bar(void function() f)
{
import core.stdc.stdio : fopen, fclose;
bool caught;
try
f();
catch (C e)
caught = true;
assert(caught);
// verify we've actually got to the end, because for some reason we can
// end up exiting with code 0 when throwing an exception
fclose(fopen("dynamiccast_endbar", "w"));
throw new C;
}
}
else
{
T getFunc(T)(const(char)* sym)
{
import core.runtime : Runtime;
version (Windows)
{
import core.sys.windows.winbase : GetProcAddress;
return cast(T) Runtime.loadLibrary("dynamiccast.dll")
.GetProcAddress(sym);
}
else version (Posix)
{
import core.sys.posix.dlfcn : dlsym;
return cast(T) Runtime.loadLibrary("./dynamiccast.so")
.dlsym(sym);
}
else static assert(0);
}
// Returns the path to the executable's directory (null-terminated).
string getThisExeDir(string arg0)
{
char[] buffer = arg0.dup;
assert(buffer.length);
for (size_t i = buffer.length - 1; i > 0; --i)
{
if (buffer[i] == '/' || buffer[i] == '\\')
{
buffer[i] = 0;
return cast(string) buffer[0 .. i];
}
}
return null;
}
version (DigitalMars) version (Win64) version = DMD_Win64;
void main(string[] args)
{
import core.stdc.stdio : fopen, fclose, remove;
const exeDir = getThisExeDir(args[0]);
if (exeDir.length)
{
version (Windows)
{
import core.sys.windows.winbase : SetCurrentDirectoryA;
SetCurrentDirectoryA(exeDir.ptr);
}
else
{
import core.sys.posix.unistd : chdir;
chdir(exeDir.ptr);
}
}
remove("dynamiccast_endmain");
remove("dynamiccast_endbar");
C c = new C;
auto o = getFunc!(Object function(Object))("foo")(c);
assert(cast(C) o);
version (DMD_Win64)
{
// FIXME: apparent crash & needs more work, see https://github.com/dlang/druntime/pull/2874
fclose(fopen("dynamiccast_endbar", "w"));
}
else
{
bool caught;
try
getFunc!(void function(void function()))("bar")(
{ throw new C; });
catch (C e)
caught = true;
assert(caught);
}
// verify we've actually got to the end, because for some reason we can
// end up exiting with code 0 when throwing an exception
fclose(fopen("dynamiccast_endmain", "w"));
}
}
|
D
|
/Users/endotsuyoshi/Documents/ios/shoanaorigin2/shoana/Build/Intermediates/Charts.build/Debug/Charts.build/Objects-normal/x86_64/IValueFormatter.o : /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/LineChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/AxisBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/MarkerImage.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Transformer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/Description.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/YAxis.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/RadarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/MarkerView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/Legend.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/XAxis.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/PieChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Animation/Animator.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Renderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ChartUtils.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/IMarker.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/Highlight.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/LegendEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Platform.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Filters/DataApproximator.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Fill.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/Range.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/ComponentBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Metal.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.apinotesc /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Supporting\ Files/Charts.h /Users/endotsuyoshi/Documents/ios/shoanaorigin2/shoana/Build/Intermediates/Charts.build/Debug/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuickLook.apinotesc
/Users/endotsuyoshi/Documents/ios/shoanaorigin2/shoana/Build/Intermediates/Charts.build/Debug/Charts.build/Objects-normal/x86_64/IValueFormatter~partial.swiftmodule : /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/LineChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/AxisBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/MarkerImage.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Transformer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/Description.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/YAxis.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/RadarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/MarkerView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/Legend.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/XAxis.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/PieChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Animation/Animator.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Renderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ChartUtils.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/IMarker.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/Highlight.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/LegendEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Platform.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Filters/DataApproximator.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Fill.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/Range.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/ComponentBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Metal.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.apinotesc /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Supporting\ Files/Charts.h /Users/endotsuyoshi/Documents/ios/shoanaorigin2/shoana/Build/Intermediates/Charts.build/Debug/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuickLook.apinotesc
/Users/endotsuyoshi/Documents/ios/shoanaorigin2/shoana/Build/Intermediates/Charts.build/Debug/Charts.build/Objects-normal/x86_64/IValueFormatter~partial.swiftdoc : /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/LineChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/AxisBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/MarkerImage.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Transformer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/Description.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/YAxis.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/RadarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/MarkerView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/Legend.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/XAxis.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/PieChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Animation/Animator.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Renderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ChartUtils.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/IMarker.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/Highlight.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/LegendEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Platform.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Filters/DataApproximator.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Charts/BarChartView.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Utils/Fill.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/Range.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Components/ComponentBase.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Metal.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.apinotesc /Users/endotsuyoshi/Documents/ios/shoanaorigin2/Charts/Source/Supporting\ Files/Charts.h /Users/endotsuyoshi/Documents/ios/shoanaorigin2/shoana/Build/Intermediates/Charts.build/Debug/Charts.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/AppKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/XPC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/QuickLook.apinotesc
|
D
|
/**
* D Documentation Generator
* Copyright: © 2014 Economic Modeling Specialists, Intl., © 2015 Ferdinand Majerech
* Authors: Ferdinand Majerech
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt Boost License 1.0)
*/
module symboldatabase;
import std.algorithm;
import std.array: popBack, back, empty, popFront;
import dparse.ast;
import dparse.lexer;
import dparse.parser;
import std.exception: enforce;
import std.range;
import std.stdio;
import std.string: join, split;
import allocator;
import config;
import item;
/**
* Gather data about modules to document into a SymbolDatabase and return the database.
*
* Params:
* config = harbored-mod configuration.
* writer = Writer (e.g. HTMLWriter), used to determine links for symbols (as Writer
* decides where to put symbols).
* files = Filenames of all modules to document.
*
* Returns: SymbolDatabase with collected data.
*/
SymbolDatabase gatherData(Writer)(ref const(Config) config, Writer writer, string[] files)
{
writeln("Collecting data about modules and symbols");
auto database = new SymbolDatabase;
foreach(modulePath; files)
{
gatherModuleData(config, database, writer, modulePath);
}
database.preCache();
return database;
}
///
class SymbolDatabase
{
/// Names of modules to document.
string[] moduleNames;
/// File paths of modules to document.
string[] moduleFiles;
/// `moduleNameToLink["pkg.module"]` gets link to module `pkg.module`
string[string] moduleNameToLink;
/// Cache storing strings used in AST nodes of the parsed modules.
private StringCache cache;
/// Construct a symbol database.
this()
{
cache = StringCache(1024 * 4);
}
/// Get module data for specified module.
SymbolDataModule moduleData(string moduleName)
{
auto mod = moduleName in modules;
enforce(mod !is null,
new Exception("No such module: " ~ moduleName));
assert(mod.type == SymbolType.Module,
"A non-module MembersTree in SymbolDatabase.modules");
return mod.dataModule;
}
//TODO if all the AAs are too slow, try RedBlackTree before completely overhauling
/**
* Get a link to documentation of symbol specified by word (if word is a symbol).
*
* Searching for a symbol matching to word is done in 3 stages:
* 1. Assume word starts by a module name (with or without parent packages of the
* module), look for matching modules, and if any, try to find the symbol there.
* 2. If 1. didn't find anything, assume word refers to a local symbol (parent
* scope - siblings of the symbol being documented or current scope - children
* of that symbol).
* 3. If 2. didn't find anything, assume word refers to a symbol in any module;
* search for a symbol with identical full name (but without the module part)
* in all modules.
*
* Params:
*
* writer = Writer used to determine links.
* scopeStack = Scope of the symbol the documentation of which contains word.
* word = Word to cross-reference.
*
* Returns: link if a matching symbol was found, null otherwise.
*/
string crossReference(Writer)(Writer writer, string[] scopeStack, string word)
{
string result;
// Don't cross-reference nonsense
if(word.splitter(".").empty || word.endsWith(".")) { return null; }
string symbolLink(S1, S2)(S1 modStack, S2 symStack)
{
return writer.symbolLink(symbolStack(modStack, symStack));
}
/// Does a module with specified name exists?
bool moduleExists(string moduleName)
{
MembersTree* node = &modulesTree;
foreach(part; moduleName.splitter("."))
{
// can happen if moduleName looks e.g. like "a..b"
if(part == "") { return false; }
node = part in node.children;
if(node is null) { return false; }
}
return node.type == SymbolType.Module;
}
// Search for a nested child with specified name stack in a members tree.
// If found, return true and rewrite the members tree pointer. The
// optional deleg argument can be used to execute code in each iteration.
//
// (e.g. for "File.writeln" nameStack would be ["File", "writeln"] and
// this would look for members.children["File"].children["writeln"])
bool findNested(Parts)(ref MembersTree* m, Parts nameStack,
void delegate(size_t partIdx, MembersTree* members) deleg = null)
{
auto members = m;
size_t partIdx;
foreach(part; nameStack)
{
members = part in members.children;
if(!members) { return false; }
if(deleg) { deleg(partIdx++, members); }
}
m = members;
return true;
}
// If module name is "tharsis.util.traits", this first checks if
// word starts with("tharsis.util.traits"), then "util.traits" and
// then "traits".
bool startsWithPartOf(Splitter)(Splitter wParts, Splitter mParts)
{
while(!mParts.empty)
{
if(wParts.startsWith(mParts)) { return true; }
mParts.popFront;
}
return false;
}
// Search for the symbol in specified module, return true if found.
bool searchInModule(string modName)
{
// Parts of the symbol name within the module.
string wordLocal = word;
// '.' prefix means module scope - which is what we're
// handling here, but need to remove the '.' so we don't
// try to look for symbol "".
while(wordLocal.startsWith(".")) { wordLocal.popFront(); }
// Remove the part of module name the word starts with.
wordLocal.skipOver(".");
foreach(part; modName.splitter(".")) if(wordLocal.startsWith(part))
{
wordLocal.skipOver(part);
wordLocal.skipOver(".");
}
MembersTree* members = modName in modules;
assert(members !is null, "Can't search in a nonexistent module");
auto parts = wordLocal.split(".");
if(!findNested(members, parts)) { return false; }
result = symbolLink(modName.split("."), parts);
return true;
}
// Search for a matching symbol assuming word starts by (part of) the name
// of the module containing the symbol.
bool searchAssumingExplicitModule(ref string result)
{
// No module name starts by "." - if we use "." we
// usually mean a global symbol.
if(word.startsWith(".")) { return false; }
auto parts = word.splitter(".");
// Avoid e.g. "typecons" automatically referencing to std.typecons;
// at least 2 parts must be specified (e.g. "std.typecons" or
// "typecons.Tuple" but not just "typecons" or "Tuple" ("Tuple"
// would still be found by searchInModulesTopLevel))
if(parts.walkLength <= 1) { return false; }
// Start by assuming fully qualified name.
// If word is fully prefixed by a module name, it almost certainly
// refers to that module (unless there is a module the name of which
// *ends* with same string in another package and the word refers
// to a symbol in *that* module. To handle that very unlikely case,
// we don't return false if we fail to find the symbol in the module)
string prefix;
foreach(part; parts)
{
prefix ~= part;
// Use searchInModule for speed.
if(moduleExists(prefix) && searchInModule(prefix))
{
return true;
}
prefix ~= ".";
}
// If not fully qualified name, assume the name is prefixed at
// least by a part of a module name. If it is, look in that module.
foreach(modName; modules.byKey) if(startsWithPartOf(parts, modName.splitter(".")))
{
if(searchInModule(modName)) { return true; }
}
return false;
}
// Search for a matching symbol in the local scope (scopeStack) - children
// of documented symbol and its parent scope - siblings of the symbol.
bool searchLocal(ref string result)
{
// a '.' prefix means we're *not* looking in the local scope.
if(word.startsWith(".")) { return false; }
MembersTree* membersScope;
MembersTree* membersParent;
string thisModule;
// For a fully qualified name, we need module name (thisModule),
// scope containing the symbol (scopeLocal for current scope,
// scopeLocal[0 .. $ - 1] for parent scope) *and* symbol name in
// the scope.
string[] scopeLocal;
string prefix;
foreach(part; scopeStack)
{
prefix ~= part;
scope(exit) { prefix ~= "."; }
if(!moduleExists(prefix)) { continue; }
thisModule = prefix;
scopeLocal = scopeStack;
scopeLocal.skipOver(thisModule.splitter("."));
MembersTree* members = &modules[thisModule];
void saveScopes(size_t depth, MembersTree* members)
{
const maxDepth = scopeLocal.length;
if(depth == maxDepth - 1) { membersScope = members; }
else if(depth == maxDepth - 2) { membersParent = members; }
}
if(findNested(members, scopeLocal, &saveScopes))
{
break;
}
}
// Search for the symbol specified by word in a members tree.
// This assumes word directly names a member of the tree.
bool searchMembers(string[] scope_, MembersTree* members)
{
auto parts = word.split(".");
if(!findNested(members, parts)) { return false; }
result = symbolLink(thisModule.split("."), scope_ ~ parts);
return true;
}
if(membersScope && searchMembers(scopeLocal, membersScope))
{
return true;
}
if(membersParent && searchMembers(scopeLocal[0 .. $ - 1], membersParent))
{
return true;
}
return false;
}
// Search for a matching symbol in top-level scopes of all modules. For a
// non-top-level sumbol to match, it must be prefixed by a top-level symbol,
// e.g. "Array.clear" instead of just "clear"
bool searchInModulesTopLevel(ref string result)
{
string wordLocal = word;
// '.' prefix means module scope - which is what we're
// handling here, but need to remove the '.' so we don't
// try to look for symbol "".
while(wordLocal.startsWith(".")) { wordLocal.popFront(); }
auto parts = wordLocal.split(".");
// Search in top-level scopes of each module.
foreach(moduleName, ref MembersTree membersRef; modules)
{
MembersTree* members = &membersRef;
if(!findNested(members, parts)) { continue; }
result = symbolLink(moduleName.split("."), parts);
return true;
}
return false;
}
if(searchAssumingExplicitModule(result)) { return result; }
if(searchLocal(result)) { return result; }
if(searchInModulesTopLevel(result)) { return result; }
return null;
}
/** Get a range describing a symbol with specified name.
*
* Params:
*
* moduleStack = Module name stack (module name split by ".").
* symbolStack = Symbol name stack (symbol name in the module split by ".").
*
* Returns: An InputRange describing the fully qualified symbol name.
* Every item of the range will be a struct describing a part of the
* name, with `string name` and `SymbolType type` members.
* E.g. for `"std.stdio.File"` the range items would be
* `{name: "std", type: Package}, {name: "stdio", type: Module},
* {name: "File", type: Class}`.
*
* Note: If the symbol does not exist, the returned range will only contain
* items for parent symbols that do exist (e.g. if moduleStack is
* ["std", "stdio"], symbolStack is ["noSuchThing"]), the symbolStack
* will describe the "std" package and "stdio" module, but will contain
* no entry for "noSuchThing".
*
*/
auto symbolStack(S1, S2)(S1 moduleStack, S2 symbolStack)
{
assert(!moduleStack.empty,
"Can't get a symbol stack with no module stack");
struct SymbolStack
{
private:
SymbolDatabase database;
S1 moduleStack;
S2 symbolStack;
MembersTree* currentSymbol;
string moduleName;
this(SymbolDatabase db, S1 modStack, S2 symStack)
{
database = db;
moduleStack = modStack;
symbolStack = symStack;
delve(false);
}
public:
auto front()
{
assert(!empty, "Can't get front of an empty range");
struct Result
{
string name;
SymbolType type;
}
return Result(moduleStack.empty ? symbolStack.front : moduleStack.front,
currentSymbol.type);
}
void popFront()
{
assert(!empty, "Can't pop front of an empty range");
if(!moduleStack.empty)
{
moduleStack.popFront();
delve(moduleStack.empty);
}
else
{
symbolStack.popFront();
delve(false);
}
}
bool empty()
{
return currentSymbol is null;
}
void delve(bool justFinishedModule)
{
if(!moduleStack.empty) with(database)
{
if(!moduleName.empty) { moduleName ~= "."; }
moduleName ~= moduleStack.front;
currentSymbol = currentSymbol is null
? (moduleStack.front in modulesTree.children)
: (moduleStack.front in currentSymbol.children);
return;
}
if(!symbolStack.empty)
{
if(justFinishedModule) with(database)
{
currentSymbol = moduleName in modules;
assert(currentSymbol !is null,
"A module that's in moduleTree " ~
"must be in modules too");
}
currentSymbol = symbolStack.front in currentSymbol.children;
return;
}
currentSymbol = null;
}
}
return SymbolStack(this, moduleStack, symbolStack);
}
private:
/** Pre-compute any data structures needed for fast cross-referencing.
*
* Currently used for modulesTree, which allows quick decisions on whether a
* module exists.
*/
void preCache()
{
foreach(name; modules.byKey)
{
auto parts = name.splitter(".");
MembersTree* node = &modulesTree;
foreach(part; parts)
{
node.type = SymbolType.Package;
MembersTree* child = part in node.children;
if(child is null)
{
node.children[part] = MembersTree.init;
child = part in node.children;
}
node = child;
}
// The leaf nodes of the module tree are packages.
node.type = SymbolType.Module;
}
}
/// Member trees of all modules, indexed by full module names.
MembersTree[string] modules;
/// Allows to quickly determine whether a module exists. Built by preCache.
MembersTree modulesTree;
/// Get members of symbol with specified name stack in specified module.
MembersTree* getMembers(string moduleName, string[] symbolStack)
{
MembersTree* members = &modules[moduleName];
foreach(namePart; symbolStack)
{
members = &members.children[namePart];
}
return members;
}
}
/// Enumberates types of symbols in the symbol database.
enum SymbolType: ubyte
{
/// A package with no module file (package.d would be considered a module).
Package,
/// A module.
Module,
/// An alias.
Alias,
/// An enum.
Enum,
/// A class.
Class,
/// A struct.
Struct,
/// An interface.
Interface,
/// A function (including e.g. constructors).
Function,
/// A template (not a template function/template class/etc).
Template,
/// Only used for enum members at the moment.
Value,
/// A variable member.
Variable
}
/// Data we keep track of for a module.
struct SymbolDataModule
{
/// Summary comment of the module, *not* processes by Markdown.
string summary;
}
private:
// Reusing Members here is a very quick hack, and we may need something better than a
// tree of AA's if generating docs for big projects is too slow.
/// Recursive tree of all members of a symbol.
struct MembersTree
{
/// Members of children of this tree node.
MembersTree[string] children;
/// Type of this symbol.
SymbolType type;
union
{
/// Data specific for a module symbol.
SymbolDataModule dataModule;
//TODO data for any other symbol types. In a union to save space.
}
}
/** Gather data about symbols in a module into a SymbolDatabase.
*
* Writes directly into the passed SymbolDatabase.
*
* Params:
*
* config = harbored-mod configuration.
* database = SymbolDatabase to gather data into.
* writer = Writer (e.g. HTMLWriter), used to determine links for symbols (as Writer
* decides where to put symbols).
* modulePath = Path of the module file.
*/
void gatherModuleData(Writer)
(ref const(Config) config, SymbolDatabase database, Writer writer, string modulePath)
{
// Load the module file.
import std.file;
ubyte[] fileBytes;
try
{
fileBytes = cast(ubyte[])modulePath.readText!(char[]);
}
catch(Exception e)
{
writefln("Failed to load file %s: will be ignored", modulePath);
return;
}
import core.memory;
scope(exit) { GC.free(fileBytes.ptr); }
// Parse the module.
LexerConfig lexConfig;
lexConfig.fileName = modulePath;
lexConfig.stringBehavior = StringBehavior.source;
auto tokens = getTokensForParser(fileBytes, lexConfig, &database.cache).array;
import main: doNothing;
import dparse.rollback_allocator;
import std.functional : toDelegate;
RollbackAllocator allocator;
Module m = parseModule(tokens, modulePath, &allocator, toDelegate(&doNothing));
// Gather data.
auto visitor = new DataGatherVisitor!Writer(config, database, writer, modulePath);
visitor.visit(m);
}
/** Visits AST nodes to gather data about symbols in a module.
*/
class DataGatherVisitor(Writer) : ASTVisitor
{
/** Construct a DataGatherVisitor.
* Params:
*
* config = Configuration data, including macros and the output directory.
* database = Database to gather data into.
* writer = Used to determine link strings.
* fileName = Module file name.
*/
this(ref const Config config, SymbolDatabase database, Writer writer, string fileName)
{
this.config = &config;
this.database = database;
this.writer = writer;
this.fileName = fileName;
}
alias visit = ASTVisitor.visit;
/// Determines module name and adds a MemberTree for it to the database.
override void visit(const Module mod)
{
import std.range : chain, iota, join, only;
import std.conv : to;
if (mod.moduleDeclaration is null)
{
writefln("Ignoring file %s: no 'module' declaration", fileName);
return;
}
auto stack = cast(string[])mod.moduleDeclaration.moduleName.identifiers.map!(a => a.text).array;
foreach(exclude; config.excludes)
{
// If module name is pkg1.pkg2.mod, we first check
// "pkg1", then "pkg1.pkg2", then "pkg1.pkg2.mod"
// i.e. we only check for full package/module names.
if(iota(stack.length + 1).map!(l => stack[0 .. l].join(".")).canFind(exclude))
{
writeln("Excluded module ", stack.join("."));
return;
}
}
moduleName = stack.join(".").to!string;
database.moduleNames ~= moduleName;
database.moduleFiles ~= fileName;
database.moduleNameToLink[moduleName] = writer.moduleLink(stack);
database.modules[moduleName] = MembersTree.init;
database.modules[moduleName].type = SymbolType.Module;
database.modules[moduleName].dataModule.summary =
commentSummary(mod.moduleDeclaration.comment);
mod.accept(this);
}
/// Gather data about various members ///
override void visit(const EnumDeclaration ed)
{
visitAggregateDeclaration!(SymbolType.Enum)(ed);
}
// Document all enum members even if they have no doc comments.
override void visit(const EnumMember member)
{
// Link to the enum owning the member (enum members themselves have no
// files/detailed explanations).
MembersTree* members = pushSymbol(member.name.text, SymbolType.Value);
scope(exit) popSymbol();
}
override void visit(const ClassDeclaration cd)
{
visitAggregateDeclaration!(SymbolType.Class)(cd);
}
override void visit(const TemplateDeclaration td)
{
visitAggregateDeclaration!(SymbolType.Template)(td);
}
override void visit(const StructDeclaration sd)
{
visitAggregateDeclaration!(SymbolType.Struct)(sd);
}
override void visit(const InterfaceDeclaration id)
{
visitAggregateDeclaration!(SymbolType.Interface)(id);
}
override void visit(const AliasDeclaration ad)
{
if (ad.comment is null)
return;
if (ad.declaratorIdentifierList !is null)
foreach (name; ad.declaratorIdentifierList.identifiers)
{
MembersTree* members = pushSymbol(name.text, SymbolType.Alias);
scope(exit) popSymbol();
}
else foreach (initializer; ad.initializers)
{
MembersTree* members = pushSymbol(initializer.name.text, SymbolType.Alias);
scope(exit) popSymbol();
}
}
override void visit(const VariableDeclaration vd)
{
foreach (const Declarator dec; vd.declarators)
{
if (vd.comment is null && dec.comment is null)
continue;
MembersTree* members = pushSymbol(dec.name.text, SymbolType.Variable);
scope(exit) popSymbol();
}
if (vd.comment !is null && vd.autoDeclaration !is null)
{
foreach (part; vd.autoDeclaration.parts) with (part)
{
MembersTree* members = pushSymbol(identifier.text,
SymbolType.Variable);
scope(exit) popSymbol();
string[] storageClasses;
foreach(stor; vd.storageClasses)
{
storageClasses ~= str(stor.token.type);
}
}
}
}
override void visit(const Constructor cons)
{
if (cons.comment is null)
return;
visitFunctionDeclaration("this", cons);
}
override void visit(const FunctionDeclaration fd)
{
if (fd.comment is null)
return;
visitFunctionDeclaration(fd.name.text, fd);
}
// Optimization: don't allow visit() for these AST nodes to result in visit()
// calls for their subnodes. This avoids most of the dynamic cast overhead.
override void visit(const AssignExpression assignExpression) {}
override void visit(const CmpExpression cmpExpression) {}
override void visit(const TernaryExpression ternaryExpression) {}
override void visit(const IdentityExpression identityExpression) {}
override void visit(const InExpression inExpression) {}
private:
/** If the comment starts with a summary, return it, otherwise return null.
*
* Note: as libdparse does not seem to recognize summaries correctly (?),
* we simply assume the first section of the comment to be the summary.
*/
string commentSummary(string comment)
{
if(comment.empty)
{
return null;
}
import core.exception: RangeError;
try
{
import ddoc.comments;
auto app = appender!string();
if (comment.length >= 3)
{
comment.unDecorateComment(app);
}
Comment c = parseComment(app.data, cast(string[string])config.macros);
if (c.sections.length)
{
return c.sections[0].content;
}
}
catch(RangeError e)
{
writeln("RangeError");
// Writer.readAndWriteComment will catch this too and
// write an error message. Not kosher to catch Errors
// but unfortunately needed with libdparse ATM (2015).
return null;
}
return null;
}
void visitAggregateDeclaration(SymbolType type, A)(const A ad)
{
if (ad.comment is null)
return;
// pushSymbol will push to stack, add tree entry and return MembersTree
// containing that entry so we can also add the aggregate to the correct
// Item array
MembersTree* members = pushSymbol(ad.name.text, type);
scope(exit) popSymbol();
ad.accept(this);
}
void visitFunctionDeclaration(Fn)(string name, Fn fn)
{
MembersTree* members = pushSymbol(name, SymbolType.Function);
scope(exit) popSymbol();
string fdName;
static if (__traits(hasMember, typeof(fn), "name"))
fdName = fn.name.text;
else
fdName = "this";
fn.accept(this);
}
/** Push a symbol to the stack, moving into its scope.
*
* Params:
*
* name = The symbol's name
* type = Type of the symbol.
*
* Returns: Tree of the *parent* symbol of the pushed symbol.
*/
MembersTree* pushSymbol(string name, SymbolType type)
{
auto parentStack = symbolStack;
symbolStack ~= name;
MembersTree* members = database.getMembers(moduleName, parentStack);
if(!(name in members.children))
{
members.children[name] = MembersTree.init;
members.children[name].type = type;
}
return members;
}
/// Leave scope of a symbol, moving back to its parent.
void popSymbol()
{
symbolStack.popBack();
}
/// Harbored-mod configuration.
const(Config)* config;
/// Database we're gathering data into.
SymbolDatabase database;
/// Used to determine links to symbols.
Writer writer;
/// Filename of this module.
string fileName;
/// Name of this module in D code.
string moduleName;
/** Namespace stack of the current symbol, without the package/module name.
*
* E.g. ["Class", "member"]
*/
string[] symbolStack;
}
|
D
|
/***********************************************************************\
* pbt.d *
* *
* Windows API header module *
* *
* Translated from MinGW Windows headers *
* by Stewart Gordon *
* *
* Placed into public domain *
\***********************************************************************/
module windows.pbt;
nothrow:
private import windows.windef;
enum : WPARAM {
PBT_APMQUERYSUSPEND,
PBT_APMQUERYSTANDBY,
PBT_APMQUERYSUSPENDFAILED,
PBT_APMQUERYSTANDBYFAILED,
PBT_APMSUSPEND,
PBT_APMSTANDBY,
PBT_APMRESUMECRITICAL,
PBT_APMRESUMESUSPEND,
PBT_APMRESUMESTANDBY,
PBT_APMBATTERYLOW,
PBT_APMPOWERSTATUSCHANGE,
PBT_APMOEMEVENT // = 11
}
const LPARAM PBTF_APMRESUMEFROMFAILURE = 1;
|
D
|
module alist;
import std.typetuple;
import std.stdio;
import half;
struct AList(T...)
{
static if (T.length >= 2 && T.length % 2 == 0)
alias Half!T Keys;
else static if (T.length >= 2 && T.length % 2 == 1)
alias Half!(T[0..$-1]) Keys;
else
alias TypeTuple!() Keys;
static if (T.length >= 2)
alias Half!(T[1..$]) Values;
else
alias TypeTuple!() Values;
template at(alias a)
{
// key not found, but default value present
static if ((staticIndexOf!(a, Keys) == -1) && (T.length % 2 == 1))
enum at = T[$-1]; // default value
else static if ((staticIndexOf!(a, Keys) == -1) && (T.length % 2 == 0))
static assert(0, "AList: no key equal to " ~ a.stringof);
else //static if (Keys[staticIndexOf!(a, Keys)] == a)
enum at = Values[staticIndexOf!(a, Keys)];
}
}
void main()
{
alias AList!( 1, "abc"
, 2, 'd'
, 3, "def"
, "foo", 3.14
, "Default") al;
writeln("Keys: ", al.Keys.stringof);
writeln("Values: ", al.Values.stringof);
writeln("at!1: ", al.at!(1));
writeln("at!2: ", al.at!(2));
writeln("at!\"foo\": ", al.at!("foo"));
writeln("Default: ", al.at!4);
}
|
D
|
/*
* DSFML - The Simple and Fast Multimedia Library for D
*
* Copyright (c) 2013 - 2017 Jeremy DeHaan (dehaan.jeremiah@gmail.com)
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the
* use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim
* that you wrote the original software. If you use this software in a product,
* an acknowledgment in the product documentation would be appreciated but is
* not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution
*/
/// A module containing configuration settings.
module dsfml.system.config;
//Check to confirm compiler is at least v2.067
static if (__VERSION__ < 2067L)
{
static assert(0, "Please upgrade your compiler to v2.067 or later");
}
/// DSFML version enum
enum
{
/// DSFML's major version number.
DSFML_VERSION_MAJOR = 2,
/// DSFML's minor version number.
DSFML_VERSION_MINOR = 4
}
//destructor output for mixing in.
enum destructorOutput =`
version (DSFML_Noisy_Destructors)
{
import dsfml.system.err;
err.writeln("Destroying ", typeof(this).stringof);
}`;
|
D
|
module graphics;
public import graphics.display : Display;
public import graphics.imageloader : ImageLoader;
public import graphics.image : Image;
|
D
|
; Copyright (C) 2008 The Android Open Source Project
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
.source T_sget_short_7.java
.class public dot.junit.opcodes.sget_short.d.T_sget_short_7
.super java/lang/Object
.method public <init>()V
.limit regs 1
invoke-direct {v0}, java/lang/Object/<init>()V
return-void
.end method
.method public run()S
.limit regs 3
sget-short v1, dot.junit.opcodes.sget_short.d.T_sget_short_7no_class.i1 S
return v1
.end method
|
D
|
// Copyright © 2012-2013, Bernard Helyer. All rights reserved.
// Copyright © 2016, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/volt/license.d (BOOST ver. 1.0).
module volt.lowerer.alloc;
import ir = volt.ir.ir;
import volt.ir.util;
import volt.interfaces;
import volt.token.location;
/**
* Creates a call to the allocDg delegate.
*
* The type of the returned expression is 'void*'. If countArg is not given,
* zero is assumed (not a array or class).
*
* @param[in] loc Location to tag expressions and types with.
* @param[in] lp LanguagePass
* @param[in] type Type to be alloced, copied smartly.
* @param[in] countArg A expression returning a value of size_t, not copied.
*/
ir.Exp buildAllocVoidPtr(in Location loc, LanguagePass lp, ir.Type type,
ir.Exp countArg = null)
{
if (countArg is null) {
auto countConst = new ir.Constant();
countConst.location = loc;
countConst.u._ulong = 0;
countConst.type = buildSizeT(loc, lp);
countArg = countConst;
}
auto adRef = new ir.ExpReference();
adRef.location = loc;
adRef.idents ~= "allocDg";
adRef.decl = lp.allocDgVariable;
auto _tidExp = new ir.Typeid();
_tidExp.location = loc;
_tidExp.type = copyTypeSmart(loc, type);
auto tidExp = buildCastSmart(loc, lp.typeInfoClass, _tidExp);
auto pfixCall = new ir.Postfix();
pfixCall.location = loc;
pfixCall.op = ir.Postfix.Op.Call;
pfixCall.child = adRef;
pfixCall.arguments = [tidExp, countArg];
return pfixCall;
}
/**
* Creates a call to the allocDg delegate.
*
* The type of the returned expression is 'type*'. If countArg is not given,
* zero is assumed (not a array or class).
*
* @param[in] loc Location to tag expressions and types with.
* @param[in] lp LanguagePass
* @param[in] type Type to be alloced, copied smartly.
* @param[in] countArg A expression returning a value of size_t, not copied.
*/
ir.Exp buildAllocTypePtr(in Location loc, LanguagePass lp, ir.Type type,
ir.Exp countArg = null)
{
auto pfixCall = buildAllocVoidPtr(loc, lp, type, countArg);
auto result = new ir.PointerType(copyTypeSmart(loc, type));
result.location = loc;
auto resultCast = new ir.Unary(result, pfixCall);
resultCast.location = loc;
return resultCast;
}
|
D
|
//**************************
// Skeleton-Mage Prototype
//**************************
PROTOTYPE Mst_Default_Skeleton_Mage(C_Npc)
{
//----- Monster ----
name = "Skelettmagier";
guild = GIL_SKELETON_MAGE;
aivar[AIV_MM_REAL_ID] = ID_SKELETON_MAGE;
level = 30;
//----- Attribute ----
attribute [ATR_STRENGTH] = 150;
attribute [ATR_DEXTERITY] = 15;
attribute [ATR_HITPOINTS_MAX] = 300;
attribute [ATR_HITPOINTS] = 300;
attribute [ATR_MANA_MAX] = 200;
attribute [ATR_MANA] = 200;
//----- Protections ----
protection [PROT_BLUNT] = 50000;
protection [PROT_EDGE] = 125000;
protection [PROT_POINT] = -1;
protection [PROT_FIRE] = 125;
protection [PROT_FLY] = 125;
protection [PROT_MAGIC] = 50;
self.aivar[AIV_Damage] = self.attribute[ATR_HITPOINTS_MAX];
//----- Damage Types ----
damagetype = DAM_EDGE;
// damage [DAM_INDEX_BLUNT] = 0;
// damage [DAM_INDEX_EDGE] = 0;
// damage [DAM_INDEX_POINT] = 0;
// damage [DAM_INDEX_FIRE] = 0;
// damage [DAM_INDEX_FLY] = 0;
// damage [DAM_INDEX_MAGIC] = 0;
//----- Kampf-Taktik ----
fight_tactic = FAI_HUMAN_STRONG;
//----- Senses & Ranges ----
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = PERC_DIST_MONSTER_ACTIVE_MAX;
aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM;
aivar[AIV_MM_FollowInWater] = FALSE;
//----- Daily Routine ----
start_aistate = ZS_MM_AllScheduler;
aivar[AIV_MM_RestStart] = OnlyRoutine;
};
//*************
// Visuals
//*************
func void B_SetVisuals_Skeleton_Mage()
{
Mdl_SetVisual (self, "HumanS.mds");
Mdl_ApplyOverlayMds (self, "humans_skeleton_fly.mds");
// Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR
Mdl_SetVisualBody (self, "Ske_Fly_Body", 1, DEFAULT, "", 1, DEFAULT, -1);
};
func void B_SetVisuals_Gespenst()
{
Mdl_SetVisual (self, "HumanS.mds");
Mdl_ApplyOverlayMds (self, "humans_skeleton_fly.mds");
// Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR
Mdl_SetVisualBody (self, "Gespenst_Body", 0, DEFAULT, "", 1, DEFAULT, -1);
};
//*********************
// Skeleton Mage
//*********************
INSTANCE SkeletonMage (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
};
INSTANCE SkeletonMage_Weg (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
};
INSTANCE SkeletonMage_Riddler (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
name = "Besonderer Skelettmagier";
CreateInvItems (self, theriddle1, 1);
};
INSTANCE SkeletonMage_DienerDesBoesen_01_01 (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
};
INSTANCE SkeletonMage_DienerDesBoesen_01_02 (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
};
INSTANCE SkeletonMage_DienerDesBoesen_02_01 (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
};
INSTANCE SkeletonMage_DienerDesBoesen_02_02 (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Skeleton_Mage();
};
INSTANCE Gespenst (Mst_Default_Skeleton_Mage)
{
B_SetVisuals_Gespenst();
};
|
D
|
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range;
void get(Args...)(ref Args args)
{
import std.traits, std.meta, std.typecons;
static if (Args.length == 1) {
alias Arg = Args[0];
static if (isArray!Arg) {
static if (isSomeChar!(ElementType!Arg)) {
args[0] = readln.chomp.to!Arg;
} else {
args[0] = readln.split.to!Arg;
}
} else static if (isTuple!Arg) {
auto input = readln.split;
static foreach (i; 0..Fields!Arg.length) {
args[0][i] = input[i].to!(Fields!Arg[i]);
}
} else {
args[0] = readln.chomp.to!Arg;
}
} else {
auto input = readln.split;
assert(input.length == Args.length);
static foreach (i; 0..Args.length) {
args[i] = input[i].to!(Args[i]);
}
}
}
void get_lines(Args...)(size_t N, ref Args args)
{
import std.traits, std.range;
static foreach (i; 0..Args.length) {
static assert(isArray!(Args[i]));
args[i].length = N;
}
foreach (i; 0..N) {
static if (Args.length == 1) {
get(args[0][i]);
} else {
auto input = readln.split;
static foreach (j; 0..Args.length) {
args[j][i] = input[j].to!(ElementType!(Args[j]));
}
}
}
}
void main()
{
int T; get(T); while (T--) {
long A, B, C, D; get(A, B, C, D);
if (A < B || D < B) {
writeln("No");
} else if (C >= B) {
writeln("Yes");
} else {
auto g = gcd(B, D);
writeln(A % g + B - g > C ? "No" : "Yes");
}
}
}
|
D
|
instance Mod_7252_SLD_Orkjaeger_MT (Npc_Default)
{
// ------ NSC ------
name = NAME_ORKJAEGER;
guild = GIL_mil;
id = 7252;
voice = 11;
flags = 0; //NPC_FLAG_IMMORTAL oder 0
npctype = NPCTYPE_MT_ORKJAEGER;
// ------ Attribute ------
B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------
EquipItem (self, ItMw_Orkschlaechter);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------
Mdl_SetVisual (self,"HUMANS.MDS");
Mdl_SetVisualBody (self,"hum_body_Naked0",3,1,"Hum_Head_Pony",5 , 1, ITAR_SLD_H);
Mdl_SetModelFatness (self, 0);
Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 50); //Grenzen für Talent-Level liegen bei 30 und 60
// ------ TA anmelden ------
daily_routine = Rtn_Start_7252;
};
FUNC VOID Rtn_Start_7252 ()
{
TA_Stand_Guarding (07,45,23,45,"OW_PATH_198_ORCGRAVEYARD6");
TA_Stand_Guarding (23,45,07,45,"OW_PATH_198_ORCGRAVEYARD6");
};
FUNC VOID Rtn_Tot_7252()
{
TA_Stand_WP (08,00,20,00,"TOT");
TA_Stand_WP (20,00,08,00,"TOT");
};
|
D
|
instance DIA_FED_EXIT(C_INFO)
{
npc = strf_1106_fed;
nr = 999;
condition = dia_fed_exit_condition;
information = dia_fed_exit_info;
permanent = TRUE;
description = DIALOG_ENDE;
};
func int dia_fed_exit_condition()
{
return TRUE;
};
func void dia_fed_exit_info()
{
AI_StopProcessInfos(self);
};
instance DIA_FED_HALLO(C_INFO)
{
npc = strf_1106_fed;
nr = 2;
condition = dia_fed_hallo_condition;
information = dia_fed_hallo_info;
permanent = FALSE;
important = TRUE;
};
func int dia_fed_hallo_condition()
{
if(Npc_IsInState(self,zs_talk) && (MIS_FAJETH_KILL_SNAPPER != LOG_SUCCESS))
{
return TRUE;
};
};
func void dia_fed_hallo_info()
{
AI_Output(self,other,"DIA_Fed_HALLO_08_00"); //Co ode mě chceš? Nikam nejdu!
AI_Output(other,self,"DIA_Fed_HALLO_15_01"); //Klídek, v pohodě - nikdo po tobě nechce, aby někam chodil.
AI_Output(self,other,"DIA_Fed_HALLO_08_02"); //Díky Innosovi. Však víš, během několika posledních dní opustilo pár chlapů tábor - a nikdo z nich se nevrátil.
AI_Output(self,other,"DIA_Fed_HALLO_08_03"); //Všechny je sežrali chňapavci. Ale mě ne. Prostě tady zůstanu do tý doby, než to skončí.
};
instance DIA_FED_SNAPPER(C_INFO)
{
npc = strf_1106_fed;
nr = 3;
condition = dia_fed_snapper_condition;
information = dia_fed_snapper_info;
permanent = FALSE;
description = "Co víš o chňapavcích?";
};
func int dia_fed_snapper_condition()
{
if(MIS_FAJETH_KILL_SNAPPER == LOG_RUNNING)
{
return TRUE;
};
};
func void dia_fed_snapper_info()
{
AI_Output(other,self,"DIA_Fed_Snapper_15_00"); //Co víš o chňapavcích?
AI_Output(self,other,"DIA_Fed_Snapper_08_01"); //Bilgot je v noci vídá. Několik z nich jich je dole u jezírka pod tmavou věží.
AI_Output(self,other,"DIA_Fed_Snapper_08_02"); //Ostatní jsou přímo nad náma - nahoře na skále. Jen čekají, až se úplně vyčerpáme.
AI_Output(self,other,"DIA_Fed_Snapper_08_03"); //Jsme tady v pasti. Brzo napadnou tábor - a udělají si krvavé hody.
AI_Output(other,self,"DIA_Fed_Snapper_15_04"); //Aha.
};
instance DIA_FED_PERM(C_INFO)
{
npc = strf_1106_fed;
nr = 5;
condition = dia_fed_perm_condition;
information = dia_fed_perm_info;
permanent = TRUE;
description = "Jsi v pořádku?";
};
func int dia_fed_perm_condition()
{
return TRUE;
};
func void dia_fed_perm_info()
{
AI_Output(other,self,"DIA_Fed_Perm_15_00"); //Jsi v pořádku?
if(MIS_FAJETH_KILL_SNAPPER != LOG_SUCCESS)
{
AI_Output(self,other,"DIA_Fed_Perm_08_01"); //Venku jsou chňapavci. Cítíš je...? Já je cítím...
}
else
{
AI_Output(self,other,"DIA_Fed_Perm_08_02"); //Vypadá to, že se chňapavci stáhli. Ale to ještě nic neznamená. Oni se vrátí - nebo vlci nebo ještěrani nebo skřeti.
AI_Output(self,other,"DIA_Fed_Perm_08_03"); //A dříve či později nás dostanou a pošmáknou si na našich mrtvolách.
};
AI_StopProcessInfos(self);
};
instance DIA_FED_PICKPOCKET(C_INFO)
{
npc = strf_1106_fed;
nr = 900;
condition = dia_fed_pickpocket_condition;
information = dia_fed_pickpocket_info;
permanent = TRUE;
description = PICKPOCKET_40;
};
func int dia_fed_pickpocket_condition()
{
return c_beklauen(32,8);
};
func void dia_fed_pickpocket_info()
{
Info_ClearChoices(dia_fed_pickpocket);
Info_AddChoice(dia_fed_pickpocket,DIALOG_BACK,dia_fed_pickpocket_back);
Info_AddChoice(dia_fed_pickpocket,DIALOG_PICKPOCKET,dia_fed_pickpocket_doit);
};
func void dia_fed_pickpocket_doit()
{
b_beklauen();
Info_ClearChoices(dia_fed_pickpocket);
};
func void dia_fed_pickpocket_back()
{
Info_ClearChoices(dia_fed_pickpocket);
};
|
D
|
module pluginadapter;
import plugin;
import std.stdio;
import std.string;
import std.file;
import std.path;
import std.conv:to;
import std.process;
string[][] getExportedFunctions(string pluginFolder)
{
if(!exists(pluginFolder))
{
writeln(pluginFolder ~ "\n\n does not exist! Creating it.");
mkdirRecurse(pluginFolder);
return [[]];
}
string[][] exporteds;
foreach(string file; dirEntries(pluginFolder, SpanMode.shallow))
{
if(isDir(file))
{
exporteds ~= [file.baseName];
foreach(DirEntry plugin; dirEntries(file, "*.d", SpanMode.shallow))
{
if(plugin.isFile)
{
exporteds[exporteds.length - 1] ~= plugin.name.stripExtension.baseName.capitalize;
}
}
}
}
return exporteds;
}
version(Posix)
{
void* _dlopen(const scope char* dllName)
{
import core.sys.posix.dlfcn : dlopen, RTLD_LAZY;
return dlopen(dllName, RTLD_LAZY);
}
}
class PluginAdapter
{
static Plugin[string] loadedPlugins;
static Plugin function()[] loadFuncs;
static void*[] dlls;
version(Windows)
{
import core.sys.windows.windows;
static alias loadDLL = LoadLibraryA;
static const (char)* err;
static void* symbolLink(void* dll, const (char)* symbolName)
{
void* ret = GetProcAddress(dll, symbolName);
import std.conv:to;
if(!ret)
err = ("Could not link symbol "~to!string(symbolName)).ptr;
return ret;
}
static const(char)* dllError()
{
const(char)* ret = err;
err = null;
return ret;
}
}
else version(Posix)
{
import core.sys.posix.dlfcn;
static alias loadDLL = _dlopen;
static alias symbolLink = dlsym;
static alias dllError = dlerror;
}
else pragma(msg, "Current system does not support dll loading! Implement it yourself or open a new issue!");
version(Posix)static const (char)* getPackName(string packName)
{
return ("libplugin"~packName~".so").ptr;
}
version(Windows)static const (char)* getPackName(string packName)
{
return ("libplugin"~packName~".dll").ptr;
}
static void loadDLLFunc(void* dll, string pluginName)
{
void* symbol = symbolLink(dll, ("export"~pluginName).ptr);
const(char)* error = dllError();
if(error)
writeln("Dynamic Library symbol link error: ", to!string(error));
else
{
Plugin function() getClass = cast(Plugin function())symbol;
Plugin p = getClass();
loadedPlugins[p.target] = p;
writeln("Loaded plugin '", p.target, "'");
}
}
static bool compilePluginDLL(string pluginFolder, string[] files, bool optDebug)
{
import std.algorithm : countUntil;
string firstFilePath = buildPath(pluginFolder, files[0]);
if(countUntil(files, "Package") == -1)
{
writeln("package not found, creating it.");
string pkg;
import std.format : format;
import std.uni : toLower;
pkg = "module "~ files[0]~";\n";
pkg~="import plugin;";
for(size_t i = 1, len = files.length; i < len; i++)
{
if(files[i] != "Package") //Remember extension was stripped and it is capitalized
pkg~="\npublic import " ~ toLower(files[i])~";";
}
pkg~= "\n\nmixin PluginLoad;";
std.file.write(buildPath(firstFilePath, "package.d"), pkg);
}
string packName = to!string(getPackName(files[0]));
string[] compileCommand =
[
"dmd", "-shared",
"-od" ~ buildPath(firstFilePath, "obj"),
"-of" ~ buildPath(firstFilePath, packName)
];
if(optDebug)
compileCommand ~= "-g";
version(X86){compileCommand ~= "-m32";}
else version(X86_64){compileCommand ~= "-m64";}
else
{
writeln("Architecture unknown, omitting architecture command for compiler");
}
version(Windows)
{
//DLL Specific things.
string dllDef = "LIBRARY \"" ~ packName ~ "\"\n";
dllDef ~= "EXETYPE NT\n";
dllDef ~= "SUBSYSTEM WINDOWS\n";
dllDef ~= "CODE SHARED EXECUTE\n";
dllDef ~= "DATA WRITE";
string dllDefName = buildPath(firstFilePath, setExtension(packName, ".def"));
if(!exists(dllDefName))
std.file.write(dllDefName, dllDef);
compileCommand ~= dllDefName;
}
compileCommand ~= "source/plugin.d";
for(size_t i = 1, len = files.length; i < len; i++)
{
compileCommand ~= buildPath(firstFilePath, setExtension(toLower(files[i]), ".d"));
}
writeln("Executing command '", compileCommand, "'");
auto ret = execute(compileCommand);
if(ret.status != 0)
writeln("DMD Log: \n\n\n", ret.output, "\n\n\n");
return true;
}
static void clean(string dllName)
{
string bName = dllName.stripExtension;
with(std.file)
{
writeln(bName);
if(exists(dllName))
remove(dllName);
if(exists(bName~".def"))
remove(bName~".def");
if(exists(bName~".exp"))
remove(bName~".exp");
if(exists(bName~".lib"))
remove(bName~".lib");
if(exists(bName~".pdb"))
remove(bName~".pdb");
}
}
static string[] loadPlugins(string pluginFolder, string[] plugins, bool regenerate, bool optDebug)
{
string[][] funcs = getExportedFunctions(pluginFolder);
import std.algorithm : countUntil;
string[] pluginsLoaded;
for(size_t i = 0, len = funcs.length; i < len; i++)
{
if(plugins.length != 0 && countUntil(plugins, funcs[i][0]) == -1)
continue;
string packName = to!string(getPackName(funcs[i][0]));
string packPath = buildPath(pluginFolder, funcs[i][0], packName);
if(!exists(packPath) || regenerate)
{
if(!regenerate)
{
writeln(packName, " does not exists. Invoke dmd? y/n");
if(readln() == "y\n")
compilePluginDLL(pluginFolder, funcs[i], optDebug);
else
{
writeln("Compile the dll first!");
continue;
}
}
else
{
clean(packPath);
compilePluginDLL(pluginFolder, funcs[i], optDebug);
}
}
void* dll = loadDLL(packPath.toStringz);
if(dll == null)
{
writeln("Could not load ", packPath);
continue;
}
else
{
pluginsLoaded ~= funcs[i][0];
dlls ~= dll;
}
for(ulong j = 1, len2 = funcs[i].length; j < len2; j++)
{
if(funcs[i][j] == "Package")
continue;
loadDLLFunc(dll, funcs[i][j]);
}
}
return pluginsLoaded;
}
}
|
D
|
not adequate to give satisfaction
not acceptable
used of persons or their behavior
not conforming to standard usage
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.