code
stringlengths 3
10M
| language
stringclasses 31
values |
|---|---|
instance Tpl_1437_Templer_Exit(C_Info)
{
npc = TPL_1437_Templer;
nr = 999;
condition = Tpl_1437_Templer_Exit_Condition;
information = Tpl_1437_Templer_Exit_Info;
important = 0;
permanent = 1;
description = DIALOG_ENDE;
};
func int Tpl_1437_Templer_Exit_Condition()
{
return TRUE;
};
func void Tpl_1437_Templer_Exit_Info()
{
AI_StopProcessInfos(self);
};
instance Tpl_1437_Templer_NERV(C_Info)
{
npc = TPL_1437_Templer;
condition = Tpl_1437_Templer_NERV_Condition;
information = Tpl_1437_Templer_NERV_Info;
important = 0;
permanent = 0;
description = "Co se děje?";
};
func int Tpl_1437_Templer_NERV_Condition()
{
return TRUE;
};
func void Tpl_1437_Templer_NERV_Info()
{
AI_Output(other,self,"Tpl_1437_Templer_NERV_Info_15_01"); //Co se děje?
AI_Output(self,other,"Tpl_1437_Templer_NERV_Info_13_02"); //Poslouchej, opravdu tady musíš každého otravovat?
AI_StopProcessInfos(self);
};
instance Tpl_1437_Templer_LEAVE(C_Info)
{
npc = TPL_1437_Templer;
condition = Tpl_1437_Templer_LEAVE_Condition;
information = Tpl_1437_Templer_LEAVE_Info;
important = 0;
permanent = 0;
description = "Všechno v pořádku?";
};
func int Tpl_1437_Templer_LEAVE_Condition()
{
if(Npc_KnowsInfo(other,Tpl_1437_Templer_NERV))
{
return TRUE;
};
};
func void Tpl_1437_Templer_LEAVE_Info()
{
AI_Output(other,self,"Tpl_1437_Templer_LEAVE_Info_15_01"); //Všechno v pořádku?
AI_Output(self,other,"Tpl_1437_Templer_LEAVE_Info_13_02"); //Chci svůj klid, jasný? Tak se kliď a dělej něco - jiného!
AI_StopProcessInfos(self);
};
instance Tpl_1437_Templer_LEAVENOW(C_Info)
{
npc = TPL_1437_Templer;
condition = Tpl_1437_Templer_LEAVENOW_Condition;
information = Tpl_1437_Templer_LEAVENOW_Info;
important = 0;
permanent = 0;
description = "Ne, nerozumím ti!";
};
func int Tpl_1437_Templer_LEAVENOW_Condition()
{
if(Npc_KnowsInfo(hero,Tpl_1437_Templer_LEAVE))
{
return TRUE;
};
};
func void Tpl_1437_Templer_LEAVENOW_Info()
{
AI_Output(other,self,"Tpl_1437_Templer_LEAVENOW_Info_15_01"); //Ne, nerozumím ti!
AI_Output(self,other,"Tpl_1437_Templer_LEAVENOW_Info_13_02"); //Dobrá, pokusím se ti to teda vysvětlit.
AI_Output(self,other,"Tpl_1437_Templer_LEAVENOW_Info_13_03"); //Vypadni!
AI_Output(self,other,"Tpl_1437_Templer_LEAVENOW_Info_13_04"); //Odejdi z dolu!
AI_Output(self,other,"Tpl_1437_Templer_LEAVENOW_Info_13_05"); //NIKDY mě už neoslovuj!
AI_Output(self,other,"Tpl_1437_Templer_LEAVENOW_Info_13_06"); //Vypadni! Nech mě o samotě!
AI_Output(self,other,"Tpl_1437_Templer_LEAVENOW_Info_13_07"); //ZTRAŤ SE!!
AI_StopProcessInfos(self);
};
instance TPL_1437_TEMPLER_HI(C_Info)
{
npc = TPL_1437_Templer;
condition = tpl_1437_templer_hi_condition;
information = tpl_1437_templer_hi_info;
important = 0;
permanent = 0;
description = "Hej, ty!";
};
func int tpl_1437_templer_hi_condition()
{
if(Npc_KnowsInfo(hero,Tpl_1437_Templer_LEAVENOW))
{
return TRUE;
};
};
func void tpl_1437_templer_hi_info()
{
AI_Output(other,self,"DIA_Fletcher_Hello_15_00"); //Hej, ty!
AI_StopProcessInfos(self);
Npc_SetTarget(self,other);
AI_StartState(self,ZS_Attack,1,"");
};
|
D
|
// REQUIRED_ARGS: -g
// https://issues.dlang.org/show_bug.cgi?id=104
// fails only with -g
Foofunc f;
alias int Foo;
alias int function(Foo) Foofunc;
|
D
|
module android.java.java.nio.channels.ScatteringByteChannel_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.java.lang.Class_d_interface;
import import0 = android.java.java.nio.ByteBuffer_d_interface;
final class ScatteringByteChannel : IJavaObject {
static immutable string[] _d_canCastTo = [
"java/nio/channels/ReadableByteChannel",
];
@Import long read(import0.ByteBuffer, int, int[]);
@Import long read(import0.ByteBuffer[]);
@Import import1.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
@Import int read(import0.ByteBuffer);
@Import bool isOpen();
@Import void close();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Ljava/nio/channels/ScatteringByteChannel;";
}
|
D
|
// Written in the D programming language.
/**
Utilities for manipulating files and scanning directories. Functions
in this module handle files as a unit, e.g., read or write one _file
at a time. For opening files and manipulating them via handles refer
to module $(LINK2 std_stdio.html,$(D std.stdio)).
Macros:
WIKI = Phobos/StdFile
Copyright: Copyright Digital Mars 2007 - 2011.
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB digitalmars.com, Walter Bright),
$(WEB erdani.org, Andrei Alexandrescu),
Jonathan M Davis
Source: $(PHOBOSSRC std/_file.d)
*/
module std.file;
import core.memory;
import core.stdc.stdio, core.stdc.stdlib, core.stdc.string,
core.stdc.errno, std.algorithm, std.array, std.conv,
std.datetime, std.exception, std.format, std.path, std.process,
std.range, std.stdio, std.string, std.traits,
std.typecons, std.typetuple, std.utf;
version (Windows)
{
import core.sys.windows.windows, std.windows.syserror;
}
else version (Posix)
{
import core.sys.posix.dirent, core.sys.posix.fcntl, core.sys.posix.sys.stat,
core.sys.posix.sys.time, core.sys.posix.unistd, core.sys.posix.utime;
}
else
static assert(false, "Module " ~ .stringof ~ " not implemented for this OS.");
version (unittest)
{
import core.thread;
private @property string deleteme() @safe
{
static _deleteme = "deleteme.dmd.unittest.pid";
static _first = true;
if(_first)
{
_deleteme = buildPath(tempDir(), _deleteme) ~ to!string(thisProcessID);
_first = false;
}
return _deleteme;
}
}
// @@@@ TEMPORARY - THIS SHOULD BE IN THE CORE @@@
// {{{
version (Windows)
{
enum FILE_ATTRIBUTE_REPARSE_POINT = 0x400;
// Required by tempPath():
private extern(Windows) DWORD GetTempPathW(DWORD nBufferLength,
LPWSTR lpBuffer);
// Required by rename():
enum MOVEFILE_REPLACE_EXISTING = 1;
private extern(Windows) DWORD MoveFileExW(LPCWSTR lpExistingFileName,
LPCWSTR lpNewFileName,
DWORD dwFlags);
}
else version (Posix)
{
deprecated alias stat_t struct_stat64;
}
// }}}
/++
Exception thrown for file I/O errors.
+/
class FileException : Exception
{
/++
OS error code.
+/
immutable uint errno;
/++
Constructor which takes an error message.
Params:
name = Name of file for which the error occurred.
msg = Message describing the error.
file = The file where the error occurred.
line = The line where the error occurred.
+/
this(in char[] name, in char[] msg, string file = __FILE__, size_t line = __LINE__) @safe pure
{
if(msg.empty)
super(name.idup, file, line);
else
super(text(name, ": ", msg), file, line);
errno = 0;
}
/++
Constructor which takes the error number ($(LUCKY GetLastError)
in Windows, $(D_PARAM errno) in Posix).
Params:
name = Name of file for which the error occurred.
errno = The error number.
file = The file where the error occurred.
Defaults to $(D __FILE__).
line = The line where the error occurred.
Defaults to $(D __LINE__).
+/
version(Windows) this(in char[] name,
uint errno = .GetLastError(),
string file = __FILE__,
size_t line = __LINE__) @safe
{
this(name, sysErrorString(errno), file, line);
this.errno = errno;
}
else version(Posix) this(in char[] name,
uint errno = .errno,
string file = __FILE__,
size_t line = __LINE__) @trusted
{
auto s = strerror(errno);
this(name, to!string(s), file, line);
this.errno = errno;
}
}
private T cenforce(T)(T condition, lazy const(char)[] name, string file = __FILE__, size_t line = __LINE__)
{
if (!condition)
{
version (Windows)
{
throw new FileException(name, .GetLastError(), file, line);
}
else version (Posix)
{
throw new FileException(name, .errno, file, line);
}
}
return condition;
}
/* **********************************
* Basic File operations.
*/
/********************************************
Read entire contents of file $(D name) and returns it as an untyped
array. If the file size is larger than $(D upTo), only $(D upTo)
bytes are read.
Example:
----
import std.file, std.stdio;
void main()
{
auto bytes = cast(ubyte[]) read("filename", 5);
if (bytes.length == 5)
writefln("The fifth byte of the file is 0x%x", bytes[4]);
}
----
Returns: Untyped array of bytes _read.
Throws: $(D FileException) on error.
*/
void[] read(in char[] name, size_t upTo = size_t.max)
{
version(Windows)
{
alias TypeTuple!(GENERIC_READ,
FILE_SHARE_READ, (SECURITY_ATTRIBUTES*).init, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
HANDLE.init)
defaults;
auto h = CreateFileW(std.utf.toUTF16z(name), defaults);
cenforce(h != INVALID_HANDLE_VALUE, name);
scope(exit) cenforce(CloseHandle(h), name);
auto size = GetFileSize(h, null);
cenforce(size != INVALID_FILE_SIZE, name);
size = min(upTo, size);
auto buf = uninitializedArray!(ubyte[])(size);
scope(failure) delete buf;
DWORD numread = void;
cenforce(ReadFile(h,buf.ptr, size, &numread, null) == 1
&& numread == size, name);
return buf[0 .. size];
}
else version(Posix)
{
// A few internal configuration parameters {
enum size_t
minInitialAlloc = 1024 * 4,
maxInitialAlloc = size_t.max / 2,
sizeIncrement = 1024 * 16,
maxSlackMemoryAllowed = 1024;
// }
immutable fd = core.sys.posix.fcntl.open(toStringz(name),
core.sys.posix.fcntl.O_RDONLY);
cenforce(fd != -1, name);
scope(exit) core.sys.posix.unistd.close(fd);
stat_t statbuf = void;
cenforce(fstat(fd, &statbuf) == 0, name);
immutable initialAlloc = to!size_t(statbuf.st_size
? min(statbuf.st_size + 1, maxInitialAlloc)
: minInitialAlloc);
void[] result = uninitializedArray!(ubyte[])(initialAlloc);
scope(failure) delete result;
size_t size = 0;
for (;;)
{
immutable actual = core.sys.posix.unistd.read(fd, result.ptr + size,
min(result.length, upTo) - size);
cenforce(actual != -1, name);
if (actual == 0) break;
size += actual;
if (size < result.length) continue;
immutable newAlloc = size + sizeIncrement;
result = GC.realloc(result.ptr, newAlloc, GC.BlkAttr.NO_SCAN)
[0 .. newAlloc];
}
return result.length - size >= maxSlackMemoryAllowed
? GC.realloc(result.ptr, size, GC.BlkAttr.NO_SCAN)[0 .. size]
: result[0 .. size];
}
}
unittest
{
write(deleteme, "1234");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
assert(read(deleteme, 2) == "12");
assert(read(deleteme) == "1234");
}
version (linux) unittest
{
// A file with "zero" length that doesn't have 0 length at all
auto s = std.file.readText("/proc/sys/kernel/osrelease");
assert(s.length > 0);
//writefln("'%s'", s);
}
/********************************************
Read and validates (using $(XREF utf, validate)) a text file. $(D S)
can be a type of array of characters of any width and constancy. No
width conversion is performed; if the width of the characters in file
$(D name) is different from the width of elements of $(D S),
validation will fail.
Returns: Array of characters read.
Throws: $(D FileException) on file error, $(D UTFException) on UTF
decoding error.
Example:
----
enforce(system("echo abc>deleteme") == 0);
scope(exit) remove("deleteme");
enforce(chomp(readText("deleteme")) == "abc");
----
*/
S readText(S = string)(in char[] name)
{
auto result = cast(S) read(name);
std.utf.validate(result);
return result;
}
unittest
{
write(deleteme, "abc\n");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
enforce(chomp(readText(deleteme)) == "abc");
}
/*********************************************
Write $(D buffer) to file $(D name).
Throws: $(D FileException) on error.
Example:
----
import std.file;
void main()
{
int[] a = [ 0, 1, 1, 2, 3, 5, 8 ];
write("filename", a);
assert(cast(int[]) read("filename") == a);
}
----
*/
void write(in char[] name, const void[] buffer)
{
version(Windows)
{
alias TypeTuple!(GENERIC_WRITE, 0, null, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
HANDLE.init)
defaults;
auto h = CreateFileW(std.utf.toUTF16z(name), defaults);
cenforce(h != INVALID_HANDLE_VALUE, name);
scope(exit) cenforce(CloseHandle(h), name);
DWORD numwritten;
cenforce(WriteFile(h, buffer.ptr, to!DWORD(buffer.length), &numwritten, null) == 1
&& buffer.length == numwritten,
name);
}
else version(Posix)
return writeImpl(name, buffer, O_CREAT | O_WRONLY | O_TRUNC);
}
/*********************************************
Appends $(D buffer) to file $(D name).
Throws: $(D FileException) on error.
Example:
----
import std.file;
void main()
{
int[] a = [ 0, 1, 1, 2, 3, 5, 8 ];
write("filename", a);
int[] b = [ 13, 21 ];
append("filename", b);
assert(cast(int[]) read("filename") == a ~ b);
}
----
*/
void append(in char[] name, in void[] buffer)
{
version(Windows)
{
alias TypeTuple!(GENERIC_WRITE,0,null,OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,HANDLE.init)
defaults;
auto h = CreateFileW(std.utf.toUTF16z(name), defaults);
cenforce(h != INVALID_HANDLE_VALUE, name);
scope(exit) cenforce(CloseHandle(h), name);
DWORD numwritten;
cenforce(SetFilePointer(h, 0, null, FILE_END) != INVALID_SET_FILE_POINTER
&& WriteFile(h,buffer.ptr,to!DWORD(buffer.length),&numwritten,null) == 1
&& buffer.length == numwritten,
name);
}
else version(Posix)
return writeImpl(name, buffer, O_APPEND | O_WRONLY | O_CREAT);
}
// Posix implementation helper for write and append
version(Posix) private void writeImpl(in char[] name,
in void[] buffer, in uint mode)
{
immutable fd = core.sys.posix.fcntl.open(toStringz(name),
mode, octal!666);
cenforce(fd != -1, name);
{
scope(failure) core.sys.posix.unistd.close(fd);
immutable size = buffer.length;
cenforce(
core.sys.posix.unistd.write(fd, buffer.ptr, size) == size,
name);
}
cenforce(core.sys.posix.unistd.close(fd) == 0, name);
}
/***************************************************
* Rename file $(D from) to $(D to).
* If the target file exists, it is overwritten.
* Throws: $(D FileException) on error.
*/
void rename(in char[] from, in char[] to)
{
version(Windows)
{
enforce(MoveFileExW(std.utf.toUTF16z(from), std.utf.toUTF16z(to), MOVEFILE_REPLACE_EXISTING),
new FileException(
text("Attempting to rename file ", from, " to ",
to)));
}
else version(Posix)
cenforce(core.stdc.stdio.rename(toStringz(from), toStringz(to)) == 0, to);
}
unittest
{
auto t1 = deleteme, t2 = deleteme~"2";
scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove();
write(t1, "1");
rename(t1, t2);
assert(readText(t2) == "1");
write(t1, "2");
rename(t1, t2);
assert(readText(t2) == "2");
}
/***************************************************
Delete file $(D name).
Throws: $(D FileException) on error.
*/
void remove(in char[] name)
{
version(Windows)
{
cenforce(DeleteFileW(std.utf.toUTF16z(name)), name);
}
else version(Posix)
cenforce(core.stdc.stdio.remove(toStringz(name)) == 0,
"Failed to remove file " ~ name);
}
version(Windows) private WIN32_FILE_ATTRIBUTE_DATA getFileAttributesWin(in char[] name)
{
WIN32_FILE_ATTRIBUTE_DATA fad;
enforce(GetFileAttributesExW(std.utf.toUTF16z(name), GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard, &fad), new FileException(name.idup));
return fad;
}
version(Windows) private ulong makeUlong(DWORD dwLow, DWORD dwHigh)
{
ULARGE_INTEGER li;
li.LowPart = dwLow;
li.HighPart = dwHigh;
return li.QuadPart;
}
/***************************************************
Get size of file $(D name) in bytes.
Throws: $(D FileException) on error (e.g., file not found).
*/
ulong getSize(in char[] name)
{
version(Windows)
{
with (getFileAttributesWin(name))
return makeUlong(nFileSizeLow, nFileSizeHigh);
}
else version(Posix)
{
stat_t statbuf = void;
cenforce(stat(toStringz(name), &statbuf) == 0, name);
return statbuf.st_size;
}
}
unittest
{
// create a file of size 1
write(deleteme, "a");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
assert(getSize(deleteme) == 1);
// create a file of size 3
write(deleteme, "abc");
assert(getSize(deleteme) == 3);
}
/++
Get the access and modified times of file or folder $(D name).
Params:
name = File/Folder name to get times for.
accessTime = Time the file/folder was last accessed.
modificationTime = Time the file/folder was last modified.
Throws:
$(D FileException) on error.
+/
void getTimes(in char[] name,
out SysTime accessTime,
out SysTime modificationTime)
{
version(Windows)
{
with (getFileAttributesWin(name))
{
accessTime = std.datetime.FILETIMEToSysTime(&ftLastAccessTime);
modificationTime = std.datetime.FILETIMEToSysTime(&ftLastWriteTime);
}
}
else version(Posix)
{
stat_t statbuf = void;
cenforce(stat(toStringz(name), &statbuf) == 0, name);
accessTime = SysTime(unixTimeToStdTime(statbuf.st_atime));
modificationTime = SysTime(unixTimeToStdTime(statbuf.st_mtime));
}
}
unittest
{
auto currTime = Clock.currTime();
write(deleteme, "a");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
SysTime accessTime1 = void;
SysTime modificationTime1 = void;
getTimes(deleteme, accessTime1, modificationTime1);
enum leeway = dur!"seconds"(5);
{
auto diffa = accessTime1 - currTime;
auto diffm = modificationTime1 - currTime;
scope(failure) writefln("[%s] [%s] [%s] [%s] [%s]", accessTime1, modificationTime1, currTime, diffa, diffm);
assert(abs(diffa) <= leeway);
assert(abs(diffm) <= leeway);
}
version(fullFileTests)
{
enum sleepTime = dur!"seconds"(2);
Thread.sleep(sleepTime);
currTime = Clock.currTime();
write(deleteme, "b");
SysTime accessTime2 = void;
SysTime modificationTime2 = void;
getTimes(deleteme, accessTime2, modificationTime2);
{
auto diffa = accessTime2 - currTime;
auto diffm = modificationTime2 - currTime;
scope(failure) writefln("[%s] [%s] [%s] [%s] [%s]", accessTime2, modificationTime2, currTime, diffa, diffm);
//There is no guarantee that the access time will be updated.
assert(abs(diffa) <= leeway + sleepTime);
assert(abs(diffm) <= leeway);
}
assert(accessTime1 <= accessTime2);
assert(modificationTime1 <= modificationTime2);
}
}
/++
$(BLUE This function is Windows-Only.)
Get creation/access/modified times of file $(D name).
This is the same as $(D getTimes) except that it also gives you the file
creation time - which isn't possible on Posix systems.
Params:
name = File name to get times for.
fileCreationTime = Time the file was created.
fileAccessTime = Time the file was last accessed.
fileModificationTime = Time the file was last modified.
Throws:
$(D FileException) on error.
+/
version(StdDdoc) void getTimesWin(in char[] name,
out SysTime fileCreationTime,
out SysTime fileAccessTime,
out SysTime fileModificationTime);
else version(Windows) void getTimesWin(in char[] name,
out SysTime fileCreationTime,
out SysTime fileAccessTime,
out SysTime fileModificationTime)
{
with (getFileAttributesWin(name))
{
fileCreationTime = std.datetime.FILETIMEToSysTime(&ftCreationTime);
fileAccessTime = std.datetime.FILETIMEToSysTime(&ftLastAccessTime);
fileModificationTime = std.datetime.FILETIMEToSysTime(&ftLastWriteTime);
}
}
version(Windows) unittest
{
auto currTime = Clock.currTime();
write(deleteme, "a");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
SysTime creationTime1 = void;
SysTime accessTime1 = void;
SysTime modificationTime1 = void;
getTimesWin(deleteme, creationTime1, accessTime1, modificationTime1);
enum leeway = dur!"seconds"(5);
{
auto diffc = creationTime1 - currTime;
auto diffa = accessTime1 - currTime;
auto diffm = modificationTime1 - currTime;
scope(failure)
{
writefln("[%s] [%s] [%s] [%s] [%s] [%s] [%s]",
creationTime1, accessTime1, modificationTime1, currTime, diffc, diffa, diffm);
}
// Deleting and recreating a file doesn't seem to always reset the "file creation time"
//assert(abs(diffc) <= leeway);
assert(abs(diffa) <= leeway);
assert(abs(diffm) <= leeway);
}
version(fullFileTests)
{
Thread.sleep(dur!"seconds"(2));
currTime = Clock.currTime();
write(deleteme, "b");
SysTime creationTime2 = void;
SysTime accessTime2 = void;
SysTime modificationTime2 = void;
getTimesWin(deleteme, creationTime2, accessTime2, modificationTime2);
{
auto diffa = accessTime2 - currTime;
auto diffm = modificationTime2 - currTime;
scope(failure)
{
writefln("[%s] [%s] [%s] [%s] [%s]",
accessTime2, modificationTime2, currTime, diffa, diffm);
}
assert(abs(diffa) <= leeway);
assert(abs(diffm) <= leeway);
}
assert(creationTime1 == creationTime2);
assert(accessTime1 <= accessTime2);
assert(modificationTime1 <= modificationTime2);
}
}
/++
Set access/modified times of file or folder $(D name).
Params:
name = File/Folder name to get times for.
accessTime = Time the file/folder was last accessed.
modificationTime = Time the file/folder was last modified.
Throws:
$(D FileException) on error.
+/
void setTimes(in char[] name,
SysTime accessTime,
SysTime modificationTime)
{
version(Windows)
{
const ta = SysTimeToFILETIME(accessTime);
const tm = SysTimeToFILETIME(modificationTime);
alias TypeTuple!(GENERIC_WRITE,
0,
null,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL |
FILE_ATTRIBUTE_DIRECTORY |
FILE_FLAG_BACKUP_SEMANTICS,
HANDLE.init)
defaults;
auto h = CreateFileW(std.utf.toUTF16z(name), defaults);
cenforce(h != INVALID_HANDLE_VALUE, name);
scope(exit)
cenforce(CloseHandle(h), name);
cenforce(SetFileTime(h, null, &ta, &tm), name);
}
else version(Posix)
{
timeval[2] t = void;
t[0] = accessTime.toTimeVal();
t[1] = modificationTime.toTimeVal();
cenforce(utimes(toStringz(name), t) == 0, name);
}
}
unittest
{
string dir = deleteme ~ r".dir/a/b/c";
string file = dir ~ "/file";
if (!exists(dir)) mkdirRecurse(dir);
{ auto f = File(file, "w"); }
foreach (path; [file, dir]) // test file and dir
{
SysTime atime = SysTime(DateTime(2010, 10, 4, 0, 0, 30));
SysTime mtime = SysTime(DateTime(2011, 10, 4, 0, 0, 30));
setTimes(path, atime, mtime);
SysTime atime_res;
SysTime mtime_res;
getTimes(path, atime_res, mtime_res);
assert(atime == atime_res);
assert(mtime == mtime_res);
}
rmdirRecurse(dir);
}
/++
Returns the time that the given file was last modified.
Throws:
$(D FileException) if the given file does not exist.
+/
SysTime timeLastModified(in char[] name)
{
version(Windows)
{
SysTime dummy = void;
SysTime ftm = void;
getTimesWin(name, dummy, dummy, ftm);
return ftm;
}
else version(Posix)
{
stat_t statbuf = void;
cenforce(stat(toStringz(name), &statbuf) == 0, name);
return SysTime(unixTimeToStdTime(statbuf.st_mtime));
}
}
/++
Returns the time that the given file was last modified. If the
file does not exist, returns $(D returnIfMissing).
A frequent usage pattern occurs in build automation tools such as
$(WEB gnu.org/software/make, make) or $(WEB
en.wikipedia.org/wiki/Apache_Ant, ant). To check whether file $(D
target) must be rebuilt from file $(D source) (i.e., $(D target) is
older than $(D source) or does not exist), use the comparison
below. The code throws a $(D FileException) if $(D source) does not
exist (as it should). On the other hand, the $(D SysTime.min) default
makes a non-existing $(D target) seem infinitely old so the test
correctly prompts building it.
Params:
name = The name of the file to get the modification time for.
returnIfMissing = The time to return if the given file does not exist.
Examples:
--------------------
if(timeLastModified(source) >= timeLastModified(target, SysTime.min))
{
// must (re)build
}
else
{
// target is up-to-date
}
--------------------
+/
SysTime timeLastModified(in char[] name, SysTime returnIfMissing)
{
version(Windows)
{
if(!exists(name))
return returnIfMissing;
SysTime dummy = void;
SysTime ftm = void;
getTimesWin(name, dummy, dummy, ftm);
return ftm;
}
else version(Posix)
{
stat_t statbuf = void;
return stat(toStringz(name), &statbuf) != 0 ?
returnIfMissing :
SysTime(unixTimeToStdTime(statbuf.st_mtime));
}
}
unittest
{
//std.process.system("echo a > deleteme") == 0 || assert(false);
if(exists(deleteme))
remove(deleteme);
write(deleteme, "a\n");
scope(exit)
{
assert(exists(deleteme));
remove(deleteme);
}
// assert(lastModified("deleteme") >
// lastModified("this file does not exist", SysTime.min));
//assert(lastModified("deleteme") > lastModified(__FILE__));
}
/++
Returns whether the given file (or directory) exists.
+/
bool exists(in char[] name) @trusted
{
version(Windows)
{
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/
// fileio/base/getfileattributes.asp
return GetFileAttributesW(std.utf.toUTF16z(name)) != 0xFFFFFFFF;
}
else version(Posix)
{
/*
The reason why we use stat (and not access) here is
the quirky behavior of access for SUID programs: if
we used access, a file may not appear to "exist",
despite that the program would be able to open it
just fine. The behavior in question is described as
follows in the access man page:
> The check is done using the calling process's real
> UID and GID, rather than the effective IDs as is
> done when actually attempting an operation (e.g.,
> open(2)) on the file. This allows set-user-ID
> programs to easily determine the invoking user's
> authority.
While various operating systems provide eaccess or
euidaccess functions, these are not part of POSIX -
so it's safer to use stat instead.
*/
stat_t statbuf = void;
return stat(toStringz(name), &statbuf) == 0;
}
}
unittest
{
assert(exists("."));
assert(!exists("this file does not exist"));
write(deleteme, "a\n");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
assert(exists(deleteme));
}
/++
Returns the attributes of the given file.
Note that the file attributes on Windows and Posix systems are
completely different. On Windows, they're what is returned by $(WEB
msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx,
GetFileAttributes), whereas on Posix systems, they're the $(LUCKY
st_mode) value which is part of the $(D stat struct) gotten by
calling the $(WEB en.wikipedia.org/wiki/Stat_%28Unix%29, $(D stat))
function.
On Posix systems, if the given file is a symbolic link, then
attributes are the attributes of the file pointed to by the symbolic
link.
Params:
name = The file to get the attributes of.
Throws: $(D FileException) on error.
+/
uint getAttributes(in char[] name)
{
version(Windows)
{
immutable result = GetFileAttributesW(std.utf.toUTF16z(name));
enforce(result != uint.max, new FileException(name.idup));
return result;
}
else version(Posix)
{
stat_t statbuf = void;
cenforce(stat(toStringz(name), &statbuf) == 0, name);
return statbuf.st_mode;
}
}
/++
If the given file is a symbolic link, then this returns the attributes of the
symbolic link itself rather than file that it points to. If the given file
is $(I not) a symbolic link, then this function returns the same result
as getAttributes.
On Windows, getLinkAttributes is identical to getAttributes. It exists on
Windows so that you don't have to special-case code for Windows when dealing
with symbolic links.
Params:
name = The file to get the symbolic link attributes of.
Throws:
$(D FileException) on error.
+/
uint getLinkAttributes(in char[] name)
{
version(Windows)
{
return getAttributes(name);
}
else version(Posix)
{
stat_t lstatbuf = void;
cenforce(lstat(toStringz(name), &lstatbuf) == 0, name);
return lstatbuf.st_mode;
}
}
/++
Returns whether the given file is a directory.
Params:
name = The path to the file.
Throws:
$(D FileException) if the given file does not exist.
Examples:
--------------------
assert(!"/etc/fonts/fonts.conf".isDir);
assert("/usr/share/include".isDir);
--------------------
+/
@property bool isDir(in char[] name)
{
version(Windows)
{
return (getAttributes(name) & FILE_ATTRIBUTE_DIRECTORY) != 0;
}
else version(Posix)
{
return (getAttributes(name) & S_IFMT) == S_IFDIR;
}
}
unittest
{
version(Windows)
{
if("C:\\Program Files\\".exists)
assert("C:\\Program Files\\".isDir);
if("C:\\Windows\\system.ini".exists)
assert(!"C:\\Windows\\system.ini".isDir);
}
else version(Posix)
{
if("/usr/include".exists)
assert("/usr/include".isDir);
if("/usr/include/assert.h".exists)
assert(!"/usr/include/assert.h".isDir);
}
}
/++
Returns whether the given file attributes are for a directory.
Params:
attributes = The file attributes.
Examples:
--------------------
assert(!attrIsDir(getAttributes("/etc/fonts/fonts.conf")));
assert(!attrIsDir(getLinkAttributes("/etc/fonts/fonts.conf")));
--------------------
+/
bool attrIsDir(uint attributes) nothrow
{
version(Windows)
{
return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
}
else version(Posix)
{
return (attributes & S_IFMT) == S_IFDIR;
}
}
unittest
{
version(Windows)
{
if("C:\\Program Files\\".exists)
{
assert(attrIsDir(getAttributes("C:\\Program Files\\")));
assert(attrIsDir(getLinkAttributes("C:\\Program Files\\")));
}
if("C:\\Windows\\system.ini".exists)
{
assert(!attrIsDir(getAttributes("C:\\Windows\\system.ini")));
assert(!attrIsDir(getLinkAttributes("C:\\Windows\\system.ini")));
}
}
else version(Posix)
{
if("/usr/include".exists)
{
assert(attrIsDir(getAttributes("/usr/include")));
assert(attrIsDir(getLinkAttributes("/usr/include")));
}
if("/usr/include/assert.h".exists)
{
assert(!attrIsDir(getAttributes("/usr/include/assert.h")));
assert(!attrIsDir(getLinkAttributes("/usr/include/assert.h")));
}
}
}
/++
Returns whether the given file (or directory) is a file.
On Windows, if a file is not a directory, then it's a file. So,
either $(D isFile) or $(D isDir) will return true for any given file.
On Posix systems, if $(D isFile) is $(D true), that indicates that the file
is a regular file (e.g. not a block not device). So, on Posix systems, it's
possible for both $(D isFile) and $(D isDir) to be $(D false) for a
particular file (in which case, it's a special file). You can use
$(D getAttributes) to get the attributes to figure out what type of special
it is, or you can use $(D DirEntry) to get at its $(D statBuf), which is the
result from $(D stat). In either case, see the man page for $(D stat) for
more information.
Params:
name = The path to the file.
Throws:
$(D FileException) if the given file does not exist.
Examples:
--------------------
assert("/etc/fonts/fonts.conf".isFile);
assert(!"/usr/share/include".isFile);
--------------------
+/
@property bool isFile(in char[] name)
{
version(Windows)
return !name.isDir;
else version(Posix)
return (getAttributes(name) & S_IFMT) == S_IFREG;
}
unittest
{
version(Windows)
{
if("C:\\Program Files\\".exists)
assert(!"C:\\Program Files\\".isFile);
if("C:\\Windows\\system.ini".exists)
assert("C:\\Windows\\system.ini".isFile);
}
else version(Posix)
{
if("/usr/include".exists)
assert(!"/usr/include".isFile);
if("/usr/include/assert.h".exists)
assert("/usr/include/assert.h".isFile);
}
}
/++
Returns whether the given file attributes are for a file.
On Windows, if a file is not a directory, it's a file. So, either
$(D attrIsFile) or $(D attrIsDir) will return $(D true) for the
attributes of any given file.
On Posix systems, if $(D attrIsFile) is $(D true), that indicates that the
file is a regular file (e.g. not a block not device). So, on Posix systems,
it's possible for both $(D attrIsFile) and $(D attrIsDir) to be $(D false)
for a particular file (in which case, it's a special file). If a file is a
special file, you can use the attributes to check what type of special file
it is (see the man page for $(D stat) for more information).
Params:
attributes = The file attributes.
Examples:
--------------------
assert(attrIsFile(getAttributes("/etc/fonts/fonts.conf")));
assert(attrIsFile(getLinkAttributes("/etc/fonts/fonts.conf")));
--------------------
+/
bool attrIsFile(uint attributes) nothrow
{
version(Windows)
{
return (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
else version(Posix)
{
return (attributes & S_IFMT) == S_IFREG;
}
}
unittest
{
version(Windows)
{
if("C:\\Program Files\\".exists)
{
assert(!attrIsFile(getAttributes("C:\\Program Files\\")));
assert(!attrIsFile(getLinkAttributes("C:\\Program Files\\")));
}
if("C:\\Windows\\system.ini".exists)
{
assert(attrIsFile(getAttributes("C:\\Windows\\system.ini")));
assert(attrIsFile(getLinkAttributes("C:\\Windows\\system.ini")));
}
}
else version(Posix)
{
if("/usr/include".exists)
{
assert(!attrIsFile(getAttributes("/usr/include")));
assert(!attrIsFile(getLinkAttributes("/usr/include")));
}
if("/usr/include/assert.h".exists)
{
assert(attrIsFile(getAttributes("/usr/include/assert.h")));
assert(attrIsFile(getLinkAttributes("/usr/include/assert.h")));
}
}
}
/++
Returns whether the given file is a symbolic link.
On Windows, returns $(D true) when the file is either a symbolic link or a
junction point.
Params:
name = The path to the file.
Throws:
$(D FileException) if the given file does not exist.
+/
@property bool isSymlink(C)(const(C)[] name)
{
version(Windows)
return (getAttributes(name) & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
else version(Posix)
return (getLinkAttributes(name) & S_IFMT) == S_IFLNK;
}
unittest
{
version(Windows)
{
if("C:\\Program Files\\".exists)
assert(!"C:\\Program Files\\".isSymlink);
if("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists)
assert("C:\\Documents and Settings\\".isSymlink);
enum fakeSymFile = "C:\\Windows\\system.ini";
if(fakeSymFile.exists)
{
assert(!fakeSymFile.isSymlink);
assert(!fakeSymFile.isSymlink);
assert(!attrIsSymlink(getAttributes(fakeSymFile)));
assert(!attrIsSymlink(getLinkAttributes(fakeSymFile)));
assert(attrIsFile(getAttributes(fakeSymFile)));
assert(attrIsFile(getLinkAttributes(fakeSymFile)));
assert(!attrIsDir(getAttributes(fakeSymFile)));
assert(!attrIsDir(getLinkAttributes(fakeSymFile)));
assert(getAttributes(fakeSymFile) == getLinkAttributes(fakeSymFile));
}
}
else version(Posix)
{
if("/usr/include".exists)
{
assert(!"/usr/include".isSymlink);
immutable symfile = deleteme ~ "_slink\0";
scope(exit) if(symfile.exists) symfile.remove();
core.sys.posix.unistd.symlink("/usr/include", symfile.ptr);
assert(symfile.isSymlink);
assert(!attrIsSymlink(getAttributes(symfile)));
assert(attrIsSymlink(getLinkAttributes(symfile)));
assert(attrIsDir(getAttributes(symfile)));
assert(!attrIsDir(getLinkAttributes(symfile)));
assert(!attrIsFile(getAttributes(symfile)));
assert(!attrIsFile(getLinkAttributes(symfile)));
}
if("/usr/include/assert.h".exists)
{
assert(!"/usr/include/assert.h".isSymlink);
immutable symfile = deleteme ~ "_slink\0";
scope(exit) if(symfile.exists) symfile.remove();
core.sys.posix.unistd.symlink("/usr/include/assert.h", symfile.ptr);
assert(symfile.isSymlink);
assert(!attrIsSymlink(getAttributes(symfile)));
assert(attrIsSymlink(getLinkAttributes(symfile)));
assert(!attrIsDir(getAttributes(symfile)));
assert(!attrIsDir(getLinkAttributes(symfile)));
assert(attrIsFile(getAttributes(symfile)));
assert(!attrIsFile(getLinkAttributes(symfile)));
}
}
}
/++
Returns whether the given file attributes are for a symbolic link.
On Windows, return $(D true) when the file is either a symbolic link or a
junction point.
Params:
attributes = The file attributes.
Examples:
--------------------
core.sys.posix.unistd.symlink("/etc/fonts/fonts.conf", "/tmp/alink");
assert(!getAttributes("/tmp/alink").isSymlink);
assert(getLinkAttributes("/tmp/alink").isSymlink);
--------------------
+/
bool attrIsSymlink(uint attributes) nothrow
{
version(Windows)
return (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
else version(Posix)
return (attributes & S_IFMT) == S_IFLNK;
}
/****************************************************
* Change directory to $(D pathname).
* Throws: $(D FileException) on error.
*/
void chdir(in char[] pathname)
{
version(Windows)
{
enforce(SetCurrentDirectoryW(std.utf.toUTF16z(pathname)),
new FileException(pathname.idup));
}
else version(Posix)
{
cenforce(core.sys.posix.unistd.chdir(toStringz(pathname)) == 0,
pathname);
}
}
/****************************************************
Make directory $(D pathname).
Throws: $(D FileException) on error.
*/
void mkdir(in char[] pathname)
{
version(Windows)
{
enforce(CreateDirectoryW(std.utf.toUTF16z(pathname), null),
new FileException(pathname.idup));
}
else version(Posix)
{
cenforce(core.sys.posix.sys.stat.mkdir(toStringz(pathname), octal!777) == 0,
pathname);
}
}
/****************************************************
* Make directory and all parent directories as needed.
*
* Throws: $(D FileException) on error.
*/
void mkdirRecurse(in char[] pathname)
{
const left = dirName(pathname);
if (!exists(left))
{
version (Windows)
{ /* Prevent infinite recursion if left is "d:\" and
* drive d does not exist.
*/
if (left.length >= 3 && left[$ - 2] == ':')
throw new FileException(left.idup);
}
mkdirRecurse(left);
}
if (!baseName(pathname).empty)
{
mkdir(pathname);
}
}
unittest
{
// bug3570
{
immutable basepath = deleteme ~ "_dir";
version (Windows)
{
immutable path = basepath ~ "\\fake\\here\\";
}
else version (Posix)
{
immutable path = basepath ~ `/fake/here/`;
}
mkdirRecurse(path);
assert(basepath.exists && basepath.isDir);
scope(exit) rmdirRecurse(basepath);
assert(path.exists && path.isDir);
}
}
/****************************************************
Remove directory $(D pathname).
Throws: $(D FileException) on error.
*/
void rmdir(in char[] pathname)
{
version(Windows)
{
cenforce(RemoveDirectoryW(std.utf.toUTF16z(pathname)),
pathname);
}
else version(Posix)
{
cenforce(core.sys.posix.unistd.rmdir(toStringz(pathname)) == 0,
pathname);
}
}
/++
$(BLUE This function is Posix-Only.)
Creates a symlink.
Params:
original = The file to link from.
link = The symlink to create.
Note:
Relative paths are relative to the current working directory,
not the files being linked to or from.
Throws:
$(D FileException) on error (which includes if the symlink already
exists).
+/
version(StdDdoc) void symlink(C1, C2)(const(C1)[] original, const(C2)[] link);
else version(Posix) void symlink(C1, C2)(const(C1)[] original, const(C2)[] link)
{
cenforce(core.sys.posix.unistd.symlink(toUTFz!(const char*)(original),
toUTFz!(const char*)(link)) == 0,
link);
}
version(Posix) unittest
{
if("/usr/include".exists)
{
immutable symfile = deleteme ~ "_slink\0";
scope(exit) if(symfile.exists) symfile.remove();
symlink("/usr/include", symfile);
assert(symfile.exists);
assert(symfile.isSymlink);
assert(!attrIsSymlink(getAttributes(symfile)));
assert(attrIsSymlink(getLinkAttributes(symfile)));
assert(attrIsDir(getAttributes(symfile)));
assert(!attrIsDir(getLinkAttributes(symfile)));
assert(!attrIsFile(getAttributes(symfile)));
assert(!attrIsFile(getLinkAttributes(symfile)));
}
if("/usr/include/assert.h".exists)
{
assert(!"/usr/include/assert.h".isSymlink);
immutable symfile = deleteme ~ "_slink\0";
scope(exit) if(symfile.exists) symfile.remove();
symlink("/usr/include/assert.h", symfile);
assert(symfile.exists);
assert(symfile.isSymlink);
assert(!attrIsSymlink(getAttributes(symfile)));
assert(attrIsSymlink(getLinkAttributes(symfile)));
assert(!attrIsDir(getAttributes(symfile)));
assert(!attrIsDir(getLinkAttributes(symfile)));
assert(attrIsFile(getAttributes(symfile)));
assert(!attrIsFile(getLinkAttributes(symfile)));
}
}
/++
$(BLUE This function is Posix-Only.)
Returns the path to the file pointed to by a symlink. Note that the
path could be either relative or absolute depending on the symlink.
If the path is relative, it's relative to the symlink, not the current
working directory.
Throws:
$(D FileException) on error.
+/
version(StdDdoc) string readLink(C)(const(C)[] link);
else version(Posix) string readLink(C)(const(C)[] link)
{
enum bufferLen = 2048;
enum maxCodeUnits = 6;
char[bufferLen] buffer;
auto linkPtr = toUTFz!(const char*)(link);
auto size = core.sys.posix.unistd.readlink(linkPtr,
buffer.ptr,
buffer.length);
cenforce(size != -1, link);
if(size <= bufferLen - maxCodeUnits)
return to!string(buffer[0 .. size]);
auto dynamicBuffer = new char[](bufferLen * 3 / 2);
foreach(i; 0 .. 10)
{
size = core.sys.posix.unistd.readlink(linkPtr,
dynamicBuffer.ptr,
dynamicBuffer.length);
cenforce(size != -1, link);
if(size <= dynamicBuffer.length - maxCodeUnits)
{
dynamicBuffer.length = size;
return assumeUnique(dynamicBuffer);
}
dynamicBuffer.length = dynamicBuffer.length * 3 / 2;
}
throw new FileException(to!string(link), "Path is too long to read.");
}
version(Posix) unittest
{
foreach(file; ["/usr/include", "/usr/include/assert.h"])
{
if(file.exists)
{
immutable symfile = deleteme ~ "_slink\0";
scope(exit) if(symfile.exists) symfile.remove();
symlink(file, symfile);
assert(readLink(symfile) == file, format("Failed file: %s", file));
}
}
assertThrown!FileException(readLink("/doesnotexist"));
}
/****************************************************
* Get current directory.
* Throws: $(D FileException) on error.
*/
version(Windows) string getcwd()
{
/* GetCurrentDirectory's return value:
1. function succeeds: the number of characters that are written to
the buffer, not including the terminating null character.
2. function fails: zero
3. the buffer (lpBuffer) is not large enough: the required size of
the buffer, in characters, including the null-terminating character.
*/
wchar[4096] buffW = void; //enough for most common case
immutable n = cenforce(GetCurrentDirectoryW(to!DWORD(buffW.length), buffW.ptr),
"getcwd");
// we can do it because toUTFX always produces a fresh string
if(n < buffW.length)
{
return toUTF8(buffW[0 .. n]);
}
else //staticBuff isn't enough
{
auto ptr = cast(wchar*) malloc(wchar.sizeof * n);
scope(exit) free(ptr);
immutable n2 = GetCurrentDirectoryW(n, ptr);
cenforce(n2 && n2 < n, "getcwd");
return toUTF8(ptr[0 .. n2]);
}
}
else version (Posix) string getcwd()
{
auto p = cenforce(core.sys.posix.unistd.getcwd(null, 0),
"cannot get cwd");
scope(exit) core.stdc.stdlib.free(p);
return p[0 .. core.stdc.string.strlen(p)].idup;
}
unittest
{
auto s = getcwd();
assert(s.length);
}
version (OSX)
private extern (C) int _NSGetExecutablePath(char* buf, uint* bufsize);
else version (FreeBSD)
private extern (C) int sysctl (const int* name, uint namelen, void* oldp,
size_t* oldlenp, const void* newp, size_t newlen);
/**
* Returns the full path of the current executable.
*
* Throws:
* $(XREF object, Exception)
*/
@trusted string thisExePath ()
{
version (OSX)
{
import core.sys.posix.stdlib : realpath;
uint size;
_NSGetExecutablePath(null, &size); // get the length of the path
auto buffer = new char[size];
_NSGetExecutablePath(buffer.ptr, &size);
auto absolutePath = realpath(buffer.ptr, null); // let the function allocate
scope (exit)
{
if (absolutePath)
free(absolutePath);
}
errnoEnforce(absolutePath);
return to!(string)(absolutePath);
}
else version (linux)
{
return readLink("/proc/self/exe");
}
else version (Windows)
{
wchar[MAX_PATH] buf;
wchar[] buffer = buf[];
while (true)
{
auto len = GetModuleFileNameW(null, buffer.ptr, cast(DWORD) buffer.length);
enforce(len, sysErrorString(GetLastError()));
if (len != buffer.length)
return to!(string)(buffer[0 .. len]);
buffer.length *= 2;
}
}
else version (FreeBSD)
{
enum
{
CTL_KERN = 1,
KERN_PROC = 14,
KERN_PROC_PATHNAME = 12
}
int[4] mib = [CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1];
size_t len;
auto result = sysctl(mib.ptr, mib.length, null, &len, null, 0); // get the length of the path
errnoEnforce(result == 0);
auto buffer = new char[len - 1];
result = sysctl(mib.ptr, mib.length, buffer.ptr, &len, null, 0);
errnoEnforce(result == 0);
return buffer.assumeUnique;
}
else
static assert(0, "thisExePath is not supported on this platform");
}
unittest
{
auto path = thisExePath();
assert(path.exists);
assert(path.isAbsolute);
assert(path.isFile);
}
version(StdDdoc)
{
/++
Info on a file, similar to what you'd get from stat on a Posix system.
+/
struct DirEntry
{
/++
Constructs a DirEntry for the given file (or directory).
Params:
path = The file (or directory) to get a DirEntry for.
Throws:
$(D FileException) if the file does not exist.
+/
this(string path);
version (Windows)
{
private this(string path, in WIN32_FIND_DATA* fd);
private this(string path, in WIN32_FIND_DATAW *fd);
}
else version (Posix)
{
private this(string path, core.sys.posix.dirent.dirent* fd);
}
/++
Returns the path to the file represented by this $(D DirEntry).
Examples:
--------------------
auto de1 = DirEntry("/etc/fonts/fonts.conf");
assert(de1.name == "/etc/fonts/fonts.conf");
auto de2 = DirEntry("/usr/share/include");
assert(de2.name == "/usr/share/include");
--------------------
+/
@property string name() const;
/++
Returns whether the file represented by this $(D DirEntry) is a
directory.
Examples:
--------------------
auto de1 = DirEntry("/etc/fonts/fonts.conf");
assert(!de1.isDir);
auto de2 = DirEntry("/usr/share/include");
assert(de2.isDir);
--------------------
+/
@property bool isDir();
/++
Returns whether the file represented by this $(D DirEntry) is a file.
On Windows, if a file is not a directory, then it's a file. So,
either $(D isFile) or $(D isDir) will return $(D true).
On Posix systems, if $(D isFile) is $(D true), that indicates that
the file is a regular file (e.g. not a block not device). So, on
Posix systems, it's possible for both $(D isFile) and $(D isDir) to
be $(D false) for a particular file (in which case, it's a special
file). You can use $(D attributes) or $(D statBuf) to get more
information about a special file (see the stat man page for more
details).
Examples:
--------------------
auto de1 = DirEntry("/etc/fonts/fonts.conf");
assert(de1.isFile);
auto de2 = DirEntry("/usr/share/include");
assert(!de2.isFile);
--------------------
+/
@property bool isFile();
/++
Returns whether the file represented by this $(D DirEntry) is a
symbolic link.
On Windows, return $(D true) when the file is either a symbolic
link or a junction point.
+/
@property bool isSymlink();
/++
Returns the size of the the file represented by this $(D DirEntry)
in bytes.
+/
@property ulong size();
/++
$(BLUE This function is Windows-Only.)
Returns the creation time of the file represented by this
$(D DirEntry).
+/
@property SysTime timeCreated() const;
/++
Returns the time that the file represented by this $(D DirEntry) was
last accessed.
Note that many file systems do not update the access time for files
(generally for performance reasons), so there's a good chance that
$(D timeLastAccessed) will return the same value as
$(D timeLastModified).
+/
@property SysTime timeLastAccessed();
/++
Returns the time that the file represented by this $(D DirEntry) was
last modified.
+/
@property SysTime timeLastModified();
/++
Returns the attributes of the file represented by this $(D DirEntry).
Note that the file attributes on Windows and Posix systems are
completely different. On, Windows, they're what is returned by
$(D GetFileAttributes)
$(WEB msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx, GetFileAttributes)
Whereas, an Posix systems, they're the $(D st_mode) value which is
part of the $(D stat) struct gotten by calling $(D stat).
On Posix systems, if the file represented by this $(D DirEntry) is a
symbolic link, then attributes are the attributes of the file
pointed to by the symbolic link.
+/
@property uint attributes();
/++
On Posix systems, if the file represented by this $(D DirEntry) is a
symbolic link, then $(D linkAttributes) are the attributes of the
symbolic link itself. Otherwise, $(D linkAttributes) is identical to
$(D attributes).
On Windows, $(D linkAttributes) is identical to $(D attributes). It
exists on Windows so that you don't have to special-case code for
Windows when dealing with symbolic links.
+/
@property uint linkAttributes();
version(Windows)
alias void* stat_t;
/++
$(BLUE This function is Posix-Only.)
The $(D stat) struct gotten from calling $(D stat).
+/
@property stat_t statBuf();
}
}
else version(Windows)
{
struct DirEntry
{
public:
alias name this;
this(string path)
{
if(!path.exists)
throw new FileException(path, "File does not exist");
_name = path;
with (getFileAttributesWin(path))
{
_size = makeUlong(nFileSizeLow, nFileSizeHigh);
_timeCreated = std.datetime.FILETIMEToSysTime(&ftCreationTime);
_timeLastAccessed = std.datetime.FILETIMEToSysTime(&ftLastAccessTime);
_timeLastModified = std.datetime.FILETIMEToSysTime(&ftLastWriteTime);
_attributes = dwFileAttributes;
}
}
private this(string path, in WIN32_FIND_DATA* fd)
{
auto clength = to!int(core.stdc.string.strlen(fd.cFileName.ptr));
// Convert cFileName[] to unicode
const wlength = MultiByteToWideChar(0, 0, fd.cFileName.ptr, clength, null, 0);
auto wbuf = new wchar[wlength];
const n = MultiByteToWideChar(0, 0, fd.cFileName.ptr, clength, wbuf.ptr, wlength);
assert(n == wlength);
// toUTF8() returns a new buffer
_name = buildPath(path, std.utf.toUTF8(wbuf[0 .. wlength]));
_size = (cast(ulong)fd.nFileSizeHigh << 32) | fd.nFileSizeLow;
_timeCreated = std.datetime.FILETIMEToSysTime(&fd.ftCreationTime);
_timeLastAccessed = std.datetime.FILETIMEToSysTime(&fd.ftLastAccessTime);
_timeLastModified = std.datetime.FILETIMEToSysTime(&fd.ftLastWriteTime);
_attributes = fd.dwFileAttributes;
}
private this(string path, in WIN32_FIND_DATAW *fd)
{
size_t clength = std.string.wcslen(fd.cFileName.ptr);
_name = std.utf.toUTF8(fd.cFileName[0 .. clength]);
_name = buildPath(path, std.utf.toUTF8(fd.cFileName[0 .. clength]));
_size = (cast(ulong)fd.nFileSizeHigh << 32) | fd.nFileSizeLow;
_timeCreated = std.datetime.FILETIMEToSysTime(&fd.ftCreationTime);
_timeLastAccessed = std.datetime.FILETIMEToSysTime(&fd.ftLastAccessTime);
_timeLastModified = std.datetime.FILETIMEToSysTime(&fd.ftLastWriteTime);
_attributes = fd.dwFileAttributes;
}
@property string name() const pure nothrow
{
return _name;
}
@property bool isDir() const pure nothrow
{
return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
}
@property bool isFile() const pure nothrow
{
//Are there no options in Windows other than directory and file?
//If there are, then this probably isn't the best way to determine
//whether this DirEntry is a file or not.
return !isDir;
}
@property bool isSymlink() const pure nothrow
{
return (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
}
@property ulong size() const pure nothrow
{
return _size;
}
@property SysTime timeCreated() const pure nothrow
{
return cast(SysTime)_timeCreated;
}
@property SysTime timeLastAccessed() const pure nothrow
{
return cast(SysTime)_timeLastAccessed;
}
@property SysTime timeLastModified() const pure nothrow
{
return cast(SysTime)_timeLastModified;
}
@property uint attributes() const pure nothrow
{
return _attributes;
}
@property uint linkAttributes() const pure nothrow
{
return _attributes;
}
private:
string _name; /// The file or directory represented by this DirEntry.
SysTime _timeCreated; /// The time when the file was created.
SysTime _timeLastAccessed; /// The time when the file was last accessed.
SysTime _timeLastModified; /// The time when the file was last modified.
ulong _size; /// The size of the file in bytes.
uint _attributes; /// The file attributes from WIN32_FIND_DATAW.
}
}
else version(Posix)
{
struct DirEntry
{
public:
alias name this;
this(string path)
{
if(!path.exists)
throw new FileException(path, "File does not exist");
_name = path;
_didLStat = false;
_didStat = false;
_dTypeSet = false;
}
private this(string path, core.sys.posix.dirent.dirent* fd)
{
immutable len = core.stdc.string.strlen(fd.d_name.ptr);
_name = buildPath(path, fd.d_name[0 .. len]);
_didLStat = false;
_didStat = false;
//fd_d_type doesn't work for all file systems,
//in which case the result is DT_UNKOWN. But we
//can determine the correct type from lstat, so
//we'll only set the dtype here if we could
//correctly determine it (not lstat in the case
//of DT_UNKNOWN in case we don't ever actually
//need the dtype, thus potentially avoiding the
//cost of calling lstat).
if(fd.d_type != DT_UNKNOWN)
{
_dType = fd.d_type;
_dTypeSet = true;
}
else
_dTypeSet = false;
}
@property string name() const pure nothrow
{
return _name;
}
@property bool isDir()
{
_ensureStatDone();
return (_statBuf.st_mode & S_IFMT) == S_IFDIR;
}
@property bool isFile()
{
_ensureStatDone();
return (_statBuf.st_mode & S_IFMT) == S_IFREG;
}
@property bool isSymlink()
{
_ensureLStatDone();
return (_lstatMode & S_IFMT) == S_IFLNK;
}
@property ulong size()
{
_ensureStatDone();
return _statBuf.st_size;
}
@property SysTime timeStatusChanged()
{
_ensureStatDone();
return SysTime(unixTimeToStdTime(_statBuf.st_ctime));
}
@property SysTime timeLastAccessed()
{
_ensureStatDone();
return SysTime(unixTimeToStdTime(_statBuf.st_ctime));
}
@property SysTime timeLastModified()
{
_ensureStatDone();
return SysTime(unixTimeToStdTime(_statBuf.st_mtime));
}
@property uint attributes()
{
_ensureStatDone();
return _statBuf.st_mode;
}
@property uint linkAttributes()
{
_ensureLStatDone();
return _lstatMode;
}
@property stat_t statBuf()
{
_ensureStatDone();
return _statBuf;
}
private:
/++
This is to support lazy evaluation, because doing stat's is
expensive and not always needed.
+/
void _ensureStatDone()
{
if(_didStat)
return;
enforce(stat(toStringz(_name), &_statBuf) == 0,
"Failed to stat file `" ~ _name ~ "'");
_didStat = true;
}
/++
This is to support lazy evaluation, because doing stat's is
expensive and not always needed.
+/
void _ensureLStatDone()
{
if(_didLStat)
return;
stat_t statbuf = void;
enforce(lstat(toStringz(_name), &statbuf) == 0,
"Failed to stat file `" ~ _name ~ "'");
_lstatMode = statbuf.st_mode;
_dTypeSet = true;
_didLStat = true;
}
string _name; /// The file or directory represented by this DirEntry.
stat_t _statBuf = void; /// The result of stat().
uint _lstatMode; /// The stat mode from lstat().
ubyte _dType; /// The type of the file.
bool _didLStat = false; /// Whether lstat() has been called for this DirEntry.
bool _didStat = false; /// Whether stat() has been called for this DirEntry.
bool _dTypeSet = false; /// Whether the dType of the file has been set.
}
}
unittest
{
version(Windows)
{
if("C:\\Program Files\\".exists)
{
auto de = DirEntry("C:\\Program Files\\");
assert(!de.isFile);
assert(de.isDir);
assert(!de.isSymlink);
}
if("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists)
{
auto de = DirEntry("C:\\Documents and Settings\\");
assert(de.isSymlink);
}
if("C:\\Windows\\system.ini".exists)
{
auto de = DirEntry("C:\\Windows\\system.ini");
assert(de.isFile);
assert(!de.isDir);
assert(!de.isSymlink);
}
}
else version(Posix)
{
if("/usr/include".exists)
{
{
auto de = DirEntry("/usr/include");
assert(!de.isFile);
assert(de.isDir);
assert(!de.isSymlink);
}
immutable symfile = deleteme ~ "_slink\0";
scope(exit) if(symfile.exists) symfile.remove();
core.sys.posix.unistd.symlink("/usr/include", symfile.ptr);
{
auto de = DirEntry(symfile);
assert(!de.isFile);
assert(de.isDir);
assert(de.isSymlink);
}
}
if("/usr/include/assert.h".exists)
{
auto de = DirEntry("/usr/include/assert.h");
assert(de.isFile);
assert(!de.isDir);
assert(!de.isSymlink);
}
}
}
/***************************************************
Copy file $(D from) to file $(D to). File timestamps are preserved.
If the target file exists, it is overwritten.
Throws: $(D FileException) on error.
*/
void copy(in char[] from, in char[] to)
{
version(Windows)
{
immutable result = CopyFileW(std.utf.toUTF16z(from), std.utf.toUTF16z(to), false);
if (!result)
throw new FileException(to.idup);
}
else version(Posix)
{
immutable fd = core.sys.posix.fcntl.open(toStringz(from), O_RDONLY);
cenforce(fd != -1, from);
scope(exit) core.sys.posix.unistd.close(fd);
stat_t statbuf = void;
cenforce(fstat(fd, &statbuf) == 0, from);
//cenforce(core.sys.posix.sys.stat.fstat(fd, &statbuf) == 0, from);
auto toz = toStringz(to);
immutable fdw = core.sys.posix.fcntl.open(toz,
O_CREAT | O_WRONLY | O_TRUNC, octal!666);
cenforce(fdw != -1, from);
scope(failure) core.stdc.stdio.remove(toz);
{
scope(failure) core.sys.posix.unistd.close(fdw);
auto BUFSIZ = 4096u * 16;
auto buf = core.stdc.stdlib.malloc(BUFSIZ);
if (!buf)
{
BUFSIZ = 4096;
buf = core.stdc.stdlib.malloc(BUFSIZ);
buf || assert(false, "Out of memory in std.file.copy");
}
scope(exit) core.stdc.stdlib.free(buf);
for (auto size = statbuf.st_size; size; )
{
immutable toxfer = (size > BUFSIZ) ? BUFSIZ : cast(size_t) size;
cenforce(
core.sys.posix.unistd.read(fd, buf, toxfer) == toxfer
&& core.sys.posix.unistd.write(fdw, buf, toxfer) == toxfer,
from);
assert(size >= toxfer);
size -= toxfer;
}
}
cenforce(core.sys.posix.unistd.close(fdw) != -1, from);
utimbuf utim = void;
utim.actime = cast(time_t)statbuf.st_atime;
utim.modtime = cast(time_t)statbuf.st_mtime;
cenforce(utime(toz, &utim) != -1, from);
}
}
unittest
{
auto t1 = deleteme, t2 = deleteme~"2";
scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove();
write(t1, "1");
copy(t1, t2);
assert(readText(t2) == "1");
write(t1, "2");
copy(t1, t2);
assert(readText(t2) == "2");
}
/++
Remove directory and all of its content and subdirectories,
recursively.
Throws:
$(D FileException) if there is an error (including if the given
file is not a directory).
+/
void rmdirRecurse(in char[] pathname)
{
//No references to pathname will be kept after rmdirRecurse,
//so the cast is safe
rmdirRecurse(DirEntry(cast(string)pathname));
}
/++
Remove directory and all of its content and subdirectories,
recursively.
Throws:
$(D FileException) if there is an error (including if the given
file is not a directory).
+/
void rmdirRecurse(ref DirEntry de)
{
if(!de.isDir)
throw new FileException(de.name, "Not a directory");
if(de.isSymlink)
remove(de.name);
else
{
// all children, recursively depth-first
foreach(DirEntry e; dirEntries(de.name, SpanMode.depth, false))
{
attrIsDir(e.linkAttributes) ? rmdir(e.name) : remove(e.name);
}
// the dir itself
rmdir(de.name);
}
}
///ditto
//Note, without this overload, passing an RValue DirEntry still works, but
//actually fully reconstructs a DirEntry inside the
//"rmdirRecurse(in char[] pathname)" implementation. That is needlessly
//expensive.
//A DirEntry is a bit big (72B), so keeping the "by ref" signature is desirable.
void rmdirRecurse(DirEntry de)
{
rmdirRecurse(de);
}
version(Windows) unittest
{
auto d = deleteme ~ r".dir\a\b\c\d\e\f\g";
mkdirRecurse(d);
rmdirRecurse(deleteme ~ ".dir");
enforce(!exists(deleteme ~ ".dir"));
}
version(Posix) unittest
{
collectException(rmdirRecurse(deleteme));
auto d = deleteme~"/a/b/c/d/e/f/g";
enforce(collectException(mkdir(d)));
mkdirRecurse(d);
core.sys.posix.unistd.symlink((deleteme~"/a/b/c\0").ptr,
(deleteme~"/link\0").ptr);
rmdirRecurse(deleteme~"/link");
enforce(exists(d));
rmdirRecurse(deleteme);
enforce(!exists(deleteme));
d = deleteme~"/a/b/c/d/e/f/g";
mkdirRecurse(d);
std.process.system("ln -sf "~deleteme~"/a/b/c "~deleteme~"/link");
rmdirRecurse(deleteme);
enforce(!exists(deleteme));
}
unittest
{
void[] buf;
buf = new void[10];
(cast(byte[])buf)[] = 3;
if (exists("unittest_write.tmp")) remove("unittest_write.tmp");
write("unittest_write.tmp", buf);
void buf2[] = read("unittest_write.tmp");
assert(buf == buf2);
copy("unittest_write.tmp", "unittest_write2.tmp");
buf2 = read("unittest_write2.tmp");
assert(buf == buf2);
remove("unittest_write.tmp");
assert(!exists("unittest_write.tmp"));
remove("unittest_write2.tmp");
assert(!exists("unittest_write2.tmp"));
}
/**
* Dictates directory spanning policy for $(D_PARAM dirEntries) (see below).
*/
enum SpanMode
{
/** Only spans one directory. */
shallow,
/** Spans the directory depth-first, i.e. the content of any
subdirectory is spanned before that subdirectory itself. Useful
e.g. when recursively deleting files. */
depth,
/** Spans the directory breadth-first, i.e. the content of any
subdirectory is spanned right after that subdirectory itself. */
breadth,
}
private struct DirIteratorImpl
{
SpanMode _mode;
// Whether we should follow symlinked directories while iterating.
// It also indicates whether we should avoid functions which call
// stat (since we should only need lstat in this case and it would
// be more efficient to not call stat in addition to lstat).
bool _followSymlink;
DirEntry _cur;
Appender!(DirHandle[]) _stack;
Appender!(DirEntry[]) _stashed; //used in depth first mode
//stack helpers
void pushExtra(DirEntry de){ _stashed.put(de); }
//ditto
bool hasExtra(){ return !_stashed.data.empty; }
//ditto
DirEntry popExtra()
{
DirEntry de;
de = _stashed.data[$-1];
_stashed.shrinkTo(_stashed.data.length - 1);
return de;
}
version(Windows)
{
struct DirHandle
{
string dirpath;
HANDLE h;
}
bool stepIn(string directory)
{
string search_pattern = buildPath(directory, "*.*");
WIN32_FIND_DATAW findinfo;
HANDLE h = FindFirstFileW(toUTF16z(search_pattern), &findinfo);
cenforce(h != INVALID_HANDLE_VALUE, directory);
_stack.put(DirHandle(directory, h));
return toNext(false, &findinfo);
}
bool next()
{
if(_stack.data.empty)
return false;
WIN32_FIND_DATAW findinfo;
return toNext(true, &findinfo);
}
bool toNext(bool fetch, WIN32_FIND_DATAW* findinfo)
{
if(fetch)
{
if(FindNextFileW(_stack.data[$-1].h, findinfo) == FALSE)
{
popDirStack();
return false;
}
}
while( std.string.wcscmp(findinfo.cFileName.ptr, ".") == 0
|| std.string.wcscmp(findinfo.cFileName.ptr, "..") == 0)
if(FindNextFileW(_stack.data[$-1].h, findinfo) == FALSE)
{
popDirStack();
return false;
}
_cur = DirEntry(_stack.data[$-1].dirpath, findinfo);
return true;
}
bool toNext(bool fetch, WIN32_FIND_DATA* findinfo)
{
if(fetch)
{
if(FindNextFileA(_stack.data[$-1].h, findinfo) == FALSE)
{
popDirStack();
return false;
}
}
while( core.stdc.string.strcmp(findinfo.cFileName.ptr, ".") == 0
|| core.stdc.string.strcmp(findinfo.cFileName.ptr, "..") == 0)
if(FindNextFileA(_stack.data[$-1].h, findinfo) == FALSE)
{
popDirStack();
return false;
}
_cur = DirEntry(_stack.data[$-1].dirpath, findinfo);
return true;
}
void popDirStack()
{
assert(!_stack.data.empty);
FindClose(_stack.data[$-1].h);
_stack.shrinkTo(_stack.data.length-1);
}
void releaseDirStack()
{
foreach( d; _stack.data)
FindClose(d.h);
}
bool mayStepIn()
{
return _followSymlink ? _cur.isDir : _cur.isDir && !_cur.isSymlink;
}
}
else version(Posix)
{
struct DirHandle
{
string dirpath;
DIR* h;
}
bool stepIn(string directory)
{
auto h = cenforce(opendir(toStringz(directory)), directory);
_stack.put(DirHandle(directory, h));
return next();
}
bool next()
{
if(_stack.data.empty)
return false;
for(dirent* fdata; (fdata = readdir(_stack.data[$-1].h)) != null; )
{
// Skip "." and ".."
if(core.stdc.string.strcmp(fdata.d_name.ptr, ".") &&
core.stdc.string.strcmp(fdata.d_name.ptr, "..") )
{
_cur = DirEntry(_stack.data[$-1].dirpath, fdata);
return true;
}
}
popDirStack();
return false;
}
void popDirStack()
{
assert(!_stack.data.empty);
closedir(_stack.data[$-1].h);
_stack.shrinkTo(_stack.data.length-1);
}
void releaseDirStack()
{
foreach( d; _stack.data)
closedir(d.h);
}
bool mayStepIn()
{
return _followSymlink ? _cur.isDir : attrIsDir(_cur.linkAttributes);
}
}
this(string pathname, SpanMode mode, bool followSymlink)
{
_mode = mode;
_followSymlink = followSymlink;
_stack = appender(cast(DirHandle[])[]);
if(_mode == SpanMode.depth)
_stashed = appender(cast(DirEntry[])[]);
if(stepIn(pathname))
{
if(_mode == SpanMode.depth)
while(mayStepIn())
{
auto thisDir = _cur;
if(stepIn(_cur.name))
{
pushExtra(thisDir);
}
else
break;
}
}
}
@property bool empty(){ return _stashed.data.empty && _stack.data.empty; }
@property DirEntry front(){ return _cur; }
void popFront()
{
switch(_mode)
{
case SpanMode.depth:
if(next())
{
while(mayStepIn())
{
auto thisDir = _cur;
if(stepIn(_cur.name))
{
pushExtra(thisDir);
}
else
break;
}
}
else if(hasExtra())
_cur = popExtra();
break;
case SpanMode.breadth:
if(mayStepIn())
{
if(!stepIn(_cur.name))
while(!empty && !next()){}
}
else
while(!empty && !next()){}
break;
default:
next();
}
}
~this()
{
releaseDirStack();
}
}
struct DirIterator
{
private:
RefCounted!(DirIteratorImpl, RefCountedAutoInitialize.no) impl;
this(string pathname, SpanMode mode, bool followSymlink)
{
impl = typeof(impl)(pathname, mode, followSymlink);
}
public:
@property bool empty(){ return impl.empty; }
@property DirEntry front(){ return impl.front; }
void popFront(){ impl.popFront(); }
}
/++
Returns an input range of DirEntry that lazily iterates a given directory,
also provides two ways of foreach iteration. The iteration variable can be of
type $(D_PARAM string) if only the name is needed, or $(D_PARAM DirEntry)
if additional details are needed. The span mode dictates the how the
directory is traversed. The name of the each directory entry iterated
contains the absolute path.
Params:
path = The directory to iterate over.
mode = Whether the directory's sub-directories should be iterated
over depth-first ($(D_PARAM depth)), breadth-first
($(D_PARAM breadth)), or not at all ($(D_PARAM shallow)).
followSymlink = Whether symbolic links which point to directories
should be treated as directories and their contents
iterated over.
Throws:
$(D FileException) if the directory does not exist.
Examples:
--------------------
// Iterate a directory in depth
foreach (string name; dirEntries("destroy/me", SpanMode.depth))
{
remove(name);
}
// Iterate a directory in breadth
foreach (string name; dirEntries(".", SpanMode.breadth))
{
writeln(name);
}
// Iterate a directory and get detailed info about it
foreach (DirEntry e; dirEntries("dmd-testing", SpanMode.breadth))
{
writeln(e.name, "\t", e.size);
}
// Iterate over all *.d files in current directory and all its subdirectories
auto dFiles = filter!`endsWith(a.name,".d")`(dirEntries(".",SpanMode.depth));
foreach(d; dFiles)
writeln(d.name);
// Hook it up with std.parallelism to compile them all in parallel:
foreach(d; parallel(dFiles, 1)) //passes by 1 file to each thread
{
string cmd = "dmd -c " ~ d.name;
writeln(cmd);
std.process.system(cmd);
}
--------------------
+/
auto dirEntries(string path, SpanMode mode, bool followSymlink = true)
{
return DirIterator(path, mode, followSymlink);
}
unittest
{
string testdir = "deleteme.dmd.unittest.std.file" ~ to!string(getpid()); // needs to be relative
mkdirRecurse(buildPath(testdir, "somedir"));
scope(exit) rmdirRecurse(testdir);
write(buildPath(testdir, "somefile"), null);
write(buildPath(testdir, "somedir", "somedeepfile"), null);
// testing range interface
size_t equalEntries(string relpath, SpanMode mode)
{
auto len = enforce(walkLength(dirEntries(absolutePath(relpath), mode)));
assert(walkLength(dirEntries(relpath, mode)) == len);
assert(equal(
map!(a => std.path.absolutePath(a.name))(dirEntries(relpath, mode)),
map!(a => a.name)(dirEntries(absolutePath(relpath), mode))));
return len;
}
assert(equalEntries(testdir, SpanMode.shallow) == 2);
assert(equalEntries(testdir, SpanMode.depth) == 3);
assert(equalEntries(testdir, SpanMode.breadth) == 3);
// testing opApply
foreach (string name; dirEntries(testdir, SpanMode.breadth))
{
//writeln(name);
assert(name.startsWith(testdir));
}
foreach (DirEntry e; dirEntries(absolutePath(testdir), SpanMode.breadth))
{
//writeln(name);
assert(e.isFile || e.isDir, e.name);
}
}
unittest
{
//issue 7264
foreach (string name; dirEntries(".", "*.d", SpanMode.breadth))
{
}
foreach (entry; dirEntries(".", SpanMode.breadth))
{
static assert(is(typeof(entry) == DirEntry));
}
//issue 7138
auto a = array(dirEntries(".", SpanMode.shallow));
}
/++
Convenience wrapper for filtering file names with a glob pattern.
Params:
path = The directory to iterate over.
pattern = String with wildcards, such as $(RED "*.d"). The supported
wildcard strings are described under
$(XREF path, globMatch).
mode = Whether the directory's sub-directories should be iterated
over depth-first ($(D_PARAM depth)), breadth-first
($(D_PARAM breadth)), or not at all ($(D_PARAM shallow)).
followSymlink = Whether symbolic links which point to directories
should be treated as directories and their contents
iterated over.
Throws:
$(D FileException) if the directory does not exist.
Examples:
--------------------
// Iterate over all D source files in current directory and all its
// subdirectories
auto dFiles = dirEntries(".","*.{d,di}",SpanMode.depth);
foreach(d; dFiles)
writeln(d.name);
--------------------
+/
auto dirEntries(string path, string pattern, SpanMode mode,
bool followSymlink = true)
{
bool f(DirEntry de) { return globMatch(baseName(de.name), pattern); }
return filter!f(DirIterator(path, mode, followSymlink));
}
/++
$(RED Deprecated. It will be removed in July 2014.
Please use $(LREF DirEntry) constructor directly instead.)
Returns a DirEntry for the given file (or directory).
Params:
name = The file (or directory) to get a DirEntry for.
Throws:
$(D FileException) if the file does not exist.
+/
deprecated("Please use DirEntry constructor directly instead.")
DirEntry dirEntry(in char[] name)
{
return DirEntry(name.idup);
}
//Test dirEntry with a directory.
unittest
{
auto before = Clock.currTime();
Thread.sleep(dur!"seconds"(2));
immutable path = deleteme ~ "_dir";
scope(exit) { if(path.exists) rmdirRecurse(path); }
mkdir(path);
Thread.sleep(dur!"seconds"(2));
auto de = dirEntry(path);
assert(de.name == path);
assert(de.isDir);
assert(!de.isFile);
assert(!de.isSymlink);
assert(de.isDir == path.isDir);
assert(de.isFile == path.isFile);
assert(de.isSymlink == path.isSymlink);
assert(de.size == path.getSize());
assert(de.attributes == getAttributes(path));
assert(de.linkAttributes == getLinkAttributes(path));
auto now = Clock.currTime();
scope(failure) writefln("[%s] [%s] [%s] [%s]", before, de.timeLastAccessed, de.timeLastModified, now);
assert(de.timeLastAccessed > before);
assert(de.timeLastAccessed < now);
assert(de.timeLastModified > before);
assert(de.timeLastModified < now);
assert(attrIsDir(de.attributes));
assert(attrIsDir(de.linkAttributes));
assert(!attrIsFile(de.attributes));
assert(!attrIsFile(de.linkAttributes));
assert(!attrIsSymlink(de.attributes));
assert(!attrIsSymlink(de.linkAttributes));
version(Windows)
{
assert(de.timeCreated > before);
assert(de.timeCreated < now);
}
else version(Posix)
{
assert(de.timeStatusChanged > before);
assert(de.timeStatusChanged < now);
assert(de.attributes == de.statBuf.st_mode);
}
}
//Test dirEntry with a file.
unittest
{
auto before = Clock.currTime();
Thread.sleep(dur!"seconds"(2));
immutable path = deleteme ~ "_file";
scope(exit) { if(path.exists) remove(path); }
write(path, "hello world");
Thread.sleep(dur!"seconds"(2));
auto de = dirEntry(path);
assert(de.name == path);
assert(!de.isDir);
assert(de.isFile);
assert(!de.isSymlink);
assert(de.isDir == path.isDir);
assert(de.isFile == path.isFile);
assert(de.isSymlink == path.isSymlink);
assert(de.size == path.getSize());
assert(de.attributes == getAttributes(path));
assert(de.linkAttributes == getLinkAttributes(path));
auto now = Clock.currTime();
scope(failure) writefln("[%s] [%s] [%s] [%s]", before, de.timeLastAccessed, de.timeLastModified, now);
assert(de.timeLastAccessed > before);
assert(de.timeLastAccessed < now);
assert(de.timeLastModified > before);
assert(de.timeLastModified < now);
assert(!attrIsDir(de.attributes));
assert(!attrIsDir(de.linkAttributes));
assert(attrIsFile(de.attributes));
assert(attrIsFile(de.linkAttributes));
assert(!attrIsSymlink(de.attributes));
assert(!attrIsSymlink(de.linkAttributes));
version(Windows)
{
assert(de.timeCreated > before);
assert(de.timeCreated < now);
}
else version(Posix)
{
assert(de.timeStatusChanged > before);
assert(de.timeStatusChanged < now);
assert(de.attributes == de.statBuf.st_mode);
}
}
//Test dirEntry with a symlink to a directory.
version(linux) unittest
{
auto before = Clock.currTime();
Thread.sleep(dur!"seconds"(2));
immutable orig = deleteme ~ "_dir";
mkdir(orig);
immutable path = deleteme ~ "_slink";
scope(exit) { if(orig.exists) rmdirRecurse(orig); }
scope(exit) { if(path.exists) remove(path); }
core.sys.posix.unistd.symlink((orig ~ "\0").ptr, (path ~ "\0").ptr);
Thread.sleep(dur!"seconds"(2));
auto de = dirEntry(path);
assert(de.name == path);
assert(de.isDir);
assert(!de.isFile);
assert(de.isSymlink);
assert(de.isDir == path.isDir);
assert(de.isFile == path.isFile);
assert(de.isSymlink == path.isSymlink);
assert(de.size == path.getSize());
assert(de.attributes == getAttributes(path));
assert(de.linkAttributes == getLinkAttributes(path));
auto now = Clock.currTime();
scope(failure) writefln("[%s] [%s] [%s] [%s]", before, de.timeLastAccessed, de.timeLastModified, now);
assert(de.timeLastAccessed > before);
assert(de.timeLastAccessed < now);
assert(de.timeLastModified > before);
assert(de.timeLastModified < now);
assert(attrIsDir(de.attributes));
assert(!attrIsDir(de.linkAttributes));
assert(!attrIsFile(de.attributes));
assert(!attrIsFile(de.linkAttributes));
assert(!attrIsSymlink(de.attributes));
assert(attrIsSymlink(de.linkAttributes));
assert(de.timeStatusChanged > before);
assert(de.timeStatusChanged < now);
assert(de.attributes == de.statBuf.st_mode);
}
//Test dirEntry with a symlink to a file.
version(linux) unittest
{
auto before = Clock.currTime();
Thread.sleep(dur!"seconds"(2));
immutable orig = deleteme ~ "_file";
write(orig, "hello world");
immutable path = deleteme ~ "_slink";
scope(exit) { if(orig.exists) remove(orig); }
scope(exit) { if(path.exists) remove(path); }
core.sys.posix.unistd.symlink((orig ~ "\0").ptr, (path ~ "\0").ptr);
Thread.sleep(dur!"seconds"(2));
auto de = dirEntry(path);
assert(de.name == path);
assert(!de.isDir);
assert(de.isFile);
assert(de.isSymlink);
assert(de.isDir == path.isDir);
assert(de.isFile == path.isFile);
assert(de.isSymlink == path.isSymlink);
assert(de.size == path.getSize());
assert(de.attributes == getAttributes(path));
assert(de.linkAttributes == getLinkAttributes(path));
auto now = Clock.currTime();
scope(failure) writefln("[%s] [%s] [%s] [%s]", before, de.timeLastAccessed, de.timeLastModified, now);
assert(de.timeLastAccessed > before);
assert(de.timeLastAccessed < now);
assert(de.timeLastModified > before);
assert(de.timeLastModified < now);
assert(!attrIsDir(de.attributes));
assert(!attrIsDir(de.linkAttributes));
assert(attrIsFile(de.attributes));
assert(!attrIsFile(de.linkAttributes));
assert(!attrIsSymlink(de.attributes));
assert(attrIsSymlink(de.linkAttributes));
assert(de.timeStatusChanged > before);
assert(de.timeStatusChanged < now);
assert(de.attributes == de.statBuf.st_mode);
}
/**
Reads an entire file into an array.
Example:
----
// Load file; each line is an int followed by comma, whitespace and a
// double.
auto a = slurp!(int, double)("filename", "%s, %s");
----
*/
Select!(Types.length == 1, Types[0][], Tuple!(Types)[])
slurp(Types...)(string filename, in char[] format)
{
typeof(return) result;
auto app = appender!(typeof(return))();
ElementType!(typeof(return)) toAdd;
auto f = File(filename);
scope(exit) f.close();
foreach (line; f.byLine())
{
formattedRead(line, format, &toAdd);
enforce(line.empty,
text("Trailing characters at the end of line: `", line,
"'"));
app.put(toAdd);
}
return app.data;
}
unittest
{
// Tuple!(int, double)[] x;
// auto app = appender(&x);
write(deleteme, "12 12.25\n345 1.125");
scope(exit) { assert(exists(deleteme)); remove(deleteme); }
auto a = slurp!(int, double)(deleteme, "%s %s");
assert(a.length == 2);
assert(a[0] == tuple(12, 12.25));
assert(a[1] == tuple(345, 1.125));
}
/**
Returns the path to a directory for temporary files.
On Windows, this function returns the result of calling the Windows API function
$(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992.aspx, $(D GetTempPath)).
On POSIX platforms, it searches through the following list of directories
and returns the first one which is found to exist:
$(OL
$(LI The directory given by the $(D TMPDIR) environment variable.)
$(LI The directory given by the $(D TEMP) environment variable.)
$(LI The directory given by the $(D TMP) environment variable.)
$(LI $(D /tmp))
$(LI $(D /var/tmp))
$(LI $(D /usr/tmp))
)
On all platforms, $(D tempDir) returns $(D ".") on failure, representing
the current working directory.
The return value of the function is cached, so the procedures described
above will only be performed the first time the function is called. All
subsequent runs will return the same string, regardless of whether
environment variables and directory structures have changed in the
meantime.
The POSIX $(D tempDir) algorithm is inspired by Python's
$(LINK2 http://docs.python.org/library/tempfile.html#tempfile.tempdir, $(D tempfile.tempdir)).
*/
string tempDir() @trusted
{
static string cache;
if (cache is null)
{
version(Windows)
{
wchar[MAX_PATH] buf;
DWORD len = GetTempPathW(buf.length, buf.ptr);
if (len) cache = toUTF8(buf[0 .. len]);
}
else version(Posix)
{
// This function looks through the list of alternative directories
// and returns the first one which exists and is a directory.
static string findExistingDir(T...)(lazy T alternatives)
{
foreach (dir; alternatives)
if (!dir.empty && exists(dir)) return dir;
return null;
}
cache = findExistingDir(environment.get("TMPDIR"),
environment.get("TEMP"),
environment.get("TMP"),
"/tmp",
"/var/tmp",
"/usr/tmp");
}
else static assert (false, "Unsupported platform");
if (cache is null) cache = ".";
}
return cache;
}
|
D
|
/*
Copyright (c) 2016-2019 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
module dlib.audio.sample;
/*
* dlib.audio defines four integer sample formats:
* S8 - signed 8-bit
* S16 - signed 16-bit
* U8 - unsigned 8-bit
* U16 - unsigned 16-bit
*/
enum SampleFormat
{
S8,
S16,
U8,
U16
}
/*
* Integer formats are for storage only: all sound processing and sample I/O
* should be done in floating point numbers. Floating point sample is signed and
* ranges from -1.0f to 1.0f.
*/
// Convert integer sample to floating point
float toFloatSample(ubyte* ptr, SampleFormat format)
{
float res;
switch (format)
{
case SampleFormat.S8:
res = *cast(byte*)ptr;
res /= byte.max;
break;
case SampleFormat.S16:
res = *cast(short*)ptr;
res /= short.max;
break;
case SampleFormat.U8:
res = *ptr;
res /= ubyte.max;
res = res * 2.0f - 1.0f; // normalize to range -1..1
break;
case SampleFormat.U16:
res = *cast(ushort*)ptr;
res /= ushort.max;
res = res * 2.0f - 1.0f; // normalize to range -1..1
break;
default:
break;
}
return res;
}
// Convert floating point sample to integer
void fromFloatSample(ubyte* ptr, SampleFormat format, float s)
{
switch (format)
{
case SampleFormat.S8:
*cast(byte*)ptr = cast(byte)(s * byte.max);
break;
case SampleFormat.S16:
*cast(short*)ptr = cast(short)(s * short.max);
break;
case SampleFormat.U8:
*cast(ubyte*)ptr = cast(ubyte)((s + 1.0f) * 0.5f * ubyte.max);
break;
case SampleFormat.U16:
*cast(ushort*)ptr = cast(ushort)((s + 1.0f) * 0.5f * ushort.max);
break;
default:
break;
}
}
|
D
|
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/Fluent.build/QueryBuilder/QueryBuilder+Filter.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.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/Command.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/Console.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/Logging.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/Fluent.build/QueryBuilder/QueryBuilder+Filter~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.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/Command.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/Console.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/Logging.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/Fluent.build/QueryBuilder/QueryBuilder+Filter~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.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/Command.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/Console.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/Logging.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/Fluent.build/QueryBuilder/QueryBuilder+Filter~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ID.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+CRUD.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/MigrateCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/RevertCommand.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Decode.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Range.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/SoftDeletable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Aggregate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationConfig.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/JoinSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Transaction/TransactionSupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/QuerySupporting.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/MigrationLog.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Model.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/AnyModel.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Children.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Join/QueryBuilder+Join.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaSupporting+Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigration.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Run.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/FluentProvider.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaUpdater.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Filter.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/FluentError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/SchemaCreator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Schema/DatabasesConfig+References.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Siblings.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/Migrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Migration/AnyMigrations.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Operators.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Relations/Parent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Service/CommandConfig+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/KeyedCacheSupporting+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Database/DatabaseConnection+Fluent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/ModelEvent.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Model/Pivot.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Sort.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/QueryBuilder/QueryBuilder+Copy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Cache/CacheEntry.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/fluent/Sources/Fluent/Query/FluentProperty.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/Command.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/Console.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/Logging.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
|
struct v4 {
union {
struct { float x, y, z, w; };
struct { float r, g, b, a; };
}
v4 opBinary(string op)(v4 l) if (op == "+" || op == "-") {
mixin("return v4(x" ~ op ~ "l.x, y" ~ op ~ "l.y, z" ~ op ~ "l.z, w" ~ op ~ "l.w);");
}
v4 opBinary(string op)(float f) if (op == "*") {
return v4(f*x, f*y, f*z, f*w);
}
v4 opBinaryRight(string op)(float f) if (op == "*") {
return opBinary!op(f);
}
v4 opOpAssign(string op,T)(T l) {
return this = this.opBinary!op(l);
}
string toString() {
import std.conv : to;
return "v4("~x.to!string~", "~y.to!string~", "~z.to!string~", "~w.to!string~")";
}
}
v4 lerp(v4 a, float t, v4 b) {
return (1.0f - t)*a + t*b;
}
|
D
|
module flatman.x.ewmh;
import flatman;
__gshared:
enum _NET_WM_STATE_REMOVE = 0;
enum _NET_WM_STATE_ADD = 1;
enum _NET_WM_STATE_TOGGLE = 2;
struct ewmh {
static Atom[] netSupported(){
return [
Atoms._NET_SUPPORTED,
Atoms._NET_CLIENT_LIST,
Atoms._NET_CLIENT_LIST_STACKING,
Atoms._NET_WORKAREA,
Atoms._NET_DESKTOP_GEOMETRY,
Atoms._NET_DESKTOP_VIEWPORT,
Atoms._NET_CURRENT_DESKTOP,
Atoms._NET_NUMBER_OF_DESKTOPS,
Atoms._NET_DESKTOP_NAMES,
Atoms._NET_MOVERESIZE_WINDOW,
Atoms._NET_RESTACK_WINDOW,
Atoms._NET_ACTIVE_WINDOW,
Atoms._NET_WM_MOVERESIZE,
Atoms._NET_WM_PID,
Atoms._NET_WM_NAME,
Atoms._NET_WM_ICON,
Atoms._NET_WM_STATE,
Atoms._NET_WM_STATE_MODAL,
Atoms._NET_WM_STATE_FULLSCREEN,
Atoms._NET_WM_STATE_DEMANDS_ATTENTION,
Atoms._NET_WM_STRUT_PARTIAL,
Atoms._NET_WM_WINDOW_TYPE,
Atoms._NET_WM_WINDOW_TYPE_DIALOG,
Atoms._NET_WM_WINDOW_TYPE_DOCK,
Atoms._NET_WM_WINDOW_TYPE_SPLASH,
Atoms._NET_WM_WINDOW_TYPE_NOTIFICATION,
Atoms._NET_WM_DESKTOP,
Atoms._NET_WM_USER_TIME,
Atoms._NET_SUPPORTING_WM_CHECK
];
}
static Window getWindow(Window window, Atom prop){
int di;
ulong dl;
ubyte* p;
Atom da, atom = None;
if(XGetWindowProperty(dpy, window, prop, 0L, atom.sizeof, false, XA_WINDOW,
&da, &di, &dl, &dl, &p) == Success && p){
atom = *cast(Atom*)p;
XFree(p);
}
return atom;
}
static void setSupportingWm(){
XSetWindowAttributes wa;
wa.override_redirect = true;
auto window = XCreateWindow(dpy, root, 0, 0, 1, 1, 0,
DefaultDepth(dpy, screen),
CopyFromParent,
DefaultVisual(dpy, screen),
CWOverrideRedirect,
&wa
);
foreach(w; [root, window]){
w.replace(Atoms._NET_SUPPORTING_WM_CHECK, window);
w.replace(Atoms._NET_WM_NAME, "flatman");
}
}
static void updateCurrentDesktop(){
replace(Atoms._NET_CURRENT_DESKTOP, cast(long)monitor.workspaceActive);
}
static void updateDesktopCount(){
replace(Atoms._NET_NUMBER_OF_DESKTOPS, cast(CARDINAL)monitor.workspaces.length);
}
static void updateDesktopNames(){
string names;
foreach(i, ws; monitor.workspaces){
try{
names ~= std.array.replace(ws.context.expandTilde.readText, "~".expandTilde, "~");
}catch(Throwable) {
names ~= "~";
}
names ~= "\0";
}
Atoms._NET_DESKTOP_NAMES.replace(names);
}
static void updateWindowDesktop(Client client, long n){
client.win.replace!CARDINAL(Atoms._NET_WM_DESKTOP, n);
if(client.frame)
client.frame.window.replace!CARDINAL(Atoms._NET_WM_DESKTOP, n);
}
static void updateWorkspaces(){
foreach(monitor; monitors){
foreach(n, ws; monitor.workspaces){
foreach(s; ws.split.separators){
s.window.replace!CARDINAL(Atoms._NET_WM_DESKTOP, n);
}
foreach(c; ws.clients)
updateWindowDesktop(c, n);
}
}
updateDesktopNames;
}
static void updateActiveWindow(){
replace(Atoms._NET_ACTIVE_WINDOW, monitor.active.win);
}
static void updateWorkarea(){
CARDINAL[] data;
foreach(ws; monitor.workspaces)
//data ~= [ws.split.pos.x, ws.split.pos.y, ws.split.size.w, ws.split.size.h];
data ~= [0, 0, rootSize.w, rootSize.h];
Atoms._NET_WORKAREA.replace(data);
Atoms._NET_DESKTOP_VIEWPORT.replace(monitor.pos.to!(long[]));
"RESIZE %s".format(monitor.size.to!(long[])).log;
Atoms._NET_DESKTOP_GEOMETRY.replace(monitor.size.to!(long[]));
}
static void updateClientList(){
auto clients = clients;
foreach(c; clients)
assert(!c.destroyed);
Atoms._NET_CLIENT_LIST.replace(clients);
Atoms._NET_CLIENT_LIST_STACKING.replace(clients);
}
}
|
D
|
module dkh.datastructure.convexhull;
import dkh.container.deque;
/// Convex Hull's query type
enum CHQueryType {
incr, ///
decr, ///
}
/**
Convex Hull Trick
Params:
T = value type
queryType = if queries are increase, use CHMode.incr.
if queries are decrease, use CHMode.decr.
*/
struct ConvexHull(T, CHQueryType queryType) {
import std.algorithm : max;
alias L = T[2]; /// Line type $(D y = L[0] * x + L[1])
private static T value(L l, T x) { return l[0]*x + l[1]; }
Deque!L lines;
// can remove mid?
private static bool isNeed(L mid, L left, L right) {
assert(left[0] <= mid[0] && mid[0] <= right[0]);
return (right[0]-mid[0])*(left[1]-mid[1]) < (mid[0]-left[0])*(mid[1]-right[1]);
}
private void insertFront(L l) {
if (lines.empty) {
lines.insertFront(l);
return;
}
assert(l[0] <= lines[0][0]);
if (l[0] == lines[0][0]) {
if (l[1] <= lines[0][1]) return;
lines.removeFront;
}
while (lines.length >= 2 && !isNeed(lines.front, l, lines[1])) {
lines.removeFront;
}
lines.insertFront(l);
}
private void insertBack(L l) {
if (lines.empty) {
lines.insertBack(l);
return;
}
assert(lines[$-1][0] <= l[0]);
if (lines[$-1][0] == l[0]) {
if (l[1] <= lines[$-1][1]) return;
lines.removeBack;
}
while (lines.length >= 2 && !isNeed(lines.back, lines[$-2], l)) {
lines.removeBack;
}
lines.insertBack(l);
}
/**
Insert line
line's degree must be minimum or maximum
*/
void insertLine(L line) {
if (lines.empty) {
lines.insertBack(line);
return;
}
if (line[0] <= lines[0][0]) insertFront(line);
else if (lines[$-1][0] <= line[0]) insertBack(line);
else {
assert(false, "line's degree must be minimum or maximum");
}
}
/// get maximum y
long maxY(T x) {
assert(lines.length);
static if (queryType == CHQueryType.incr) {
while (lines.length >= 2 &&
value(lines[0], x) <= value(lines[1], x)) {
lines.removeFront;
}
return value(lines.front, x);
} else {
while (lines.length >= 2 &&
value(lines[$-2], x) >= value(lines[$-1], x)) {
lines.removeBack;
}
return value(lines.back, x);
}
}
}
///
unittest {
ConvexHull!(int, CHQueryType.incr) c;
c.insertLine([1, 4]);
c.insertLine([2, 1]);
c.insertLine([3, -100]);
assert(c.maxY(-1) == 3); // 1 * (-1) + 4 = 3
c.insertLine([-10, 100]);
assert(c.maxY(2) == 80); // 2 * (-10) + 100 = 80
}
unittest {
import std.random;
import std.algorithm;
int getMax(int[2][] v, int x) {
int ans = int.min;
foreach (l; v) {
ans = max(ans, l[0]*x + l[1]);
}
return ans;
}
void f1() {
int[2][] v = new int[2][](100);
int[] smp = new int[](100);
foreach (i; 0..100) {
v[i][0] = uniform(-100, 100);
v[i][1] = uniform(-100, 100);
smp[i] = uniform(-10000, 10000);
}
sort(v);
sort(smp);
ConvexHull!(int, CHQueryType.incr) c;
if (uniform(0, 2)) {
foreach_reverse (i; 0..100) {
c.insertLine(v[i]);
}
} else {
foreach (i; 0..100) {
c.insertLine(v[i]);
}
}
foreach (i; 0..100) {
assert(c.maxY(smp[i]) == getMax(v, smp[i]));
}
}
void f2() {
int[2][] v = new int[2][](100);
int[] smp = new int[](100);
foreach (i; 0..100) {
v[i][0] = uniform(-100, 100);
v[i][1] = uniform(-100, 100);
smp[i] = uniform(-10000, 10000);
}
sort(v);
sort(smp); reverse(smp);
ConvexHull!(int, CHQueryType.decr) c;
if (uniform(0, 2)) {
foreach_reverse (i; 0..100) {
c.insertLine(v[i]);
}
} else {
foreach (i; 0..100) {
c.insertLine(v[i]);
}
}
foreach (i; 0..100) {
assert(c.maxY(smp[i]) == getMax(v, smp[i]));
}
}
import std.stdio;
import dkh.stopwatch;
auto ti = benchmark!(f1, f2)(500);
writeln("ConvexHull Random500: ", ti[].map!(a => a.toMsecs()));
}
|
D
|
module mci.assembler.generation.types;
import std.conv,
mci.core.common,
mci.core.container,
mci.core.math,
mci.core.nullable,
mci.core.analysis.utilities,
mci.core.code.metadata,
mci.core.code.modules,
mci.core.typing.core,
mci.core.typing.cache,
mci.core.typing.types,
mci.assembler.parsing.ast,
mci.assembler.generation.exception,
mci.assembler.generation.modules;
public StructureType generateType(TypeDeclarationNode node, Module module_)
in
{
assert(node);
assert(module_);
}
out (result)
{
assert(result);
}
body
{
if (auto type = module_.types.get(node.name.name))
throw new GenerationException("Type " ~ type.toString() ~ " already defined.", node.location);
uint alignment;
if (node.alignment)
{
auto al = to!uint(node.alignment.value);
if (al && !powerOfTwo(al))
throw new GenerationException("Type alignment must be a power of two.", node.alignment.location);
alignment = al;
}
auto type = new StructureType(module_, node.name.name, alignment);
if (node.metadata)
foreach (md; node.metadata.metadata)
type.metadata.add(MetadataPair(md.key.name, md.value.name));
return type;
}
public StructureMember generateMember(MemberDeclarationNode node, StructureType type, ModuleManager manager)
in
{
assert(node);
assert(type);
assert(manager);
}
out (result)
{
assert(result);
}
body
{
auto fieldType = resolveType(node.type, type.module_, manager);
if (auto struc = cast(StructureType)fieldType)
if (type.hasCycle(struc))
throw new GenerationException("Member " ~ type.toString() ~ ":'" ~ node.name.name ~ "' would create an infinite cycle.", node.location);
return type.createMember(node.name.name, fieldType);
}
public Type resolveType(TypeReferenceNode node, Module module_, ModuleManager manager)
in
{
assert(node);
assert(module_);
assert(manager);
}
out (result)
{
assert(result);
}
body
{
return match(node,
(StructureTypeReferenceNode n) => resolveStructureType(n, module_, manager),
(FunctionPointerTypeReferenceNode n) => resolveFunctionPointerType(n, module_, manager),
(PointerTypeReferenceNode n) => getPointerType(resolveType(n.elementType, module_, manager)),
(ReferenceTypeReferenceNode n) => getReferenceType(cast(StructureType)resolveType(n.elementType, module_, manager)),
(ArrayTypeReferenceNode n) => getArrayType(resolveType(n.elementType, module_, manager)),
(VectorTypeReferenceNode n) => getVectorType(resolveType(n.elementType, module_, manager), to!uint(n.elements.value)),
(StaticArrayTypeReferenceNode n) => getStaticArrayType(resolveType(n.elementType, module_, manager), to!uint(n.elements.value)),
(Int8TypeReferenceNode n) => Int8Type.instance,
(UInt8TypeReferenceNode n) => UInt8Type.instance,
(Int16TypeReferenceNode n) => Int16Type.instance,
(UInt16TypeReferenceNode n) => UInt16Type.instance,
(Int32TypeReferenceNode n) => Int32Type.instance,
(UInt32TypeReferenceNode n) => UInt32Type.instance,
(Int64TypeReferenceNode n) => Int64Type.instance,
(UInt64TypeReferenceNode n) => UInt64Type.instance,
(NativeIntTypeReferenceNode n) => NativeIntType.instance,
(NativeUIntTypeReferenceNode n) => NativeUIntType.instance,
(Float32TypeReferenceNode n) => Float32Type.instance,
(Float64TypeReferenceNode n) => Float64Type.instance);
}
public StructureType resolveStructureType(StructureTypeReferenceNode node, Module module_, ModuleManager manager)
in
{
assert(node);
assert(module_);
assert(manager);
}
out (result)
{
assert(result);
}
body
{
// If no module is specified, default to the module the type reference is in.
auto mod = node.moduleName ? resolveModule(node.moduleName, manager) : module_;
if (auto type = mod.types.get(node.name.name))
return *type;
throw new GenerationException("Unknown type " ~ mod.toString() ~ "/'" ~ node.name.name ~ "'.", node.location);
}
public FunctionPointerType resolveFunctionPointerType(FunctionPointerTypeReferenceNode node, Module module_,
ModuleManager manager)
in
{
assert(node);
assert(module_);
assert(manager);
}
out (result)
{
assert(result);
}
body
{
auto returnType = node.returnType ? resolveType(node.returnType, module_, manager) : null;
auto parameterTypes = new NoNullList!Type();
foreach (paramType; node.parameterTypes)
parameterTypes.add(resolveType(paramType, module_, manager));
return getFunctionPointerType(node.callingConvention, returnType, parameterTypes);
}
public StructureMember resolveMember(MemberReferenceNode node, Module module_, ModuleManager manager)
in
{
assert(node);
assert(module_);
assert(manager);
}
out (result)
{
assert(result);
}
body
{
auto type = cast(StructureType)resolveType(node.typeName, module_, manager);
if (auto field = type.members.get(node.name.name))
return *field;
throw new GenerationException("Unknown member " ~ type.toString() ~ ":'" ~ node.name.name ~ "'.", node.location);
}
|
D
|
/mnt/d/dev/blockchain/wormhole/solana/bridge/client/target/rls/debug/deps/fixed_hash-61919979c6b5a806.rmeta: /home/franglin/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-hash-0.7.0/src/lib.rs /home/franglin/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-hash-0.7.0/src/hash.rs
/mnt/d/dev/blockchain/wormhole/solana/bridge/client/target/rls/debug/deps/fixed_hash-61919979c6b5a806.d: /home/franglin/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-hash-0.7.0/src/lib.rs /home/franglin/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-hash-0.7.0/src/hash.rs
/home/franglin/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-hash-0.7.0/src/lib.rs:
/home/franglin/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-hash-0.7.0/src/hash.rs:
|
D
|
module ogregl.hardwareocclusionquery;
import derelict.opengl3.gl;
import ogre.rendersystem.hardware;
import ogre.exception;
import ogregl.glew;
import ogregl.compat;
// If you use multiple rendering passes you can test only the first pass and all other passes don't have to be rendered
// if the first pass result has too few pixels visible.
// Be sure to render all occluder first and whats out so the RenderQue don't switch places on
// the occluding objects and the tested objects because it thinks it's more effective..
/**
* This is a class that is the base class of the query class for
* hardware occlusion.
*
* @author Lee Sandberg email: lee@abcmedia.se
* Updated on 13/9/2005 by Tuan Kuranes email: tuan.kuranes@free.fr
*/
class GLHardwareOcclusionQuery : HardwareOcclusionQuery
{
//----------------------------------------------------------------------
// Public methods
//--
public:
/**
* Default object constructor
*
*/
this()
{
// Check for hardware occlusion support
if(GLEW_VERSION_1_5 || ARB_occlusion_query)
{
glGenQueries(1, &mQueryID );
}
/*else if (NV_occlusion_query)
{
glGenOcclusionQueriesNV(1, &mQueryID);
}*/
else
{
throw new InternalError(
"Cannot allocate a Hardware query. This video card doesn't support it, sorry.",
"GLHardwareOcclusionQuery.GLHardwareOcclusionQuery" );
}
}
/**
* Object destructor
*/
~this()
{
if(GLEW_VERSION_1_5 || ARB_occlusion_query)
{
glDeleteQueries(1, &mQueryID);
}
/*else if (NV_occlusion_query)
{
glDeleteOcclusionQueriesNV(1, &mQueryID);
}*/
}
//------------------------------------------------------------------
// Occlusion query functions (see base class documentation for this)
//--
override void beginOcclusionQuery()
{
if(GLEW_VERSION_1_5 || ARB_occlusion_query)
{
glBeginQuery(GL_SAMPLES_PASSED, mQueryID);
}
/*else if (GLEW_NV_occlusion_query)
{
glBeginOcclusionQueryNV(mQueryID);
}*/
}
override void endOcclusionQuery()
{
if(GLEW_VERSION_1_5 || ARB_occlusion_query)
{
glEndQuery(GL_SAMPLES_PASSED);
}
/*else if (GLEW_NV_occlusion_query)
{
glEndOcclusionQueryNV();
}*/
}
override bool pullOcclusionQuery( uint* NumOfFragments)
{
if(GLEW_VERSION_1_5 || ARB_occlusion_query)
{
glGetQueryObjectuiv(mQueryID, GL_QUERY_RESULT, cast(GLuint*)NumOfFragments);
mPixelCount = *NumOfFragments;
return true;
}
/*else if (GLEW_NV_occlusion_query)
{
glGetOcclusionQueryuivNV(mQueryID, GL_PIXEL_COUNT_NV, (GLuint*)NumOfFragments);
mPixelCount = *NumOfFragments;
return true;
}*/
return false;
}
override bool isStillOutstanding()
{
GLuint available = GL_FALSE;
if(GLEW_VERSION_1_5 || ARB_occlusion_query)
{
glGetQueryObjectuiv(mQueryID, GL_QUERY_RESULT_AVAILABLE, &available);
}
/*else if (GLEW_NV_occlusion_query)
{
glGetOcclusionQueryuivNV(mQueryID, GL_PIXEL_COUNT_AVAILABLE_NV, &available);
}*/
// GL_TRUE means a wait would occur
return !(available == GL_TRUE);
}
//----------------------------------------------------------------------
// private members
//--
private:
GLuint mQueryID;
}
|
D
|
module android.java.android.text.style.SubscriptSpan;
public import android.java.android.text.style.SubscriptSpan_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!SubscriptSpan;
import import3 = android.java.android.text.style.CharacterStyle;
import import2 = android.java.android.text.style.MetricAffectingSpan;
import import4 = android.java.java.lang.Class;
|
D
|
/Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/DerivedData/Catch\ the\ jellyfish/Build/Intermediates.noindex/Catch\ the\ jellyfish.build/Debug-iphonesimulator/Catch\ the\ jellyfish.build/Objects-normal/x86_64/AppDelegate.o : /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/Mouse.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/AppDelegate.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/GameMain.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/ViewController.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/Classes.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/simd.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval32.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval64.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ucontext64.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet6/in6.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugInCOM.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitEQ.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/alloca.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerMediaSelectionCriteria.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVDepthData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCameraCalibrationData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/data.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/quota.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netdb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/timeb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIKernelMetalLib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdlib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_stdlib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/glob.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitReverb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioCodec.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timespec.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/logic.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomic.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_o_sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_o_dsync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/malloc/malloc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/malloc/_malloc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/proc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ipc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSThread.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/pthread.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitVarispeed.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/sched.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/packed.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ucred.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomicDeprecated.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSSpinLockDeprecated.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_ctermid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/uuid/uuid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/gethostuuid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextField.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchTextField.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/simd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICommand.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKeyCommand.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/kmod.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteboard.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboard.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/unistd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/unistd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pwd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_interface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLIOSurface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtectionSpace.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/MusicDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderService.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenshotService.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIToolbarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedCollectionDifference.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/once.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDiffableDataSource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/source.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/resource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusGuide.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILayoutGuide.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenMode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioIONode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSourceNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSinkNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioMixerNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioPlayerNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioEnvironmentNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/rbtree.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHTTPCookieStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/ThreadLocalStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredentialStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/message.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/message.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescriptionBridge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTimeRange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedCollectionChange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLAuthenticationChallenge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTextureCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHTTPCookie.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMovie.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector_make.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/locale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_locale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_xlocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHashTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMapTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_purgable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_posix_vdisable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileHandle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/CAFFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/file.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/clonefile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/copyfile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTextStyleRule.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/utsname.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVHostTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/NSObjCRuntime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/runtime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/utime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScene.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWindowScene.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioEngine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_os_inline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTimeZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterShape.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/__wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/__wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/runetype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUbiquitousKeyValueStore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSystemPressure.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFeature.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMethodSignature.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutputBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/readpassphrase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLResponse.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCompoundPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSComparisonPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteDelegate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/thread_state.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/thread_state.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSemanticSegmentationMatte.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPortraitEffectsMatte.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomicQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSimpleQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNotificationQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBufferQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/queue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/queue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardSegue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardPopoverSegue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/time_value.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_page_size.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_setsize.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_def.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStddef.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_offsetof.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/fp_reg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mig.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfigurationReading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsynchronousKeyValueLoading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragging.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionRequestHandling.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderThumbnailing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitioning.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDropping.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVQueuedSampleBufferRendering.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_symbol_aliasing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDataSourceTranslating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoCompositing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/AssertionReporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfigurationSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteConfigurationSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteractionSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContentSizeCategoryImageAdjusting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategoryAdjusting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueObserving.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSStringDrawing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioMixing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/syslog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syslog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/msg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fmtmsg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/mach_debug.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/search.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fnmatch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/dispatch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitTimePitch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwitch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_switch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUGraph.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBezierPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSIndexPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/KeyPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/math.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/math.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/tgmath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/kauth.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-api.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/port_obj.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMovieTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCompositionTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sigaltstack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/lock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/lock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Block.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMAudioClock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/block.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetDownloadTask.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_task.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AvailabilityInternal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDropProposal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateInterval.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/acl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_dl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILabel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIKernel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/dyld_kernel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/util.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syscall.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/poll.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/poll.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNull.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_null.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtocol.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAutoreleasePool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferPool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMMemoryPool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStdbool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISegmentedControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPageControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRefreshControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/pthread_impl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ioctl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sysctl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fcntl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/fcntl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFileStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ndbm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplicationShortcutItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_nl_item.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/System.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusSystem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuSystem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/shm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ioccom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ttycom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Random.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityZoom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/vm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/mman.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dlfcn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreen.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libgen.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet/in.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILexicon.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRegion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_region.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/quaternion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationServiceExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSFileProviderExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileVersion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/conversion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDINetworkSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetExportSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExpression.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRegularExpression.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityIdentification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSInvocation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIRenderDestination.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOperation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItemDecoration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStateRestoration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageSymbolConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewControllerConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder+UIActivityItemsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeActionsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUAudioUnitImplementation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSJSONSerialization.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextualAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPencilInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextItemInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDropInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaSelection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIThruConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVComposition.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoComposition.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSException.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelFormatDescription.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitDistortion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarCommon.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/common.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_common.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIButton.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/extern.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/un.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProcessInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/ipc_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/page_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/zone_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/hash_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/vm_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/lockgroup_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/langinfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_langinfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/io.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/aio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/aio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFAudio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVFAudio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sockio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/filio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/cpio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/uio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/errno.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/errno.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_zero.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-auto.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MTAudioProcessingTap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_map.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/bootstrap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet/tcp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/setjmp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRunLoop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/workloop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/grp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTextMarkup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTimedMetadataGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrackGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaSelectionGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/group.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDISetup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wordexp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIToolbar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_char.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_wchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/tar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_var.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/ndr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSequencer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetReader.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetResourceLoader.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/FileProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITimingCurveProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSUserActivity+NSItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuBuilder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/i386/OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/i386/_OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/_OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/architecture/byte_order.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioRecorder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSampleBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBlockBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetDownloadStorageManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStatusBarManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/DocumentManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLinguisticTagger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusDebugger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICloudSharingController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPresentationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverPresentationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentInteractionController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInteractionController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImagePickerController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrinterPickerController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVideoEditorController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPageViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerExtensionViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchContainerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInputViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentMenuViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIReferenceLibraryViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchDisplayController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CISampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTimer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValueTransformer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContainer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSScanner.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPaper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerLooper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileWrapper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStepper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsPDFRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPageRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsImageRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferAudioRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragPreviewRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXMLParser.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIRAWFilter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrinter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioConverter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioConverter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRelativeDateTimeFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSISO8601DateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLengthFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateIntervalFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMassFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPersonNameComponentsFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurementFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSByteCountFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSListFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnergyFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyedArchiver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILargeContentViewer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSynchronizedLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureVideoPreviewLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVMIDIPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/MusicPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPinchGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPanGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenEdgePanGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRotationGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITapGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILongPressGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferRenderSynchronizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDataOutputSynchronizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_clr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutAnchor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFieldBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPushBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicItemBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollisionBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISnapBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAttachmentBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGravityBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_behavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/error.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_error.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageProcessor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageAccumulator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicAnimator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewPropertyAnimator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextFormattingCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusAnimationCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitionCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetImageGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINotificationFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISelectionFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImpactFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIVector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemMediaDataCollector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIDetector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVRouteDetector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterConstructor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIBarcodeDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityLocationDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSortDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/err.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/attr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/xattr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RuntimeStubs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontMetrics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_statistics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNetServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnitProperties.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MTFormatNames.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/times.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/MacTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/AudioSessionTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/std_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/mach_debug_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/nl_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exception_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_voucher_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/memory_object_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/matrix_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/gltypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/inttypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_inttypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMetadataAttributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_attributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/cdefs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/statvfs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xattr_flags.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/eflags.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/strings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_strings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioProcessingSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/paths.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread_spis.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVSpeechSynthesis.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/TargetConditionals.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_syscalls.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSDataShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/LibcShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/UnicodeShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSLocaleShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RuntimeShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSTimeZoneShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CFHashingShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSIndexPathShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreFoundationShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCalendarShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCoderShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSFileManagerShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSUndoManagerShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSKeyedArchiverShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSErrorShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CFCharacterSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCharacterSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSIndexSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/ObjectiveCOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreMediaOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/LibcOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/DispatchOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreFoundationOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/UIKitOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSDictionaryShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterBuiltins.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINibDeclarations.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderActions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccessRestrictions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPointerFunctions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UNNotificationResponse+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSIndexPath+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSItemProvider+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneActivationConditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneDefinitions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneOptions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/termios.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/termios.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/qos.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/qos.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ConditionalMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AssertMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AvailabilityMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_traps.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ifaddrs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataIdentifiers.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITimingParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnitParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragPreviewParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/FoundationErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mig_errors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRendererSubclass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccess.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPress.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProgress.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/GlobalObjects.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/_structs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/_structs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syslimits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sysexits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserDefaults.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ttydefaults.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPersonNameComponents.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/bsm/audit_uevents.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/appleapiopts.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocus.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragURLPreviews.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ino64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_filesec_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_iovec_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_id_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsobj_id_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_gid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_pid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_guid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uuid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_cond_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_once_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mode_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_time_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_rune_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ct_rune_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_wctype_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mbstate_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_size_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_blksize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_rsize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ssize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ptrdiff_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_off_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_clock_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_nlink_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_socklen_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ino_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_errno_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_wchar_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_in_addr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_caddr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_intptr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uintptr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_attr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_useconds_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_suseconds_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_wctrans_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sigset_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_blkcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsblkcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsfilcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_wint_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mach_port_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_in_port_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_dev_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_intmax_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uintmax_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_key_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_key_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sa_family_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/float.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/stat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_act.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitTimeEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMotionEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBlurEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVibrancyEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/NSObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/HeapObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/object.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/object.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/select.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_select.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_inspect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderMaterializedSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSIndexSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/ShareSheet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActionSheet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Target.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/socket.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/arpa/inet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/lock_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_seek_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSessionPreset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSDataAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_isset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/wait.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/bsm/audit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ulimit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUAudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioOutputUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_init.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_inherit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTextCheckingResult.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_s_ifmt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVOutputSettingsAssistant.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuElement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityElement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCompositionTrackSegment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrackSegment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIManagedDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitMIDIInstrument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dirent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/dirent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPressesEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/event.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusMovementHint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutConstraint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStdint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioConnectionPoint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RefCount.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/mount.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_reboot.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_prot.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/getopt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlert.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/assert.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_short.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/port.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_port.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationShimSupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverSupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPropertyList.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_va_list.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_host.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/kdebug_signpost.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCompositionalLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioChannelLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewTransitionLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewFlowLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriterInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDepthDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureVideoDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureMetadataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureStillImageOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetReaderOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioPreviewOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIOpenURLContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_mcontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_mcontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ucontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ucontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/net_kev.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_priv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_priv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fenv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/iconv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverBackgroundView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStackView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewHeaderFooterView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityIndicatorView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIProgressView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffectView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInputView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITargetedPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITargetedDragPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSShadow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/CAShow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ftw.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/complex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioMix.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/matrix.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/utmpx.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/lctx.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitDelay.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPointerArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/sync_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/notify.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_notify.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrthography.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_reply.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_copy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/monetary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_monetary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderSearchQuery.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDICapabilityInquiry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategory.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGeometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/geometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLESAvailability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_posix_availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Visibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/FoundationLegacySwiftCompatibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_security.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProxy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach-o/module.map /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libxml2/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/unicode/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/CommonCrypto/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudio.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/DerivedData/Catch\ the\ jellyfish/Build/Intermediates.noindex/Catch\ the\ jellyfish.build/Debug-iphonesimulator/Catch\ the\ jellyfish.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/Mouse.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/AppDelegate.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/GameMain.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/ViewController.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/Classes.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/simd.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval32.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval64.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ucontext64.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet6/in6.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugInCOM.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitEQ.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/alloca.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerMediaSelectionCriteria.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVDepthData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCameraCalibrationData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/data.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/quota.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netdb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/timeb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIKernelMetalLib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdlib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_stdlib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/glob.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitReverb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioCodec.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timespec.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/logic.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomic.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_o_sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_o_dsync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/malloc/malloc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/malloc/_malloc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/proc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ipc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSThread.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/pthread.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitVarispeed.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/sched.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/packed.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ucred.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomicDeprecated.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSSpinLockDeprecated.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_ctermid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/uuid/uuid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/gethostuuid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextField.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchTextField.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/simd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICommand.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKeyCommand.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/kmod.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteboard.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboard.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/unistd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/unistd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pwd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_interface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLIOSurface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtectionSpace.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/MusicDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderService.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenshotService.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIToolbarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedCollectionDifference.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/once.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDiffableDataSource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/source.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/resource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusGuide.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILayoutGuide.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenMode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioIONode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSourceNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSinkNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioMixerNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioPlayerNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioEnvironmentNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/rbtree.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHTTPCookieStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/ThreadLocalStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredentialStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/message.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/message.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescriptionBridge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTimeRange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedCollectionChange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLAuthenticationChallenge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTextureCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHTTPCookie.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMovie.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector_make.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/locale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_locale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_xlocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHashTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMapTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_purgable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_posix_vdisable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileHandle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/CAFFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/file.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/clonefile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/copyfile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTextStyleRule.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/utsname.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVHostTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/NSObjCRuntime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/runtime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/utime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScene.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWindowScene.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioEngine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_os_inline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTimeZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterShape.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/__wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/__wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/runetype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUbiquitousKeyValueStore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSystemPressure.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFeature.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMethodSignature.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutputBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/readpassphrase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLResponse.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCompoundPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSComparisonPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteDelegate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/thread_state.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/thread_state.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSemanticSegmentationMatte.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPortraitEffectsMatte.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomicQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSimpleQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNotificationQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBufferQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/queue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/queue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardSegue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardPopoverSegue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/time_value.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_page_size.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_setsize.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_def.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStddef.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_offsetof.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/fp_reg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mig.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfigurationReading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsynchronousKeyValueLoading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragging.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionRequestHandling.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderThumbnailing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitioning.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDropping.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVQueuedSampleBufferRendering.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_symbol_aliasing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDataSourceTranslating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoCompositing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/AssertionReporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfigurationSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteConfigurationSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteractionSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContentSizeCategoryImageAdjusting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategoryAdjusting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueObserving.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSStringDrawing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioMixing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/syslog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syslog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/msg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fmtmsg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/mach_debug.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/search.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fnmatch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/dispatch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitTimePitch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwitch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_switch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUGraph.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBezierPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSIndexPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/KeyPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/math.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/math.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/tgmath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/kauth.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-api.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/port_obj.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMovieTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCompositionTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sigaltstack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/lock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/lock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Block.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMAudioClock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/block.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetDownloadTask.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_task.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AvailabilityInternal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDropProposal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateInterval.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/acl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_dl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILabel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIKernel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/dyld_kernel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/util.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syscall.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/poll.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/poll.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNull.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_null.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtocol.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAutoreleasePool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferPool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMMemoryPool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStdbool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISegmentedControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPageControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRefreshControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/pthread_impl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ioctl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sysctl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fcntl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/fcntl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFileStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ndbm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplicationShortcutItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_nl_item.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/System.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusSystem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuSystem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/shm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ioccom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ttycom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Random.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityZoom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/vm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/mman.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dlfcn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreen.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libgen.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet/in.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILexicon.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRegion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_region.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/quaternion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationServiceExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSFileProviderExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileVersion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/conversion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDINetworkSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetExportSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExpression.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRegularExpression.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityIdentification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSInvocation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIRenderDestination.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOperation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItemDecoration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStateRestoration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageSymbolConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewControllerConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder+UIActivityItemsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeActionsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUAudioUnitImplementation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSJSONSerialization.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextualAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPencilInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextItemInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDropInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaSelection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIThruConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVComposition.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoComposition.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSException.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelFormatDescription.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitDistortion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarCommon.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/common.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_common.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIButton.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/extern.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/un.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProcessInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/ipc_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/page_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/zone_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/hash_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/vm_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/lockgroup_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/langinfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_langinfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/io.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/aio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/aio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFAudio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVFAudio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sockio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/filio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/cpio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/uio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/errno.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/errno.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_zero.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-auto.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MTAudioProcessingTap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_map.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/bootstrap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet/tcp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/setjmp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRunLoop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/workloop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/grp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTextMarkup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTimedMetadataGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrackGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaSelectionGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/group.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDISetup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wordexp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIToolbar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_char.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_wchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/tar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_var.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/ndr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSequencer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetReader.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetResourceLoader.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/FileProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITimingCurveProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSUserActivity+NSItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuBuilder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/i386/OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/i386/_OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/_OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/architecture/byte_order.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioRecorder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSampleBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBlockBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetDownloadStorageManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStatusBarManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/DocumentManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLinguisticTagger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusDebugger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICloudSharingController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPresentationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverPresentationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentInteractionController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInteractionController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImagePickerController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrinterPickerController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVideoEditorController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPageViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerExtensionViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchContainerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInputViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentMenuViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIReferenceLibraryViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchDisplayController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CISampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTimer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValueTransformer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContainer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSScanner.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPaper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerLooper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileWrapper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStepper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsPDFRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPageRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsImageRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferAudioRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragPreviewRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXMLParser.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIRAWFilter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrinter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioConverter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioConverter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRelativeDateTimeFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSISO8601DateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLengthFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateIntervalFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMassFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPersonNameComponentsFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurementFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSByteCountFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSListFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnergyFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyedArchiver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILargeContentViewer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSynchronizedLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureVideoPreviewLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVMIDIPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/MusicPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPinchGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPanGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenEdgePanGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRotationGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITapGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILongPressGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferRenderSynchronizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDataOutputSynchronizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_clr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutAnchor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFieldBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPushBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicItemBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollisionBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISnapBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAttachmentBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGravityBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_behavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/error.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_error.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageProcessor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageAccumulator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicAnimator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewPropertyAnimator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextFormattingCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusAnimationCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitionCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetImageGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINotificationFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISelectionFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImpactFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIVector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemMediaDataCollector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIDetector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVRouteDetector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterConstructor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIBarcodeDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityLocationDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSortDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/err.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/attr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/xattr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RuntimeStubs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontMetrics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_statistics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNetServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnitProperties.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MTFormatNames.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/times.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/MacTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/AudioSessionTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/std_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/mach_debug_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/nl_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exception_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_voucher_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/memory_object_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/matrix_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/gltypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/inttypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_inttypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMetadataAttributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_attributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/cdefs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/statvfs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xattr_flags.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/eflags.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/strings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_strings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioProcessingSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/paths.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread_spis.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVSpeechSynthesis.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/TargetConditionals.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_syscalls.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSDataShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/LibcShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/UnicodeShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSLocaleShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RuntimeShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSTimeZoneShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CFHashingShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSIndexPathShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreFoundationShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCalendarShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCoderShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSFileManagerShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSUndoManagerShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSKeyedArchiverShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSErrorShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CFCharacterSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCharacterSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSIndexSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/ObjectiveCOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreMediaOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/LibcOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/DispatchOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreFoundationOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/UIKitOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSDictionaryShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterBuiltins.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINibDeclarations.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderActions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccessRestrictions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPointerFunctions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UNNotificationResponse+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSIndexPath+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSItemProvider+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneActivationConditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneDefinitions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneOptions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/termios.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/termios.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/qos.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/qos.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ConditionalMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AssertMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AvailabilityMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_traps.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ifaddrs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataIdentifiers.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITimingParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnitParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragPreviewParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/FoundationErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mig_errors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRendererSubclass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccess.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPress.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProgress.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/GlobalObjects.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/_structs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/_structs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syslimits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sysexits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserDefaults.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ttydefaults.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPersonNameComponents.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/bsm/audit_uevents.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/appleapiopts.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocus.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragURLPreviews.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ino64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_filesec_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_iovec_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_id_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsobj_id_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_gid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_pid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_guid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uuid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_cond_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_once_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mode_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_time_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_rune_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ct_rune_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_wctype_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mbstate_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_size_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_blksize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_rsize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ssize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ptrdiff_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_off_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_clock_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_nlink_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_socklen_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ino_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_errno_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_wchar_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_in_addr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_caddr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_intptr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uintptr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_attr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_useconds_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_suseconds_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_wctrans_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sigset_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_blkcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsblkcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsfilcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_wint_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mach_port_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_in_port_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_dev_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_intmax_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uintmax_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_key_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_key_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sa_family_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/float.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/stat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_act.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitTimeEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMotionEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBlurEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVibrancyEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/NSObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/HeapObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/object.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/object.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/select.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_select.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_inspect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderMaterializedSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSIndexSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/ShareSheet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActionSheet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Target.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/socket.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/arpa/inet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/lock_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_seek_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSessionPreset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSDataAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_isset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/wait.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/bsm/audit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ulimit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUAudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioOutputUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_init.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_inherit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTextCheckingResult.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_s_ifmt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVOutputSettingsAssistant.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuElement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityElement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCompositionTrackSegment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrackSegment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIManagedDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitMIDIInstrument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dirent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/dirent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPressesEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/event.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusMovementHint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutConstraint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStdint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioConnectionPoint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RefCount.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/mount.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_reboot.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_prot.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/getopt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlert.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/assert.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_short.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/port.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_port.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationShimSupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverSupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPropertyList.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_va_list.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_host.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/kdebug_signpost.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCompositionalLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioChannelLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewTransitionLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewFlowLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriterInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDepthDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureVideoDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureMetadataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureStillImageOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetReaderOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioPreviewOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIOpenURLContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_mcontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_mcontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ucontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ucontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/net_kev.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_priv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_priv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fenv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/iconv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverBackgroundView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStackView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewHeaderFooterView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityIndicatorView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIProgressView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffectView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInputView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITargetedPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITargetedDragPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSShadow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/CAShow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ftw.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/complex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioMix.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/matrix.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/utmpx.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/lctx.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitDelay.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPointerArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/sync_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/notify.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_notify.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrthography.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_reply.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_copy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/monetary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_monetary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderSearchQuery.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDICapabilityInquiry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategory.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGeometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/geometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLESAvailability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_posix_availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Visibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/FoundationLegacySwiftCompatibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_security.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProxy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach-o/module.map /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libxml2/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/unicode/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/CommonCrypto/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudio.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/DerivedData/Catch\ the\ jellyfish/Build/Intermediates.noindex/Catch\ the\ jellyfish.build/Debug-iphonesimulator/Catch\ the\ jellyfish.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/Mouse.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/AppDelegate.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/GameMain.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/ViewController.swift /Users/nazarkovalik/Desktop/work/MouseHunter/MouseHunter/Catch\ the\ jellyfish/Classes.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMIDI.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreMedia.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/simd.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/AVFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreAudio.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMIDI.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreMedia.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/simd.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/AVFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreAudio.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval32.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval64.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ucontext64.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet6/in6.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/CoreMIDI.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugInCOM.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitEQ.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/alloca.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerMediaSelectionCriteria.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVDepthData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCameraCalibrationData.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/data.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/quota.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netdb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/timeb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIKernelMetalLib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdlib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_stdlib.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/glob.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitReverb.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioCodec.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timespec.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/logic.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomic.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_o_sync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_o_dsync.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/malloc/malloc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/malloc/_malloc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/proc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ipc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/rpc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exc.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSThread.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/pthread.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitVarispeed.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/sched.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/packed.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ucred.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomicDeprecated.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSSpinLockDeprecated.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_ctermid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/uuid/uuid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/gethostuuid.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextField.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchTextField.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/simd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICommand.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKeyCommand.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/kmod.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteboard.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboard.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/unistd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/unistd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pwd.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_interface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLIOSurface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtectionSpace.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/MusicDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderService.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenshotService.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIToolbarAppearance.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedCollectionDifference.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/once.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDiffableDataSource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/source.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/resource.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusGuide.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILayoutGuide.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenMode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioIONode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSourceNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSinkNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioMixerNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioPlayerNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioEnvironmentNode.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/rbtree.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHTTPCookieStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/ThreadLocalStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredentialStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/message.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/message.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescriptionBridge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTimeRange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedCollectionChange.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLAuthenticationChallenge.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTextureCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetCache.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHTTPCookie.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMovie.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector_make.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/locale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_locale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_xlocale.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSHashTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMapTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_purgable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_posix_vdisable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileHandle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/CAFFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/ExtendedAudioFile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/file.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/clonefile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/copyfile.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTextStyleRule.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/utsname.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVHostTime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_time.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/NSObjCRuntime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/runtime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/utime.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScene.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWindowScene.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioEngine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_os_inline.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTimeZone.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterShape.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_ctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/__wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/__wctype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/runetype.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/semaphore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUbiquitousKeyValueStore.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSystemPressure.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFeature.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMethodSignature.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVOpenGLESTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTexture.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutputBase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/base.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/readpassphrase.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLResponse.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCompoundPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSComparisonPredicate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteDelegate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/thread_state.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/thread_state.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSemanticSegmentationMatte.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPortraitEffectsMatte.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSAtomicQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSimpleQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNotificationQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBufferQueue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/queue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/queue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardSegue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardPopoverSegue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValue.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/time_value.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_page_size.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_setsize.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_def.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStddef.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_offsetof.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/fp_reg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mig.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfigurationReading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsynchronousKeyValueLoading.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragging.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionRequestHandling.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderThumbnailing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitioning.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDropping.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVQueuedSampleBufferRendering.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_string.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_symbol_aliasing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDataSourceTranslating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoCompositing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/AssertionReporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfigurationSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteConfigurationSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteractionSupporting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContentSizeCategoryImageAdjusting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategoryAdjusting.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueObserving.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSStringDrawing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioMixing.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/syslog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syslog.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/msg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fmtmsg.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/mach_debug.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/search.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fnmatch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/dispatch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitTimePitch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwitch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_switch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUGraph.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBezierPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSIndexPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/KeyPath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/math.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/math.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/tgmath.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/kauth.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-api.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/port_obj.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMovieTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCompositionTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sigaltstack.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/lock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/lock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Block.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMAudioClock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/block.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetDownloadTask.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_task.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/signal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AvailabilityInternal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDropProposal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_timeval.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateInterval.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/acl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_dl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILabel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIKernel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/dyld_kernel.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/gl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/util.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syscall.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCell.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/poll.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/poll.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNull.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_null.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLProtocol.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAutoreleasePool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferPool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMMemoryPool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStdbool.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISegmentedControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPageControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRefreshControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/pthread_impl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ioctl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sysctl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fcntl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/fcntl.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFileStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_param.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ndbm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplicationShortcutItem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_nl_item.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/System.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusSystem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuSystem.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/shm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ioccom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ttycom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Random.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityZoom.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/vm.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/boolean.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_endian.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/mman.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dlfcn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreen.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libgen.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet/in.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILexicon.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRegion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_region.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/quaternion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationServiceExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSFileProviderExtension.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileVersion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/conversion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDINetworkSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetExportSession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVContentKeySession.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExpression.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRegularExpression.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityIdentification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSInvocation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIRenderDestination.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOperation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItemDecoration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStateRestoration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPasteConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageSymbolConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewControllerConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder+UIActivityItemsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeActionsConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUAudioUnitImplementation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSJSONSerialization.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextualAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserAction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPencilInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextItemInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDropInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewInteraction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaSelection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIThruConnection.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVComposition.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoComposition.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSException.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exception.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelFormatDescription.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitDistortion.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarCommon.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/common.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_common.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIButton.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/extern.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/kern_return.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/un.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/spawn.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProcessInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/ipc_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/page_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/zone_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/hash_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/vm_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/lockgroup_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_info.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/langinfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_langinfo.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/io.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/aio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/aio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_stdio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFAudio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVFAudio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/sockio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/filio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/cpio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/uio.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/errno.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/errno.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_zero.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/objc-auto.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MTAudioProcessingTap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_map.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/bootstrap.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/netinet/tcp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/setjmp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRunLoop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/workloop.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/grp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMTextMarkup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVTimedMetadataGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrackGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaSelectionGroup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/group.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDISetup.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wordexp.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIToolbar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_char.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/wchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_wchar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/tar.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_var.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/ndr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSequencer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetReader.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetResourceLoader.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/FileProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITimingCurveProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSUserActivity+NSItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemProvider.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuBuilder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/i386/OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/i386/_OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libkern/_OSByteOrder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/architecture/byte_order.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioRecorder.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMSampleBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBlockBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioBuffer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetDownloadStorageManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStatusBarManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/DocumentManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutManager.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLinguisticTagger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusDebugger.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICloudSharingController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINavigationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPresentationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverPresentationController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentInteractionController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInteractionController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITabBarController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImagePickerController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrinterPickerController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVideoEditorController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPageViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerExtensionViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchContainerViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInputViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentMenuViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIReferenceLibraryViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityViewController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchDisplayController.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CISampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitSampler.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTimer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSValueTransformer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContainer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSScanner.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPaper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerLooper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileWrapper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStepper.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsPDFRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPageRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsImageRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferAudioRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragPreviewRenderer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSXMLParser.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccelerometer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIRAWFilter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrinter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioConverter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioConverter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRelativeDateTimeFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSISO8601DateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLengthFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateIntervalFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMassFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPersonNameComponentsFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDateComponentsFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurementFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSByteCountFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSListFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnergyFormatter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyedArchiver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIDriver.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILargeContentViewer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSynchronizedLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureVideoPreviewLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferDisplayLayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVMIDIPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/MusicPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioPlayer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPinchGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPanGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScreenEdgePanGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIRotationGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITapGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILongPressGestureRecognizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVSampleBufferRenderSynchronizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDataOutputSynchronizer.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_clr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutAnchor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFieldBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPushBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicItemBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollisionBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISnapBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAttachmentBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGravityBehavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_behavior.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPrintError.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/error.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_error.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageProcessor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImageAccumulator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicAnimator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewPropertyAnimator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextFormattingCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusAnimationCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitionCoordinator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetImageGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINotificationFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISelectionFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImpactFeedbackGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitGenerator.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIVector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemMediaDataCollector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIDetector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVRouteDetector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterConstructor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIBarcodeDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityLocationDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSortDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/err.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/attr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/xattr.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RuntimeStubs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFontMetrics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_statistics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNetServices.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnitProperties.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MTFormatNames.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/times.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/MacTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/AudioSessionTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/std_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/if_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach_debug/mach_debug_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/nl_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/exception_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_voucher_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/vector_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/memory_object_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/matrix_types.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/gltypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/inttypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_inttypes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMetadataAttributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_attributes.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/cdefs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/statvfs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xattr_flags.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/eflags.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/strings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/secure/_strings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioProcessingSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVVideoSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSettings.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/paths.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread_spis.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVSpeechSynthesis.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/TargetConditionals.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_syscalls.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSDataShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/LibcShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/UnicodeShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSLocaleShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RuntimeShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSTimeZoneShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CFHashingShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSIndexPathShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreFoundationShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCalendarShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCoderShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSFileManagerShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSUndoManagerShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSKeyedArchiverShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSErrorShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CFCharacterSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSCharacterSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSIndexSetShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/ObjectiveCOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreMediaOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/LibcOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/DispatchOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/CoreFoundationOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/UIKitOverlayShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/NSDictionaryShims.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilterBuiltins.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UINibDeclarations.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderActions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccessRestrictions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPointerFunctions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UNNotificationResponse+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSIndexPath+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSItemProvider+UIKitAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneActivationConditions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneDefinitions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISceneOptions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/termios.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/termios.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/pthread/qos.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/qos.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ConditionalMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AssertMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/AvailabilityMacros.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_traps.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ifaddrs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataIdentifiers.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITimingParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnitParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragPreviewParameters.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/FoundationErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mig_errors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRendererSubclass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccess.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPress.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProgress.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/GlobalObjects.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/_structs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/_structs.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_limits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/syslimits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sysexits.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserDefaults.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ttydefaults.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPersonNameComponents.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/bsm/audit_uevents.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/appleapiopts.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_special_ports.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocus.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/i386/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/machine/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_status.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextDragURLPreviews.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint32_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ino64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint64_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint16_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_int8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uint8_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_filesec_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_iovec_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_id_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsobj_id_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_gid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_pid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_guid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uuid_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_cond_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_once_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mode_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_time_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_rune_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ct_rune_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_wctype_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mbstate_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_size_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_blksize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_rsize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ssize_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ptrdiff_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_off_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_clock_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_nlink_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_socklen_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ino_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_errno_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_wchar_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_in_addr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_caddr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_intptr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_uintptr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_attr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_useconds_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_suseconds_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_wctrans_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sigset_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_blkcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsblkcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fsfilcnt_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_wint_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_mach_port_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_in_port_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_dev_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_intmax_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_types/_uintmax_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_key_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_pthread/_pthread_key_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_sa_family_t.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMediaFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioFormat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/float.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/stat.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_act.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitTimeEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMotionEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIBlurEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVibrancyEffect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/NSObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVMetadataObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/HeapObject.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/object.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/object.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/select.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_select.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_inspect.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderMaterializedSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSIndexSet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/ShareSheet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActionSheet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Target.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/socket.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/arpa/inet.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/lock_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_seek_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/processor_set.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSessionPreset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSDataAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageAsset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_isset.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/wait.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/bsm/audit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ulimit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUAudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioOutputUnit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_init.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_inherit.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSTextCheckingResult.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_s_ifmt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVOutputSettingsAssistant.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenuElement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityElement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurement.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCompositionTrackSegment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetTrackSegment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIManagedDocument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitMIDIInstrument.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AUComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitComponent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dirent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/dirent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPressesEvent.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/event.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFocusMovementHint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_int.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutConstraint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/SwiftStdint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/stdint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioConnectionPoint.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/RefCount.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/mount.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_reboot.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/vm_prot.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/getopt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlert.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/assert.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_u_short.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/port.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_port.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/FoundationShimSupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverSupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderRequest.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPropertyList.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_va_list.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/mach_host.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/kdebug_signpost.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCompositionalLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioChannelLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewTransitionLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewFlowLayout.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriterInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextInput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDepthDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureVideoDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioDataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureMetadataOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureStillImageOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureFileOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVPlayerItemOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCapturePhotoOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetReaderOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioPreviewOutput.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES1/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES2/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/ES3/glext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIOpenURLContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/i386/_mcontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/machine/_mcontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/ucontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_ucontext.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/net/net_kev.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_priv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_priv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/fenv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/iconv.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverBackgroundView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImageView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStackView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableViewHeaderFooterView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityIndicatorView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIProgressView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffectView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInputView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITargetedPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDragPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITargetedDragPreview.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSShadow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/CAShow.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/ftw.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/_regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_regex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/complex.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAudioMix.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/matrix.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/utmpx.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/lctx.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioUnitDelay.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPointerArray.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/sync_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/thread_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/task_policy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/notify.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_notify.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrthography.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/clock_reply.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_types/_fd_copy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/monetary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/xlocale/_monetary.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderSearchQuery.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDICapabilityInquiry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategory.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGeometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/geometry.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLESAvailability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/os/availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/sys/_posix_availability.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/Visibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/FoundationLegacySwiftCompatibility.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach/host_security.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUserActivity.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProxy.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/mach-o/module.map /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/libxml2/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/simd/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/unicode/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/dispatch/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/CommonCrypto/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMIDI.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/ImageIO.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudio.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/FileProvider.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/shims/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioTypes.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/MediaToolbox.framework/Headers/MediaToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/charge/charge.d (GPLv2 only).
/**
* Source file for StartupScene.
*/
module charge.game.scene.startup;
import charge.math.color : Color4f;
import charge.util.vector : Vector;
static import charge.gfx.font;
static import charge.gfx.draw;
static import charge.gfx.target;
static import charge.ctl.input;
static import charge.ctl.mouse;
static import charge.ctl.keyboard;
import charge.game.scene.scene;
/**
* Scene that runs tasks and displays progress.
*
* Often used at startup to load several things at
* the same time.
*/
class StartupScene : Scene
{
protected:
string[] errors;
private:
SceneManager r;
mixin charge.sys.logger.Logging;
charge.ctl.keyboard.Keyboard keyboard;
charge.ctl.mouse.Mouse mouse;
charge.gfx.draw.Draw d;
Vector!(Task) active;
Vector!(Task) done;
Vector!(Task) added;
Vector!(Task) signaled;
public:
this(SceneManager r)
{
super(Type.Menu);
this.r = r;
keyboard = charge.ctl.input.Input().keyboard;
mouse = charge.ctl.input.Input().mouse;
d = new charge.gfx.draw.Draw();
r.addBuilder(&build);
}
~this()
{
assert(active.length == 0);
assert(signaled.length == 0);
}
override void close()
{
r.removeBuilder(&build);
// Make sure that all tasks are closed.
foreach(task; active.adup) {
task.close();
// List is duped this is safe.
active.remove(task);
// Safe to remove twice.
r.removeBuilder(&task.build);
}
// Incase somebody thought they be clever and
// add another task on the active list.
assert(active.length == 0);
// All signaled task are also on the active list.
signaled.removeAll();
}
override void logic()
{
/* nothing */
}
override void render(charge.gfx.target.RenderTarget rt)
{
d.target = rt;
d.start();
auto f = charge.gfx.font.BitmapFont.defaultFont;
const barWidth = 50;
auto w = 1 * f.width + barWidth + 1;
auto h = 1 * f.height;
int x = rt.width - w;
int y = rt.height - h * 2;
uint fWidth;
uint fHeight;
foreach_reverse(task; active) {
f.buildSize(task.text, fWidth, fHeight);
f.draw(d, x - fWidth - f.width, y, task.text, false);
uint bW = cast(uint)((task.completed / 100f) * barWidth);
d.fill(Color4f.White, false, x , y + 0, barWidth + 1, h - 1);
d.fill(Color4f.Black, false, x + 1, y + 1, barWidth - 1, h - 3);
d.fill(Color4f.White, false, x + 1, y + 1, bW, h - 3);
y -= h;
}
foreach_reverse(task; done) {
f.buildSize(task.text, fWidth, fHeight);
f.draw(d, x - fWidth - f.width, y, task.text, false);
d.fill(Color4f.White, false, x, y, barWidth + 1, h - 1);
y -= h;
}
d.stop();
}
override void assumeControl()
{
keyboard.down ~= &this.keyDown;
}
override void dropControl()
{
keyboard.down -= &this.keyDown;
}
bool build()
{
// The last mangeTasks took care of
// the handleNoTaskLeft call.
if (added.length == 0 &&
active.length == 0 &&
signaled.length == 0)
return false;
manageTasks();
// Nothing to do.
if (added.length == 0 &&
active.length == 0)
return false;
bool built;
foreach(t; active)
built = t.build() || built;
// Want to be called again if we have new stuff.
built = added.length > 0 || built;
manageTasks();
// New task added by manageTasks, ask to be called again.
return built || added.length > 0;
}
abstract void handleNoTaskLeft();
abstract void handleEscapePressed();
/*
*
* Tasks functions.
*
*/
void signalError(Task task, string[] errors)
{
this.errors = errors;
assert(signaled.find(task) < 0);
assert(active.find(task) >= 0);
assert(done.find(task) < 0);
signaled.add(task);
r.removeBuilder(&task.build);
}
final void addTask(Task task)
{
assert(signaled.find(task) < 0);
assert(active.find(task) < 0);
assert(added.find(task) < 0);
assert(done.find(task) < 0);
added.add(task);
}
final void signalDone(Task task)
{
assert(active.find(task) >= 0 || added.find(task) >= 0);
assert(signaled.find(task) < 0);
assert(done.find(task) < 0);
signaled.add(task);
}
final void manageTasks()
{
foreach(t; added) {
active.add(t);
}
added.removeAll();
foreach(task; signaled) {
active.remove(task);
task.close();
done.add(task);
assert(active.find(task) < 0);
}
signaled.removeAll();
if (active.length == 0)
handleNoTaskLeft();
}
protected:
/*
*
* Input functions.
*
*/
void keyDown(charge.ctl.keyboard.Keyboard kb, int sym, dchar unicode, char[] str)
{
if (sym != 27)
return;
handleEscapePressed();
}
}
abstract class Task
{
protected:
StartupScene startup;
int completed;
string text;
public:
this(StartupScene startup)
{
this.startup = startup;
}
void signalDone()
{
completed = 100;
startup.signalDone(this);
}
void signalError(string[] errors)
{
completed = -1;
startup.signalError(this, errors);
}
void nextTask(Task t)
{
startup.addTask(t);
}
abstract void close();
abstract bool build();
}
|
D
|
extern(C):
import tokenizer;
import utils;
import ast;
import gen;
import sema;
import core.stdc.stdio;
import core.stdc.string;
int Main(FILE* fp, int argc, char** argv)
{
if(argc != 2) {
fprintf(stderr, "引数の個数が正しくありません\n");
return 1;
}
user_input = argv[1];
size_t input_len = strlen(argv[1]);
token = tokenize(argv[1][0 .. input_len]);
Node*[] func_decl_defs = program();
semantic_analysis(func_decl_defs);
LLVM_IR_Env env;
env.header_fp = tmpfile();
env.fp = tmpfile();
env.constval_cnt = 0;
gen_llvm_ir_decl_def(&env, func_decl_defs);
concat_ir(fp, env.header_fp);
concat_ir(fp, env.fp);
return 0;
}
|
D
|
a carbonaceous material obtained by heating wood or other organic matter in the absence of air
a stick of black carbon material used for drawing
a very dark grey color
a drawing made with a stick of black carbon material
draw, trace, or represent with charcoal
of a very dark grey
|
D
|
//Written in the D programming language
/++
$(SECTION Intro)
$(LUCKY Regular expressions) are a commonly used method of pattern matching
on strings, with $(I regex) being a catchy word for a pattern in this domain
specific language. Typical problems usually solved by regular expressions
include validation of user input and the ubiquitous find & replace
in text processing utilities.
$(SECTION Synopsis)
---
import std.regex;
import std.stdio;
void main()
{
// Print out all possible dd/mm/yy(yy) dates found in user input.
auto r = regex(r"\b[0-9][0-9]?/[0-9][0-9]?/[0-9][0-9](?:[0-9][0-9])?\b");
foreach(line; stdin.byLine)
{
// matchAll() returns a range that can be iterated
// to get all subsequent matches.
foreach(c; matchAll(line, r))
writeln(c.hit);
}
}
...
// Create a static regex at compile-time, which contains fast native code.
auto ctr = ctRegex!(`^.*/([^/]+)/?$`);
// It works just like a normal regex:
auto c2 = matchFirst("foo/bar", ctr); // First match found here, if any
assert(!c2.empty); // Be sure to check if there is a match before examining contents!
assert(c2[1] == "bar"); // Captures is a range of submatches: 0 = full match.
...
// The result of the $(D matchAll) is directly testable with if/assert/while.
// e.g. test if a string consists of letters:
assert(matchFirst("Letter", `^\p{L}+$`));
---
$(SECTION Syntax and general information)
The general usage guideline is to keep regex complexity on the side of simplicity,
as its capabilities reside in purely character-level manipulation.
As such it's ill-suited for tasks involving higher level invariants
like matching an integer number $(U bounded) in an [a,b] interval.
Checks of this sort of are better addressed by additional post-processing.
The basic syntax shouldn't surprise experienced users of regular expressions.
For an introduction to $(D std.regex) see a
$(WEB dlang.org/regular-expression.html, short tour) of the module API
and its abilities.
There are other web resources on regular expressions to help newcomers,
and a good $(WEB www.regular-expressions.info, reference with tutorial)
can easily be found.
This library uses a remarkably common ECMAScript syntax flavor
with the following extensions:
$(UL
$(LI Named subexpressions, with Python syntax. )
$(LI Unicode properties such as Scripts, Blocks and common binary properties e.g Alphabetic, White_Space, Hex_Digit etc.)
$(LI Arbitrary length and complexity lookbehind, including lookahead in lookbehind and vise-versa.)
)
$(REG_START Pattern syntax )
$(I std.regex operates on codepoint level,
'character' in this table denotes a single Unicode codepoint.)
$(REG_TABLE
$(REG_TITLE Pattern element, Semantics )
$(REG_TITLE Atoms, Match single characters )
$(REG_ROW any character except [{|*+?()^$, Matches the character itself. )
$(REG_ROW ., In single line mode matches any character.
Otherwise it matches any character except '\n' and '\r'. )
$(REG_ROW [class], Matches a single character
that belongs to this character class. )
$(REG_ROW [^class], Matches a single character that
does $(U not) belong to this character class.)
$(REG_ROW \cC, Matches the control character corresponding to letter C)
$(REG_ROW \xXX, Matches a character with hexadecimal value of XX. )
$(REG_ROW \uXXXX, Matches a character with hexadecimal value of XXXX. )
$(REG_ROW \U00YYYYYY, Matches a character with hexadecimal value of YYYYYY. )
$(REG_ROW \f, Matches a formfeed character. )
$(REG_ROW \n, Matches a linefeed character. )
$(REG_ROW \r, Matches a carriage return character. )
$(REG_ROW \t, Matches a tab character. )
$(REG_ROW \v, Matches a vertical tab character. )
$(REG_ROW \d, Matches any Unicode digit. )
$(REG_ROW \D, Matches any character except Unicode digits. )
$(REG_ROW \w, Matches any word character (note: this includes numbers).)
$(REG_ROW \W, Matches any non-word character.)
$(REG_ROW \s, Matches whitespace, same as \p{White_Space}.)
$(REG_ROW \S, Matches any character except those recognized as $(I \s ). )
$(REG_ROW \\, Matches \ character. )
$(REG_ROW \c where c is one of [|*+?(), Matches the character c itself. )
$(REG_ROW \p{PropertyName}, Matches a character that belongs
to the Unicode PropertyName set.
Single letter abbreviations can be used without surrounding {,}. )
$(REG_ROW \P{PropertyName}, Matches a character that does not belong
to the Unicode PropertyName set.
Single letter abbreviations can be used without surrounding {,}. )
$(REG_ROW \p{InBasicLatin}, Matches any character that is part of
the BasicLatin Unicode $(U block).)
$(REG_ROW \P{InBasicLatin}, Matches any character except ones in
the BasicLatin Unicode $(U block).)
$(REG_ROW \p{Cyrillic}, Matches any character that is part of
Cyrillic $(U script).)
$(REG_ROW \P{Cyrillic}, Matches any character except ones in
Cyrillic $(U script).)
$(REG_TITLE Quantifiers, Specify repetition of other elements)
$(REG_ROW *, Matches previous character/subexpression 0 or more times.
Greedy version - tries as many times as possible.)
$(REG_ROW *?, Matches previous character/subexpression 0 or more times.
Lazy version - stops as early as possible.)
$(REG_ROW +, Matches previous character/subexpression 1 or more times.
Greedy version - tries as many times as possible.)
$(REG_ROW +?, Matches previous character/subexpression 1 or more times.
Lazy version - stops as early as possible.)
$(REG_ROW {n}, Matches previous character/subexpression exactly n times. )
$(REG_ROW {n,}, Matches previous character/subexpression n times or more.
Greedy version - tries as many times as possible. )
$(REG_ROW {n,}?, Matches previous character/subexpression n times or more.
Lazy version - stops as early as possible.)
$(REG_ROW {n,m}, Matches previous character/subexpression n to m times.
Greedy version - tries as many times as possible, but no more than m times. )
$(REG_ROW {n,m}?, Matches previous character/subexpression n to m times.
Lazy version - stops as early as possible, but no less then n times.)
$(REG_TITLE Other, Subexpressions & alternations )
$(REG_ROW (regex), Matches subexpression regex,
saving matched portion of text for later retrieval. )
$(REG_ROW (?:regex), Matches subexpression regex,
$(U not) saving matched portion of text. Useful to speed up matching. )
$(REG_ROW A|B, Matches subexpression A, or failing that, matches B. )
$(REG_ROW (?P<name>regex), Matches named subexpression
regex labeling it with name 'name'.
When referring to a matched portion of text,
names work like aliases in addition to direct numbers.
)
$(REG_TITLE Assertions, Match position rather than character )
$(REG_ROW ^, Matches at the begining of input or line (in multiline mode).)
$(REG_ROW $, Matches at the end of input or line (in multiline mode). )
$(REG_ROW \b, Matches at word boundary. )
$(REG_ROW \B, Matches when $(U not) at word boundary. )
$(REG_ROW (?=regex), Zero-width lookahead assertion.
Matches at a point where the subexpression
regex could be matched starting from the current position.
)
$(REG_ROW (?!regex), Zero-width negative lookahead assertion.
Matches at a point where the subexpression
regex could $(U not) be matched starting from the current position.
)
$(REG_ROW (?<=regex), Zero-width lookbehind assertion. Matches at a point
where the subexpression regex could be matched ending
at the current position (matching goes backwards).
)
$(REG_ROW (?<!regex), Zero-width negative lookbehind assertion.
Matches at a point where the subexpression regex could $(U not)
be matched ending at the current position (matching goes backwards).
)
)
$(REG_START Character classes )
$(REG_TABLE
$(REG_TITLE Pattern element, Semantics )
$(REG_ROW Any atom, Has the same meaning as outside of a character class.)
$(REG_ROW a-z, Includes characters a, b, c, ..., z. )
$(REG_ROW [a||b], [a--b], [a~~b], [a&&b], Where a, b are arbitrary classes,
means union, set difference, symmetric set difference, and intersection respectively.
$(I Any sequence of character class elements implicitly forms a union.) )
)
$(REG_START Regex flags )
$(REG_TABLE
$(REG_TITLE Flag, Semantics )
$(REG_ROW g, Global regex, repeat over the whole input. )
$(REG_ROW i, Case insensitive matching. )
$(REG_ROW m, Multi-line mode, match ^, $ on start and end line separators
as well as start and end of input.)
$(REG_ROW s, Single-line mode, makes . match '\n' and '\r' as well. )
$(REG_ROW x, Free-form syntax, ignores whitespace in pattern,
useful for formatting complex regular expressions. )
)
$(SECTION Unicode support)
This library provides full Level 1 support* according to
$(WEB unicode.org/reports/tr18/, UTS 18). Specifically:
$(UL
$(LI 1.1 Hex notation via any of \uxxxx, \U00YYYYYY, \xZZ.)
$(LI 1.2 Unicode properties.)
$(LI 1.3 Character classes with set operations.)
$(LI 1.4 Word boundaries use the full set of "word" characters.)
$(LI 1.5 Using simple casefolding to match case
insensitively across the full range of codepoints.)
$(LI 1.6 Respecting line breaks as any of
\u000A | \u000B | \u000C | \u000D | \u0085 | \u2028 | \u2029 | \u000D\u000A.)
$(LI 1.7 Operating on codepoint level.)
)
*With exception of point 1.1.1, as of yet, normalization of input
is expected to be enforced by user.
$(SECTION Replace format string)
A set of functions in this module that do the substitution rely
on a simple format to guide the process. In particular the table below
applies to the $(D format) argument of
$(LREF replaceFirst) and $(LREF replaceAll).
The format string can reference parts of match using the following notation.
$(REG_TABLE
$(REG_TITLE Format specifier, Replaced by )
$(REG_ROW $&, the whole match. )
$(REG_ROW $`, part of input $(I preceding) the match. )
$(REG_ROW $', part of input $(I following) the match. )
$(REG_ROW $$, '$' character. )
$(REG_ROW \c , where c is any character, the character c itself. )
$(REG_ROW \\, '\' character. )
$(REG_ROW $1 .. $99, submatch number 1 to 99 respectively. )
)
$(SECTION Slicing and zero memory allocations orientation)
All matches returned by pattern matching functionality in this library
are slices of the original input. The notable exception is the $(D replace)
family of functions that generate a new string from the input.
In cases where producing the replacement is the ultimate goal
$(LREF replaceFirstInto) and $(LREF replaceAllInto) could come in handy
as functions that avoid allocations even for replacement.
Copyright: Copyright Dmitry Olshansky, 2011-
License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Dmitry Olshansky,
API and utility constructs are modeled after the original $(D std.regex)
by Walter Bright and Andrei Alexandrescu.
Source: $(PHOBOSSRC std/_regex.d)
Macros:
REG_ROW = $(TR $(TD $(I $1 )) $(TD $+) )
REG_TITLE = $(TR $(TD $(B $1)) $(TD $(B $2)) )
REG_TABLE = <table border="1" cellspacing="0" cellpadding="5" > $0 </table>
REG_START = <h3><div align="center"> $0 </div></h3>
SECTION = <h3><a id="$1">$0</a></h3>
S_LINK = <a href="#$1">$+</a>
+/
module std.regex;
import std.internal.uni, std.internal.uni_tab;//Unicode property tables
import std.array, std.algorithm, std.range,
std.conv, std.exception, std.traits, std.typetuple,
std.utf, std.format, std.typecons, std.bitmanip,
std.functional, std.exception;
import core.bitop, core.stdc.string, core.stdc.stdlib;
static import std.ascii;
import std.string : representation;
debug(std_regex_parser) import std.stdio; //trace parser progress
debug(std_regex_search) import std.stdio; //trace prefix search engine
debug(std_regex_matcher) import std.stdio; //trace matcher engine
debug(std_regex_allocation) import std.stdio; //track object life cycle
debug(std_regex_ctr) import std.stdio; //dump ctRegex generated sources
debug(std_regex_test) import std.stdio; //trace test suite progress
private:
import std.uni : isAlpha, isWhite;
// IR bit pattern: 0b1_xxxxx_yy
// where yy indicates class of instruction, xxxxx for actual operation code
// 00: atom, a normal instruction
// 01: open, opening of a group, has length of contained IR in the low bits
// 10: close, closing of a group, has length of contained IR in the low bits
// 11 unused
//
// Loops with Q (non-greedy, with ? mark) must have the same size / other properties as non Q version
// Possible changes:
//* merge group, option, infinite/repeat start (to never copy during parsing of (a|b){1,2})
//* reorganize groups to make n args easier to find, or simplify the check for groups of similar ops
// (like lookaround), or make it easier to identify hotspots.
enum IR:uint {
Char = 0b1_00000_00, //a character
Any = 0b1_00001_00, //any character
CodepointSet = 0b1_00010_00, //a most generic CodepointSet [...]
Trie = 0b1_00011_00, //CodepointSet implemented as Trie
//match with any of a consecutive OrChar's in this sequence
//(used for case insensitive match)
//OrChar holds in upper two bits of data total number of OrChars in this _sequence_
//the drawback of this representation is that it is difficult
// to detect a jump in the middle of it
OrChar = 0b1_00100_00,
Nop = 0b1_00101_00, //no operation (padding)
End = 0b1_00110_00, //end of program
Bol = 0b1_00111_00, //beginning of a string ^
Eol = 0b1_01000_00, //end of a string $
Wordboundary = 0b1_01001_00, //boundary of a word
Notwordboundary = 0b1_01010_00, //not a word boundary
Backref = 0b1_01011_00, //backreference to a group (that has to be pinned, i.e. locally unique) (group index)
GroupStart = 0b1_01100_00, //start of a group (x) (groupIndex+groupPinning(1bit))
GroupEnd = 0b1_01101_00, //end of a group (x) (groupIndex+groupPinning(1bit))
Option = 0b1_01110_00, //start of an option within an alternation x | y (length)
GotoEndOr = 0b1_01111_00, //end of an option (length of the rest)
//... any additional atoms here
OrStart = 0b1_00000_01, //start of alternation group (length)
OrEnd = 0b1_00000_10, //end of the or group (length,mergeIndex)
//with this instruction order
//bit mask 0b1_00001_00 could be used to test/set greediness
InfiniteStart = 0b1_00001_01, //start of an infinite repetition x* (length)
InfiniteEnd = 0b1_00001_10, //end of infinite repetition x* (length,mergeIndex)
InfiniteQStart = 0b1_00010_01, //start of a non eager infinite repetition x*? (length)
InfiniteQEnd = 0b1_00010_10, //end of non eager infinite repetition x*? (length,mergeIndex)
RepeatStart = 0b1_00011_01, //start of a {n,m} repetition (length)
RepeatEnd = 0b1_00011_10, //end of x{n,m} repetition (length,step,minRep,maxRep)
RepeatQStart = 0b1_00100_01, //start of a non eager x{n,m}? repetition (length)
RepeatQEnd = 0b1_00100_10, //end of non eager x{n,m}? repetition (length,step,minRep,maxRep)
//
LookaheadStart = 0b1_00101_01, //begin of the lookahead group (length)
LookaheadEnd = 0b1_00101_10, //end of a lookahead group (length)
NeglookaheadStart = 0b1_00110_01, //start of a negative lookahead (length)
NeglookaheadEnd = 0b1_00110_10, //end of a negative lookahead (length)
LookbehindStart = 0b1_00111_01, //start of a lookbehind (length)
LookbehindEnd = 0b1_00111_10, //end of a lookbehind (length)
NeglookbehindStart= 0b1_01000_01, //start of a negative lookbehind (length)
NeglookbehindEnd = 0b1_01000_10, //end of negative lookbehind (length)
}
//a shorthand for IR length - full length of specific opcode evaluated at compile time
template IRL(IR code)
{
enum uint IRL = lengthOfIR(code);
}
static assert (IRL!(IR.LookaheadStart) == 3);
//how many parameters follow the IR, should be optimized fixing some IR bits
int immediateParamsIR(IR i){
switch (i){
case IR.OrEnd,IR.InfiniteEnd,IR.InfiniteQEnd:
return 1;
case IR.RepeatEnd, IR.RepeatQEnd:
return 4;
case IR.LookaheadStart, IR.NeglookaheadStart, IR.LookbehindStart, IR.NeglookbehindStart:
return 2;
default:
return 0;
}
}
//full length of IR instruction inlcuding all parameters that might follow it
int lengthOfIR(IR i)
{
return 1 + immediateParamsIR(i);
}
//full length of the paired IR instruction inlcuding all parameters that might follow it
int lengthOfPairedIR(IR i)
{
return 1 + immediateParamsIR(pairedIR(i));
}
//if the operation has a merge point (this relies on the order of the ops)
bool hasMerge(IR i)
{
return (i&0b11)==0b10 && i <= IR.RepeatQEnd;
}
//is an IR that opens a "group"
bool isStartIR(IR i)
{
return (i&0b11)==0b01;
}
//is an IR that ends a "group"
bool isEndIR(IR i)
{
return (i&0b11)==0b10;
}
//is a standalone IR
bool isAtomIR(IR i)
{
return (i&0b11)==0b00;
}
//makes respective pair out of IR i, swapping start/end bits of instruction
IR pairedIR(IR i)
{
assert(isStartIR(i) || isEndIR(i));
return cast(IR)(i ^ 0b11);
}
//encoded IR instruction
struct Bytecode
{
uint raw;
//natural constraints
enum maxSequence = 2+4;
enum maxData = 1<<22;
enum maxRaw = 1<<31;
this(IR code, uint data)
{
assert(data < (1<<22) && code < 256);
raw = code<<24 | data;
}
this(IR code, uint data, uint seq)
{
assert(data < (1<<22) && code < 256 );
assert(seq >= 2 && seq < maxSequence);
raw = code << 24 | (seq - 2)<<22 | data;
}
//store raw data
static Bytecode fromRaw(uint data)
{
Bytecode t;
t.raw = data;
return t;
}
//bit twiddling helpers
//0-arg template due to @@@BUG@@@ 10985
@property uint data()() const { return raw & 0x003f_ffff; }
//ditto
//0-arg template due to @@@BUG@@@ 10985
@property uint sequence()() const { return 2 + (raw >> 22 & 0x3); }
//ditto
//0-arg template due to @@@BUG@@@ 10985
@property IR code()() const { return cast(IR)(raw>>24); }
//ditto
@property bool hotspot() const { return hasMerge(code); }
//test the class of this instruction
@property bool isAtom() const { return isAtomIR(code); }
//ditto
@property bool isStart() const { return isStartIR(code); }
//ditto
@property bool isEnd() const { return isEndIR(code); }
//number of arguments for this instruction
@property int args() const { return immediateParamsIR(code); }
//mark this GroupStart or GroupEnd as referenced in backreference
void setBackrefence()
{
assert(code == IR.GroupStart || code == IR.GroupEnd);
raw = raw | 1 << 23;
}
//is referenced
@property bool backreference() const
{
assert(code == IR.GroupStart || code == IR.GroupEnd);
return cast(bool)(raw & 1 << 23);
}
//mark as local reference (for backrefs in lookarounds)
void setLocalRef()
{
assert(code == IR.Backref);
raw = raw | 1 << 23;
}
//is a local ref
@property bool localRef() const
{
assert(code == IR.Backref);
return cast(bool)(raw & 1 << 23);
}
//human readable name of instruction
@trusted @property string mnemonic() const
{//@@@BUG@@@ to is @system
return to!string(code);
}
//full length of instruction
@property uint length() const
{
return lengthOfIR(code);
}
//full length of respective start/end of this instruction
@property uint pairedLength() const
{
return lengthOfPairedIR(code);
}
//returns bytecode of paired instruction (assuming this one is start or end)
@property Bytecode paired() const
{//depends on bit and struct layout order
assert(isStart || isEnd);
return Bytecode.fromRaw(raw ^ 0b11 << 24);
}
//gets an index into IR block of the respective pair
uint indexOfPair(uint pc) const
{
assert(isStart || isEnd);
return isStart ? pc + data + length : pc - data - lengthOfPairedIR(code);
}
}
static assert(Bytecode.sizeof == 4);
//debugging tool, prints out instruction along with opcodes
@trusted string disassemble(in Bytecode[] irb, uint pc, in NamedGroup[] dict=[])
{
auto output = appender!string();
formattedWrite(output,"%s", irb[pc].mnemonic);
switch(irb[pc].code)
{
case IR.Char:
formattedWrite(output, " %s (0x%x)",cast(dchar)irb[pc].data, irb[pc].data);
break;
case IR.OrChar:
formattedWrite(output, " %s (0x%x) seq=%d", cast(dchar)irb[pc].data, irb[pc].data, irb[pc].sequence);
break;
case IR.RepeatStart, IR.InfiniteStart, IR.Option, IR.GotoEndOr, IR.OrStart:
//forward-jump instructions
uint len = irb[pc].data;
formattedWrite(output, " pc=>%u", pc+len+IRL!(IR.RepeatStart));
break;
case IR.RepeatEnd, IR.RepeatQEnd: //backward-jump instructions
uint len = irb[pc].data;
formattedWrite(output, " pc=>%u min=%u max=%u step=%u",
pc - len, irb[pc + 3].raw, irb[pc + 4].raw, irb[pc + 2].raw);
break;
case IR.InfiniteEnd, IR.InfiniteQEnd, IR.OrEnd: //ditto
uint len = irb[pc].data;
formattedWrite(output, " pc=>%u", pc-len);
break;
case IR.LookaheadEnd, IR.NeglookaheadEnd: //ditto
uint len = irb[pc].data;
formattedWrite(output, " pc=>%u", pc-len);
break;
case IR.GroupStart, IR.GroupEnd:
uint n = irb[pc].data;
string name;
foreach(v;dict)
if(v.group == n)
{
name = "'"~v.name~"'";
break;
}
formattedWrite(output, " %s #%u " ~ (irb[pc].backreference ? "referenced" : ""),
name, n);
break;
case IR.LookaheadStart, IR.NeglookaheadStart, IR.LookbehindStart, IR.NeglookbehindStart:
uint len = irb[pc].data;
uint start = irb[pc+1].raw, end = irb[pc+2].raw;
formattedWrite(output, " pc=>%u [%u..%u]", pc + len + IRL!(IR.LookaheadStart), start, end);
break;
case IR.Backref: case IR.CodepointSet: case IR.Trie:
uint n = irb[pc].data;
formattedWrite(output, " %u", n);
if(irb[pc].code == IR.Backref)
formattedWrite(output, " %s", irb[pc].localRef ? "local" : "global");
break;
default://all data-free instructions
}
if(irb[pc].hotspot)
formattedWrite(output, " Hotspot %u", irb[pc+1].raw);
return output.data;
}
//disassemble the whole chunk
@trusted void printBytecode()(in Bytecode[] slice, in NamedGroup[] dict=[])
{
import std.stdio;
for(uint pc=0; pc<slice.length; pc += slice[pc].length)
writeln("\t", disassemble(slice, pc, dict));
}
//index entry structure for name --> number of submatch
struct NamedGroup
{
string name;
uint group;
}
//holds pair of start-end markers for a submatch
struct Group(DataIndex)
{
DataIndex begin, end;
@trusted string toString() const
{
auto a = appender!string();
formattedWrite(a, "%s..%s", begin, end);
return a.data;
}
}
@trusted void reverseBytecode()(Bytecode[] code)
{
Bytecode[] rev = new Bytecode[code.length];
uint revPc = cast(uint)rev.length;
Stack!(Tuple!(uint, uint, uint)) stack;
uint start = 0;
uint end = cast(uint)code.length;
for(;;)
{
for(uint pc = start; pc < end; )
{
uint len = code[pc].length;
if(code[pc].code == IR.GotoEndOr)
break; //pick next alternation branch
if(code[pc].isAtom)
{
rev[revPc - len .. revPc] = code[pc .. pc + len];
revPc -= len;
pc += len;
}
else if(code[pc].isStart || code[pc].isEnd)
{
//skip over other embedded lookbehinds they are reversed
if(code[pc].code == IR.LookbehindStart
|| code[pc].code == IR.NeglookbehindStart)
{
uint blockLen = len + code[pc].data
+ code[pc].pairedLength;
rev[revPc - blockLen .. revPc] = code[pc .. pc + blockLen];
pc += blockLen;
revPc -= blockLen;
continue;
}
uint second = code[pc].indexOfPair(pc);
uint secLen = code[second].length;
rev[revPc - secLen .. revPc] = code[second .. second + secLen];
revPc -= secLen;
if(code[pc].code == IR.OrStart)
{
//we pass len bytes forward, but secLen in reverse
uint revStart = revPc - (second + len - secLen - pc);
uint r = revStart;
uint i = pc + IRL!(IR.OrStart);
while(code[i].code == IR.Option)
{
if(code[i - 1].code != IR.OrStart)
{
assert(code[i - 1].code == IR.GotoEndOr);
rev[r - 1] = code[i - 1];
}
rev[r] = code[i];
auto newStart = i + IRL!(IR.Option);
auto newEnd = newStart + code[i].data;
auto newRpc = r + code[i].data + IRL!(IR.Option);
if(code[newEnd].code != IR.OrEnd)
{
newRpc--;
}
stack.push(tuple(newStart, newEnd, newRpc));
r += code[i].data + IRL!(IR.Option);
i += code[i].data + IRL!(IR.Option);
}
pc = i;
revPc = revStart;
assert(code[pc].code == IR.OrEnd);
}
else
pc += len;
}
}
if(stack.empty)
break;
start = stack.top[0];
end = stack.top[1];
revPc = stack.top[2];
stack.pop();
}
code[] = rev[];
}
//Regular expression engine/parser options:
// global - search all nonoverlapping matches in input
// casefold - case insensitive matching, do casefolding on match in unicode mode
// freeform - ignore whitespace in pattern, to match space use [ ] or \s
// multiline - switch ^, $ detect start and end of linesinstead of just start and end of input
enum RegexOption: uint {
global = 0x1,
casefold = 0x2,
freeform = 0x4,
nonunicode = 0x8,
multiline = 0x10,
singleline = 0x20
}
//do not reorder this list
alias RegexOptionNames = TypeTuple!('g', 'i', 'x', 'U', 'm', 's');
static assert( RegexOption.max < 0x80);
enum RegexInfo : uint { oneShot = 0x80 }
alias Escapables = TypeTuple!('[', ']', '\\', '^', '$', '.', '|', '?', ',', '-',
';', ':', '#', '&', '%', '/', '<', '>', '`', '*', '+', '(', ')', '{', '}', '~');
private enum NEL = '\u0085', LS = '\u2028', PS = '\u2029';
//test if a given string starts with hex number of maxDigit that's a valid codepoint
//returns it's value and skips these maxDigit chars on success, throws on failure
dchar parseUniHex(Char)(ref Char[] str, size_t maxDigit)
{
//std.conv.parse is both @system and bogus
enforce(str.length >= maxDigit,"incomplete escape sequence");
uint val;
for(int k = 0; k < maxDigit; k++)
{
auto current = str[k];//accepts ascii only, so it's OK to index directly
if('0' <= current && current <= '9')
val = val * 16 + current - '0';
else if('a' <= current && current <= 'f')
val = val * 16 + current -'a' + 10;
else if('A' <= current && current <= 'F')
val = val * 16 + current - 'A' + 10;
else
throw new Exception("invalid escape sequence");
}
enforce(val <= 0x10FFFF, "invalid codepoint");
str = str[maxDigit..$];
return val;
}
@system unittest //BUG canFind is system
{
string[] non_hex = [ "000j", "000z", "FffG", "0Z"];
string[] hex = [ "01", "ff", "00af", "10FFFF" ];
int[] value = [ 1, 0xFF, 0xAF, 0x10FFFF ];
foreach(v; non_hex)
assert(collectException(parseUniHex(v, v.length)).msg
.canFind("invalid escape sequence"));
foreach(i, v; hex)
assert(parseUniHex(v, v.length) == value[i]);
string over = "0011FFFF";
assert(collectException(parseUniHex(over, over.length)).msg
.canFind("invalid codepoint"));
}
//heuristic value determines maximum CodepointSet length suitable for linear search
enum maxCharsetUsed = 6;
enum maxCachedTries = 8;
alias Trie = CodepointTrie!8;
Trie[const(CodepointSet)] trieCache;
//accessor with caching
@trusted Trie getTrie(in CodepointSet set)
{// @@@BUG@@@ 6357 almost all properties of AA are not @safe
if(__ctfe || maxCachedTries == 0)
return Trie(set);
else
{
auto p = set in trieCache;
if(p)
return *p;
if(trieCache.length == maxCachedTries)
{
// flush entries in trieCache
trieCache = null;
}
return (trieCache[set] = Trie(set));
}
}
//property for \w character class
@property CodepointSet wordCharacter()
{
return memoizeExpr!("CodepointSet.init.add(unicodeAlphabetic).add(unicodeMn).add(unicodeMc)
.add(unicodeMe).add(unicodeNd).add(unicodePc)")();
}
@property Trie wordTrie()
{
return memoizeExpr!("Trie(wordCharacter)")();
}
auto memoizeExpr(string expr)()
{
if(__ctfe)
return mixin(expr);
alias T = typeof(mixin(expr));
static T slot;
static bool initialized;
if(!initialized)
{
slot = mixin(expr);
initialized = true;
}
return slot;
}
/+
fetch codepoint set corresponding to a name (InBlock or binary property)
+/
@trusted const(CodepointSet) getUnicodeSet(in char[] name, bool negated, bool casefold)
{
alias ucmp = comparePropertyName;
CodepointSet s;
//unicode property
//helper: direct access with a sanity check
if(ucmp(name, "L") == 0 || ucmp(name, "Letter") == 0)
{
s.add(unicodeLu).add(unicodeLl).add(unicodeLt)
.add(unicodeLo).add(unicodeLm);
}
else if(ucmp(name,"LC") == 0 || ucmp(name,"Cased Letter") == 0)
{
s.add(unicodeLl).add(unicodeLu).add(unicodeLt);//Title case
}
else if(ucmp(name, "M") == 0 || ucmp(name, "Mark") == 0)
{
s.add(unicodeMn).add(unicodeMc).add(unicodeMe);
}
else if(ucmp(name, "P") == 0 || ucmp(name, "Punctuation") == 0)
{
s.add(unicodePc).add(unicodePd).add(unicodePs).add(unicodePe)
.add(unicodePi).add(unicodePf).add(unicodePo);
}
else if(ucmp(name, "S") == 0 || ucmp(name, "Symbol") == 0)
{
s.add(unicodeSm).add(unicodeSc).add(unicodeSk).add(unicodeSo);
}
else if(ucmp(name, "Z") == 0 || ucmp(name, "Separator") == 0)
{
s.add(unicodeZs).add(unicodeZl).add(unicodeZp);
}
else if(ucmp(name, "C") == 0 || ucmp(name, "Other") == 0)
{
s.add(unicodeCo).add(unicodeLo).add(unicodeNo)
.add(unicodeSo).add(unicodePo);
}
else if(ucmp(name, "any") == 0)
s.add(Interval(0,0x10FFFF));
else if(ucmp(name, "ascii") == 0)
s.add(Interval(0,0x7f));
else
{
auto range = assumeSorted!((x,y) => ucmp(x.name, y.name) < 0)(unicodeProperties);
//creating empty Codepointset is a workaround
auto eq = range.lowerBound(UnicodeProperty(cast(string)name,CodepointSet.init)).length;
enforce(eq != range.length && ucmp(name,range[eq].name) == 0,
"invalid property name");
s = range[eq].set.dup;
}
if(casefold)
s = caseEnclose(s);
if(negated)
s.negate();
return cast(const CodepointSet)s;
}
//basic stack, just in case it gets used anywhere else then Parser
@trusted struct Stack(T)
{
T[] data;
@property bool empty(){ return data.empty; }
@property size_t length(){ return data.length; }
void push(T val){ data ~= val; }
T pop()
{
assert(!empty);
auto val = data[$ - 1];
data = data[0 .. $ - 1];
if(!__ctfe)
data.assumeSafeAppend();
return val;
}
@property ref T top()
{
assert(!empty);
return data[$ - 1];
}
}
//safety limits
enum maxGroupNumber = 2^^19;
enum maxLookaroundDepth = 16;
// *Bytecode.sizeof, i.e. 1Mb of bytecode alone
enum maxCompiledLength = 2^^18;
//amounts to up to 4 Mb of auxilary table for matching
enum maxCumulativeRepetitionLength = 2^^20;
alias BasicElementOf(Range) = Unqual!(ElementEncodingType!Range);
struct Parser(R)
if (isForwardRange!R && is(ElementType!R : dchar))
{
enum infinite = ~0u;
dchar _current;
bool empty;
R pat, origin; //keep full pattern for pretty printing error messages
Bytecode[] ir; //resulting bytecode
uint re_flags = 0; //global flags e.g. multiline + internal ones
Stack!(uint) fixupStack; //stack of opened start instructions
NamedGroup[] dict; //maps name -> user group number
//current num of group, group nesting level and repetitions step
Stack!(uint) groupStack;
uint nesting = 0;
uint lookaroundNest = 0;
uint counterDepth = 0; //current depth of nested counted repetitions
const(CodepointSet)[] charsets; //
const(Trie)[] tries; //
uint[] backrefed; //bitarray for groups
@trusted this(S)(R pattern, S flags)
if(isSomeString!S)
{
pat = origin = pattern;
//reserve slightly more then avg as sampled from unittests
if(!__ctfe)
ir.reserve((pat.length*5+2)/4);
parseFlags(flags);
_current = ' ';//a safe default for freeform parsing
next();
try
{
parseRegex();
}
catch(Exception e)
{
error(e.msg);//also adds pattern location
}
put(Bytecode(IR.End, 0));
}
//mark referenced groups for latter processing
void markBackref(uint n)
{
if(n/32 >= backrefed.length)
backrefed.length = n/32 + 1;
backrefed[n / 32] |= 1 << (n & 31);
}
@property dchar current(){ return _current; }
bool _next()
{
if(pat.empty)
{
empty = true;
return false;
}
_current = pat.front;
pat.popFront();
return true;
}
void skipSpace()
{
while(isWhite(current) && _next()){ }
}
bool next()
{
if(re_flags & RegexOption.freeform)
{
bool r = _next();
skipSpace();
return r;
}
else
return _next();
}
void put(Bytecode code)
{
enforce(ir.length < maxCompiledLength,
"maximum compiled pattern length is exceeded");
ir ~= code;
}
void putRaw(uint number)
{
enforce(ir.length < maxCompiledLength,
"maximum compiled pattern length is exceeded");
ir ~= Bytecode.fromRaw(number);
}
//parsing number with basic overflow check
uint parseDecimal()
{
uint r = 0;
while(std.ascii.isDigit(current))
{
if(r >= (uint.max/10))
error("Overflow in decimal number");
r = 10*r + cast(uint)(current-'0');
if(!next())
break;
}
return r;
}
//parse control code of form \cXXX, c assumed to be the current symbol
dchar parseControlCode()
{
enforce(next(), "Unfinished escape sequence");
enforce(('a' <= current && current <= 'z') || ('A' <= current && current <= 'Z'),
"Only letters are allowed after \\c");
return current & 0x1f;
}
//
@trusted void parseFlags(S)(S flags)
{//@@@BUG@@@ text is @system
foreach(ch; flags)//flags are ASCII anyway
{
L_FlagSwitch:
switch(ch)
{
foreach(i, op; __traits(allMembers, RegexOption))
{
case RegexOptionNames[i]:
if(re_flags & mixin("RegexOption."~op))
throw new RegexException(text("redundant flag specified: ",ch));
re_flags |= mixin("RegexOption."~op);
break L_FlagSwitch;
}
default:
throw new RegexException(text("unknown regex flag '",ch,"'"));
}
}
}
//parse and store IR for regex pattern
@trusted void parseRegex()
{
fixupStack.push(0);
groupStack.push(1);//0 - whole match
auto maxCounterDepth = counterDepth;
uint fix;//fixup pointer
while(!empty)
{
debug(std_regex_parser)
writeln("*LR*\nSource: ", pat, "\nStack: ",fixupStack.stack.data);
switch(current)
{
case '(':
next();
nesting++;
uint nglob;
fixupStack.push(cast(uint)ir.length);
if(current == '?')
{
next();
switch(current)
{
case ':':
put(Bytecode(IR.Nop, 0));
next();
break;
case '=':
genLookaround(IR.LookaheadStart);
next();
break;
case '!':
genLookaround(IR.NeglookaheadStart);
next();
break;
case 'P':
next();
if(current != '<')
error("Expected '<' in named group");
string name;
if(!next() || !(isAlpha(current) || current == '_'))
error("Expected alpha starting a named group");
name ~= current;
while(next() && (isAlpha(current) ||
current == '_' || std.ascii.isDigit(current)))
{
name ~= current;
}
if(current != '>')
error("Expected '>' closing named group");
next();
nglob = groupStack.top++;
enforce(groupStack.top <= maxGroupNumber, "limit on submatches is exceeded");
auto t = NamedGroup(name, nglob);
auto d = assumeSorted!"a.name < b.name"(dict);
auto ind = d.lowerBound(t).length;
insertInPlaceAlt(dict, ind, t);
put(Bytecode(IR.GroupStart, nglob));
break;
case '<':
next();
if(current == '=')
genLookaround(IR.LookbehindStart);
else if(current == '!')
genLookaround(IR.NeglookbehindStart);
else
error("'!' or '=' expected after '<'");
next();
break;
default:
error(" ':', '=', '<', 'P' or '!' expected after '(?' ");
}
}
else
{
nglob = groupStack.top++;
enforce(groupStack.top <= maxGroupNumber, "limit on number of submatches is exceeded");
put(Bytecode(IR.GroupStart, nglob));
}
break;
case ')':
enforce(nesting, "Unmatched ')'");
nesting--;
next();
fix = fixupStack.pop();
switch(ir[fix].code)
{
case IR.GroupStart:
put(Bytecode(IR.GroupEnd,ir[fix].data));
parseQuantifier(fix);
break;
case IR.LookaheadStart, IR.NeglookaheadStart, IR.LookbehindStart, IR.NeglookbehindStart:
assert(lookaroundNest);
fixLookaround(fix);
lookaroundNest--;
break;
case IR.Option: //| xxx )
//two fixups: last option + full OR
finishAlternation(fix);
fix = fixupStack.top;
switch(ir[fix].code)
{
case IR.GroupStart:
fixupStack.pop();
put(Bytecode(IR.GroupEnd,ir[fix].data));
parseQuantifier(fix);
break;
case IR.LookaheadStart, IR.NeglookaheadStart, IR.LookbehindStart, IR.NeglookbehindStart:
assert(lookaroundNest);
lookaroundNest--;
fix = fixupStack.pop();
fixLookaround(fix);
break;
default://(?:xxx)
fixupStack.pop();
parseQuantifier(fix);
}
break;
default://(?:xxx)
parseQuantifier(fix);
}
break;
case '|':
next();
fix = fixupStack.top;
if(ir.length > fix && ir[fix].code == IR.Option)
{
ir[fix] = Bytecode(ir[fix].code, cast(uint)ir.length - fix);
put(Bytecode(IR.GotoEndOr, 0));
fixupStack.top = cast(uint)ir.length; //replace latest fixup for Option
put(Bytecode(IR.Option, 0));
break;
}
uint len, orStart;
//start a new option
if(fixupStack.length == 1)
{//only root entry, effectively no fixup
len = cast(uint)ir.length + IRL!(IR.GotoEndOr);
orStart = 0;
}
else
{//IR.lookahead, etc. fixups that have length > 1, thus check ir[x].length
len = cast(uint)ir.length - fix - (ir[fix].length - 1);
orStart = fix + ir[fix].length;
}
insertInPlaceAlt(ir, orStart, Bytecode(IR.OrStart, 0), Bytecode(IR.Option, len));
assert(ir[orStart].code == IR.OrStart);
put(Bytecode(IR.GotoEndOr, 0));
fixupStack.push(orStart); //fixup for StartOR
fixupStack.push(cast(uint)ir.length); //for second Option
put(Bytecode(IR.Option, 0));
break;
default://no groups or whatever
uint start = cast(uint)ir.length;
parseAtom();
parseQuantifier(start);
}
}
if(fixupStack.length != 1)
{
fix = fixupStack.pop();
enforce(ir[fix].code == IR.Option, "no matching ')'");
finishAlternation(fix);
enforce(fixupStack.length == 1, "no matching ')'");
}
}
//helper function, finalizes IR.Option, fix points to the first option of sequence
void finishAlternation(uint fix)
{
enforce(ir[fix].code == IR.Option, "no matching ')'");
ir[fix] = Bytecode(ir[fix].code, cast(uint)ir.length - fix - IRL!(IR.OrStart));
fix = fixupStack.pop();
enforce(ir[fix].code == IR.OrStart, "no matching ')'");
ir[fix] = Bytecode(IR.OrStart, cast(uint)ir.length - fix - IRL!(IR.OrStart));
put(Bytecode(IR.OrEnd, cast(uint)ir.length - fix - IRL!(IR.OrStart)));
uint pc = fix + IRL!(IR.OrStart);
while(ir[pc].code == IR.Option)
{
pc = pc + ir[pc].data;
if(ir[pc].code != IR.GotoEndOr)
break;
ir[pc] = Bytecode(IR.GotoEndOr, cast(uint)(ir.length - pc - IRL!(IR.OrEnd)));
pc += IRL!(IR.GotoEndOr);
}
put(Bytecode.fromRaw(0));
}
//parse and store IR for atom-quantifier pair
@trusted void parseQuantifier(uint offset)
{//copy is @system
uint replace = ir[offset].code == IR.Nop;
if(empty && !replace)
return;
uint min, max;
switch(current)
{
case '*':
min = 0;
max = infinite;
break;
case '?':
min = 0;
max = 1;
break;
case '+':
min = 1;
max = infinite;
break;
case '{':
enforce(next(), "Unexpected end of regex pattern");
enforce(std.ascii.isDigit(current), "First number required in repetition");
min = parseDecimal();
if(current == '}')
max = min;
else if(current == ',')
{
next();
if(std.ascii.isDigit(current))
max = parseDecimal();
else if(current == '}')
max = infinite;
else
error("Unexpected symbol in regex pattern");
skipSpace();
if(current != '}')
error("Unmatched '{' in regex pattern");
}
else
error("Unexpected symbol in regex pattern");
if(min > max)
error("Illegal {n,m} quantifier");
break;
default:
if(replace)
{
copyForwardAlt(ir[offset + 1 .. $],ir[offset .. $ - 1]);
ir.length -= 1;
}
return;
}
uint len = cast(uint)ir.length - offset - replace;
bool greedy = true;
//check only if we managed to get new symbol
if(next() && current == '?')
{
greedy = false;
next();
}
if(max != infinite)
{
if(min != 1 || max != 1)
{
Bytecode op = Bytecode(greedy ? IR.RepeatStart : IR.RepeatQStart, len);
if(replace)
ir[offset] = op;
else
insertInPlaceAlt(ir, offset, op);
put(Bytecode(greedy ? IR.RepeatEnd : IR.RepeatQEnd, len));
put(Bytecode.init); //hotspot
putRaw(1);
putRaw(min);
putRaw(max);
counterDepth = std.algorithm.max(counterDepth, nesting+1);
}
}
else if(min) //&& max is infinite
{
if(min != 1)
{
Bytecode op = Bytecode(greedy ? IR.RepeatStart : IR.RepeatQStart, len);
if(replace)
ir[offset] = op;
else
insertInPlaceAlt(ir, offset, op);
offset += 1;//so it still points to the repeated block
put(Bytecode(greedy ? IR.RepeatEnd : IR.RepeatQEnd, len));
put(Bytecode.init); //hotspot
putRaw(1);
putRaw(min);
putRaw(min);
counterDepth = std.algorithm.max(counterDepth, nesting+1);
}
else if(replace)
{
copyForwardAlt(ir[offset+1 .. $],ir[offset .. $-1]);
ir.length -= 1;
}
put(Bytecode(greedy ? IR.InfiniteStart : IR.InfiniteQStart, len));
enforce(ir.length + len < maxCompiledLength, "maximum compiled pattern length is exceeded");
ir ~= ir[offset .. offset+len];
//IR.InfinteX is always a hotspot
put(Bytecode(greedy ? IR.InfiniteEnd : IR.InfiniteQEnd, len));
put(Bytecode.init); //merge index
}
else//vanila {0,inf}
{
Bytecode op = Bytecode(greedy ? IR.InfiniteStart : IR.InfiniteQStart, len);
if(replace)
ir[offset] = op;
else
insertInPlaceAlt(ir, offset, op);
//IR.InfinteX is always a hotspot
put(Bytecode(greedy ? IR.InfiniteEnd : IR.InfiniteQEnd, len));
put(Bytecode.init); //merge index
}
}
//parse and store IR for atom
void parseAtom()
{
if(empty)
return;
switch(current)
{
case '*', '?', '+', '|', '{', '}':
error("'*', '+', '?', '{', '}' not allowed in atom");
break;
case '.':
put(Bytecode(IR.Any, 0));
next();
break;
case '[':
parseCharset();
break;
case '\\':
enforce(_next(), "Unfinished escape sequence");
parseEscape();
break;
case '^':
put(Bytecode(IR.Bol, 0));
next();
break;
case '$':
put(Bytecode(IR.Eol, 0));
next();
break;
default:
if(re_flags & RegexOption.casefold)
{
dchar[5] data;
auto range = getCommonCasing(current, data);
assert(range.length <= 5);
if(range.length == 1)
put(Bytecode(IR.Char, range[0]));
else
foreach(v; range)
put(Bytecode(IR.OrChar, v, cast(uint)range.length));
}
else
put(Bytecode(IR.Char, current));
next();
}
}
//generate code for start of lookaround: (?= (?! (?<= (?<!
void genLookaround(IR opcode)
{
put(Bytecode(opcode, 0));
put(Bytecode.fromRaw(0));
put(Bytecode.fromRaw(0));
groupStack.push(0);
lookaroundNest++;
enforce(lookaroundNest <= maxLookaroundDepth,
"maximum lookaround depth is exceeded");
}
//fixup lookaround with start at offset fix and append a proper *-End opcode
void fixLookaround(uint fix)
{
ir[fix] = Bytecode(ir[fix].code,
cast(uint)ir.length - fix - IRL!(IR.LookaheadStart));
auto g = groupStack.pop();
assert(!groupStack.empty);
ir[fix+1] = Bytecode.fromRaw(groupStack.top);
//groups are cumulative across lookarounds
ir[fix+2] = Bytecode.fromRaw(groupStack.top+g);
groupStack.top += g;
if(ir[fix].code == IR.LookbehindStart || ir[fix].code == IR.NeglookbehindStart)
{
reverseBytecode(ir[fix + IRL!(IR.LookbehindStart) .. $]);
}
put(ir[fix].paired);
}
//CodepointSet operations relatively in order of priority
enum Operator:uint {
Open = 0, Negate, Difference, SymDifference, Intersection, Union, None
}
//parse unit of CodepointSet spec, most notably escape sequences and char ranges
//also fetches next set operation
Tuple!(CodepointSet,Operator) parseCharTerm()
{
enum State{ Start, Char, Escape, CharDash, CharDashEscape,
PotentialTwinSymbolOperator }
Operator op = Operator.None;
dchar last;
CodepointSet set;
State state = State.Start;
static void addWithFlags(ref CodepointSet set, uint ch, uint re_flags)
{
if(re_flags & RegexOption.casefold)
{
dchar[5] chars;
auto range = getCommonCasing(ch, chars);
foreach(v; range)
set.add(v);
}
else
set.add(ch);
}
static Operator twinSymbolOperator(dchar symbol)
{
switch(symbol)
{
case '|':
return Operator.Union;
case '-':
return Operator.Difference;
case '~':
return Operator.SymDifference;
case '&':
return Operator.Intersection;
default:
assert(false);
}
}
L_CharTermLoop:
for(;;)
{
final switch(state)
{
case State.Start:
switch(current)
{
case '|':
case '-':
case '~':
case '&':
state = State.PotentialTwinSymbolOperator;
last = current;
break;
case '[':
op = Operator.Union;
goto case;
case ']':
break L_CharTermLoop;
case '\\':
state = State.Escape;
break;
default:
state = State.Char;
last = current;
}
break;
case State.Char:
// xxx last current xxx
switch(current)
{
case '|':
case '~':
case '&':
// then last is treated as normal char and added as implicit union
state = State.PotentialTwinSymbolOperator;
addWithFlags(set, last, re_flags);
last = current;
break;
case '-': // still need more info
state = State.CharDash;
break;
case '\\':
set.add(last);
state = State.Escape;
break;
case '[':
op = Operator.Union;
goto case;
case ']':
set.add(last);
break L_CharTermLoop;
default:
addWithFlags(set, last, re_flags);
last = current;
}
break;
case State.PotentialTwinSymbolOperator:
// xxx last current xxxx
// where last = [|-&~]
if(current == last)
{
op = twinSymbolOperator(last);
next();//skip second twin char
break L_CharTermLoop;
}
goto case State.Char;// it's not a twin lets re-run normal logic
case State.Escape:
// xxx \ current xxx
switch(current)
{
case 'f':
last = '\f';
state = State.Char;
break;
case 'n':
last = '\n';
state = State.Char;
break;
case 'r':
last = '\r';
state = State.Char;
break;
case 't':
last = '\t';
state = State.Char;
break;
case 'v':
last = '\v';
state = State.Char;
break;
case 'c':
last = parseControlCode();
state = State.Char;
break;
foreach(val; Escapables)
{
case val:
}
last = current;
state = State.Char;
break;
case 'p':
set.add(parseUnicodePropertySpec(false));
state = State.Start;
continue L_CharTermLoop; //next char already fetched
case 'P':
set.add(parseUnicodePropertySpec(true));
state = State.Start;
continue L_CharTermLoop; //next char already fetched
case 'x':
last = parseUniHex(pat, 2);
state = State.Char;
break;
case 'u':
last = parseUniHex(pat, 4);
state = State.Char;
break;
case 'U':
last = parseUniHex(pat, 8);
state = State.Char;
break;
case 'd':
set.add(unicodeNd);
state = State.Start;
break;
case 'D':
set.add(unicodeNd.dup.negate());
state = State.Start;
break;
case 's':
set.add(unicodeWhite_Space);
state = State.Start;
break;
case 'S':
set.add(unicodeWhite_Space.dup.negate());
state = State.Start;
break;
case 'w':
set.add(wordCharacter);
state = State.Start;
break;
case 'W':
set.add(wordCharacter.dup.negate());
state = State.Start;
break;
default:
enforce(false, "invalid escape sequence");
}
break;
case State.CharDash:
// xxx last - current xxx
switch(current)
{
case '[':
op = Operator.Union;
goto case;
case ']':
//means dash is a single char not an interval specifier
addWithFlags(set, last, re_flags);
addWithFlags(set, '-', re_flags);
break L_CharTermLoop;
case '-'://set Difference again
addWithFlags(set, last, re_flags);
op = Operator.Difference;
next();//skip '-'
break L_CharTermLoop;
case '\\':
state = State.CharDashEscape;
break;
default:
enforce(last <= current, "inverted range");
if(re_flags & RegexOption.casefold)
{
for(uint ch = last; ch <= current; ch++)
addWithFlags(set, ch, re_flags);
}
else
set.add(Interval(last, current));
state = State.Start;
}
break;
case State.CharDashEscape:
//xxx last - \ current xxx
uint end;
switch(current)
{
case 'f':
end = '\f';
break;
case 'n':
end = '\n';
break;
case 'r':
end = '\r';
break;
case 't':
end = '\t';
break;
case 'v':
end = '\v';
break;
foreach(val; Escapables)
{
case val:
}
end = current;
break;
case 'c':
end = parseControlCode();
break;
case 'x':
end = parseUniHex(pat, 2);
break;
case 'u':
end = parseUniHex(pat, 4);
break;
case 'U':
end = parseUniHex(pat, 8);
break;
default:
error("invalid escape sequence");
}
enforce(last <= end,"inverted range");
set.add(Interval(last,end));
state = State.Start;
break;
}
enforce(next(), "unexpected end of CodepointSet");
}
return tuple(set, op);
}
alias ValStack = Stack!(CodepointSet);
alias OpStack = Stack!(Operator);
//parse and store IR for CodepointSet
void parseCharset()
{
ValStack vstack;
OpStack opstack;
//
static bool apply(Operator op, ref ValStack stack)
{
switch(op)
{
case Operator.Negate:
stack.top.negate();
break;
case Operator.Union:
auto s = stack.pop();//2nd operand
enforce(!stack.empty, "no operand for '||'");
stack.top.add(s);
break;
case Operator.Difference:
auto s = stack.pop();//2nd operand
enforce(!stack.empty, "no operand for '--'");
stack.top.sub(s);
break;
case Operator.SymDifference:
auto s = stack.pop();//2nd operand
enforce(!stack.empty, "no operand for '~~'");
stack.top.symmetricSub(s);
break;
case Operator.Intersection:
auto s = stack.pop();//2nd operand
enforce(!stack.empty, "no operand for '&&'");
stack.top.intersect(s);
break;
default:
return false;
}
return true;
}
static bool unrollWhile(alias cond)(ref ValStack vstack, ref OpStack opstack)
{
while(cond(opstack.top))
{
if(!apply(opstack.pop(),vstack))
return false;//syntax error
if(opstack.empty)
return false;
}
return true;
}
L_CharsetLoop:
do
{
switch(current)
{
case '[':
opstack.push(Operator.Open);
enforce(next(), "unexpected end of character class");
if(current == '^')
{
opstack.push(Operator.Negate);
enforce(next(), "unexpected end of character class");
}
//[] is prohibited
enforce(current != ']', "wrong character class");
goto default;
case ']':
enforce(unrollWhile!(unaryFun!"a != a.Open")(vstack, opstack),
"character class syntax error");
enforce(!opstack.empty, "unmatched ']'");
opstack.pop();
next();
if(opstack.empty)
break L_CharsetLoop;
auto pair = parseCharTerm();
if(!pair[0].empty)//not only operator e.g. -- or ~~
{
vstack.top.add(pair[0]);//apply union
}
if(pair[1] != Operator.None)
{
if(opstack.top == Operator.Union)
unrollWhile!(unaryFun!"a == a.Union")(vstack, opstack);
opstack.push(pair[1]);
}
break;
//
default://yet another pair of term(op)?
auto pair = parseCharTerm();
if(pair[1] != Operator.None)
{
if(opstack.top == Operator.Union)
unrollWhile!(unaryFun!"a == a.Union")(vstack, opstack);
opstack.push(pair[1]);
}
vstack.push(pair[0]);
}
}while(!empty || !opstack.empty);
while(!opstack.empty)
apply(opstack.pop(),vstack);
assert(vstack.length == 1);
charsetToIr(vstack.top);
}
//try to generate optimal IR code for this CodepointSet
@trusted void charsetToIr(in CodepointSet set)
{//@@@BUG@@@ writeln is @system
uint chars = set.chars;
if(chars < Bytecode.maxSequence)
{
switch(chars)
{
case 1:
put(Bytecode(IR.Char, set.ivals[0]));
break;
case 0:
error("empty CodepointSet not allowed");
break;
default:
foreach(ch; set[])
put(Bytecode(IR.OrChar, ch, chars));
}
}
else
{
if(set.ivals.length > maxCharsetUsed)
{
auto t = getTrie(set);
put(Bytecode(IR.Trie, cast(uint)tries.length));
tries ~= t;
debug(std_regex_allocation) writeln("Trie generated");
}
else
{
put(Bytecode(IR.CodepointSet, cast(uint)charsets.length));
tries ~= Trie.init;
}
charsets ~= set;
assert(charsets.length == tries.length);
}
}
//parse and generate IR for escape stand alone escape sequence
@trusted void parseEscape()
{//accesses array of appender
switch(current)
{
case 'f': next(); put(Bytecode(IR.Char, '\f')); break;
case 'n': next(); put(Bytecode(IR.Char, '\n')); break;
case 'r': next(); put(Bytecode(IR.Char, '\r')); break;
case 't': next(); put(Bytecode(IR.Char, '\t')); break;
case 'v': next(); put(Bytecode(IR.Char, '\v')); break;
case 'd':
next();
charsetToIr(unicodeNd);
break;
case 'D':
next();
charsetToIr(unicodeNd.dup.negate());
break;
case 'b': next(); put(Bytecode(IR.Wordboundary, 0)); break;
case 'B': next(); put(Bytecode(IR.Notwordboundary, 0)); break;
case 's':
next();
charsetToIr(unicodeWhite_Space);
break;
case 'S':
next();
charsetToIr(unicodeWhite_Space.dup.negate());
break;
case 'w':
next();
charsetToIr(wordCharacter);
break;
case 'W':
next();
charsetToIr(wordCharacter.dup.negate());
break;
case 'p': case 'P':
auto CodepointSet = parseUnicodePropertySpec(current == 'P');
charsetToIr(CodepointSet);
break;
case 'x':
uint code = parseUniHex(pat, 2);
next();
put(Bytecode(IR.Char,code));
break;
case 'u': case 'U':
uint code = parseUniHex(pat, current == 'u' ? 4 : 8);
next();
put(Bytecode(IR.Char, code));
break;
case 'c': //control codes
Bytecode code = Bytecode(IR.Char, parseControlCode());
next();
put(code);
break;
case '0':
next();
put(Bytecode(IR.Char, 0));//NUL character
break;
case '1': .. case '9':
uint nref = cast(uint)current - '0';
uint maxBackref;
foreach(v; groupStack.data)
maxBackref += v;
uint localLimit = maxBackref - groupStack.top;
enforce(nref < maxBackref, "Backref to unseen group");
//perl's disambiguation rule i.e.
//get next digit only if there is such group number
while(nref < maxBackref && next() && std.ascii.isDigit(current))
{
nref = nref * 10 + current - '0';
}
if(nref >= maxBackref)
nref /= 10;
if(nref >= localLimit)
{
put(Bytecode(IR.Backref, nref-localLimit));
ir[$-1].setLocalRef();
}
else
put(Bytecode(IR.Backref, nref));
markBackref(nref);
break;
default:
auto op = Bytecode(IR.Char, current);
next();
put(op);
}
}
//parse and return a CodepointSet for \p{...Property...} and \P{...Property..},
//\ - assumed to be processed, p - is current
const(CodepointSet) parseUnicodePropertySpec(bool negated)
{
alias ucmp = comparePropertyName;
enum MAX_PROPERTY = 128;
char[MAX_PROPERTY] result;
uint k = 0;
enforce(next());
if(current == '{')
{
while(k < MAX_PROPERTY && next() && current !='}' && current !=':')
if(current != '-' && current != ' ' && current != '_')
result[k++] = cast(char)std.ascii.toLower(current);
enforce(k != MAX_PROPERTY, "invalid property name");
enforce(current == '}', "} expected ");
}
else
{//single char properties e.g.: \pL, \pN ...
enforce(current < 0x80, "invalid property name");
result[k++] = cast(char)current;
}
auto s = getUnicodeSet(result[0..k], negated,
cast(bool)(re_flags & RegexOption.casefold));
enforce(!s.empty, "unrecognized unicode property spec");
next();
return s;
}
//
@trusted void error(string msg)
{
auto app = appender!string();
ir = null;
formattedWrite(app, "%s\nPattern with error: `%s` <--HERE-- `%s`",
msg, origin[0..$-pat.length], pat);
throw new RegexException(app.data);
}
alias Char = BasicElementOf!R;
//packages parsing results into a RegEx object
@property Regex!Char program()
{
return Regex!Char(this);
}
}
/++
$(D Regex) object holds regular expression pattern in compiled form.
Instances of this object are constructed via calls to $(D regex).
This is an intended form for caching and storage of frequently
used regular expressions.
+/
public struct Regex(Char)
{
//temporary workaround for identifier lookup
const(CodepointSet)[] charsets; //
Bytecode[] ir; //compiled bytecode of pattern
/++
Test if this object doesn't contain any compiled pattern.
Example:
---
Regex!char r;
assert(r.empty);
r = regex(""); // Note: "" is a valid regex pattern.
assert(!r.empty);
---
+/
@safe @property bool empty() const nothrow { return ir is null; }
/++
A range of all the named captures in the regex.
Example:
----
import std.range;
import std.algorithm;
auto re = regex(`(?P<name>\w+) = (?P<var>\d+)`);
auto nc = re.namedCaptures;
static assert(isRandomAccessRange!(typeof(nc)));
assert(!nc.empty);
assert(nc.length == 2);
assert(nc.equal(["name", "var"]));
assert(nc[0] == "name");
assert(nc[1..$].equal(["var"]));
----
+/
@safe @property auto namedCaptures()
{
static struct NamedGroupRange
{
private:
NamedGroup[] groups;
size_t start;
size_t end;
public:
this(NamedGroup[] g, size_t s, size_t e)
{
assert(s <= e);
assert(e <= g.length);
groups = g;
start = s;
end = e;
}
@property string front() { return groups[start].name; }
@property string back() { return groups[end-1].name; }
@property bool empty() { return start >= end; }
@property size_t length() { return end - start; }
alias opDollar = length;
@property NamedGroupRange save()
{
return NamedGroupRange(groups, start, end);
}
void popFront() { assert(!empty); start++; }
void popBack() { assert(!empty); end--; }
string opIndex()(size_t i)
{
assert(start + i < end,
"Requested named group is out of range.");
return groups[start+i].name;
}
NamedGroupRange opSlice(size_t low, size_t high) {
assert(low <= high);
assert(start + high <= end);
return NamedGroupRange(groups, start + low, start + high);
}
NamedGroupRange opSlice() { return this.save; }
}
return NamedGroupRange(dict, 0, dict.length);
}
private:
NamedGroup[] dict; //maps name -> user group number
uint ngroup; //number of internal groups
uint maxCounterDepth; //max depth of nested {n,m} repetitions
uint hotspotTableSize; //number of entries in merge table
uint threadCount;
uint flags; //global regex flags
const(Trie)[] tries; //
uint[] backrefed; //bit array of backreferenced submatches
Kickstart!Char kickstart;
//bit access helper
uint isBackref(uint n)
{
if(n/32 >= backrefed.length)
return 0;
return backrefed[n / 32] & (1 << (n & 31));
}
//check if searching is not needed
void checkIfOneShot()
{
if(flags & RegexOption.multiline)
return;
L_CheckLoop:
for(uint i = 0; i < ir.length; i += ir[i].length)
{
switch(ir[i].code)
{
case IR.Bol:
flags |= RegexInfo.oneShot;
break L_CheckLoop;
case IR.GroupStart, IR.GroupEnd, IR.Eol, IR.Wordboundary, IR.Notwordboundary:
break;
default:
break L_CheckLoop;
}
}
}
/+
lightweight post process step,
only essentials
+/
@trusted void lightPostprocess()
{//@@@BUG@@@ write is @system
struct FixedStack(T)
{
T[] arr;
uint _top;
//this(T[] storage){ arr = storage; _top = -1; }
@property ref T top(){ assert(!empty); return arr[_top]; }
void push(T x){ arr[++_top] = x; }
T pop() { assert(!empty); return arr[_top--]; }
@property bool empty(){ return _top == -1; }
}
auto counterRange = FixedStack!uint(new uint[maxCounterDepth+1], -1);
counterRange.push(1);
ulong cumRange = 0;
for(uint i = 0; i < ir.length; i += ir[i].length)
{
if(ir[i].hotspot)
{
assert(i + 1 < ir.length,
"unexpected end of IR while looking for hotspot");
ir[i+1] = Bytecode.fromRaw(hotspotTableSize);
hotspotTableSize += counterRange.top;
}
switch(ir[i].code)
{
case IR.RepeatStart, IR.RepeatQStart:
uint repEnd = cast(uint)(i + ir[i].data + IRL!(IR.RepeatStart));
assert(ir[repEnd].code == ir[i].paired.code);
uint max = ir[repEnd + 4].raw;
ir[repEnd+2].raw = counterRange.top;
ir[repEnd+3].raw *= counterRange.top;
ir[repEnd+4].raw *= counterRange.top;
ulong cntRange = cast(ulong)(max)*counterRange.top;
cumRange += cntRange;
enforce(cumRange < maxCumulativeRepetitionLength,
"repetition length limit is exceeded");
counterRange.push(cast(uint)cntRange + counterRange.top);
threadCount += counterRange.top;
break;
case IR.RepeatEnd, IR.RepeatQEnd:
threadCount += counterRange.top;
counterRange.pop();
break;
case IR.GroupStart:
if(isBackref(ir[i].data))
ir[i].setBackrefence();
threadCount += counterRange.top;
break;
case IR.GroupEnd:
if(isBackref(ir[i].data))
ir[i].setBackrefence();
threadCount += counterRange.top;
break;
default:
threadCount += counterRange.top;
}
}
checkIfOneShot();
if(!(flags & RegexInfo.oneShot))
kickstart = Kickstart!Char(this, new uint[](256));
debug(std_regex_allocation) writefln("IR processed, max threads: %d", threadCount);
}
//IR code validator - proper nesting, illegal instructions, etc.
@trusted void validate()
{//@@@BUG@@@ text is @system
for(uint pc = 0; pc < ir.length; pc += ir[pc].length)
{
if(ir[pc].isStart || ir[pc].isEnd)
{
uint dest = ir[pc].indexOfPair(pc);
assert(dest < ir.length, text("Wrong length in opcode at pc=",
pc, " ", dest, " vs ", ir.length));
assert(ir[dest].paired == ir[pc],
text("Wrong pairing of opcodes at pc=", pc, "and pc=", dest));
}
else if(ir[pc].isAtom)
{
}
else
assert(0, text("Unknown type of instruction at pc=", pc));
}
}
//print out disassembly a program's IR
@trusted debug(std_regex_parser) void print() const
{//@@@BUG@@@ write is system
for(uint i = 0; i < ir.length; i += ir[i].length)
{
writefln("%d\t%s ", i, disassemble(ir, i, dict));
}
writeln("Total merge table size: ", hotspotTableSize);
writeln("Max counter nesting depth: ", maxCounterDepth);
}
//
this(S)(Parser!(S) p)
{
ir = p.ir;
dict = p.dict;
ngroup = p.groupStack.top;
maxCounterDepth = p.counterDepth;
flags = p.re_flags;
charsets = p.charsets;
tries = p.tries;
backrefed = p.backrefed;
lightPostprocess();
debug(std_regex_parser)
{
print();
}
version(assert) validate();
}
}
unittest
{
auto re = regex(`(?P<name>\w+) = (?P<var>\d+)`);
auto nc = re.namedCaptures;
static assert(isRandomAccessRange!(typeof(nc)));
assert(!nc.empty);
assert(nc.length == 2);
assert(nc.equal(["name", "var"]));
assert(nc[0] == "name");
assert(nc[1..$].equal(["var"]));
re = regex(`(\w+) (?P<named>\w+) (\w+)`);
nc = re.namedCaptures;
assert(nc.length == 1);
assert(nc[0] == "named");
assert(nc.front == "named");
assert(nc.back == "named");
re = regex(`(\w+) (\w+)`);
nc = re.namedCaptures;
assert(nc.empty);
re = regex(`(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/`);
nc = re.namedCaptures;
auto cp = nc.save;
assert(nc.equal(cp));
nc.popFront();
assert(nc.equal(cp[1..$]));
nc.popBack();
assert(nc.equal(cp[1 .. $ - 1]));
}
//
@trusted uint lookupNamedGroup(String)(NamedGroup[] dict, String name)
{//equal is @system?
auto fnd = assumeSorted!"cmp(a,b) < 0"(map!"a.name"(dict)).lowerBound(name).length;
enforce(equal(dict[fnd].name, name), text("no submatch named ", name));
return dict[fnd].group;
}
//whether ch is one of unicode newline sequences
//0-arg template due to @@@BUG@@@ 10985
bool endOfLine()(dchar front, bool seenCr)
{
return ((front == '\n') ^ seenCr) || front == '\r'
|| front == NEL || front == LS || front == PS;
}
//
//0-arg template due to @@@BUG@@@ 10985
bool startOfLine()(dchar back, bool seenNl)
{
return ((back == '\r') ^ seenNl) || back == '\n'
|| back == NEL || back == LS || back == PS;
}
//Test if bytecode starting at pc in program 're' can match given codepoint
//Returns: 0 - can't tell, -1 if doesn't match
int quickTestFwd(RegEx)(uint pc, dchar front, const ref RegEx re)
{
static assert(IRL!(IR.OrChar) == 1);//used in code processing IR.OrChar
for(;;)
switch(re.ir[pc].code)
{
case IR.OrChar:
uint len = re.ir[pc].sequence;
uint end = pc + len;
if(re.ir[pc].data != front && re.ir[pc+1].data != front)
{
for(pc = pc+2; pc < end; pc++)
if(re.ir[pc].data == front)
break;
if(pc == end)
return -1;
}
return 0;
case IR.Char:
if(front == re.ir[pc].data)
return 0;
else
return -1;
case IR.Any:
return 0;
case IR.CodepointSet:
if(re.charsets[re.ir[pc].data].scanFor(front))
return 0;
else
return -1;
case IR.GroupStart, IR.GroupEnd:
pc += IRL!(IR.GroupStart);
break;
case IR.Trie:
if(re.tries[re.ir[pc].data][front])
return 0;
else
return -1;
default:
return 0;
}
}
/*
Useful utility for self-testing, an infinite range of string samples
that _have_ to match given compiled regex.
Caveats: supports only a simple subset of bytecode.
*/
@trusted public struct SampleGenerator(Char)
{
import std.random;
const(Regex!Char) re;
Appender!(char[]) app;
uint limit, seed;
Xorshift gen;
//generator for pattern r, with soft maximum of threshold elements
//and a given random seed
this(in Regex!Char r, uint threshold, uint randomSeed)
{
re = r;
limit = threshold;
seed = randomSeed;
app = appender!(Char[])();
compose();
}
uint rand(uint x)
{
uint r = gen.front % x;
gen.popFront();
return r;
}
void compose()
{
uint pc = 0, counter = 0, dataLenOld = uint.max;
for(;;)
{
switch(re.ir[pc].code)
{
case IR.Char:
formattedWrite(app,"%s", cast(dchar)re.ir[pc].data);
pc += IRL!(IR.Char);
break;
case IR.OrChar:
uint len = re.ir[pc].sequence;
formattedWrite(app, "%s", cast(dchar)re.ir[pc + rand(len)].data);
pc += len;
break;
case IR.CodepointSet:
case IR.Trie:
auto set = re.charsets[re.ir[pc].data];
auto x = rand(set.ivals.length/2);
auto y = rand(set.ivals[x*2+1] - set.ivals[2*x]);
formattedWrite(app, "%s", cast(dchar)(set.ivals[2*x]+y));
pc += IRL!(IR.CodepointSet);
break;
case IR.Any:
uint x;
do
{
x = rand(0x11_000);
}while(x == '\r' || x == '\n' || !isValidDchar(x));
formattedWrite(app, "%s", cast(dchar)x);
pc += IRL!(IR.Any);
break;
case IR.GotoEndOr:
pc += IRL!(IR.GotoEndOr)+re.ir[pc].data;
assert(re.ir[pc].code == IR.OrEnd);
goto case;
case IR.OrEnd:
pc += IRL!(IR.OrEnd);
break;
case IR.OrStart:
pc += IRL!(IR.OrStart);
goto case;
case IR.Option:
uint next = pc + re.ir[pc].data + IRL!(IR.Option);
uint nOpt = 0;
//queue next Option
while(re.ir[next].code == IR.Option)
{
nOpt++;
next += re.ir[next].data + IRL!(IR.Option);
}
nOpt++;
nOpt = rand(nOpt);
for(;nOpt; nOpt--)
{
pc += re.ir[pc].data + IRL!(IR.Option);
}
assert(re.ir[pc].code == IR.Option);
pc += IRL!(IR.Option);
break;
case IR.RepeatStart:case IR.RepeatQStart:
pc += IRL!(IR.RepeatStart)+re.ir[pc].data;
goto case IR.RepeatEnd;
case IR.RepeatEnd:
case IR.RepeatQEnd:
uint len = re.ir[pc].data;
uint step = re.ir[pc+2].raw;
uint min = re.ir[pc+3].raw;
if(counter < min)
{
counter += step;
pc -= len;
break;
}
uint max = re.ir[pc+4].raw;
if(counter < max)
{
if(app.data.length < limit && rand(3) > 0)
{
pc -= len;
counter += step;
}
else
{
counter = counter%step;
pc += IRL!(IR.RepeatEnd);
}
}
else
{
counter = counter%step;
pc += IRL!(IR.RepeatEnd);
}
break;
case IR.InfiniteStart, IR.InfiniteQStart:
pc += re.ir[pc].data + IRL!(IR.InfiniteStart);
goto case IR.InfiniteEnd; //both Q and non-Q
case IR.InfiniteEnd:
case IR.InfiniteQEnd:
uint len = re.ir[pc].data;
if(app.data.length == dataLenOld)
{
pc += IRL!(IR.InfiniteEnd);
break;
}
dataLenOld = app.data.length;
if(app.data.length < limit && rand(3) > 0)
pc = pc - len;
else
pc = pc + IRL!(IR.InfiniteEnd);
break;
case IR.GroupStart, IR.GroupEnd:
pc += IRL!(IR.GroupStart);
break;
case IR.Bol, IR.Wordboundary, IR.Notwordboundary:
case IR.LookaheadStart, IR.NeglookaheadStart, IR.LookbehindStart, IR.NeglookbehindStart:
default:
return;
}
}
}
@property Char[] front()
{
return app.data;
}
@property empty(){ return false; }
void popFront()
{
app.shrinkTo(0);
compose();
}
}
/++
A $(D StaticRegex) is $(D Regex) object that contains specially
generated machine code to speed up matching.
Implicitly convertible to normal $(D Regex),
however doing so will result in losing this additional capability.
+/
public struct StaticRegex(Char)
{
private:
alias Matcher = BacktrackingMatcher!(true);
alias MatchFn = bool function(ref Matcher!Char) @trusted;
MatchFn nativeFn;
public:
Regex!Char _regex;
alias _regex this;
this(Regex!Char re, MatchFn fn)
{
_regex = re;
nativeFn = fn;
}
}
//utility for shiftOr, returns a minimum number of bytes to test in a Char
uint effectiveSize(Char)()
{
static if(is(Char == char))
return 1;
else static if(is(Char == wchar))
return 2;
else static if(is(Char == dchar))
return 3;
else
static assert(0);
}
/*
Kickstart engine using ShiftOr algorithm,
a bit parallel technique for inexact string searching.
*/
struct ShiftOr(Char)
{
private:
uint[] table;
uint fChar;
uint n_length;
enum charSize = effectiveSize!Char();
//maximum number of chars in CodepointSet to process
enum uint charsetThreshold = 32_000;
static struct ShiftThread
{
uint[] tab;
uint mask;
uint idx;
uint pc, counter, hops;
this(uint newPc, uint newCounter, uint[] table)
{
pc = newPc;
counter = newCounter;
mask = 1;
idx = 0;
hops = 0;
tab = table;
}
void setMask(uint idx, uint mask)
{
tab[idx] |= mask;
}
void setInvMask(uint idx, uint mask)
{
tab[idx] &= ~mask;
}
void set(alias setBits = setInvMask)(dchar ch)
{
static if(charSize == 3)
{
uint val = ch, tmask = mask;
setBits(val&0xFF, tmask);
tmask <<= 1;
val >>= 8;
setBits(val&0xFF, tmask);
tmask <<= 1;
val >>= 8;
assert(val <= 0x10);
setBits(val, tmask);
tmask <<= 1;
}
else
{
Char[dchar.sizeof/Char.sizeof] buf;
uint tmask = mask;
size_t total = encode(buf, ch);
for(size_t i = 0; i < total; i++, tmask<<=1)
{
static if(charSize == 1)
setBits(buf[i], tmask);
else static if(charSize == 2)
{
setBits(buf[i]&0xFF, tmask);
tmask <<= 1;
setBits(buf[i]>>8, tmask);
}
}
}
}
void add(dchar ch){ return set!setInvMask(ch); }
void advance(uint s)
{
mask <<= s;
idx += s;
}
@property bool full(){ return !mask; }
}
static ShiftThread fork(ShiftThread t, uint newPc, uint newCounter)
{
ShiftThread nt = t;
nt.pc = newPc;
nt.counter = newCounter;
return nt;
}
@trusted static ShiftThread fetch(ref ShiftThread[] worklist)
{
auto t = worklist[$-1];
worklist.length -= 1;
if(!__ctfe)
worklist.assumeSafeAppend();
return t;
}
static uint charLen(uint ch)
{
assert(ch <= 0x10FFFF);
return codeLength!Char(cast(dchar)ch)*charSize;
}
public:
@trusted this(const ref Regex!Char re, uint[] memory)
{
assert(memory.length == 256);
fChar = uint.max;
L_FindChar:
for(size_t i = 0;;)
{
switch(re.ir[i].code)
{
case IR.Char:
fChar = re.ir[i].data;
static if(charSize != 3)
{
Char[dchar.sizeof/Char.sizeof] buf;
encode(buf, fChar);
fChar = buf[0];
}
fChar = fChar & 0xFF;
break L_FindChar;
case IR.GroupStart, IR.GroupEnd:
i += IRL!(IR.GroupStart);
break;
case IR.Bol, IR.Wordboundary, IR.Notwordboundary:
i += IRL!(IR.Bol);
break;
default:
break L_FindChar;
}
}
table = memory;
table[] = uint.max;
ShiftThread[] trs;
ShiftThread t = ShiftThread(0, 0, table);
//locate first fixed char if any
n_length = 32;
for(;;)
{
L_Eval_Thread:
for(;;)
{
switch(re.ir[t.pc].code)
{
case IR.Char:
uint s = charLen(re.ir[t.pc].data);
if(t.idx+s > n_length)
goto L_StopThread;
t.add(re.ir[t.pc].data);
t.advance(s);
t.pc += IRL!(IR.Char);
break;
case IR.OrChar://assumes IRL!(OrChar) == 1
uint len = re.ir[t.pc].sequence;
uint end = t.pc + len;
uint[Bytecode.maxSequence] s;
uint numS;
for(uint i = 0; i < len; i++)
{
auto x = charLen(re.ir[t.pc+i].data);
if(countUntil(s[0..numS], x) < 0)
s[numS++] = x;
}
for(uint i = t.pc; i < end; i++)
{
t.add(re.ir[i].data);
}
for(uint i = 0; i < numS; i++)
{
auto tx = fork(t, t.pc + len, t.counter);
if(tx.idx + s[i] <= n_length)
{
tx.advance(s[i]);
trs ~= tx;
}
}
if(!trs.empty)
t = fetch(trs);
else
goto L_StopThread;
break;
case IR.CodepointSet:
case IR.Trie:
auto set = re.charsets[re.ir[t.pc].data];
uint[4] s;
uint numS;
static if(charSize == 3)
{
s[0] = charSize;
numS = 1;
}
else
{
static if(charSize == 1)
static immutable codeBounds = [0x0, 0x7F, 0x80, 0x7FF, 0x800, 0xFFFF, 0x10000, 0x10FFFF];
else //== 2
static immutable codeBounds = [0x0, 0xFFFF, 0x10000, 0x10FFFF];
auto srange = assumeSorted!"a <= b"(set.ivals);
for(uint i = 0; i < codeBounds.length/2; i++)
{
auto start = srange.lowerBound(codeBounds[2*i]).length;
auto end = srange.lowerBound(codeBounds[2*i+1]).length;
if(end > start || (end == start && (end & 1)))
s[numS++] = (i+1)*charSize;
}
}
if(numS == 0 || t.idx + s[numS-1] > n_length)
goto L_StopThread;
auto chars = set.chars;
if(chars > charsetThreshold)
goto L_StopThread;
foreach(ch; set[])
{
//avoid surrogate pairs
if(0xD800 <= ch && ch <= 0xDFFF)
continue;
t.add(ch);
}
for(uint i = 0; i < numS; i++)
{
auto tx = fork(t, t.pc + IRL!(IR.CodepointSet), t.counter);
tx.advance(s[i]);
trs ~= tx;
}
if(!trs.empty)
t = fetch(trs);
else
goto L_StopThread;
break;
case IR.Any:
goto L_StopThread;
case IR.GotoEndOr:
t.pc += IRL!(IR.GotoEndOr)+re.ir[t.pc].data;
assert(re.ir[t.pc].code == IR.OrEnd);
goto case;
case IR.OrEnd:
t.pc += IRL!(IR.OrEnd);
break;
case IR.OrStart:
t.pc += IRL!(IR.OrStart);
goto case;
case IR.Option:
uint next = t.pc + re.ir[t.pc].data + IRL!(IR.Option);
//queue next Option
if(re.ir[next].code == IR.Option)
{
trs ~= fork(t, next, t.counter);
}
t.pc += IRL!(IR.Option);
break;
case IR.RepeatStart:case IR.RepeatQStart:
t.pc += IRL!(IR.RepeatStart)+re.ir[t.pc].data;
goto case IR.RepeatEnd;
case IR.RepeatEnd:
case IR.RepeatQEnd:
uint len = re.ir[t.pc].data;
uint step = re.ir[t.pc+2].raw;
uint min = re.ir[t.pc+3].raw;
if(t.counter < min)
{
t.counter += step;
t.pc -= len;
break;
}
uint max = re.ir[t.pc+4].raw;
if(t.counter < max)
{
trs ~= fork(t, t.pc - len, t.counter + step);
t.counter = t.counter%step;
t.pc += IRL!(IR.RepeatEnd);
}
else
{
t.counter = t.counter%step;
t.pc += IRL!(IR.RepeatEnd);
}
break;
case IR.InfiniteStart, IR.InfiniteQStart:
t.pc += re.ir[t.pc].data + IRL!(IR.InfiniteStart);
goto case IR.InfiniteEnd; //both Q and non-Q
case IR.InfiniteEnd:
case IR.InfiniteQEnd:
uint len = re.ir[t.pc].data;
uint pc1, pc2; //branches to take in priority order
if(++t.hops == 32)
goto L_StopThread;
pc1 = t.pc + IRL!(IR.InfiniteEnd);
pc2 = t.pc - len;
trs ~= fork(t, pc2, t.counter);
t.pc = pc1;
break;
case IR.GroupStart, IR.GroupEnd:
t.pc += IRL!(IR.GroupStart);
break;
case IR.Bol, IR.Wordboundary, IR.Notwordboundary:
t.pc += IRL!(IR.Bol);
break;
case IR.LookaheadStart, IR.NeglookaheadStart, IR.LookbehindStart, IR.NeglookbehindStart:
t.pc += IRL!(IR.LookaheadStart) + IRL!(IR.LookaheadEnd) + re.ir[t.pc].data;
break;
default:
L_StopThread:
assert(re.ir[t.pc].code >= 0x80, text(re.ir[t.pc].code));
debug (fred_search) writeln("ShiftOr stumbled on ",re.ir[t.pc].mnemonic);
n_length = min(t.idx, n_length);
break L_Eval_Thread;
}
}
if(trs.empty)
break;
t = fetch(trs);
}
debug(std_regex_search)
{
writeln("Min length: ", n_length);
}
}
@property bool empty() const { return n_length == 0; }
@property uint length() const{ return n_length/charSize; }
// lookup compatible bit pattern in haystack, return starting index
// has a useful trait: if supplied with valid UTF indexes,
// returns only valid UTF indexes
// (that given the haystack in question is valid UTF string)
@trusted size_t search(const(Char)[] haystack, size_t idx)
{//@BUG: apparently assumes little endian machines
assert(!empty);
auto p = cast(const(ubyte)*)(haystack.ptr+idx);
uint state = uint.max;
uint limit = 1u<<(n_length - 1u);
debug(std_regex_search) writefln("Limit: %32b",limit);
if(fChar != uint.max)
{
const(ubyte)* end = cast(ubyte*)(haystack.ptr + haystack.length);
const orginalAlign = cast(size_t)p & (Char.sizeof-1);
while(p != end)
{
if(!~state)
{//speed up seeking first matching place
for(;;)
{
assert(p <= end, text(p," vs ", end));
p = cast(ubyte*)memchr(p, fChar, end - p);
if(!p)
return haystack.length;
if((cast(size_t)p & (Char.sizeof-1)) == orginalAlign)
break;
if(++p == end)
return haystack.length;
}
state = ~1u;
assert((cast(size_t)p & (Char.sizeof-1)) == orginalAlign);
static if(charSize == 3)
{
state = (state<<1) | table[p[1]];
state = (state<<1) | table[p[2]];
p += 4;
}
else
p++;
//first char is tested, see if that's all
if(!(state & limit))
return (p-cast(ubyte*)haystack.ptr)/Char.sizeof
-length;
}
else
{//have some bits/states for possible matches,
//use the usual shift-or cycle
static if(charSize == 3)
{
state = (state<<1) | table[p[0]];
state = (state<<1) | table[p[1]];
state = (state<<1) | table[p[2]];
p += 4;
}
else
{
state = (state<<1) | table[p[0]];
p++;
}
if(!(state & limit))
return (p-cast(ubyte*)haystack.ptr)/Char.sizeof
-length;
}
debug(std_regex_search) writefln("State: %32b", state);
}
}
else
{
//normal path, partially unrolled for char/wchar
static if(charSize == 3)
{
const(ubyte)* end = cast(ubyte*)(haystack.ptr + haystack.length);
while(p != end)
{
state = (state<<1) | table[p[0]];
state = (state<<1) | table[p[1]];
state = (state<<1) | table[p[2]];
p += 4;
if(!(state & limit))//division rounds down for dchar
return (p-cast(ubyte*)haystack.ptr)/Char.sizeof
-length;
}
}
else
{
auto len = cast(ubyte*)(haystack.ptr + haystack.length) - p;
size_t i = 0;
if(len & 1)
{
state = (state<<1) | table[p[i++]];
if(!(state & limit))
return idx+i/Char.sizeof-length;
}
while(i < len)
{
state = (state<<1) | table[p[i++]];
if(!(state & limit))
return idx+i/Char.sizeof
-length;
state = (state<<1) | table[p[i++]];
if(!(state & limit))
return idx+i/Char.sizeof
-length;
debug(std_regex_search) writefln("State: %32b", state);
}
}
}
return haystack.length;
}
@system debug static void dump(uint[] table)
{//@@@BUG@@@ writef(ln) is @system
import std.stdio;
for(size_t i = 0; i < table.length; i += 4)
{
writefln("%32b %32b %32b %32b",table[i], table[i+1], table[i+2], table[i+3]);
}
}
}
unittest
{
@trusted void test_fixed(alias Kick)()
{
foreach(i, v; TypeTuple!(char, wchar, dchar))
{
alias Char = v;
alias String = immutable(v)[];
auto r = regex(to!String(`abc$`));
auto kick = Kick!Char(r, new uint[256]);
assert(kick.length == 3, text(Kick.stringof," ",v.stringof, " == ", kick.length));
auto r2 = regex(to!String(`(abc){2}a+`));
kick = Kick!Char(r2, new uint[256]);
assert(kick.length == 7, text(Kick.stringof,v.stringof," == ", kick.length));
auto r3 = regex(to!String(`\b(a{2}b{3}){2,4}`));
kick = Kick!Char(r3, new uint[256]);
assert(kick.length == 10, text(Kick.stringof,v.stringof," == ", kick.length));
auto r4 = regex(to!String(`\ba{2}c\bxyz`));
kick = Kick!Char(r4, new uint[256]);
assert(kick.length == 6, text(Kick.stringof,v.stringof, " == ", kick.length));
auto r5 = regex(to!String(`\ba{2}c\b`));
kick = Kick!Char(r5, new uint[256]);
size_t x = kick.search("aabaacaa", 0);
assert(x == 3, text(Kick.stringof,v.stringof," == ", kick.length));
x = kick.search("aabaacaa", x+1);
assert(x == 8, text(Kick.stringof,v.stringof," == ", kick.length));
}
}
@trusted void test_flex(alias Kick)()
{
foreach(i, v;TypeTuple!(char, wchar, dchar))
{
alias Char = v;
alias String = immutable(v)[];
auto r = regex(to!String(`abc[a-z]`));
auto kick = Kick!Char(r, new uint[256]);
auto x = kick.search(to!String("abbabca"), 0);
assert(x == 3, text("real x is ", x, " ",v.stringof));
auto r2 = regex(to!String(`(ax|bd|cdy)`));
String s2 = to!String("abdcdyabax");
kick = Kick!Char(r2, new uint[256]);
x = kick.search(s2, 0);
assert(x == 1, text("real x is ", x));
x = kick.search(s2, x+1);
assert(x == 3, text("real x is ", x));
x = kick.search(s2, x+1);
assert(x == 8, text("real x is ", x));
auto rdot = regex(to!String(`...`));
kick = Kick!Char(rdot, new uint[256]);
assert(kick.length == 0);
auto rN = regex(to!String(`a(b+|c+)x`));
kick = Kick!Char(rN, new uint[256]);
assert(kick.length == 3);
assert(kick.search("ababx",0) == 2);
assert(kick.search("abaacba",0) == 3);//expected inexact
}
}
test_fixed!(ShiftOr)();
test_flex!(ShiftOr)();
}
alias Kickstart = ShiftOr;
//Simple UTF-string abstraction compatible with stream interface
struct Input(Char)
if(is(Char :dchar))
{
alias DataIndex = size_t;
enum { isLoopback = false };
alias String = const(Char)[];
String _origin;
size_t _index;
//constructs Input object out of plain string
this(String input, size_t idx = 0)
{
_origin = input;
_index = idx;
}
//codepoint at current stream position
bool nextChar(ref dchar res, ref size_t pos)
{
pos = _index;
if(_index == _origin.length)
return false;
res = std.utf.decode(_origin, _index);
return true;
}
@property bool atEnd(){
return _index == _origin.length;
}
bool search(Kickstart)(ref Kickstart kick, ref dchar res, ref size_t pos)
{
size_t idx = kick.search(_origin, _index);
_index = idx;
return nextChar(res, pos);
}
//index of at End position
@property size_t lastIndex(){ return _origin.length; }
//support for backtracker engine, might not be present
void reset(size_t index){ _index = index; }
String opSlice(size_t start, size_t end){ return _origin[start..end]; }
struct BackLooper
{
alias DataIndex = size_t;
enum { isLoopback = true };
String _origin;
size_t _index;
this(Input input, size_t index)
{
_origin = input._origin;
_index = index;
}
@trusted bool nextChar(ref dchar res,ref size_t pos)
{
pos = _index;
if(_index == 0)
return false;
res = _origin[0.._index].back;
_index -= std.utf.strideBack(_origin, _index);
return true;
}
@property atEnd(){ return _index == 0 || _index == std.utf.strideBack(_origin, _index); }
auto loopBack(size_t index){ return Input(_origin, index); }
//support for backtracker engine, might not be present
//void reset(size_t index){ _index = index ? index-std.utf.strideBack(_origin, index) : 0; }
void reset(size_t index){ _index = index; }
String opSlice(size_t start, size_t end){ return _origin[end..start]; }
//index of at End position
@property size_t lastIndex(){ return 0; }
}
auto loopBack(size_t index){ return BackLooper(this, index); }
}
//both helperd below are internal, on its own are quite "explosive"
//unsafe, no initialization of elements
@system T[] mallocArray(T)(size_t len)
{
return (cast(T*)malloc(len * T.sizeof))[0 .. len];
}
//very unsafe, no initialization
@system T[] arrayInChunk(T)(size_t len, ref void[] chunk)
{
auto ret = (cast(T*)chunk.ptr)[0..len];
chunk = chunk[len * T.sizeof .. $];
return ret;
}
/+
BacktrackingMatcher implements backtracking scheme of matching
regular expressions.
+/
template BacktrackingMatcher(bool CTregex)
{
@trusted struct BacktrackingMatcher(Char, Stream = Input!Char)
if(is(Char : dchar))
{
alias DataIndex = Stream.DataIndex;
struct State
{//top bit in pc is set if saved along with matches
DataIndex index;
uint pc, counter, infiniteNesting;
}
static assert(State.sizeof % size_t.sizeof == 0);
enum stateSize = State.sizeof / size_t.sizeof;
enum initialStack = 1<<11; // items in a block of segmented stack
alias const(Char)[] String;
alias RegEx = Regex!Char;
alias MatchFn = bool function (ref BacktrackingMatcher!(Char, Stream));
RegEx re; //regex program
static if(CTregex)
MatchFn nativeFn; //native code for that program
//Stream state
Stream s;
DataIndex index;
dchar front;
bool exhausted;
//backtracking machine state
uint pc, counter;
DataIndex lastState = 0; //top of state stack
DataIndex[] trackers;
static if(!CTregex)
uint infiniteNesting;
size_t[] memory;
//local slice of matches, global for backref
Group!DataIndex[] matches, backrefed;
static if(__traits(hasMember,Stream, "search"))
{
enum kicked = true;
}
else
enum kicked = false;
static size_t initialMemory(const ref RegEx re)
{
return (re.ngroup+1)*DataIndex.sizeof //trackers
+ stackSize(re)*size_t.sizeof;
}
static size_t stackSize(const ref RegEx re)
{
return initialStack*(stateSize + re.ngroup*(Group!DataIndex).sizeof/size_t.sizeof)+1;
}
@property bool atStart(){ return index == 0; }
@property bool atEnd(){ return index == s.lastIndex && s.atEnd; }
void next()
{
if(!s.nextChar(front, index))
index = s.lastIndex;
}
void search()
{
static if(kicked)
{
if(!s.search(re.kickstart, front, index))
{
index = s.lastIndex;
}
}
else
next();
}
//
void newStack()
{
auto chunk = mallocArray!(size_t)(stackSize(re));
chunk[0] = cast(size_t)(memory.ptr);
memory = chunk[1..$];
}
void initExternalMemory(void[] memBlock)
{
trackers = arrayInChunk!(DataIndex)(re.ngroup+1, memBlock);
memory = cast(size_t[])memBlock;
memory[0] = 0; //hidden pointer
memory = memory[1..$];
}
void initialize(ref RegEx program, Stream stream, void[] memBlock)
{
re = program;
s = stream;
exhausted = false;
initExternalMemory(memBlock);
backrefed = null;
}
auto dupTo(void[] memory)
{
typeof(this) tmp = this;
tmp.initExternalMemory(memory);
return tmp;
}
this(ref RegEx program, Stream stream, void[] memBlock, dchar ch, DataIndex idx)
{
initialize(program, stream, memBlock);
front = ch;
index = idx;
}
this(ref RegEx program, Stream stream, void[] memBlock)
{
initialize(program, stream, memBlock);
next();
}
auto fwdMatcher(ref BacktrackingMatcher matcher, void[] memBlock)
{
alias BackMatcherTempl = .BacktrackingMatcher!(CTregex);
alias BackMatcher = BackMatcherTempl!(Char, Stream);
auto fwdMatcher = BackMatcher(matcher.re, s, memBlock, front, index);
return fwdMatcher;
}
auto bwdMatcher(ref BacktrackingMatcher matcher, void[] memBlock)
{
alias BackMatcherTempl = .BacktrackingMatcher!(CTregex);
alias BackMatcher = BackMatcherTempl!(Char, typeof(s.loopBack(index)));
auto fwdMatcher =
BackMatcher(matcher.re, s.loopBack(index), memBlock);
return fwdMatcher;
}
//
bool matchFinalize()
{
size_t start = index;
if(matchImpl())
{//stream is updated here
matches[0].begin = start;
matches[0].end = index;
if(!(re.flags & RegexOption.global) || atEnd)
exhausted = true;
if(start == index)//empty match advances input
next();
return true;
}
else
return false;
}
//lookup next match, fill matches with indices into input
bool match(Group!DataIndex matches[])
{
debug(std_regex_matcher)
{
writeln("------------------------------------------");
}
if(exhausted) //all matches collected
return false;
this.matches = matches;
if(re.flags & RegexInfo.oneShot)
{
exhausted = true;
DataIndex start = index;
auto m = matchImpl();
if(m)
{
matches[0].begin = start;
matches[0].end = index;
}
return m;
}
static if(kicked)
{
if(!re.kickstart.empty)
{
for(;;)
{
if(matchFinalize())
return true;
else
{
if(atEnd)
break;
search();
if(atEnd)
{
exhausted = true;
return matchFinalize();
}
}
}
exhausted = true;
return false; //early return
}
}
//no search available - skip a char at a time
for(;;)
{
if(matchFinalize())
return true;
else
{
if(atEnd)
break;
next();
if(atEnd)
{
exhausted = true;
return matchFinalize();
}
}
}
exhausted = true;
return false;
}
/+
match subexpression against input,
results are stored in matches
+/
bool matchImpl()
{
static if(CTregex && is(typeof(nativeFn(this))))
{
debug(std_regex_ctr) writeln("using C-T matcher");
return nativeFn(this);
}
else
{
pc = 0;
counter = 0;
lastState = 0;
infiniteNesting = -1;//intentional
auto start = s._index;
debug(std_regex_matcher)
writeln("Try match starting at ", s[index..s.lastIndex]);
for(;;)
{
debug(std_regex_matcher)
writefln("PC: %s\tCNT: %s\t%s \tfront: %s src: %s",
pc, counter, disassemble(re.ir, pc, re.dict),
front, s._index);
switch(re.ir[pc].code)
{
case IR.OrChar://assumes IRL!(OrChar) == 1
if(atEnd)
goto L_backtrack;
uint len = re.ir[pc].sequence;
uint end = pc + len;
if(re.ir[pc].data != front && re.ir[pc+1].data != front)
{
for(pc = pc+2; pc < end; pc++)
if(re.ir[pc].data == front)
break;
if(pc == end)
goto L_backtrack;
}
pc = end;
next();
break;
case IR.Char:
if(atEnd || front != re.ir[pc].data)
goto L_backtrack;
pc += IRL!(IR.Char);
next();
break;
case IR.Any:
if(atEnd || (!(re.flags & RegexOption.singleline)
&& (front == '\r' || front == '\n')))
goto L_backtrack;
pc += IRL!(IR.Any);
next();
break;
case IR.CodepointSet:
if(atEnd || !re.charsets[re.ir[pc].data].scanFor(front))
goto L_backtrack;
next();
pc += IRL!(IR.CodepointSet);
break;
case IR.Trie:
if(atEnd || !re.tries[re.ir[pc].data][front])
goto L_backtrack;
next();
pc += IRL!(IR.Trie);
break;
case IR.Wordboundary:
dchar back;
DataIndex bi;
//at start & end of input
if(atStart && wordTrie[front])
{
pc += IRL!(IR.Wordboundary);
break;
}
else if(atEnd && s.loopBack(index).nextChar(back, bi)
&& wordTrie[back])
{
pc += IRL!(IR.Wordboundary);
break;
}
else if(s.loopBack(index).nextChar(back, bi))
{
bool af = wordTrie[front];
bool ab = wordTrie[back];
if(af ^ ab)
{
pc += IRL!(IR.Wordboundary);
break;
}
}
goto L_backtrack;
case IR.Notwordboundary:
dchar back;
DataIndex bi;
//at start & end of input
if(atStart && wordTrie[front])
goto L_backtrack;
else if(atEnd && s.loopBack(index).nextChar(back, bi)
&& wordTrie[back])
goto L_backtrack;
else if(s.loopBack(index).nextChar(back, bi))
{
bool af = wordTrie[front];
bool ab = wordTrie[back];
if(af ^ ab)
goto L_backtrack;
}
pc += IRL!(IR.Wordboundary);
break;
case IR.Bol:
dchar back;
DataIndex bi;
if(atStart)
pc += IRL!(IR.Bol);
else if((re.flags & RegexOption.multiline)
&& s.loopBack(index).nextChar(back,bi)
&& endOfLine(back, front == '\n'))
{
pc += IRL!(IR.Bol);
}
else
goto L_backtrack;
break;
case IR.Eol:
dchar back;
DataIndex bi;
debug(std_regex_matcher) writefln("EOL (front 0x%x) %s", front, s[index..s.lastIndex]);
//no matching inside \r\n
if(atEnd || ((re.flags & RegexOption.multiline)
&& endOfLine(front, s.loopBack(index).nextChar(back,bi)
&& back == '\r')))
{
pc += IRL!(IR.Eol);
}
else
goto L_backtrack;
break;
case IR.InfiniteStart, IR.InfiniteQStart:
trackers[infiniteNesting+1] = index;
pc += re.ir[pc].data + IRL!(IR.InfiniteStart);
//now pc is at end IR.Infininite(Q)End
uint len = re.ir[pc].data;
int test;
if(re.ir[pc].code == IR.InfiniteEnd)
{
test = quickTestFwd(pc+IRL!(IR.InfiniteEnd), front, re);
if(test >= 0)
pushState(pc+IRL!(IR.InfiniteEnd), counter);
infiniteNesting++;
pc -= len;
}
else
{
test = quickTestFwd(pc - len, front, re);
if(test >= 0)
{
infiniteNesting++;
pushState(pc - len, counter);
infiniteNesting--;
}
pc += IRL!(IR.InfiniteEnd);
}
break;
case IR.RepeatStart, IR.RepeatQStart:
pc += re.ir[pc].data + IRL!(IR.RepeatStart);
break;
case IR.RepeatEnd:
case IR.RepeatQEnd:
//len, step, min, max
uint len = re.ir[pc].data;
uint step = re.ir[pc+2].raw;
uint min = re.ir[pc+3].raw;
uint max = re.ir[pc+4].raw;
if(counter < min)
{
counter += step;
pc -= len;
}
else if(counter < max)
{
if(re.ir[pc].code == IR.RepeatEnd)
{
pushState(pc + IRL!(IR.RepeatEnd), counter%step);
counter += step;
pc -= len;
}
else
{
pushState(pc - len, counter + step);
counter = counter%step;
pc += IRL!(IR.RepeatEnd);
}
}
else
{
counter = counter%step;
pc += IRL!(IR.RepeatEnd);
}
break;
case IR.InfiniteEnd:
case IR.InfiniteQEnd:
uint len = re.ir[pc].data;
debug(std_regex_matcher) writeln("Infinited nesting:", infiniteNesting);
assert(infiniteNesting < trackers.length);
if(trackers[infiniteNesting] == index)
{//source not consumed
pc += IRL!(IR.InfiniteEnd);
infiniteNesting--;
break;
}
else
trackers[infiniteNesting] = index;
int test;
if(re.ir[pc].code == IR.InfiniteEnd)
{
test = quickTestFwd(pc+IRL!(IR.InfiniteEnd), front, re);
if(test >= 0)
{
infiniteNesting--;
pushState(pc + IRL!(IR.InfiniteEnd), counter);
infiniteNesting++;
}
pc -= len;
}
else
{
test = quickTestFwd(pc-len, front, re);
if(test >= 0)
pushState(pc-len, counter);
pc += IRL!(IR.InfiniteEnd);
infiniteNesting--;
}
break;
case IR.OrEnd:
pc += IRL!(IR.OrEnd);
break;
case IR.OrStart:
pc += IRL!(IR.OrStart);
goto case;
case IR.Option:
uint len = re.ir[pc].data;
if(re.ir[pc+len].code == IR.GotoEndOr)//not a last one
{
pushState(pc + len + IRL!(IR.Option), counter); //remember 2nd branch
}
pc += IRL!(IR.Option);
break;
case IR.GotoEndOr:
pc = pc + re.ir[pc].data + IRL!(IR.GotoEndOr);
break;
case IR.GroupStart:
uint n = re.ir[pc].data;
matches[n].begin = index;
debug(std_regex_matcher) writefln("IR group #%u starts at %u", n, index);
pc += IRL!(IR.GroupStart);
break;
case IR.GroupEnd:
uint n = re.ir[pc].data;
matches[n].end = index;
debug(std_regex_matcher) writefln("IR group #%u ends at %u", n, index);
pc += IRL!(IR.GroupEnd);
break;
case IR.LookaheadStart:
case IR.NeglookaheadStart:
uint len = re.ir[pc].data;
auto save = index;
uint ms = re.ir[pc+1].raw, me = re.ir[pc+2].raw;
auto mem = malloc(initialMemory(re))[0..initialMemory(re)];
scope(exit) free(mem.ptr);
static if(Stream.isLoopback)
{
auto matcher = bwdMatcher(this, mem);
}
else
{
auto matcher = fwdMatcher(this, mem);
}
matcher.matches = matches[ms .. me];
matcher.backrefed = backrefed.empty ? matches : backrefed;
matcher.re.ir = re.ir[pc+IRL!(IR.LookaheadStart) .. pc+IRL!(IR.LookaheadStart)+len+IRL!(IR.LookaheadEnd)];
bool match = matcher.matchImpl() ^ (re.ir[pc].code == IR.NeglookaheadStart);
s.reset(save);
next();
if(!match)
goto L_backtrack;
else
{
pc += IRL!(IR.LookaheadStart)+len+IRL!(IR.LookaheadEnd);
}
break;
case IR.LookbehindStart:
case IR.NeglookbehindStart:
uint len = re.ir[pc].data;
uint ms = re.ir[pc+1].raw, me = re.ir[pc+2].raw;
auto mem = malloc(initialMemory(re))[0..initialMemory(re)];
scope(exit) free(mem.ptr);
static if(Stream.isLoopback)
{
alias Matcher = BacktrackingMatcher!(Char, Stream);
auto matcher = Matcher(re, s, mem, front, index);
}
else
{
alias Matcher = BacktrackingMatcher!(Char, typeof(s.loopBack(index)));
auto matcher = Matcher(re, s.loopBack(index), mem);
}
matcher.matches = matches[ms .. me];
matcher.re.ir = re.ir[pc + IRL!(IR.LookbehindStart) .. pc + IRL!(IR.LookbehindStart) + len + IRL!(IR.LookbehindEnd)];
matcher.backrefed = backrefed.empty ? matches : backrefed;
bool match = matcher.matchImpl() ^ (re.ir[pc].code == IR.NeglookbehindStart);
if(!match)
goto L_backtrack;
else
{
pc += IRL!(IR.LookbehindStart)+len+IRL!(IR.LookbehindEnd);
}
break;
case IR.Backref:
uint n = re.ir[pc].data;
auto referenced = re.ir[pc].localRef
? s[matches[n].begin .. matches[n].end]
: s[backrefed[n].begin .. backrefed[n].end];
while(!atEnd && !referenced.empty && front == referenced.front)
{
next();
referenced.popFront();
}
if(referenced.empty)
pc++;
else
goto L_backtrack;
break;
case IR.Nop:
pc += IRL!(IR.Nop);
break;
case IR.LookaheadEnd:
case IR.NeglookaheadEnd:
case IR.LookbehindEnd:
case IR.NeglookbehindEnd:
case IR.End:
return true;
default:
debug printBytecode(re.ir[0..$]);
assert(0);
L_backtrack:
if(!popState())
{
s.reset(start);
return false;
}
}
}
}
assert(0);
}
@property size_t stackAvail()
{
return memory.length - lastState;
}
bool prevStack()
{
size_t* prev = memory.ptr-1;
prev = cast(size_t*)*prev;//take out hidden pointer
if(!prev)
return false;
free(memory.ptr);//last segment is freed in RegexMatch
immutable size = initialStack*(stateSize + 2*re.ngroup);
memory = prev[0..size];
lastState = size;
return true;
}
void stackPush(T)(T val)
if(!isDynamicArray!T)
{
*cast(T*)&memory[lastState] = val;
enum delta = (T.sizeof+size_t.sizeof/2)/size_t.sizeof;
lastState += delta;
debug(std_regex_matcher) writeln("push element SP= ", lastState);
}
void stackPush(T)(T[] val)
{
static assert(T.sizeof % size_t.sizeof == 0);
(cast(T*)&memory[lastState])[0..val.length]
= val[0..$];
lastState += val.length*(T.sizeof/size_t.sizeof);
debug(std_regex_matcher) writeln("push array SP= ", lastState);
}
void stackPop(T)(ref T val)
if(!isDynamicArray!T)
{
enum delta = (T.sizeof+size_t.sizeof/2)/size_t.sizeof;
lastState -= delta;
val = *cast(T*)&memory[lastState];
debug(std_regex_matcher) writeln("pop element SP= ", lastState);
}
void stackPop(T)(T[] val)
{
stackPop(val); // call ref version
}
void stackPop(T)(ref T[] val)
{
lastState -= val.length*(T.sizeof/size_t.sizeof);
val[0..$] = (cast(T*)&memory[lastState])[0..val.length];
debug(std_regex_matcher) writeln("pop array SP= ", lastState);
}
static if(!CTregex)
{
//helper function, saves engine state
void pushState(uint pc, uint counter)
{
if(stateSize + matches.length > stackAvail)
{
newStack();
lastState = 0;
}
*cast(State*)&memory[lastState] =
State(index, pc, counter, infiniteNesting);
lastState += stateSize;
memory[lastState .. lastState + 2 * matches.length] = (cast(size_t[])matches)[];
lastState += 2*matches.length;
debug(std_regex_matcher)
writefln("Saved(pc=%s) front: %s src: %s",
pc, front, s[index..s.lastIndex]);
}
//helper function, restores engine state
bool popState()
{
if(!lastState)
return prevStack();
lastState -= 2*matches.length;
auto pm = cast(size_t[])matches;
pm[] = memory[lastState .. lastState+2*matches.length];
lastState -= stateSize;
State* state = cast(State*)&memory[lastState];
index = state.index;
pc = state.pc;
counter = state.counter;
infiniteNesting = state.infiniteNesting;
debug(std_regex_matcher)
{
writefln("Restored matches", front, s[index .. s.lastIndex]);
foreach(i, m; matches)
writefln("Sub(%d) : %s..%s", i, m.begin, m.end);
}
s.reset(index);
next();
debug(std_regex_matcher)
writefln("Backtracked (pc=%s) front: %s src: %s",
pc, front, s[index..s.lastIndex]);
return true;
}
}
}
}
//very shitty string formatter, $$ replaced with next argument converted to string
@trusted string ctSub( U...)(string format, U args)
{
bool seenDollar;
foreach(i, ch; format)
{
if(ch == '$')
{
if(seenDollar)
{
static if(args.length > 0)
{
return format[0 .. i - 1] ~ to!string(args[0])
~ ctSub(format[i + 1 .. $], args[1 .. $]);
}
else
assert(0);
}
else
seenDollar = true;
}
else
seenDollar = false;
}
return format;
}
//generate code for TypeTuple(S, S+1, S+2, ... E)
@system string ctGenSeq(int S, int E)
{
string s = "alias Sequence = TypeTuple!(";
if(S < E)
s ~= to!string(S);
for(int i = S+1; i < E;i++)
{
s ~= ", ";
s ~= to!string(i);
}
return s ~");";
}
//alias to TypeTuple(S, S+1, S+2, ... E)
template Sequence(int S, int E)
{
mixin(ctGenSeq(S,E));
}
struct CtContext
{
//dirty flags
bool counter, infNesting;
// to make a unique advancement counter per nesting level of loops
int curInfLoop, nInfLoops;
//to mark the portion of matches to save
int match, total_matches;
int reserved;
//state of codegenerator
struct CtState
{
string code;
int addr;
}
this(Char)(Regex!Char re)
{
match = 1;
reserved = 1; //first match is skipped
total_matches = re.ngroup;
}
CtContext lookaround()
{
CtContext ct;
ct.total_matches = total_matches;
ct.match = 1;
return ct;
}
//restore state having current context
string restoreCode()
{
string text;
//stack is checked in L_backtrack
text ~= counter
? "
stackPop(counter);"
: "
counter = 0;";
if(match < total_matches)
{
text ~= ctSub("
stackPop(matches[$$..$$]);", reserved, match);
text ~= ctSub("
matches[$$..$] = typeof(matches[0]).init;", match);
}
else
text ~= ctSub("
stackPop(matches[$$..$]);", reserved);
return text;
}
//save state having current context
string saveCode(uint pc, string count_expr="counter")
{
string text = ctSub("
if(stackAvail < $$*(Group!(DataIndex)).sizeof/size_t.sizeof + $$)
{
newStack();
lastState = 0;
}", match - reserved, cast(int)counter + 2);
if(match < total_matches)
text ~= ctSub("
stackPush(matches[$$..$$]);", reserved, match);
else
text ~= ctSub("
stackPush(matches[$$..$]);", reserved);
text ~= counter ? ctSub("
stackPush($$);", count_expr) : "";
text ~= ctSub("
stackPush(index); stackPush($$); \n", pc);
return text;
}
//
CtState ctGenBlock(Bytecode[] ir, int addr)
{
CtState result;
result.addr = addr;
while(!ir.empty)
{
auto n = ctGenGroup(ir, result.addr);
result.code ~= n.code;
result.addr = n.addr;
}
return result;
}
//
CtState ctGenGroup(ref Bytecode[] ir, int addr)
{
auto bailOut = "goto L_backtrack;";
auto nextInstr = ctSub("goto case $$;", addr+1);
CtState r;
assert(!ir.empty);
switch(ir[0].code)
{
case IR.InfiniteStart, IR.InfiniteQStart, IR.RepeatStart, IR.RepeatQStart:
bool infLoop =
ir[0].code == IR.InfiniteStart || ir[0].code == IR.InfiniteQStart;
infNesting = infNesting || infLoop;
if(infLoop)
{
curInfLoop++;
nInfLoops = max(nInfLoops, curInfLoop+1);
}
counter = counter ||
ir[0].code == IR.RepeatStart || ir[0].code == IR.RepeatQStart;
uint len = ir[0].data;
auto nir = ir[ir[0].length .. ir[0].length+len];
r = ctGenBlock(nir, addr+1);
if(infLoop)
curInfLoop--;
//start/end codegen
//r.addr is at last test+ jump of loop, addr+1 is body of loop
nir = ir[ir[0].length + len .. $];
r.code = ctGenFixupCode(ir[0..ir[0].length], addr, r.addr) ~ r.code;
r.code ~= ctGenFixupCode(nir, r.addr, addr+1);
r.addr += 2; //account end instruction + restore state
ir = nir;
break;
case IR.OrStart:
uint len = ir[0].data;
auto nir = ir[ir[0].length .. ir[0].length+len];
r = ctGenAlternation(nir, addr);
ir = ir[ir[0].length + len .. $];
assert(ir[0].code == IR.OrEnd);
ir = ir[ir[0].length..$];
break;
case IR.LookaheadStart:
case IR.NeglookaheadStart:
case IR.LookbehindStart:
case IR.NeglookbehindStart:
uint len = ir[0].data;
bool behind = ir[0].code == IR.LookbehindStart || ir[0].code == IR.NeglookbehindStart;
bool negative = ir[0].code == IR.NeglookaheadStart || ir[0].code == IR.NeglookbehindStart;
string fwdType = "typeof(fwdMatcher(matcher, []))";
string bwdType = "typeof(bwdMatcher(matcher, []))";
string fwdCreate = "fwdMatcher(matcher, mem)";
string bwdCreate = "bwdMatcher(matcher, mem)";
uint start = IRL!(IR.LookbehindStart);
uint end = IRL!(IR.LookbehindStart)+len+IRL!(IR.LookaheadEnd);
CtContext context = lookaround(); //split off new context
auto slice = ir[start .. end];
r.code ~= ctSub(`
case $$: //fake lookaround "atom"
static if(typeof(matcher.s).isLoopback)
alias Lookaround = $$;
else
alias Lookaround = $$;
static bool matcher_$$(ref Lookaround matcher) @trusted
{
//(neg)lookaround piece start
$$
//(neg)lookaround piece ends
}
auto save = index;
auto mem = malloc(initialMemory(re))[0..initialMemory(re)];
scope(exit) free(mem.ptr);
static if(typeof(matcher.s).isLoopback)
auto lookaround = $$;
else
auto lookaround = $$;
lookaround.matches = matches[$$..$$];
lookaround.backrefed = backrefed.empty ? matches : backrefed;
lookaround.nativeFn = &matcher_$$; //hookup closure's binary code
bool match = $$;
s.reset(save);
next();
if(match)
$$
else
$$`, addr,
behind ? fwdType : bwdType, behind ? bwdType : fwdType,
addr, context.ctGenRegEx(slice),
behind ? fwdCreate : bwdCreate, behind ? bwdCreate : fwdCreate,
ir[1].raw, ir[2].raw, //start - end of matches slice
addr,
negative ? "!lookaround.matchImpl()" : "lookaround.matchImpl()",
nextInstr, bailOut);
ir = ir[end .. $];
r.addr = addr + 1;
break;
case IR.LookaheadEnd: case IR.NeglookaheadEnd:
case IR.LookbehindEnd: case IR.NeglookbehindEnd:
ir = ir[IRL!(IR.LookaheadEnd) .. $];
r.addr = addr;
break;
default:
assert(ir[0].isAtom, text(ir[0].mnemonic));
r = ctGenAtom(ir, addr);
}
return r;
}
//generate source for bytecode contained in OrStart ... OrEnd
CtState ctGenAlternation(Bytecode[] ir, int addr)
{
CtState[] pieces;
CtState r;
enum optL = IRL!(IR.Option);
for(;;)
{
assert(ir[0].code == IR.Option);
auto len = ir[0].data;
if(optL+len < ir.length && ir[optL+len].code == IR.Option)//not a last option
{
auto nir = ir[optL .. optL+len-IRL!(IR.GotoEndOr)];
r = ctGenBlock(nir, addr+2);//space for Option + restore state
//r.addr+1 to account GotoEndOr at end of branch
r.code = ctGenFixupCode(ir[0 .. ir[0].length], addr, r.addr+1) ~ r.code;
addr = r.addr+1;//leave space for GotoEndOr
pieces ~= r;
ir = ir[optL + len .. $];
}
else
{
pieces ~= ctGenBlock(ir[optL..$], addr);
addr = pieces[$-1].addr;
break;
}
}
r = pieces[0];
for(uint i = 1; i < pieces.length; i++)
{
r.code ~= ctSub(`
case $$:
goto case $$; `, pieces[i-1].addr, addr);
r.code ~= pieces[i].code;
}
r.addr = addr;
return r;
}
// generate fixup code for instruction in ir,
// fixup means it has an alternative way for control flow
string ctGenFixupCode(Bytecode[] ir, int addr, int fixup)
{
return ctGenFixupCode(ir, addr, fixup); // call ref Bytecode[] version
}
string ctGenFixupCode(ref Bytecode[] ir, int addr, int fixup)
{
string r;
string testCode;
r = ctSub(`
case $$: debug(std_regex_matcher) writeln("#$$");`,
addr, addr);
switch(ir[0].code)
{
case IR.InfiniteStart, IR.InfiniteQStart:
r ~= ctSub( `
tracker_$$ = DataIndex.max;
goto case $$;`, curInfLoop, fixup);
ir = ir[ir[0].length..$];
break;
case IR.InfiniteEnd:
testCode = ctQuickTest(ir[IRL!(IR.InfiniteEnd) .. $],addr + 1);
r ~= ctSub( `
if(tracker_$$ == index)
{//source not consumed
goto case $$;
}
tracker_$$ = index;
$$
{
$$
}
goto case $$;
case $$: //restore state and go out of loop
$$
goto case;`, curInfLoop, addr+2,
curInfLoop, testCode, saveCode(addr+1),
fixup, addr+1, restoreCode());
ir = ir[ir[0].length..$];
break;
case IR.InfiniteQEnd:
testCode = ctQuickTest(ir[IRL!(IR.InfiniteEnd) .. $],addr + 1);
r ~= ctSub( `
if(tracker_$$ == index)
{//source not consumed
goto case $$;
}
tracker_$$ = index;
$$
{
$$
goto case $$;
}
else
goto case $$;
case $$://restore state and go inside loop
$$
goto case $$;`, curInfLoop, addr+2, curInfLoop,
testCode, saveCode(addr+1),
addr+2, fixup, addr+1, restoreCode(), fixup);
ir = ir[ir[0].length..$];
break;
case IR.RepeatStart, IR.RepeatQStart:
r ~= ctSub( `
goto case $$;`, fixup);
ir = ir[ir[0].length..$];
break;
case IR.RepeatEnd, IR.RepeatQEnd:
//len, step, min, max
uint len = ir[0].data;
uint step = ir[2].raw;
uint min = ir[3].raw;
uint max = ir[4].raw;
r ~= ctSub(`
if(counter < $$)
{
debug(std_regex_matcher) writeln("RepeatEnd min case pc=", $$);
counter += $$;
goto case $$;
}`, min, addr, step, fixup);
if(ir[0].code == IR.RepeatEnd)
{
string counter_expr = ctSub("counter % $$", step);
r ~= ctSub(`
else if(counter < $$)
{
$$
counter += $$;
goto case $$;
}`, max, saveCode(addr+1, counter_expr), step, fixup);
}
else
{
string counter_expr = ctSub("counter % $$", step);
r ~= ctSub(`
else if(counter < $$)
{
$$
counter = counter % $$;
goto case $$;
}`, max, saveCode(addr+1,counter_expr), step, addr+2);
}
r ~= ctSub(`
else
{
counter = counter % $$;
goto case $$;
}
case $$: //restore state
$$
goto case $$;`, step, addr+2, addr+1, restoreCode(),
ir[0].code == IR.RepeatEnd ? addr+2 : fixup );
ir = ir[ir[0].length..$];
break;
case IR.Option:
r ~= ctSub( `
{
$$
}
goto case $$;
case $$://restore thunk to go to the next group
$$
goto case $$;`, saveCode(addr+1), addr+2,
addr+1, restoreCode(), fixup);
ir = ir[ir[0].length..$];
break;
default:
assert(0, text(ir[0].mnemonic));
}
return r;
}
string ctQuickTest(Bytecode[] ir, int id)
{
uint pc = 0;
while(pc < ir.length && ir[pc].isAtom)
{
if(ir[pc].code == IR.GroupStart || ir[pc].code == IR.GroupEnd)
{
pc++;
}
else
{
auto code = ctAtomCode(ir[pc..$], -1);
return ctSub(`
int test_$$()
{
$$ //$$
}
if(test_$$() >= 0)`, id, code.ptr ? code : "return 0;",
ir[pc].mnemonic, id);
}
}
return "";
}
//process & generate source for simple bytecodes at front of ir using address addr
CtState ctGenAtom(ref Bytecode[] ir, int addr)
{
CtState result;
result.code = ctAtomCode(ir, addr);
ir.popFrontN(ir[0].code == IR.OrChar ? ir[0].sequence : ir[0].length);
result.addr = addr + 1;
return result;
}
//D code for atom at ir using address addr, addr < 0 means quickTest
string ctAtomCode(Bytecode[] ir, int addr)
{
string code;
string bailOut, nextInstr;
if(addr < 0)
{
bailOut = "return -1;";
nextInstr = "return 0;";
}
else
{
bailOut = "goto L_backtrack;";
nextInstr = ctSub("goto case $$;", addr+1);
code ~= ctSub( `
case $$: debug(std_regex_matcher) writeln("#$$");
`, addr, addr);
}
switch(ir[0].code)
{
case IR.OrChar://assumes IRL!(OrChar) == 1
code ~= ctSub(`
if(atEnd)
$$`, bailOut);
uint len = ir[0].sequence;
for(uint i = 0; i < len; i++)
{
code ~= ctSub( `
if(front == $$)
{
$$
$$
}`, ir[i].data, addr >= 0 ? "next();" :"", nextInstr);
}
code ~= ctSub( `
$$`, bailOut);
break;
case IR.Char:
code ~= ctSub( `
if(atEnd || front != $$)
$$
$$
$$`, ir[0].data, bailOut, addr >= 0 ? "next();" :"", nextInstr);
break;
case IR.Any:
code ~= ctSub( `
if(atEnd || (!(re.flags & RegexOption.singleline)
&& (front == '\r' || front == '\n')))
$$
$$
$$`, bailOut, addr >= 0 ? "next();" :"",nextInstr);
break;
case IR.CodepointSet:
code ~= ctSub( `
if(atEnd || !re.charsets[$$].scanFor(front))
$$
$$
$$`, ir[0].data, bailOut, addr >= 0 ? "next();" :"", nextInstr);
break;
case IR.Trie:
code ~= ctSub( `
if(atEnd || !re.tries[$$][front])
$$
$$
$$`, ir[0].data, bailOut, addr >= 0 ? "next();" :"", nextInstr);
break;
case IR.Wordboundary:
code ~= ctSub( `
dchar back;
DataIndex bi;
if(atStart && wordTrie[front])
{
$$
}
else if(atEnd && s.loopBack(index).nextChar(back, bi)
&& wordTrie[back])
{
$$
}
else if(s.loopBack(index).nextChar(back, bi))
{
bool af = wordTrie[front];
bool ab = wordTrie[back];
if(af ^ ab)
{
$$
}
}
$$`, nextInstr, nextInstr, nextInstr, bailOut);
break;
case IR.Notwordboundary:
code ~= ctSub( `
dchar back;
DataIndex bi;
//at start & end of input
if(atStart && wordTrie[front])
$$
else if(atEnd && s.loopBack(index).nextChar(back, bi)
&& wordTrie[back])
$$
else if(s.loopBack(index).nextChar(back, bi))
{
bool af = wordTrie[front];
bool ab = wordTrie[back];
if(af ^ ab)
$$
}
$$`, bailOut, bailOut, bailOut, nextInstr);
break;
case IR.Bol:
code ~= ctSub(`
dchar back;
DataIndex bi;
if(atStart || ((re.flags & RegexOption.multiline)
&& s.loopBack(index).nextChar(back,bi)
&& endOfLine(back, front == '\n')))
{
debug(std_regex_matcher) writeln("BOL matched");
$$
}
else
$$`, nextInstr, bailOut);
break;
case IR.Eol:
code ~= ctSub(`
dchar back;
DataIndex bi;
debug(std_regex_matcher) writefln("EOL (front 0x%x) %s", front, s[index..s.lastIndex]);
//no matching inside \r\n
if(atEnd || ((re.flags & RegexOption.multiline)
&& endOfLine(front, s.loopBack(index).nextChar(back,bi)
&& back == '\r')))
{
debug(std_regex_matcher) writeln("EOL matched");
$$
}
else
$$`, nextInstr, bailOut);
break;
case IR.GroupStart:
code ~= ctSub(`
matches[$$].begin = index;
$$`, ir[0].data, nextInstr);
match = ir[0].data+1;
break;
case IR.GroupEnd:
code ~= ctSub(`
matches[$$].end = index;
$$`, ir[0].data, nextInstr);
break;
case IR.Backref:
string mStr = "auto referenced = ";
mStr ~= ir[0].localRef
? ctSub("s[matches[$$].begin .. matches[$$].end];",
ir[0].data, ir[0].data)
: ctSub("s[backrefed[$$].begin .. backrefed[$$].end];",
ir[0].data, ir[0].data);
code ~= ctSub( `
$$
while(!atEnd && !referenced.empty && front == referenced.front)
{
next();
referenced.popFront();
}
if(referenced.empty)
$$
else
$$`, mStr, nextInstr, bailOut);
break;
case IR.Nop:
case IR.End:
break;
default:
assert(0, text(ir[0].mnemonic, " is not supported yet"));
}
return code;
}
//generate D code for the whole regex
public string ctGenRegEx(Bytecode[] ir)
{
auto bdy = ctGenBlock(ir, 0);
auto r = `
with(matcher)
{
pc = 0;
counter = 0;
lastState = 0;
auto start = s._index;`;
for(int i = 0; i < nInfLoops; i++)
r ~= ctSub(`
size_t tracker_$$;`, i);
r ~= `
goto StartLoop;
debug(std_regex_matcher) writeln("Try CT matching starting at ",s[index..s.lastIndex]);
L_backtrack:
if(lastState || prevStack())
{
stackPop(pc);
stackPop(index);
s.reset(index);
next();
}
else
{
s.reset(start);
return false;
}
StartLoop:
switch(pc)
{
`;
r ~= bdy.code;
r ~= ctSub(`
case $$: break;`,bdy.addr);
r ~= `
default:
assert(0);
}
return true;
}
`;
return r;
}
}
string ctGenRegExCode(Char)(Regex!Char re)
{
auto context = CtContext(re);
return context.ctGenRegEx(re.ir);
}
//State of VM thread
struct Thread(DataIndex)
{
Thread* next; //intrusive linked list
uint pc;
uint counter; //loop counter
uint uopCounter; //counts micro operations inside one macro instruction (e.g. BackRef)
Group!DataIndex[1] matches;
}
//head-tail singly-linked list
struct ThreadList(DataIndex)
{
Thread!DataIndex* tip = null, toe = null;
//add new thread to the start of list
void insertFront(Thread!DataIndex* t)
{
if(tip)
{
t.next = tip;
tip = t;
}
else
{
t.next = null;
tip = toe = t;
}
}
//add new thread to the end of list
void insertBack(Thread!DataIndex* t)
{
if(toe)
{
toe.next = t;
toe = t;
}
else
tip = toe = t;
toe.next = null;
}
//move head element out of list
Thread!DataIndex* fetch()
{
auto t = tip;
if(tip == toe)
tip = toe = null;
else
tip = tip.next;
return t;
}
//non-destructive iteration of ThreadList
struct ThreadRange
{
const(Thread!DataIndex)* ct;
this(ThreadList tlist){ ct = tlist.tip; }
@property bool empty(){ return ct is null; }
@property const(Thread!DataIndex)* front(){ return ct; }
@property popFront()
{
assert(ct);
ct = ct.next;
}
}
@property bool empty()
{
return tip == null;
}
ThreadRange opSlice()
{
return ThreadRange(this);
}
}
//direction parameter for thompson one-shot match evaluator
enum OneShot { Fwd, Bwd };
/+
Thomspon matcher does all matching in lockstep,
never looking at the same char twice
+/
@trusted struct ThompsonMatcher(Char, Stream = Input!Char)
if(is(Char : dchar))
{
alias DataIndex = Stream.DataIndex;
Thread!DataIndex* freelist;
ThreadList!DataIndex clist, nlist;
DataIndex[] merge;
Group!DataIndex[] backrefed;
Regex!Char re; //regex program
Stream s;
dchar front;
DataIndex index;
DataIndex genCounter; //merge trace counter, goes up on every dchar
size_t[size_t] subCounters; //a table of gen counter per sub-engine: PC -> counter
size_t threadSize;
bool matched;
bool exhausted;
static if(__traits(hasMember,Stream, "search"))
{
enum kicked = true;
}
else
enum kicked = false;
static size_t getThreadSize(const ref Regex!Char re)
{
return re.ngroup
? (Thread!DataIndex).sizeof + (re.ngroup-1)*(Group!DataIndex).sizeof
: (Thread!DataIndex).sizeof - (Group!DataIndex).sizeof;
}
static size_t initialMemory(const ref Regex!Char re)
{
return getThreadSize(re)*re.threadCount + re.hotspotTableSize*size_t.sizeof;
}
//true if it's start of input
@property bool atStart(){ return index == 0; }
//true if it's end of input
@property bool atEnd(){ return index == s.lastIndex && s.atEnd; }
bool next()
{
if(!s.nextChar(front, index))
{
index = s.lastIndex;
return false;
}
return true;
}
static if(kicked)
{
bool search()
{
if(!s.search(re.kickstart, front, index))
{
index = s.lastIndex;
return false;
}
return true;
}
}
void initExternalMemory(void[] memory)
{
threadSize = getThreadSize(re);
prepareFreeList(re.threadCount, memory);
if(re.hotspotTableSize)
{
merge = arrayInChunk!(DataIndex)(re.hotspotTableSize, memory);
merge[] = 0;
}
}
this()(Regex!Char program, Stream stream, void[] memory)
{
re = program;
s = stream;
initExternalMemory(memory);
genCounter = 0;
}
this(S)(ref ThompsonMatcher!(Char,S) matcher, Bytecode[] piece, Stream stream)
{
s = stream;
re = matcher.re;
re.ir = piece;
threadSize = matcher.threadSize;
merge = matcher.merge;
freelist = matcher.freelist;
front = matcher.front;
index = matcher.index;
}
auto fwdMatcher()(Bytecode[] piece, size_t counter)
{
auto m = ThompsonMatcher!(Char, Stream)(this, piece, s);
m.genCounter = counter;
return m;
}
auto bwdMatcher()(Bytecode[] piece, size_t counter)
{
alias BackLooper = typeof(s.loopBack(index));
auto m = ThompsonMatcher!(Char, BackLooper)(this, piece, s.loopBack(index));
m.genCounter = counter;
m.next();
return m;
}
auto dupTo(void[] memory)
{
typeof(this) tmp = this;//bitblit
tmp.initExternalMemory(memory);
tmp.genCounter = 0;
return tmp;
}
enum MatchResult{
NoMatch,
PartialMatch,
Match,
}
bool match(Group!DataIndex[] matches)
{
debug(std_regex_matcher)
writeln("------------------------------------------");
if(exhausted)
{
return false;
}
if(re.flags & RegexInfo.oneShot)
{
next();
exhausted = true;
return matchOneShot(matches)==MatchResult.Match;
}
static if(kicked)
if(!re.kickstart.empty)
return matchImpl!(true)(matches);
return matchImpl!(false)(matches);
}
//match the input and fill matches
bool matchImpl(bool withSearch)(Group!DataIndex[] matches)
{
if(!matched && clist.empty)
{
static if(withSearch)
search();
else
next();
}
else//char in question is fetched in prev call to match
{
matched = false;
}
if(!atEnd)//if no char
for(;;)
{
genCounter++;
debug(std_regex_matcher)
{
writefln("Threaded matching threads at %s", s[index..s.lastIndex]);
foreach(t; clist[])
{
assert(t);
writef("pc=%s ",t.pc);
write(t.matches);
writeln();
}
}
for(Thread!DataIndex* t = clist.fetch(); t; t = clist.fetch())
{
eval!true(t, matches);
}
if(!matched)//if we already have match no need to push the engine
eval!true(createStart(index), matches);//new thread staring at this position
else if(nlist.empty)
{
debug(std_regex_matcher) writeln("Stopped matching before consuming full input");
break;//not a partial match for sure
}
clist = nlist;
nlist = (ThreadList!DataIndex).init;
if(clist.tip is null)
{
static if(withSearch)
{
if(!search())
break;
}
else
{
if(!next())
break;
}
}
else if(!next())
{
if (!atEnd) return false;
exhausted = true;
break;
}
}
genCounter++; //increment also on each end
debug(std_regex_matcher) writefln("Threaded matching threads at end");
//try out all zero-width posibilities
for(Thread!DataIndex* t = clist.fetch(); t; t = clist.fetch())
{
eval!false(t, matches);
}
if(!matched)
eval!false(createStart(index), matches);//new thread starting at end of input
if(matched)
{//in case NFA found match along the way
//and last possible longer alternative ultimately failed
s.reset(matches[0].end);//reset to last successful match
next();//and reload front character
//--- here the exact state of stream was restored ---
exhausted = atEnd || !(re.flags & RegexOption.global);
//+ empty match advances the input
if(!exhausted && matches[0].begin == matches[0].end)
next();
}
return matched;
}
/+
handle succesful threads
+/
void finish(const(Thread!DataIndex)* t, Group!DataIndex[] matches)
{
matches.ptr[0..re.ngroup] = t.matches.ptr[0..re.ngroup];
debug(std_regex_matcher)
{
writef("FOUND pc=%s prog_len=%s",
t.pc, re.ir.length);
if(!matches.empty)
writefln(": %s..%s", matches[0].begin, matches[0].end);
foreach(v; matches)
writefln("%d .. %d", v.begin, v.end);
}
matched = true;
}
/+
match thread against codepoint, cutting trough all 0-width instructions
and taking care of control flow, then add it to nlist
+/
void eval(bool withInput)(Thread!DataIndex* t, Group!DataIndex[] matches)
{
ThreadList!DataIndex worklist;
debug(std_regex_matcher) writeln("---- Evaluating thread");
for(;;)
{
debug(std_regex_matcher)
{
writef("\tpc=%s [", t.pc);
foreach(x; worklist[])
writef(" %s ", x.pc);
writeln("]");
}
switch(re.ir[t.pc].code)
{
case IR.End:
finish(t, matches);
matches[0].end = index; //fix endpoint of the whole match
recycle(t);
//cut off low priority threads
recycle(clist);
recycle(worklist);
debug(std_regex_matcher) writeln("Finished thread ", matches);
return;
case IR.Wordboundary:
dchar back;
DataIndex bi;
//at start & end of input
if(atStart && wordTrie[front])
{
t.pc += IRL!(IR.Wordboundary);
break;
}
else if(atEnd && s.loopBack(index).nextChar(back, bi)
&& wordTrie[back])
{
t.pc += IRL!(IR.Wordboundary);
break;
}
else if(s.loopBack(index).nextChar(back, bi))
{
bool af = wordTrie[front];
bool ab = wordTrie[back];
if(af ^ ab)
{
t.pc += IRL!(IR.Wordboundary);
break;
}
}
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
case IR.Notwordboundary:
dchar back;
DataIndex bi;
//at start & end of input
if(atStart && wordTrie[front])
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
else if(atEnd && s.loopBack(index).nextChar(back, bi)
&& wordTrie[back])
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
else if(s.loopBack(index).nextChar(back, bi))
{
bool af = wordTrie[front];
bool ab = wordTrie[back] != 0;
if(af ^ ab)
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
}
t.pc += IRL!(IR.Wordboundary);
break;
case IR.Bol:
dchar back;
DataIndex bi;
if(atStart
||( (re.flags & RegexOption.multiline)
&& s.loopBack(index).nextChar(back,bi)
&& startOfLine(back, front == '\n')))
{
t.pc += IRL!(IR.Bol);
}
else
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
}
break;
case IR.Eol:
debug(std_regex_matcher) writefln("EOL (front 0x%x) %s", front, s[index..s.lastIndex]);
dchar back;
DataIndex bi;
//no matching inside \r\n
if(atEnd || ((re.flags & RegexOption.multiline)
&& endOfLine(front, s.loopBack(index).nextChar(back, bi)
&& back == '\r')))
{
t.pc += IRL!(IR.Eol);
}
else
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
}
break;
case IR.InfiniteStart, IR.InfiniteQStart:
t.pc += re.ir[t.pc].data + IRL!(IR.InfiniteStart);
goto case IR.InfiniteEnd; //both Q and non-Q
case IR.RepeatStart, IR.RepeatQStart:
t.pc += re.ir[t.pc].data + IRL!(IR.RepeatStart);
goto case IR.RepeatEnd; //both Q and non-Q
case IR.RepeatEnd:
case IR.RepeatQEnd:
//len, step, min, max
uint len = re.ir[t.pc].data;
uint step = re.ir[t.pc+2].raw;
uint min = re.ir[t.pc+3].raw;
if(t.counter < min)
{
t.counter += step;
t.pc -= len;
break;
}
if(merge[re.ir[t.pc + 1].raw+t.counter] < genCounter)
{
debug(std_regex_matcher) writefln("A thread(pc=%s) passed there : %s ; GenCounter=%s mergetab=%s",
t.pc, index, genCounter, merge[re.ir[t.pc + 1].raw+t.counter] );
merge[re.ir[t.pc + 1].raw+t.counter] = genCounter;
}
else
{
debug(std_regex_matcher) writefln("A thread(pc=%s) got merged there : %s ; GenCounter=%s mergetab=%s",
t.pc, index, genCounter, merge[re.ir[t.pc + 1].raw+t.counter] );
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
uint max = re.ir[t.pc+4].raw;
if(t.counter < max)
{
if(re.ir[t.pc].code == IR.RepeatEnd)
{
//queue out-of-loop thread
worklist.insertFront(fork(t, t.pc + IRL!(IR.RepeatEnd), t.counter % step));
t.counter += step;
t.pc -= len;
}
else
{
//queue into-loop thread
worklist.insertFront(fork(t, t.pc - len, t.counter + step));
t.counter %= step;
t.pc += IRL!(IR.RepeatEnd);
}
}
else
{
t.counter %= step;
t.pc += IRL!(IR.RepeatEnd);
}
break;
case IR.InfiniteEnd:
case IR.InfiniteQEnd:
if(merge[re.ir[t.pc + 1].raw+t.counter] < genCounter)
{
debug(std_regex_matcher) writefln("A thread(pc=%s) passed there : %s ; GenCounter=%s mergetab=%s",
t.pc, index, genCounter, merge[re.ir[t.pc + 1].raw+t.counter] );
merge[re.ir[t.pc + 1].raw+t.counter] = genCounter;
}
else
{
debug(std_regex_matcher) writefln("A thread(pc=%s) got merged there : %s ; GenCounter=%s mergetab=%s",
t.pc, index, genCounter, merge[re.ir[t.pc + 1].raw+t.counter] );
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
uint len = re.ir[t.pc].data;
uint pc1, pc2; //branches to take in priority order
if(re.ir[t.pc].code == IR.InfiniteEnd)
{
pc1 = t.pc - len;
pc2 = t.pc + IRL!(IR.InfiniteEnd);
}
else
{
pc1 = t.pc + IRL!(IR.InfiniteEnd);
pc2 = t.pc - len;
}
static if(withInput)
{
int test = quickTestFwd(pc1, front, re);
if(test >= 0)
{
worklist.insertFront(fork(t, pc2, t.counter));
t.pc = pc1;
}
else
t.pc = pc2;
}
else
{
worklist.insertFront(fork(t, pc2, t.counter));
t.pc = pc1;
}
break;
case IR.OrEnd:
if(merge[re.ir[t.pc + 1].raw+t.counter] < genCounter)
{
debug(std_regex_matcher) writefln("A thread(pc=%s) passed there : %s ; GenCounter=%s mergetab=%s",
t.pc, s[index .. s.lastIndex], genCounter, merge[re.ir[t.pc + 1].raw + t.counter] );
merge[re.ir[t.pc + 1].raw+t.counter] = genCounter;
t.pc += IRL!(IR.OrEnd);
}
else
{
debug(std_regex_matcher) writefln("A thread(pc=%s) got merged there : %s ; GenCounter=%s mergetab=%s",
t.pc, s[index .. s.lastIndex], genCounter, merge[re.ir[t.pc + 1].raw + t.counter] );
recycle(t);
t = worklist.fetch();
if(!t)
return;
}
break;
case IR.OrStart:
t.pc += IRL!(IR.OrStart);
goto case;
case IR.Option:
uint next = t.pc + re.ir[t.pc].data + IRL!(IR.Option);
//queue next Option
if(re.ir[next].code == IR.Option)
{
worklist.insertFront(fork(t, next, t.counter));
}
t.pc += IRL!(IR.Option);
break;
case IR.GotoEndOr:
t.pc = t.pc + re.ir[t.pc].data + IRL!(IR.GotoEndOr);
goto case IR.OrEnd;
case IR.GroupStart:
uint n = re.ir[t.pc].data;
t.matches.ptr[n].begin = index;
t.pc += IRL!(IR.GroupStart);
break;
case IR.GroupEnd:
uint n = re.ir[t.pc].data;
t.matches.ptr[n].end = index;
t.pc += IRL!(IR.GroupEnd);
break;
case IR.Backref:
uint n = re.ir[t.pc].data;
Group!DataIndex* source = re.ir[t.pc].localRef ? t.matches.ptr : backrefed.ptr;
assert(source);
if(source[n].begin == source[n].end)//zero-width Backref!
{
t.pc += IRL!(IR.Backref);
}
else static if(withInput)
{
size_t idx = source[n].begin + t.uopCounter;
size_t end = source[n].end;
if(s[idx..end].front == front)
{
t.uopCounter += std.utf.stride(s[idx..end], 0);
if(t.uopCounter + source[n].begin == source[n].end)
{//last codepoint
t.pc += IRL!(IR.Backref);
t.uopCounter = 0;
}
nlist.insertBack(t);
}
else
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
else
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
break;
case IR.LookbehindStart:
case IR.NeglookbehindStart:
uint len = re.ir[t.pc].data;
uint ms = re.ir[t.pc + 1].raw, me = re.ir[t.pc + 2].raw;
uint end = t.pc + len + IRL!(IR.LookbehindEnd) + IRL!(IR.LookbehindStart);
bool positive = re.ir[t.pc].code == IR.LookbehindStart;
static if(Stream.isLoopback)
auto matcher = fwdMatcher(re.ir[t.pc .. end], subCounters.get(t.pc, 0));
else
auto matcher = bwdMatcher(re.ir[t.pc .. end], subCounters.get(t.pc, 0));
matcher.re.ngroup = re.ir[t.pc+2].raw - re.ir[t.pc+1].raw;
matcher.backrefed = backrefed.empty ? t.matches : backrefed;
//backMatch
bool nomatch = (matcher.matchOneShot(t.matches, IRL!(IR.LookbehindStart))
== MatchResult.Match) ^ positive;
freelist = matcher.freelist;
subCounters[t.pc] = matcher.genCounter;
if(nomatch)
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
else
t.pc = end;
break;
case IR.LookaheadStart:
case IR.NeglookaheadStart:
auto save = index;
uint len = re.ir[t.pc].data;
uint ms = re.ir[t.pc+1].raw, me = re.ir[t.pc+2].raw;
uint end = t.pc+len+IRL!(IR.LookaheadEnd)+IRL!(IR.LookaheadStart);
bool positive = re.ir[t.pc].code == IR.LookaheadStart;
static if(Stream.isLoopback)
auto matcher = bwdMatcher(re.ir[t.pc .. end], subCounters.get(t.pc, 0));
else
auto matcher = fwdMatcher(re.ir[t.pc .. end], subCounters.get(t.pc, 0));
matcher.re.ngroup = me - ms;
matcher.backrefed = backrefed.empty ? t.matches : backrefed;
bool nomatch = (matcher.matchOneShot(t.matches, IRL!(IR.LookaheadStart))
== MatchResult.Match) ^ positive;
freelist = matcher.freelist;
subCounters[t.pc] = matcher.genCounter;
s.reset(index);
next();
if(nomatch)
{
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
}
else
t.pc = end;
break;
case IR.LookaheadEnd:
case IR.NeglookaheadEnd:
case IR.LookbehindEnd:
case IR.NeglookbehindEnd:
t.pc = re.ir[t.pc].indexOfPair(t.pc);
uint ms = re.ir[t.pc+1].raw, me = re.ir[t.pc+2].raw;
finish(t, matches.ptr[ms..me]);
recycle(t);
//cut off low priority threads
recycle(clist);
recycle(worklist);
return;
case IR.Nop:
t.pc += IRL!(IR.Nop);
break;
static if(withInput)
{
case IR.OrChar:
uint len = re.ir[t.pc].sequence;
uint end = t.pc + len;
static assert(IRL!(IR.OrChar) == 1);
for(; t.pc < end; t.pc++)
if(re.ir[t.pc].data == front)
break;
if(t.pc != end)
{
t.pc = end;
nlist.insertBack(t);
}
else
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
case IR.Char:
if(front == re.ir[t.pc].data)
{
t.pc += IRL!(IR.Char);
nlist.insertBack(t);
}
else
recycle(t);
t = worklist.fetch();
if(!t)
return;
break;
case IR.Any:
t.pc += IRL!(IR.Any);
if(!(re.flags & RegexOption.singleline)
&& (front == '\r' || front == '\n'))
recycle(t);
else
nlist.insertBack(t);
t = worklist.fetch();
if(!t)
return;
break;
case IR.CodepointSet:
if(re.charsets[re.ir[t.pc].data].scanFor(front))
{
t.pc += IRL!(IR.CodepointSet);
nlist.insertBack(t);
}
else
{
recycle(t);
}
t = worklist.fetch();
if(!t)
return;
break;
case IR.Trie:
if(re.tries[re.ir[t.pc].data][front])
{
t.pc += IRL!(IR.Trie);
nlist.insertBack(t);
}
else
{
recycle(t);
}
t = worklist.fetch();
if(!t)
return;
break;
default:
assert(0, "Unrecognized instruction " ~ re.ir[t.pc].mnemonic);
}
else
{
default:
recycle(t);
t = worklist.fetch();
if(!t)
return;
}
}
}
}
enum uint RestartPc = uint.max;
//match the input, evaluating IR without searching
MatchResult matchOneShot(Group!DataIndex[] matches, uint startPc = 0)
{
debug(std_regex_matcher)
{
writefln("---------------single shot match ----------------- ");
}
alias evalFn = eval;
assert(clist == (ThreadList!DataIndex).init || startPc == RestartPc); // incorrect after a partial match
assert(nlist == (ThreadList!DataIndex).init || startPc == RestartPc);
startPc = startPc;
if(!atEnd)//if no char
{
debug(std_regex_matcher)
{
writefln("-- Threaded matching threads at %s", s[index..s.lastIndex]);
}
if(startPc!=RestartPc)
{
auto startT = createStart(index, startPc);
genCounter++;
evalFn!true(startT, matches);
}
for(;;)
{
debug(std_regex_matcher) writeln("\n-- Started iteration of main cycle");
genCounter++;
debug(std_regex_matcher)
{
foreach(t; clist[])
{
assert(t);
}
}
for(Thread!DataIndex* t = clist.fetch(); t; t = clist.fetch())
{
evalFn!true(t, matches);
}
if(nlist.empty)
{
debug(std_regex_matcher) writeln("Stopped matching before consuming full input");
break;//not a partial match for sure
}
clist = nlist;
nlist = (ThreadList!DataIndex).init;
if(!next())
{
if (!atEnd) return MatchResult.PartialMatch;
break;
}
debug(std_regex_matcher) writeln("-- Ended iteration of main cycle\n");
}
}
genCounter++; //increment also on each end
debug(std_regex_matcher) writefln("-- Matching threads at end");
//try out all zero-width posibilities
for(Thread!DataIndex* t = clist.fetch(); t; t = clist.fetch())
{
evalFn!false(t, matches);
}
if(!matched)
evalFn!false(createStart(index, startPc), matches);
return (matched?MatchResult.Match:MatchResult.NoMatch);
}
//get a dirty recycled Thread
Thread!DataIndex* allocate()
{
assert(freelist, "not enough preallocated memory");
Thread!DataIndex* t = freelist;
freelist = freelist.next;
return t;
}
//link memory into a free list of Threads
void prepareFreeList(size_t size, ref void[] memory)
{
void[] mem = memory[0 .. threadSize*size];
memory = memory[threadSize * size .. $];
freelist = cast(Thread!DataIndex*)&mem[0];
size_t i;
for(i = threadSize; i < threadSize*size; i += threadSize)
(cast(Thread!DataIndex*)&mem[i-threadSize]).next = cast(Thread!DataIndex*)&mem[i];
(cast(Thread!DataIndex*)&mem[i-threadSize]).next = null;
}
//dispose a thread
void recycle(Thread!DataIndex* t)
{
t.next = freelist;
freelist = t;
}
//dispose list of threads
void recycle(ref ThreadList!DataIndex list)
{
auto t = list.tip;
while(t)
{
auto next = t.next;
recycle(t);
t = next;
}
list = list.init;
}
//creates a copy of master thread with given pc
Thread!DataIndex* fork(Thread!DataIndex* master, uint pc, uint counter)
{
auto t = allocate();
t.matches.ptr[0..re.ngroup] = master.matches.ptr[0..re.ngroup];
t.pc = pc;
t.counter = counter;
t.uopCounter = 0;
return t;
}
//creates a start thread
Thread!DataIndex* createStart(DataIndex index, uint pc = 0)
{
auto t = allocate();
t.matches.ptr[0..re.ngroup] = (Group!DataIndex).init;
t.matches[0].begin = index;
t.pc = pc;
t.counter = 0;
t.uopCounter = 0;
return t;
}
}
/++
$(D Captures) object contains submatches captured during a call
to $(D match) or iteration over $(D RegexMatch) range.
First element of range is the whole match.
+/
@trusted public struct Captures(R, DIndex = size_t)
if(isSomeString!R)
{//@trusted because of union inside
alias DataIndex = DIndex;
alias String = R;
private:
R _input;
bool _empty;
enum smallString = 3;
union
{
Group!DataIndex[] big_matches;
Group!DataIndex[smallString] small_matches;
}
uint _f, _b;
uint _ngroup;
NamedGroup[] _names;
this()(R input, uint ngroups, NamedGroup[] named)
{
_input = input;
_ngroup = ngroups;
_names = named;
newMatches();
_b = _ngroup;
_f = 0;
}
this(alias Engine)(ref RegexMatch!(R,Engine) rmatch)
{
_input = rmatch._input;
_ngroup = rmatch._engine.re.ngroup;
_names = rmatch._engine.re.dict;
newMatches();
_b = _ngroup;
_f = 0;
}
@property Group!DataIndex[] matches()
{
return _ngroup > smallString ? big_matches : small_matches[0 .. _ngroup];
}
void newMatches()
{
if(_ngroup > smallString)
big_matches = new Group!DataIndex[_ngroup];
}
public:
///Slice of input prior to the match.
@property R pre()
{
return _empty ? _input[] : _input[0 .. matches[0].begin];
}
///Slice of input immediately after the match.
@property R post()
{
return _empty ? _input[] : _input[matches[0].end .. $];
}
///Slice of matched portion of input.
@property R hit()
{
assert(!_empty);
return _input[matches[0].begin .. matches[0].end];
}
///Range interface.
@property R front()
{
assert(!empty);
return _input[matches[_f].begin .. matches[_f].end];
}
///ditto
@property R back()
{
assert(!empty);
return _input[matches[_b - 1].begin .. matches[_b - 1].end];
}
///ditto
void popFront()
{
assert(!empty);
++_f;
}
///ditto
void popBack()
{
assert(!empty);
--_b;
}
///ditto
@property bool empty() const { return _empty || _f >= _b; }
///ditto
R opIndex()(size_t i) /*const*/ //@@@BUG@@@
{
assert(_f + i < _b,text("requested submatch number ", i," is out of range"));
assert(matches[_f + i].begin <= matches[_f + i].end,
text("wrong match: ", matches[_f + i].begin, "..", matches[_f + i].end));
return _input[matches[_f + i].begin .. matches[_f + i].end];
}
/++
Explicit cast to bool.
Useful as a shorthand for !(x.empty) in if and assert statements.
---
import std.regex;
assert(!matchFirst("nothing", "something"));
---
+/
@safe bool opCast(T:bool)() const nothrow { return !empty; }
/++
Lookup named submatch.
---
import std.regex;
import std.range;
auto c = matchFirst("a = 42;", regex(`(?P<var>\w+)\s*=\s*(?P<value>\d+);`));
assert(c["var"] == "a");
assert(c["value"] == "42");
popFrontN(c, 2);
//named groups are unaffected by range primitives
assert(c["var"] =="a");
assert(c.front == "42");
----
+/
R opIndex(String)(String i) /*const*/ //@@@BUG@@@
if(isSomeString!String)
{
size_t index = lookupNamedGroup(_names, i);
return _input[matches[index].begin .. matches[index].end];
}
///Number of matches in this object.
@property size_t length() const { return _empty ? 0 : _b - _f; }
///A hook for compatibility with original std.regex.
@property ref captures(){ return this; }
}
///
unittest
{
auto c = matchFirst("@abc#", regex(`(\w)(\w)(\w)`));
assert(c.pre == "@"); // Part of input preceeding match
assert(c.post == "#"); // Immediately after match
assert(c.hit == c[0] && c.hit == "abc"); // The whole match
assert(c[2] == "b");
assert(c.front == "abc");
c.popFront();
assert(c.front == "a");
assert(c.back == "c");
c.popBack();
assert(c.back == "b");
popFrontN(c, 2);
assert(c.empty);
assert(!matchFirst("nothing", "something"));
}
/++
A regex engine state, as returned by $(D match) family of functions.
Effectively it's a forward range of Captures!R, produced
by lazily searching for matches in a given input.
$(D alias Engine) specifies an engine type to use during matching,
and is automatically deduced in a call to $(D match)/$(D bmatch).
+/
@trusted public struct RegexMatch(R, alias Engine = ThompsonMatcher)
if(isSomeString!R)
{
private:
alias Char = BasicElementOf!R;
alias EngineType = Engine!Char;
EngineType _engine;
R _input;
Captures!(R,EngineType.DataIndex) _captures;
void[] _memory;//is ref-counted
this(RegEx)(R input, RegEx prog)
{
_input = input;
immutable size = EngineType.initialMemory(prog)+size_t.sizeof;
_memory = (enforce(malloc(size))[0..size]);
scope(failure) free(_memory.ptr);
*cast(size_t*)_memory.ptr = 1;
_engine = EngineType(prog, Input!Char(input), _memory[size_t.sizeof..$]);
static if(is(RegEx == StaticRegex!(BasicElementOf!R)))
_engine.nativeFn = prog.nativeFn;
_captures = Captures!(R,EngineType.DataIndex)(this);
_captures._empty = !_engine.match(_captures.matches);
debug(std_regex_allocation) writefln("RefCount (ctor): %x %d", _memory.ptr, counter);
}
@property ref size_t counter(){ return *cast(size_t*)_memory.ptr; }
public:
this(this)
{
if(_memory.ptr)
{
++counter;
debug(std_regex_allocation) writefln("RefCount (postblit): %x %d",
_memory.ptr, *cast(size_t*)_memory.ptr);
}
}
~this()
{
if(_memory.ptr && --*cast(size_t*)_memory.ptr == 0)
{
debug(std_regex_allocation) writefln("RefCount (dtor): %x %d",
_memory.ptr, *cast(size_t*)_memory.ptr);
free(cast(void*)_memory.ptr);
}
}
///Shorthands for front.pre, front.post, front.hit.
@property R pre()
{
return _captures.pre;
}
///ditto
@property R post()
{
return _captures.post;
}
///ditto
@property R hit()
{
return _captures.hit;
}
/++
Functionality for processing subsequent matches of global regexes via range interface:
---
import std.regex;
auto m = matchAll("Hello, world!", regex(`\w+`));
assert(m.front.hit == "Hello");
m.popFront();
assert(m.front.hit == "world");
m.popFront();
assert(m.empty);
---
+/
@property auto front()
{
return _captures;
}
///ditto
void popFront()
{
if(counter != 1)
{//do cow magic first
counter--;//we abandon this reference
immutable size = EngineType.initialMemory(_engine.re)+size_t.sizeof;
_memory = (enforce(malloc(size))[0..size]);
_engine = _engine.dupTo(_memory[size_t.sizeof..size]);
counter = 1;//points to new chunk
}
//previous _captures can have escaped references from Capture object
_captures.newMatches();
_captures._empty = !_engine.match(_captures.matches);
}
///ditto
auto save(){ return this; }
///Test if this match object is empty.
@property bool empty(){ return _captures._empty; }
///Same as !(x.empty), provided for its convenience in conditional statements.
T opCast(T:bool)(){ return !empty; }
/// Same as .front, provided for compatibility with original std.regex.
@property auto captures(){ return _captures; }
}
private @trusted auto matchOnce(alias Engine, RegEx, R)(R input, RegEx re)
{
alias Char = BasicElementOf!R;
alias EngineType = Engine!Char;
size_t size = EngineType.initialMemory(re);
void[] memory = enforce(malloc(size))[0..size];
scope(exit) free(memory.ptr);
auto captures = Captures!(R, EngineType.DataIndex)(input, re.ngroup, re.dict);
auto engine = EngineType(re, Input!Char(input), memory);
static if(is(RegEx == StaticRegex!(BasicElementOf!R)))
engine.nativeFn = re.nativeFn;
captures._empty = !engine.match(captures.matches);
return captures;
}
private auto matchMany(alias Engine, RegEx, R)(R input, RegEx re)
{
re.flags |= RegexOption.global;
return RegexMatch!(R, Engine)(input, re);
}
unittest
{
//sanity checks for new API
auto re = regex("abc");
assert(!"abc".matchOnce!(ThompsonMatcher)(re).empty);
assert("abc".matchOnce!(ThompsonMatcher)(re)[0] == "abc");
}
/++
Compile regular expression pattern for the later execution.
Returns: $(D Regex) object that works on inputs having
the same character width as $(D pattern).
Params:
pattern = Regular expression
flags = The _attributes (g, i, m and x accepted)
Throws: $(D RegexException) if there were any errors during compilation.
+/
@trusted public auto regex(S)(S pattern, const(char)[] flags="")
if(isSomeString!(S))
{
enum cacheSize = 8; //TODO: invent nice interface to control regex caching
if(__ctfe)
return regexImpl(pattern, flags);
return memoize!(regexImpl!S, cacheSize)(pattern, flags);
}
public auto regexImpl(S)(S pattern, const(char)[] flags="")
if(isSomeString!(S))
{
auto parser = Parser!(Unqual!(typeof(pattern)))(pattern, flags);
auto r = parser.program;
return r;
}
template ctRegexImpl(alias pattern, string flags=[])
{
enum r = regex(pattern, flags);
alias Char = BasicElementOf!(typeof(pattern));
enum source = ctGenRegExCode(r);
alias Matcher = BacktrackingMatcher!(true);
@trusted bool func(ref Matcher!Char matcher)
{
debug(std_regex_ctr) pragma(msg, source);
mixin(source);
}
enum nr = StaticRegex!Char(r, &func);
}
/++
Compile regular expression using CTFE
and generate optimized native machine code for matching it.
Returns: StaticRegex object for faster matching.
Params:
pattern = Regular expression
flags = The _attributes (g, i, m and x accepted)
+/
public enum ctRegex(alias pattern, alias flags=[]) = ctRegexImpl!(pattern, flags).nr;
enum isRegexFor(RegEx, R) = is(RegEx == Regex!(BasicElementOf!R))
|| is(RegEx == StaticRegex!(BasicElementOf!R));
/++
Start matching $(D input) to regex pattern $(D re),
using Thompson NFA matching scheme.
The use of this function is $(RED discouraged) - use either of
$(LREF matchAll) or $(LREF matchFirst).
Delegating the kind of operation
to "g" flag is soon to be phased out along with the
ability to choose the exact matching scheme. The choice of
matching scheme to use depends highly on the pattern kind and
can done automatically on case by case basis.
Returns: a $(D RegexMatch) object holding engine state after first match.
+/
public auto match(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
return RegexMatch!(Unqual!(typeof(input)),ThompsonMatcher)(input, re);
}
///ditto
public auto match(R, String)(R input, String re)
if(isSomeString!R && isSomeString!String)
{
return RegexMatch!(Unqual!(typeof(input)),ThompsonMatcher)(input, regex(re));
}
public auto match(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
return RegexMatch!(Unqual!(typeof(input)),BacktrackingMatcher!true)(input, re);
}
/++
Find the first (leftmost) slice of the $(D input) that
matches the pattern $(D re). This function picks the most suitable
regular expression engine depending on the pattern properties.
$(D re) parameter can be one of three types:
$(UL
$(LI Plain string, in which case it's compiled to bytecode before matching. )
$(LI Regex!char (wchar/dchar) that contains a pattern in the form of
compiled bytecode. )
$(LI StaticRegex!char (wchar/dchar) that contains a pattern in the form of
compiled native machine code. )
)
Returns:
$(LREF Captures) containing the extent of a match together with all submatches
if there was a match, otherwise an empty $(LREF Captures) object.
+/
public auto matchFirst(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
return matchOnce!ThompsonMatcher(input, re);
}
///ditto
public auto matchFirst(R, String)(R input, String re)
if(isSomeString!R && isSomeString!String)
{
return matchOnce!ThompsonMatcher(input, regex(re));
}
public auto matchFirst(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
return matchOnce!(BacktrackingMatcher!true)(input, re);
}
/++
Initiate a search for all non-overlapping matches to the pattern $(D re)
in the given $(D input). The result is a lazy range of matches generated
as they are encountered in the input going left to right.
This function picks the most suitable regular expression engine
depending on the pattern properties.
$(D re) parameter can be one of three types:
$(UL
$(LI Plain string, in which case it's compiled to bytecode before matching. )
$(LI Regex!char (wchar/dchar) that contains a pattern in the form of
compiled bytecode. )
$(LI StaticRegex!char (wchar/dchar) that contains a pattern in the form of
compiled native machine code. )
)
Returns:
$(LREF RegexMatch) object that represents matcher state
after the first match was found or an empty one if not present.
+/
public auto matchAll(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
return matchMany!ThompsonMatcher(input, re);
}
///ditto
public auto matchAll(R, String)(R input, String re)
if(isSomeString!R && isSomeString!String)
{
return matchMany!ThompsonMatcher(input, regex(re));
}
public auto matchAll(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
return matchMany!(BacktrackingMatcher!true)(input, re);
}
// another set of tests just to cover the new API
@system unittest
{
foreach(String; TypeTuple!(string, wstring, const(dchar)[]))
{
auto str1 = "blah-bleh".to!String();
auto pat1 = "bl[ae]h".to!String();
auto mf = matchFirst(str1, pat1);
assert(mf.equal(["blah".to!String()]));
auto mAll = matchAll(str1, pat1);
assert(mAll.equal!((a,b) => a.equal(b))
([["blah".to!String()], ["bleh".to!String()]]));
auto str2 = "1/03/12 - 3/03/12".to!String();
auto pat2 = regex(r"(\d+)/(\d+)/(\d+)".to!String());
auto mf2 = matchFirst(str2, pat2);
assert(mf2.equal(["1/03/12", "1", "03", "12"].map!(to!String)()));
auto mAll2 = matchAll(str2, pat2);
assert(mAll2.front.equal(mf2));
mAll2.popFront();
assert(mAll2.front.equal(["3/03/12", "3", "03", "12"].map!(to!String)()));
mf2.popFrontN(3);
assert(mf2.equal(["12".to!String()]));
auto ctPat = ctRegex!(`(?P<Quot>\d+)/(?P<Denom>\d+)`.to!String());
auto str = "2 + 34/56 - 6/1".to!String();
auto cmf = matchFirst(str, ctPat);
assert(cmf.equal(["34/56", "34", "56"].map!(to!String)()));
assert(cmf["Quot"] == "34".to!String());
assert(cmf["Denom"] == "56".to!String());
auto cmAll = matchAll(str, ctPat);
assert(cmAll.front.equal(cmf));
cmAll.popFront();
assert(cmAll.front.equal(["6/1", "6", "1"].map!(to!String)()));
}
}
/++
Start matching of $(D input) to regex pattern $(D re),
using traditional $(LUCKY backtracking) matching scheme.
The use of this function is $(RED discouraged) - use either of
$(LREF matchAll) or $(LREF matchFirst).
Delegating the kind of operation
to "g" flag is soon to be phased out along with the
ability to choose the exact matching scheme. The choice of
matching scheme to use depends highly on the pattern kind and
can done automatically on case by case basis.
Returns: a $(D RegexMatch) object holding engine
state after first match.
+/
public auto bmatch(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == Regex!(BasicElementOf!R)))
{
return RegexMatch!(Unqual!(typeof(input)), BacktrackingMatcher!false)(input, re);
}
///ditto
public auto bmatch(R, String)(R input, String re)
if(isSomeString!R && isSomeString!String)
{
return RegexMatch!(Unqual!(typeof(input)), BacktrackingMatcher!false)(input, regex(re));
}
public auto bmatch(R, RegEx)(R input, RegEx re)
if(isSomeString!R && is(RegEx == StaticRegex!(BasicElementOf!R)))
{
return RegexMatch!(Unqual!(typeof(input)),BacktrackingMatcher!true)(input, re);
}
enum isReplaceFunctor(alias fun, R) =
__traits(compiles, (Captures!R c) { fun(c); });
// the lowest level - just stuff replacements into the sink
private @trusted void replaceCapturesInto(alias output, Sink, R, T)
(ref Sink sink, R input, T captures)
if(isOutputRange!(Sink, dchar) && isSomeString!R)
{
sink.put(captures.pre);
// a hack to get around bogus errors, should be simply output(captures, sink)
// "is a nested function and cannot be accessed from"
static if(isReplaceFunctor!(output, R))
sink.put(output(captures)); //"mutator" type of function
else
output(captures, sink); //"output" type of function
sink.put(captures.post);
}
// ditto for a range of captures
private void replaceMatchesInto(alias output, Sink, R, T)
(ref Sink sink, R input, T matches)
if(isOutputRange!(Sink, dchar) && isSomeString!R)
{
size_t offset = 0;
foreach(cap; matches)
{
sink.put(cap.pre[offset .. $]);
// same hack, see replaceCapturesInto
static if(isReplaceFunctor!(output, R))
sink.put(output(cap)); //"mutator" type of function
else
output(cap, sink); //"output" type of function
offset = cap.pre.length + cap.hit.length;
}
sink.put(input[offset .. $]);
}
// a general skeleton of replaceFirst
private R replaceFirstWith(alias output, R, RegEx)(R input, RegEx re)
if(isSomeString!R && isRegexFor!(RegEx, R))
{
auto data = matchFirst(input, re);
if(data.empty)
return input;
auto app = appender!(R)();
replaceCapturesInto!output(app, input, data);
return app.data;
}
// ditto for replaceAll
// the method parameter allows old API to ride on the back of the new one
private R replaceAllWith(alias output,
alias method=matchAll, R, RegEx)(R input, RegEx re)
if(isSomeString!R && isRegexFor!(RegEx, R))
{
auto matches = method(input, re); //inout(C)[] fails
if(matches.empty)
return input;
auto app = appender!(R)();
replaceMatchesInto!output(app, input, matches);
return app.data;
}
/++
Construct a new string from $(D input) by replacing the first match with
a string generated from it according to the $(D format) specifier.
To replace all matches use $(LREF replaceAll).
Params:
input = string to search
re = compiled regular expression to use
format = format string to generate replacements from,
see $(S_LINK Replace format string, the format string).
Returns:
A string of the same type with the first match (if any) replaced.
If no match is found returns the input string itself.
Example:
---
assert(replaceFirst("noon", regex("n"), "[$&]") == "[n]oon");
---
+/
public R replaceFirst(R, C, RegEx)(R input, RegEx re, const(C)[] format)
if(isSomeString!R && is(C : dchar) && isRegexFor!(RegEx, R))
{
return replaceFirstWith!((m, sink) => replaceFmt(format, m, sink))(input, re);
}
/++
This is a general replacement tool that construct a new string by replacing
matches of pattern $(D re) in the $(D input). Unlike the other overload
there is no format string instead captures are passed to
to a user-defined functor $(D fun) that returns a new string
to use as replacement.
This version replaces the first match in $(D input),
see $(LREF replaceAll) to replace the all of the matches.
Returns:
A new string of the same type as $(D input) with all matches
replaced by return values of $(D fun). If no matches found
returns the $(D input) itself.
Example:
---
string list = "#21 out of 46";
string newList = replaceFirst!(cap => to!string(to!int(cap.hit)+1))
(list, regex(`[0-9]+`));
assert(newList == "#22 out of 46");
---
+/
public R replaceFirst(alias fun, R, RegEx)(R input, RegEx re)
if(isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceFirstWith!((m, sink) => sink.put(fun(m)))(input, re);
}
/++
A variation on $(LREF replaceFirst) that instead of allocating a new string
on each call outputs the result piece-wise to the $(D sink). In particular
this enables efficient construction of a final output incrementally.
Like in $(LREF replaceFirst) family of functions there is an overload
for the substitution guided by the $(D format) string
and the one with the user defined callback.
Example:
---
import std.array;
string m1 = "first message\n";
string m2 = "second message\n";
auto result = appender!string();
replaceFirstInto(result, m1, regex(`([a-z]+) message`), "$1");
//equivalent of the above with user-defined callback
replaceFirstInto!(cap=>cap[1])(result, m2, regex(`([a-z]+) message`));
assert(result.data == "first\nsecond\n");
---
+/
public @trusted void replaceFirstInto(Sink, R, C, RegEx)
(ref Sink sink, R input, RegEx re, const(C)[] format)
if(isOutputRange!(Sink, dchar) && isSomeString!R
&& is(C : dchar) && isRegexFor!(RegEx, R))
{
replaceCapturesInto!((m, sink) => replaceFmt(format, m, sink))
(sink, input, matchFirst(input, re));
}
///ditto
public @trusted void replaceFirstInto(alias fun, Sink, R, RegEx)
(Sink sink, R input, RegEx re)
if(isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
{
replaceCapturesInto!fun(sink, input, matchFirst(input, re));
}
//examples for replaceFirst
@system unittest
{
string list = "#21 out of 46";
string newList = replaceFirst!(cap => to!string(to!int(cap.hit)+1))
(list, regex(`[0-9]+`));
assert(newList == "#22 out of 46");
import std.array;
string m1 = "first message\n";
string m2 = "second message\n";
auto result = appender!string();
replaceFirstInto(result, m1, regex(`([a-z]+) message`), "$1");
//equivalent of the above with user-defined callback
replaceFirstInto!(cap=>cap[1])(result, m2, regex(`([a-z]+) message`));
assert(result.data == "first\nsecond\n");
}
/++
Construct a new string from $(D input) by replacing all of the
fragments that match a pattern $(D re) with a string generated
from the match according to the $(D format) specifier.
To replace only the first match use $(LREF replaceFirst).
Params:
input = string to search
re = compiled regular expression to use
format = format string to generate replacements from,
see $(S_LINK Replace format string, the format string).
Returns:
A string of the same type as $(D input) with the all
of the matches (if any) replaced.
If no match is found returns the input string itself.
Example:
---
// Comify a number
auto com = regex(r"(?<=\d)(?=(\d\d\d)+\b)","g");
assert(replaceAll("12000 + 42100 = 54100", com, ",") == "12,000 + 42,100 = 54,100");
---
+/
public @trusted R replaceAll(R, C, RegEx)(R input, RegEx re, const(C)[] format)
if(isSomeString!R && is(C : dchar) && isRegexFor!(RegEx, R))
{
return replaceAllWith!((m, sink) => replaceFmt(format, m, sink))(input, re);
}
/++
This is a general replacement tool that construct a new string by replacing
matches of pattern $(D re) in the $(D input). Unlike the other overload
there is no format string instead captures are passed to
to a user-defined functor $(D fun) that returns a new string
to use as replacement.
This version replaces all of the matches found in $(D input),
see $(LREF replaceFirst) to replace the first match only.
Returns:
A new string of the same type as $(D input) with all matches
replaced by return values of $(D fun). If no matches found
returns the $(D input) itself.
Params:
input = string to search
re = compiled regular expression
fun = delegate to use
Example:
Capitalize the letters 'a' and 'r':
---
string baz(Captures!(string) m)
{
return std.string.toUpper(m.hit);
}
auto s = replaceAll!(baz)("Strap a rocket engine on a chicken.",
regex("[ar]"));
assert(s == "StRAp A Rocket engine on A chicken.");
---
+/
public @trusted R replaceAll(alias fun, R, RegEx)(R input, RegEx re)
if(isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceAllWith!((m, sink) => sink.put(fun(m)))(input, re);
}
/++
A variation on $(LREF replaceAll) that instead of allocating a new string
on each call outputs the result piece-wise to the $(D sink). In particular
this enables efficient construction of a final output incrementally.
As with $(LREF replaceAll) there are 2 overloads - one with a format string,
the other one with a user defined functor.
Example:
---
//swap all 3 letter words and bring it back
string text = "How are you doing?";
auto sink = appender!(char[])();
replaceAllInto!(cap => retro(cap[0]))(sink, text, regex(`\b\w{3}\b`));
auto swapped = sink.data.dup; // make a copy explicitly
assert(swapped == "woH era uoy doing?");
sink.clear();
replaceAllInto!(cap => retro(cap[0]))(sink, swapped, regex(`\b\w{3}\b`));
assert(sink.data == text);
---
+/
public @trusted void replaceAllInto(Sink, R, C, RegEx)
(Sink sink, R input, RegEx re, const(C)[] format)
if(isOutputRange!(Sink, dchar) && isSomeString!R
&& is(C : dchar) && isRegexFor!(RegEx, R))
{
replaceMatchesInto!((m, sink) => replaceFmt(format, m, sink))
(sink, input, matchAll(input, re));
}
///ditto
public @trusted void replaceAllInto(alias fun, Sink, R, RegEx)
(Sink sink, R input, RegEx re)
if(isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
{
replaceMatchesInto!fun(sink, input, matchAll(input, re));
}
// a bit of examples
@system unittest
{
//swap all 3 letter words and bring it back
string text = "How are you doing?";
auto sink = appender!(char[])();
replaceAllInto!(cap => retro(cap[0]))(sink, text, regex(`\b\w{3}\b`));
auto swapped = sink.data.dup; // make a copy explicitly
assert(swapped == "woH era uoy doing?");
sink.clear();
replaceAllInto!(cap => retro(cap[0]))(sink, swapped, regex(`\b\w{3}\b`));
assert(sink.data == text);
}
// exercise all of the replace APIs
@system unittest
{
// try and check first/all simple substitution
foreach(S; TypeTuple!(string, wstring, dstring, char[], wchar[], dchar[]))
{
S s1 = "curt trial".to!S();
S s2 = "round dome".to!S();
S t1F = "court trial".to!S();
S t2F = "hound dome".to!S();
S t1A = "court trial".to!S();
S t2A = "hound home".to!S();
auto re1 = regex("curt".to!S());
auto re2 = regex("[dr]o".to!S());
assert(replaceFirst(s1, re1, "court") == t1F);
assert(replaceFirst(s2, re2, "ho") == t2F);
assert(replaceAll(s1, re1, "court") == t1A);
assert(replaceAll(s2, re2, "ho") == t2A);
auto rep1 = replaceFirst!(cap => cap[0][0]~"o".to!S()~cap[0][1..$])(s1, re1);
assert(rep1 == t1F);
assert(replaceFirst!(cap => "ho".to!S())(s2, re2) == t2F);
auto rep1A = replaceAll!(cap => cap[0][0]~"o".to!S()~cap[0][1..$])(s1, re1);
assert(rep1A == t1A);
assert(replaceAll!(cap => "ho".to!S())(s2, re2) == t2A);
auto sink = appender!S();
replaceFirstInto(sink, s1, re1, "court");
assert(sink.data == t1F);
replaceFirstInto(sink, s2, re2, "ho");
assert(sink.data == t1F~t2F);
replaceAllInto(sink, s1, re1, "court");
assert(sink.data == t1F~t2F~t1A);
replaceAllInto(sink, s2, re2, "ho");
assert(sink.data == t1F~t2F~t1A~t2A);
}
}
/++
Old API for replacement, operation depends on flags of pattern $(D re).
With "g" flag it performs the equivalent of $(LREF replaceAll) otherwise it
works the same as $(LREF replaceFirst).
The use of this function is $(RED discouraged), please use $(LREF replaceAll)
or $(LREF replaceFirst) explicitly.
+/
public R replace(alias scheme = match, R, C, RegEx)(R input, RegEx re, const(C)[] format)
if(isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceAllWith!((m, sink) => replaceFmt(format, m, sink), match)(input, re);
}
///ditto
public R replace(alias fun, R, RegEx)(R input, RegEx re)
if(isSomeString!R && isRegexFor!(RegEx, R))
{
return replaceAllWith!(fun, match)(input, re);
}
//produce replacement string from format using captures for substitution
private void replaceFmt(R, Capt, OutR)
(R format, Capt captures, OutR sink, bool ignoreBadSubs = false)
if(isOutputRange!(OutR, ElementEncodingType!R[]) &&
isOutputRange!(OutR, ElementEncodingType!(Capt.String)[]))
{
enum State { Normal, Dollar }
auto state = State.Normal;
size_t offset;
L_Replace_Loop:
while(!format.empty)
final switch(state)
{
case State.Normal:
for(offset = 0; offset < format.length; offset++)//no decoding
{
if(format[offset] == '$')
{
state = State.Dollar;
sink.put(format[0 .. offset]);
format = format[offset+1 .. $];//ditto
continue L_Replace_Loop;
}
}
sink.put(format[0 .. offset]);
format = format[offset .. $];
break;
case State.Dollar:
if(std.ascii.isDigit(format[0]))
{
uint digit = parse!uint(format);
enforce(ignoreBadSubs || digit < captures.length, text("invalid submatch number ", digit));
if(digit < captures.length)
sink.put(captures[digit]);
}
else if(format[0] == '{')
{
auto x = find!(a => !std.ascii.isAlpha(a))(format[1..$]);
enforce(!x.empty && x[0] == '}', "no matching '}' in replacement format");
auto name = format[1 .. $ - x.length];
format = x[1..$];
enforce(!name.empty, "invalid name in ${...} replacement format");
sink.put(captures[name]);
}
else if(format[0] == '&')
{
sink.put(captures[0]);
format = format[1 .. $];
}
else if(format[0] == '`')
{
sink.put(captures.pre);
format = format[1 .. $];
}
else if(format[0] == '\'')
{
sink.put(captures.post);
format = format[1 .. $];
}
else if(format[0] == '$')
{
sink.put(format[0 .. 1]);
format = format[1 .. $];
}
state = State.Normal;
break;
}
enforce(state == State.Normal, "invalid format string in regex replace");
}
/++
Range that splits a string using a regular expression as a
separator.
Example:
----
auto s1 = ", abc, de, fg, hi, ";
assert(equal(splitter(s1, regex(", *")),
["", "abc", "de", "fg", "hi", ""]));
----
+/
public struct Splitter(Range, alias RegEx = Regex)
if(isSomeString!Range && isRegexFor!(RegEx, Range))
{
private:
Range _input;
size_t _offset;
alias Rx = typeof(match(Range.init,RegEx.init));
Rx _match;
@trusted this(Range input, RegEx separator)
{//@@@BUG@@@ generated opAssign of RegexMatch is not @trusted
_input = input;
separator.flags |= RegexOption.global;
if (_input.empty)
{
//there is nothing to match at all, make _offset > 0
_offset = 1;
}
else
{
_match = Rx(_input, separator);
}
}
public:
auto ref opSlice()
{
return this.save;
}
///Forward range primitives.
@property Range front()
{
assert(!empty && _offset <= _match.pre.length
&& _match.pre.length <= _input.length);
return _input[_offset .. min($, _match.pre.length)];
}
///ditto
@property bool empty()
{
return _offset > _input.length;
}
///ditto
void popFront()
{
assert(!empty);
if (_match.empty)
{
//No more separators, work is done here
_offset = _input.length + 1;
}
else
{
//skip past the separator
_offset = _match.pre.length + _match.hit.length;
_match.popFront();
}
}
///ditto
@property auto save()
{
return this;
}
}
/**
A helper function, creates a $(D Splitter) on range $(D r) separated by regex $(D pat).
Captured subexpressions have no effect on the resulting range.
*/
public Splitter!(Range, RegEx) splitter(Range, RegEx)(Range r, RegEx pat)
if(is(BasicElementOf!Range : dchar) && isRegexFor!(RegEx, Range))
{
return Splitter!(Range, RegEx)(r, pat);
}
///An eager version of $(D splitter) that creates an array with splitted slices of $(D input).
public @trusted String[] split(String, RegEx)(String input, RegEx rx)
if(isSomeString!String && isRegexFor!(RegEx, String))
{
auto a = appender!(String[])();
foreach(e; splitter(input, rx))
a.put(e);
return a.data;
}
///Exception object thrown in case of errors during regex compilation.
public class RegexException : Exception
{
///
@trusted this(string msg, string file = __FILE__, size_t line = __LINE__)
{//@@@BUG@@@ Exception constructor is not @safe
super(msg, file, line);
}
}
//--------------------- TEST SUITE ---------------------------------
version(unittest)
{
@system:
unittest
{//sanity checks
regex("(a|b)*");
regex(`(?:([0-9A-F]+)\.\.([0-9A-F]+)|([0-9A-F]+))\s*;\s*(.*)\s*#`);
regex("abc|edf|ighrg");
auto r1 = regex("abc");
auto r2 = regex("(gylba)");
assert(match("abcdef", r1).hit == "abc");
assert(!match("wida",r2));
assert(bmatch("abcdef", r1).hit == "abc");
assert(!bmatch("wida", r2));
assert(match("abc", "abc".dup));
assert(bmatch("abc", "abc".dup));
Regex!char rc;
assert(rc.empty);
rc = regex("test");
assert(!rc.empty);
}
/* The test vectors in this file are altered from Henry Spencer's regexp
test code. His copyright notice is:
Copyright (c) 1986 by University of Toronto.
Written by Henry Spencer. Not derived from licensed software.
Permission is granted to anyone to use this software for any
purpose on any computer system, and to redistribute it freely,
subject to the following restrictions:
1. The author is not responsible for the consequences of use of
this software, no matter how awful, even if they arise
from defects in it.
2. The origin of this software must not be misrepresented, either
by explicit claim or by omission.
3. Altered versions must be plainly marked as such, and must not
be misrepresented as being the original software.
*/
unittest
{
struct TestVectors
{
string pattern;
string input;
string result;
string format;
string replace;
string flags;
}
enum TestVectors tv[] = [
TestVectors( "a\\b", "a", "y", "$&", "a" ),
TestVectors( "(a)b\\1", "abaab","y", "$&", "aba" ),
TestVectors( "()b\\1", "aaab", "y", "$&", "b" ),
TestVectors( "abc", "abc", "y", "$&", "abc" ),
TestVectors( "abc", "xbc", "n", "-", "-" ),
TestVectors( "abc", "axc", "n", "-", "-" ),
TestVectors( "abc", "abx", "n", "-", "-" ),
TestVectors( "abc", "xabcy","y", "$&", "abc" ),
TestVectors( "abc", "ababc","y", "$&", "abc" ),
TestVectors( "ab*c", "abc", "y", "$&", "abc" ),
TestVectors( "ab*bc", "abc", "y", "$&", "abc" ),
TestVectors( "ab*bc", "abbc", "y", "$&", "abbc" ),
TestVectors( "ab*bc", "abbbbc","y", "$&", "abbbbc" ),
TestVectors( "ab+bc", "abbc", "y", "$&", "abbc" ),
TestVectors( "ab+bc", "abc", "n", "-", "-" ),
TestVectors( "ab+bc", "abq", "n", "-", "-" ),
TestVectors( "ab+bc", "abbbbc","y", "$&", "abbbbc" ),
TestVectors( "ab?bc", "abbc", "y", "$&", "abbc" ),
TestVectors( "ab?bc", "abc", "y", "$&", "abc" ),
TestVectors( "ab?bc", "abbbbc","n", "-", "-" ),
TestVectors( "ab?c", "abc", "y", "$&", "abc" ),
TestVectors( "^abc$", "abc", "y", "$&", "abc" ),
TestVectors( "^abc$", "abcc", "n", "-", "-" ),
TestVectors( "^abc", "abcc", "y", "$&", "abc" ),
TestVectors( "^abc$", "aabc", "n", "-", "-" ),
TestVectors( "abc$", "aabc", "y", "$&", "abc" ),
TestVectors( "^", "abc", "y", "$&", "" ),
TestVectors( "$", "abc", "y", "$&", "" ),
TestVectors( "a.c", "abc", "y", "$&", "abc" ),
TestVectors( "a.c", "axc", "y", "$&", "axc" ),
TestVectors( "a.*c", "axyzc","y", "$&", "axyzc" ),
TestVectors( "a.*c", "axyzd","n", "-", "-" ),
TestVectors( "a[bc]d", "abc", "n", "-", "-" ),
TestVectors( "a[bc]d", "abd", "y", "$&", "abd" ),
TestVectors( "a[b-d]e", "abd", "n", "-", "-" ),
TestVectors( "a[b-d]e", "ace", "y", "$&", "ace" ),
TestVectors( "a[b-d]", "aac", "y", "$&", "ac" ),
TestVectors( "a[-b]", "a-", "y", "$&", "a-" ),
TestVectors( "a[b-]", "a-", "y", "$&", "a-" ),
TestVectors( "a[b-a]", "-", "c", "-", "-" ),
TestVectors( "a[]b", "-", "c", "-", "-" ),
TestVectors( "a[", "-", "c", "-", "-" ),
TestVectors( "a]", "a]", "y", "$&", "a]" ),
TestVectors( "a[\\]]b", "a]b", "y", "$&", "a]b" ),
TestVectors( "a[^bc]d", "aed", "y", "$&", "aed" ),
TestVectors( "a[^bc]d", "abd", "n", "-", "-" ),
TestVectors( "a[^-b]c", "adc", "y", "$&", "adc" ),
TestVectors( "a[^-b]c", "a-c", "n", "-", "-" ),
TestVectors( "a[^\\]b]c", "adc", "y", "$&", "adc" ),
TestVectors( "ab|cd", "abc", "y", "$&", "ab" ),
TestVectors( "ab|cd", "abcd", "y", "$&", "ab" ),
TestVectors( "()ef", "def", "y", "$&-$1", "ef-" ),
TestVectors( "()*", "-", "y", "-", "-" ),
TestVectors( "*a", "-", "c", "-", "-" ),
TestVectors( "^*", "-", "y", "-", "-" ),
TestVectors( "$*", "-", "y", "-", "-" ),
TestVectors( "(*)b", "-", "c", "-", "-" ),
TestVectors( "$b", "b", "n", "-", "-" ),
TestVectors( "a\\", "-", "c", "-", "-" ),
TestVectors( "a\\(b", "a(b", "y", "$&-$1", "a(b-" ),
TestVectors( "a\\(*b", "ab", "y", "$&", "ab" ),
TestVectors( "a\\(*b", "a((b", "y", "$&", "a((b" ),
TestVectors( "a\\\\b", "a\\b", "y", "$&", "a\\b" ),
TestVectors( "abc)", "-", "c", "-", "-" ),
TestVectors( "(abc", "-", "c", "-", "-" ),
TestVectors( "((a))", "abc", "y", "$&-$1-$2", "a-a-a" ),
TestVectors( "(a)b(c)", "abc", "y", "$&-$1-$2", "abc-a-c" ),
TestVectors( "a+b+c", "aabbabc","y", "$&", "abc" ),
TestVectors( "a**", "-", "c", "-", "-" ),
TestVectors( "a*?a", "aa", "y", "$&", "a" ),
TestVectors( "(a*)*", "aaa", "y", "-", "-" ),
TestVectors( "(a*)+", "aaa", "y", "-", "-" ),
TestVectors( "(a|)*", "-", "y", "-", "-" ),
TestVectors( "(a*|b)*", "aabb", "y", "-", "-" ),
TestVectors( "(a|b)*", "ab", "y", "$&-$1", "ab-b" ),
TestVectors( "(a+|b)*", "ab", "y", "$&-$1", "ab-b" ),
TestVectors( "(a+|b)+", "ab", "y", "$&-$1", "ab-b" ),
TestVectors( "(a+|b)?", "ab", "y", "$&-$1", "a-a" ),
TestVectors( "[^ab]*", "cde", "y", "$&", "cde" ),
TestVectors( "(^)*", "-", "y", "-", "-" ),
TestVectors( "(ab|)*", "-", "y", "-", "-" ),
TestVectors( ")(", "-", "c", "-", "-" ),
TestVectors( "", "abc", "y", "$&", "" ),
TestVectors( "abc", "", "n", "-", "-" ),
TestVectors( "a*", "", "y", "$&", "" ),
TestVectors( "([abc])*d", "abbbcd", "y", "$&-$1", "abbbcd-c" ),
TestVectors( "([abc])*bcd", "abcd", "y", "$&-$1", "abcd-a" ),
TestVectors( "a|b|c|d|e", "e", "y", "$&", "e" ),
TestVectors( "(a|b|c|d|e)f", "ef", "y", "$&-$1", "ef-e" ),
TestVectors( "((a*|b))*", "aabb", "y", "-", "-" ),
TestVectors( "abcd*efg", "abcdefg", "y", "$&", "abcdefg" ),
TestVectors( "ab*", "xabyabbbz", "y", "$&", "ab" ),
TestVectors( "ab*", "xayabbbz", "y", "$&", "a" ),
TestVectors( "(ab|cd)e", "abcde", "y", "$&-$1", "cde-cd" ),
TestVectors( "[abhgefdc]ij", "hij", "y", "$&", "hij" ),
TestVectors( "^(ab|cd)e", "abcde", "n", "x$1y", "xy" ),
TestVectors( "(abc|)ef", "abcdef", "y", "$&-$1", "ef-" ),
TestVectors( "(a|b)c*d", "abcd", "y", "$&-$1", "bcd-b" ),
TestVectors( "(ab|ab*)bc", "abc", "y", "$&-$1", "abc-a" ),
TestVectors( "a([bc]*)c*", "abc", "y", "$&-$1", "abc-bc" ),
TestVectors( "a([bc]*)(c*d)", "abcd", "y", "$&-$1-$2", "abcd-bc-d" ),
TestVectors( "a([bc]+)(c*d)", "abcd", "y", "$&-$1-$2", "abcd-bc-d" ),
TestVectors( "a([bc]*)(c+d)", "abcd", "y", "$&-$1-$2", "abcd-b-cd" ),
TestVectors( "a[bcd]*dcdcde", "adcdcde", "y", "$&", "adcdcde" ),
TestVectors( "a[bcd]+dcdcde", "adcdcde", "n", "-", "-" ),
TestVectors( "(ab|a)b*c", "abc", "y", "$&-$1", "abc-ab" ),
TestVectors( "((a)(b)c)(d)", "abcd", "y", "$1-$2-$3-$4", "abc-a-b-d" ),
TestVectors( "[a-zA-Z_][a-zA-Z0-9_]*", "alpha", "y", "$&", "alpha" ),
TestVectors( "^a(bc+|b[eh])g|.h$", "abh", "y", "$&-$1", "bh-" ),
TestVectors( "(bc+d$|ef*g.|h?i(j|k))", "effgz", "y", "$&-$1-$2", "effgz-effgz-" ),
TestVectors( "(bc+d$|ef*g.|h?i(j|k))", "ij", "y", "$&-$1-$2", "ij-ij-j" ),
TestVectors( "(bc+d$|ef*g.|h?i(j|k))", "effg", "n", "-", "-" ),
TestVectors( "(bc+d$|ef*g.|h?i(j|k))", "bcdd", "n", "-", "-" ),
TestVectors( "(bc+d$|ef*g.|h?i(j|k))", "reffgz", "y", "$&-$1-$2", "effgz-effgz-" ),
TestVectors( "(((((((((a)))))))))", "a", "y", "$&", "a" ),
TestVectors( "multiple words of text", "uh-uh", "n", "-", "-" ),
TestVectors( "multiple words", "multiple words, yeah", "y", "$&", "multiple words" ),
TestVectors( "(.*)c(.*)", "abcde", "y", "$&-$1-$2", "abcde-ab-de" ),
TestVectors( "\\((.*), (.*)\\)", "(a, b)", "y", "($2, $1)", "(b, a)" ),
TestVectors( "abcd", "abcd", "y", "$&-&-$$$&", "abcd-&-$abcd" ),
TestVectors( "a(bc)d", "abcd", "y", "$1-$$1-$$$1", "bc-$1-$bc" ),
TestVectors( "[k]", "ab", "n", "-", "-" ),
TestVectors( "[ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "[ -~ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "[ -~ -~ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "[ -~ -~ -~ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "[ -~ -~ -~ -~ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "[ -~ -~ -~ -~ -~ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "[ -~ -~ -~ -~ -~ -~ -~]*", "abc", "y", "$&", "abc" ),
TestVectors( "a{2}", "candy", "n", "", "" ),
TestVectors( "a{2}", "caandy", "y", "$&", "aa" ),
TestVectors( "a{2}", "caaandy", "y", "$&", "aa" ),
TestVectors( "a{2,}", "candy", "n", "", "" ),
TestVectors( "a{2,}", "caandy", "y", "$&", "aa" ),
TestVectors( "a{2,}", "caaaaaandy", "y", "$&", "aaaaaa" ),
TestVectors( "a{1,3}", "cndy", "n", "", "" ),
TestVectors( "a{1,3}", "candy", "y", "$&", "a" ),
TestVectors( "a{1,3}", "caandy", "y", "$&", "aa" ),
TestVectors( "a{1,3}", "caaaaaandy", "y", "$&", "aaa" ),
TestVectors( "e?le?", "angel", "y", "$&", "el" ),
TestVectors( "e?le?", "angle", "y", "$&", "le" ),
TestVectors( "\\bn\\w", "noonday", "y", "$&", "no" ),
TestVectors( "\\wy\\b", "possibly yesterday", "y", "$&", "ly" ),
TestVectors( "\\w\\Bn", "noonday", "y", "$&", "on" ),
TestVectors( "y\\B\\w", "possibly yesterday", "y", "$&", "ye" ),
TestVectors( "\\cJ", "abc\ndef", "y", "$&", "\n" ),
TestVectors( "\\d", "B2 is", "y", "$&", "2" ),
TestVectors( "\\D", "B2 is", "y", "$&", "B" ),
TestVectors( "\\s\\w*", "foo bar", "y", "$&", " bar" ),
TestVectors( "\\S\\w*", "foo bar", "y", "$&", "foo" ),
TestVectors( "abc", "ababc", "y", "$&", "abc" ),
TestVectors( "apple(,)\\sorange\\1", "apple, orange, cherry, peach", "y", "$&", "apple, orange," ),
TestVectors( "(\\w+)\\s(\\w+)", "John Smith", "y", "$2, $1", "Smith, John" ),
TestVectors( "\\n\\f\\r\\t\\v", "abc\n\f\r\t\vdef", "y", "$&", "\n\f\r\t\v" ),
TestVectors( ".*c", "abcde", "y", "$&", "abc" ),
TestVectors( "^\\w+((;|=)\\w+)+$", "some=host=tld", "y", "$&-$1-$2", "some=host=tld-=tld-=" ),
TestVectors( "^\\w+((\\.|-)\\w+)+$", "some.host.tld", "y", "$&-$1-$2", "some.host.tld-.tld-." ),
TestVectors( "q(a|b)*q", "xxqababqyy", "y", "$&-$1", "qababq-b" ),
TestVectors( "^(a)(b){0,1}(c*)", "abcc", "y", "$1 $2 $3", "a b cc" ),
TestVectors( "^(a)((b){0,1})(c*)", "abcc", "y", "$1 $2 $3", "a b b" ),
TestVectors( "^(a)(b)?(c*)", "abcc", "y", "$1 $2 $3", "a b cc" ),
TestVectors( "^(a)((b)?)(c*)", "abcc", "y", "$1 $2 $3", "a b b" ),
TestVectors( "^(a)(b){0,1}(c*)", "acc", "y", "$1 $2 $3", "a cc" ),
TestVectors( "^(a)((b){0,1})(c*)", "acc", "y", "$1 $2 $3", "a " ),
TestVectors( "^(a)(b)?(c*)", "acc", "y", "$1 $2 $3", "a cc" ),
TestVectors( "^(a)((b)?)(c*)", "acc", "y", "$1 $2 $3", "a " ),
TestVectors( "(?:ab){3}", "_abababc","y", "$&-$1", "ababab-" ),
TestVectors( "(?:a(?:x)?)+", "aaxaxx", "y", "$&-$1-$2", "aaxax--" ),
TestVectors( `\W\w\W`, "aa b!ca", "y", "$&", " b!"),
//more repetitions:
TestVectors( "(?:a{2,4}b{1,3}){1,2}", "aaabaaaabbb", "y", "$&", "aaabaaaabbb" ),
TestVectors( "(?:a{2,4}b{1,3}){1,2}?", "aaabaaaabbb", "y", "$&", "aaab" ),
//groups:
TestVectors( "(abc)|(edf)|(xyz)", "xyz", "y", "$1-$2-$3","--xyz"),
TestVectors( "(?P<q>\\d+)/(?P<d>\\d+)", "2/3", "y", "${d}/${q}", "3/2"),
//set operations:
TestVectors( "[a-z--d-f]", " dfa", "y", "$&", "a"),
TestVectors( "[abc[pq--acq]]{2}", "bqpaca", "y", "$&", "pa"),
TestVectors( "[a-z9&&abc0-9]{3}", "z90a0abc", "y", "$&", "abc"),
TestVectors( "[0-9a-f~~0-5a-z]{2}", "g0a58x", "y", "$&", "8x"),
TestVectors( "[abc[pq]xyz[rs]]{4}", "cqxr", "y", "$&", "cqxr"),
TestVectors( "[abcdf--[ab&&[bcd]][acd]]", "abcdefgh", "y", "$&", "f"),
//unicode blocks & properties:
TestVectors( `\P{Inlatin1suppl ement}`, "\u00c2!", "y", "$&", "!"),
TestVectors( `\p{InLatin-1 Supplement}\p{in-mathematical-operators}\P{Inlatin1suppl ement}`, "\u00c2\u2200\u00c3\u2203.", "y", "$&", "\u00c3\u2203."),
TestVectors( `[-+*/\p{in-mathematical-operators}]{2}`, "a+\u2212", "y", "$&", "+\u2212"),
TestVectors( `\p{Ll}+`, "XabcD", "y", "$&", "abc"),
TestVectors( `\p{Lu}+`, "абвГДЕ", "y", "$&", "ГДЕ"),
TestVectors( `^\p{Currency Symbol}\p{Sc}`, "$₤", "y", "$&", "$₤"),
TestVectors( `\p{Common}\p{Thai}`, "!ฆ", "y", "$&", "!ฆ"),
TestVectors( `[\d\s]*\D`, "12 \t3\U00001680\u0F20_2", "y", "$&", "12 \t3\U00001680\u0F20_"),
TestVectors( `[c-wф]фф`, "ффф", "y", "$&", "ффф"),
//case insensitive:
TestVectors( `^abcdEf$`, "AbCdEF", "y", "$&", "AbCdEF", "i"),
TestVectors( `Русский язык`, "рУсскИй ЯзЫк", "y", "$&", "рУсскИй ЯзЫк", "i"),
TestVectors( `ⒶⒷⓒ` , "ⓐⓑⒸ", "y", "$&", "ⓐⓑⒸ", "i"),
TestVectors( "\U00010400{2}", "\U00010428\U00010400 ", "y", "$&", "\U00010428\U00010400", "i"),
TestVectors( `[adzУ-Я]{4}`, "DzюЯ", "y", "$&", "DzюЯ", "i"),
TestVectors( `\p{L}\p{Lu}{10}`, "абвгдеЖЗИКЛ", "y", "$&", "абвгдеЖЗИКЛ", "i"),
TestVectors( `(?:Dåb){3}`, "DåbDÅBdÅb", "y", "$&", "DåbDÅBdÅb", "i"),
//escapes:
TestVectors( `\u0041\u005a\U00000065\u0001`, "AZe\u0001", "y", "$&", "AZe\u0001"),
TestVectors( `\u`, "", "c", "-", "-"),
TestVectors( `\U`, "", "c", "-", "-"),
TestVectors( `\u003`, "", "c", "-", "-"),
TestVectors( `[\x00-\x7f]{4}`, "\x00\x09ab", "y", "$&", "\x00\x09ab"),
TestVectors( `[\cJ\cK\cA-\cD]{3}\cQ`, "\x01\x0B\x0A\x11", "y", "$&", "\x01\x0B\x0A\x11"),
TestVectors( `\r\n\v\t\f\\`, "\r\n\v\t\f\\", "y", "$&", "\r\n\v\t\f\\"),
TestVectors( `[\u0003\u0001]{2}`, "\u0001\u0003", "y", "$&", "\u0001\u0003"),
TestVectors( `^[\u0020-\u0080\u0001\n-\r]{8}`, "abc\u0001\v\f\r\n", "y", "$&", "abc\u0001\v\f\r\n"),
TestVectors( `\w+\S\w+`, "ab7!44c", "y", "$&", "ab7!44c"),
TestVectors( `\b\w+\b`, " abde4 ", "y", "$&", "abde4"),
TestVectors( `\b\w+\b`, " abde4", "y", "$&", "abde4"),
TestVectors( `\b\w+\b`, "abde4 ", "y", "$&", "abde4"),
TestVectors( `\pL\pS`, "a\u02DA", "y", "$&", "a\u02DA"),
TestVectors( `\pX`, "", "c", "-", "-"),
// ^, $, \b, \B, multiline :
TestVectors( `\r.*?$`, "abc\r\nxy", "y", "$&", "\r\nxy", "sm"),
TestVectors( `^a$^b$`, "a\r\nb\n", "n", "$&", "-", "m"),
TestVectors( `^a$\r\n^b$`,"a\r\nb\n", "y", "$&", "a\r\nb", "m"),
TestVectors( `^$`, "\r\n", "y", "$&", "", "m"),
TestVectors( `^a$\nx$`, "a\nx\u2028","y", "$&", "a\nx", "m"),
TestVectors( `^a$\nx$`, "a\nx\u2029","y", "$&", "a\nx", "m"),
TestVectors( `^a$\nx$`, "a\nx\u0085","y", "$&", "a\nx","m"),
TestVectors( `^x$`, "\u2028x", "y", "$&", "x", "m"),
TestVectors( `^x$`, "\u2029x", "y", "$&", "x", "m"),
TestVectors( `^x$`, "\u0085x", "y", "$&", "x", "m"),
TestVectors( `\b^.`, "ab", "y", "$&", "a"),
TestVectors( `\B^.`, "ab", "n", "-", "-"),
TestVectors( `^ab\Bc\B`, "\r\nabcd", "y", "$&", "abc", "m"),
TestVectors( `^.*$`, "12345678", "y", "$&", "12345678"),
// luckily obtained regression on incremental matching in backtracker
TestVectors( `^(?:(?:([0-9A-F]+)\.\.([0-9A-F]+)|([0-9A-F]+))\s*;\s*([^ ]*)\s*#|# (?:\w|_)+=((?:\w|_)+))`,
"0020 ; White_Space # ", "y", "$1-$2-$3", "--0020"),
//lookahead
TestVectors( "(foo.)(?=(bar))", "foobar foodbar", "y", "$&-$1-$2", "food-food-bar" ),
TestVectors( `\b(\d+)[a-z](?=\1)`, "123a123", "y", "$&-$1", "123a-123" ),
TestVectors( `\$(?!\d{3})\w+`, "$123 $abc", "y", "$&", "$abc"),
TestVectors( `(abc)(?=(ed(f))\3)`, "abcedff", "y", "-", "-"),
TestVectors( `\b[A-Za-z0-9.]+(?=(@(?!gmail)))`, "a@gmail,x@com", "y", "$&-$1", "x-@"),
TestVectors( `x()(abc)(?=(d)(e)(f)\2)`, "xabcdefabc", "y", "$&", "xabc"),
TestVectors( `x()(abc)(?=(d)(e)(f)()\3\4\5)`, "xabcdefdef", "y", "$&", "xabc"),
//lookback
TestVectors( `(?<=(ab))\d`, "12ba3ab4", "y", "$&-$1", "4-ab", "i"),
TestVectors( `\w(?<!\d)\w`, "123ab24", "y", "$&", "ab"),
TestVectors( `(?<=Dåb)x\w`, "DåbDÅBxdÅb", "y", "$&", "xd", "i"),
TestVectors( `(?<=(ab*c))x`, "abbbbcxac", "y", "$&-$1", "x-abbbbc"),
TestVectors( `(?<=(ab*?c))x`, "abbbbcxac", "y", "$&-$1", "x-abbbbc"),
TestVectors( `(?<=(a.*?c))x`, "ababbcxac", "y", "$&-$1", "x-abbc"),
TestVectors( `(?<=(a{2,4}b{1,3}))x`, "yyaaaabx", "y", "$&-$1", "x-aaaab"),
TestVectors( `(?<=((?:a{2,4}b{1,3}){1,2}))x`, "aabbbaaaabx", "y", "$&-$1", "x-aabbbaaaab"),
TestVectors( `(?<=((?:a{2,4}b{1,3}){1,2}?))x`, "aabbbaaaabx", "y", "$&-$1", "x-aaaab"),
TestVectors( `(?<=(abc|def|aef))x`, "abcx", "y", "$&-$1", "x-abc"),
TestVectors( `(?<=(abc|def|aef))x`, "aefx", "y", "$&-$1", "x-aef"),
TestVectors( `(?<=(abc|dabc))(x)`, "dabcx", "y", "$&-$1-$2", "x-abc-x"),
TestVectors( `(?<=(|abc))x`, "dabcx", "y", "$&-$1", "x-"),
TestVectors( `(?<=((ab|da)*))x`, "abdaabx", "y", "$&-$2-$1", "x-ab-abdaab"),
TestVectors( `a(?<=(ba(?<=(aba)(?<=aaba))))`, "aabaa", "y", "$&-$1-$2", "a-ba-aba"),
TestVectors( `.(?<!b).`, "bax", "y", "$&", "ax"),
TestVectors( `(?<=b(?<!ab)).`, "abbx", "y", "$&", "x"),
TestVectors( `(?<=\.|[!?]+)X`, "Hey?!X", "y", "$&", "X"),
TestVectors( `(?<=\.|[!?]+)a{3}`, ".Nope.aaaX", "y", "$&", "aaa"),
//mixed lookaround
TestVectors( `a(?<=a(?=b))b`, "ab", "y", "$&", "ab"),
TestVectors( `a(?<=a(?!b))c`, "ac", "y", "$&", "ac"),
];
string produceExpected(M,String)(auto ref M m, String fmt)
{
auto app = appender!(String)();
replaceFmt(fmt, m.captures, app, true);
return app.data;
}
void run_tests(alias matchFn)()
{
int i;
foreach(Char; TypeTuple!( char, wchar, dchar))
{
alias String = immutable(Char)[];
String produceExpected(M,Range)(auto ref M m, Range fmt)
{
auto app = appender!(String)();
replaceFmt(fmt, m.captures, app, true);
return app.data;
}
Regex!(Char) r;
foreach(a, tvd; tv)
{
uint c = tvd.result[0];
debug(std_regex_test) writeln(" Test #", a, " pattern: ", tvd.pattern, " with Char = ", Char.stringof);
try
{
i = 1;
r = regex(to!(String)(tvd.pattern), tvd.flags);
}
catch (RegexException e)
{
i = 0;
debug(std_regex_test) writeln(e.msg);
}
assert((c == 'c') ? !i : i, "failed to compile pattern "~tvd.pattern);
if(c != 'c')
{
auto m = matchFn(to!(String)(tvd.input), r);
i = !m.empty;
assert((c == 'y') ? i : !i, text(matchFn.stringof ~": failed to match pattern #", a ,": ", tvd.pattern));
if(c == 'y')
{
auto result = produceExpected(m, to!(String)(tvd.format));
assert(result == to!String(tvd.replace),
text(matchFn.stringof ~": mismatch pattern #", a, ": ", tvd.pattern," expected: ",
tvd.replace, " vs ", result));
}
}
}
}
debug(std_regex_test) writeln("!!! FReD bulk test done "~matchFn.stringof~" !!!");
}
void ct_tests()
{
version(std_regex_ct1)
{
pragma(msg, "Testing 1st part of ctRegex");
alias Tests = Sequence!(0, 90);
}
else version(std_regex_ct2)
{
pragma(msg, "Testing 2nd part of ctRegex");
alias Tests = Sequence!(90, 165);
}
else version(std_regex_ct3)
{
pragma(msg, "Testing 3rd part of ctRegex");
alias Tests = Sequence!(185, 220);
}
else version(std_regex_ct4)
{
pragma(msg, "Testing 4th part of ctRegex");
alias Tests = Sequence!(220, tv.length);
}
else
alias Tests = TypeTuple!(Sequence!(0, 30), Sequence!(235, tv.length-5));
foreach(a, v; Tests)
{
enum tvd = tv[v];
static if(tvd.result == "c")
{
static assert(!__traits(compiles, (){
enum r = regex(tvd.pattern, tvd.flags);
}), "errornously compiles regex pattern: " ~ tvd.pattern);
}
else
{
//BUG: tv[v] is fine but tvd is not known at compile time?!
enum r = ctRegex!(tv[v].pattern, tv[v].flags);
auto nr = regex(tvd.pattern, tvd.flags);
assert(equal(r.ir, nr.ir),
text("!C-T regex! failed to compile pattern #", a ,": ", tvd.pattern));
auto m = match(tvd.input, r);
auto c = tvd.result[0];
bool ok = (c == 'y') ^ m.empty;
assert(ok, text("ctRegex: failed to match pattern #",
a ,": ", tvd.pattern));
if(c == 'y')
{
import std.stdio;
auto result = produceExpected(m, tvd.format);
if(result != tvd.replace)
writeln("ctRegex mismatch pattern #", a, ": ", tvd.pattern," expected: ",
tvd.replace, " vs ", result);
}
}
}
debug(std_regex_test) writeln("!!! FReD C-T test done !!!");
}
ct_tests();
run_tests!bmatch(); //backtracker
run_tests!match(); //thompson VM
}
unittest
{
auto cr = ctRegex!("abc");
assert(bmatch("abc",cr).hit == "abc");
auto cr2 = ctRegex!("ab*c");
assert(bmatch("abbbbc",cr2).hit == "abbbbc");
auto cr3 = ctRegex!("^abc$");
assert(bmatch("abc",cr3).hit == "abc");
auto cr4 = ctRegex!(`\b(a\B[a-z]b)\b`);
assert(array(match("azb",cr4).captures) == ["azb", "azb"]);
auto cr5 = ctRegex!("(?:a{2,4}b{1,3}){1,2}");
assert(bmatch("aaabaaaabbb", cr5).hit == "aaabaaaabbb");
auto cr6 = ctRegex!("(?:a{2,4}b{1,3}){1,2}?"w);
assert(bmatch("aaabaaaabbb"w, cr6).hit == "aaab"w);
auto cr7 = ctRegex!(`\r.*?$`,"sm");
assert(bmatch("abc\r\nxy", cr7).hit == "\r\nxy");
auto greed = ctRegex!("<packet.*?/packet>");
assert(bmatch("<packet>text</packet><packet>text</packet>", greed).hit
== "<packet>text</packet>");
auto cr8 = ctRegex!("^(a)(b)?(c*)");
auto m8 = bmatch("abcc",cr8);
assert(m8);
assert(m8.captures[1] == "a");
assert(m8.captures[2] == "b");
assert(m8.captures[3] == "cc");
auto cr9 = ctRegex!("q(a|b)*q");
auto m9 = match("xxqababqyy",cr9);
assert(m9);
assert(equal(bmatch("xxqababqyy",cr9).captures, ["qababq", "b"]));
auto rtr = regex("a|b|c");
enum ctr = regex("a|b|c");
assert(equal(rtr.ir,ctr.ir));
//CTFE parser BUG is triggered by group
//in the middle of alternation (at least not first and not last)
enum testCT = regex(`abc|(edf)|xyz`);
auto testRT = regex(`abc|(edf)|xyz`);
assert(equal(testCT.ir,testRT.ir));
}
unittest
{
enum cx = ctRegex!"(A|B|C)";
auto mx = match("B",cx);
assert(mx);
assert(equal(mx.captures, [ "B", "B"]));
enum cx2 = ctRegex!"(A|B)*";
assert(match("BAAA",cx2));
enum cx3 = ctRegex!("a{3,4}","i");
auto mx3 = match("AaA",cx3);
assert(mx3);
assert(mx3.captures[0] == "AaA");
enum cx4 = ctRegex!(`^a{3,4}?[a-zA-Z0-9~]{1,2}`,"i");
auto mx4 = match("aaaabc", cx4);
assert(mx4);
assert(mx4.captures[0] == "aaaab");
auto cr8 = ctRegex!("(a)(b)?(c*)");
auto m8 = bmatch("abcc",cr8);
assert(m8);
assert(m8.captures[1] == "a");
assert(m8.captures[2] == "b");
assert(m8.captures[3] == "cc");
auto cr9 = ctRegex!(".*$", "gm");
auto m9 = match("First\rSecond", cr9);
assert(m9);
assert(equal(map!"a.hit"(m9), ["First", "", "Second"]));
}
unittest
{
//global matching
void test_body(alias matchFn)()
{
string s = "a quick brown fox jumps over a lazy dog";
auto r1 = regex("\\b[a-z]+\\b","g");
string[] test;
foreach(m; matchFn(s, r1))
test ~= m.hit;
assert(equal(test, [ "a", "quick", "brown", "fox", "jumps", "over", "a", "lazy", "dog"]));
auto free_reg = regex(`
abc
\s+
"
(
[^"]+
| \\ "
)+
"
z
`, "x");
auto m = match(`abc "quoted string with \" inside"z`,free_reg);
assert(m);
string mails = " hey@you.com no@spam.net ";
auto rm = regex(`@(?<=\S+@)\S+`,"g");
assert(equal(map!"a[0]"(matchFn(mails, rm)), ["@you.com", "@spam.net"]));
auto m2 = matchFn("First line\nSecond line",regex(".*$","gm"));
assert(equal(map!"a[0]"(m2), ["First line", "", "Second line"]));
auto m2a = matchFn("First line\nSecond line",regex(".+$","gm"));
assert(equal(map!"a[0]"(m2a), ["First line", "Second line"]));
auto m2b = matchFn("First line\nSecond line",regex(".+?$","gm"));
assert(equal(map!"a[0]"(m2b), ["First line", "Second line"]));
debug(std_regex_test) writeln("!!! FReD FLAGS test done "~matchFn.stringof~" !!!");
}
test_body!bmatch();
test_body!match();
}
//tests for accumulated std.regex issues and other regressions
unittest
{
void test_body(alias matchFn)()
{
//issue 5857
//matching goes out of control if ... in (...){x} has .*/.+
auto c = matchFn("axxxzayyyyyzd",regex("(a.*z){2}d")).captures;
assert(c[0] == "axxxzayyyyyzd");
assert(c[1] == "ayyyyyz");
auto c2 = matchFn("axxxayyyyyd",regex("(a.*){2}d")).captures;
assert(c2[0] == "axxxayyyyyd");
assert(c2[1] == "ayyyyy");
//issue 2108
//greedy vs non-greedy
auto nogreed = regex("<packet.*?/packet>");
assert(matchFn("<packet>text</packet><packet>text</packet>", nogreed).hit
== "<packet>text</packet>");
auto greed = regex("<packet.*/packet>");
assert(matchFn("<packet>text</packet><packet>text</packet>", greed).hit
== "<packet>text</packet><packet>text</packet>");
//issue 4574
//empty successful match still advances the input
string[] pres, posts, hits;
foreach(m; matchFn("abcabc", regex("","g"))) {
pres ~= m.pre;
posts ~= m.post;
assert(m.hit.empty);
}
auto heads = [
"abcabc",
"abcab",
"abca",
"abc",
"ab",
"a",
""
];
auto tails = [
"abcabc",
"bcabc",
"cabc",
"abc",
"bc",
"c",
""
];
assert(pres == array(retro(heads)));
assert(posts == tails);
//issue 6076
//regression on .*
auto re = regex("c.*|d");
auto m = matchFn("mm", re);
assert(!m);
debug(std_regex_test) writeln("!!! FReD REGRESSION test done "~matchFn.stringof~" !!!");
auto rprealloc = regex(`((.){5}.{1,10}){5}`);
auto arr = array(repeat('0',100));
auto m2 = matchFn(arr, rprealloc);
assert(m2);
assert(collectException(
regex(r"^(import|file|binary|config)\s+([^\(]+)\(?([^\)]*)\)?\s*$")
) is null);
foreach(ch; [Escapables])
{
assert(match(to!string(ch),regex(`[\`~ch~`]`)));
assert(!match(to!string(ch),regex(`[^\`~ch~`]`)));
assert(match(to!string(ch),regex(`[\`~ch~`-\`~ch~`]`)));
}
//bugzilla 7718
string strcmd = "./myApp.rb -os OSX -path \"/GIT/Ruby Apps/sec\" -conf 'notimer'";
auto reStrCmd = regex (`(".*")|('.*')`, "g");
assert(equal(map!"a[0]"(matchFn(strcmd, reStrCmd)),
[`"/GIT/Ruby Apps/sec"`, `'notimer'`]));
}
test_body!bmatch();
test_body!match();
}
// tests for replace
unittest
{
void test(alias matchFn)()
{
import std.string : toUpper;
foreach(i, v; TypeTuple!(string, wstring, dstring))
{
auto baz(Cap)(Cap m)
if (is(Cap == Captures!(Cap.String)))
{
return std.string.toUpper(m.hit);
}
alias String = v;
assert(std.regex.replace!(matchFn)(to!String("ark rapacity"), regex(to!String("r")), to!String("c"))
== to!String("ack rapacity"));
assert(std.regex.replace!(matchFn)(to!String("ark rapacity"), regex(to!String("r"), "g"), to!String("c"))
== to!String("ack capacity"));
assert(std.regex.replace!(matchFn)(to!String("noon"), regex(to!String("^n")), to!String("[$&]"))
== to!String("[n]oon"));
assert(std.regex.replace!(matchFn)(to!String("test1 test2"), regex(to!String(`\w+`),"g"), to!String("$`:$'"))
== to!String(": test2 test1 :"));
auto s = std.regex.replace!(baz!(Captures!(String)))(to!String("Strap a rocket engine on a chicken."),
regex(to!String("[ar]"), "g"));
assert(s == "StRAp A Rocket engine on A chicken.");
}
debug(std_regex_test) writeln("!!! Replace test done "~matchFn.stringof~" !!!");
}
test!(bmatch)();
test!(match)();
}
// tests for splitter
unittest
{
auto s1 = ", abc, de, fg, hi, ";
auto sp1 = splitter(s1, regex(", *"));
auto w1 = ["", "abc", "de", "fg", "hi", ""];
assert(equal(sp1, w1));
auto s2 = ", abc, de, fg, hi";
auto sp2 = splitter(s2, regex(", *"));
auto w2 = ["", "abc", "de", "fg", "hi"];
uint cnt;
foreach(e; sp2) {
assert(w2[cnt++] == e);
}
assert(equal(sp2, w2));
}
unittest
{
char[] s1 = ", abc, de, fg, hi, ".dup;
auto sp2 = splitter(s1, regex(", *"));
}
unittest
{
auto s1 = ", abc, de, fg, hi, ";
auto w1 = ["", "abc", "de", "fg", "hi", ""];
assert(equal(split(s1, regex(", *")), w1[]));
}
unittest
{ // bugzilla 7141
string pattern = `[a\--b]`;
assert(match("-", pattern));
assert(match("b", pattern));
string pattern2 = `[&-z]`;
assert(match("b", pattern2));
}
unittest
{//bugzilla 7111
assert(match("", regex("^")));
}
unittest
{//bugzilla 7300
assert(!match("a"d, "aa"d));
}
unittest
{//bugzilla 7674
assert("1234".replace(regex("^"), "$$") == "$1234");
assert("hello?".replace(regex(r"\?", "g"), r"\?") == r"hello\?");
assert("hello?".replace(regex(r"\?", "g"), r"\\?") != r"hello\?");
}
unittest
{// bugzilla 7679
foreach(S; TypeTuple!(string, wstring, dstring))
{
enum re = ctRegex!(to!S(r"\."));
auto str = to!S("a.b");
assert(equal(std.regex.splitter(str, re), [to!S("a"), to!S("b")]));
assert(split(str, re) == [to!S("a"), to!S("b")]);
}
}
unittest
{//bugzilla 8203
string data = "
NAME = XPAW01_STA:STATION
NAME = XPAW01_STA
";
auto uniFileOld = data;
auto r = regex(
r"^NAME = (?P<comp>[a-zA-Z0-9_]+):*(?P<blk>[a-zA-Z0-9_]*)","gm");
auto uniCapturesNew = match(uniFileOld, r);
for(int i = 0; i < 20; i++)
foreach (matchNew; uniCapturesNew) {}
//a second issue with same symptoms
auto r2 = regex(`([а-яА-Я\-_]+\s*)+(?<=[\s\.,\^])`);
match("аллея Театральная", r2);
}
unittest
{// bugzilla 8637 purity of enforce
auto m = match("hello world", regex("world"));
enforce(m);
}
// bugzilla 8725
unittest
{
static italic = regex( r"\*
(?!\s+)
(.*?)
(?!\s+)
\*", "gx" );
string input = "this * is* interesting, *very* interesting";
assert(replace(input, italic, "<i>$1</i>") ==
"this * is* interesting, <i>very</i> interesting");
}
// bugzilla 8349
unittest
{
enum peakRegexStr = r"\>(wgEncode.*Tfbs.*\.(?:narrow)|(?:broad)Peak.gz)</a>";
enum peakRegex = ctRegex!(peakRegexStr);
//note that the regex pattern itself is probably bogus
assert(match(r"\>wgEncode-blah-Tfbs.narrow</a>", peakRegex));
}
// bugzilla 9211
unittest
{
auto rx_1 = regex(r"^(\w)*(\d)");
auto m = match("1234", rx_1);
assert(equal(m.front, ["1234", "3", "4"]));
auto rx_2 = regex(r"^([0-9])*(\d)");
auto m2 = match("1234", rx_2);
assert(equal(m2.front, ["1234", "3", "4"]));
}
// bugzilla 9280
unittest
{
string tomatch = "a!b@c";
static r = regex(r"^(?P<nick>.*?)!(?P<ident>.*?)@(?P<host>.*?)$");
auto nm = match(tomatch, r);
assert(nm);
auto c = nm.captures;
assert(c[1] == "a");
assert(c["nick"] == "a");
}
// bugzilla 9579
unittest
{
char[] input = ['a', 'b', 'c'];
string format = "($1)";
// used to give a compile error:
auto re = regex(`(a)`, "g");
auto r = replace(input, re, format);
assert(r == "(a)bc");
}
// bugzilla 9634
unittest
{
auto re = ctRegex!"(?:a+)";
assert(match("aaaa", re).hit == "aaaa");
}
// bugzilla 10913
unittest
{
@system static string foo(const(char)[] s)
{
return s.dup;
}
@safe static string bar(const(char)[] s)
{
return s.dup;
}
() @system {
replace!((a) => foo(a.hit))("blah", regex(`a`));
}();
() @safe {
replace!((a) => bar(a.hit))("blah", regex(`a`));
}();
}
// bugzilla 11262
unittest
{
enum reg = ctRegex!(r",", "g");
auto str = "This,List";
str = str.replace(reg, "-");
assert(str == "This-List");
}
// bugzilla 11775
unittest
{
assert(collectException(regex("a{1,0}")));
}
// bugzilla 11839
unittest
{
assert(regex(`(?P<var1>\w+)`).namedCaptures.equal(["var1"]));
assert(collectException(regex(`(?P<1>\w+)`)));
assert(regex(`(?P<v1>\w+)`).namedCaptures.equal(["v1"]));
assert(regex(`(?P<__>\w+)`).namedCaptures.equal(["__"]));
assert(regex(`(?P<я>\w+)`).namedCaptures.equal(["я"]));
}
}//version(unittest)
|
D
|
//Written in the D programming language
/++
Module containing Date/Time functionality.
This module provides:
$(UL
$(LI Types to represent points in time: $(LREF SysTime), $(LREF Date),
$(LREF TimeOfDay), and $(LREF2 .DateTime, DateTime).)
$(LI Types to represent intervals of time.)
$(LI Types to represent ranges over intervals of time.)
$(LI Types to represent time zones (used by $(LREF SysTime)).)
$(LI A platform-independent, high precision stopwatch type:
$(LREF StopWatch))
$(LI Benchmarking functions.)
$(LI Various helper functions.)
)
Closely related to std.datetime is <a href="core_time.html">$(D core.time)</a>,
and some of the time types used in std.datetime come from there - such as
$(CXREF time, Duration), $(CXREF time, TickDuration), and
$(CXREF time, FracSec).
core.time is publically imported into std.datetime, it isn't necessary
to import it separately.
Three of the main concepts used in this module are time points, time
durations, and time intervals.
A time point is a specific point in time. e.g. January 5th, 2010
or 5:00.
A time duration is a length of time with units. e.g. 5 days or 231 seconds.
A time interval indicates a period of time associated with a fixed point in
time. It is either two time points associated with each other,
indicating the time starting at the first point up to, but not including,
the second point - e.g. [January 5th, 2010 - March 10th, 2010$(RPAREN) - or
it is a time point and a time duration associated with one another. e.g.
January 5th, 2010 and 5 days, indicating [January 5th, 2010 -
January 10th, 2010$(RPAREN).
Various arithmetic operations are supported between time points and
durations (e.g. the difference between two time points is a time duration),
and ranges can be gotten from time intervals, so range-based operations may
be done on a series of time points.
The types that the typical user is most likely to be interested in are
$(LREF Date) (if they want dates but don't care about time), $(LREF DateTime)
(if they want dates and times but don't care about time zones), $(LREF SysTime)
(if they want the date and time from the OS and/or do care about time
zones), and StopWatch (a platform-independent, high precision stop watch).
$(LREF Date) and $(LREF DateTime) are optimized for calendar-based operations,
while $(LREF SysTime) is designed for dealing with time from the OS. Check out
their specific documentation for more details.
To get the current time, use $(LREF2 .Clock.currTime, Clock.currTime).
It will return the current
time as a $(LREF SysTime). To print it, $(D toString) is
sufficient, but if using $(D toISOString), $(D toISOExtString), or
$(D toSimpleString), use the corresponding $(D fromISOString),
$(D fromISOExtString), or $(D fromSimpleString) to create a
$(LREF SysTime) from the string.
--------------------
auto currentTime = Clock.currTime();
auto timeString = currentTime.toISOExtString();
auto restoredTime = SysTime.fromISOExtString(timeString);
--------------------
Various functions take a string (or strings) to represent a unit of time
(e.g. $(D convert!("days", "hours")(numDays))). The valid strings to use
with such functions are $(D "years"), $(D "months"), $(D "weeks"),
$(D "days"), $(D "hours"), $(D "minutes"), $(D "seconds"),
$(D "msecs") (milliseconds), $(D "usecs") (microseconds),
$(D "hnsecs") (hecto-nanoseconds - i.e. 100 ns), or some subset thereof.
There are a few functions in core.time which take $(D "nsecs"), but because
nothing in std.datetime has precision greater than hnsecs, and very little
in core.time does, no functions in std.datetime accept $(D "nsecs").
To remember which units are abbreviated and which aren't,
all units seconds and greater use their full names, and all
sub-second units are abbreviated (since they'd be rather long if they
weren't).
Note:
$(LREF DateTimeException) is an alias for $(CXREF time, TimeException),
so you don't need to worry about core.time functions and std.datetime
functions throwing different exception types (except in the rare case
that they throw something other than $(CXREF time, TimeException) or
$(LREF DateTimeException)).
See_Also:
<a href="../intro-to-datetime.html">Introduction to std._datetime </a><br>
$(WEB en.wikipedia.org/wiki/ISO_8601, ISO 8601)<br>
$(WEB en.wikipedia.org/wiki/Tz_database,
Wikipedia entry on TZ Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones,
List of Time Zones)<br>
Copyright: Copyright 2010 - 2011
License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Jonathan M Davis and Kato Shoichi
Source: $(PHOBOSSRC std/_datetime.d)
Macros:
LREF2=<a href="#$1">$(D $2)</a>
+/
module std.datetime;
public import core.time;
import core.exception;
import core.stdc.time;
import std.exception;
import std.range.primitives;
import std.traits;
// FIXME
import std.functional; //: unaryFun;
version(Windows)
{
import core.sys.windows.windows;
import core.sys.windows.winsock2;
import std.windows.registry;
}
else version(Posix)
{
import core.sys.posix.stdlib;
import core.sys.posix.sys.time;
}
version(unittest)
{
import std.stdio;
}
unittest
{
initializeTests();
}
//Verify module example.
unittest
{
auto currentTime = Clock.currTime();
auto timeString = currentTime.toISOExtString();
auto restoredTime = SysTime.fromISOExtString(timeString);
}
//Verify Examples for core.time.Duration which couldn't be in core.time.
unittest
{
assert(std.datetime.Date(2010, 9, 7) + dur!"days"(5) ==
std.datetime.Date(2010, 9, 12));
assert(std.datetime.Date(2010, 9, 7) - std.datetime.Date(2010, 10, 3) ==
dur!"days"(-26));
}
//==============================================================================
// Section with public enums and constants.
//==============================================================================
/++
Represents the 12 months of the Gregorian year (January is 1).
+/
enum Month : ubyte { jan = 1, ///
feb, ///
mar, ///
apr, ///
may, ///
jun, ///
jul, ///
aug, ///
sep, ///
oct, ///
nov, ///
dec ///
}
/++
Represents the 7 days of the Gregorian week (Sunday is 0).
+/
enum DayOfWeek : ubyte { sun = 0, ///
mon, ///
tue, ///
wed, ///
thu, ///
fri, ///
sat ///
}
/++
In some date calculations, adding months or years can cause the date to fall
on a day of the month which is not valid (e.g. February 29th 2001 or
June 31st 2000). If overflow is allowed (as is the default), then the month
will be incremented accordingly (so, February 29th 2001 would become
March 1st 2001, and June 31st 2000 would become July 1st 2000). If overflow
is not allowed, then the day will be adjusted to the last valid day in that
month (so, February 29th 2001 would become February 28th 2001 and
June 31st 2000 would become June 30th 2000).
AllowDayOverflow only applies to calculations involving months or years.
+/
enum AllowDayOverflow
{
/// No, don't allow day overflow.
no,
/// Yes, allow day overflow.
yes
}
/++
Indicates a direction in time. One example of its use is $(LREF2 .Interval, Interval)'s
$(LREF expand, expand) function which uses it to indicate whether the interval should
be expanded backwards (into the past), forwards (into the future), or both.
+/
enum Direction
{
/// Backward.
bwd,
/// Forward.
fwd,
/// Both backward and forward.
both
}
/++
Used to indicate whether $(D popFront) should be called immediately upon
creating a range. The idea is that for some functions used to generate a
range for an interval, $(D front) is not necessarily a time point which
would ever be generated by the range. To get the first time point
in the range to match what the function generates, then use
$(D PopFirst.yes) to indicate that the range should have $(D popFront)
called on it before the range is returned so that $(D front) is a time point
which the function would generate.
For instance, if the function used to generate a range of time points
generated successive Easters (i.e. you're iterating over all of the Easters
within the interval), the initial date probably isn't an Easter. Using
$(D PopFirst.yes) would tell the function which returned the
range that $(D popFront) was to be called so that front would then be
an Easter - the next one generated by the function (which when
iterating forward would be the Easter following the original $(D front),
while when iterating backward, it would be the Easter prior to the
original $(D front)). If $(D PopFirst.no) were used, then $(D front) would
remain the original time point and it would not necessarily be a time point
which would be generated by the range-generating function (which in many
cases is exactly what is desired -
e.g. if iterating over every day starting at the beginning
of the interval).
+/
enum PopFirst
{
/// No, don't call popFront() before returning the range.
no,
/// Yes, call popFront() before returning the range.
yes
}
/++
Used by StopWatch to indicate whether it should start immediately upon
construction.
+/
enum AutoStart
{
/// No, don't start the StopWatch when it is constructed.
no,
/// Yes, do start the StopWatch when it is constructed.
yes
}
/++
Array of the strings representing time units, starting with the smallest
unit and going to the largest. It does not include $(D "nsecs").
Includes $(D "hnsecs") (hecto-nanoseconds (100 ns)),
$(D "usecs") (microseconds), $(D "msecs") (milliseconds), $(D "seconds"),
$(D "minutes"), $(D "hours"), $(D "days"), $(D "weeks"), $(D "months"), and
$(D "years")
+/
immutable string[] timeStrings = ["hnsecs", "usecs", "msecs", "seconds", "minutes",
"hours", "days", "weeks", "months", "years"];
//==============================================================================
// Section with other types.
//==============================================================================
/++
Exception type used by std.datetime. It's an alias to $(CXREF time, TimeException).
Either can be caught without concern about which
module it came from.
+/
alias DateTimeException = TimeException;
/++
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.
Throws:
$(XREF exception, ErrnoException) (on Posix) or $(XREF exception, Exception) (on Windows)
if it fails to get the time of day.
+/
static SysTime currTime(immutable TimeZone tz = LocalTime()) @safe
{
return SysTime(currStdTime, tz);
}
unittest
{
assert(currTime(UTC()).timezone is UTC());
//I have no idea why, but for some reason, Windows/Wine likes to get
//time_t wrong when getting it with core.stdc.time.time. On one box
//I have (which has its local time set to UTC), it always gives time_t
//in the real local time (America/Los_Angeles), and after the most recent
//DST switch, every Windows box that I've tried it in is reporting
//time_t as being 1 hour off of where it's supposed to be. So, I really
//don't know what the deal is, but given what I'm seeing, I don't trust
//core.stdc.time.time on Windows, so I'm just going to disable this test
//on Windows.
version(Posix)
{
immutable unixTimeD = currTime().toUnixTime();
immutable unixTimeC = core.stdc.time.time(null);
immutable diff = unixTimeC - unixTimeD;
assert(diff >= -2);
assert(diff <= 2);
}
}
/++
Returns the number of hnsecs since midnight, January 1st, 1 A.D. for the
current time.
Throws:
$(LREF DateTimeException) if it fails to get the time.
+/
static @property long currStdTime() @trusted
{
version(Windows)
{
FILETIME fileTime;
GetSystemTimeAsFileTime(&fileTime);
return FILETIMEToStdTime(&fileTime);
}
else version(Posix)
{
enum hnsecsToUnixEpoch = 621_355_968_000_000_000L;
static if(is(typeof(clock_gettime)))
{
timespec ts;
if(clock_gettime(CLOCK_REALTIME, &ts) != 0)
throw new TimeException("Failed in clock_gettime().");
return convert!("seconds", "hnsecs")(ts.tv_sec) +
ts.tv_nsec / 100 +
hnsecsToUnixEpoch;
}
else
{
timeval tv;
if(gettimeofday(&tv, null) != 0)
throw new TimeException("Failed in gettimeofday().");
return convert!("seconds", "hnsecs")(tv.tv_sec) +
convert!("usecs", "hnsecs")(tv.tv_usec) +
hnsecsToUnixEpoch;
}
}
}
/++
The current system tick. The number of ticks per second varies from
system to system. currSystemTick uses a monotonic clock, so it's
intended for precision timing by comparing relative time values, not
for getting the current system time.
Warning:
On some systems, the monotonic clock may stop counting when
the computer goes to sleep or hibernates. So, the monotonic
clock could be off if that occurs. This is known to happen
on Mac OS X. It has not been tested whether it occurs on
either Windows or Linux.
Throws:
$(LREF DateTimeException) if it fails to get the time.
+/
static @property TickDuration currSystemTick() @safe nothrow
{
return TickDuration.currSystemTick;
}
unittest
{
assert(Clock.currSystemTick.length > 0);
}
/++
The current number of system ticks since the application started.
The number of ticks per second varies from system to system.
This uses a monotonic clock.
Warning:
On some systems, the monotonic clock may stop counting when
the computer goes to sleep or hibernates. So, the monotonic
clock could be off if that occurs. This is known to happen
on Mac OS X. It has not been tested whether it occurs on
either Windows or on Linux.
Throws:
$(LREF DateTimeException) if it fails to get the time.
+/
static @property TickDuration currAppTick() @safe
{
return currSystemTick - TickDuration.appOrigin;
}
unittest
{
auto a = Clock.currSystemTick;
auto b = Clock.currAppTick;
assert(a.length);
assert(b.length);
assert(a > b);
}
private:
@disable this() {}
}
//==============================================================================
// Section with time points.
//==============================================================================
/++
$(D SysTime) is the type used to get the current time from the
system or doing anything that involves time zones. Unlike
$(LREF DateTime), 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
$(LREF DateTime), 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 $(LREF DateTime) would be the type to
use. For system time, use $(D SysTime).
$(LREF2 .Clock.currTime, Clock.currTime) will return the current time as a $(D SysTime).
To convert a $(D SysTime) to a $(LREF Date) or $(LREF DateTime), simply cast
it. To convert a $(LREF Date) or $(LREF DateTime) to a
$(D SysTime), use $(D SysTime)'s constructor, and pass in the
intended time zone with it (or don't pass in a $(LREF2 .TimeZone, TimeZone), and the local
time zone will be used). Be aware, however, that converting from a
$(LREF DateTime) 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
$(LREF PosixTimeZone) on Posix systems (or on Windows, if providing the TZ
Database files), and use $(LREF WindowsTimeZone) 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). $(LREF LocalTime) is the $(LREF2 .TimeZone, TimeZone) class
which represents the local time, and $(D UTC) is the $(LREF2 .TimeZone, TimeZone) class
which represents UTC. $(D SysTime) uses $(LREF LocalTime) if no $(LREF2 .TimeZone, TimeZone)
is provided. For more details on time zones, see the documentation for
$(LREF2 .TimeZone, TimeZone), $(LREF PosixTimeZone), and $(LREF WindowsTimeZone).
$(D SysTime)'s range is from approximately 29,000 B.C. to approximately
29,000 A.D.
+/
struct SysTime
{
import std.typecons : Rebindable;
public:
/++
Params:
dateTime = The $(LREF DateTime) to use to set this $(LREF SysTime)'s
internal std time. As $(LREF DateTime) has no concept of
time zone, tz is used as its time zone.
tz = The $(LREF2 .TimeZone, TimeZone) to use for this $(LREF SysTime). If null,
$(LREF LocalTime) will be used. The given $(LREF DateTime) 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.");
}
unittest
{
import std.format : format;
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 $(LREF DateTime) to use to set this $(LREF SysTime)'s
internal std time. As $(LREF DateTime) has no concept of
time zone, tz is used as its time zone.
fracSecs = The fractional seconds portion of the time.
tz = The $(LREF2 .TimeZone, TimeZone) to use for this $(LREF SysTime). If null,
$(LREF LocalTime) will be used. The given $(LREF DateTime) is
assumed to be in the given time zone.
Throws:
$(LREF DateTimeException) 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);
}
unittest
{
import std.format : format;
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()));
}
/++
$(RED Scheduled for deprecation. Please use the overload which takes a
$(CXREF time, Duration) for the fractional seconds. This overload
will be deprecated in 2.068).
Params:
dateTime = The $(LREF DateTime) to use to set this $(LREF SysTime)'s
internal std time. As $(LREF DateTime) has no concept of
time zone, tz is used as its time zone.
fracSec = The fractional seconds portion of the time.
tz = The $(LREF2 .TimeZone, TimeZone) to use for this $(LREF SysTime). If null,
$(LREF LocalTime) will be used. The given $(LREF DateTime) is
assumed to be in the given time zone.
Throws:
$(LREF DateTimeException) if $(D fracSec) is negative.
+/
//deprecated("Please use the overload which takes a Duration instead of a FracSec.")
this(in DateTime dateTime, in FracSec fracSec, immutable TimeZone tz = null) @safe
{
immutable fracHNSecs = fracSec.hnsecs;
enforce(fracHNSecs >= 0, new DateTimeException("A SysTime cannot have negative fractional seconds."));
_timezone = tz is null ? LocalTime() : tz;
try
{
immutable dateDiff = (dateTime.date - Date(1, 1, 1)).total!"hnsecs";
immutable todDiff = (dateTime.timeOfDay - TimeOfDay(0, 0, 0)).total!"hnsecs";
immutable adjustedTime = dateDiff + todDiff + fracHNSecs;
immutable standardTime = _timezone.tzToUTC(adjustedTime);
this(standardTime, _timezone);
}
catch(Exception e)
assert(0, "Date, TimeOfDay, or DateTime's constructor threw when it shouldn't have.");
}
/+deprecated+/ unittest
{
import std.format : format;
static void test(DateTime dt,
FracSec fracSec,
immutable TimeZone tz,
long expected)
{
auto sysTime = SysTime(dt, fracSec, tz);
assert(sysTime._stdTime == expected);
assert(sysTime._timezone is (tz is null ? LocalTime() : tz),
format("Given DateTime: %s, Given FracSec: %s", dt, fracSec));
}
test(DateTime.init, FracSec.init, UTC(), 0);
test(DateTime(1, 1, 1, 12, 30, 33), FracSec.init, UTC(), 450_330_000_000L);
test(DateTime(0, 12, 31, 12, 30, 33), FracSec.init, UTC(), -413_670_000_000L);
test(DateTime(1, 1, 1, 0, 0, 0), FracSec.from!"msecs"(1), UTC(), 10_000L);
test(DateTime(0, 12, 31, 23, 59, 59), FracSec.from!"msecs"(999), UTC(), -10_000L);
test(DateTime(0, 12, 31, 23, 59, 59), FracSec.from!"hnsecs"(9_999_999), UTC(), -1);
test(DateTime(0, 12, 31, 23, 59, 59), FracSec.from!"hnsecs"(1), UTC(), -9_999_999);
test(DateTime(0, 12, 31, 23, 59, 59), FracSec.from!"hnsecs"(0), UTC(), -10_000_000);
assertThrown!DateTimeException(SysTime(DateTime.init, FracSec.from!"hnsecs"(-1), UTC()));
}
/++
Params:
date = The $(LREF Date) to use to set this $(LREF SysTime)'s internal std
time. As $(LREF Date) has no concept of time zone, tz is used as
its time zone.
tz = The $(LREF2 .TimeZone, TimeZone) to use for this $(LREF SysTime). If null,
$(LREF LocalTime) will be used. The given $(LREF 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.");
}
unittest
{
static void test(Date d, immutable TimeZone tz, long expected)
{
import std.format : format;
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 $(LREF2 .TimeZone, TimeZone) to use for this $(LREF SysTime). If null,
$(LREF LocalTime) will be used.
+/
this(long stdTime, immutable TimeZone tz = null) @safe pure nothrow
{
_stdTime = stdTime;
_timezone = tz is null ? LocalTime() : tz;
}
unittest
{
static void test(long stdTime, immutable TimeZone tz)
{
import std.format : format;
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) 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;
}
unittest
{
import std.range;
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));
static assert(__traits(compiles, st == st));
static assert(__traits(compiles, st == cst));
//static assert(__traits(compiles, st == ist));
static assert(__traits(compiles, cst == st));
static assert(__traits(compiles, cst == cst));
//static assert(__traits(compiles, cst == ist));
//static assert(__traits(compiles, ist == st));
//static assert(__traits(compiles, ist == cst));
//static assert(__traits(compiles, 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;
}
unittest
{
import std.range;
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));
static assert(__traits(compiles, st.opCmp(st)));
static assert(__traits(compiles, st.opCmp(cst)));
//static assert(__traits(compiles, st.opCmp(ist)));
static assert(__traits(compiles, cst.opCmp(st)));
static assert(__traits(compiles, cst.opCmp(cst)));
//static assert(__traits(compiles, cst.opCmp(ist)));
//static assert(__traits(compiles, ist.opCmp(st)));
//static assert(__traits(compiles, ist.opCmp(cst)));
//static assert(__traits(compiles, ist.opCmp(ist)));
}
/++
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;
}
unittest
{
import std.range;
static void test(SysTime sysTime, long expected)
{
import std.format : format;
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));
static assert(__traits(compiles, cst.year));
//static assert(__traits(compiles, ist.year));
}
/++
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:
$(LREF DateTimeException) 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;
}
///
unittest
{
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);
}
unittest
{
import std.range;
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:
$(LREF DateTimeException) if $(D isAD) is true.
+/
@property ushort yearBC() @safe const
{
return (cast(Date)this).yearBC;
}
///
unittest
{
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);
}
unittest
{
import std.format : format;
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));
static assert(__traits(compiles, 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:
$(LREF DateTimeException) 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;
}
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)));
}
unittest
{
import std.range;
static void test(SysTime st, int year, in SysTime expected)
{
import std.format : format;
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));
static assert(__traits(compiles, 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;
}
///
unittest
{
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);
}
unittest
{
import std.range;
static void test(SysTime sysTime, Month expected)
{
import std.format : format;
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));
static assert(__traits(compiles, cst.month));
//static assert(__traits(compiles, ist.month));
}
/++
Month of a Gregorian Year.
Params:
month = The month to set this $(LREF SysTime)'s month to.
Throws:
$(LREF DateTimeException) 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;
}
unittest
{
import std.range;
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;
}
///
unittest
{
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);
}
unittest
{
import std.range;
static void test(SysTime sysTime, int expected)
{
import std.format : format;
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));
static assert(__traits(compiles, cst.day));
//static assert(__traits(compiles, ist.day));
}
/++
Day of a Gregorian Month.
Params:
day = The day of the month to set this $(LREF SysTime)'s day to.
Throws:
$(LREF DateTimeException) 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;
}
unittest
{
import std.format : format;
import std.range;
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);
}
unittest
{
import std.range;
import std.format : format;
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));
static assert(__traits(compiles, cst.hour));
//static assert(__traits(compiles, ist.hour));
}
/++
Hours past midnight.
Params:
hour = The hours to set this $(LREF SysTime)'s hour to.
Throws:
$(LREF DateTimeException) 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;
}
unittest
{
import std.range;
import std.format : format;
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);
}
unittest
{
import std.range;
import std.format : format;
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));
static assert(__traits(compiles, cst.minute));
//static assert(__traits(compiles, ist.minute));
}
/++
Minutes past the current hour.
Params:
minute = The minute to set this $(LREF SysTime)'s minute to.
Throws:
$(LREF DateTimeException) 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;
}
unittest
{
import std.range;
import std.format : format;
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);
}
unittest
{
import std.range;
import std.format : format;
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));
static assert(__traits(compiles, cst.second));
//static assert(__traits(compiles, ist.second));
}
/++
Seconds past the current minute.
Params:
second = The second to set this $(LREF SysTime)'s second to.
Throws:
$(LREF DateTimeException) 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;
}
unittest
{
import std.range;
import std.format : format;
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));
}
///
unittest
{
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));
}
unittest
{
import std.range;
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));
static assert(__traits(compiles, cst.fracSecs));
//static assert(__traits(compiles, ist.fracSecs));
}
/++
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:
$(LREF DateTimeException) 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;
}
///
unittest
{
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));
}
unittest
{
import std.range;
import std.format : format;
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)));
}
/++
$(RED Scheduled for deprecation. Please use $(LREF fracSecs) instead of
fracSec. It uses a $(CXREF time, Duration) to represent the
fractional seconds instead of a $(CXREF time, FracSec). This
overload will be deprecated in 2.068).
Fractional seconds past the second.
+/
//deprecated("Please use fracSecs (with an s) rather than fracSec (without an s). It returns a Duration instead of a FracSec, as FracSec is being deprecated.")
@property FracSec fracSec() @safe const nothrow
{
try
{
auto hnsecs = removeUnitsFromHNSecs!"days"(adjTime);
if(hnsecs < 0)
hnsecs += convert!("hours", "hnsecs")(24);
hnsecs = removeUnitsFromHNSecs!"seconds"(hnsecs);
return FracSec.from!"hnsecs"(cast(int)hnsecs);
}
catch(Exception e)
assert(0, "FracSec.from!\"hnsecs\"() threw.");
}
/+deprecated+/ unittest
{
import std.range;
import std.format : format;
static void test(SysTime sysTime, FracSec expected, size_t line = __LINE__)
{
if(sysTime.fracSec != expected)
throw new AssertError(format("Value given: %s", sysTime.fracSec), __FILE__, line);
}
test(SysTime(0, UTC()), FracSec.from!"hnsecs"(0));
test(SysTime(1, UTC()), FracSec.from!"hnsecs"(1));
test(SysTime(-1, UTC()), FracSec.from!"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)
test(SysTime(dt, fs, tz), FracSec.from!"hnsecs"(fs.total!"hnsecs"));
}
}
}
}
}
}
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.fracSec));
//static assert(__traits(compiles, ist.fracSec));
}
/++
$(RED Scheduled for deprecation. Please use $(LREF fracSecs) instead of
fracSec. It uses a $(CXREF time, Duration) to represent the
fractional seconds instead of a $(CXREF time, FracSec). This
overload will be deprecated in 2.068).
Fractional seconds past the second.
Params:
fracSec = The fractional seconds to set this $(LREF SysTime)'s
fractional seconds to.
Throws:
$(LREF DateTimeException) if $(D fracSec) is negative.
+/
//deprecated("Please use fracSecs (with an s) rather than fracSec (without an s). It takes a Duration instead of a FracSec, as FracSec is being deprecated.")
@property void fracSec(FracSec fracSec) @safe
{
immutable fracHNSecs = fracSec.hnsecs;
enforce(fracHNSecs >= 0, new DateTimeException("A SysTime cannot have negative fractional seconds."));
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);
immutable second = getUnitsFromHNSecs!"seconds"(hnsecs);
hnsecs = fracHNSecs;
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;
}
/+deprecated+/ unittest
{
import std.range;
import std.format : format;
foreach(fracSec; testFracSecs)
{
foreach(st; chain(testSysTimesBC, testSysTimesAD))
{
auto dt = cast(DateTime)st;
auto expected = SysTime(dt, fracSec, st.timezone);
st.fracSec = FracSec.from!"hnsecs"(fracSec.total!"hnsecs");
assert(st == expected, format("[%s] [%s]", st, expected));
}
}
auto st = testSysTimesAD[0];
assertThrown!DateTimeException(st.fracSec = FracSec.from!"hnsecs"(-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.fracSec = FracSec.from!"msecs"(7)));
//static assert(!__traits(compiles, ist.fracSec = FracSec.from!"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;
}
unittest
{
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 == 330000502L);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), UTC()).stdTime == 621355968000000000L);
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));
//static assert(__traits(compiles, ist.stdTime));
}
/++
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;
}
unittest
{
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 $(LREF2 .TimeZone, 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
$(LREF LocalTime) as its time zone.
+/
SysTime toLocalTime() @safe const pure nothrow
{
return SysTime(_stdTime, LocalTime());
}
unittest
{
{
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());
}
unittest
{
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);
}
unittest
{
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());
}
/++
Returns a $(D time_t) which represents the same time as this
$(LREF SysTime).
Note that like all conversions in std.datetime, this is a truncating
conversion.
If $(D time_t) is 32 bits, rather than 64, and the result can't fit in a
32-bit value, then the closest value that can be held in 32 bits will be
used (so $(D time_t.max) if it goes over and $(D time_t.min) if it goes
under).
+/
time_t toUnixTime() @safe const pure nothrow
{
return stdTimeToUnixTime(_stdTime);
}
unittest
{
assert(SysTime(DateTime(1970, 1, 1), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), hnsecs(1), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), usecs(1), UTC()).toUnixTime() == 0);
assert(SysTime(DateTime(1970, 1, 1, 0, 0, 0), msecs(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);
}
/++
Returns a $(D timeval) which represents this $(LREF SysTime).
Note that like all conversions in std.datetime, this is a truncating
conversion.
If $(D time_t) is 32 bits, rather than 64, and the result can't fit in a
32-bit value, then the closest value that can be held in 32 bits will be
used for $(D tv_sec). (so $(D time_t.max) if it goes over and
$(D time_t.min) if it goes under).
+/
timeval toTimeVal() @safe const pure nothrow
{
immutable tv_sec = toUnixTime();
immutable fracHNSecs = removeUnitsFromHNSecs!"seconds"(_stdTime - 621355968000000000L);
immutable tv_usec = cast(int)convert!("hnsecs", "usecs")(fracHNSecs);
return timeval(tv_sec, tv_usec);
}
unittest
{
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));
}
/++
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;
}
unittest
{
import std.conv : to;
version(Posix)
{
scope(exit) clearTZEnvVar();
setTZEnvVar("America/Los_Angeles");
}
{
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;
}
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 AllowDayOverlow.yes
unittest
{
//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 AllowDayOverlow.no
unittest
{
//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 AllowDayOverlow.yes
unittest
{
//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 AllowDayOverlow.no
unittest
{
//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);
}
///
unittest
{
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)));
}
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));
static assert(__traits(compiles, 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 AllowDayOverlow.yes
unittest
{
//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 AllowDayOverlow.no
unittest
{
//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;
}
///
unittest
{
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)));
}
unittest
{
//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"().
unittest
{
static void testST(SysTime orig, int hours, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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"().
unittest
{
static void testST(SysTime orig, int minutes, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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"().
unittest
{
static void testST(SysTime orig, int seconds, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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"().
unittest
{
static void testST(SysTime orig, int milliseconds, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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"().
unittest
{
static void testST(SysTime orig, long microseconds, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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"().
unittest
{
static void testST(SysTime orig, long hnsecs, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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 duration 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 duration to add to or subtract from this
$(LREF SysTime).
+/
SysTime opBinary(string op, D)(in D duration) @safe const pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
SysTime retval = SysTime(this._stdTime, this._timezone);
static if(is(Unqual!D == Duration))
immutable hnsecs = duration.total!"hnsecs";
else static if(is(Unqual!D == TickDuration))
immutable hnsecs = duration.hnsecs;
mixin(format("retval._stdTime %s= hnsecs;", op));
return retval;
}
unittest
{
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)));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(st + TickDuration.from!"usecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_748)));
assert(st + TickDuration.from!"usecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_608)));
}
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)));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(st - TickDuration.from!"usecs"(-7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_748)));
assert(st - TickDuration.from!"usecs"(7) == SysTime(DateTime(1999, 7, 6, 12, 30, 33), hnsecs(2_345_608)));
}
static void testST(in SysTime orig, long hnsecs, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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));
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 result of adding or subtracting a duration 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 duration to add to or subtract from this
$(LREF SysTime).
+/
ref SysTime opOpAssign(string op, D)(in D duration) @safe pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
static if(is(Unqual!D == Duration))
auto hnsecs = duration.total!"hnsecs";
else static if(is(Unqual!D == TickDuration))
auto hnsecs = duration.hnsecs;
mixin(format("_stdTime %s= hnsecs;", op));
return this;
}
unittest
{
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__)
{
import std.format : format;
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);
}
unittest
{
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));
auto tz = TimeZone.getTimeZone("America/Los_Angeles");
{
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));
static assert(__traits(compiles, st - st));
static assert(__traits(compiles, cst - st));
//static assert(__traits(compiles, ist - st));
static assert(__traits(compiles, st - cst));
static assert(__traits(compiles, cst - cst));
//static assert(__traits(compiles, ist - cst));
//static assert(__traits(compiles, st - ist));
//static assert(__traits(compiles, cst - ist));
//static assert(__traits(compiles, ist - ist));
}
/++
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 $(CXREF time, Duration)
that results. Because converting between months and smaller
units requires a specific date (which $(CXREF time, Duration)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);
}
///
unittest
{
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);
}
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));
static assert(__traits(compiles, st.diffMonths(st)));
static assert(__traits(compiles, cst.diffMonths(st)));
//static assert(__traits(compiles, ist.diffMonths(st)));
static assert(__traits(compiles, st.diffMonths(cst)));
static assert(__traits(compiles, cst.diffMonths(cst)));
//static assert(__traits(compiles, ist.diffMonths(cst)));
//static assert(__traits(compiles, st.diffMonths(ist)));
//static assert(__traits(compiles, cst.diffMonths(ist)));
//static assert(__traits(compiles, ist.diffMonths(ist)));
}
/++
Whether this $(LREF SysTime) is in a leap year.
+/
@property bool isLeapYear() @safe const nothrow
{
return (cast(Date)this).isLeapYear;
}
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));
static assert(__traits(compiles, st.isLeapYear));
static assert(__traits(compiles, cst.isLeapYear));
//static assert(__traits(compiles, ist.isLeapYear));
}
/++
Day of the week this $(LREF SysTime) is on.
+/
@property DayOfWeek dayOfWeek() @safe const nothrow
{
return getDayOfWeek(dayOfGregorianCal);
}
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));
static assert(__traits(compiles, st.dayOfWeek));
static assert(__traits(compiles, cst.dayOfWeek));
//static assert(__traits(compiles, ist.dayOfWeek));
}
/++
Day of the year this $(LREF SysTime) is on.
+/
@property ushort dayOfYear() @safe const nothrow
{
return (cast(Date)this).dayOfYear;
}
///
unittest
{
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);
}
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));
static assert(__traits(compiles, st.dayOfYear));
static assert(__traits(compiles, cst.dayOfYear));
//static assert(__traits(compiles, ist.dayOfYear));
}
/++
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;
}
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));
static assert(__traits(compiles, 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;
}
///
unittest
{
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);
}
unittest
{
//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));
static assert(__traits(compiles, cst.dayOfGregorianCal));
//static assert(__traits(compiles, ist.dayOfGregorianCal));
}
//Test that the logic for the day of the Gregorian Calendar is consistent
//between Date and SysTime.
unittest
{
void test(Date date, SysTime st, size_t line = __LINE__)
{
import std.format : format;
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;
}
///
unittest
{
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)));
}
unittest
{
void testST(SysTime orig, int day, in SysTime expected, size_t line = __LINE__)
{
import std.format : format;
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__)
{
import std.format : format;
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:
$(WEB en.wikipedia.org/wiki/ISO_week_date, ISO Week Date).
+/
@property ubyte isoWeek() @safe const nothrow
{
return (cast(Date)this).isoWeek;
}
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));
static assert(__traits(compiles, st.isoWeek));
static assert(__traits(compiles, cst.isoWeek));
//static assert(__traits(compiles, ist.isoWeek));
}
/++
$(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;
}
///
unittest
{
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)));
}
unittest
{
//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));
static assert(__traits(compiles, cst.endOfMonth));
//static assert(__traits(compiles, ist.endOfMonth));
}
/++
The last day in the month that this $(LREF SysTime) is in.
+/
@property ubyte daysInMonth() @safe const nothrow
{
return Date(dayOfGregorianCal).daysInMonth;
}
///
unittest
{
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);
}
unittest
{
//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));
static assert(__traits(compiles, cst.daysInMonth));
//static assert(__traits(compiles, ist.daysInMonth));
}
/++
Whether the current year is a date in A.D.
+/
@property bool isAD() @safe const nothrow
{
return adjTime >= 0;
}
///
unittest
{
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);
}
unittest
{
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));
static assert(__traits(compiles, cst.isAD));
//static assert(__traits(compiles, ist.isAD));
}
/++
The $(WEB 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;
}
unittest
{
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));
static assert(__traits(compiles, cst.julianDay));
//static assert(__traits(compiles, ist.julianDay));
}
/++
The modified $(WEB 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;
}
unittest
{
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));
static assert(__traits(compiles, cst.modJulianDay));
//static assert(__traits(compiles, ist.modJulianDay));
}
/++
Returns a $(LREF Date) equivalent to this $(LREF SysTime).
+/
Date opCast(T)() @safe const nothrow
if(is(Unqual!T == Date))
{
return Date(dayOfGregorianCal);
}
unittest
{
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));
static assert(__traits(compiles, cast(Date)cst));
//static assert(__traits(compiles, cast(Date)ist));
}
/++
Returns a $(LREF DateTime) 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.");
}
unittest
{
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));
static assert(__traits(compiles, cast(DateTime)cst));
//static assert(__traits(compiles, cast(DateTime)ist));
}
/++
Returns a $(LREF TimeOfDay) 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.");
}
unittest
{
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));
static assert(__traits(compiles, cast(TimeOfDay)cst));
//static assert(__traits(compiles, cast(TimeOfDay)ist));
}
//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 $(LREF LocalTime), then TZ is empty.
If its time zone is $(D UTC), then it is "Z". Otherwise, it is the
offset from UTC (e.g. +1:00 or -7: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.
+/
string toISOString() @safe const nothrow
{
import std.format : format;
try
{
immutable adjustedTime = adjTime;
long hnsecs = adjustedTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if(hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto hour = splitUnitsFromHNSecs!"hours"(hnsecs);
auto minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
auto second = splitUnitsFromHNSecs!"seconds"(hnsecs);
auto dateTime = DateTime(Date(cast(int)days), TimeOfDay(cast(int)hour, cast(int)minute, cast(int)second));
auto fracSecStr = fracSecsToISOString(cast(int)hnsecs);
if(_timezone is LocalTime())
return dateTime.toISOString() ~ fracSecsToISOString(cast(int)hnsecs);
if(_timezone is UTC())
return dateTime.toISOString() ~ fracSecsToISOString(cast(int)hnsecs) ~ "Z";
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
return format("%s%s%s",
dateTime.toISOString(),
fracSecsToISOString(cast(int)hnsecs),
SimpleTimeZone.toISOString(utcOffset));
}
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
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");
}
unittest
{
//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));
static assert(__traits(compiles, cast(TimeOfDay)cst));
//static assert(__traits(compiles, cast(TimeOfDay)ist));
}
/++
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 $(LREF LocalTime), then TZ is empty. If
its time zone is $(D UTC), then it is "Z". Otherwise, it is the offset
from UTC (e.g. +1:00 or -7: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.
+/
string toISOExtString() @safe const nothrow
{
import std.format : format;
try
{
immutable adjustedTime = adjTime;
long hnsecs = adjustedTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if(hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto hour = splitUnitsFromHNSecs!"hours"(hnsecs);
auto minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
auto second = splitUnitsFromHNSecs!"seconds"(hnsecs);
auto dateTime = DateTime(Date(cast(int)days), TimeOfDay(cast(int)hour, cast(int)minute, cast(int)second));
auto fracSecStr = fracSecsToISOString(cast(int)hnsecs);
if(_timezone is LocalTime())
return dateTime.toISOExtString() ~ fracSecsToISOString(cast(int)hnsecs);
if(_timezone is UTC())
return dateTime.toISOExtString() ~ fracSecsToISOString(cast(int)hnsecs) ~ "Z";
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
return format("%s%s%s",
dateTime.toISOExtString(),
fracSecsToISOString(cast(int)hnsecs),
SimpleTimeZone.toISOString(utcOffset));
}
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
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");
}
unittest
{
//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));
static assert(__traits(compiles, cast(TimeOfDay)cst));
//static assert(__traits(compiles, cast(TimeOfDay)ist));
}
/++
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 $(LREF LocalTime), then TZ is empty. If
its time zone is $(D UTC), then it is "Z". Otherwise, it is the offset
from UTC (e.g. +1:00 or -7: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.
+/
string toSimpleString() @safe const nothrow
{
import std.format : format;
try
{
immutable adjustedTime = adjTime;
long hnsecs = adjustedTime;
auto days = splitUnitsFromHNSecs!"days"(hnsecs) + 1;
if(hnsecs < 0)
{
hnsecs += convert!("hours", "hnsecs")(24);
--days;
}
auto hour = splitUnitsFromHNSecs!"hours"(hnsecs);
auto minute = splitUnitsFromHNSecs!"minutes"(hnsecs);
auto second = splitUnitsFromHNSecs!"seconds"(hnsecs);
auto dateTime = DateTime(Date(cast(int)days), TimeOfDay(cast(int)hour, cast(int)minute, cast(int)second));
auto fracSecStr = fracSecsToISOString(cast(int)hnsecs);
if(_timezone is LocalTime())
return dateTime.toSimpleString() ~ fracSecsToISOString(cast(int)hnsecs);
if(_timezone is UTC())
return dateTime.toSimpleString() ~ fracSecsToISOString(cast(int)hnsecs) ~ "Z";
immutable utcOffset = dur!"hnsecs"(adjustedTime - stdTime);
return format("%s%s%s",
dateTime.toSimpleString(),
fracSecsToISOString(cast(int)hnsecs),
SimpleTimeZone.toISOString(utcOffset));
}
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
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");
}
unittest
{
//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));
static assert(__traits(compiles, cast(TimeOfDay)cst));
//static assert(__traits(compiles, cast(TimeOfDay)ist));
}
/++
Converts this $(LREF SysTime) to a string.
+/
string toString() @safe const nothrow
{
return toSimpleString();
}
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));
static assert(__traits(compiles, st.toString()));
static assert(__traits(compiles, cst.toString()));
//static assert(__traits(compiles, 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.
If there is no time zone in the string, then $(LREF LocalTime) is used. If
the time zone is "Z", then $(D UTC) is used. Otherwise, a
$(LREF SimpleTimeZone) 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 +H, -H, +HH, -HH, +H:MM, -H:MM, +HH:MM, and -HH:MM.
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:
$(LREF DateTimeException) 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.string : strip;
import std.conv : to;
import std.algorithm : startsWith, find;
import std.format : format;
auto dstr = to!dstring(strip(isoString));
immutable skipFirst = dstr.startsWith('+', '-') != 0;
auto found = (skipFirst ? dstr[1..$] : dstr).find('.', 'Z', '+', '-');
auto dateTimeStr = dstr[0 .. $ - found[0].length];
dstring fracSecStr;
dstring 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.fromISOString(dateTimeStr);
auto fracSec = fracSecsFromISOString(fracSecStr);
Rebindable!(immutable TimeZone) parsedZone;
if(zoneStr.empty)
parsedZone = LocalTime();
else if(zoneStr == "Z")
parsedZone = UTC();
else
parsedZone = SimpleTimeZone.fromISOString(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));
}
///
unittest
{
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("-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-8:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(dur!"hours"(-8))));
assert(SysTime.fromISOString("20100704T070612+8:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(dur!"hours"(8))));
}
unittest
{
assertThrown!DateTimeException(SysTime.fromISOString(""));
assertThrown!DateTimeException(SysTime.fromISOString("20100704000000"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704 000000"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704t000000"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000."));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000.A"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000.Z"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000.00000000"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000.00000000"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000+"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000-"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000:"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000-:"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000+:"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000-1:"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000+1:"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000+1:0"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000-24.00"));
assertThrown!DateTimeException(SysTime.fromISOString("20100704T000000+24.00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-07-0400:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-07-04t00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-07-04T00:00:00."));
assertThrown!DateTimeException(SysTime.fromISOString("2010-Jul-0400:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-Jul-04 00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-Jul-04t00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-Jul-04T00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-Jul-04 00:00:00."));
assertThrown!DateTimeException(SysTime.fromISOString("2010-12-22T172201"));
assertThrown!DateTimeException(SysTime.fromISOString("2010-Dec-22 17:22:01"));
assert(SysTime.fromISOString("20101222T172201") == SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
assert(SysTime.fromISOString("19990706T123033") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOString("-19990706T123033") == SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOString("+019990706T123033") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOString("19990706T123033 ") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOString(" 19990706T123033") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOString(" 19990706T123033 ") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOString("19070707T121212.0") == SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
assert(SysTime.fromISOString("19070707T121212.0000000") == SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
assert(SysTime.fromISOString("19070707T121212.0000001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), hnsecs(1)));
assert(SysTime.fromISOString("19070707T121212.000001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
assert(SysTime.fromISOString("19070707T121212.0000010") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
assert(SysTime.fromISOString("19070707T121212.001") == SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
assert(SysTime.fromISOString("19070707T121212.0010000") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
assert(SysTime.fromISOString("20101222T172201Z") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), UTC()));
assert(SysTime.fromISOString("20101222T172201-1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOString("20101222T172201-1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOString("20101222T172201-1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-90))));
assert(SysTime.fromISOString("20101222T172201-8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-480))));
assert(SysTime.fromISOString("20101222T172201+1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOString("20101222T172201+1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOString("20101222T172201+1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(90))));
assert(SysTime.fromISOString("20101222T172201+8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(480))));
assert(SysTime.fromISOString("20101103T065106.57159Z") ==
SysTime(DateTime(2010, 11, 3, 6, 51, 6), hnsecs(5715900), UTC()));
assert(SysTime.fromISOString("20101222T172201.23412Z") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_341_200), UTC()));
assert(SysTime.fromISOString("20101222T172201.23112-1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200),
new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOString("20101222T172201.45-1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000),
new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOString("20101222T172201.1-1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000),
new immutable SimpleTimeZone(dur!"minutes"(-90))));
assert(SysTime.fromISOString("20101222T172201.55-8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000),
new immutable SimpleTimeZone(dur!"minutes"(-480))));
assert(SysTime.fromISOString("20101222T172201.1234567+1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567),
new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOString("20101222T172201.0+1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01),
new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOString("20101222T172201.0000000+1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01),
new immutable SimpleTimeZone(dur!"minutes"(90))));
assert(SysTime.fromISOString("20101222T172201.45+8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000),
new immutable SimpleTimeZone(dur!"minutes"(480))));
}
/++
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.
If there is no time zone in the string, then $(LREF LocalTime) is used. If
the time zone is "Z", then $(D UTC) is used. Otherwise, a
$(LREF SimpleTimeZone) 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 +H, -H, +HH, -HH, +H:MM, -H:MM, +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:
$(LREF DateTimeException) 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.string : strip;
import std.conv : to;
import std.algorithm : countUntil, find;
import std.format : format;
auto dstr = to!dstring(strip(isoExtString));
auto tIndex = dstr.countUntil('T');
enforce(tIndex != -1, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
auto found = dstr[tIndex + 1 .. $].find('.', 'Z', '+', '-');
auto dateTimeStr = dstr[0 .. $ - found[0].length];
dstring fracSecStr;
dstring 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.fromISOString(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));
}
///
unittest
{
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("-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-8:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(dur!"hours"(-8))));
assert(SysTime.fromISOExtString("2010-07-04T07:06:12+8:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(dur!"hours"(8))));
}
unittest
{
assertThrown!DateTimeException(SysTime.fromISOExtString(""));
assertThrown!DateTimeException(SysTime.fromISOExtString("20100704000000"));
assertThrown!DateTimeException(SysTime.fromISOExtString("20100704 000000"));
assertThrown!DateTimeException(SysTime.fromISOExtString("20100704t000000"));
assertThrown!DateTimeException(SysTime.fromISOExtString("20100704T000000."));
assertThrown!DateTimeException(SysTime.fromISOExtString("20100704T000000.0"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07:0400:00:00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04t00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00."));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00.A"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00.Z"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00.00000000"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00.00000000"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00+"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00-"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00:"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00-:"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00+:"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00-1:"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00+1:"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00+1:0"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00-24.00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-07-04T00:00:00+24.00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-Jul-0400:00:00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-Jul-04t00:00:00"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-Jul-04 00:00:00."));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-Jul-04 00:00:00.0"));
assertThrown!DateTimeException(SysTime.fromISOExtString("20101222T172201"));
assertThrown!DateTimeException(SysTime.fromISOExtString("2010-Dec-22 17:22:01"));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01") == SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
assert(SysTime.fromISOExtString("1999-07-06T12:30:33") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOExtString("-1999-07-06T12:30:33") == SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOExtString("+01999-07-06T12:30:33") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOExtString("1999-07-06T12:30:33 ") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOExtString(" 1999-07-06T12:30:33") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOExtString(" 1999-07-06T12:30:33 ") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.0") == SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.0000000") == SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.0000001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), hnsecs(1)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.000001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.0000010") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
assert(SysTime.fromISOExtString("1907-07-07T12:12:12.0010000") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01Z") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), UTC()));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01-1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01-1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01-1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-90))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01-8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-480))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01+1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01+1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01+1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(90))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01+8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(480))));
assert(SysTime.fromISOExtString("2010-11-03T06:51:06.57159Z") ==
SysTime(DateTime(2010, 11, 3, 6, 51, 6), hnsecs(5715900), UTC()));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.23412Z") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_341_200), UTC()));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.23112-1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200),
new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.45-1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000),
new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.1-1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000),
new immutable SimpleTimeZone(dur!"minutes"(-90))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.55-8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000),
new immutable SimpleTimeZone(dur!"minutes"(-480))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.1234567+1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567),
new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.0+1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01),
new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.0000000+1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01),
new immutable SimpleTimeZone(dur!"minutes"(90))));
assert(SysTime.fromISOExtString("2010-12-22T17:22:01.45+8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000),
new immutable SimpleTimeZone(dur!"minutes"(480))));
}
/++
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.
If there is no time zone in the string, then $(LREF LocalTime) is used. If
the time zone is "Z", then $(D UTC) is used. Otherwise, a
$(LREF SimpleTimeZone) 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 +H, -H, +HH, -HH, +H:MM, -H:MM, +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:
$(LREF DateTimeException) 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.string : strip;
import std.conv : to;
import std.algorithm : countUntil, find;
import std.format : format;
auto dstr = to!dstring(strip(simpleString));
auto spaceIndex = dstr.countUntil(' ');
enforce(spaceIndex != -1, new DateTimeException(format("Invalid Simple String: %s", simpleString)));
auto found = dstr[spaceIndex + 1 .. $].find('.', 'Z', '+', '-');
auto dateTimeStr = dstr[0 .. $ - found[0].length];
dstring fracSecStr;
dstring 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.fromISOString(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));
}
///
unittest
{
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("-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-8:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(dur!"hours"(-8))));
assert(SysTime.fromSimpleString("2010-Jul-04 07:06:12+8:00") ==
SysTime(DateTime(2010, 7, 4, 7, 6, 12),
new immutable SimpleTimeZone(dur!"hours"(8))));
}
unittest
{
assertThrown!DateTimeException(SysTime.fromSimpleString(""));
assertThrown!DateTimeException(SysTime.fromSimpleString("20100704000000"));
assertThrown!DateTimeException(SysTime.fromSimpleString("20100704 000000"));
assertThrown!DateTimeException(SysTime.fromSimpleString("20100704t000000"));
assertThrown!DateTimeException(SysTime.fromSimpleString("20100704T000000."));
assertThrown!DateTimeException(SysTime.fromSimpleString("20100704T000000.0"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-07-0400:00:00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-07-04t00:00:00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-07-04T00:00:00."));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-07-04T00:00:00.0"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-0400:00:00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04t00:00:00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04T00:00:00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00."));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00.A"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00.Z"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00.00000000"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00.00000000"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00+"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00-"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00:"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00-:"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00+:"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00-1:"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00+1:"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00+1:0"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00-24.00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-Jul-04 00:00:00+24.00"));
assertThrown!DateTimeException(SysTime.fromSimpleString("20101222T172201"));
assertThrown!DateTimeException(SysTime.fromSimpleString("2010-12-22T172201"));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01") == SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
assert(SysTime.fromSimpleString("1999-Jul-06 12:30:33") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromSimpleString("-1999-Jul-06 12:30:33") == SysTime(DateTime(-1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromSimpleString("+01999-Jul-06 12:30:33") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromSimpleString("1999-Jul-06 12:30:33 ") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromSimpleString(" 1999-Jul-06 12:30:33") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromSimpleString(" 1999-Jul-06 12:30:33 ") == SysTime(DateTime(1999, 7, 6, 12, 30, 33)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.0") == SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.0000000") == SysTime(DateTime(1907, 07, 07, 12, 12, 12)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.0000001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), hnsecs(1)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.000001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.0000010") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), usecs(1)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.001") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
assert(SysTime.fromSimpleString("1907-Jul-07 12:12:12.0010000") ==
SysTime(DateTime(1907, 07, 07, 12, 12, 12), msecs(1)));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01Z") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), UTC()));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01-1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01-1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01-1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-90))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01-8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(-480))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01+1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01+1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01+1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(90))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01+8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), new immutable SimpleTimeZone(dur!"minutes"(480))));
assert(SysTime.fromSimpleString("2010-Nov-03 06:51:06.57159Z") ==
SysTime(DateTime(2010, 11, 3, 6, 51, 6), hnsecs(5715900), UTC()));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.23412Z") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_341_200), UTC()));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.23112-1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(2_311_200),
new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.45-1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000),
new immutable SimpleTimeZone(dur!"minutes"(-60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.1-1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_000_000),
new immutable SimpleTimeZone(dur!"minutes"(-90))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.55-8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(5_500_000),
new immutable SimpleTimeZone(dur!"minutes"(-480))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.1234567+1:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(1_234_567),
new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.0+1") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01),
new immutable SimpleTimeZone(dur!"minutes"(60))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.0000000+1:30") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01),
new immutable SimpleTimeZone(dur!"minutes"(90))));
assert(SysTime.fromSimpleString("2010-Dec-22 17:22:01.45+8:00") ==
SysTime(DateTime(2010, 12, 22, 17, 22, 01), hnsecs(4_500_000),
new immutable SimpleTimeZone(dur!"minutes"(480))));
}
/++
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());
}
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());
}
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
{
return _timezone.utcToTZ(_stdTime);
}
/+
Converts the given hnsecs from $(LREF SysTime)'s time zone to std time.
+/
@property void adjTime(long adjTime) @safe nothrow
{
_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;
}
/++
Represents a date in the
$(WEB en.wikipedia.org/wiki/Proleptic_Gregorian_calendar, Proleptic Gregorian Calendar)
ranging from
32,768 B.C. to 32,767 A.D. Positive years are A.D. Non-positive years are
B.C.
Year, month, and day are kept separately internally so that $(D Date) is
optimized for calendar-based operations.
$(D Date) uses the Proleptic Gregorian Calendar, so it assumes the Gregorian
leap year calculations for its entire length. As per
$(WEB en.wikipedia.org/wiki/ISO_8601, ISO 8601), it treats 1 B.C. as
year 0, i.e. 1 B.C. is 0, 2 B.C. is -1, etc. Use $(LREF yearBC) to use B.C. as
a positive integer with 1 B.C. being the year prior to 1 A.D.
Year 0 is a leap year.
+/
struct Date
{
public:
/++
Throws:
$(LREF DateTimeException) if the resulting $(LREF Date) would not be valid.
Params:
year = Year of the Gregorian Calendar. Positive values are A.D.
Non-positive values are B.C. with year 0 being the year
prior to 1 A.D.
month = Month of the year.
day = Day of the month.
+/
this(int year, int month, int day) @safe pure
{
enforceValid!"months"(cast(Month)month);
enforceValid!"days"(year, cast(Month)month, day);
_year = cast(short)year;
_month = cast(Month)month;
_day = cast(ubyte)day;
}
unittest
{
assert(Date(1, 1, 1) == Date.init);
static void testDate(in Date date, int year, int month, int day)
{
assert(date._year == year);
assert(date._month == month);
assert(date._day == day);
}
testDate(Date(1999, 1 , 1), 1999, Month.jan, 1);
testDate(Date(1999, 7 , 1), 1999, Month.jul, 1);
testDate(Date(1999, 7 , 6), 1999, Month.jul, 6);
//Test A.D.
assertThrown!DateTimeException(Date(1, 0, 1));
assertThrown!DateTimeException(Date(1, 1, 0));
assertThrown!DateTimeException(Date(1999, 13, 1));
assertThrown!DateTimeException(Date(1999, 1, 32));
assertThrown!DateTimeException(Date(1999, 2, 29));
assertThrown!DateTimeException(Date(2000, 2, 30));
assertThrown!DateTimeException(Date(1999, 3, 32));
assertThrown!DateTimeException(Date(1999, 4, 31));
assertThrown!DateTimeException(Date(1999, 5, 32));
assertThrown!DateTimeException(Date(1999, 6, 31));
assertThrown!DateTimeException(Date(1999, 7, 32));
assertThrown!DateTimeException(Date(1999, 8, 32));
assertThrown!DateTimeException(Date(1999, 9, 31));
assertThrown!DateTimeException(Date(1999, 10, 32));
assertThrown!DateTimeException(Date(1999, 11, 31));
assertThrown!DateTimeException(Date(1999, 12, 32));
assertNotThrown!DateTimeException(Date(1999, 1, 31));
assertNotThrown!DateTimeException(Date(1999, 2, 28));
assertNotThrown!DateTimeException(Date(2000, 2, 29));
assertNotThrown!DateTimeException(Date(1999, 3, 31));
assertNotThrown!DateTimeException(Date(1999, 4, 30));
assertNotThrown!DateTimeException(Date(1999, 5, 31));
assertNotThrown!DateTimeException(Date(1999, 6, 30));
assertNotThrown!DateTimeException(Date(1999, 7, 31));
assertNotThrown!DateTimeException(Date(1999, 8, 31));
assertNotThrown!DateTimeException(Date(1999, 9, 30));
assertNotThrown!DateTimeException(Date(1999, 10, 31));
assertNotThrown!DateTimeException(Date(1999, 11, 30));
assertNotThrown!DateTimeException(Date(1999, 12, 31));
//Test B.C.
assertNotThrown!DateTimeException(Date(0, 1, 1));
assertNotThrown!DateTimeException(Date(-1, 1, 1));
assertNotThrown!DateTimeException(Date(-1, 12, 31));
assertNotThrown!DateTimeException(Date(-1, 2, 28));
assertNotThrown!DateTimeException(Date(-4, 2, 29));
assertThrown!DateTimeException(Date(-1, 2, 29));
assertThrown!DateTimeException(Date(-2, 2, 29));
assertThrown!DateTimeException(Date(-3, 2, 29));
}
/++
Params:
day = The Xth day of the Gregorian Calendar that the constructed
$(LREF Date) will be for.
+/
this(int day) @safe pure nothrow
{
if(day > 0)
{
int years = (day / daysIn400Years) * 400 + 1;
day %= daysIn400Years;
{
immutable tempYears = day / daysIn100Years;
if(tempYears == 4)
{
years += 300;
day -= daysIn100Years * 3;
}
else
{
years += tempYears * 100;
day %= daysIn100Years;
}
}
years += (day / daysIn4Years) * 4;
day %= daysIn4Years;
{
immutable tempYears = day / daysInYear;
if(tempYears == 4)
{
years += 3;
day -= daysInYear * 3;
}
else
{
years += tempYears;
day %= daysInYear;
}
}
if(day == 0)
{
_year = cast(short)(years - 1);
_month = Month.dec;
_day = 31;
}
else
{
_year = cast(short)years;
try
dayOfYear = day;
catch(Exception e)
assert(0, "dayOfYear assignment threw.");
}
}
else if(day <= 0 && -day < daysInLeapYear)
{
_year = 0;
try
dayOfYear = (daysInLeapYear + day);
catch(Exception e)
assert(0, "dayOfYear assignment threw.");
}
else
{
day += daysInLeapYear - 1;
int years = (day / daysIn400Years) * 400 - 1;
day %= daysIn400Years;
{
immutable tempYears = day / daysIn100Years;
if(tempYears == -4)
{
years -= 300;
day += daysIn100Years * 3;
}
else
{
years += tempYears * 100;
day %= daysIn100Years;
}
}
years += (day / daysIn4Years) * 4;
day %= daysIn4Years;
{
immutable tempYears = day / daysInYear;
if(tempYears == -4)
{
years -= 3;
day += daysInYear * 3;
}
else
{
years += tempYears;
day %= daysInYear;
}
}
if(day == 0)
{
_year = cast(short)(years + 1);
_month = Month.jan;
_day = 1;
}
else
{
_year = cast(short)years;
immutable newDoY = (yearIsLeapYear(_year) ? daysInLeapYear : daysInYear) + day + 1;
try
dayOfYear = newDoY;
catch(Exception e)
assert(0, "dayOfYear assignment threw.");
}
}
}
unittest
{
import std.range;
//Test A.D.
foreach(gd; chain(testGregDaysBC, testGregDaysAD))
assert(Date(gd.day) == gd.date);
}
/++
Compares this $(LREF Date) with the given $(LREF Date).
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
+/
int opCmp(in Date rhs) @safe const pure nothrow
{
if(_year < rhs._year)
return -1;
if(_year > rhs._year)
return 1;
if(_month < rhs._month)
return -1;
if(_month > rhs._month)
return 1;
if(_day < rhs._day)
return -1;
if(_day > rhs._day)
return 1;
return 0;
}
unittest
{
//Test A.D.
assert(Date(1, 1, 1).opCmp(Date.init) == 0);
assert(Date(1999, 1, 1).opCmp(Date(1999, 1, 1)) == 0);
assert(Date(1, 7, 1).opCmp(Date(1, 7, 1)) == 0);
assert(Date(1, 1, 6).opCmp(Date(1, 1, 6)) == 0);
assert(Date(1999, 7, 1).opCmp(Date(1999, 7, 1)) == 0);
assert(Date(1999, 7, 6).opCmp(Date(1999, 7, 6)) == 0);
assert(Date(1, 7, 6).opCmp(Date(1, 7, 6)) == 0);
assert(Date(1999, 7, 6).opCmp(Date(2000, 7, 6)) < 0);
assert(Date(2000, 7, 6).opCmp(Date(1999, 7, 6)) > 0);
assert(Date(1999, 7, 6).opCmp(Date(1999, 8, 6)) < 0);
assert(Date(1999, 8, 6).opCmp(Date(1999, 7, 6)) > 0);
assert(Date(1999, 7, 6).opCmp(Date(1999, 7, 7)) < 0);
assert(Date(1999, 7, 7).opCmp(Date(1999, 7, 6)) > 0);
assert(Date(1999, 8, 7).opCmp(Date(2000, 7, 6)) < 0);
assert(Date(2000, 8, 6).opCmp(Date(1999, 7, 7)) > 0);
assert(Date(1999, 7, 7).opCmp(Date(2000, 7, 6)) < 0);
assert(Date(2000, 7, 6).opCmp(Date(1999, 7, 7)) > 0);
assert(Date(1999, 7, 7).opCmp(Date(1999, 8, 6)) < 0);
assert(Date(1999, 8, 6).opCmp(Date(1999, 7, 7)) > 0);
//Test B.C.
assert(Date(0, 1, 1).opCmp(Date(0, 1, 1)) == 0);
assert(Date(-1, 1, 1).opCmp(Date(-1, 1, 1)) == 0);
assert(Date(-1, 7, 1).opCmp(Date(-1, 7, 1)) == 0);
assert(Date(-1, 1, 6).opCmp(Date(-1, 1, 6)) == 0);
assert(Date(-1999, 7, 1).opCmp(Date(-1999, 7, 1)) == 0);
assert(Date(-1999, 7, 6).opCmp(Date(-1999, 7, 6)) == 0);
assert(Date(-1, 7, 6).opCmp(Date(-1, 7, 6)) == 0);
assert(Date(-2000, 7, 6).opCmp(Date(-1999, 7, 6)) < 0);
assert(Date(-1999, 7, 6).opCmp(Date(-2000, 7, 6)) > 0);
assert(Date(-1999, 7, 6).opCmp(Date(-1999, 8, 6)) < 0);
assert(Date(-1999, 8, 6).opCmp(Date(-1999, 7, 6)) > 0);
assert(Date(-1999, 7, 6).opCmp(Date(-1999, 7, 7)) < 0);
assert(Date(-1999, 7, 7).opCmp(Date(-1999, 7, 6)) > 0);
assert(Date(-2000, 8, 6).opCmp(Date(-1999, 7, 7)) < 0);
assert(Date(-1999, 8, 7).opCmp(Date(-2000, 7, 6)) > 0);
assert(Date(-2000, 7, 6).opCmp(Date(-1999, 7, 7)) < 0);
assert(Date(-1999, 7, 7).opCmp(Date(-2000, 7, 6)) > 0);
assert(Date(-1999, 7, 7).opCmp(Date(-1999, 8, 6)) < 0);
assert(Date(-1999, 8, 6).opCmp(Date(-1999, 7, 7)) > 0);
//Test Both
assert(Date(-1999, 7, 6).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 7, 6)) > 0);
assert(Date(-1999, 8, 6).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 8, 6)) > 0);
assert(Date(-1999, 7, 7).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 7, 7)) > 0);
assert(Date(-1999, 8, 7).opCmp(Date(1999, 7, 6)) < 0);
assert(Date(1999, 7, 6).opCmp(Date(-1999, 8, 7)) > 0);
assert(Date(-1999, 8, 6).opCmp(Date(1999, 6, 6)) < 0);
assert(Date(1999, 6, 8).opCmp(Date(-1999, 7, 6)) > 0);
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date.opCmp(date)));
static assert(__traits(compiles, date.opCmp(cdate)));
static assert(__traits(compiles, date.opCmp(idate)));
static assert(__traits(compiles, cdate.opCmp(date)));
static assert(__traits(compiles, cdate.opCmp(cdate)));
static assert(__traits(compiles, cdate.opCmp(idate)));
static assert(__traits(compiles, idate.opCmp(date)));
static assert(__traits(compiles, idate.opCmp(cdate)));
static assert(__traits(compiles, idate.opCmp(idate)));
}
/++
Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive
are B.C.
+/
@property short year() @safe const pure nothrow
{
return _year;
}
///
unittest
{
assert(Date(1999, 7, 6).year == 1999);
assert(Date(2010, 10, 4).year == 2010);
assert(Date(-7, 4, 5).year == -7);
}
unittest
{
assert(Date.init.year == 1);
assert(Date(1999, 7, 6).year == 1999);
assert(Date(-1999, 7, 6).year == -1999);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.year == 1999));
static assert(__traits(compiles, idate.year == 1999));
}
/++
Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive
are B.C.
Params:
year = The year to set this Date's year to.
Throws:
$(LREF DateTimeException) if the new year is not a leap year and the
resulting date would be on February 29th.
+/
@property void year(int year) @safe pure
{
enforceValid!"days"(year, _month, _day);
_year = cast(short)year;
}
///
unittest
{
assert(Date(1999, 7, 6).year == 1999);
assert(Date(2010, 10, 4).year == 2010);
assert(Date(-7, 4, 5).year == -7);
}
unittest
{
static void testDateInvalid(Date date, int year)
{
date.year = year;
}
static void testDate(Date date, int year, in Date expected)
{
date.year = year;
assert(date == expected);
}
assertThrown!DateTimeException(testDateInvalid(Date(4, 2, 29), 1));
testDate(Date(1, 1, 1), 1999, Date(1999, 1, 1));
testDate(Date(1, 1, 1), 0, Date(0, 1, 1));
testDate(Date(1, 1, 1), -1999, Date(-1999, 1, 1));
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.year = 1999));
static assert(!__traits(compiles, idate.year = 1999));
}
/++
Year B.C. of the Gregorian Calendar counting year 0 as 1 B.C.
Throws:
$(LREF DateTimeException) if $(D isAD) is true.
+/
@property ushort yearBC() @safe const pure
{
import std.format : format;
if(isAD)
throw new DateTimeException(format("Year %s is A.D.", _year));
return cast(ushort)((_year * -1) + 1);
}
///
unittest
{
assert(Date(0, 1, 1).yearBC == 1);
assert(Date(-1, 1, 1).yearBC == 2);
assert(Date(-100, 1, 1).yearBC == 101);
}
unittest
{
assertThrown!DateTimeException((in Date date){date.yearBC;}(Date(1, 1, 1)));
auto date = Date(0, 7, 6);
const cdate = Date(0, 7, 6);
immutable idate = Date(0, 7, 6);
static assert(__traits(compiles, date.yearBC));
static assert(__traits(compiles, cdate.yearBC));
static assert(__traits(compiles, idate.yearBC));
}
/++
Year B.C. of the Gregorian Calendar counting year 0 as 1 B.C.
Params:
year = The year B.C. to set this $(LREF Date)'s year to.
Throws:
$(LREF DateTimeException) if a non-positive value is given.
+/
@property void yearBC(int year) @safe pure
{
if(year <= 0)
throw new DateTimeException("The given year is not a year B.C.");
_year = cast(short)((year - 1) * -1);
}
///
unittest
{
auto date = Date(2010, 1, 1);
date.yearBC = 1;
assert(date == Date(0, 1, 1));
date.yearBC = 10;
assert(date == Date(-9, 1, 1));
}
unittest
{
assertThrown!DateTimeException((Date date){date.yearBC = -1;}(Date(1, 1, 1)));
auto date = Date(0, 7, 6);
const cdate = Date(0, 7, 6);
immutable idate = Date(0, 7, 6);
static assert(__traits(compiles, date.yearBC = 7));
static assert(!__traits(compiles, cdate.yearBC = 7));
static assert(!__traits(compiles, idate.yearBC = 7));
}
/++
Month of a Gregorian Year.
+/
@property Month month() @safe const pure nothrow
{
return _month;
}
///
unittest
{
assert(Date(1999, 7, 6).month == 7);
assert(Date(2010, 10, 4).month == 10);
assert(Date(-7, 4, 5).month == 4);
}
unittest
{
assert(Date.init.month == 1);
assert(Date(1999, 7, 6).month == 7);
assert(Date(-1999, 7, 6).month == 7);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.month == 7));
static assert(__traits(compiles, idate.month == 7));
}
/++
Month of a Gregorian Year.
Params:
month = The month to set this $(LREF Date)'s month to.
Throws:
$(LREF DateTimeException) if the given month is not a valid month or if
the current day would not be valid in the given month.
+/
@property void month(Month month) @safe pure
{
enforceValid!"months"(month);
enforceValid!"days"(_year, month, _day);
_month = cast(Month)month;
}
unittest
{
static void testDate(Date date, Month month, in Date expected = Date.init)
{
date.month = month;
assert(expected != Date.init);
assert(date == expected);
}
assertThrown!DateTimeException(testDate(Date(1, 1, 1), cast(Month)0));
assertThrown!DateTimeException(testDate(Date(1, 1, 1), cast(Month)13));
assertThrown!DateTimeException(testDate(Date(1, 1, 29), cast(Month)2));
assertThrown!DateTimeException(testDate(Date(0, 1, 30), cast(Month)2));
testDate(Date(1, 1, 1), cast(Month)7, Date(1, 7, 1));
testDate(Date(-1, 1, 1), cast(Month)7, Date(-1, 7, 1));
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.month = 7));
static assert(!__traits(compiles, idate.month = 7));
}
/++
Day of a Gregorian Month.
+/
@property ubyte day() @safe const pure nothrow
{
return _day;
}
///
unittest
{
assert(Date(1999, 7, 6).day == 6);
assert(Date(2010, 10, 4).day == 4);
assert(Date(-7, 4, 5).day == 5);
}
unittest
{
import std.range;
import std.format : format;
static void test(Date date, int expected)
{
assert(date.day == expected,
format("Value given: %s", date));
}
foreach(year; chain(testYearsBC, testYearsAD))
{
foreach(md; testMonthDays)
test(Date(year, md.month, md.day), md.day);
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.day == 6));
static assert(__traits(compiles, idate.day == 6));
}
/++
Day of a Gregorian Month.
Params:
day = The day of the month to set this $(LREF Date)'s day to.
Throws:
$(LREF DateTimeException) if the given day is not a valid day of the
current month.
+/
@property void day(int day) @safe pure
{
enforceValid!"days"(_year, _month, day);
_day = cast(ubyte)day;
}
unittest
{
static void testDate(Date date, int day)
{
date.day = day;
}
//Test A.D.
assertThrown!DateTimeException(testDate(Date(1, 1, 1), 0));
assertThrown!DateTimeException(testDate(Date(1, 1, 1), 32));
assertThrown!DateTimeException(testDate(Date(1, 2, 1), 29));
assertThrown!DateTimeException(testDate(Date(4, 2, 1), 30));
assertThrown!DateTimeException(testDate(Date(1, 3, 1), 32));
assertThrown!DateTimeException(testDate(Date(1, 4, 1), 31));
assertThrown!DateTimeException(testDate(Date(1, 5, 1), 32));
assertThrown!DateTimeException(testDate(Date(1, 6, 1), 31));
assertThrown!DateTimeException(testDate(Date(1, 7, 1), 32));
assertThrown!DateTimeException(testDate(Date(1, 8, 1), 32));
assertThrown!DateTimeException(testDate(Date(1, 9, 1), 31));
assertThrown!DateTimeException(testDate(Date(1, 10, 1), 32));
assertThrown!DateTimeException(testDate(Date(1, 11, 1), 31));
assertThrown!DateTimeException(testDate(Date(1, 12, 1), 32));
assertNotThrown!DateTimeException(testDate(Date(1, 1, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(1, 2, 1), 28));
assertNotThrown!DateTimeException(testDate(Date(4, 2, 1), 29));
assertNotThrown!DateTimeException(testDate(Date(1, 3, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(1, 4, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(1, 5, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(1, 6, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(1, 7, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(1, 8, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(1, 9, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(1, 10, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(1, 11, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(1, 12, 1), 31));
{
auto date = Date(1, 1, 1);
date.day = 6;
assert(date == Date(1, 1, 6));
}
//Test B.C.
assertThrown!DateTimeException(testDate(Date(-1, 1, 1), 0));
assertThrown!DateTimeException(testDate(Date(-1, 1, 1), 32));
assertThrown!DateTimeException(testDate(Date(-1, 2, 1), 29));
assertThrown!DateTimeException(testDate(Date(0, 2, 1), 30));
assertThrown!DateTimeException(testDate(Date(-1, 3, 1), 32));
assertThrown!DateTimeException(testDate(Date(-1, 4, 1), 31));
assertThrown!DateTimeException(testDate(Date(-1, 5, 1), 32));
assertThrown!DateTimeException(testDate(Date(-1, 6, 1), 31));
assertThrown!DateTimeException(testDate(Date(-1, 7, 1), 32));
assertThrown!DateTimeException(testDate(Date(-1, 8, 1), 32));
assertThrown!DateTimeException(testDate(Date(-1, 9, 1), 31));
assertThrown!DateTimeException(testDate(Date(-1, 10, 1), 32));
assertThrown!DateTimeException(testDate(Date(-1, 11, 1), 31));
assertThrown!DateTimeException(testDate(Date(-1, 12, 1), 32));
assertNotThrown!DateTimeException(testDate(Date(-1, 1, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(-1, 2, 1), 28));
assertNotThrown!DateTimeException(testDate(Date(0, 2, 1), 29));
assertNotThrown!DateTimeException(testDate(Date(-1, 3, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(-1, 4, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(-1, 5, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(-1, 6, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(-1, 7, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(-1, 8, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(-1, 9, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(-1, 10, 1), 31));
assertNotThrown!DateTimeException(testDate(Date(-1, 11, 1), 30));
assertNotThrown!DateTimeException(testDate(Date(-1, 12, 1), 31));
{
auto date = Date(-1, 1, 1);
date.day = 6;
assert(date == Date(-1, 1, 6));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.day = 6));
static assert(!__traits(compiles, idate.day = 6));
}
/++
Adds the given number of years or months to this $(LREF Date). 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 Date).
allowOverflow = Whether the day should be allowed to overflow,
causing the month to increment.
+/
ref Date add(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
if(units == "years")
{
immutable newYear = _year + value;
_year += value;
if(_month == Month.feb && _day == 29 && !yearIsLeapYear(_year))
{
if(allowOverflow == AllowDayOverflow.yes)
{
_month = Month.mar;
_day = 1;
}
else
_day = 28;
}
return this;
}
///
unittest
{
auto d1 = Date(2010, 1, 1);
d1.add!"months"(11);
assert(d1 == Date(2010, 12, 1));
auto d2 = Date(2010, 1, 1);
d2.add!"months"(-11);
assert(d2 == Date(2009, 2, 1));
auto d3 = Date(2000, 2, 29);
d3.add!"years"(1);
assert(d3 == Date(2001, 3, 1));
auto d4 = Date(2000, 2, 29);
d4.add!"years"(1, AllowDayOverflow.no);
assert(d4 == Date(2001, 2, 28));
}
//Test add!"years"() with AllowDayOverlow.yes
unittest
{
//Test A.D.
{
auto date = Date(1999, 7, 6);
date.add!"years"(7);
assert(date == Date(2006, 7, 6));
date.add!"years"(-9);
assert(date == Date(1997, 7, 6));
}
{
auto date = Date(1999, 2, 28);
date.add!"years"(1);
assert(date == Date(2000, 2, 28));
}
{
auto date = Date(2000, 2, 29);
date.add!"years"(-1);
assert(date == Date(1999, 3, 1));
}
//Test B.C.
{
auto date = Date(-1999, 7, 6);
date.add!"years"(-7);
assert(date == Date(-2006, 7, 6));
date.add!"years"(9);
assert(date == Date(-1997, 7, 6));
}
{
auto date = Date(-1999, 2, 28);
date.add!"years"(-1);
assert(date == Date(-2000, 2, 28));
}
{
auto date = Date(-2000, 2, 29);
date.add!"years"(1);
assert(date == Date(-1999, 3, 1));
}
//Test Both
{
auto date = Date(4, 7, 6);
date.add!"years"(-5);
assert(date == Date(-1, 7, 6));
date.add!"years"(5);
assert(date == Date(4, 7, 6));
}
{
auto date = Date(-4, 7, 6);
date.add!"years"(5);
assert(date == Date(1, 7, 6));
date.add!"years"(-5);
assert(date == Date(-4, 7, 6));
}
{
auto date = Date(4, 7, 6);
date.add!"years"(-8);
assert(date == Date(-4, 7, 6));
date.add!"years"(8);
assert(date == Date(4, 7, 6));
}
{
auto date = Date(-4, 7, 6);
date.add!"years"(8);
assert(date == Date(4, 7, 6));
date.add!"years"(-8);
assert(date == Date(-4, 7, 6));
}
{
auto date = Date(-4, 2, 29);
date.add!"years"(5);
assert(date == Date(1, 3, 1));
}
{
auto date = Date(4, 2, 29);
date.add!"years"(-5);
assert(date == Date(-1, 3, 1));
}
{
auto date = Date(4, 2, 29);
date.add!"years"(-5).add!"years"(7);
assert(date == Date(6, 3, 1));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.add!"years"(7)));
static assert(!__traits(compiles, idate.add!"years"(7)));
}
//Test add!"years"() with AllowDayOverlow.no
unittest
{
//Test A.D.
{
auto date = Date(1999, 7, 6);
date.add!"years"(7, AllowDayOverflow.no);
assert(date == Date(2006, 7, 6));
date.add!"years"(-9, AllowDayOverflow.no);
assert(date == Date(1997, 7, 6));
}
{
auto date = Date(1999, 2, 28);
date.add!"years"(1, AllowDayOverflow.no);
assert(date == Date(2000, 2, 28));
}
{
auto date = Date(2000, 2, 29);
date.add!"years"(-1, AllowDayOverflow.no);
assert(date == Date(1999, 2, 28));
}
//Test B.C.
{
auto date = Date(-1999, 7, 6);
date.add!"years"(-7, AllowDayOverflow.no);
assert(date == Date(-2006, 7, 6));
date.add!"years"(9, AllowDayOverflow.no);
assert(date == Date(-1997, 7, 6));
}
{
auto date = Date(-1999, 2, 28);
date.add!"years"(-1, AllowDayOverflow.no);
assert(date == Date(-2000, 2, 28));
}
{
auto date = Date(-2000, 2, 29);
date.add!"years"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 2, 28));
}
//Test Both
{
auto date = Date(4, 7, 6);
date.add!"years"(-5, AllowDayOverflow.no);
assert(date == Date(-1, 7, 6));
date.add!"years"(5, AllowDayOverflow.no);
assert(date == Date(4, 7, 6));
}
{
auto date = Date(-4, 7, 6);
date.add!"years"(5, AllowDayOverflow.no);
assert(date == Date(1, 7, 6));
date.add!"years"(-5, AllowDayOverflow.no);
assert(date == Date(-4, 7, 6));
}
{
auto date = Date(4, 7, 6);
date.add!"years"(-8, AllowDayOverflow.no);
assert(date == Date(-4, 7, 6));
date.add!"years"(8, AllowDayOverflow.no);
assert(date == Date(4, 7, 6));
}
{
auto date = Date(-4, 7, 6);
date.add!"years"(8, AllowDayOverflow.no);
assert(date == Date(4, 7, 6));
date.add!"years"(-8, AllowDayOverflow.no);
assert(date == Date(-4, 7, 6));
}
{
auto date = Date(-4, 2, 29);
date.add!"years"(5, AllowDayOverflow.no);
assert(date == Date(1, 2, 28));
}
{
auto date = Date(4, 2, 29);
date.add!"years"(-5, AllowDayOverflow.no);
assert(date == Date(-1, 2, 28));
}
{
auto date = Date(4, 2, 29);
date.add!"years"(-5, AllowDayOverflow.no).add!"years"(7, AllowDayOverflow.no);
assert(date == Date(6, 2, 28));
}
}
//Shares documentation with "years" version.
ref Date add(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
if(units == "months")
{
auto years = months / 12;
months %= 12;
auto newMonth = _month + months;
if(months < 0)
{
if(newMonth < 1)
{
newMonth += 12;
--years;
}
}
else if(newMonth > 12)
{
newMonth -= 12;
++years;
}
_year += years;
_month = cast(Month)newMonth;
immutable currMaxDay = maxDay(_year, _month);
immutable overflow = _day - currMaxDay;
if(overflow > 0)
{
if(allowOverflow == AllowDayOverflow.yes)
{
++_month;
_day = cast(ubyte)overflow;
}
else
_day = cast(ubyte)currMaxDay;
}
return this;
}
//Test add!"months"() with AllowDayOverlow.yes
unittest
{
//Test A.D.
{
auto date = Date(1999, 7, 6);
date.add!"months"(3);
assert(date == Date(1999, 10, 6));
date.add!"months"(-4);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 7, 6);
date.add!"months"(6);
assert(date == Date(2000, 1, 6));
date.add!"months"(-6);
assert(date == Date(1999, 7, 6));
}
{
auto date = Date(1999, 7, 6);
date.add!"months"(27);
assert(date == Date(2001, 10, 6));
date.add!"months"(-28);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 5, 31);
date.add!"months"(1);
assert(date == Date(1999, 7, 1));
}
{
auto date = Date(1999, 5, 31);
date.add!"months"(-1);
assert(date == Date(1999, 5, 1));
}
{
auto date = Date(1999, 2, 28);
date.add!"months"(12);
assert(date == Date(2000, 2, 28));
}
{
auto date = Date(2000, 2, 29);
date.add!"months"(12);
assert(date == Date(2001, 3, 1));
}
{
auto date = Date(1999, 7, 31);
date.add!"months"(1);
assert(date == Date(1999, 8, 31));
date.add!"months"(1);
assert(date == Date(1999, 10, 1));
}
{
auto date = Date(1998, 8, 31);
date.add!"months"(13);
assert(date == Date(1999, 10, 1));
date.add!"months"(-13);
assert(date == Date(1998, 9, 1));
}
{
auto date = Date(1997, 12, 31);
date.add!"months"(13);
assert(date == Date(1999, 1, 31));
date.add!"months"(-13);
assert(date == Date(1997, 12, 31));
}
{
auto date = Date(1997, 12, 31);
date.add!"months"(14);
assert(date == Date(1999, 3, 3));
date.add!"months"(-14);
assert(date == Date(1998, 1, 3));
}
{
auto date = Date(1998, 12, 31);
date.add!"months"(14);
assert(date == Date(2000, 3, 2));
date.add!"months"(-14);
assert(date == Date(1999, 1, 2));
}
{
auto date = Date(1999, 12, 31);
date.add!"months"(14);
assert(date == Date(2001, 3, 3));
date.add!"months"(-14);
assert(date == Date(2000, 1, 3));
}
//Test B.C.
{
auto date = Date(-1999, 7, 6);
date.add!"months"(3);
assert(date == Date(-1999, 10, 6));
date.add!"months"(-4);
assert(date == Date(-1999, 6, 6));
}
{
auto date = Date(-1999, 7, 6);
date.add!"months"(6);
assert(date == Date(-1998, 1, 6));
date.add!"months"(-6);
assert(date == Date(-1999, 7, 6));
}
{
auto date = Date(-1999, 7, 6);
date.add!"months"(-27);
assert(date == Date(-2001, 4, 6));
date.add!"months"(28);
assert(date == Date(-1999, 8, 6));
}
{
auto date = Date(-1999, 5, 31);
date.add!"months"(1);
assert(date == Date(-1999, 7, 1));
}
{
auto date = Date(-1999, 5, 31);
date.add!"months"(-1);
assert(date == Date(-1999, 5, 1));
}
{
auto date = Date(-1999, 2, 28);
date.add!"months"(-12);
assert(date == Date(-2000, 2, 28));
}
{
auto date = Date(-2000, 2, 29);
date.add!"months"(-12);
assert(date == Date(-2001, 3, 1));
}
{
auto date = Date(-1999, 7, 31);
date.add!"months"(1);
assert(date == Date(-1999, 8, 31));
date.add!"months"(1);
assert(date == Date(-1999, 10, 1));
}
{
auto date = Date(-1998, 8, 31);
date.add!"months"(13);
assert(date == Date(-1997, 10, 1));
date.add!"months"(-13);
assert(date == Date(-1998, 9, 1));
}
{
auto date = Date(-1997, 12, 31);
date.add!"months"(13);
assert(date == Date(-1995, 1, 31));
date.add!"months"(-13);
assert(date == Date(-1997, 12, 31));
}
{
auto date = Date(-1997, 12, 31);
date.add!"months"(14);
assert(date == Date(-1995, 3, 3));
date.add!"months"(-14);
assert(date == Date(-1996, 1, 3));
}
{
auto date = Date(-2002, 12, 31);
date.add!"months"(14);
assert(date == Date(-2000, 3, 2));
date.add!"months"(-14);
assert(date == Date(-2001, 1, 2));
}
{
auto date = Date(-2001, 12, 31);
date.add!"months"(14);
assert(date == Date(-1999, 3, 3));
date.add!"months"(-14);
assert(date == Date(-2000, 1, 3));
}
//Test Both
{
auto date = Date(1, 1, 1);
date.add!"months"(-1);
assert(date == Date(0, 12, 1));
date.add!"months"(1);
assert(date == Date(1, 1, 1));
}
{
auto date = Date(4, 1, 1);
date.add!"months"(-48);
assert(date == Date(0, 1, 1));
date.add!"months"(48);
assert(date == Date(4, 1, 1));
}
{
auto date = Date(4, 3, 31);
date.add!"months"(-49);
assert(date == Date(0, 3, 2));
date.add!"months"(49);
assert(date == Date(4, 4, 2));
}
{
auto date = Date(4, 3, 31);
date.add!"months"(-85);
assert(date == Date(-3, 3, 3));
date.add!"months"(85);
assert(date == Date(4, 4, 3));
}
{
auto date = Date(-3, 3, 31);
date.add!"months"(85).add!"months"(-83);
assert(date == Date(-3, 6, 1));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.add!"months"(3)));
static assert(!__traits(compiles, idate.add!"months"(3)));
}
//Test add!"months"() with AllowDayOverlow.no
unittest
{
//Test A.D.
{
auto date = Date(1999, 7, 6);
date.add!"months"(3, AllowDayOverflow.no);
assert(date == Date(1999, 10, 6));
date.add!"months"(-4, AllowDayOverflow.no);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 7, 6);
date.add!"months"(6, AllowDayOverflow.no);
assert(date == Date(2000, 1, 6));
date.add!"months"(-6, AllowDayOverflow.no);
assert(date == Date(1999, 7, 6));
}
{
auto date = Date(1999, 7, 6);
date.add!"months"(27, AllowDayOverflow.no);
assert(date == Date(2001, 10, 6));
date.add!"months"(-28, AllowDayOverflow.no);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 5, 31);
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(1999, 6, 30));
}
{
auto date = Date(1999, 5, 31);
date.add!"months"(-1, AllowDayOverflow.no);
assert(date == Date(1999, 4, 30));
}
{
auto date = Date(1999, 2, 28);
date.add!"months"(12, AllowDayOverflow.no);
assert(date == Date(2000, 2, 28));
}
{
auto date = Date(2000, 2, 29);
date.add!"months"(12, AllowDayOverflow.no);
assert(date == Date(2001, 2, 28));
}
{
auto date = Date(1999, 7, 31);
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(1999, 8, 31));
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(1999, 9, 30));
}
{
auto date = Date(1998, 8, 31);
date.add!"months"(13, AllowDayOverflow.no);
assert(date == Date(1999, 9, 30));
date.add!"months"(-13, AllowDayOverflow.no);
assert(date == Date(1998, 8, 30));
}
{
auto date = Date(1997, 12, 31);
date.add!"months"(13, AllowDayOverflow.no);
assert(date == Date(1999, 1, 31));
date.add!"months"(-13, AllowDayOverflow.no);
assert(date == Date(1997, 12, 31));
}
{
auto date = Date(1997, 12, 31);
date.add!"months"(14, AllowDayOverflow.no);
assert(date == Date(1999, 2, 28));
date.add!"months"(-14, AllowDayOverflow.no);
assert(date == Date(1997, 12, 28));
}
{
auto date = Date(1998, 12, 31);
date.add!"months"(14, AllowDayOverflow.no);
assert(date == Date(2000, 2, 29));
date.add!"months"(-14, AllowDayOverflow.no);
assert(date == Date(1998, 12, 29));
}
{
auto date = Date(1999, 12, 31);
date.add!"months"(14, AllowDayOverflow.no);
assert(date == Date(2001, 2, 28));
date.add!"months"(-14, AllowDayOverflow.no);
assert(date == Date(1999, 12, 28));
}
//Test B.C.
{
auto date = Date(-1999, 7, 6);
date.add!"months"(3, AllowDayOverflow.no);
assert(date == Date(-1999, 10, 6));
date.add!"months"(-4, AllowDayOverflow.no);
assert(date == Date(-1999, 6, 6));
}
{
auto date = Date(-1999, 7, 6);
date.add!"months"(6, AllowDayOverflow.no);
assert(date == Date(-1998, 1, 6));
date.add!"months"(-6, AllowDayOverflow.no);
assert(date == Date(-1999, 7, 6));
}
{
auto date = Date(-1999, 7, 6);
date.add!"months"(-27, AllowDayOverflow.no);
assert(date == Date(-2001, 4, 6));
date.add!"months"(28, AllowDayOverflow.no);
assert(date == Date(-1999, 8, 6));
}
{
auto date = Date(-1999, 5, 31);
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 6, 30));
}
{
auto date = Date(-1999, 5, 31);
date.add!"months"(-1, AllowDayOverflow.no);
assert(date == Date(-1999, 4, 30));
}
{
auto date = Date(-1999, 2, 28);
date.add!"months"(-12, AllowDayOverflow.no);
assert(date == Date(-2000, 2, 28));
}
{
auto date = Date(-2000, 2, 29);
date.add!"months"(-12, AllowDayOverflow.no);
assert(date == Date(-2001, 2, 28));
}
{
auto date = Date(-1999, 7, 31);
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 8, 31));
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 9, 30));
}
{
auto date = Date(-1998, 8, 31);
date.add!"months"(13, AllowDayOverflow.no);
assert(date == Date(-1997, 9, 30));
date.add!"months"(-13, AllowDayOverflow.no);
assert(date == Date(-1998, 8, 30));
}
{
auto date = Date(-1997, 12, 31);
date.add!"months"(13, AllowDayOverflow.no);
assert(date == Date(-1995, 1, 31));
date.add!"months"(-13, AllowDayOverflow.no);
assert(date == Date(-1997, 12, 31));
}
{
auto date = Date(-1997, 12, 31);
date.add!"months"(14, AllowDayOverflow.no);
assert(date == Date(-1995, 2, 28));
date.add!"months"(-14, AllowDayOverflow.no);
assert(date == Date(-1997, 12, 28));
}
{
auto date = Date(-2002, 12, 31);
date.add!"months"(14, AllowDayOverflow.no);
assert(date == Date(-2000, 2, 29));
date.add!"months"(-14, AllowDayOverflow.no);
assert(date == Date(-2002, 12, 29));
}
{
auto date = Date(-2001, 12, 31);
date.add!"months"(14, AllowDayOverflow.no);
assert(date == Date(-1999, 2, 28));
date.add!"months"(-14, AllowDayOverflow.no);
assert(date == Date(-2001, 12, 28));
}
//Test Both
{
auto date = Date(1, 1, 1);
date.add!"months"(-1, AllowDayOverflow.no);
assert(date == Date(0, 12, 1));
date.add!"months"(1, AllowDayOverflow.no);
assert(date == Date(1, 1, 1));
}
{
auto date = Date(4, 1, 1);
date.add!"months"(-48, AllowDayOverflow.no);
assert(date == Date(0, 1, 1));
date.add!"months"(48, AllowDayOverflow.no);
assert(date == Date(4, 1, 1));
}
{
auto date = Date(4, 3, 31);
date.add!"months"(-49, AllowDayOverflow.no);
assert(date == Date(0, 2, 29));
date.add!"months"(49, AllowDayOverflow.no);
assert(date == Date(4, 3, 29));
}
{
auto date = Date(4, 3, 31);
date.add!"months"(-85, AllowDayOverflow.no);
assert(date == Date(-3, 2, 28));
date.add!"months"(85, AllowDayOverflow.no);
assert(date == Date(4, 3, 28));
}
{
auto date = Date(-3, 3, 31);
date.add!"months"(85, AllowDayOverflow.no).add!"months"(-83, AllowDayOverflow.no);
assert(date == Date(-3, 5, 30));
}
}
/++
Adds the given number of years or months to this $(LREF Date). A negative
number will subtract.
The difference between rolling and adding is that rolling does not
affect larger units. Rolling a $(LREF Date) 12 months gets
the exact same $(LREF Date). 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 Date).
allowOverflow = Whether the day should be allowed to overflow,
causing the month to increment.
+/
ref Date roll(string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
if(units == "years")
{
return add!"years"(value, allowOverflow);
}
///
unittest
{
auto d1 = Date(2010, 1, 1);
d1.roll!"months"(1);
assert(d1 == Date(2010, 2, 1));
auto d2 = Date(2010, 1, 1);
d2.roll!"months"(-1);
assert(d2 == Date(2010, 12, 1));
auto d3 = Date(1999, 1, 29);
d3.roll!"months"(1);
assert(d3 == Date(1999, 3, 1));
auto d4 = Date(1999, 1, 29);
d4.roll!"months"(1, AllowDayOverflow.no);
assert(d4 == Date(1999, 2, 28));
auto d5 = Date(2000, 2, 29);
d5.roll!"years"(1);
assert(d5 == Date(2001, 3, 1));
auto d6 = Date(2000, 2, 29);
d6.roll!"years"(1, AllowDayOverflow.no);
assert(d6 == Date(2001, 2, 28));
}
unittest
{
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.roll!"years"(3)));
static assert(!__traits(compiles, idate.rolYears(3)));
}
//Shares documentation with "years" version.
ref Date roll(string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
if(units == "months")
{
months %= 12;
auto newMonth = _month + months;
if(months < 0)
{
if(newMonth < 1)
newMonth += 12;
}
else
{
if(newMonth > 12)
newMonth -= 12;
}
_month = cast(Month)newMonth;
immutable currMaxDay = maxDay(_year, _month);
immutable overflow = _day - currMaxDay;
if(overflow > 0)
{
if(allowOverflow == AllowDayOverflow.yes)
{
++_month;
_day = cast(ubyte)overflow;
}
else
_day = cast(ubyte)currMaxDay;
}
return this;
}
//Test roll!"months"() with AllowDayOverlow.yes
unittest
{
//Test A.D.
{
auto date = Date(1999, 7, 6);
date.roll!"months"(3);
assert(date == Date(1999, 10, 6));
date.roll!"months"(-4);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 7, 6);
date.roll!"months"(6);
assert(date == Date(1999, 1, 6));
date.roll!"months"(-6);
assert(date == Date(1999, 7, 6));
}
{
auto date = Date(1999, 7, 6);
date.roll!"months"(27);
assert(date == Date(1999, 10, 6));
date.roll!"months"(-28);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 5, 31);
date.roll!"months"(1);
assert(date == Date(1999, 7, 1));
}
{
auto date = Date(1999, 5, 31);
date.roll!"months"(-1);
assert(date == Date(1999, 5, 1));
}
{
auto date = Date(1999, 2, 28);
date.roll!"months"(12);
assert(date == Date(1999, 2, 28));
}
{
auto date = Date(2000, 2, 29);
date.roll!"months"(12);
assert(date == Date(2000, 2, 29));
}
{
auto date = Date(1999, 7, 31);
date.roll!"months"(1);
assert(date == Date(1999, 8, 31));
date.roll!"months"(1);
assert(date == Date(1999, 10, 1));
}
{
auto date = Date(1998, 8, 31);
date.roll!"months"(13);
assert(date == Date(1998, 10, 1));
date.roll!"months"(-13);
assert(date == Date(1998, 9, 1));
}
{
auto date = Date(1997, 12, 31);
date.roll!"months"(13);
assert(date == Date(1997, 1, 31));
date.roll!"months"(-13);
assert(date == Date(1997, 12, 31));
}
{
auto date = Date(1997, 12, 31);
date.roll!"months"(14);
assert(date == Date(1997, 3, 3));
date.roll!"months"(-14);
assert(date == Date(1997, 1, 3));
}
{
auto date = Date(1998, 12, 31);
date.roll!"months"(14);
assert(date == Date(1998, 3, 3));
date.roll!"months"(-14);
assert(date == Date(1998, 1, 3));
}
{
auto date = Date(1999, 12, 31);
date.roll!"months"(14);
assert(date == Date(1999, 3, 3));
date.roll!"months"(-14);
assert(date == Date(1999, 1, 3));
}
//Test B.C.
{
auto date = Date(-1999, 7, 6);
date.roll!"months"(3);
assert(date == Date(-1999, 10, 6));
date.roll!"months"(-4);
assert(date == Date(-1999, 6, 6));
}
{
auto date = Date(-1999, 7, 6);
date.roll!"months"(6);
assert(date == Date(-1999, 1, 6));
date.roll!"months"(-6);
assert(date == Date(-1999, 7, 6));
}
{
auto date = Date(-1999, 7, 6);
date.roll!"months"(-27);
assert(date == Date(-1999, 4, 6));
date.roll!"months"(28);
assert(date == Date(-1999, 8, 6));
}
{
auto date = Date(-1999, 5, 31);
date.roll!"months"(1);
assert(date == Date(-1999, 7, 1));
}
{
auto date = Date(-1999, 5, 31);
date.roll!"months"(-1);
assert(date == Date(-1999, 5, 1));
}
{
auto date = Date(-1999, 2, 28);
date.roll!"months"(-12);
assert(date == Date(-1999, 2, 28));
}
{
auto date = Date(-2000, 2, 29);
date.roll!"months"(-12);
assert(date == Date(-2000, 2, 29));
}
{
auto date = Date(-1999, 7, 31);
date.roll!"months"(1);
assert(date == Date(-1999, 8, 31));
date.roll!"months"(1);
assert(date == Date(-1999, 10, 1));
}
{
auto date = Date(-1998, 8, 31);
date.roll!"months"(13);
assert(date == Date(-1998, 10, 1));
date.roll!"months"(-13);
assert(date == Date(-1998, 9, 1));
}
{
auto date = Date(-1997, 12, 31);
date.roll!"months"(13);
assert(date == Date(-1997, 1, 31));
date.roll!"months"(-13);
assert(date == Date(-1997, 12, 31));
}
{
auto date = Date(-1997, 12, 31);
date.roll!"months"(14);
assert(date == Date(-1997, 3, 3));
date.roll!"months"(-14);
assert(date == Date(-1997, 1, 3));
}
{
auto date = Date(-2002, 12, 31);
date.roll!"months"(14);
assert(date == Date(-2002, 3, 3));
date.roll!"months"(-14);
assert(date == Date(-2002, 1, 3));
}
{
auto date = Date(-2001, 12, 31);
date.roll!"months"(14);
assert(date == Date(-2001, 3, 3));
date.roll!"months"(-14);
assert(date == Date(-2001, 1, 3));
}
//Test Both
{
auto date = Date(1, 1, 1);
date.roll!"months"(-1);
assert(date == Date(1, 12, 1));
date.roll!"months"(1);
assert(date == Date(1, 1, 1));
}
{
auto date = Date(4, 1, 1);
date.roll!"months"(-48);
assert(date == Date(4, 1, 1));
date.roll!"months"(48);
assert(date == Date(4, 1, 1));
}
{
auto date = Date(4, 3, 31);
date.roll!"months"(-49);
assert(date == Date(4, 3, 2));
date.roll!"months"(49);
assert(date == Date(4, 4, 2));
}
{
auto date = Date(4, 3, 31);
date.roll!"months"(-85);
assert(date == Date(4, 3, 2));
date.roll!"months"(85);
assert(date == Date(4, 4, 2));
}
{
auto date = Date(-1, 1, 1);
date.roll!"months"(-1);
assert(date == Date(-1, 12, 1));
date.roll!"months"(1);
assert(date == Date(-1, 1, 1));
}
{
auto date = Date(-4, 1, 1);
date.roll!"months"(-48);
assert(date == Date(-4, 1, 1));
date.roll!"months"(48);
assert(date == Date(-4, 1, 1));
}
{
auto date = Date(-4, 3, 31);
date.roll!"months"(-49);
assert(date == Date(-4, 3, 2));
date.roll!"months"(49);
assert(date == Date(-4, 4, 2));
}
{
auto date = Date(-4, 3, 31);
date.roll!"months"(-85);
assert(date == Date(-4, 3, 2));
date.roll!"months"(85);
assert(date == Date(-4, 4, 2));
}
{
auto date = Date(-3, 3, 31);
date.roll!"months"(85).roll!"months"(-83);
assert(date == Date(-3, 6, 1));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.roll!"months"(3)));
static assert(!__traits(compiles, idate.roll!"months"(3)));
}
//Test roll!"months"() with AllowDayOverlow.no
unittest
{
//Test A.D.
{
auto date = Date(1999, 7, 6);
date.roll!"months"(3, AllowDayOverflow.no);
assert(date == Date(1999, 10, 6));
date.roll!"months"(-4, AllowDayOverflow.no);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 7, 6);
date.roll!"months"(6, AllowDayOverflow.no);
assert(date == Date(1999, 1, 6));
date.roll!"months"(-6, AllowDayOverflow.no);
assert(date == Date(1999, 7, 6));
}
{
auto date = Date(1999, 7, 6);
date.roll!"months"(27, AllowDayOverflow.no);
assert(date == Date(1999, 10, 6));
date.roll!"months"(-28, AllowDayOverflow.no);
assert(date == Date(1999, 6, 6));
}
{
auto date = Date(1999, 5, 31);
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(1999, 6, 30));
}
{
auto date = Date(1999, 5, 31);
date.roll!"months"(-1, AllowDayOverflow.no);
assert(date == Date(1999, 4, 30));
}
{
auto date = Date(1999, 2, 28);
date.roll!"months"(12, AllowDayOverflow.no);
assert(date == Date(1999, 2, 28));
}
{
auto date = Date(2000, 2, 29);
date.roll!"months"(12, AllowDayOverflow.no);
assert(date == Date(2000, 2, 29));
}
{
auto date = Date(1999, 7, 31);
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(1999, 8, 31));
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(1999, 9, 30));
}
{
auto date = Date(1998, 8, 31);
date.roll!"months"(13, AllowDayOverflow.no);
assert(date == Date(1998, 9, 30));
date.roll!"months"(-13, AllowDayOverflow.no);
assert(date == Date(1998, 8, 30));
}
{
auto date = Date(1997, 12, 31);
date.roll!"months"(13, AllowDayOverflow.no);
assert(date == Date(1997, 1, 31));
date.roll!"months"(-13, AllowDayOverflow.no);
assert(date == Date(1997, 12, 31));
}
{
auto date = Date(1997, 12, 31);
date.roll!"months"(14, AllowDayOverflow.no);
assert(date == Date(1997, 2, 28));
date.roll!"months"(-14, AllowDayOverflow.no);
assert(date == Date(1997, 12, 28));
}
{
auto date = Date(1998, 12, 31);
date.roll!"months"(14, AllowDayOverflow.no);
assert(date == Date(1998, 2, 28));
date.roll!"months"(-14, AllowDayOverflow.no);
assert(date == Date(1998, 12, 28));
}
{
auto date = Date(1999, 12, 31);
date.roll!"months"(14, AllowDayOverflow.no);
assert(date == Date(1999, 2, 28));
date.roll!"months"(-14, AllowDayOverflow.no);
assert(date == Date(1999, 12, 28));
}
//Test B.C.
{
auto date = Date(-1999, 7, 6);
date.roll!"months"(3, AllowDayOverflow.no);
assert(date == Date(-1999, 10, 6));
date.roll!"months"(-4, AllowDayOverflow.no);
assert(date == Date(-1999, 6, 6));
}
{
auto date = Date(-1999, 7, 6);
date.roll!"months"(6, AllowDayOverflow.no);
assert(date == Date(-1999, 1, 6));
date.roll!"months"(-6, AllowDayOverflow.no);
assert(date == Date(-1999, 7, 6));
}
{
auto date = Date(-1999, 7, 6);
date.roll!"months"(-27, AllowDayOverflow.no);
assert(date == Date(-1999, 4, 6));
date.roll!"months"(28, AllowDayOverflow.no);
assert(date == Date(-1999, 8, 6));
}
{
auto date = Date(-1999, 5, 31);
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 6, 30));
}
{
auto date = Date(-1999, 5, 31);
date.roll!"months"(-1, AllowDayOverflow.no);
assert(date == Date(-1999, 4, 30));
}
{
auto date = Date(-1999, 2, 28);
date.roll!"months"(-12, AllowDayOverflow.no);
assert(date == Date(-1999, 2, 28));
}
{
auto date = Date(-2000, 2, 29);
date.roll!"months"(-12, AllowDayOverflow.no);
assert(date == Date(-2000, 2, 29));
}
{
auto date = Date(-1999, 7, 31);
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 8, 31));
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1999, 9, 30));
}
{
auto date = Date(-1998, 8, 31);
date.roll!"months"(13, AllowDayOverflow.no);
assert(date == Date(-1998, 9, 30));
date.roll!"months"(-13, AllowDayOverflow.no);
assert(date == Date(-1998, 8, 30));
}
{
auto date = Date(-1997, 12, 31);
date.roll!"months"(13, AllowDayOverflow.no);
assert(date == Date(-1997, 1, 31));
date.roll!"months"(-13, AllowDayOverflow.no);
assert(date == Date(-1997, 12, 31));
}
{
auto date = Date(-1997, 12, 31);
date.roll!"months"(14, AllowDayOverflow.no);
assert(date == Date(-1997, 2, 28));
date.roll!"months"(-14, AllowDayOverflow.no);
assert(date == Date(-1997, 12, 28));
}
{
auto date = Date(-2002, 12, 31);
date.roll!"months"(14, AllowDayOverflow.no);
assert(date == Date(-2002, 2, 28));
date.roll!"months"(-14, AllowDayOverflow.no);
assert(date == Date(-2002, 12, 28));
}
{
auto date = Date(-2001, 12, 31);
date.roll!"months"(14, AllowDayOverflow.no);
assert(date == Date(-2001, 2, 28));
date.roll!"months"(-14, AllowDayOverflow.no);
assert(date == Date(-2001, 12, 28));
}
//Test Both
{
auto date = Date(1, 1, 1);
date.roll!"months"(-1, AllowDayOverflow.no);
assert(date == Date(1, 12, 1));
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(1, 1, 1));
}
{
auto date = Date(4, 1, 1);
date.roll!"months"(-48, AllowDayOverflow.no);
assert(date == Date(4, 1, 1));
date.roll!"months"(48, AllowDayOverflow.no);
assert(date == Date(4, 1, 1));
}
{
auto date = Date(4, 3, 31);
date.roll!"months"(-49, AllowDayOverflow.no);
assert(date == Date(4, 2, 29));
date.roll!"months"(49, AllowDayOverflow.no);
assert(date == Date(4, 3, 29));
}
{
auto date = Date(4, 3, 31);
date.roll!"months"(-85, AllowDayOverflow.no);
assert(date == Date(4, 2, 29));
date.roll!"months"(85, AllowDayOverflow.no);
assert(date == Date(4, 3, 29));
}
{
auto date = Date(-1, 1, 1);
date.roll!"months"(-1, AllowDayOverflow.no);
assert(date == Date(-1, 12, 1));
date.roll!"months"(1, AllowDayOverflow.no);
assert(date == Date(-1, 1, 1));
}
{
auto date = Date(-4, 1, 1);
date.roll!"months"(-48, AllowDayOverflow.no);
assert(date == Date(-4, 1, 1));
date.roll!"months"(48, AllowDayOverflow.no);
assert(date == Date(-4, 1, 1));
}
{
auto date = Date(-4, 3, 31);
date.roll!"months"(-49, AllowDayOverflow.no);
assert(date == Date(-4, 2, 29));
date.roll!"months"(49, AllowDayOverflow.no);
assert(date == Date(-4, 3, 29));
}
{
auto date = Date(-4, 3, 31);
date.roll!"months"(-85, AllowDayOverflow.no);
assert(date == Date(-4, 2, 29));
date.roll!"months"(85, AllowDayOverflow.no);
assert(date == Date(-4, 3, 29));
}
{
auto date = Date(-3, 3, 31);
date.roll!"months"(85, AllowDayOverflow.no).roll!"months"(-83, AllowDayOverflow.no);
assert(date == Date(-3, 5, 30));
}
}
/++
Adds the given number of units to this $(LREF Date). A negative number will
subtract.
The difference between rolling and adding is that rolling does not
affect larger units. For instance, rolling a $(LREF Date) one
year's worth of days gets the exact same $(LREF Date).
The only accepted units are $(D "days").
Params:
units = The units to add. Must be $(D "days").
days = The number of days to add to this $(LREF Date).
+/
ref Date roll(string units)(long days) @safe pure nothrow
if(units == "days")
{
immutable limit = maxDay(_year, _month);
days %= limit;
auto newDay = _day + days;
if(days < 0)
{
if(newDay < 1)
newDay += limit;
}
else if(newDay > limit)
newDay -= limit;
_day = cast(ubyte)newDay;
return this;
}
///
unittest
{
auto d = Date(2010, 1, 1);
d.roll!"days"(1);
assert(d == Date(2010, 1, 2));
d.roll!"days"(365);
assert(d == Date(2010, 1, 26));
d.roll!"days"(-32);
assert(d == Date(2010, 1, 25));
}
unittest
{
//Test A.D.
{
auto date = Date(1999, 2, 28);
date.roll!"days"(1);
assert(date == Date(1999, 2, 1));
date.roll!"days"(-1);
assert(date == Date(1999, 2, 28));
}
{
auto date = Date(2000, 2, 28);
date.roll!"days"(1);
assert(date == Date(2000, 2, 29));
date.roll!"days"(1);
assert(date == Date(2000, 2, 1));
date.roll!"days"(-1);
assert(date == Date(2000, 2, 29));
}
{
auto date = Date(1999, 6, 30);
date.roll!"days"(1);
assert(date == Date(1999, 6, 1));
date.roll!"days"(-1);
assert(date == Date(1999, 6, 30));
}
{
auto date = Date(1999, 7, 31);
date.roll!"days"(1);
assert(date == Date(1999, 7, 1));
date.roll!"days"(-1);
assert(date == Date(1999, 7, 31));
}
{
auto date = Date(1999, 1, 1);
date.roll!"days"(-1);
assert(date == Date(1999, 1, 31));
date.roll!"days"(1);
assert(date == Date(1999, 1, 1));
}
{
auto date = Date(1999, 7, 6);
date.roll!"days"(9);
assert(date == Date(1999, 7, 15));
date.roll!"days"(-11);
assert(date == Date(1999, 7, 4));
date.roll!"days"(30);
assert(date == Date(1999, 7, 3));
date.roll!"days"(-3);
assert(date == Date(1999, 7, 31));
}
{
auto date = Date(1999, 7, 6);
date.roll!"days"(365);
assert(date == Date(1999, 7, 30));
date.roll!"days"(-365);
assert(date == Date(1999, 7, 6));
date.roll!"days"(366);
assert(date == Date(1999, 7, 31));
date.roll!"days"(730);
assert(date == Date(1999, 7, 17));
date.roll!"days"(-1096);
assert(date == Date(1999, 7, 6));
}
{
auto date = Date(1999, 2, 6);
date.roll!"days"(365);
assert(date == Date(1999, 2, 7));
date.roll!"days"(-365);
assert(date == Date(1999, 2, 6));
date.roll!"days"(366);
assert(date == Date(1999, 2, 8));
date.roll!"days"(730);
assert(date == Date(1999, 2, 10));
date.roll!"days"(-1096);
assert(date == Date(1999, 2, 6));
}
//Test B.C.
{
auto date = Date(-1999, 2, 28);
date.roll!"days"(1);
assert(date == Date(-1999, 2, 1));
date.roll!"days"(-1);
assert(date == Date(-1999, 2, 28));
}
{
auto date = Date(-2000, 2, 28);
date.roll!"days"(1);
assert(date == Date(-2000, 2, 29));
date.roll!"days"(1);
assert(date == Date(-2000, 2, 1));
date.roll!"days"(-1);
assert(date == Date(-2000, 2, 29));
}
{
auto date = Date(-1999, 6, 30);
date.roll!"days"(1);
assert(date == Date(-1999, 6, 1));
date.roll!"days"(-1);
assert(date == Date(-1999, 6, 30));
}
{
auto date = Date(-1999, 7, 31);
date.roll!"days"(1);
assert(date == Date(-1999, 7, 1));
date.roll!"days"(-1);
assert(date == Date(-1999, 7, 31));
}
{
auto date = Date(-1999, 1, 1);
date.roll!"days"(-1);
assert(date == Date(-1999, 1, 31));
date.roll!"days"(1);
assert(date == Date(-1999, 1, 1));
}
{
auto date = Date(-1999, 7, 6);
date.roll!"days"(9);
assert(date == Date(-1999, 7, 15));
date.roll!"days"(-11);
assert(date == Date(-1999, 7, 4));
date.roll!"days"(30);
assert(date == Date(-1999, 7, 3));
date.roll!"days"(-3);
assert(date == Date(-1999, 7, 31));
}
{
auto date = Date(-1999, 7, 6);
date.roll!"days"(365);
assert(date == Date(-1999, 7, 30));
date.roll!"days"(-365);
assert(date == Date(-1999, 7, 6));
date.roll!"days"(366);
assert(date == Date(-1999, 7, 31));
date.roll!"days"(730);
assert(date == Date(-1999, 7, 17));
date.roll!"days"(-1096);
assert(date == Date(-1999, 7, 6));
}
//Test Both
{
auto date = Date(1, 7, 6);
date.roll!"days"(-365);
assert(date == Date(1, 7, 13));
date.roll!"days"(365);
assert(date == Date(1, 7, 6));
date.roll!"days"(-731);
assert(date == Date(1, 7, 19));
date.roll!"days"(730);
assert(date == Date(1, 7, 5));
}
{
auto date = Date(0, 7, 6);
date.roll!"days"(-365);
assert(date == Date(0, 7, 13));
date.roll!"days"(365);
assert(date == Date(0, 7, 6));
date.roll!"days"(-731);
assert(date == Date(0, 7, 19));
date.roll!"days"(730);
assert(date == Date(0, 7, 5));
}
{
auto date = Date(0, 7, 6);
date.roll!"days"(-365).roll!"days"(362).roll!"days"(-12).roll!"days"(730);
assert(date == Date(0, 7, 8));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.roll!"days"(12)));
static assert(!__traits(compiles, idate.roll!"days"(12)));
}
/++
Gives the result of adding or subtracting a duration from this
$(LREF Date).
The legal types of arithmetic for Date using this operator are
$(BOOKTABLE,
$(TR $(TD Date) $(TD +) $(TD duration) $(TD -->) $(TD Date))
$(TR $(TD Date) $(TD -) $(TD duration) $(TD -->) $(TD Date))
)
Params:
duration = The duration to add to or subtract from this $(LREF Date).
+/
Date opBinary(string op, D)(in D duration) @safe const pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
Date retval = this;
static if(is(Unqual!D == Duration))
immutable days = duration.total!"days";
else static if(is(Unqual!D == TickDuration))
immutable days = convert!("hnsecs", "days")(duration.hnsecs);
mixin(format("return retval._addDays(%sdays);", op));
}
unittest
{
auto date = Date(1999, 7, 6);
assert(date + dur!"weeks"(7) == Date(1999, 8, 24));
assert(date + dur!"weeks"(-7) == Date(1999, 5, 18));
assert(date + dur!"days"(7) == Date(1999, 7, 13));
assert(date + dur!"days"(-7) == Date(1999, 6, 29));
assert(date + dur!"hours"(24) == Date(1999, 7, 7));
assert(date + dur!"hours"(-24) == Date(1999, 7, 5));
assert(date + dur!"minutes"(1440) == Date(1999, 7, 7));
assert(date + dur!"minutes"(-1440) == Date(1999, 7, 5));
assert(date + dur!"seconds"(86_400) == Date(1999, 7, 7));
assert(date + dur!"seconds"(-86_400) == Date(1999, 7, 5));
assert(date + dur!"msecs"(86_400_000) == Date(1999, 7, 7));
assert(date + dur!"msecs"(-86_400_000) == Date(1999, 7, 5));
assert(date + dur!"usecs"(86_400_000_000) == Date(1999, 7, 7));
assert(date + dur!"usecs"(-86_400_000_000) == Date(1999, 7, 5));
assert(date + dur!"hnsecs"(864_000_000_000) == Date(1999, 7, 7));
assert(date + dur!"hnsecs"(-864_000_000_000) == Date(1999, 7, 5));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(date + TickDuration.from!"usecs"(86_400_000_000) == Date(1999, 7, 7));
assert(date + TickDuration.from!"usecs"(-86_400_000_000) == Date(1999, 7, 5));
}
assert(date - dur!"weeks"(-7) == Date(1999, 8, 24));
assert(date - dur!"weeks"(7) == Date(1999, 5, 18));
assert(date - dur!"days"(-7) == Date(1999, 7, 13));
assert(date - dur!"days"(7) == Date(1999, 6, 29));
assert(date - dur!"hours"(-24) == Date(1999, 7, 7));
assert(date - dur!"hours"(24) == Date(1999, 7, 5));
assert(date - dur!"minutes"(-1440) == Date(1999, 7, 7));
assert(date - dur!"minutes"(1440) == Date(1999, 7, 5));
assert(date - dur!"seconds"(-86_400) == Date(1999, 7, 7));
assert(date - dur!"seconds"(86_400) == Date(1999, 7, 5));
assert(date - dur!"msecs"(-86_400_000) == Date(1999, 7, 7));
assert(date - dur!"msecs"(86_400_000) == Date(1999, 7, 5));
assert(date - dur!"usecs"(-86_400_000_000) == Date(1999, 7, 7));
assert(date - dur!"usecs"(86_400_000_000) == Date(1999, 7, 5));
assert(date - dur!"hnsecs"(-864_000_000_000) == Date(1999, 7, 7));
assert(date - dur!"hnsecs"(864_000_000_000) == Date(1999, 7, 5));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(date - TickDuration.from!"usecs"(-86_400_000_000) == Date(1999, 7, 7));
assert(date - TickDuration.from!"usecs"(86_400_000_000) == Date(1999, 7, 5));
}
auto duration = dur!"days"(12);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date + duration));
static assert(__traits(compiles, cdate + duration));
static assert(__traits(compiles, idate + duration));
static assert(__traits(compiles, date - duration));
static assert(__traits(compiles, cdate - duration));
static assert(__traits(compiles, idate - duration));
}
/++
Gives the result of adding or subtracting a duration from this
$(LREF Date), as well as assigning the result to this $(LREF Date).
The legal types of arithmetic for $(LREF Date) using this operator are
$(BOOKTABLE,
$(TR $(TD Date) $(TD +) $(TD duration) $(TD -->) $(TD Date))
$(TR $(TD Date) $(TD -) $(TD duration) $(TD -->) $(TD Date))
)
Params:
duration = The duration to add to or subtract from this $(LREF Date).
+/
ref Date opOpAssign(string op, D)(in D duration) @safe pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
static if(is(Unqual!D == Duration))
immutable days = duration.total!"days";
else static if(is(Unqual!D == TickDuration))
immutable days = convert!("hnsecs", "days")(duration.hnsecs);
mixin(format("return _addDays(%sdays);", op));
}
unittest
{
assert(Date(1999, 7, 6) + dur!"weeks"(7) == Date(1999, 8, 24));
assert(Date(1999, 7, 6) + dur!"weeks"(-7) == Date(1999, 5, 18));
assert(Date(1999, 7, 6) + dur!"days"(7) == Date(1999, 7, 13));
assert(Date(1999, 7, 6) + dur!"days"(-7) == Date(1999, 6, 29));
assert(Date(1999, 7, 6) + dur!"hours"(24) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) + dur!"hours"(-24) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) + dur!"minutes"(1440) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) + dur!"minutes"(-1440) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) + dur!"seconds"(86_400) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) + dur!"seconds"(-86_400) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) + dur!"msecs"(86_400_000) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) + dur!"msecs"(-86_400_000) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) + dur!"usecs"(86_400_000_000) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) + dur!"usecs"(-86_400_000_000) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) + dur!"hnsecs"(864_000_000_000) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) + dur!"hnsecs"(-864_000_000_000) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) - dur!"weeks"(-7) == Date(1999, 8, 24));
assert(Date(1999, 7, 6) - dur!"weeks"(7) == Date(1999, 5, 18));
assert(Date(1999, 7, 6) - dur!"days"(-7) == Date(1999, 7, 13));
assert(Date(1999, 7, 6) - dur!"days"(7) == Date(1999, 6, 29));
assert(Date(1999, 7, 6) - dur!"hours"(-24) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) - dur!"hours"(24) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) - dur!"minutes"(-1440) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) - dur!"minutes"(1440) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) - dur!"seconds"(-86_400) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) - dur!"seconds"(86_400) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) - dur!"msecs"(-86_400_000) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) - dur!"msecs"(86_400_000) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) - dur!"usecs"(-86_400_000_000) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) - dur!"usecs"(86_400_000_000) == Date(1999, 7, 5));
assert(Date(1999, 7, 6) - dur!"hnsecs"(-864_000_000_000) == Date(1999, 7, 7));
assert(Date(1999, 7, 6) - dur!"hnsecs"(864_000_000_000) == Date(1999, 7, 5));
{
auto date = Date(0, 1, 31);
(date += dur!"days"(507)) += dur!"days"(-2);
assert(date == Date(1, 6, 19));
}
auto duration = dur!"days"(12);
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date += duration));
static assert(!__traits(compiles, cdate += duration));
static assert(!__traits(compiles, idate += duration));
static assert(__traits(compiles, date -= duration));
static assert(!__traits(compiles, cdate -= duration));
static assert(!__traits(compiles, idate -= duration));
}
/++
Gives the difference between two $(LREF Date)s.
The legal types of arithmetic for Date using this operator are
$(BOOKTABLE,
$(TR $(TD Date) $(TD -) $(TD Date) $(TD -->) $(TD duration))
)
+/
Duration opBinary(string op)(in Date rhs) @safe const pure nothrow
if(op == "-")
{
return dur!"days"(this.dayOfGregorianCal - rhs.dayOfGregorianCal);
}
unittest
{
auto date = Date(1999, 7, 6);
assert(Date(1999, 7, 6) - Date(1998, 7, 6) == dur!"days"(365));
assert(Date(1998, 7, 6) - Date(1999, 7, 6) == dur!"days"(-365));
assert(Date(1999, 6, 6) - Date(1999, 5, 6) == dur!"days"(31));
assert(Date(1999, 5, 6) - Date(1999, 6, 6) == dur!"days"(-31));
assert(Date(1999, 1, 1) - Date(1998, 12, 31) == dur!"days"(1));
assert(Date(1998, 12, 31) - Date(1999, 1, 1) == dur!"days"(-1));
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date - date));
static assert(__traits(compiles, cdate - date));
static assert(__traits(compiles, idate - date));
static assert(__traits(compiles, date - cdate));
static assert(__traits(compiles, cdate - cdate));
static assert(__traits(compiles, idate - cdate));
static assert(__traits(compiles, date - idate));
static assert(__traits(compiles, cdate - idate));
static assert(__traits(compiles, idate - idate));
}
/++
Returns the difference between the two $(LREF Date)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 $(CXREF time, Duration)
that results. Because converting between months and smaller
units requires a specific date (which $(CXREF time, Duration)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 $(LREF 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 Date) to subtract from this one.
+/
int diffMonths(in Date rhs) @safe const pure nothrow
{
immutable yearDiff = _year - rhs._year;
immutable monthDiff = _month - rhs._month;
return yearDiff * 12 + monthDiff;
}
///
unittest
{
assert(Date(1999, 2, 1).diffMonths(Date(1999, 1, 31)) == 1);
assert(Date(1999, 1, 31).diffMonths(Date(1999, 2, 1)) == -1);
assert(Date(1999, 3, 1).diffMonths(Date(1999, 1, 1)) == 2);
assert(Date(1999, 1, 1).diffMonths(Date(1999, 3, 31)) == -2);
}
unittest
{
auto date = Date(1999, 7, 6);
//Test A.D.
assert(date.diffMonths(Date(1998, 6, 5)) == 13);
assert(date.diffMonths(Date(1998, 7, 5)) == 12);
assert(date.diffMonths(Date(1998, 8, 5)) == 11);
assert(date.diffMonths(Date(1998, 9, 5)) == 10);
assert(date.diffMonths(Date(1998, 10, 5)) == 9);
assert(date.diffMonths(Date(1998, 11, 5)) == 8);
assert(date.diffMonths(Date(1998, 12, 5)) == 7);
assert(date.diffMonths(Date(1999, 1, 5)) == 6);
assert(date.diffMonths(Date(1999, 2, 6)) == 5);
assert(date.diffMonths(Date(1999, 3, 6)) == 4);
assert(date.diffMonths(Date(1999, 4, 6)) == 3);
assert(date.diffMonths(Date(1999, 5, 6)) == 2);
assert(date.diffMonths(Date(1999, 6, 6)) == 1);
assert(date.diffMonths(date) == 0);
assert(date.diffMonths(Date(1999, 8, 6)) == -1);
assert(date.diffMonths(Date(1999, 9, 6)) == -2);
assert(date.diffMonths(Date(1999, 10, 6)) == -3);
assert(date.diffMonths(Date(1999, 11, 6)) == -4);
assert(date.diffMonths(Date(1999, 12, 6)) == -5);
assert(date.diffMonths(Date(2000, 1, 6)) == -6);
assert(date.diffMonths(Date(2000, 2, 6)) == -7);
assert(date.diffMonths(Date(2000, 3, 6)) == -8);
assert(date.diffMonths(Date(2000, 4, 6)) == -9);
assert(date.diffMonths(Date(2000, 5, 6)) == -10);
assert(date.diffMonths(Date(2000, 6, 6)) == -11);
assert(date.diffMonths(Date(2000, 7, 6)) == -12);
assert(date.diffMonths(Date(2000, 8, 6)) == -13);
assert(Date(1998, 6, 5).diffMonths(date) == -13);
assert(Date(1998, 7, 5).diffMonths(date) == -12);
assert(Date(1998, 8, 5).diffMonths(date) == -11);
assert(Date(1998, 9, 5).diffMonths(date) == -10);
assert(Date(1998, 10, 5).diffMonths(date) == -9);
assert(Date(1998, 11, 5).diffMonths(date) == -8);
assert(Date(1998, 12, 5).diffMonths(date) == -7);
assert(Date(1999, 1, 5).diffMonths(date) == -6);
assert(Date(1999, 2, 6).diffMonths(date) == -5);
assert(Date(1999, 3, 6).diffMonths(date) == -4);
assert(Date(1999, 4, 6).diffMonths(date) == -3);
assert(Date(1999, 5, 6).diffMonths(date) == -2);
assert(Date(1999, 6, 6).diffMonths(date) == -1);
assert(Date(1999, 8, 6).diffMonths(date) == 1);
assert(Date(1999, 9, 6).diffMonths(date) == 2);
assert(Date(1999, 10, 6).diffMonths(date) == 3);
assert(Date(1999, 11, 6).diffMonths(date) == 4);
assert(Date(1999, 12, 6).diffMonths(date) == 5);
assert(Date(2000, 1, 6).diffMonths(date) == 6);
assert(Date(2000, 2, 6).diffMonths(date) == 7);
assert(Date(2000, 3, 6).diffMonths(date) == 8);
assert(Date(2000, 4, 6).diffMonths(date) == 9);
assert(Date(2000, 5, 6).diffMonths(date) == 10);
assert(Date(2000, 6, 6).diffMonths(date) == 11);
assert(Date(2000, 7, 6).diffMonths(date) == 12);
assert(Date(2000, 8, 6).diffMonths(date) == 13);
assert(date.diffMonths(Date(1999, 6, 30)) == 1);
assert(date.diffMonths(Date(1999, 7, 1)) == 0);
assert(date.diffMonths(Date(1999, 7, 6)) == 0);
assert(date.diffMonths(Date(1999, 7, 11)) == 0);
assert(date.diffMonths(Date(1999, 7, 16)) == 0);
assert(date.diffMonths(Date(1999, 7, 21)) == 0);
assert(date.diffMonths(Date(1999, 7, 26)) == 0);
assert(date.diffMonths(Date(1999, 7, 31)) == 0);
assert(date.diffMonths(Date(1999, 8, 1)) == -1);
assert(date.diffMonths(Date(1990, 6, 30)) == 109);
assert(date.diffMonths(Date(1990, 7, 1)) == 108);
assert(date.diffMonths(Date(1990, 7, 6)) == 108);
assert(date.diffMonths(Date(1990, 7, 11)) == 108);
assert(date.diffMonths(Date(1990, 7, 16)) == 108);
assert(date.diffMonths(Date(1990, 7, 21)) == 108);
assert(date.diffMonths(Date(1990, 7, 26)) == 108);
assert(date.diffMonths(Date(1990, 7, 31)) == 108);
assert(date.diffMonths(Date(1990, 8, 1)) == 107);
assert(Date(1999, 6, 30).diffMonths(date) == -1);
assert(Date(1999, 7, 1).diffMonths(date) == 0);
assert(Date(1999, 7, 6).diffMonths(date) == 0);
assert(Date(1999, 7, 11).diffMonths(date) == 0);
assert(Date(1999, 7, 16).diffMonths(date) == 0);
assert(Date(1999, 7, 21).diffMonths(date) == 0);
assert(Date(1999, 7, 26).diffMonths(date) == 0);
assert(Date(1999, 7, 31).diffMonths(date) == 0);
assert(Date(1999, 8, 1).diffMonths(date) == 1);
assert(Date(1990, 6, 30).diffMonths(date) == -109);
assert(Date(1990, 7, 1).diffMonths(date) == -108);
assert(Date(1990, 7, 6).diffMonths(date) == -108);
assert(Date(1990, 7, 11).diffMonths(date) == -108);
assert(Date(1990, 7, 16).diffMonths(date) == -108);
assert(Date(1990, 7, 21).diffMonths(date) == -108);
assert(Date(1990, 7, 26).diffMonths(date) == -108);
assert(Date(1990, 7, 31).diffMonths(date) == -108);
assert(Date(1990, 8, 1).diffMonths(date) == -107);
//Test B.C.
auto dateBC = Date(-1999, 7, 6);
assert(dateBC.diffMonths(Date(-2000, 6, 5)) == 13);
assert(dateBC.diffMonths(Date(-2000, 7, 5)) == 12);
assert(dateBC.diffMonths(Date(-2000, 8, 5)) == 11);
assert(dateBC.diffMonths(Date(-2000, 9, 5)) == 10);
assert(dateBC.diffMonths(Date(-2000, 10, 5)) == 9);
assert(dateBC.diffMonths(Date(-2000, 11, 5)) == 8);
assert(dateBC.diffMonths(Date(-2000, 12, 5)) == 7);
assert(dateBC.diffMonths(Date(-1999, 1, 5)) == 6);
assert(dateBC.diffMonths(Date(-1999, 2, 6)) == 5);
assert(dateBC.diffMonths(Date(-1999, 3, 6)) == 4);
assert(dateBC.diffMonths(Date(-1999, 4, 6)) == 3);
assert(dateBC.diffMonths(Date(-1999, 5, 6)) == 2);
assert(dateBC.diffMonths(Date(-1999, 6, 6)) == 1);
assert(dateBC.diffMonths(dateBC) == 0);
assert(dateBC.diffMonths(Date(-1999, 8, 6)) == -1);
assert(dateBC.diffMonths(Date(-1999, 9, 6)) == -2);
assert(dateBC.diffMonths(Date(-1999, 10, 6)) == -3);
assert(dateBC.diffMonths(Date(-1999, 11, 6)) == -4);
assert(dateBC.diffMonths(Date(-1999, 12, 6)) == -5);
assert(dateBC.diffMonths(Date(-1998, 1, 6)) == -6);
assert(dateBC.diffMonths(Date(-1998, 2, 6)) == -7);
assert(dateBC.diffMonths(Date(-1998, 3, 6)) == -8);
assert(dateBC.diffMonths(Date(-1998, 4, 6)) == -9);
assert(dateBC.diffMonths(Date(-1998, 5, 6)) == -10);
assert(dateBC.diffMonths(Date(-1998, 6, 6)) == -11);
assert(dateBC.diffMonths(Date(-1998, 7, 6)) == -12);
assert(dateBC.diffMonths(Date(-1998, 8, 6)) == -13);
assert(Date(-2000, 6, 5).diffMonths(dateBC) == -13);
assert(Date(-2000, 7, 5).diffMonths(dateBC) == -12);
assert(Date(-2000, 8, 5).diffMonths(dateBC) == -11);
assert(Date(-2000, 9, 5).diffMonths(dateBC) == -10);
assert(Date(-2000, 10, 5).diffMonths(dateBC) == -9);
assert(Date(-2000, 11, 5).diffMonths(dateBC) == -8);
assert(Date(-2000, 12, 5).diffMonths(dateBC) == -7);
assert(Date(-1999, 1, 5).diffMonths(dateBC) == -6);
assert(Date(-1999, 2, 6).diffMonths(dateBC) == -5);
assert(Date(-1999, 3, 6).diffMonths(dateBC) == -4);
assert(Date(-1999, 4, 6).diffMonths(dateBC) == -3);
assert(Date(-1999, 5, 6).diffMonths(dateBC) == -2);
assert(Date(-1999, 6, 6).diffMonths(dateBC) == -1);
assert(Date(-1999, 8, 6).diffMonths(dateBC) == 1);
assert(Date(-1999, 9, 6).diffMonths(dateBC) == 2);
assert(Date(-1999, 10, 6).diffMonths(dateBC) == 3);
assert(Date(-1999, 11, 6).diffMonths(dateBC) == 4);
assert(Date(-1999, 12, 6).diffMonths(dateBC) == 5);
assert(Date(-1998, 1, 6).diffMonths(dateBC) == 6);
assert(Date(-1998, 2, 6).diffMonths(dateBC) == 7);
assert(Date(-1998, 3, 6).diffMonths(dateBC) == 8);
assert(Date(-1998, 4, 6).diffMonths(dateBC) == 9);
assert(Date(-1998, 5, 6).diffMonths(dateBC) == 10);
assert(Date(-1998, 6, 6).diffMonths(dateBC) == 11);
assert(Date(-1998, 7, 6).diffMonths(dateBC) == 12);
assert(Date(-1998, 8, 6).diffMonths(dateBC) == 13);
assert(dateBC.diffMonths(Date(-1999, 6, 30)) == 1);
assert(dateBC.diffMonths(Date(-1999, 7, 1)) == 0);
assert(dateBC.diffMonths(Date(-1999, 7, 6)) == 0);
assert(dateBC.diffMonths(Date(-1999, 7, 11)) == 0);
assert(dateBC.diffMonths(Date(-1999, 7, 16)) == 0);
assert(dateBC.diffMonths(Date(-1999, 7, 21)) == 0);
assert(dateBC.diffMonths(Date(-1999, 7, 26)) == 0);
assert(dateBC.diffMonths(Date(-1999, 7, 31)) == 0);
assert(dateBC.diffMonths(Date(-1999, 8, 1)) == -1);
assert(dateBC.diffMonths(Date(-2008, 6, 30)) == 109);
assert(dateBC.diffMonths(Date(-2008, 7, 1)) == 108);
assert(dateBC.diffMonths(Date(-2008, 7, 6)) == 108);
assert(dateBC.diffMonths(Date(-2008, 7, 11)) == 108);
assert(dateBC.diffMonths(Date(-2008, 7, 16)) == 108);
assert(dateBC.diffMonths(Date(-2008, 7, 21)) == 108);
assert(dateBC.diffMonths(Date(-2008, 7, 26)) == 108);
assert(dateBC.diffMonths(Date(-2008, 7, 31)) == 108);
assert(dateBC.diffMonths(Date(-2008, 8, 1)) == 107);
assert(Date(-1999, 6, 30).diffMonths(dateBC) == -1);
assert(Date(-1999, 7, 1).diffMonths(dateBC) == 0);
assert(Date(-1999, 7, 6).diffMonths(dateBC) == 0);
assert(Date(-1999, 7, 11).diffMonths(dateBC) == 0);
assert(Date(-1999, 7, 16).diffMonths(dateBC) == 0);
assert(Date(-1999, 7, 21).diffMonths(dateBC) == 0);
assert(Date(-1999, 7, 26).diffMonths(dateBC) == 0);
assert(Date(-1999, 7, 31).diffMonths(dateBC) == 0);
assert(Date(-1999, 8, 1).diffMonths(dateBC) == 1);
assert(Date(-2008, 6, 30).diffMonths(dateBC) == -109);
assert(Date(-2008, 7, 1).diffMonths(dateBC) == -108);
assert(Date(-2008, 7, 6).diffMonths(dateBC) == -108);
assert(Date(-2008, 7, 11).diffMonths(dateBC) == -108);
assert(Date(-2008, 7, 16).diffMonths(dateBC) == -108);
assert(Date(-2008, 7, 21).diffMonths(dateBC) == -108);
assert(Date(-2008, 7, 26).diffMonths(dateBC) == -108);
assert(Date(-2008, 7, 31).diffMonths(dateBC) == -108);
assert(Date(-2008, 8, 1).diffMonths(dateBC) == -107);
//Test Both
assert(Date(3, 3, 3).diffMonths(Date(-5, 5, 5)) == 94);
assert(Date(-5, 5, 5).diffMonths(Date(3, 3, 3)) == -94);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date.diffMonths(date)));
static assert(__traits(compiles, cdate.diffMonths(date)));
static assert(__traits(compiles, idate.diffMonths(date)));
static assert(__traits(compiles, date.diffMonths(cdate)));
static assert(__traits(compiles, cdate.diffMonths(cdate)));
static assert(__traits(compiles, idate.diffMonths(cdate)));
static assert(__traits(compiles, date.diffMonths(idate)));
static assert(__traits(compiles, cdate.diffMonths(idate)));
static assert(__traits(compiles, idate.diffMonths(idate)));
}
/++
Whether this $(LREF Date) is in a leap year.
+/
@property bool isLeapYear() @safe const pure nothrow
{
return yearIsLeapYear(_year);
}
unittest
{
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, date.isLeapYear = true));
static assert(!__traits(compiles, cdate.isLeapYear = true));
static assert(!__traits(compiles, idate.isLeapYear = true));
}
/++
Day of the week this $(LREF Date) is on.
+/
@property DayOfWeek dayOfWeek() @safe const pure nothrow
{
return getDayOfWeek(dayOfGregorianCal);
}
unittest
{
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.dayOfWeek == DayOfWeek.sun));
static assert(!__traits(compiles, cdate.dayOfWeek = DayOfWeek.sun));
static assert(__traits(compiles, idate.dayOfWeek == DayOfWeek.sun));
static assert(!__traits(compiles, idate.dayOfWeek = DayOfWeek.sun));
}
/++
Day of the year this $(LREF Date) is on.
+/
@property ushort dayOfYear() @safe const pure nothrow
{
if (_month >= Month.jan && _month <= Month.dec)
{
immutable int[] lastDay = isLeapYear ? lastDayLeap : lastDayNonLeap;
auto monthIndex = _month - Month.jan;
return cast(ushort)(lastDay[monthIndex] + _day);
}
assert(0, "Invalid month.");
}
///
unittest
{
assert(Date(1999, 1, 1).dayOfYear == 1);
assert(Date(1999, 12, 31).dayOfYear == 365);
assert(Date(2000, 12, 31).dayOfYear == 366);
}
unittest
{
import std.range;
foreach(year; filter!((a){return !yearIsLeapYear(a);})
(chain(testYearsBC, testYearsAD)))
{
foreach(doy; testDaysOfYear)
{
assert(Date(year, doy.md.month, doy.md.day).dayOfYear ==
doy.day);
}
}
foreach(year; filter!((a){return yearIsLeapYear(a);})
(chain(testYearsBC, testYearsAD)))
{
foreach(doy; testDaysOfLeapYear)
{
assert(Date(year, doy.md.month, doy.md.day).dayOfYear ==
doy.day);
}
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.dayOfYear == 187));
static assert(__traits(compiles, idate.dayOfYear == 187));
}
/++
Day of the year.
Params:
day = The day of the year to set which day of the year this
$(LREF Date) is on.
Throws:
$(LREF DateTimeException) if the given day is an invalid day of the
year.
+/
@property void dayOfYear(int day) @safe pure
{
immutable int[] lastDay = isLeapYear ? lastDayLeap : lastDayNonLeap;
if(day <= 0 || day > (isLeapYear ? daysInLeapYear : daysInYear) )
throw new DateTimeException("Invalid day of the year.");
foreach (i; 1..lastDay.length)
{
if (day <= lastDay[i])
{
_month = cast(Month)(cast(int)Month.jan + i - 1);
_day = cast(ubyte)(day - lastDay[i - 1]);
return;
}
}
assert(0, "Invalid day of the year.");
}
unittest
{
static void test(Date date, int day, MonthDay expected, size_t line = __LINE__)
{
date.dayOfYear = day;
assert(date.month == expected.month);
assert(date.day == expected.day);
}
foreach(doy; testDaysOfYear)
{
test(Date(1999, 1, 1), doy.day, doy.md);
test(Date(-1, 1, 1), doy.day, doy.md);
}
foreach(doy; testDaysOfLeapYear)
{
test(Date(2000, 1, 1), doy.day, doy.md);
test(Date(-4, 1, 1), doy.day, doy.md);
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.dayOfYear = 187));
static assert(!__traits(compiles, idate.dayOfYear = 187));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF Date) is on.
+/
@property int dayOfGregorianCal() @safe const pure nothrow
{
if(isAD)
{
if(_year == 1)
return dayOfYear;
int years = _year - 1;
auto days = (years / 400) * daysIn400Years;
years %= 400;
days += (years / 100) * daysIn100Years;
years %= 100;
days += (years / 4) * daysIn4Years;
years %= 4;
days += years * daysInYear;
days += dayOfYear;
return days;
}
else if(_year == 0)
return dayOfYear - daysInLeapYear;
else
{
int years = _year;
auto days = (years / 400) * daysIn400Years;
years %= 400;
days += (years / 100) * daysIn100Years;
years %= 100;
days += (years / 4) * daysIn4Years;
years %= 4;
if(years < 0)
{
days -= daysInLeapYear;
++years;
days += years * daysInYear;
days -= daysInYear - dayOfYear;
}
else
days -= daysInLeapYear - dayOfYear;
return days;
}
}
///
unittest
{
assert(Date(1, 1, 1).dayOfGregorianCal == 1);
assert(Date(1, 12, 31).dayOfGregorianCal == 365);
assert(Date(2, 1, 1).dayOfGregorianCal == 366);
assert(Date(0, 12, 31).dayOfGregorianCal == 0);
assert(Date(0, 1, 1).dayOfGregorianCal == -365);
assert(Date(-1, 12, 31).dayOfGregorianCal == -366);
assert(Date(2000, 1, 1).dayOfGregorianCal == 730_120);
assert(Date(2010, 12, 31).dayOfGregorianCal == 734_137);
}
unittest
{
import std.range;
foreach(gd; chain(testGregDaysBC, testGregDaysAD))
assert(gd.date.dayOfGregorianCal == gd.day);
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date.dayOfGregorianCal));
static assert(__traits(compiles, cdate.dayOfGregorianCal));
static assert(__traits(compiles, idate.dayOfGregorianCal));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF Date) is on.
Params:
day = The day of the Gregorian Calendar to set this $(LREF Date) to.
+/
@property void dayOfGregorianCal(int day) @safe pure nothrow
{
this = Date(day);
}
///
unittest
{
auto date = Date.init;
date.dayOfGregorianCal = 1;
assert(date == Date(1, 1, 1));
date.dayOfGregorianCal = 365;
assert(date == Date(1, 12, 31));
date.dayOfGregorianCal = 366;
assert(date == Date(2, 1, 1));
date.dayOfGregorianCal = 0;
assert(date == Date(0, 12, 31));
date.dayOfGregorianCal = -365;
assert(date == Date(-0, 1, 1));
date.dayOfGregorianCal = -366;
assert(date == Date(-1, 12, 31));
date.dayOfGregorianCal = 730_120;
assert(date == Date(2000, 1, 1));
date.dayOfGregorianCal = 734_137;
assert(date == Date(2010, 12, 31));
}
unittest
{
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date.dayOfGregorianCal = 187));
static assert(!__traits(compiles, cdate.dayOfGregorianCal = 187));
static assert(!__traits(compiles, idate.dayOfGregorianCal = 187));
}
/++
The ISO 8601 week of the year that this $(LREF Date) is in.
See_Also:
$(WEB en.wikipedia.org/wiki/ISO_week_date, ISO Week Date)
+/
@property ubyte isoWeek() @safe const pure nothrow
{
immutable weekday = dayOfWeek;
immutable adjustedWeekday = weekday == DayOfWeek.sun ? 7 : weekday;
immutable week = (dayOfYear - adjustedWeekday + 10) / 7;
try
{
if(week == 53)
{
switch(Date(_year + 1, 1, 1).dayOfWeek)
{
case DayOfWeek.mon:
case DayOfWeek.tue:
case DayOfWeek.wed:
case DayOfWeek.thu:
return 1;
case DayOfWeek.fri:
case DayOfWeek.sat:
case DayOfWeek.sun:
return 53;
default:
assert(0, "Invalid ISO Week");
}
}
else if(week > 0)
return cast(ubyte)week;
else
return Date(_year - 1, 12, 31).isoWeek;
}
catch(Exception e)
assert(0, "Date's constructor threw.");
}
unittest
{
//Test A.D.
assert(Date(2009, 12, 28).isoWeek == 53);
assert(Date(2009, 12, 29).isoWeek == 53);
assert(Date(2009, 12, 30).isoWeek == 53);
assert(Date(2009, 12, 31).isoWeek == 53);
assert(Date(2010, 1, 1).isoWeek == 53);
assert(Date(2010, 1, 2).isoWeek == 53);
assert(Date(2010, 1, 3).isoWeek == 53);
assert(Date(2010, 1, 4).isoWeek == 1);
assert(Date(2010, 1, 5).isoWeek == 1);
assert(Date(2010, 1, 6).isoWeek == 1);
assert(Date(2010, 1, 7).isoWeek == 1);
assert(Date(2010, 1, 8).isoWeek == 1);
assert(Date(2010, 1, 9).isoWeek == 1);
assert(Date(2010, 1, 10).isoWeek == 1);
assert(Date(2010, 1, 11).isoWeek == 2);
assert(Date(2010, 12, 31).isoWeek == 52);
assert(Date(2004, 12, 26).isoWeek == 52);
assert(Date(2004, 12, 27).isoWeek == 53);
assert(Date(2004, 12, 28).isoWeek == 53);
assert(Date(2004, 12, 29).isoWeek == 53);
assert(Date(2004, 12, 30).isoWeek == 53);
assert(Date(2004, 12, 31).isoWeek == 53);
assert(Date(2005, 1, 1).isoWeek == 53);
assert(Date(2005, 1, 2).isoWeek == 53);
assert(Date(2005, 12, 31).isoWeek == 52);
assert(Date(2007, 1, 1).isoWeek == 1);
assert(Date(2007, 12, 30).isoWeek == 52);
assert(Date(2007, 12, 31).isoWeek == 1);
assert(Date(2008, 1, 1).isoWeek == 1);
assert(Date(2008, 12, 28).isoWeek == 52);
assert(Date(2008, 12, 29).isoWeek == 1);
assert(Date(2008, 12, 30).isoWeek == 1);
assert(Date(2008, 12, 31).isoWeek == 1);
assert(Date(2009, 1, 1).isoWeek == 1);
assert(Date(2009, 1, 2).isoWeek == 1);
assert(Date(2009, 1, 3).isoWeek == 1);
assert(Date(2009, 1, 4).isoWeek == 1);
//Test B.C.
//The algorithm should work identically for both A.D. and B.C. since
//it doesn't really take the year into account, so B.C. testing
//probably isn't really needed.
assert(Date(0, 12, 31).isoWeek == 52);
assert(Date(0, 1, 4).isoWeek == 1);
assert(Date(0, 1, 1).isoWeek == 52);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.isoWeek == 3));
static assert(!__traits(compiles, cdate.isoWeek = 3));
static assert(__traits(compiles, idate.isoWeek == 3));
static assert(!__traits(compiles, idate.isoWeek = 3));
}
/++
$(LREF Date) for the last day in the month that this $(LREF Date) is in.
+/
@property Date endOfMonth() @safe const pure nothrow
{
try
return Date(_year, _month, maxDay(_year, _month));
catch(Exception e)
assert(0, "Date's constructor threw.");
}
///
unittest
{
assert(Date(1999, 1, 6).endOfMonth == Date(1999, 1, 31));
assert(Date(1999, 2, 7).endOfMonth == Date(1999, 2, 28));
assert(Date(2000, 2, 7).endOfMonth == Date(2000, 2, 29));
assert(Date(2000, 6, 4).endOfMonth == Date(2000, 6, 30));
}
unittest
{
//Test A.D.
assert(Date(1999, 1, 1).endOfMonth == Date(1999, 1, 31));
assert(Date(1999, 2, 1).endOfMonth == Date(1999, 2, 28));
assert(Date(2000, 2, 1).endOfMonth == Date(2000, 2, 29));
assert(Date(1999, 3, 1).endOfMonth == Date(1999, 3, 31));
assert(Date(1999, 4, 1).endOfMonth == Date(1999, 4, 30));
assert(Date(1999, 5, 1).endOfMonth == Date(1999, 5, 31));
assert(Date(1999, 6, 1).endOfMonth == Date(1999, 6, 30));
assert(Date(1999, 7, 1).endOfMonth == Date(1999, 7, 31));
assert(Date(1999, 8, 1).endOfMonth == Date(1999, 8, 31));
assert(Date(1999, 9, 1).endOfMonth == Date(1999, 9, 30));
assert(Date(1999, 10, 1).endOfMonth == Date(1999, 10, 31));
assert(Date(1999, 11, 1).endOfMonth == Date(1999, 11, 30));
assert(Date(1999, 12, 1).endOfMonth == Date(1999, 12, 31));
//Test B.C.
assert(Date(-1999, 1, 1).endOfMonth == Date(-1999, 1, 31));
assert(Date(-1999, 2, 1).endOfMonth == Date(-1999, 2, 28));
assert(Date(-2000, 2, 1).endOfMonth == Date(-2000, 2, 29));
assert(Date(-1999, 3, 1).endOfMonth == Date(-1999, 3, 31));
assert(Date(-1999, 4, 1).endOfMonth == Date(-1999, 4, 30));
assert(Date(-1999, 5, 1).endOfMonth == Date(-1999, 5, 31));
assert(Date(-1999, 6, 1).endOfMonth == Date(-1999, 6, 30));
assert(Date(-1999, 7, 1).endOfMonth == Date(-1999, 7, 31));
assert(Date(-1999, 8, 1).endOfMonth == Date(-1999, 8, 31));
assert(Date(-1999, 9, 1).endOfMonth == Date(-1999, 9, 30));
assert(Date(-1999, 10, 1).endOfMonth == Date(-1999, 10, 31));
assert(Date(-1999, 11, 1).endOfMonth == Date(-1999, 11, 30));
assert(Date(-1999, 12, 1).endOfMonth == Date(-1999, 12, 31));
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.endOfMonth = Date(1999, 7, 30)));
static assert(!__traits(compiles, idate.endOfMonth = Date(1999, 7, 30)));
}
/++
The last day in the month that this $(LREF Date) is in.
+/
@property ubyte daysInMonth() @safe const pure nothrow
{
return maxDay(_year, _month);
}
///
unittest
{
assert(Date(1999, 1, 6).daysInMonth == 31);
assert(Date(1999, 2, 7).daysInMonth == 28);
assert(Date(2000, 2, 7).daysInMonth == 29);
assert(Date(2000, 6, 4).daysInMonth == 30);
}
unittest
{
//Test A.D.
assert(Date(1999, 1, 1).daysInMonth == 31);
assert(Date(1999, 2, 1).daysInMonth == 28);
assert(Date(2000, 2, 1).daysInMonth == 29);
assert(Date(1999, 3, 1).daysInMonth == 31);
assert(Date(1999, 4, 1).daysInMonth == 30);
assert(Date(1999, 5, 1).daysInMonth == 31);
assert(Date(1999, 6, 1).daysInMonth == 30);
assert(Date(1999, 7, 1).daysInMonth == 31);
assert(Date(1999, 8, 1).daysInMonth == 31);
assert(Date(1999, 9, 1).daysInMonth == 30);
assert(Date(1999, 10, 1).daysInMonth == 31);
assert(Date(1999, 11, 1).daysInMonth == 30);
assert(Date(1999, 12, 1).daysInMonth == 31);
//Test B.C.
assert(Date(-1999, 1, 1).daysInMonth == 31);
assert(Date(-1999, 2, 1).daysInMonth == 28);
assert(Date(-2000, 2, 1).daysInMonth == 29);
assert(Date(-1999, 3, 1).daysInMonth == 31);
assert(Date(-1999, 4, 1).daysInMonth == 30);
assert(Date(-1999, 5, 1).daysInMonth == 31);
assert(Date(-1999, 6, 1).daysInMonth == 30);
assert(Date(-1999, 7, 1).daysInMonth == 31);
assert(Date(-1999, 8, 1).daysInMonth == 31);
assert(Date(-1999, 9, 1).daysInMonth == 30);
assert(Date(-1999, 10, 1).daysInMonth == 31);
assert(Date(-1999, 11, 1).daysInMonth == 30);
assert(Date(-1999, 12, 1).daysInMonth == 31);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate.daysInMonth = 30));
static assert(!__traits(compiles, idate.daysInMonth = 30));
}
/++
Whether the current year is a date in A.D.
+/
@property bool isAD() @safe const pure nothrow
{
return _year > 0;
}
///
unittest
{
assert(Date(1, 1, 1).isAD);
assert(Date(2010, 12, 31).isAD);
assert(!Date(0, 12, 31).isAD);
assert(!Date(-2010, 1, 1).isAD);
}
unittest
{
assert(Date(2010, 7, 4).isAD);
assert(Date(1, 1, 1).isAD);
assert(!Date(0, 1, 1).isAD);
assert(!Date(-1, 1, 1).isAD);
assert(!Date(-2010, 7, 4).isAD);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.isAD));
static assert(__traits(compiles, idate.isAD));
}
/++
The $(WEB en.wikipedia.org/wiki/Julian_day, Julian day) for this $(LREF Date) at noon (since the Julian day changes
at noon).
+/
@property long julianDay() @safe const pure nothrow
{
return dayOfGregorianCal + 1_721_425;
}
unittest
{
assert(Date(-4713, 11, 24).julianDay == 0);
assert(Date(0, 12, 31).julianDay == 1_721_425);
assert(Date(1, 1, 1).julianDay == 1_721_426);
assert(Date(1582, 10, 15).julianDay == 2_299_161);
assert(Date(1858, 11, 17).julianDay == 2_400_001);
assert(Date(1982, 1, 4).julianDay == 2_444_974);
assert(Date(1996, 3, 31).julianDay == 2_450_174);
assert(Date(2010, 8, 24).julianDay == 2_455_433);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.julianDay));
static assert(__traits(compiles, idate.julianDay));
}
/++
The modified $(WEB 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 pure nothrow
{
return julianDay - 2_400_001;
}
unittest
{
assert(Date(1858, 11, 17).modJulianDay == 0);
assert(Date(2010, 8, 24).modJulianDay == 55_432);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.modJulianDay));
static assert(__traits(compiles, idate.modJulianDay));
}
/++
Converts this $(LREF Date) to a string with the format YYYYMMDD.
+/
string toISOString() @safe const pure nothrow
{
import std.format : format;
try
{
if(_year >= 0)
{
if(_year < 10_000)
return format("%04d%02d%02d", _year, _month, _day);
else
return format("+%05d%02d%02d", _year, _month, _day);
}
else if(_year > -10_000)
return format("%05d%02d%02d", _year, _month, _day);
else
return format("%06d%02d%02d", _year, _month, _day);
}
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(Date(2010, 7, 4).toISOString() == "20100704");
assert(Date(1998, 12, 25).toISOString() == "19981225");
assert(Date(0, 1, 5).toISOString() == "00000105");
assert(Date(-4, 1, 5).toISOString() == "-00040105");
}
unittest
{
//Test A.D.
assert(Date(9, 12, 4).toISOString() == "00091204");
assert(Date(99, 12, 4).toISOString() == "00991204");
assert(Date(999, 12, 4).toISOString() == "09991204");
assert(Date(9999, 7, 4).toISOString() == "99990704");
assert(Date(10000, 10, 20).toISOString() == "+100001020");
//Test B.C.
assert(Date(0, 12, 4).toISOString() == "00001204");
assert(Date(-9, 12, 4).toISOString() == "-00091204");
assert(Date(-99, 12, 4).toISOString() == "-00991204");
assert(Date(-999, 12, 4).toISOString() == "-09991204");
assert(Date(-9999, 7, 4).toISOString() == "-99990704");
assert(Date(-10000, 10, 20).toISOString() == "-100001020");
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.toISOString()));
static assert(__traits(compiles, idate.toISOString()));
}
/++
Converts this $(LREF Date) to a string with the format YYYY-MM-DD.
+/
string toISOExtString() @safe const pure nothrow
{
import std.format : format;
try
{
if(_year >= 0)
{
if(_year < 10_000)
return format("%04d-%02d-%02d", _year, _month, _day);
else
return format("+%05d-%02d-%02d", _year, _month, _day);
}
else if(_year > -10_000)
return format("%05d-%02d-%02d", _year, _month, _day);
else
return format("%06d-%02d-%02d", _year, _month, _day);
}
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(Date(2010, 7, 4).toISOExtString() == "2010-07-04");
assert(Date(1998, 12, 25).toISOExtString() == "1998-12-25");
assert(Date(0, 1, 5).toISOExtString() == "0000-01-05");
assert(Date(-4, 1, 5).toISOExtString() == "-0004-01-05");
}
unittest
{
//Test A.D.
assert(Date(9, 12, 4).toISOExtString() == "0009-12-04");
assert(Date(99, 12, 4).toISOExtString() == "0099-12-04");
assert(Date(999, 12, 4).toISOExtString() == "0999-12-04");
assert(Date(9999, 7, 4).toISOExtString() == "9999-07-04");
assert(Date(10000, 10, 20).toISOExtString() == "+10000-10-20");
//Test B.C.
assert(Date(0, 12, 4).toISOExtString() == "0000-12-04");
assert(Date(-9, 12, 4).toISOExtString() == "-0009-12-04");
assert(Date(-99, 12, 4).toISOExtString() == "-0099-12-04");
assert(Date(-999, 12, 4).toISOExtString() == "-0999-12-04");
assert(Date(-9999, 7, 4).toISOExtString() == "-9999-07-04");
assert(Date(-10000, 10, 20).toISOExtString() == "-10000-10-20");
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.toISOExtString()));
static assert(__traits(compiles, idate.toISOExtString()));
}
/++
Converts this $(LREF Date) to a string with the format YYYY-Mon-DD.
+/
string toSimpleString() @safe const pure nothrow
{
import std.format : format;
try
{
if(_year >= 0)
{
if(_year < 10_000)
return format("%04d-%s-%02d", _year, monthToString(_month), _day);
else
return format("+%05d-%s-%02d", _year, monthToString(_month), _day);
}
else if(_year > -10_000)
return format("%05d-%s-%02d", _year, monthToString(_month), _day);
else
return format("%06d-%s-%02d", _year, monthToString(_month), _day);
}
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(Date(2010, 7, 4).toSimpleString() == "2010-Jul-04");
assert(Date(1998, 12, 25).toSimpleString() == "1998-Dec-25");
assert(Date(0, 1, 5).toSimpleString() == "0000-Jan-05");
assert(Date(-4, 1, 5).toSimpleString() == "-0004-Jan-05");
}
unittest
{
//Test A.D.
assert(Date(9, 12, 4).toSimpleString() == "0009-Dec-04");
assert(Date(99, 12, 4).toSimpleString() == "0099-Dec-04");
assert(Date(999, 12, 4).toSimpleString() == "0999-Dec-04");
assert(Date(9999, 7, 4).toSimpleString() == "9999-Jul-04");
assert(Date(10000, 10, 20).toSimpleString() == "+10000-Oct-20");
//Test B.C.
assert(Date(0, 12, 4).toSimpleString() == "0000-Dec-04");
assert(Date(-9, 12, 4).toSimpleString() == "-0009-Dec-04");
assert(Date(-99, 12, 4).toSimpleString() == "-0099-Dec-04");
assert(Date(-999, 12, 4).toSimpleString() == "-0999-Dec-04");
assert(Date(-9999, 7, 4).toSimpleString() == "-9999-Jul-04");
assert(Date(-10000, 10, 20).toSimpleString() == "-10000-Oct-20");
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, cdate.toSimpleString()));
static assert(__traits(compiles, idate.toSimpleString()));
}
/++
Converts this $(LREF Date) to a string.
+/
string toString() @safe const pure nothrow
{
return toSimpleString();
}
unittest
{
auto date = Date(1999, 7, 6);
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(__traits(compiles, date.toString()));
static assert(__traits(compiles, cdate.toString()));
static assert(__traits(compiles, idate.toString()));
}
/++
Creates a $(LREF Date) from a string with the format YYYYMMDD. Whitespace
is stripped from the given string.
Params:
isoString = A string formatted in the ISO format for dates.
Throws:
$(LREF DateTimeException) if the given string is not in the ISO format
or if the resulting $(LREF Date) would not be valid.
+/
static Date fromISOString(S)(in S isoString) @safe pure
if(isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
import std.conv : to;
import std.algorithm : all, startsWith;
import std.format : format;
auto dstr = to!dstring(strip(isoString));
enforce(dstr.length >= 8, new DateTimeException(format("Invalid ISO String: %s", isoString)));
auto day = dstr[$-2 .. $];
auto month = dstr[$-4 .. $-2];
auto year = dstr[0 .. $-4];
enforce(all!isDigit(day), new DateTimeException(format("Invalid ISO String: %s", isoString)));
enforce(all!isDigit(month), new DateTimeException(format("Invalid ISO String: %s", isoString)));
if(year.length > 4)
{
enforce(year.startsWith('-', '+'),
new DateTimeException(format("Invalid ISO String: %s", isoString)));
enforce(all!isDigit(year[1..$]),
new DateTimeException(format("Invalid ISO String: %s", isoString)));
}
else
enforce(all!isDigit(year), new DateTimeException(format("Invalid ISO String: %s", isoString)));
return Date(to!short(year), to!ubyte(month), to!ubyte(day));
}
///
unittest
{
assert(Date.fromISOString("20100704") == Date(2010, 7, 4));
assert(Date.fromISOString("19981225") == Date(1998, 12, 25));
assert(Date.fromISOString("00000105") == Date(0, 1, 5));
assert(Date.fromISOString("-00040105") == Date(-4, 1, 5));
assert(Date.fromISOString(" 20100704 ") == Date(2010, 7, 4));
}
unittest
{
assertThrown!DateTimeException(Date.fromISOString(""));
assertThrown!DateTimeException(Date.fromISOString("990704"));
assertThrown!DateTimeException(Date.fromISOString("0100704"));
assertThrown!DateTimeException(Date.fromISOString("2010070"));
assertThrown!DateTimeException(Date.fromISOString("2010070 "));
assertThrown!DateTimeException(Date.fromISOString("120100704"));
assertThrown!DateTimeException(Date.fromISOString("-0100704"));
assertThrown!DateTimeException(Date.fromISOString("+0100704"));
assertThrown!DateTimeException(Date.fromISOString("2010070a"));
assertThrown!DateTimeException(Date.fromISOString("20100a04"));
assertThrown!DateTimeException(Date.fromISOString("2010a704"));
assertThrown!DateTimeException(Date.fromISOString("99-07-04"));
assertThrown!DateTimeException(Date.fromISOString("010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-0"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-0 "));
assertThrown!DateTimeException(Date.fromISOString("12010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("-010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("+010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-0a"));
assertThrown!DateTimeException(Date.fromISOString("2010-0a-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-a7-04"));
assertThrown!DateTimeException(Date.fromISOString("2010/07/04"));
assertThrown!DateTimeException(Date.fromISOString("2010/7/04"));
assertThrown!DateTimeException(Date.fromISOString("2010/7/4"));
assertThrown!DateTimeException(Date.fromISOString("2010/07/4"));
assertThrown!DateTimeException(Date.fromISOString("2010-7-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-7-4"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-4"));
assertThrown!DateTimeException(Date.fromISOString("99Jul04"));
assertThrown!DateTimeException(Date.fromISOString("010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("2010Jul0"));
assertThrown!DateTimeException(Date.fromISOString("2010Jul0 "));
assertThrown!DateTimeException(Date.fromISOString("12010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("-010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("+010Jul04"));
assertThrown!DateTimeException(Date.fromISOString("2010Jul0a"));
assertThrown!DateTimeException(Date.fromISOString("2010Jua04"));
assertThrown!DateTimeException(Date.fromISOString("2010aul04"));
assertThrown!DateTimeException(Date.fromISOString("99-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0 "));
assertThrown!DateTimeException(Date.fromISOString("12010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("-010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("+010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-0a"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jua-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jal-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-aul-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-07-04"));
assertThrown!DateTimeException(Date.fromISOString("2010-Jul-04"));
assert(Date.fromISOString("19990706") == Date(1999, 7, 6));
assert(Date.fromISOString("-19990706") == Date(-1999, 7, 6));
assert(Date.fromISOString("+019990706") == Date(1999, 7, 6));
assert(Date.fromISOString("19990706 ") == Date(1999, 7, 6));
assert(Date.fromISOString(" 19990706") == Date(1999, 7, 6));
assert(Date.fromISOString(" 19990706 ") == Date(1999, 7, 6));
}
/++
Creates a $(LREF Date) from a string with the format YYYY-MM-DD. Whitespace
is stripped from the given string.
Params:
isoExtString = A string formatted in the ISO Extended format for
dates.
Throws:
$(LREF DateTimeException) if the given string is not in the ISO
Extended format or if the resulting $(LREF Date) would not be valid.
+/
static Date fromISOExtString(S)(in S isoExtString) @safe pure
if(isSomeString!(S))
{
import std.ascii : isDigit;
import std.string : strip;
import std.conv : to;
import std.algorithm : all, startsWith;
import std.format : format;
auto dstr = to!dstring(strip(isoExtString));
enforce(dstr.length >= 10, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
auto day = dstr[$-2 .. $];
auto month = dstr[$-5 .. $-3];
auto year = dstr[0 .. $-6];
enforce(dstr[$-3] == '-', new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(dstr[$-6] == '-', new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(all!isDigit(day),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(all!isDigit(month),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
if(year.length > 4)
{
enforce(year.startsWith('-', '+'),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(all!isDigit(year[1..$]),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
}
else
enforce(all!isDigit(year),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
return Date(to!short(year), to!ubyte(month), to!ubyte(day));
}
///
unittest
{
assert(Date.fromISOExtString("2010-07-04") == Date(2010, 7, 4));
assert(Date.fromISOExtString("1998-12-25") == Date(1998, 12, 25));
assert(Date.fromISOExtString("0000-01-05") == Date(0, 1, 5));
assert(Date.fromISOExtString("-0004-01-05") == Date(-4, 1, 5));
assert(Date.fromISOExtString(" 2010-07-04 ") == Date(2010, 7, 4));
}
unittest
{
assertThrown!DateTimeException(Date.fromISOExtString(""));
assertThrown!DateTimeException(Date.fromISOExtString("990704"));
assertThrown!DateTimeException(Date.fromISOExtString("0100704"));
assertThrown!DateTimeException(Date.fromISOExtString("2010070"));
assertThrown!DateTimeException(Date.fromISOExtString("2010070 "));
assertThrown!DateTimeException(Date.fromISOExtString("120100704"));
assertThrown!DateTimeException(Date.fromISOExtString("-0100704"));
assertThrown!DateTimeException(Date.fromISOExtString("+0100704"));
assertThrown!DateTimeException(Date.fromISOExtString("2010070a"));
assertThrown!DateTimeException(Date.fromISOExtString("20100a04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010a704"));
assertThrown!DateTimeException(Date.fromISOExtString("99-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0 "));
assertThrown!DateTimeException(Date.fromISOExtString("12010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("-010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("+010-07-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-0a"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-0a-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-a7-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/07/04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/7/04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/7/4"));
assertThrown!DateTimeException(Date.fromISOExtString("2010/07/4"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-7-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-7-4"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-07-4"));
assertThrown!DateTimeException(Date.fromISOExtString("99Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0 "));
assertThrown!DateTimeException(Date.fromISOExtString("12010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("-010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("+010Jul04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0a"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jua04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010aul04"));
assertThrown!DateTimeException(Date.fromISOExtString("99-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0"));
assertThrown!DateTimeException(Date.fromISOExtString("2010Jul0 "));
assertThrown!DateTimeException(Date.fromISOExtString("12010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("-010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("+010-Jul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-0a"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jua-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jal-04"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-aul-04"));
assertThrown!DateTimeException(Date.fromISOExtString("20100704"));
assertThrown!DateTimeException(Date.fromISOExtString("2010-Jul-04"));
assert(Date.fromISOExtString("1999-07-06") == Date(1999, 7, 6));
assert(Date.fromISOExtString("-1999-07-06") == Date(-1999, 7, 6));
assert(Date.fromISOExtString("+01999-07-06") == Date(1999, 7, 6));
assert(Date.fromISOExtString("1999-07-06 ") == Date(1999, 7, 6));
assert(Date.fromISOExtString(" 1999-07-06") == Date(1999, 7, 6));
assert(Date.fromISOExtString(" 1999-07-06 ") == Date(1999, 7, 6));
}
/++
Creates a $(LREF Date) from a string with the format YYYY-Mon-DD.
Whitespace is stripped from the given string.
Params:
simpleString = A string formatted in the way that toSimpleString
formats dates.
Throws:
$(LREF DateTimeException) if the given string is not in the correct
format or if the resulting $(LREF Date) would not be valid.
+/
static Date fromSimpleString(S)(in S simpleString) @safe pure
if(isSomeString!(S))
{
import std.ascii : isDigit;
import std.string : strip;
import std.conv : to;
import std.algorithm : all, startsWith;
import std.format : format;
auto dstr = to!dstring(strip(simpleString));
enforce(dstr.length >= 11, new DateTimeException(format("Invalid string format: %s", simpleString)));
auto day = dstr[$-2 .. $];
auto month = monthFromString(to!string(dstr[$-6 .. $-3]));
auto year = dstr[0 .. $-7];
enforce(dstr[$-3] == '-', new DateTimeException(format("Invalid string format: %s", simpleString)));
enforce(dstr[$-7] == '-', new DateTimeException(format("Invalid string format: %s", simpleString)));
enforce(all!isDigit(day), new DateTimeException(format("Invalid string format: %s", simpleString)));
if(year.length > 4)
{
enforce(year.startsWith('-', '+'),
new DateTimeException(format("Invalid string format: %s", simpleString)));
enforce(all!isDigit(year[1..$]),
new DateTimeException(format("Invalid string format: %s", simpleString)));
}
else
enforce(all!isDigit(year),
new DateTimeException(format("Invalid string format: %s", simpleString)));
return Date(to!short(year), month, to!ubyte(day));
}
///
unittest
{
assert(Date.fromSimpleString("2010-Jul-04") == Date(2010, 7, 4));
assert(Date.fromSimpleString("1998-Dec-25") == Date(1998, 12, 25));
assert(Date.fromSimpleString("0000-Jan-05") == Date(0, 1, 5));
assert(Date.fromSimpleString("-0004-Jan-05") == Date(-4, 1, 5));
assert(Date.fromSimpleString(" 2010-Jul-04 ") == Date(2010, 7, 4));
}
unittest
{
assertThrown!DateTimeException(Date.fromSimpleString(""));
assertThrown!DateTimeException(Date.fromSimpleString("990704"));
assertThrown!DateTimeException(Date.fromSimpleString("0100704"));
assertThrown!DateTimeException(Date.fromSimpleString("2010070"));
assertThrown!DateTimeException(Date.fromSimpleString("2010070 "));
assertThrown!DateTimeException(Date.fromSimpleString("120100704"));
assertThrown!DateTimeException(Date.fromSimpleString("-0100704"));
assertThrown!DateTimeException(Date.fromSimpleString("+0100704"));
assertThrown!DateTimeException(Date.fromSimpleString("2010070a"));
assertThrown!DateTimeException(Date.fromSimpleString("20100a04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010a704"));
assertThrown!DateTimeException(Date.fromSimpleString("99-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0 "));
assertThrown!DateTimeException(Date.fromSimpleString("12010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("-010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("+010-07-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-0a"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-0a-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-a7-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/07/04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/7/04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/7/4"));
assertThrown!DateTimeException(Date.fromSimpleString("2010/07/4"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-7-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-7-4"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-4"));
assertThrown!DateTimeException(Date.fromSimpleString("99Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0 "));
assertThrown!DateTimeException(Date.fromSimpleString("12010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("-010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("+010Jul04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jul0a"));
assertThrown!DateTimeException(Date.fromSimpleString("2010Jua04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010aul04"));
assertThrown!DateTimeException(Date.fromSimpleString("99-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0 "));
assertThrown!DateTimeException(Date.fromSimpleString("12010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("-010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("+010-Jul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jul-0a"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jua-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-Jal-04"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-aul-04"));
assertThrown!DateTimeException(Date.fromSimpleString("20100704"));
assertThrown!DateTimeException(Date.fromSimpleString("2010-07-04"));
assert(Date.fromSimpleString("1999-Jul-06") == Date(1999, 7, 6));
assert(Date.fromSimpleString("-1999-Jul-06") == Date(-1999, 7, 6));
assert(Date.fromSimpleString("+01999-Jul-06") == Date(1999, 7, 6));
assert(Date.fromSimpleString("1999-Jul-06 ") == Date(1999, 7, 6));
assert(Date.fromSimpleString(" 1999-Jul-06") == Date(1999, 7, 6));
assert(Date.fromSimpleString(" 1999-Jul-06 ") == Date(1999, 7, 6));
}
/++
Returns the $(LREF Date) farthest in the past which is representable by
$(LREF Date).
+/
@property static Date min() @safe pure nothrow
{
auto date = Date.init;
date._year = short.min;
date._month = Month.jan;
date._day = 1;
return date;
}
unittest
{
assert(Date.min.year < 0);
assert(Date.min < Date.max);
}
/++
Returns the $(LREF Date) farthest in the future which is representable by
$(LREF Date).
+/
@property static Date max() @safe pure nothrow
{
auto date = Date.init;
date._year = short.max;
date._month = Month.dec;
date._day = 31;
return date;
}
unittest
{
assert(Date.max.year > 0);
assert(Date.max > Date.min);
}
private:
/+
Whether the given values form a valid date.
Params:
year = The year to test.
month = The month of the Gregorian Calendar to test.
day = The day of the month to test.
+/
static bool _valid(int year, int month, int day) @safe pure nothrow
{
if(!valid!"months"(month))
return false;
return valid!"days"(year, month, day);
}
/+
Adds the given number of days to this $(LREF Date). A negative number will
subtract.
The month will be adjusted along with the day if the number of days
added (or subtracted) would overflow (or underflow) the current month.
The year will be adjusted along with the month if the increase (or
decrease) to the month would cause it to overflow (or underflow) the
current year.
$(D _addDays(numDays)) is effectively equivalent to
$(D date.dayOfGregorianCal = date.dayOfGregorianCal + days).
Params:
days = The number of days to add to this Date.
+/
ref Date _addDays(long days) return @safe pure nothrow
{
dayOfGregorianCal = cast(int)(dayOfGregorianCal + days);
return this;
}
unittest
{
//Test A.D.
{
auto date = Date(1999, 2, 28);
date._addDays(1);
assert(date == Date(1999, 3, 1));
date._addDays(-1);
assert(date == Date(1999, 2, 28));
}
{
auto date = Date(2000, 2, 28);
date._addDays(1);
assert(date == Date(2000, 2, 29));
date._addDays(1);
assert(date == Date(2000, 3, 1));
date._addDays(-1);
assert(date == Date(2000, 2, 29));
}
{
auto date = Date(1999, 6, 30);
date._addDays(1);
assert(date == Date(1999, 7, 1));
date._addDays(-1);
assert(date == Date(1999, 6, 30));
}
{
auto date = Date(1999, 7, 31);
date._addDays(1);
assert(date == Date(1999, 8, 1));
date._addDays(-1);
assert(date == Date(1999, 7, 31));
}
{
auto date = Date(1999, 1, 1);
date._addDays(-1);
assert(date == Date(1998, 12, 31));
date._addDays(1);
assert(date == Date(1999, 1, 1));
}
{
auto date = Date(1999, 7, 6);
date._addDays(9);
assert(date == Date(1999, 7, 15));
date._addDays(-11);
assert(date == Date(1999, 7, 4));
date._addDays(30);
assert(date == Date(1999, 8, 3));
date._addDays(-3);
assert(date == Date(1999, 7, 31));
}
{
auto date = Date(1999, 7, 6);
date._addDays(365);
assert(date == Date(2000, 7, 5));
date._addDays(-365);
assert(date == Date(1999, 7, 6));
date._addDays(366);
assert(date == Date(2000, 7, 6));
date._addDays(730);
assert(date == Date(2002, 7, 6));
date._addDays(-1096);
assert(date == Date(1999, 7, 6));
}
//Test B.C.
{
auto date = Date(-1999, 2, 28);
date._addDays(1);
assert(date == Date(-1999, 3, 1));
date._addDays(-1);
assert(date == Date(-1999, 2, 28));
}
{
auto date = Date(-2000, 2, 28);
date._addDays(1);
assert(date == Date(-2000, 2, 29));
date._addDays(1);
assert(date == Date(-2000, 3, 1));
date._addDays(-1);
assert(date == Date(-2000, 2, 29));
}
{
auto date = Date(-1999, 6, 30);
date._addDays(1);
assert(date == Date(-1999, 7, 1));
date._addDays(-1);
assert(date == Date(-1999, 6, 30));
}
{
auto date = Date(-1999, 7, 31);
date._addDays(1);
assert(date == Date(-1999, 8, 1));
date._addDays(-1);
assert(date == Date(-1999, 7, 31));
}
{
auto date = Date(-1999, 1, 1);
date._addDays(-1);
assert(date == Date(-2000, 12, 31));
date._addDays(1);
assert(date == Date(-1999, 1, 1));
}
{
auto date = Date(-1999, 7, 6);
date._addDays(9);
assert(date == Date(-1999, 7, 15));
date._addDays(-11);
assert(date == Date(-1999, 7, 4));
date._addDays(30);
assert(date == Date(-1999, 8, 3));
date._addDays(-3);
}
{
auto date = Date(-1999, 7, 6);
date._addDays(365);
assert(date == Date(-1998, 7, 6));
date._addDays(-365);
assert(date == Date(-1999, 7, 6));
date._addDays(366);
assert(date == Date(-1998, 7, 7));
date._addDays(730);
assert(date == Date(-1996, 7, 6));
date._addDays(-1096);
assert(date == Date(-1999, 7, 6));
}
//Test Both
{
auto date = Date(1, 7, 6);
date._addDays(-365);
assert(date == Date(0, 7, 6));
date._addDays(365);
assert(date == Date(1, 7, 6));
date._addDays(-731);
assert(date == Date(-1, 7, 6));
date._addDays(730);
assert(date == Date(1, 7, 5));
}
const cdate = Date(1999, 7, 6);
immutable idate = Date(1999, 7, 6);
static assert(!__traits(compiles, cdate._addDays(12)));
static assert(!__traits(compiles, idate._addDays(12)));
}
@safe pure invariant()
{
import std.format : format;
assert(valid!"months"(_month),
format("Invariant Failure: year [%s] month [%s] day [%s]", _year, _month, _day));
assert(valid!"days"(_year, _month, _day),
format("Invariant Failure: year [%s] month [%s] day [%s]", _year, _month, _day));
}
short _year = 1;
Month _month = Month.jan;
ubyte _day = 1;
}
/++
Represents a time of day with hours, minutes, and seconds. It uses 24 hour
time.
+/
struct TimeOfDay
{
public:
/++
Params:
hour = Hour of the day [0 - 24$(RPAREN).
minute = Minute of the hour [0 - 60$(RPAREN).
second = Second of the minute [0 - 60$(RPAREN).
Throws:
$(LREF DateTimeException) if the resulting $(LREF TimeOfDay) would be not
be valid.
+/
this(int hour, int minute, int second = 0) @safe pure
{
enforceValid!"hours"(hour);
enforceValid!"minutes"(minute);
enforceValid!"seconds"(second);
_hour = cast(ubyte)hour;
_minute = cast(ubyte)minute;
_second = cast(ubyte)second;
}
unittest
{
assert(TimeOfDay(0, 0) == TimeOfDay.init);
{
auto tod = TimeOfDay(0, 0);
assert(tod._hour == 0);
assert(tod._minute == 0);
assert(tod._second == 0);
}
{
auto tod = TimeOfDay(12, 30, 33);
assert(tod._hour == 12);
assert(tod._minute == 30);
assert(tod._second == 33);
}
{
auto tod = TimeOfDay(23, 59, 59);
assert(tod._hour == 23);
assert(tod._minute == 59);
assert(tod._second == 59);
}
assertThrown!DateTimeException(TimeOfDay(24, 0, 0));
assertThrown!DateTimeException(TimeOfDay(0, 60, 0));
assertThrown!DateTimeException(TimeOfDay(0, 0, 60));
}
/++
Compares this $(LREF TimeOfDay) with the given $(LREF TimeOfDay).
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
+/
int opCmp(in TimeOfDay rhs) @safe const pure nothrow
{
if(_hour < rhs._hour)
return -1;
if(_hour > rhs._hour)
return 1;
if(_minute < rhs._minute)
return -1;
if(_minute > rhs._minute)
return 1;
if(_second < rhs._second)
return -1;
if(_second > rhs._second)
return 1;
return 0;
}
unittest
{
assert(TimeOfDay(0, 0, 0).opCmp(TimeOfDay.init) == 0);
assert(TimeOfDay(0, 0, 0).opCmp(TimeOfDay(0, 0, 0)) == 0);
assert(TimeOfDay(12, 0, 0).opCmp(TimeOfDay(12, 0, 0)) == 0);
assert(TimeOfDay(0, 30, 0).opCmp(TimeOfDay(0, 30, 0)) == 0);
assert(TimeOfDay(0, 0, 33).opCmp(TimeOfDay(0, 0, 33)) == 0);
assert(TimeOfDay(12, 30, 0).opCmp(TimeOfDay(12, 30, 0)) == 0);
assert(TimeOfDay(12, 30, 33).opCmp(TimeOfDay(12, 30, 33)) == 0);
assert(TimeOfDay(0, 30, 33).opCmp(TimeOfDay(0, 30, 33)) == 0);
assert(TimeOfDay(0, 0, 33).opCmp(TimeOfDay(0, 0, 33)) == 0);
assert(TimeOfDay(12, 30, 33).opCmp(TimeOfDay(13, 30, 33)) < 0);
assert(TimeOfDay(13, 30, 33).opCmp(TimeOfDay(12, 30, 33)) > 0);
assert(TimeOfDay(12, 30, 33).opCmp(TimeOfDay(12, 31, 33)) < 0);
assert(TimeOfDay(12, 31, 33).opCmp(TimeOfDay(12, 30, 33)) > 0);
assert(TimeOfDay(12, 30, 33).opCmp(TimeOfDay(12, 30, 34)) < 0);
assert(TimeOfDay(12, 30, 34).opCmp(TimeOfDay(12, 30, 33)) > 0);
assert(TimeOfDay(13, 30, 33).opCmp(TimeOfDay(12, 30, 34)) > 0);
assert(TimeOfDay(12, 30, 34).opCmp(TimeOfDay(13, 30, 33)) < 0);
assert(TimeOfDay(13, 30, 33).opCmp(TimeOfDay(12, 31, 33)) > 0);
assert(TimeOfDay(12, 31, 33).opCmp(TimeOfDay(13, 30, 33)) < 0);
assert(TimeOfDay(12, 31, 33).opCmp(TimeOfDay(12, 30, 34)) > 0);
assert(TimeOfDay(12, 30, 34).opCmp(TimeOfDay(12, 31, 33)) < 0);
const ctod = TimeOfDay(12, 30, 33);
immutable itod = TimeOfDay(12, 30, 33);
static assert(__traits(compiles, ctod.opCmp(itod)));
static assert(__traits(compiles, itod.opCmp(ctod)));
}
/++
Hours past midnight.
+/
@property ubyte hour() @safe const pure nothrow
{
return _hour;
}
unittest
{
assert(TimeOfDay.init.hour == 0);
assert(TimeOfDay(12, 0, 0).hour == 12);
const ctod = TimeOfDay(12, 0, 0);
immutable itod = TimeOfDay(12, 0, 0);
static assert(__traits(compiles, ctod.hour == 12));
static assert(__traits(compiles, itod.hour == 12));
}
/++
Hours past midnight.
Params:
hour = The hour of the day to set this $(LREF TimeOfDay)'s hour to.
Throws:
$(LREF DateTimeException) if the given hour would result in an invalid
$(LREF TimeOfDay).
+/
@property void hour(int hour) @safe pure
{
enforceValid!"hours"(hour);
_hour = cast(ubyte)hour;
}
unittest
{
assertThrown!DateTimeException((){TimeOfDay(0, 0, 0).hour = 24;}());
auto tod = TimeOfDay(0, 0, 0);
tod.hour = 12;
assert(tod == TimeOfDay(12, 0, 0));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod.hour = 12));
static assert(!__traits(compiles, itod.hour = 12));
}
/++
Minutes past the hour.
+/
@property ubyte minute() @safe const pure nothrow
{
return _minute;
}
unittest
{
assert(TimeOfDay.init.minute == 0);
assert(TimeOfDay(0, 30, 0).minute == 30);
const ctod = TimeOfDay(0, 30, 0);
immutable itod = TimeOfDay(0, 30, 0);
static assert(__traits(compiles, ctod.minute == 30));
static assert(__traits(compiles, itod.minute == 30));
}
/++
Minutes past the hour.
Params:
minute = The minute to set this $(LREF TimeOfDay)'s minute to.
Throws:
$(LREF DateTimeException) if the given minute would result in an
invalid $(LREF TimeOfDay).
+/
@property void minute(int minute) @safe pure
{
enforceValid!"minutes"(minute);
_minute = cast(ubyte)minute;
}
unittest
{
assertThrown!DateTimeException((){TimeOfDay(0, 0, 0).minute = 60;}());
auto tod = TimeOfDay(0, 0, 0);
tod.minute = 30;
assert(tod == TimeOfDay(0, 30, 0));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod.minute = 30));
static assert(!__traits(compiles, itod.minute = 30));
}
/++
Seconds past the minute.
+/
@property ubyte second() @safe const pure nothrow
{
return _second;
}
unittest
{
assert(TimeOfDay.init.second == 0);
assert(TimeOfDay(0, 0, 33).second == 33);
const ctod = TimeOfDay(0, 0, 33);
immutable itod = TimeOfDay(0, 0, 33);
static assert(__traits(compiles, ctod.second == 33));
static assert(__traits(compiles, itod.second == 33));
}
/++
Seconds past the minute.
Params:
second = The second to set this $(LREF TimeOfDay)'s second to.
Throws:
$(LREF DateTimeException) if the given second would result in an
invalid $(LREF TimeOfDay).
+/
@property void second(int second) @safe pure
{
enforceValid!"seconds"(second);
_second = cast(ubyte)second;
}
unittest
{
assertThrown!DateTimeException((){TimeOfDay(0, 0, 0).second = 60;}());
auto tod = TimeOfDay(0, 0, 0);
tod.second = 33;
assert(tod == TimeOfDay(0, 0, 33));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod.second = 33));
static assert(!__traits(compiles, itod.second = 33));
}
/++
Adds the given number of units to this $(LREF TimeOfDay). A negative number
will subtract.
The difference between rolling and adding is that rolling does not
affect larger units. For instance, rolling a $(LREF TimeOfDay)
one hours's worth of minutes gets the exact same
$(LREF TimeOfDay).
Accepted units are $(D "hours"), $(D "minutes"), and $(D "seconds").
Params:
units = The units to add.
value = The number of $(D_PARAM units) to add to this
$(LREF TimeOfDay).
+/
ref TimeOfDay roll(string units)(long value) @safe pure nothrow
if(units == "hours")
{
return this += dur!"hours"(value);
}
///
unittest
{
auto tod1 = TimeOfDay(7, 12, 0);
tod1.roll!"hours"(1);
assert(tod1 == TimeOfDay(8, 12, 0));
auto tod2 = TimeOfDay(7, 12, 0);
tod2.roll!"hours"(-1);
assert(tod2 == TimeOfDay(6, 12, 0));
auto tod3 = TimeOfDay(23, 59, 0);
tod3.roll!"minutes"(1);
assert(tod3 == TimeOfDay(23, 0, 0));
auto tod4 = TimeOfDay(0, 0, 0);
tod4.roll!"minutes"(-1);
assert(tod4 == TimeOfDay(0, 59, 0));
auto tod5 = TimeOfDay(23, 59, 59);
tod5.roll!"seconds"(1);
assert(tod5 == TimeOfDay(23, 59, 0));
auto tod6 = TimeOfDay(0, 0, 0);
tod6.roll!"seconds"(-1);
assert(tod6 == TimeOfDay(0, 0, 59));
}
unittest
{
auto tod = TimeOfDay(12, 27, 2);
tod.roll!"hours"(22).roll!"hours"(-7);
assert(tod == TimeOfDay(3, 27, 2));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod.roll!"hours"(53)));
static assert(!__traits(compiles, itod.roll!"hours"(53)));
}
//Shares documentation with "hours" version.
ref TimeOfDay roll(string units)(long value) @safe pure nothrow
if(units == "minutes" ||
units == "seconds")
{
import std.format : format;
enum memberVarStr = units[0 .. $ - 1];
value %= 60;
mixin(format("auto newVal = cast(ubyte)(_%s) + value;", memberVarStr));
if(value < 0)
{
if(newVal < 0)
newVal += 60;
}
else if(newVal >= 60)
newVal -= 60;
mixin(format("_%s = cast(ubyte)newVal;", memberVarStr));
return this;
}
//Test roll!"minutes"().
unittest
{
static void testTOD(TimeOfDay orig, int minutes, in TimeOfDay expected, size_t line = __LINE__)
{
orig.roll!"minutes"(minutes);
assert(orig == expected);
}
testTOD(TimeOfDay(12, 30, 33), 0, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 1, TimeOfDay(12, 31, 33));
testTOD(TimeOfDay(12, 30, 33), 2, TimeOfDay(12, 32, 33));
testTOD(TimeOfDay(12, 30, 33), 3, TimeOfDay(12, 33, 33));
testTOD(TimeOfDay(12, 30, 33), 4, TimeOfDay(12, 34, 33));
testTOD(TimeOfDay(12, 30, 33), 5, TimeOfDay(12, 35, 33));
testTOD(TimeOfDay(12, 30, 33), 10, TimeOfDay(12, 40, 33));
testTOD(TimeOfDay(12, 30, 33), 15, TimeOfDay(12, 45, 33));
testTOD(TimeOfDay(12, 30, 33), 29, TimeOfDay(12, 59, 33));
testTOD(TimeOfDay(12, 30, 33), 30, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 30, 33), 45, TimeOfDay(12, 15, 33));
testTOD(TimeOfDay(12, 30, 33), 60, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 75, TimeOfDay(12, 45, 33));
testTOD(TimeOfDay(12, 30, 33), 90, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 30, 33), 100, TimeOfDay(12, 10, 33));
testTOD(TimeOfDay(12, 30, 33), 689, TimeOfDay(12, 59, 33));
testTOD(TimeOfDay(12, 30, 33), 690, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 30, 33), 691, TimeOfDay(12, 1, 33));
testTOD(TimeOfDay(12, 30, 33), 960, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 1439, TimeOfDay(12, 29, 33));
testTOD(TimeOfDay(12, 30, 33), 1440, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 1441, TimeOfDay(12, 31, 33));
testTOD(TimeOfDay(12, 30, 33), 2880, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -1, TimeOfDay(12, 29, 33));
testTOD(TimeOfDay(12, 30, 33), -2, TimeOfDay(12, 28, 33));
testTOD(TimeOfDay(12, 30, 33), -3, TimeOfDay(12, 27, 33));
testTOD(TimeOfDay(12, 30, 33), -4, TimeOfDay(12, 26, 33));
testTOD(TimeOfDay(12, 30, 33), -5, TimeOfDay(12, 25, 33));
testTOD(TimeOfDay(12, 30, 33), -10, TimeOfDay(12, 20, 33));
testTOD(TimeOfDay(12, 30, 33), -15, TimeOfDay(12, 15, 33));
testTOD(TimeOfDay(12, 30, 33), -29, TimeOfDay(12, 1, 33));
testTOD(TimeOfDay(12, 30, 33), -30, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 30, 33), -45, TimeOfDay(12, 45, 33));
testTOD(TimeOfDay(12, 30, 33), -60, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -75, TimeOfDay(12, 15, 33));
testTOD(TimeOfDay(12, 30, 33), -90, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 30, 33), -100, TimeOfDay(12, 50, 33));
testTOD(TimeOfDay(12, 30, 33), -749, TimeOfDay(12, 1, 33));
testTOD(TimeOfDay(12, 30, 33), -750, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 30, 33), -751, TimeOfDay(12, 59, 33));
testTOD(TimeOfDay(12, 30, 33), -960, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -1439, TimeOfDay(12, 31, 33));
testTOD(TimeOfDay(12, 30, 33), -1440, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -1441, TimeOfDay(12, 29, 33));
testTOD(TimeOfDay(12, 30, 33), -2880, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 0, 33), 1, TimeOfDay(12, 1, 33));
testTOD(TimeOfDay(12, 0, 33), 0, TimeOfDay(12, 0, 33));
testTOD(TimeOfDay(12, 0, 33), -1, TimeOfDay(12, 59, 33));
testTOD(TimeOfDay(11, 59, 33), 1, TimeOfDay(11, 0, 33));
testTOD(TimeOfDay(11, 59, 33), 0, TimeOfDay(11, 59, 33));
testTOD(TimeOfDay(11, 59, 33), -1, TimeOfDay(11, 58, 33));
testTOD(TimeOfDay(0, 0, 33), 1, TimeOfDay(0, 1, 33));
testTOD(TimeOfDay(0, 0, 33), 0, TimeOfDay(0, 0, 33));
testTOD(TimeOfDay(0, 0, 33), -1, TimeOfDay(0, 59, 33));
testTOD(TimeOfDay(23, 59, 33), 1, TimeOfDay(23, 0, 33));
testTOD(TimeOfDay(23, 59, 33), 0, TimeOfDay(23, 59, 33));
testTOD(TimeOfDay(23, 59, 33), -1, TimeOfDay(23, 58, 33));
auto tod = TimeOfDay(12, 27, 2);
tod.roll!"minutes"(97).roll!"minutes"(-102);
assert(tod == TimeOfDay(12, 22, 2));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod.roll!"minutes"(7)));
static assert(!__traits(compiles, itod.roll!"minutes"(7)));
}
//Test roll!"seconds"().
unittest
{
static void testTOD(TimeOfDay orig, int seconds, in TimeOfDay expected, size_t line = __LINE__)
{
orig.roll!"seconds"(seconds);
assert(orig == expected);
}
testTOD(TimeOfDay(12, 30, 33), 0, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 1, TimeOfDay(12, 30, 34));
testTOD(TimeOfDay(12, 30, 33), 2, TimeOfDay(12, 30, 35));
testTOD(TimeOfDay(12, 30, 33), 3, TimeOfDay(12, 30, 36));
testTOD(TimeOfDay(12, 30, 33), 4, TimeOfDay(12, 30, 37));
testTOD(TimeOfDay(12, 30, 33), 5, TimeOfDay(12, 30, 38));
testTOD(TimeOfDay(12, 30, 33), 10, TimeOfDay(12, 30, 43));
testTOD(TimeOfDay(12, 30, 33), 15, TimeOfDay(12, 30, 48));
testTOD(TimeOfDay(12, 30, 33), 26, TimeOfDay(12, 30, 59));
testTOD(TimeOfDay(12, 30, 33), 27, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 33), 30, TimeOfDay(12, 30, 3));
testTOD(TimeOfDay(12, 30, 33), 59, TimeOfDay(12, 30, 32));
testTOD(TimeOfDay(12, 30, 33), 60, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 61, TimeOfDay(12, 30, 34));
testTOD(TimeOfDay(12, 30, 33), 1766, TimeOfDay(12, 30, 59));
testTOD(TimeOfDay(12, 30, 33), 1767, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 33), 1768, TimeOfDay(12, 30, 1));
testTOD(TimeOfDay(12, 30, 33), 2007, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 33), 3599, TimeOfDay(12, 30, 32));
testTOD(TimeOfDay(12, 30, 33), 3600, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 3601, TimeOfDay(12, 30, 34));
testTOD(TimeOfDay(12, 30, 33), 7200, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -1, TimeOfDay(12, 30, 32));
testTOD(TimeOfDay(12, 30, 33), -2, TimeOfDay(12, 30, 31));
testTOD(TimeOfDay(12, 30, 33), -3, TimeOfDay(12, 30, 30));
testTOD(TimeOfDay(12, 30, 33), -4, TimeOfDay(12, 30, 29));
testTOD(TimeOfDay(12, 30, 33), -5, TimeOfDay(12, 30, 28));
testTOD(TimeOfDay(12, 30, 33), -10, TimeOfDay(12, 30, 23));
testTOD(TimeOfDay(12, 30, 33), -15, TimeOfDay(12, 30, 18));
testTOD(TimeOfDay(12, 30, 33), -33, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 33), -34, TimeOfDay(12, 30, 59));
testTOD(TimeOfDay(12, 30, 33), -35, TimeOfDay(12, 30, 58));
testTOD(TimeOfDay(12, 30, 33), -59, TimeOfDay(12, 30, 34));
testTOD(TimeOfDay(12, 30, 33), -60, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -61, TimeOfDay(12, 30, 32));
testTOD(TimeOfDay(12, 30, 0), 1, TimeOfDay(12, 30, 1));
testTOD(TimeOfDay(12, 30, 0), 0, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 0), -1, TimeOfDay(12, 30, 59));
testTOD(TimeOfDay(12, 0, 0), 1, TimeOfDay(12, 0, 1));
testTOD(TimeOfDay(12, 0, 0), 0, TimeOfDay(12, 0, 0));
testTOD(TimeOfDay(12, 0, 0), -1, TimeOfDay(12, 0, 59));
testTOD(TimeOfDay(0, 0, 0), 1, TimeOfDay(0, 0, 1));
testTOD(TimeOfDay(0, 0, 0), 0, TimeOfDay(0, 0, 0));
testTOD(TimeOfDay(0, 0, 0), -1, TimeOfDay(0, 0, 59));
testTOD(TimeOfDay(23, 59, 59), 1, TimeOfDay(23, 59, 0));
testTOD(TimeOfDay(23, 59, 59), 0, TimeOfDay(23, 59, 59));
testTOD(TimeOfDay(23, 59, 59), -1, TimeOfDay(23, 59, 58));
auto tod = TimeOfDay(12, 27, 2);
tod.roll!"seconds"(105).roll!"seconds"(-77);
assert(tod == TimeOfDay(12, 27, 30));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod.roll!"seconds"(7)));
static assert(!__traits(compiles, itod.roll!"seconds"(7)));
}
/++
Gives the result of adding or subtracting a duration from this
$(LREF TimeOfDay).
The legal types of arithmetic for $(LREF TimeOfDay) using this operator are
$(BOOKTABLE,
$(TR $(TD TimeOfDay) $(TD +) $(TD duration) $(TD -->) $(TD TimeOfDay))
$(TR $(TD TimeOfDay) $(TD -) $(TD duration) $(TD -->) $(TD TimeOfDay))
)
Params:
duration = The duration to add to or subtract from this
$(LREF TimeOfDay).
+/
TimeOfDay opBinary(string op, D)(in D duration) @safe const pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
TimeOfDay retval = this;
static if(is(Unqual!D == Duration))
immutable hnsecs = duration.total!"hnsecs";
else static if(is(Unqual!D == TickDuration))
immutable hnsecs = duration.hnsecs;
mixin(format(`return retval._addSeconds(convert!("hnsecs", "seconds")(%shnsecs));`, op));
}
unittest
{
auto tod = TimeOfDay(12, 30, 33);
assert(tod + dur!"hours"(7) == TimeOfDay(19, 30, 33));
assert(tod + dur!"hours"(-7) == TimeOfDay(5, 30, 33));
assert(tod + dur!"minutes"(7) == TimeOfDay(12, 37, 33));
assert(tod + dur!"minutes"(-7) == TimeOfDay(12, 23, 33));
assert(tod + dur!"seconds"(7) == TimeOfDay(12, 30, 40));
assert(tod + dur!"seconds"(-7) == TimeOfDay(12, 30, 26));
assert(tod + dur!"msecs"(7000) == TimeOfDay(12, 30, 40));
assert(tod + dur!"msecs"(-7000) == TimeOfDay(12, 30, 26));
assert(tod + dur!"usecs"(7_000_000) == TimeOfDay(12, 30, 40));
assert(tod + dur!"usecs"(-7_000_000) == TimeOfDay(12, 30, 26));
assert(tod + dur!"hnsecs"(70_000_000) == TimeOfDay(12, 30, 40));
assert(tod + dur!"hnsecs"(-70_000_000) == TimeOfDay(12, 30, 26));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(tod + TickDuration.from!"usecs"(7_000_000) == TimeOfDay(12, 30, 40));
assert(tod + TickDuration.from!"usecs"(-7_000_000) == TimeOfDay(12, 30, 26));
}
assert(tod - dur!"hours"(-7) == TimeOfDay(19, 30, 33));
assert(tod - dur!"hours"(7) == TimeOfDay(5, 30, 33));
assert(tod - dur!"minutes"(-7) == TimeOfDay(12, 37, 33));
assert(tod - dur!"minutes"(7) == TimeOfDay(12, 23, 33));
assert(tod - dur!"seconds"(-7) == TimeOfDay(12, 30, 40));
assert(tod - dur!"seconds"(7) == TimeOfDay(12, 30, 26));
assert(tod - dur!"msecs"(-7000) == TimeOfDay(12, 30, 40));
assert(tod - dur!"msecs"(7000) == TimeOfDay(12, 30, 26));
assert(tod - dur!"usecs"(-7_000_000) == TimeOfDay(12, 30, 40));
assert(tod - dur!"usecs"(7_000_000) == TimeOfDay(12, 30, 26));
assert(tod - dur!"hnsecs"(-70_000_000) == TimeOfDay(12, 30, 40));
assert(tod - dur!"hnsecs"(70_000_000) == TimeOfDay(12, 30, 26));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(tod - TickDuration.from!"usecs"(-7_000_000) == TimeOfDay(12, 30, 40));
assert(tod - TickDuration.from!"usecs"(7_000_000) == TimeOfDay(12, 30, 26));
}
auto duration = dur!"hours"(11);
const ctod = TimeOfDay(12, 33, 30);
immutable itod = TimeOfDay(12, 33, 30);
static assert(__traits(compiles, tod + duration));
static assert(__traits(compiles, ctod + duration));
static assert(__traits(compiles, itod + duration));
static assert(__traits(compiles, tod - duration));
static assert(__traits(compiles, ctod - duration));
static assert(__traits(compiles, itod - duration));
}
/++
Gives the result of adding or subtracting a duration from this
$(LREF TimeOfDay), as well as assigning the result to this
$(LREF TimeOfDay).
The legal types of arithmetic for $(LREF TimeOfDay) using this operator are
$(BOOKTABLE,
$(TR $(TD TimeOfDay) $(TD +) $(TD duration) $(TD -->) $(TD TimeOfDay))
$(TR $(TD TimeOfDay) $(TD -) $(TD duration) $(TD -->) $(TD TimeOfDay))
)
Params:
duration = The duration to add to or subtract from this
$(LREF TimeOfDay).
+/
ref TimeOfDay opOpAssign(string op, D)(in D duration) @safe pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
static if(is(Unqual!D == Duration))
immutable hnsecs = duration.total!"hnsecs";
else static if(is(Unqual!D == TickDuration))
immutable hnsecs = duration.hnsecs;
mixin(format(`return _addSeconds(convert!("hnsecs", "seconds")(%shnsecs));`, op));
}
unittest
{
auto duration = dur!"hours"(12);
assert(TimeOfDay(12, 30, 33) + dur!"hours"(7) == TimeOfDay(19, 30, 33));
assert(TimeOfDay(12, 30, 33) + dur!"hours"(-7) == TimeOfDay(5, 30, 33));
assert(TimeOfDay(12, 30, 33) + dur!"minutes"(7) == TimeOfDay(12, 37, 33));
assert(TimeOfDay(12, 30, 33) + dur!"minutes"(-7) == TimeOfDay(12, 23, 33));
assert(TimeOfDay(12, 30, 33) + dur!"seconds"(7) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) + dur!"seconds"(-7) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) + dur!"msecs"(7000) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) + dur!"msecs"(-7000) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) + dur!"usecs"(7_000_000) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) + dur!"usecs"(-7_000_000) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) + dur!"hnsecs"(70_000_000) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) + dur!"hnsecs"(-70_000_000) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) - dur!"hours"(-7) == TimeOfDay(19, 30, 33));
assert(TimeOfDay(12, 30, 33) - dur!"hours"(7) == TimeOfDay(5, 30, 33));
assert(TimeOfDay(12, 30, 33) - dur!"minutes"(-7) == TimeOfDay(12, 37, 33));
assert(TimeOfDay(12, 30, 33) - dur!"minutes"(7) == TimeOfDay(12, 23, 33));
assert(TimeOfDay(12, 30, 33) - dur!"seconds"(-7) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) - dur!"seconds"(7) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) - dur!"msecs"(-7000) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) - dur!"msecs"(7000) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) - dur!"usecs"(-7_000_000) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) - dur!"usecs"(7_000_000) == TimeOfDay(12, 30, 26));
assert(TimeOfDay(12, 30, 33) - dur!"hnsecs"(-70_000_000) == TimeOfDay(12, 30, 40));
assert(TimeOfDay(12, 30, 33) - dur!"hnsecs"(70_000_000) == TimeOfDay(12, 30, 26));
auto tod = TimeOfDay(19, 17, 22);
(tod += dur!"seconds"(9)) += dur!"seconds"(-7292);
assert(tod == TimeOfDay(17, 15, 59));
const ctod = TimeOfDay(12, 33, 30);
immutable itod = TimeOfDay(12, 33, 30);
static assert(!__traits(compiles, ctod += duration));
static assert(!__traits(compiles, itod += duration));
static assert(!__traits(compiles, ctod -= duration));
static assert(!__traits(compiles, itod -= duration));
}
/++
Gives the difference between two $(LREF TimeOfDay)s.
The legal types of arithmetic for $(LREF TimeOfDay) using this operator are
$(BOOKTABLE,
$(TR $(TD TimeOfDay) $(TD -) $(TD TimeOfDay) $(TD -->) $(TD duration))
)
Params:
rhs = The $(LREF TimeOfDay) to subtract from this one.
+/
Duration opBinary(string op)(in TimeOfDay rhs) @safe const pure nothrow
if(op == "-")
{
immutable lhsSec = _hour * 3600 + _minute * 60 + _second;
immutable rhsSec = rhs._hour * 3600 + rhs._minute * 60 + rhs._second;
return dur!"seconds"(lhsSec - rhsSec);
}
unittest
{
auto tod = TimeOfDay(12, 30, 33);
assert(TimeOfDay(7, 12, 52) - TimeOfDay(12, 30, 33) == dur!"seconds"(-19_061));
assert(TimeOfDay(12, 30, 33) - TimeOfDay(7, 12, 52) == dur!"seconds"(19_061));
assert(TimeOfDay(12, 30, 33) - TimeOfDay(14, 30, 33) == dur!"seconds"(-7200));
assert(TimeOfDay(14, 30, 33) - TimeOfDay(12, 30, 33) == dur!"seconds"(7200));
assert(TimeOfDay(12, 30, 33) - TimeOfDay(12, 34, 33) == dur!"seconds"(-240));
assert(TimeOfDay(12, 34, 33) - TimeOfDay(12, 30, 33) == dur!"seconds"(240));
assert(TimeOfDay(12, 30, 33) - TimeOfDay(12, 30, 34) == dur!"seconds"(-1));
assert(TimeOfDay(12, 30, 34) - TimeOfDay(12, 30, 33) == dur!"seconds"(1));
const ctod = TimeOfDay(12, 30, 33);
immutable itod = TimeOfDay(12, 30, 33);
static assert(__traits(compiles, tod - tod));
static assert(__traits(compiles, ctod - tod));
static assert(__traits(compiles, itod - tod));
static assert(__traits(compiles, tod - ctod));
static assert(__traits(compiles, ctod - ctod));
static assert(__traits(compiles, itod - ctod));
static assert(__traits(compiles, tod - itod));
static assert(__traits(compiles, ctod - itod));
static assert(__traits(compiles, itod - itod));
}
/++
Converts this $(LREF TimeOfDay) to a string with the format HHMMSS.
+/
string toISOString() @safe const pure nothrow
{
import std.format : format;
try
return format("%02d%02d%02d", _hour, _minute, _second);
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(TimeOfDay(0, 0, 0).toISOString() == "000000");
assert(TimeOfDay(12, 30, 33).toISOString() == "123033");
}
unittest
{
auto tod = TimeOfDay(12, 30, 33);
const ctod = TimeOfDay(12, 30, 33);
immutable itod = TimeOfDay(12, 30, 33);
static assert(__traits(compiles, tod.toISOString()));
static assert(__traits(compiles, ctod.toISOString()));
static assert(__traits(compiles, itod.toISOString()));
}
/++
Converts this $(LREF TimeOfDay) to a string with the format HH:MM:SS.
+/
string toISOExtString() @safe const pure nothrow
{
import std.format : format;
try
return format("%02d:%02d:%02d", _hour, _minute, _second);
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(TimeOfDay(0, 0, 0).toISOExtString() == "00:00:00");
assert(TimeOfDay(12, 30, 33).toISOExtString() == "12:30:33");
}
unittest
{
auto tod = TimeOfDay(12, 30, 33);
const ctod = TimeOfDay(12, 30, 33);
immutable itod = TimeOfDay(12, 30, 33);
static assert(__traits(compiles, tod.toISOExtString()));
static assert(__traits(compiles, ctod.toISOExtString()));
static assert(__traits(compiles, itod.toISOExtString()));
}
/++
Converts this TimeOfDay to a string.
+/
string toString() @safe const pure nothrow
{
return toISOExtString();
}
unittest
{
auto tod = TimeOfDay(12, 30, 33);
const ctod = TimeOfDay(12, 30, 33);
immutable itod = TimeOfDay(12, 30, 33);
static assert(__traits(compiles, tod.toString()));
static assert(__traits(compiles, ctod.toString()));
static assert(__traits(compiles, itod.toString()));
}
/++
Creates a $(LREF TimeOfDay) from a string with the format HHMMSS.
Whitespace is stripped from the given string.
Params:
isoString = A string formatted in the ISO format for times.
Throws:
$(LREF DateTimeException) if the given string is not in the ISO format
or if the resulting $(LREF TimeOfDay) would not be valid.
+/
static TimeOfDay fromISOString(S)(in S isoString) @safe pure
if(isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
import std.conv : to;
import std.algorithm : all;
import std.format : format;
auto dstr = to!dstring(strip(isoString));
enforce(dstr.length == 6, new DateTimeException(format("Invalid ISO String: %s", isoString)));
auto hours = dstr[0 .. 2];
auto minutes = dstr[2 .. 4];
auto seconds = dstr[4 .. $];
enforce(all!isDigit(hours), new DateTimeException(format("Invalid ISO String: %s", isoString)));
enforce(all!isDigit(minutes), new DateTimeException(format("Invalid ISO String: %s", isoString)));
enforce(all!isDigit(seconds), new DateTimeException(format("Invalid ISO String: %s", isoString)));
return TimeOfDay(to!int(hours), to!int(minutes), to!int(seconds));
}
///
unittest
{
assert(TimeOfDay.fromISOString("000000") == TimeOfDay(0, 0, 0));
assert(TimeOfDay.fromISOString("123033") == TimeOfDay(12, 30, 33));
assert(TimeOfDay.fromISOString(" 123033 ") == TimeOfDay(12, 30, 33));
}
unittest
{
assertThrown!DateTimeException(TimeOfDay.fromISOString(""));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("00"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("000"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0000"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("00000"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("13033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("1277"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12707"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12070"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12303a"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("1230a3"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("123a33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12a033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("1a0033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("a20033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("1200330"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0120033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("-120033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("+120033"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("120033am"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("120033pm"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0::"));
assertThrown!DateTimeException(TimeOfDay.fromISOString(":0:"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("::0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0:0:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0:0:00"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("0:00:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("00:0:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("00:00:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("00:0:00"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("13:0:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:7:7"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:7:07"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:07:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:30:3a"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:30:a3"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:3a:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:a0:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("1a:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("a2:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:003:30"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("120:03:30"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("012:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("01:200:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("-12:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("+12:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:00:33am"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:00:33pm"));
assertThrown!DateTimeException(TimeOfDay.fromISOString("12:00:33"));
assert(TimeOfDay.fromISOString("011217") == TimeOfDay(1, 12, 17));
assert(TimeOfDay.fromISOString("001412") == TimeOfDay(0, 14, 12));
assert(TimeOfDay.fromISOString("000007") == TimeOfDay(0, 0, 7));
assert(TimeOfDay.fromISOString("011217 ") == TimeOfDay(1, 12, 17));
assert(TimeOfDay.fromISOString(" 011217") == TimeOfDay(1, 12, 17));
assert(TimeOfDay.fromISOString(" 011217 ") == TimeOfDay(1, 12, 17));
}
/++
Creates a $(LREF TimeOfDay) from a string with the format HH:MM:SS.
Whitespace is stripped from the given string.
Params:
isoExtString = A string formatted in the ISO Extended format for times.
Throws:
$(LREF DateTimeException) if the given string is not in the ISO
Extended format or if the resulting $(LREF TimeOfDay) would not be
valid.
+/
static TimeOfDay fromISOExtString(S)(in S isoExtString) @safe pure
if(isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
import std.conv : to;
import std.algorithm : all;
import std.format : format;
auto dstr = to!dstring(strip(isoExtString));
enforce(dstr.length == 8, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
auto hours = dstr[0 .. 2];
auto minutes = dstr[3 .. 5];
auto seconds = dstr[6 .. $];
enforce(dstr[2] == ':', new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(dstr[5] == ':', new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(all!isDigit(hours),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(all!isDigit(minutes),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
enforce(all!isDigit(seconds),
new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
return TimeOfDay(to!int(hours), to!int(minutes), to!int(seconds));
}
///
unittest
{
assert(TimeOfDay.fromISOExtString("00:00:00") == TimeOfDay(0, 0, 0));
assert(TimeOfDay.fromISOExtString("12:30:33") == TimeOfDay(12, 30, 33));
assert(TimeOfDay.fromISOExtString(" 12:30:33 ") == TimeOfDay(12, 30, 33));
}
unittest
{
assertThrown!DateTimeException(TimeOfDay.fromISOExtString(""));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("00"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("000"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0000"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("00000"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("13033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("1277"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12707"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12070"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12303a"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("1230a3"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("123a33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12a033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("1a0033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("a20033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("1200330"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0120033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("-120033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("+120033"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("120033am"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("120033pm"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0::"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString(":0:"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("::0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0:0:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0:0:00"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("0:00:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("00:0:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("00:00:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("00:0:00"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("13:0:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:7:7"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:7:07"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:07:0"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:30:3a"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:30:a3"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:3a:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:a0:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("1a:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("a2:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:003:30"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("120:03:30"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("012:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("01:200:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("-12:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("+12:00:33"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:00:33am"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("12:00:33pm"));
assertThrown!DateTimeException(TimeOfDay.fromISOExtString("120033"));
assert(TimeOfDay.fromISOExtString("01:12:17") == TimeOfDay(1, 12, 17));
assert(TimeOfDay.fromISOExtString("00:14:12") == TimeOfDay(0, 14, 12));
assert(TimeOfDay.fromISOExtString("00:00:07") == TimeOfDay(0, 0, 7));
assert(TimeOfDay.fromISOExtString("01:12:17 ") == TimeOfDay(1, 12, 17));
assert(TimeOfDay.fromISOExtString(" 01:12:17") == TimeOfDay(1, 12, 17));
assert(TimeOfDay.fromISOExtString(" 01:12:17 ") == TimeOfDay(1, 12, 17));
}
/++
Returns midnight.
+/
@property static TimeOfDay min() @safe pure nothrow
{
return TimeOfDay.init;
}
unittest
{
assert(TimeOfDay.min.hour == 0);
assert(TimeOfDay.min.minute == 0);
assert(TimeOfDay.min.second == 0);
assert(TimeOfDay.min < TimeOfDay.max);
}
/++
Returns one second short of midnight.
+/
@property static TimeOfDay max() @safe pure nothrow
{
auto tod = TimeOfDay.init;
tod._hour = maxHour;
tod._minute = maxMinute;
tod._second = maxSecond;
return tod;
}
unittest
{
assert(TimeOfDay.max.hour == 23);
assert(TimeOfDay.max.minute == 59);
assert(TimeOfDay.max.second == 59);
assert(TimeOfDay.max > TimeOfDay.min);
}
private:
/+
Add seconds to the time of day. Negative values will subtract. If the
number of seconds overflows (or underflows), then the seconds will wrap,
increasing (or decreasing) the number of minutes accordingly. If the
number of minutes overflows (or underflows), then the minutes will wrap.
If the number of minutes overflows(or underflows), then the hour will
wrap. (e.g. adding 90 seconds to 23:59:00 would result in 00:00:30).
Params:
seconds = The number of seconds to add to this TimeOfDay.
+/
ref TimeOfDay _addSeconds(long seconds) return @safe pure nothrow
{
long hnsecs = convert!("seconds", "hnsecs")(seconds);
hnsecs += convert!("hours", "hnsecs")(_hour);
hnsecs += convert!("minutes", "hnsecs")(_minute);
hnsecs += convert!("seconds", "hnsecs")(_second);
hnsecs %= convert!("days", "hnsecs")(1);
if(hnsecs < 0)
hnsecs += convert!("days", "hnsecs")(1);
immutable newHours = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable newMinutes = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable newSeconds = splitUnitsFromHNSecs!"seconds"(hnsecs);
_hour = cast(ubyte)newHours;
_minute = cast(ubyte)newMinutes;
_second = cast(ubyte)newSeconds;
return this;
}
unittest
{
static void testTOD(TimeOfDay orig, int seconds, in TimeOfDay expected, size_t line = __LINE__)
{
orig._addSeconds(seconds);
assert(orig == expected);
}
testTOD(TimeOfDay(12, 30, 33), 0, TimeOfDay(12, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 1, TimeOfDay(12, 30, 34));
testTOD(TimeOfDay(12, 30, 33), 2, TimeOfDay(12, 30, 35));
testTOD(TimeOfDay(12, 30, 33), 3, TimeOfDay(12, 30, 36));
testTOD(TimeOfDay(12, 30, 33), 4, TimeOfDay(12, 30, 37));
testTOD(TimeOfDay(12, 30, 33), 5, TimeOfDay(12, 30, 38));
testTOD(TimeOfDay(12, 30, 33), 10, TimeOfDay(12, 30, 43));
testTOD(TimeOfDay(12, 30, 33), 15, TimeOfDay(12, 30, 48));
testTOD(TimeOfDay(12, 30, 33), 26, TimeOfDay(12, 30, 59));
testTOD(TimeOfDay(12, 30, 33), 27, TimeOfDay(12, 31, 0));
testTOD(TimeOfDay(12, 30, 33), 30, TimeOfDay(12, 31, 3));
testTOD(TimeOfDay(12, 30, 33), 59, TimeOfDay(12, 31, 32));
testTOD(TimeOfDay(12, 30, 33), 60, TimeOfDay(12, 31, 33));
testTOD(TimeOfDay(12, 30, 33), 61, TimeOfDay(12, 31, 34));
testTOD(TimeOfDay(12, 30, 33), 1766, TimeOfDay(12, 59, 59));
testTOD(TimeOfDay(12, 30, 33), 1767, TimeOfDay(13, 0, 0));
testTOD(TimeOfDay(12, 30, 33), 1768, TimeOfDay(13, 0, 1));
testTOD(TimeOfDay(12, 30, 33), 2007, TimeOfDay(13, 4, 0));
testTOD(TimeOfDay(12, 30, 33), 3599, TimeOfDay(13, 30, 32));
testTOD(TimeOfDay(12, 30, 33), 3600, TimeOfDay(13, 30, 33));
testTOD(TimeOfDay(12, 30, 33), 3601, TimeOfDay(13, 30, 34));
testTOD(TimeOfDay(12, 30, 33), 7200, TimeOfDay(14, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -1, TimeOfDay(12, 30, 32));
testTOD(TimeOfDay(12, 30, 33), -2, TimeOfDay(12, 30, 31));
testTOD(TimeOfDay(12, 30, 33), -3, TimeOfDay(12, 30, 30));
testTOD(TimeOfDay(12, 30, 33), -4, TimeOfDay(12, 30, 29));
testTOD(TimeOfDay(12, 30, 33), -5, TimeOfDay(12, 30, 28));
testTOD(TimeOfDay(12, 30, 33), -10, TimeOfDay(12, 30, 23));
testTOD(TimeOfDay(12, 30, 33), -15, TimeOfDay(12, 30, 18));
testTOD(TimeOfDay(12, 30, 33), -33, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 33), -34, TimeOfDay(12, 29, 59));
testTOD(TimeOfDay(12, 30, 33), -35, TimeOfDay(12, 29, 58));
testTOD(TimeOfDay(12, 30, 33), -59, TimeOfDay(12, 29, 34));
testTOD(TimeOfDay(12, 30, 33), -60, TimeOfDay(12, 29, 33));
testTOD(TimeOfDay(12, 30, 33), -61, TimeOfDay(12, 29, 32));
testTOD(TimeOfDay(12, 30, 33), -1833, TimeOfDay(12, 0, 0));
testTOD(TimeOfDay(12, 30, 33), -1834, TimeOfDay(11, 59, 59));
testTOD(TimeOfDay(12, 30, 33), -3600, TimeOfDay(11, 30, 33));
testTOD(TimeOfDay(12, 30, 33), -3601, TimeOfDay(11, 30, 32));
testTOD(TimeOfDay(12, 30, 33), -5134, TimeOfDay(11, 4, 59));
testTOD(TimeOfDay(12, 30, 33), -7200, TimeOfDay(10, 30, 33));
testTOD(TimeOfDay(12, 30, 0), 1, TimeOfDay(12, 30, 1));
testTOD(TimeOfDay(12, 30, 0), 0, TimeOfDay(12, 30, 0));
testTOD(TimeOfDay(12, 30, 0), -1, TimeOfDay(12, 29, 59));
testTOD(TimeOfDay(12, 0, 0), 1, TimeOfDay(12, 0, 1));
testTOD(TimeOfDay(12, 0, 0), 0, TimeOfDay(12, 0, 0));
testTOD(TimeOfDay(12, 0, 0), -1, TimeOfDay(11, 59, 59));
testTOD(TimeOfDay(0, 0, 0), 1, TimeOfDay(0, 0, 1));
testTOD(TimeOfDay(0, 0, 0), 0, TimeOfDay(0, 0, 0));
testTOD(TimeOfDay(0, 0, 0), -1, TimeOfDay(23, 59, 59));
testTOD(TimeOfDay(23, 59, 59), 1, TimeOfDay(0, 0, 0));
testTOD(TimeOfDay(23, 59, 59), 0, TimeOfDay(23, 59, 59));
testTOD(TimeOfDay(23, 59, 59), -1, TimeOfDay(23, 59, 58));
const ctod = TimeOfDay(0, 0, 0);
immutable itod = TimeOfDay(0, 0, 0);
static assert(!__traits(compiles, ctod._addSeconds(7)));
static assert(!__traits(compiles, itod._addSeconds(7)));
}
/+
Whether the given values form a valid $(LREF TimeOfDay).
+/
static bool _valid(int hour, int minute, int second) @safe pure nothrow
{
return valid!"hours"(hour) && valid!"minutes"(minute) && valid!"seconds"(second);
}
@safe pure invariant()
{
import std.format : format;
assert(_valid(_hour, _minute, _second),
format("Invariant Failure: hour [%s] minute [%s] second [%s]", _hour, _minute, _second));
}
ubyte _hour;
ubyte _minute;
ubyte _second;
enum ubyte maxHour = 24 - 1;
enum ubyte maxMinute = 60 - 1;
enum ubyte maxSecond = 60 - 1;
}
/++
Combines the $(LREF Date) and $(LREF TimeOfDay) structs to give an object
which holds both the date and the time. It is optimized for calendar-based
operations and has no concept of time zone. For an object which is
optimized for time operations based on the system time, use
$(LREF SysTime). $(LREF SysTime) has a concept of time zone and has much higher
precision (hnsecs). $(D DateTime) is intended primarily for calendar-based
uses rather than precise time operations.
+/
struct DateTime
{
public:
/++
Params:
date = The date portion of $(LREF DateTime).
tod = The time portion of $(LREF DateTime).
+/
this(in Date date, in TimeOfDay tod = TimeOfDay.init) @safe pure nothrow
{
_date = date;
_tod = tod;
}
unittest
{
{
auto dt = DateTime.init;
assert(dt._date == Date.init);
assert(dt._tod == TimeOfDay.init);
}
{
auto dt = DateTime(Date(1999, 7 ,6));
assert(dt._date == Date(1999, 7, 6));
assert(dt._tod == TimeOfDay.init);
}
{
auto dt = DateTime(Date(1999, 7 ,6), TimeOfDay(12, 30, 33));
assert(dt._date == Date(1999, 7, 6));
assert(dt._tod == TimeOfDay(12, 30, 33));
}
}
/++
Params:
year = The year portion of the date.
month = The month portion of the date.
day = The day portion of the date.
hour = The hour portion of the time;
minute = The minute portion of the time;
second = The second portion of the time;
+/
this(int year, int month, int day, int hour = 0, int minute = 0, int second = 0) @safe pure
{
_date = Date(year, month, day);
_tod = TimeOfDay(hour, minute, second);
}
unittest
{
{
auto dt = DateTime(1999, 7 ,6);
assert(dt._date == Date(1999, 7, 6));
assert(dt._tod == TimeOfDay.init);
}
{
auto dt = DateTime(1999, 7 ,6, 12, 30, 33);
assert(dt._date == Date(1999, 7, 6));
assert(dt._tod == TimeOfDay(12, 30, 33));
}
}
/++
Compares this $(LREF DateTime) with the given $(D DateTime.).
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
+/
int opCmp(in DateTime rhs) @safe const pure nothrow
{
immutable dateResult = _date.opCmp(rhs._date);
if(dateResult != 0)
return dateResult;
return _tod.opCmp(rhs._tod);
}
unittest
{
//Test A.D.
assert(DateTime(Date.init, TimeOfDay.init).opCmp(DateTime.init) == 0);
assert(DateTime(Date(1999, 1, 1)).opCmp(DateTime(Date(1999, 1, 1))) == 0);
assert(DateTime(Date(1, 7, 1)).opCmp(DateTime(Date(1, 7, 1))) == 0);
assert(DateTime(Date(1, 1, 6)).opCmp(DateTime(Date(1, 1, 6))) == 0);
assert(DateTime(Date(1999, 7, 1)).opCmp(DateTime(Date(1999, 7, 1))) == 0);
assert(DateTime(Date(1999, 7, 6)).opCmp(DateTime(Date(1999, 7, 6))) == 0);
assert(DateTime(Date(1, 7, 6)).opCmp(DateTime(Date(1, 7, 6))) == 0);
assert(DateTime(Date(1999, 7, 6)).opCmp(DateTime(Date(2000, 7, 6))) < 0);
assert(DateTime(Date(2000, 7, 6)).opCmp(DateTime(Date(1999, 7, 6))) > 0);
assert(DateTime(Date(1999, 7, 6)).opCmp(DateTime(Date(1999, 8, 6))) < 0);
assert(DateTime(Date(1999, 8, 6)).opCmp(DateTime(Date(1999, 7, 6))) > 0);
assert(DateTime(Date(1999, 7, 6)).opCmp(DateTime(Date(1999, 7, 7))) < 0);
assert(DateTime(Date(1999, 7, 7)).opCmp(DateTime(Date(1999, 7, 6))) > 0);
assert(DateTime(Date(1999, 8, 7)).opCmp(DateTime(Date(2000, 7, 6))) < 0);
assert(DateTime(Date(2000, 8, 6)).opCmp(DateTime(Date(1999, 7, 7))) > 0);
assert(DateTime(Date(1999, 7, 7)).opCmp(DateTime(Date(2000, 7, 6))) < 0);
assert(DateTime(Date(2000, 7, 6)).opCmp(DateTime(Date(1999, 7, 7))) > 0);
assert(DateTime(Date(1999, 7, 7)).opCmp(DateTime(Date(1999, 8, 6))) < 0);
assert(DateTime(Date(1999, 8, 6)).opCmp(DateTime(Date(1999, 7, 7))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 0)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 0))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 0)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 0))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33))) == 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)).opCmp(
DateTime(Date(2000, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(2000, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)).opCmp(
DateTime(Date(2000, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(2000, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)).opCmp(
DateTime(Date(2000, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(2000, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)).opCmp(
DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)).opCmp(
DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)).opCmp(
DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)).opCmp(
DateTime(Date(1999, 7, 7), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)).opCmp(
DateTime(Date(1999, 7, 7), TimeOfDay(12, 31, 33))) < 0);
assert(DateTime(Date(1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)).opCmp(
DateTime(Date(1999, 7, 7), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34))) > 0);
//Test B.C.
assert(DateTime(Date(-1, 1, 1), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1, 1, 1), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(-1, 7, 1), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1, 7, 1), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(-1, 1, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1, 1, 6), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(-1999, 7, 1), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 1), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(-1, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1, 7, 6), TimeOfDay(12, 30, 33))) == 0);
assert(DateTime(Date(-2000, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-2000, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-2000, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(-1999, 8, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-2000, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-2000, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-2000, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33))) > 0);
//Test Both
assert(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 7), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 8, 7), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 8, 7), TimeOfDay(12, 30, 33))) > 0);
assert(DateTime(Date(-1999, 8, 6), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(1999, 6, 6), TimeOfDay(12, 30, 33))) < 0);
assert(DateTime(Date(1999, 6, 8), TimeOfDay(12, 30, 33)).opCmp(
DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33))) > 0);
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 33, 30));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 33, 30));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 33, 30));
static assert(__traits(compiles, dt.opCmp(dt)));
static assert(__traits(compiles, dt.opCmp(cdt)));
static assert(__traits(compiles, dt.opCmp(idt)));
static assert(__traits(compiles, cdt.opCmp(dt)));
static assert(__traits(compiles, cdt.opCmp(cdt)));
static assert(__traits(compiles, cdt.opCmp(idt)));
static assert(__traits(compiles, idt.opCmp(dt)));
static assert(__traits(compiles, idt.opCmp(cdt)));
static assert(__traits(compiles, idt.opCmp(idt)));
}
/++
The date portion of $(LREF DateTime).
+/
@property Date date() @safe const pure nothrow
{
return _date;
}
unittest
{
{
auto dt = DateTime.init;
assert(dt.date == Date.init);
}
{
auto dt = DateTime(Date(1999, 7, 6));
assert(dt.date == Date(1999, 7, 6));
}
const cdt = DateTime(1999, 7, 6);
immutable idt = DateTime(1999, 7, 6);
static assert(__traits(compiles, cdt.date == Date(2010, 1, 1)));
static assert(__traits(compiles, idt.date == Date(2010, 1, 1)));
}
/++
The date portion of $(LREF DateTime).
Params:
date = The Date to set this $(LREF DateTime)'s date portion to.
+/
@property void date(in Date date) @safe pure nothrow
{
_date = date;
}
unittest
{
auto dt = DateTime.init;
dt.date = Date(1999, 7, 6);
assert(dt._date == Date(1999, 7, 6));
assert(dt._tod == TimeOfDay.init);
const cdt = DateTime(1999, 7, 6);
immutable idt = DateTime(1999, 7, 6);
static assert(!__traits(compiles, cdt.date = Date(2010, 1, 1)));
static assert(!__traits(compiles, idt.date = Date(2010, 1, 1)));
}
/++
The time portion of $(LREF DateTime).
+/
@property TimeOfDay timeOfDay() @safe const pure nothrow
{
return _tod;
}
unittest
{
{
auto dt = DateTime.init;
assert(dt.timeOfDay == TimeOfDay.init);
}
{
auto dt = DateTime(Date.init, TimeOfDay(12, 30, 33));
assert(dt.timeOfDay == TimeOfDay(12, 30, 33));
}
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.timeOfDay == TimeOfDay(12, 30, 33)));
static assert(__traits(compiles, idt.timeOfDay == TimeOfDay(12, 30, 33)));
}
/++
The time portion of $(LREF DateTime).
Params:
tod = The $(LREF TimeOfDay) to set this $(LREF DateTime)'s time portion
to.
+/
@property void timeOfDay(in TimeOfDay tod) @safe pure nothrow
{
_tod = tod;
}
unittest
{
auto dt = DateTime.init;
dt.timeOfDay = TimeOfDay(12, 30, 33);
assert(dt._date == Date.init);
assert(dt._tod == TimeOfDay(12, 30, 33));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.timeOfDay = TimeOfDay(12, 30, 33)));
static assert(!__traits(compiles, idt.timeOfDay = TimeOfDay(12, 30, 33)));
}
/++
Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive
are B.C.
+/
@property short year() @safe const pure nothrow
{
return _date.year;
}
unittest
{
assert(Date.init.year == 1);
assert(Date(1999, 7, 6).year == 1999);
assert(Date(-1999, 7, 6).year == -1999);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, idt.year));
static assert(__traits(compiles, idt.year));
}
/++
Year of the Gregorian Calendar. Positive numbers are A.D. Non-positive
are B.C.
Params:
year = The year to set this $(LREF DateTime)'s year to.
Throws:
$(LREF DateTimeException) if the new year is not a leap year and if the
resulting date would be on February 29th.
+/
@property void year(int year) @safe pure
{
_date.year = year;
}
///
unittest
{
assert(DateTime(Date(1999, 7, 6), TimeOfDay(9, 7, 5)).year == 1999);
assert(DateTime(Date(2010, 10, 4), TimeOfDay(0, 0, 30)).year == 2010);
assert(DateTime(Date(-7, 4, 5), TimeOfDay(7, 45, 2)).year == -7);
}
unittest
{
static void testDT(DateTime dt, int year, in DateTime expected, size_t line = __LINE__)
{
dt.year = year;
assert(dt == expected);
}
testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), 1999, DateTime(Date(1999, 1, 1), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), 0, DateTime(Date(0, 1, 1), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), -1999, DateTime(Date(-1999, 1, 1), TimeOfDay(12, 30, 33)));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.year = 7));
static assert(!__traits(compiles, idt.year = 7));
}
/++
Year B.C. of the Gregorian Calendar counting year 0 as 1 B.C.
Throws:
$(LREF DateTimeException) if $(D isAD) is true.
+/
@property short yearBC() @safe const pure
{
return _date.yearBC;
}
///
unittest
{
assert(DateTime(Date(0, 1, 1), TimeOfDay(12, 30, 33)).yearBC == 1);
assert(DateTime(Date(-1, 1, 1), TimeOfDay(10, 7, 2)).yearBC == 2);
assert(DateTime(Date(-100, 1, 1), TimeOfDay(4, 59, 0)).yearBC == 101);
}
unittest
{
assertThrown!DateTimeException((in DateTime dt){dt.yearBC;}(DateTime(Date(1, 1, 1))));
auto dt = DateTime(1999, 7, 6, 12, 30, 33);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, dt.yearBC = 12));
static assert(!__traits(compiles, cdt.yearBC = 12));
static assert(!__traits(compiles, idt.yearBC = 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 DateTime)'s year to.
Throws:
$(LREF DateTimeException) if a non-positive value is given.
+/
@property void yearBC(int year) @safe pure
{
_date.yearBC = year;
}
///
unittest
{
auto dt = DateTime(Date(2010, 1, 1), TimeOfDay(7, 30, 0));
dt.yearBC = 1;
assert(dt == DateTime(Date(0, 1, 1), TimeOfDay(7, 30, 0)));
dt.yearBC = 10;
assert(dt == DateTime(Date(-9, 1, 1), TimeOfDay(7, 30, 0)));
}
unittest
{
assertThrown!DateTimeException((DateTime dt){dt.yearBC = -1;}(DateTime(Date(1, 1, 1))));
auto dt = DateTime(1999, 7, 6, 12, 30, 33);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, dt.yearBC = 12));
static assert(!__traits(compiles, cdt.yearBC = 12));
static assert(!__traits(compiles, idt.yearBC = 12));
}
/++
Month of a Gregorian Year.
+/
@property Month month() @safe const pure nothrow
{
return _date.month;
}
///
unittest
{
assert(DateTime(Date(1999, 7, 6), TimeOfDay(9, 7, 5)).month == 7);
assert(DateTime(Date(2010, 10, 4), TimeOfDay(0, 0, 30)).month == 10);
assert(DateTime(Date(-7, 4, 5), TimeOfDay(7, 45, 2)).month == 4);
}
unittest
{
assert(DateTime.init.month == 1);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)).month == 7);
assert(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)).month == 7);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.month));
static assert(__traits(compiles, idt.month));
}
/++
Month of a Gregorian Year.
Params:
month = The month to set this $(LREF DateTime)'s month to.
Throws:
$(LREF DateTimeException) if the given month is not a valid month.
+/
@property void month(Month month) @safe pure
{
_date.month = month;
}
unittest
{
static void testDT(DateTime dt, Month month, in DateTime expected = DateTime.init, size_t line = __LINE__)
{
dt.month = month;
assert(expected != DateTime.init);
assert(dt == expected);
}
assertThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), cast(Month)0));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), cast(Month)13));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(12, 30, 33)), cast(Month)7, DateTime(Date(1, 7, 1), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1, 1, 1), TimeOfDay(12, 30, 33)), cast(Month)7, DateTime(Date(-1, 7, 1), TimeOfDay(12, 30, 33)));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.month = 12));
static assert(!__traits(compiles, idt.month = 12));
}
/++
Day of a Gregorian Month.
+/
@property ubyte day() @safe const pure nothrow
{
return _date.day;
}
///
unittest
{
assert(DateTime(Date(1999, 7, 6), TimeOfDay(9, 7, 5)).day == 6);
assert(DateTime(Date(2010, 10, 4), TimeOfDay(0, 0, 30)).day == 4);
assert(DateTime(Date(-7, 4, 5), TimeOfDay(7, 45, 2)).day == 5);
}
unittest
{
import std.range;
import std.format : format;
static void test(DateTime dateTime, int expected)
{
assert(dateTime.day == expected, format("Value given: %s", dateTime));
}
foreach(year; chain(testYearsBC, testYearsAD))
{
foreach(md; testMonthDays)
{
foreach(tod; testTODs)
test(DateTime(Date(year, md.month, md.day), tod), md.day);
}
}
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.day));
static assert(__traits(compiles, idt.day));
}
/++
Day of a Gregorian Month.
Params:
day = The day of the month to set this $(LREF DateTime)'s day to.
Throws:
$(LREF DateTimeException) if the given day is not a valid day of the
current month.
+/
@property void day(int day) @safe pure
{
_date.day = day;
}
unittest
{
static void testDT(DateTime dt, int day)
{
dt.day = day;
}
//Test A.D.
assertThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1)), 0));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 2, 1)), 29));
assertThrown!DateTimeException(testDT(DateTime(Date(4, 2, 1)), 30));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 3, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 4, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 5, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 6, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 7, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 8, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 9, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 10, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 11, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(1, 12, 1)), 32));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 1, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 2, 1)), 28));
assertNotThrown!DateTimeException(testDT(DateTime(Date(4, 2, 1)), 29));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 3, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 4, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 5, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 6, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 7, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 8, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 9, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 10, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 11, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(1, 12, 1)), 31));
{
auto dt = DateTime(Date(1, 1, 1), TimeOfDay(7, 12, 22));
dt.day = 6;
assert(dt == DateTime(Date(1, 1, 6), TimeOfDay(7, 12, 22)));
}
//Test B.C.
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 1, 1)), 0));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 1, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 2, 1)), 29));
assertThrown!DateTimeException(testDT(DateTime(Date(0, 2, 1)), 30));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 3, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 4, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 5, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 6, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 7, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 8, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 9, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 10, 1)), 32));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 11, 1)), 31));
assertThrown!DateTimeException(testDT(DateTime(Date(-1, 12, 1)), 32));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 1, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 2, 1)), 28));
assertNotThrown!DateTimeException(testDT(DateTime(Date(0, 2, 1)), 29));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 3, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 4, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 5, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 6, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 7, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 8, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 9, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 10, 1)), 31));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 11, 1)), 30));
assertNotThrown!DateTimeException(testDT(DateTime(Date(-1, 12, 1)), 31));
auto dt = DateTime(Date(-1, 1, 1), TimeOfDay(7, 12, 22));
dt.day = 6;
assert(dt == DateTime(Date(-1, 1, 6), TimeOfDay(7, 12, 22)));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.day = 27));
static assert(!__traits(compiles, idt.day = 27));
}
/++
Hours past midnight.
+/
@property ubyte hour() @safe const pure nothrow
{
return _tod.hour;
}
unittest
{
assert(DateTime.init.hour == 0);
assert(DateTime(Date.init, TimeOfDay(12, 0, 0)).hour == 12);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.hour));
static assert(__traits(compiles, idt.hour));
}
/++
Hours past midnight.
Params:
hour = The hour of the day to set this $(LREF DateTime)'s hour to.
Throws:
$(LREF DateTimeException) if the given hour would result in an invalid
$(LREF DateTime).
+/
@property void hour(int hour) @safe pure
{
_tod.hour = hour;
}
unittest
{
assertThrown!DateTimeException((){DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)).hour = 24;}());
auto dt = DateTime.init;
dt.hour = 12;
assert(dt == DateTime(1, 1, 1, 12, 0, 0));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.hour = 27));
static assert(!__traits(compiles, idt.hour = 27));
}
/++
Minutes past the hour.
+/
@property ubyte minute() @safe const pure nothrow
{
return _tod.minute;
}
unittest
{
assert(DateTime.init.minute == 0);
assert(DateTime(1, 1, 1, 0, 30, 0).minute == 30);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.minute));
static assert(__traits(compiles, idt.minute));
}
/++
Minutes past the hour.
Params:
minute = The minute to set this $(LREF DateTime)'s minute to.
Throws:
$(LREF DateTimeException) if the given minute would result in an
invalid $(LREF DateTime).
+/
@property void minute(int minute) @safe pure
{
_tod.minute = minute;
}
unittest
{
assertThrown!DateTimeException((){DateTime.init.minute = 60;}());
auto dt = DateTime.init;
dt.minute = 30;
assert(dt == DateTime(1, 1, 1, 0, 30, 0));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.minute = 27));
static assert(!__traits(compiles, idt.minute = 27));
}
/++
Seconds past the minute.
+/
@property ubyte second() @safe const pure nothrow
{
return _tod.second;
}
unittest
{
assert(DateTime.init.second == 0);
assert(DateTime(1, 1, 1, 0, 0, 33).second == 33);
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.second));
static assert(__traits(compiles, idt.second));
}
/++
Seconds past the minute.
Params:
second = The second to set this $(LREF DateTime)'s second to.
Throws:
$(LREF DateTimeException) if the given seconds would result in an
invalid $(LREF DateTime).
+/
@property void second(int second) @safe pure
{
_tod.second = second;
}
unittest
{
assertThrown!DateTimeException((){DateTime.init.second = 60;}());
auto dt = DateTime.init;
dt.second = 33;
assert(dt == DateTime(1, 1, 1, 0, 0, 33));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.second = 27));
static assert(!__traits(compiles, idt.second = 27));
}
/++
Adds the given number of years or months to this $(LREF DateTime). 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 DateTime).
allowOverflow = Whether the days should be allowed to overflow,
causing the month to increment.
+/
ref DateTime add(string units)
(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
if(units == "years" ||
units == "months")
{
_date.add!units(value, allowOverflow);
return this;
}
///
unittest
{
auto dt1 = DateTime(2010, 1, 1, 12, 30, 33);
dt1.add!"months"(11);
assert(dt1 == DateTime(2010, 12, 1, 12, 30, 33));
auto dt2 = DateTime(2010, 1, 1, 12, 30, 33);
dt2.add!"months"(-11);
assert(dt2 == DateTime(2009, 2, 1, 12, 30, 33));
auto dt3 = DateTime(2000, 2, 29, 12, 30, 33);
dt3.add!"years"(1);
assert(dt3 == DateTime(2001, 3, 1, 12, 30, 33));
auto dt4 = DateTime(2000, 2, 29, 12, 30, 33);
dt4.add!"years"(1, AllowDayOverflow.no);
assert(dt4 == DateTime(2001, 2, 28, 12, 30, 33));
}
unittest
{
auto dt = DateTime(2000, 1, 31);
dt.add!"years"(7).add!"months"(-4);
assert(dt == DateTime(2006, 10, 1));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.add!"years"(4)));
static assert(!__traits(compiles, idt.add!"years"(4)));
static assert(!__traits(compiles, cdt.add!"months"(4)));
static assert(!__traits(compiles, idt.add!"months"(4)));
}
/++
Adds the given number of years or months to this $(LREF DateTime). A
negative number will subtract.
The difference between rolling and adding is that rolling does not
affect larger units. Rolling a $(LREF DateTime) 12 months
gets the exact same $(LREF DateTime). 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 DateTime).
allowOverflow = Whether the days should be allowed to overflow,
causing the month to increment.
+/
ref DateTime roll(string units)
(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) @safe pure nothrow
if(units == "years" ||
units == "months")
{
_date.roll!units(value, allowOverflow);
return this;
}
///
unittest
{
auto dt1 = DateTime(2010, 1, 1, 12, 33, 33);
dt1.roll!"months"(1);
assert(dt1 == DateTime(2010, 2, 1, 12, 33, 33));
auto dt2 = DateTime(2010, 1, 1, 12, 33, 33);
dt2.roll!"months"(-1);
assert(dt2 == DateTime(2010, 12, 1, 12, 33, 33));
auto dt3 = DateTime(1999, 1, 29, 12, 33, 33);
dt3.roll!"months"(1);
assert(dt3 == DateTime(1999, 3, 1, 12, 33, 33));
auto dt4 = DateTime(1999, 1, 29, 12, 33, 33);
dt4.roll!"months"(1, AllowDayOverflow.no);
assert(dt4 == DateTime(1999, 2, 28, 12, 33, 33));
auto dt5 = DateTime(2000, 2, 29, 12, 30, 33);
dt5.roll!"years"(1);
assert(dt5 == DateTime(2001, 3, 1, 12, 30, 33));
auto dt6 = DateTime(2000, 2, 29, 12, 30, 33);
dt6.roll!"years"(1, AllowDayOverflow.no);
assert(dt6 == DateTime(2001, 2, 28, 12, 30, 33));
}
unittest
{
auto dt = DateTime(2000, 1, 31);
dt.roll!"years"(7).roll!"months"(-4);
assert(dt == DateTime(2007, 10, 1));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.roll!"years"(4)));
static assert(!__traits(compiles, idt.roll!"years"(4)));
static assert(!__traits(compiles, cdt.roll!"months"(4)));
static assert(!__traits(compiles, idt.roll!"months"(4)));
}
/++
Adds the given number of units to this $(LREF DateTime). A negative number
will subtract.
The difference between rolling and adding is that rolling does not
affect larger units. For instance, rolling a $(LREF DateTime) one
year's worth of days gets the exact same $(LREF DateTime).
Accepted units are $(D "days"), $(D "minutes"), $(D "hours"),
$(D "minutes"), and $(D "seconds").
Params:
units = The units to add.
value = The number of $(D_PARAM units) to add to this $(LREF DateTime).
+/
ref DateTime roll(string units)(long value) @safe pure nothrow
if(units == "days")
{
_date.roll!"days"(value);
return this;
}
///
unittest
{
auto dt1 = DateTime(2010, 1, 1, 11, 23, 12);
dt1.roll!"days"(1);
assert(dt1 == DateTime(2010, 1, 2, 11, 23, 12));
dt1.roll!"days"(365);
assert(dt1 == DateTime(2010, 1, 26, 11, 23, 12));
dt1.roll!"days"(-32);
assert(dt1 == DateTime(2010, 1, 25, 11, 23, 12));
auto dt2 = DateTime(2010, 7, 4, 12, 0, 0);
dt2.roll!"hours"(1);
assert(dt2 == DateTime(2010, 7, 4, 13, 0, 0));
auto dt3 = DateTime(2010, 1, 1, 0, 0, 0);
dt3.roll!"seconds"(-1);
assert(dt3 == DateTime(2010, 1, 1, 0, 0, 59));
}
unittest
{
auto dt = DateTime(2000, 1, 31);
dt.roll!"days"(7).roll!"days"(-4);
assert(dt == DateTime(2000, 1, 3));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.roll!"days"(4)));
static assert(!__traits(compiles, idt.roll!"days"(4)));
}
//Shares documentation with "days" version.
ref DateTime roll(string units)(long value) @safe pure nothrow
if(units == "hours" ||
units == "minutes" ||
units == "seconds")
{
_tod.roll!units(value);
return this;
}
//Test roll!"hours"().
unittest
{
static void testDT(DateTime orig, int hours, in DateTime expected, size_t line = __LINE__)
{
orig.roll!"hours"(hours);
assert(orig == expected);
}
//Test A.D.
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 2, DateTime(Date(1999, 7, 6), TimeOfDay(14, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 3, DateTime(Date(1999, 7, 6), TimeOfDay(15, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 4, DateTime(Date(1999, 7, 6), TimeOfDay(16, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 5, DateTime(Date(1999, 7, 6), TimeOfDay(17, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 6, DateTime(Date(1999, 7, 6), TimeOfDay(18, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 7, DateTime(Date(1999, 7, 6), TimeOfDay(19, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 8, DateTime(Date(1999, 7, 6), TimeOfDay(20, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 9, DateTime(Date(1999, 7, 6), TimeOfDay(21, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 10, DateTime(Date(1999, 7, 6), TimeOfDay(22, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 11, DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 12, DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 13, DateTime(Date(1999, 7, 6), TimeOfDay(1, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 14, DateTime(Date(1999, 7, 6), TimeOfDay(2, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 15, DateTime(Date(1999, 7, 6), TimeOfDay(3, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 16, DateTime(Date(1999, 7, 6), TimeOfDay(4, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 17, DateTime(Date(1999, 7, 6), TimeOfDay(5, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 18, DateTime(Date(1999, 7, 6), TimeOfDay(6, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 19, DateTime(Date(1999, 7, 6), TimeOfDay(7, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 20, DateTime(Date(1999, 7, 6), TimeOfDay(8, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 21, DateTime(Date(1999, 7, 6), TimeOfDay(9, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 22, DateTime(Date(1999, 7, 6), TimeOfDay(10, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 23, DateTime(Date(1999, 7, 6), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 24, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 25, DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -2, DateTime(Date(1999, 7, 6), TimeOfDay(10, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -3, DateTime(Date(1999, 7, 6), TimeOfDay(9, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -4, DateTime(Date(1999, 7, 6), TimeOfDay(8, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -5, DateTime(Date(1999, 7, 6), TimeOfDay(7, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -6, DateTime(Date(1999, 7, 6), TimeOfDay(6, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -7, DateTime(Date(1999, 7, 6), TimeOfDay(5, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -8, DateTime(Date(1999, 7, 6), TimeOfDay(4, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -9, DateTime(Date(1999, 7, 6), TimeOfDay(3, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -10, DateTime(Date(1999, 7, 6), TimeOfDay(2, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -11, DateTime(Date(1999, 7, 6), TimeOfDay(1, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -12, DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -13, DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -14, DateTime(Date(1999, 7, 6), TimeOfDay(22, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -15, DateTime(Date(1999, 7, 6), TimeOfDay(21, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -16, DateTime(Date(1999, 7, 6), TimeOfDay(20, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -17, DateTime(Date(1999, 7, 6), TimeOfDay(19, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -18, DateTime(Date(1999, 7, 6), TimeOfDay(18, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -19, DateTime(Date(1999, 7, 6), TimeOfDay(17, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -20, DateTime(Date(1999, 7, 6), TimeOfDay(16, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -21, DateTime(Date(1999, 7, 6), TimeOfDay(15, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -22, DateTime(Date(1999, 7, 6), TimeOfDay(14, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -23, DateTime(Date(1999, 7, 6), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -24, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -25, DateTime(Date(1999, 7, 6), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(1, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(23, 30, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(22, 30, 33)));
testDT(DateTime(Date(1999, 7, 31), TimeOfDay(23, 30, 33)), 1, DateTime(Date(1999, 7, 31), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(1999, 8, 1), TimeOfDay(0, 30, 33)), -1, DateTime(Date(1999, 8, 1), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(1999, 12, 31), TimeOfDay(23, 30, 33)), 1, DateTime(Date(1999, 12, 31), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(2000, 1, 1), TimeOfDay(0, 30, 33)), -1, DateTime(Date(2000, 1, 1), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(1999, 2, 28), TimeOfDay(23, 30, 33)), 25, DateTime(Date(1999, 2, 28), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(1999, 3, 2), TimeOfDay(0, 30, 33)), -25, DateTime(Date(1999, 3, 2), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(2000, 2, 28), TimeOfDay(23, 30, 33)), 25, DateTime(Date(2000, 2, 28), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(2000, 3, 1), TimeOfDay(0, 30, 33)), -25, DateTime(Date(2000, 3, 1), TimeOfDay(23, 30, 33)));
//Test B.C.
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 2, DateTime(Date(-1999, 7, 6), TimeOfDay(14, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 3, DateTime(Date(-1999, 7, 6), TimeOfDay(15, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 4, DateTime(Date(-1999, 7, 6), TimeOfDay(16, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 5, DateTime(Date(-1999, 7, 6), TimeOfDay(17, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 6, DateTime(Date(-1999, 7, 6), TimeOfDay(18, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 7, DateTime(Date(-1999, 7, 6), TimeOfDay(19, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 8, DateTime(Date(-1999, 7, 6), TimeOfDay(20, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 9, DateTime(Date(-1999, 7, 6), TimeOfDay(21, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 10, DateTime(Date(-1999, 7, 6), TimeOfDay(22, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 11, DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 12, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 13, DateTime(Date(-1999, 7, 6), TimeOfDay(1, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 14, DateTime(Date(-1999, 7, 6), TimeOfDay(2, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 15, DateTime(Date(-1999, 7, 6), TimeOfDay(3, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 16, DateTime(Date(-1999, 7, 6), TimeOfDay(4, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 17, DateTime(Date(-1999, 7, 6), TimeOfDay(5, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 18, DateTime(Date(-1999, 7, 6), TimeOfDay(6, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 19, DateTime(Date(-1999, 7, 6), TimeOfDay(7, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 20, DateTime(Date(-1999, 7, 6), TimeOfDay(8, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 21, DateTime(Date(-1999, 7, 6), TimeOfDay(9, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 22, DateTime(Date(-1999, 7, 6), TimeOfDay(10, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 23, DateTime(Date(-1999, 7, 6), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 24, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 25, DateTime(Date(-1999, 7, 6), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -2, DateTime(Date(-1999, 7, 6), TimeOfDay(10, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -3, DateTime(Date(-1999, 7, 6), TimeOfDay(9, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -4, DateTime(Date(-1999, 7, 6), TimeOfDay(8, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -5, DateTime(Date(-1999, 7, 6), TimeOfDay(7, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -6, DateTime(Date(-1999, 7, 6), TimeOfDay(6, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -7, DateTime(Date(-1999, 7, 6), TimeOfDay(5, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -8, DateTime(Date(-1999, 7, 6), TimeOfDay(4, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -9, DateTime(Date(-1999, 7, 6), TimeOfDay(3, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -10, DateTime(Date(-1999, 7, 6), TimeOfDay(2, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -11, DateTime(Date(-1999, 7, 6), TimeOfDay(1, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -12, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -13, DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -14, DateTime(Date(-1999, 7, 6), TimeOfDay(22, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -15, DateTime(Date(-1999, 7, 6), TimeOfDay(21, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -16, DateTime(Date(-1999, 7, 6), TimeOfDay(20, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -17, DateTime(Date(-1999, 7, 6), TimeOfDay(19, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -18, DateTime(Date(-1999, 7, 6), TimeOfDay(18, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -19, DateTime(Date(-1999, 7, 6), TimeOfDay(17, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -20, DateTime(Date(-1999, 7, 6), TimeOfDay(16, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -21, DateTime(Date(-1999, 7, 6), TimeOfDay(15, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -22, DateTime(Date(-1999, 7, 6), TimeOfDay(14, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -23, DateTime(Date(-1999, 7, 6), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -24, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -25, DateTime(Date(-1999, 7, 6), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(1, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(23, 30, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(22, 30, 33)));
testDT(DateTime(Date(-1999, 7, 31), TimeOfDay(23, 30, 33)), 1, DateTime(Date(-1999, 7, 31), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-1999, 8, 1), TimeOfDay(0, 30, 33)), -1, DateTime(Date(-1999, 8, 1), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-2001, 12, 31), TimeOfDay(23, 30, 33)), 1, DateTime(Date(-2001, 12, 31), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-2000, 1, 1), TimeOfDay(0, 30, 33)), -1, DateTime(Date(-2000, 1, 1), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-2001, 2, 28), TimeOfDay(23, 30, 33)), 25, DateTime(Date(-2001, 2, 28), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-2001, 3, 2), TimeOfDay(0, 30, 33)), -25, DateTime(Date(-2001, 3, 2), TimeOfDay(23, 30, 33)));
testDT(DateTime(Date(-2000, 2, 28), TimeOfDay(23, 30, 33)), 25, DateTime(Date(-2000, 2, 28), TimeOfDay(0, 30, 33)));
testDT(DateTime(Date(-2000, 3, 1), TimeOfDay(0, 30, 33)), -25, DateTime(Date(-2000, 3, 1), TimeOfDay(23, 30, 33)));
//Test Both
testDT(DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)), 17_546, DateTime(Date(-1, 1, 1), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)), -17_546, DateTime(Date(1, 1, 1), TimeOfDay(11, 30, 33)));
auto dt = DateTime(2000, 1, 31, 9, 7, 6);
dt.roll!"hours"(27).roll!"hours"(-9);
assert(dt == DateTime(2000, 1, 31, 3, 7, 6));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.roll!"hours"(4)));
static assert(!__traits(compiles, idt.roll!"hours"(4)));
}
//Test roll!"minutes"().
unittest
{
static void testDT(DateTime orig, int minutes, in DateTime expected, size_t line = __LINE__)
{
orig.roll!"minutes"(minutes);
assert(orig == expected);
}
//Test A.D.
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 2, DateTime(Date(1999, 7, 6), TimeOfDay(12, 32, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 3, DateTime(Date(1999, 7, 6), TimeOfDay(12, 33, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 4, DateTime(Date(1999, 7, 6), TimeOfDay(12, 34, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 5, DateTime(Date(1999, 7, 6), TimeOfDay(12, 35, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 10, DateTime(Date(1999, 7, 6), TimeOfDay(12, 40, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 15, DateTime(Date(1999, 7, 6), TimeOfDay(12, 45, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 29, DateTime(Date(1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 30, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 45, DateTime(Date(1999, 7, 6), TimeOfDay(12, 15, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 60, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 75, DateTime(Date(1999, 7, 6), TimeOfDay(12, 45, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 90, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 100, DateTime(Date(1999, 7, 6), TimeOfDay(12, 10, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 689, DateTime(Date(1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 690, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 691, DateTime(Date(1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 960, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1439, DateTime(Date(1999, 7, 6), TimeOfDay(12, 29, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1440, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1441, DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 2880, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 29, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -2, DateTime(Date(1999, 7, 6), TimeOfDay(12, 28, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -3, DateTime(Date(1999, 7, 6), TimeOfDay(12, 27, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -4, DateTime(Date(1999, 7, 6), TimeOfDay(12, 26, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -5, DateTime(Date(1999, 7, 6), TimeOfDay(12, 25, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -10, DateTime(Date(1999, 7, 6), TimeOfDay(12, 20, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -15, DateTime(Date(1999, 7, 6), TimeOfDay(12, 15, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -29, DateTime(Date(1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -30, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -45, DateTime(Date(1999, 7, 6), TimeOfDay(12, 45, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -60, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -75, DateTime(Date(1999, 7, 6), TimeOfDay(12, 15, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -90, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -100, DateTime(Date(1999, 7, 6), TimeOfDay(12, 50, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -749, DateTime(Date(1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -750, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -751, DateTime(Date(1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -960, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -1439, DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -1440, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -1441, DateTime(Date(1999, 7, 6), TimeOfDay(12, 29, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -2880, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(11, 59, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(11, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(11, 59, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(11, 59, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(11, 59, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(11, 58, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(0, 1, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(0, 59, 33)));
testDT(DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 33)), 1, DateTime(Date(1999, 7, 5), TimeOfDay(23, 0, 33)));
testDT(DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 33)), 0, DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 33)));
testDT(DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 33)), -1, DateTime(Date(1999, 7, 5), TimeOfDay(23, 58, 33)));
testDT(DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 33)), 1, DateTime(Date(1998, 12, 31), TimeOfDay(23, 0, 33)));
testDT(DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 33)), 0, DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 33)));
testDT(DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 33)), -1, DateTime(Date(1998, 12, 31), TimeOfDay(23, 58, 33)));
//Test B.C.
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 31, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 2, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 32, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 3, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 33, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 4, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 34, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 5, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 35, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 10, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 40, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 15, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 45, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 29, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 30, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 45, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 15, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 60, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 75, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 45, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 90, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 100, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 10, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 689, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 690, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 691, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 960, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1439, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 29, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1440, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1441, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 31, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 2880, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 29, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -2, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 28, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -3, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 27, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -4, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 26, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -5, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 25, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -10, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 20, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -15, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 15, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -29, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -30, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -45, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 45, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -60, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -75, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 15, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -90, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -100, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 50, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -749, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -750, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -751, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -960, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -1439, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 31, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -1440, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -1441, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 29, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -2880, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 1, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 59, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(11, 59, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(11, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(11, 59, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(11, 59, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(11, 59, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(11, 58, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 1, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 59, 33)));
testDT(DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 33)), 1, DateTime(Date(-1999, 7, 5), TimeOfDay(23, 0, 33)));
testDT(DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 33)), 0, DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 33)));
testDT(DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 33)), -1, DateTime(Date(-1999, 7, 5), TimeOfDay(23, 58, 33)));
testDT(DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 33)), 1, DateTime(Date(-2000, 12, 31), TimeOfDay(23, 0, 33)));
testDT(DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 33)), 0, DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 33)));
testDT(DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 33)), -1, DateTime(Date(-2000, 12, 31), TimeOfDay(23, 58, 33)));
//Test Both
testDT(DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 0)), -1, DateTime(Date(1, 1, 1), TimeOfDay(0, 59, 0)));
testDT(DateTime(Date(0, 12, 31), TimeOfDay(23, 59, 0)), 1, DateTime(Date(0, 12, 31), TimeOfDay(23, 0, 0)));
testDT(DateTime(Date(0, 1, 1), TimeOfDay(0, 0, 0)), -1, DateTime(Date(0, 1, 1), TimeOfDay(0, 59, 0)));
testDT(DateTime(Date(-1, 12, 31), TimeOfDay(23, 59, 0)), 1, DateTime(Date(-1, 12, 31), TimeOfDay(23, 0, 0)));
testDT(DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)), 1_052_760, DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)), -1_052_760, DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)), 1_052_782, DateTime(Date(-1, 1, 1), TimeOfDay(11, 52, 33)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(13, 52, 33)), -1_052_782, DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)));
auto dt = DateTime(2000, 1, 31, 9, 7, 6);
dt.roll!"minutes"(92).roll!"minutes"(-292);
assert(dt == DateTime(2000, 1, 31, 9, 47, 6));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.roll!"minutes"(4)));
static assert(!__traits(compiles, idt.roll!"minutes"(4)));
}
//Test roll!"seconds"().
unittest
{
static void testDT(DateTime orig, int seconds, in DateTime expected, size_t line = __LINE__)
{
orig.roll!"seconds"(seconds);
assert(orig == expected);
}
//Test A.D.
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 2, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 35)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 3, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 36)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 4, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 37)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 5, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 38)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 10, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 43)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 15, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 48)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 26, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 27, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 30, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 3)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 59, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 60, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 61, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1766, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1767, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 1768, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 1)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 2007, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 3599, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 3600, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 3601, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), 7200, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -2, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 31)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -3, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 30)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -4, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 29)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -5, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 28)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -10, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 23)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -15, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 18)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -33, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -34, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -35, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 58)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -59, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -60, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)), -61, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 1)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 0)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 0)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 1)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 0)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 0)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(12, 0, 59)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)), 1, DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 1)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)), 0, DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)));
testDT(DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 0)), -1, DateTime(Date(1999, 7, 6), TimeOfDay(0, 0, 59)));
testDT(DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 59)), 1, DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 0)));
testDT(DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 59)), 0, DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 59)));
testDT(DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 59)), -1, DateTime(Date(1999, 7, 5), TimeOfDay(23, 59, 58)));
testDT(DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 59)), 1, DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 0)));
testDT(DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 59)), 0, DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 59)));
testDT(DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 59)), -1, DateTime(Date(1998, 12, 31), TimeOfDay(23, 59, 58)));
//Test B.C.
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 2, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 35)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 3, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 36)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 4, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 37)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 5, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 38)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 10, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 43)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 15, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 48)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 26, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 27, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 30, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 3)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 59, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 60, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 61, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1766, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1767, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 1768, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 1)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 2007, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 3599, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 3600, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 3601, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), 7200, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -2, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 31)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -3, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 30)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -4, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 29)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -5, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 28)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -10, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 23)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -15, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 18)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -33, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -34, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -35, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 58)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -59, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 34)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -60, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)), -61, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 32)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 1)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 0)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 59)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 0)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 1)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 0)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 0)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(12, 0, 59)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 0)), 1, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 1)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 0)), 0, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 0)));
testDT(DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 0)), -1, DateTime(Date(-1999, 7, 6), TimeOfDay(0, 0, 59)));
testDT(DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 59)), 1, DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 0)));
testDT(DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 59)), 0, DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 59)));
testDT(DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 59)), -1, DateTime(Date(-1999, 7, 5), TimeOfDay(23, 59, 58)));
testDT(DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 59)), 1, DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 0)));
testDT(DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 59)), 0, DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 59)));
testDT(DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 59)), -1, DateTime(Date(-2000, 12, 31), TimeOfDay(23, 59, 58)));
//Test Both
testDT(DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 0)), -1, DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 59)));
testDT(DateTime(Date(0, 12, 31), TimeOfDay(23, 59, 59)), 1, DateTime(Date(0, 12, 31), TimeOfDay(23, 59, 0)));
testDT(DateTime(Date(0, 1, 1), TimeOfDay(0, 0, 0)), -1, DateTime(Date(0, 1, 1), TimeOfDay(0, 0, 59)));
testDT(DateTime(Date(-1, 12, 31), TimeOfDay(23, 59, 59)), 1, DateTime(Date(-1, 12, 31), TimeOfDay(23, 59, 0)));
testDT(DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)), 63_165_600L, DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)), -63_165_600L, DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)));
testDT(DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 33)), 63_165_617L, DateTime(Date(-1, 1, 1), TimeOfDay(11, 30, 50)));
testDT(DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 50)), -63_165_617L, DateTime(Date(1, 1, 1), TimeOfDay(13, 30, 33)));
auto dt = DateTime(2000, 1, 31, 9, 7, 6);
dt.roll!"seconds"(92).roll!"seconds"(-292);
assert(dt == DateTime(2000, 1, 31, 9, 7, 46));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt.roll!"seconds"(4)));
static assert(!__traits(compiles, idt.roll!"seconds"(4)));
}
/++
Gives the result of adding or subtracting a duration from this
$(LREF DateTime).
The legal types of arithmetic for $(LREF DateTime) using this operator are
$(BOOKTABLE,
$(TR $(TD DateTime) $(TD +) $(TD duration) $(TD -->) $(TD DateTime))
$(TR $(TD DateTime) $(TD -) $(TD duration) $(TD -->) $(TD DateTime))
)
Params:
duration = The duration to add to or subtract from this
$(LREF DateTime).
+/
DateTime opBinary(string op, D)(in D duration) @safe const pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
DateTime retval = this;
static if(is(Unqual!D == Duration))
immutable hnsecs = duration.total!"hnsecs";
else static if(is(Unqual!D == TickDuration))
immutable hnsecs = duration.hnsecs;
mixin(format(`return retval._addSeconds(convert!("hnsecs", "seconds")(%shnsecs));`, op));
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
assert(dt + dur!"weeks"(7) == DateTime(Date(1999, 8, 24), TimeOfDay(12, 30, 33)));
assert(dt + dur!"weeks"(-7) == DateTime(Date(1999, 5, 18), TimeOfDay(12, 30, 33)));
assert(dt + dur!"days"(7) == DateTime(Date(1999, 7, 13), TimeOfDay(12, 30, 33)));
assert(dt + dur!"days"(-7) == DateTime(Date(1999, 6, 29), TimeOfDay(12, 30, 33)));
assert(dt + dur!"hours"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(19, 30, 33)));
assert(dt + dur!"hours"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(5, 30, 33)));
assert(dt + dur!"minutes"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 37, 33)));
assert(dt + dur!"minutes"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 23, 33)));
assert(dt + dur!"seconds"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt + dur!"seconds"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(dt + dur!"msecs"(7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt + dur!"msecs"(-7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(dt + dur!"usecs"(7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt + dur!"usecs"(-7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(dt + dur!"hnsecs"(70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt + dur!"hnsecs"(-70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(dt + TickDuration.from!"usecs"(7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt + TickDuration.from!"usecs"(-7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
}
assert(dt - dur!"weeks"(-7) == DateTime(Date(1999, 8, 24), TimeOfDay(12, 30, 33)));
assert(dt - dur!"weeks"(7) == DateTime(Date(1999, 5, 18), TimeOfDay(12, 30, 33)));
assert(dt - dur!"days"(-7) == DateTime(Date(1999, 7, 13), TimeOfDay(12, 30, 33)));
assert(dt - dur!"days"(7) == DateTime(Date(1999, 6, 29), TimeOfDay(12, 30, 33)));
assert(dt - dur!"hours"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(19, 30, 33)));
assert(dt - dur!"hours"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(5, 30, 33)));
assert(dt - dur!"minutes"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 37, 33)));
assert(dt - dur!"minutes"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 23, 33)));
assert(dt - dur!"seconds"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt - dur!"seconds"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(dt - dur!"msecs"(-7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt - dur!"msecs"(7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(dt - dur!"usecs"(-7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt - dur!"usecs"(7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(dt - dur!"hnsecs"(-70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt - dur!"hnsecs"(70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
//This probably only runs in cases where gettimeofday() is used, but it's
//hard to do this test correctly with variable ticksPerSec.
if(TickDuration.ticksPerSec == 1_000_000)
{
assert(dt - TickDuration.from!"usecs"(-7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(dt - TickDuration.from!"usecs"(7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
}
auto duration = dur!"seconds"(12);
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt + duration));
static assert(__traits(compiles, idt + duration));
static assert(__traits(compiles, cdt - duration));
static assert(__traits(compiles, idt - duration));
}
/++
Gives the result of adding or subtracting a duration from this
$(LREF DateTime), as well as assigning the result to this $(LREF DateTime).
The legal types of arithmetic for $(LREF DateTime) using this operator are
$(BOOKTABLE,
$(TR $(TD DateTime) $(TD +) $(TD duration) $(TD -->) $(TD DateTime))
$(TR $(TD DateTime) $(TD -) $(TD duration) $(TD -->) $(TD DateTime))
)
Params:
duration = The duration to add to or subtract from this
$(LREF DateTime).
+/
ref DateTime opOpAssign(string op, D)(in D duration) @safe pure nothrow
if((op == "+" || op == "-") &&
(is(Unqual!D == Duration) ||
is(Unqual!D == TickDuration)))
{
import std.format : format;
DateTime retval = this;
static if(is(Unqual!D == Duration))
immutable hnsecs = duration.total!"hnsecs";
else static if(is(Unqual!D == TickDuration))
immutable hnsecs = duration.hnsecs;
mixin(format(`return _addSeconds(convert!("hnsecs", "seconds")(%shnsecs));`, op));
}
unittest
{
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"weeks"(7) == DateTime(Date(1999, 8, 24), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"weeks"(-7) == DateTime(Date(1999, 5, 18), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"days"(7) == DateTime(Date(1999, 7, 13), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"days"(-7) == DateTime(Date(1999, 6, 29), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"hours"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(19, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"hours"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(5, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"minutes"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 37, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"minutes"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 23, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"seconds"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"seconds"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"msecs"(7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"msecs"(-7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"usecs"(7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"usecs"(-7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"hnsecs"(70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) + dur!"hnsecs"(-70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"weeks"(-7) == DateTime(Date(1999, 8, 24), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"weeks"(7) == DateTime(Date(1999, 5, 18), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"days"(-7) == DateTime(Date(1999, 7, 13), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"days"(7) == DateTime(Date(1999, 6, 29), TimeOfDay(12, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"hours"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(19, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"hours"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(5, 30, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"minutes"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 37, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"minutes"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 23, 33)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"seconds"(-7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"seconds"(7) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"msecs"(-7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"msecs"(7_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"usecs"(-7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"usecs"(7_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"hnsecs"(-70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 40)));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) - dur!"hnsecs"(70_000_000) == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 26)));
auto dt = DateTime(2000, 1, 31, 9, 7, 6);
(dt += dur!"seconds"(92)) -= dur!"days"(-500);
assert(dt == DateTime(2001, 6, 14, 9, 8, 38));
auto duration = dur!"seconds"(12);
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(!__traits(compiles, cdt += duration));
static assert(!__traits(compiles, idt += duration));
static assert(!__traits(compiles, cdt -= duration));
static assert(!__traits(compiles, idt -= duration));
}
/++
Gives the difference between two $(LREF DateTime)s.
The legal types of arithmetic for $(LREF DateTime) using this operator are
$(BOOKTABLE,
$(TR $(TD DateTime) $(TD -) $(TD DateTime) $(TD -->) $(TD duration))
)
+/
Duration opBinary(string op)(in DateTime rhs) @safe const pure nothrow
if(op == "-")
{
immutable dateResult = _date - rhs.date;
immutable todResult = _tod - rhs._tod;
return dur!"hnsecs"(dateResult.total!"hnsecs" + todResult.total!"hnsecs");
}
unittest
{
auto dt = DateTime(1999, 7, 6, 12, 30, 33);
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1998, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(31_536_000));
assert(DateTime(Date(1998, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(-31_536_000));
assert(DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(26_78_400));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 8, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(-26_78_400));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 5), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(86_400));
assert(DateTime(Date(1999, 7, 5), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(-86_400));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(11, 30, 33)) ==
dur!"seconds"(3600));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(11, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(-3600));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(60));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 31, 33)) ==
dur!"seconds"(-60));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) ==
dur!"seconds"(1));
assert(DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)) -
DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 34)) ==
dur!"seconds"(-1));
assert(DateTime(1, 1, 1, 12, 30, 33) - DateTime(1, 1, 1, 0, 0, 0) == dur!"seconds"(45033));
assert(DateTime(1, 1, 1, 0, 0, 0) - DateTime(1, 1, 1, 12, 30, 33) == dur!"seconds"(-45033));
assert(DateTime(0, 12, 31, 12, 30, 33) - DateTime(1, 1, 1, 0, 0, 0) == dur!"seconds"(-41367));
assert(DateTime(1, 1, 1, 0, 0, 0) - DateTime(0, 12, 31, 12, 30, 33) == dur!"seconds"(41367));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt - dt));
static assert(__traits(compiles, cdt - dt));
static assert(__traits(compiles, idt - dt));
static assert(__traits(compiles, dt - cdt));
static assert(__traits(compiles, cdt - cdt));
static assert(__traits(compiles, idt - cdt));
static assert(__traits(compiles, dt - idt));
static assert(__traits(compiles, cdt - idt));
static assert(__traits(compiles, idt - idt));
}
/++
Returns the difference between the two $(LREF DateTime)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 $(CXREF time, Duration)
that results. Because converting between months and smaller
units requires a specific date (which $(CXREF time, Duration)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 DateTime) to subtract from this one.
+/
int diffMonths(in DateTime rhs) @safe const pure nothrow
{
return _date.diffMonths(rhs._date);
}
///
unittest
{
assert(DateTime(1999, 2, 1, 12, 2, 3).diffMonths(
DateTime(1999, 1, 31, 23, 59, 59)) == 1);
assert(DateTime(1999, 1, 31, 0, 0, 0).diffMonths(
DateTime(1999, 2, 1, 12, 3, 42)) == -1);
assert(DateTime(1999, 3, 1, 5, 30, 0).diffMonths(
DateTime(1999, 1, 1, 2, 4, 7)) == 2);
assert(DateTime(1999, 1, 1, 7, 2, 4).diffMonths(
DateTime(1999, 3, 31, 0, 30, 58)) == -2);
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.diffMonths(dt)));
static assert(__traits(compiles, cdt.diffMonths(dt)));
static assert(__traits(compiles, idt.diffMonths(dt)));
static assert(__traits(compiles, dt.diffMonths(cdt)));
static assert(__traits(compiles, cdt.diffMonths(cdt)));
static assert(__traits(compiles, idt.diffMonths(cdt)));
static assert(__traits(compiles, dt.diffMonths(idt)));
static assert(__traits(compiles, cdt.diffMonths(idt)));
static assert(__traits(compiles, idt.diffMonths(idt)));
}
/++
Whether this $(LREF DateTime) is in a leap year.
+/
@property bool isLeapYear() @safe const pure nothrow
{
return _date.isLeapYear;
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.isLeapYear));
static assert(__traits(compiles, cdt.isLeapYear));
static assert(__traits(compiles, idt.isLeapYear));
}
/++
Day of the week this $(LREF DateTime) is on.
+/
@property DayOfWeek dayOfWeek() @safe const pure nothrow
{
return _date.dayOfWeek;
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.dayOfWeek));
static assert(__traits(compiles, cdt.dayOfWeek));
static assert(__traits(compiles, idt.dayOfWeek));
}
/++
Day of the year this $(LREF DateTime) is on.
+/
@property ushort dayOfYear() @safe const pure nothrow
{
return _date.dayOfYear;
}
///
unittest
{
assert(DateTime(Date(1999, 1, 1), TimeOfDay(12, 22, 7)).dayOfYear == 1);
assert(DateTime(Date(1999, 12, 31), TimeOfDay(7, 2, 59)).dayOfYear == 365);
assert(DateTime(Date(2000, 12, 31), TimeOfDay(21, 20, 0)).dayOfYear == 366);
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.dayOfYear));
static assert(__traits(compiles, cdt.dayOfYear));
static assert(__traits(compiles, idt.dayOfYear));
}
/++
Day of the year.
Params:
day = The day of the year to set which day of the year this
$(LREF DateTime) is on.
+/
@property void dayOfYear(int day) @safe pure
{
_date.dayOfYear = day;
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.dayOfYear = 12));
static assert(!__traits(compiles, cdt.dayOfYear = 12));
static assert(!__traits(compiles, idt.dayOfYear = 12));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF DateTime) is on.
+/
@property int dayOfGregorianCal() @safe const pure nothrow
{
return _date.dayOfGregorianCal;
}
///
unittest
{
assert(DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 0)).dayOfGregorianCal == 1);
assert(DateTime(Date(1, 12, 31), TimeOfDay(23, 59, 59)).dayOfGregorianCal == 365);
assert(DateTime(Date(2, 1, 1), TimeOfDay(2, 2, 2)).dayOfGregorianCal == 366);
assert(DateTime(Date(0, 12, 31), TimeOfDay(7, 7, 7)).dayOfGregorianCal == 0);
assert(DateTime(Date(0, 1, 1), TimeOfDay(19, 30, 0)).dayOfGregorianCal == -365);
assert(DateTime(Date(-1, 12, 31), TimeOfDay(4, 7, 0)).dayOfGregorianCal == -366);
assert(DateTime(Date(2000, 1, 1), TimeOfDay(9, 30, 20)).dayOfGregorianCal == 730_120);
assert(DateTime(Date(2010, 12, 31), TimeOfDay(15, 45, 50)).dayOfGregorianCal == 734_137);
}
unittest
{
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt.dayOfGregorianCal));
static assert(__traits(compiles, idt.dayOfGregorianCal));
}
/++
The Xth day of the Gregorian Calendar that this $(LREF DateTime) is on.
Setting this property does not affect the time portion of
$(LREF DateTime).
Params:
days = The day of the Gregorian Calendar to set this $(LREF DateTime)
to.
+/
@property void dayOfGregorianCal(int days) @safe pure nothrow
{
_date.dayOfGregorianCal = days;
}
///
unittest
{
auto dt = DateTime(Date.init, TimeOfDay(12, 0, 0));
dt.dayOfGregorianCal = 1;
assert(dt == DateTime(Date(1, 1, 1), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = 365;
assert(dt == DateTime(Date(1, 12, 31), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = 366;
assert(dt == DateTime(Date(2, 1, 1), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = 0;
assert(dt == DateTime(Date(0, 12, 31), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = -365;
assert(dt == DateTime(Date(-0, 1, 1), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = -366;
assert(dt == DateTime(Date(-1, 12, 31), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = 730_120;
assert(dt == DateTime(Date(2000, 1, 1), TimeOfDay(12, 0, 0)));
dt.dayOfGregorianCal = 734_137;
assert(dt == DateTime(Date(2010, 12, 31), TimeOfDay(12, 0, 0)));
}
unittest
{
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(!__traits(compiles, cdt.dayOfGregorianCal = 7));
static assert(!__traits(compiles, idt.dayOfGregorianCal = 7));
}
/++
The ISO 8601 week of the year that this $(LREF DateTime) is in.
See_Also:
$(WEB en.wikipedia.org/wiki/ISO_week_date, ISO Week Date)
+/
@property ubyte isoWeek() @safe const pure nothrow
{
return _date.isoWeek;
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.isoWeek));
static assert(__traits(compiles, cdt.isoWeek));
static assert(__traits(compiles, idt.isoWeek));
}
/++
$(LREF DateTime) for the last day in the month that this $(LREF DateTime) is
in. The time portion of endOfMonth is always 23:59:59.
+/
@property DateTime endOfMonth() @safe const pure nothrow
{
try
return DateTime(_date.endOfMonth, TimeOfDay(23, 59, 59));
catch(Exception e)
assert(0, "DateTime constructor threw.");
}
///
unittest
{
assert(DateTime(Date(1999, 1, 6), TimeOfDay(0, 0, 0)).endOfMonth ==
DateTime(Date(1999, 1, 31), TimeOfDay(23, 59, 59)));
assert(DateTime(Date(1999, 2, 7), TimeOfDay(19, 30, 0)).endOfMonth ==
DateTime(Date(1999, 2, 28), TimeOfDay(23, 59, 59)));
assert(DateTime(Date(2000, 2, 7), TimeOfDay(5, 12, 27)).endOfMonth ==
DateTime(Date(2000, 2, 29), TimeOfDay(23, 59, 59)));
assert(DateTime(Date(2000, 6, 4), TimeOfDay(12, 22, 9)).endOfMonth ==
DateTime(Date(2000, 6, 30), TimeOfDay(23, 59, 59)));
}
unittest
{
//Test A.D.
assert(DateTime(1999, 1, 1, 0, 13, 26).endOfMonth == DateTime(1999, 1, 31, 23, 59, 59));
assert(DateTime(1999, 2, 1, 1, 14, 27).endOfMonth == DateTime(1999, 2, 28, 23, 59, 59));
assert(DateTime(2000, 2, 1, 2, 15, 28).endOfMonth == DateTime(2000, 2, 29, 23, 59, 59));
assert(DateTime(1999, 3, 1, 3, 16, 29).endOfMonth == DateTime(1999, 3, 31, 23, 59, 59));
assert(DateTime(1999, 4, 1, 4, 17, 30).endOfMonth == DateTime(1999, 4, 30, 23, 59, 59));
assert(DateTime(1999, 5, 1, 5, 18, 31).endOfMonth == DateTime(1999, 5, 31, 23, 59, 59));
assert(DateTime(1999, 6, 1, 6, 19, 32).endOfMonth == DateTime(1999, 6, 30, 23, 59, 59));
assert(DateTime(1999, 7, 1, 7, 20, 33).endOfMonth == DateTime(1999, 7, 31, 23, 59, 59));
assert(DateTime(1999, 8, 1, 8, 21, 34).endOfMonth == DateTime(1999, 8, 31, 23, 59, 59));
assert(DateTime(1999, 9, 1, 9, 22, 35).endOfMonth == DateTime(1999, 9, 30, 23, 59, 59));
assert(DateTime(1999, 10, 1, 10, 23, 36).endOfMonth == DateTime(1999, 10, 31, 23, 59, 59));
assert(DateTime(1999, 11, 1, 11, 24, 37).endOfMonth == DateTime(1999, 11, 30, 23, 59, 59));
assert(DateTime(1999, 12, 1, 12, 25, 38).endOfMonth == DateTime(1999, 12, 31, 23, 59, 59));
//Test B.C.
assert(DateTime(-1999, 1, 1, 0, 13, 26).endOfMonth == DateTime(-1999, 1, 31, 23, 59, 59));
assert(DateTime(-1999, 2, 1, 1, 14, 27).endOfMonth == DateTime(-1999, 2, 28, 23, 59, 59));
assert(DateTime(-2000, 2, 1, 2, 15, 28).endOfMonth == DateTime(-2000, 2, 29, 23, 59, 59));
assert(DateTime(-1999, 3, 1, 3, 16, 29).endOfMonth == DateTime(-1999, 3, 31, 23, 59, 59));
assert(DateTime(-1999, 4, 1, 4, 17, 30).endOfMonth == DateTime(-1999, 4, 30, 23, 59, 59));
assert(DateTime(-1999, 5, 1, 5, 18, 31).endOfMonth == DateTime(-1999, 5, 31, 23, 59, 59));
assert(DateTime(-1999, 6, 1, 6, 19, 32).endOfMonth == DateTime(-1999, 6, 30, 23, 59, 59));
assert(DateTime(-1999, 7, 1, 7, 20, 33).endOfMonth == DateTime(-1999, 7, 31, 23, 59, 59));
assert(DateTime(-1999, 8, 1, 8, 21, 34).endOfMonth == DateTime(-1999, 8, 31, 23, 59, 59));
assert(DateTime(-1999, 9, 1, 9, 22, 35).endOfMonth == DateTime(-1999, 9, 30, 23, 59, 59));
assert(DateTime(-1999, 10, 1, 10, 23, 36).endOfMonth == DateTime(-1999, 10, 31, 23, 59, 59));
assert(DateTime(-1999, 11, 1, 11, 24, 37).endOfMonth == DateTime(-1999, 11, 30, 23, 59, 59));
assert(DateTime(-1999, 12, 1, 12, 25, 38).endOfMonth == DateTime(-1999, 12, 31, 23, 59, 59));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt.endOfMonth));
static assert(__traits(compiles, idt.endOfMonth));
}
/++
The last day in the month that this $(LREF DateTime) is in.
+/
@property ubyte daysInMonth() @safe const pure nothrow
{
return _date.daysInMonth;
}
///
unittest
{
assert(DateTime(Date(1999, 1, 6), TimeOfDay(0, 0, 0)).daysInMonth == 31);
assert(DateTime(Date(1999, 2, 7), TimeOfDay(19, 30, 0)).daysInMonth == 28);
assert(DateTime(Date(2000, 2, 7), TimeOfDay(5, 12, 27)).daysInMonth == 29);
assert(DateTime(Date(2000, 6, 4), TimeOfDay(12, 22, 9)).daysInMonth == 30);
}
unittest
{
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt.daysInMonth));
static assert(__traits(compiles, idt.daysInMonth));
}
/++
Whether the current year is a date in A.D.
+/
@property bool isAD() @safe const pure nothrow
{
return _date.isAD;
}
///
unittest
{
assert(DateTime(Date(1, 1, 1), TimeOfDay(12, 7, 0)).isAD);
assert(DateTime(Date(2010, 12, 31), TimeOfDay(0, 0, 0)).isAD);
assert(!DateTime(Date(0, 12, 31), TimeOfDay(23, 59, 59)).isAD);
assert(!DateTime(Date(-2010, 1, 1), TimeOfDay(2, 2, 2)).isAD);
}
unittest
{
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt.isAD));
static assert(__traits(compiles, idt.isAD));
}
/++
The $(WEB en.wikipedia.org/wiki/Julian_day, Julian day) for this
$(LREF DateTime) 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 pure nothrow
{
if(_tod._hour < 12)
return _date.julianDay - 1;
else
return _date.julianDay;
}
unittest
{
assert(DateTime(Date(-4713, 11, 24), TimeOfDay(0, 0, 0)).julianDay == -1);
assert(DateTime(Date(-4713, 11, 24), TimeOfDay(12, 0, 0)).julianDay == 0);
assert(DateTime(Date(0, 12, 31), TimeOfDay(0, 0, 0)).julianDay == 1_721_424);
assert(DateTime(Date(0, 12, 31), TimeOfDay(12, 0, 0)).julianDay == 1_721_425);
assert(DateTime(Date(1, 1, 1), TimeOfDay(0, 0, 0)).julianDay == 1_721_425);
assert(DateTime(Date(1, 1, 1), TimeOfDay(12, 0, 0)).julianDay == 1_721_426);
assert(DateTime(Date(1582, 10, 15), TimeOfDay(0, 0, 0)).julianDay == 2_299_160);
assert(DateTime(Date(1582, 10, 15), TimeOfDay(12, 0, 0)).julianDay == 2_299_161);
assert(DateTime(Date(1858, 11, 17), TimeOfDay(0, 0, 0)).julianDay == 2_400_000);
assert(DateTime(Date(1858, 11, 17), TimeOfDay(12, 0, 0)).julianDay == 2_400_001);
assert(DateTime(Date(1982, 1, 4), TimeOfDay(0, 0, 0)).julianDay == 2_444_973);
assert(DateTime(Date(1982, 1, 4), TimeOfDay(12, 0, 0)).julianDay == 2_444_974);
assert(DateTime(Date(1996, 3, 31), TimeOfDay(0, 0, 0)).julianDay == 2_450_173);
assert(DateTime(Date(1996, 3, 31), TimeOfDay(12, 0, 0)).julianDay == 2_450_174);
assert(DateTime(Date(2010, 8, 24), TimeOfDay(0, 0, 0)).julianDay == 2_455_432);
assert(DateTime(Date(2010, 8, 24), TimeOfDay(12, 0, 0)).julianDay == 2_455_433);
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt.julianDay));
static assert(__traits(compiles, idt.julianDay));
}
/++
The modified $(WEB 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 pure nothrow
{
return _date.modJulianDay;
}
unittest
{
assert(DateTime(Date(1858, 11, 17), TimeOfDay(0, 0, 0)).modJulianDay == 0);
assert(DateTime(Date(1858, 11, 17), TimeOfDay(12, 0, 0)).modJulianDay == 0);
assert(DateTime(Date(2010, 8, 24), TimeOfDay(0, 0, 0)).modJulianDay == 55_432);
assert(DateTime(Date(2010, 8, 24), TimeOfDay(12, 0, 0)).modJulianDay == 55_432);
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, cdt.modJulianDay));
static assert(__traits(compiles, idt.modJulianDay));
}
/++
Converts this $(LREF DateTime) to a string with the format YYYYMMDDTHHMMSS.
+/
string toISOString() @safe const pure nothrow
{
import std.format : format;
try
return format("%sT%s", _date.toISOString(), _tod.toISOString());
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)).toISOString() ==
"20100704T070612");
assert(DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)).toISOString() ==
"19981225T021500");
assert(DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)).toISOString() ==
"00000105T230959");
assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toISOString() ==
"-00040105T000002");
}
unittest
{
//Test A.D.
assert(DateTime(Date(9, 12, 4), TimeOfDay(0, 0, 0)).toISOString() == "00091204T000000");
assert(DateTime(Date(99, 12, 4), TimeOfDay(5, 6, 12)).toISOString() == "00991204T050612");
assert(DateTime(Date(999, 12, 4), TimeOfDay(13, 44, 59)).toISOString() == "09991204T134459");
assert(DateTime(Date(9999, 7, 4), TimeOfDay(23, 59, 59)).toISOString() == "99990704T235959");
assert(DateTime(Date(10000, 10, 20), TimeOfDay(1, 1, 1)).toISOString() == "+100001020T010101");
//Test B.C.
assert(DateTime(Date(0, 12, 4), TimeOfDay(0, 12, 4)).toISOString() == "00001204T001204");
assert(DateTime(Date(-9, 12, 4), TimeOfDay(0, 0, 0)).toISOString() == "-00091204T000000");
assert(DateTime(Date(-99, 12, 4), TimeOfDay(5, 6, 12)).toISOString() == "-00991204T050612");
assert(DateTime(Date(-999, 12, 4), TimeOfDay(13, 44, 59)).toISOString() == "-09991204T134459");
assert(DateTime(Date(-9999, 7, 4), TimeOfDay(23, 59, 59)).toISOString() == "-99990704T235959");
assert(DateTime(Date(-10000, 10, 20), TimeOfDay(1, 1, 1)).toISOString() == "-100001020T010101");
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.toISOString()));
static assert(__traits(compiles, idt.toISOString()));
}
/++
Converts this $(LREF DateTime) to a string with the format
YYYY-MM-DDTHH:MM:SS.
+/
string toISOExtString() @safe const pure nothrow
{
import std.format : format;
try
return format("%sT%s", _date.toISOExtString(), _tod.toISOExtString());
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)).toISOExtString() ==
"2010-07-04T07:06:12");
assert(DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)).toISOExtString() ==
"1998-12-25T02:15:00");
assert(DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)).toISOExtString() ==
"0000-01-05T23:09:59");
assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toISOExtString() ==
"-0004-01-05T00:00:02");
}
unittest
{
//Test A.D.
assert(DateTime(Date(9, 12, 4), TimeOfDay(0, 0, 0)).toISOExtString() == "0009-12-04T00:00:00");
assert(DateTime(Date(99, 12, 4), TimeOfDay(5, 6, 12)).toISOExtString() == "0099-12-04T05:06:12");
assert(DateTime(Date(999, 12, 4), TimeOfDay(13, 44, 59)).toISOExtString() == "0999-12-04T13:44:59");
assert(DateTime(Date(9999, 7, 4), TimeOfDay(23, 59, 59)).toISOExtString() == "9999-07-04T23:59:59");
assert(DateTime(Date(10000, 10, 20), TimeOfDay(1, 1, 1)).toISOExtString() == "+10000-10-20T01:01:01");
//Test B.C.
assert(DateTime(Date(0, 12, 4), TimeOfDay(0, 12, 4)).toISOExtString() == "0000-12-04T00:12:04");
assert(DateTime(Date(-9, 12, 4), TimeOfDay(0, 0, 0)).toISOExtString() == "-0009-12-04T00:00:00");
assert(DateTime(Date(-99, 12, 4), TimeOfDay(5, 6, 12)).toISOExtString() == "-0099-12-04T05:06:12");
assert(DateTime(Date(-999, 12, 4), TimeOfDay(13, 44, 59)).toISOExtString() == "-0999-12-04T13:44:59");
assert(DateTime(Date(-9999, 7, 4), TimeOfDay(23, 59, 59)).toISOExtString() == "-9999-07-04T23:59:59");
assert(DateTime(Date(-10000, 10, 20), TimeOfDay(1, 1, 1)).toISOExtString() == "-10000-10-20T01:01:01");
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.toISOExtString()));
static assert(__traits(compiles, idt.toISOExtString()));
}
/++
Converts this $(LREF DateTime) to a string with the format
YYYY-Mon-DD HH:MM:SS.
+/
string toSimpleString() @safe const pure nothrow
{
import std.format : format;
try
return format("%s %s", _date.toSimpleString(), _tod.toString());
catch(Exception e)
assert(0, "format() threw.");
}
///
unittest
{
assert(DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)).toSimpleString() ==
"2010-Jul-04 07:06:12");
assert(DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)).toSimpleString() ==
"1998-Dec-25 02:15:00");
assert(DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)).toSimpleString() ==
"0000-Jan-05 23:09:59");
assert(DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)).toSimpleString() ==
"-0004-Jan-05 00:00:02");
}
unittest
{
//Test A.D.
assert(DateTime(Date(9, 12, 4), TimeOfDay(0, 0, 0)).toSimpleString() == "0009-Dec-04 00:00:00");
assert(DateTime(Date(99, 12, 4), TimeOfDay(5, 6, 12)).toSimpleString() == "0099-Dec-04 05:06:12");
assert(DateTime(Date(999, 12, 4), TimeOfDay(13, 44, 59)).toSimpleString() == "0999-Dec-04 13:44:59");
assert(DateTime(Date(9999, 7, 4), TimeOfDay(23, 59, 59)).toSimpleString() == "9999-Jul-04 23:59:59");
assert(DateTime(Date(10000, 10, 20), TimeOfDay(1, 1, 1)).toSimpleString() == "+10000-Oct-20 01:01:01");
//Test B.C.
assert(DateTime(Date(0, 12, 4), TimeOfDay(0, 12, 4)).toSimpleString() == "0000-Dec-04 00:12:04");
assert(DateTime(Date(-9, 12, 4), TimeOfDay(0, 0, 0)).toSimpleString() == "-0009-Dec-04 00:00:00");
assert(DateTime(Date(-99, 12, 4), TimeOfDay(5, 6, 12)).toSimpleString() == "-0099-Dec-04 05:06:12");
assert(DateTime(Date(-999, 12, 4), TimeOfDay(13, 44, 59)).toSimpleString() == "-0999-Dec-04 13:44:59");
assert(DateTime(Date(-9999, 7, 4), TimeOfDay(23, 59, 59)).toSimpleString() == "-9999-Jul-04 23:59:59");
assert(DateTime(Date(-10000, 10, 20), TimeOfDay(1, 1, 1)).toSimpleString() == "-10000-Oct-20 01:01:01");
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(__traits(compiles, cdt.toSimpleString()));
static assert(__traits(compiles, idt.toSimpleString()));
}
/++
Converts this $(LREF DateTime) to a string.
+/
string toString() @safe const pure nothrow
{
return toSimpleString();
}
unittest
{
auto dt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
const cdt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
immutable idt = DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33));
static assert(__traits(compiles, dt.toString()));
static assert(__traits(compiles, cdt.toString()));
static assert(__traits(compiles, idt.toString()));
}
/++
Creates a $(LREF DateTime) from a string with the format YYYYMMDDTHHMMSS.
Whitespace is stripped from the given string.
Params:
isoString = A string formatted in the ISO format for dates and times.
Throws:
$(LREF DateTimeException) if the given string is not in the ISO format
or if the resulting $(LREF DateTime) would not be valid.
+/
static DateTime fromISOString(S)(in S isoString) @safe pure
if(isSomeString!S)
{
import std.string : strip;
import std.conv : to;
import std.algorithm : countUntil;
import std.format : format;
immutable dstr = to!dstring(strip(isoString));
enforce(dstr.length >= 15, new DateTimeException(format("Invalid ISO String: %s", isoString)));
auto t = dstr.countUntil('T');
enforce(t != -1, new DateTimeException(format("Invalid ISO String: %s", isoString)));
immutable date = Date.fromISOString(dstr[0..t]);
immutable tod = TimeOfDay.fromISOString(dstr[t+1 .. $]);
return DateTime(date, tod);
}
///
unittest
{
assert(DateTime.fromISOString("20100704T070612") ==
DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
assert(DateTime.fromISOString("19981225T021500") ==
DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)));
assert(DateTime.fromISOString("00000105T230959") ==
DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)));
assert(DateTime.fromISOString("-00040105T000002") ==
DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)));
assert(DateTime.fromISOString(" 20100704T070612 ") ==
DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
}
unittest
{
assertThrown!DateTimeException(DateTime.fromISOString(""));
assertThrown!DateTimeException(DateTime.fromISOString("20100704000000"));
assertThrown!DateTimeException(DateTime.fromISOString("20100704 000000"));
assertThrown!DateTimeException(DateTime.fromISOString("20100704t000000"));
assertThrown!DateTimeException(DateTime.fromISOString("20100704T000000."));
assertThrown!DateTimeException(DateTime.fromISOString("20100704T000000.0"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-0400:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04t00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04T00:00:00."));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04T00:00:00.0"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-0400:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04 00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04t00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04T00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04 00:00:00."));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04 00:00:00.0"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-12-22T172201"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Dec-22 17:22:01"));
assert(DateTime.fromISOString("20101222T172201") == DateTime(Date(2010, 12, 22), TimeOfDay(17, 22, 01)));
assert(DateTime.fromISOString("19990706T123033") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOString("-19990706T123033") == DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOString("+019990706T123033") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOString("19990706T123033 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOString(" 19990706T123033") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOString(" 19990706T123033 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
}
/++
Creates a $(LREF DateTime) from a string with the format
YYYY-MM-DDTHH:MM:SS. Whitespace is stripped from the given string.
Params:
isoExtString = A string formatted in the ISO Extended format for dates
and times.
Throws:
$(LREF DateTimeException) if the given string is not in the ISO
Extended format or if the resulting $(LREF DateTime) would not be
valid.
+/
static DateTime fromISOExtString(S)(in S isoExtString) @safe pure
if(isSomeString!(S))
{
import std.string : strip;
import std.conv : to;
import std.algorithm : countUntil;
import std.format : format;
immutable dstr = to!dstring(strip(isoExtString));
enforce(dstr.length >= 15, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
auto t = dstr.countUntil('T');
enforce(t != -1, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
immutable date = Date.fromISOExtString(dstr[0..t]);
immutable tod = TimeOfDay.fromISOExtString(dstr[t+1 .. $]);
return DateTime(date, tod);
}
///
unittest
{
assert(DateTime.fromISOExtString("2010-07-04T07:06:12") ==
DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
assert(DateTime.fromISOExtString("1998-12-25T02:15:00") ==
DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)));
assert(DateTime.fromISOExtString("0000-01-05T23:09:59") ==
DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)));
assert(DateTime.fromISOExtString("-0004-01-05T00:00:02") ==
DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)));
assert(DateTime.fromISOExtString(" 2010-07-04T07:06:12 ") ==
DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
}
unittest
{
assertThrown!DateTimeException(DateTime.fromISOExtString(""));
assertThrown!DateTimeException(DateTime.fromISOExtString("20100704000000"));
assertThrown!DateTimeException(DateTime.fromISOExtString("20100704 000000"));
assertThrown!DateTimeException(DateTime.fromISOExtString("20100704t000000"));
assertThrown!DateTimeException(DateTime.fromISOExtString("20100704T000000."));
assertThrown!DateTimeException(DateTime.fromISOExtString("20100704T000000.0"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-07:0400:00:00"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-07-04t00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-07-04T00:00:00."));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-07-04T00:00:00.0"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-Jul-0400:00:00"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-Jul-04t00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-Jul-04 00:00:00."));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-Jul-04 00:00:00.0"));
assertThrown!DateTimeException(DateTime.fromISOExtString("20101222T172201"));
assertThrown!DateTimeException(DateTime.fromISOExtString("2010-Dec-22 17:22:01"));
assert(DateTime.fromISOExtString("2010-12-22T17:22:01") == DateTime(Date(2010, 12, 22), TimeOfDay(17, 22, 01)));
assert(DateTime.fromISOExtString("1999-07-06T12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOExtString("-1999-07-06T12:30:33") == DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOExtString("+01999-07-06T12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOExtString("1999-07-06T12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOExtString(" 1999-07-06T12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromISOExtString(" 1999-07-06T12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
}
/++
Creates a $(LREF DateTime) from a string with the format
YYYY-Mon-DD HH:MM:SS. Whitespace is stripped from the given string.
Params:
simpleString = A string formatted in the way that toSimpleString
formats dates and times.
Throws:
$(LREF DateTimeException) if the given string is not in the correct
format or if the resulting $(LREF DateTime) would not be valid.
+/
static DateTime fromSimpleString(S)(in S simpleString) @safe pure
if(isSomeString!(S))
{
import std.string : strip;
import std.conv : to;
import std.algorithm : countUntil;
import std.format : format;
immutable dstr = to!dstring(strip(simpleString));
enforce(dstr.length >= 15, new DateTimeException(format("Invalid string format: %s", simpleString)));
auto t = dstr.countUntil(' ');
enforce(t != -1, new DateTimeException(format("Invalid string format: %s", simpleString)));
immutable date = Date.fromSimpleString(dstr[0..t]);
immutable tod = TimeOfDay.fromISOExtString(dstr[t+1 .. $]);
return DateTime(date, tod);
}
///
unittest
{
assert(DateTime.fromSimpleString("2010-Jul-04 07:06:12") ==
DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
assert(DateTime.fromSimpleString("1998-Dec-25 02:15:00") ==
DateTime(Date(1998, 12, 25), TimeOfDay(2, 15, 0)));
assert(DateTime.fromSimpleString("0000-Jan-05 23:09:59") ==
DateTime(Date(0, 1, 5), TimeOfDay(23, 9, 59)));
assert(DateTime.fromSimpleString("-0004-Jan-05 00:00:02") ==
DateTime(Date(-4, 1, 5), TimeOfDay(0, 0, 2)));
assert(DateTime.fromSimpleString(" 2010-Jul-04 07:06:12 ") ==
DateTime(Date(2010, 7, 4), TimeOfDay(7, 6, 12)));
}
unittest
{
assertThrown!DateTimeException(DateTime.fromISOString(""));
assertThrown!DateTimeException(DateTime.fromISOString("20100704000000"));
assertThrown!DateTimeException(DateTime.fromISOString("20100704 000000"));
assertThrown!DateTimeException(DateTime.fromISOString("20100704t000000"));
assertThrown!DateTimeException(DateTime.fromISOString("20100704T000000."));
assertThrown!DateTimeException(DateTime.fromISOString("20100704T000000.0"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-0400:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04 00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04t00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04T00:00:00."));
assertThrown!DateTimeException(DateTime.fromISOString("2010-07-04T00:00:00.0"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-0400:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04 00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04t00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04T00:00:00"));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04 00:00:00."));
assertThrown!DateTimeException(DateTime.fromISOString("2010-Jul-04 00:00:00.0"));
assertThrown!DateTimeException(DateTime.fromSimpleString("20101222T172201"));
assertThrown!DateTimeException(DateTime.fromSimpleString("2010-12-22T172201"));
assert(DateTime.fromSimpleString("2010-Dec-22 17:22:01") == DateTime(Date(2010, 12, 22), TimeOfDay(17, 22, 01)));
assert(DateTime.fromSimpleString("1999-Jul-06 12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromSimpleString("-1999-Jul-06 12:30:33") == DateTime(Date(-1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromSimpleString("+01999-Jul-06 12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromSimpleString("1999-Jul-06 12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromSimpleString(" 1999-Jul-06 12:30:33") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
assert(DateTime.fromSimpleString(" 1999-Jul-06 12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33)));
}
/++
Returns the $(LREF DateTime) farthest in the past which is representable by
$(LREF DateTime).
+/
@property static DateTime min() @safe pure nothrow
out(result)
{
assert(result._date == Date.min);
assert(result._tod == TimeOfDay.min);
}
body
{
auto dt = DateTime.init;
dt._date._year = short.min;
dt._date._month = Month.jan;
dt._date._day = 1;
return dt;
}
unittest
{
assert(DateTime.min.year < 0);
assert(DateTime.min < DateTime.max);
}
/++
Returns the $(LREF DateTime) farthest in the future which is representable
by $(LREF DateTime).
+/
@property static DateTime max() @safe pure nothrow
out(result)
{
assert(result._date == Date.max);
assert(result._tod == TimeOfDay.max);
}
body
{
auto dt = DateTime.init;
dt._date._year = short.max;
dt._date._month = Month.dec;
dt._date._day = 31;
dt._tod._hour = TimeOfDay.maxHour;
dt._tod._minute = TimeOfDay.maxMinute;
dt._tod._second = TimeOfDay.maxSecond;
return dt;
}
unittest
{
assert(DateTime.max.year > 0);
assert(DateTime.max > DateTime.min);
}
private:
/+
Add seconds to the time of day. Negative values will subtract. If the
number of seconds overflows (or underflows), then the seconds will wrap,
increasing (or decreasing) the number of minutes accordingly. The
same goes for any larger units.
Params:
seconds = The number of seconds to add to this $(LREF DateTime).
+/
ref DateTime _addSeconds(long seconds) return @safe pure nothrow
{
long hnsecs = convert!("seconds", "hnsecs")(seconds);
hnsecs += convert!("hours", "hnsecs")(_tod._hour);
hnsecs += convert!("minutes", "hnsecs")(_tod._minute);
hnsecs += convert!("seconds", "hnsecs")(_tod._second);
auto days = splitUnitsFromHNSecs!"days"(hnsecs);
if(hnsecs < 0)
{
hnsecs += convert!("days", "hnsecs")(1);
--days;
}
_date._addDays(days);
immutable newHours = splitUnitsFromHNSecs!"hours"(hnsecs);
immutable newMinutes = splitUnitsFromHNSecs!"minutes"(hnsecs);
immutable newSeconds = splitUnitsFromHNSecs!"seconds"(hnsecs);
_tod._hour = cast(ubyte)newHours;
_tod._minute = cast(ubyte)newMinutes;
_tod._second = cast(ubyte)newSeconds;
return this;
}
unittest
{
static void testDT(DateTime orig, int seconds, in DateTime expected, size_t line = __LINE__)
{
orig._addSeconds(seconds);
assert(orig == expected);
}
//Test A.D.
testDT(DateTime(1999, 7, 6, 12, 30, 33), 0, DateTime(1999, 7, 6, 12, 30, 33));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 1, DateTime(1999, 7, 6, 12, 30, 34));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 2, DateTime(1999, 7, 6, 12, 30, 35));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 3, DateTime(1999, 7, 6, 12, 30, 36));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 4, DateTime(1999, 7, 6, 12, 30, 37));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 5, DateTime(1999, 7, 6, 12, 30, 38));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 10, DateTime(1999, 7, 6, 12, 30, 43));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 15, DateTime(1999, 7, 6, 12, 30, 48));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 26, DateTime(1999, 7, 6, 12, 30, 59));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 27, DateTime(1999, 7, 6, 12, 31, 0));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 30, DateTime(1999, 7, 6, 12, 31, 3));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 59, DateTime(1999, 7, 6, 12, 31, 32));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 60, DateTime(1999, 7, 6, 12, 31, 33));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 61, DateTime(1999, 7, 6, 12, 31, 34));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 1766, DateTime(1999, 7, 6, 12, 59, 59));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 1767, DateTime(1999, 7, 6, 13, 0, 0));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 1768, DateTime(1999, 7, 6, 13, 0, 1));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 2007, DateTime(1999, 7, 6, 13, 4, 0));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 3599, DateTime(1999, 7, 6, 13, 30, 32));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 3600, DateTime(1999, 7, 6, 13, 30, 33));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 3601, DateTime(1999, 7, 6, 13, 30, 34));
testDT(DateTime(1999, 7, 6, 12, 30, 33), 7200, DateTime(1999, 7, 6, 14, 30, 33));
testDT(DateTime(1999, 7, 6, 23, 0, 0), 432_123, DateTime(1999, 7, 11, 23, 2, 3));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -1, DateTime(1999, 7, 6, 12, 30, 32));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -2, DateTime(1999, 7, 6, 12, 30, 31));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -3, DateTime(1999, 7, 6, 12, 30, 30));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -4, DateTime(1999, 7, 6, 12, 30, 29));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -5, DateTime(1999, 7, 6, 12, 30, 28));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -10, DateTime(1999, 7, 6, 12, 30, 23));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -15, DateTime(1999, 7, 6, 12, 30, 18));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -33, DateTime(1999, 7, 6, 12, 30, 0));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -34, DateTime(1999, 7, 6, 12, 29, 59));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -35, DateTime(1999, 7, 6, 12, 29, 58));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -59, DateTime(1999, 7, 6, 12, 29, 34));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -60, DateTime(1999, 7, 6, 12, 29, 33));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -61, DateTime(1999, 7, 6, 12, 29, 32));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -1833, DateTime(1999, 7, 6, 12, 0, 0));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -1834, DateTime(1999, 7, 6, 11, 59, 59));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -3600, DateTime(1999, 7, 6, 11, 30, 33));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -3601, DateTime(1999, 7, 6, 11, 30, 32));
testDT(DateTime(1999, 7, 6, 12, 30, 33), -5134, DateTime(1999, 7, 6, 11, 4, 59));
testDT(DateTime(1999, 7, 6, 23, 0, 0), -432_123, DateTime(1999, 7, 1, 22, 57, 57));
testDT(DateTime(1999, 7, 6, 12, 30, 0), 1, DateTime(1999, 7, 6, 12, 30, 1));
testDT(DateTime(1999, 7, 6, 12, 30, 0), 0, DateTime(1999, 7, 6, 12, 30, 0));
testDT(DateTime(1999, 7, 6, 12, 30, 0), -1, DateTime(1999, 7, 6, 12, 29, 59));
testDT(DateTime(1999, 7, 6, 12, 0, 0), 1, DateTime(1999, 7, 6, 12, 0, 1));
testDT(DateTime(1999, 7, 6, 12, 0, 0), 0, DateTime(1999, 7, 6, 12, 0, 0));
testDT(DateTime(1999, 7, 6, 12, 0, 0), -1, DateTime(1999, 7, 6, 11, 59, 59));
testDT(DateTime(1999, 7, 6, 0, 0, 0), 1, DateTime(1999, 7, 6, 0, 0, 1));
testDT(DateTime(1999, 7, 6, 0, 0, 0), 0, DateTime(1999, 7, 6, 0, 0, 0));
testDT(DateTime(1999, 7, 6, 0, 0, 0), -1, DateTime(1999, 7, 5, 23, 59, 59));
testDT(DateTime(1999, 7, 5, 23, 59, 59), 1, DateTime(1999, 7, 6, 0, 0, 0));
testDT(DateTime(1999, 7, 5, 23, 59, 59), 0, DateTime(1999, 7, 5, 23, 59, 59));
testDT(DateTime(1999, 7, 5, 23, 59, 59), -1, DateTime(1999, 7, 5, 23, 59, 58));
testDT(DateTime(1998, 12, 31, 23, 59, 59), 1, DateTime(1999, 1, 1, 0, 0, 0));
testDT(DateTime(1998, 12, 31, 23, 59, 59), 0, DateTime(1998, 12, 31, 23, 59, 59));
testDT(DateTime(1998, 12, 31, 23, 59, 59), -1, DateTime(1998, 12, 31, 23, 59, 58));
testDT(DateTime(1998, 1, 1, 0, 0, 0), 1, DateTime(1998, 1, 1, 0, 0, 1));
testDT(DateTime(1998, 1, 1, 0, 0, 0), 0, DateTime(1998, 1, 1, 0, 0, 0));
testDT(DateTime(1998, 1, 1, 0, 0, 0), -1, DateTime(1997, 12, 31, 23, 59, 59));
//Test B.C.
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 0, DateTime(-1999, 7, 6, 12, 30, 33));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 1, DateTime(-1999, 7, 6, 12, 30, 34));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 2, DateTime(-1999, 7, 6, 12, 30, 35));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 3, DateTime(-1999, 7, 6, 12, 30, 36));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 4, DateTime(-1999, 7, 6, 12, 30, 37));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 5, DateTime(-1999, 7, 6, 12, 30, 38));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 10, DateTime(-1999, 7, 6, 12, 30, 43));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 15, DateTime(-1999, 7, 6, 12, 30, 48));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 26, DateTime(-1999, 7, 6, 12, 30, 59));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 27, DateTime(-1999, 7, 6, 12, 31, 0));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 30, DateTime(-1999, 7, 6, 12, 31, 3));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 59, DateTime(-1999, 7, 6, 12, 31, 32));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 60, DateTime(-1999, 7, 6, 12, 31, 33));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 61, DateTime(-1999, 7, 6, 12, 31, 34));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 1766, DateTime(-1999, 7, 6, 12, 59, 59));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 1767, DateTime(-1999, 7, 6, 13, 0, 0));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 1768, DateTime(-1999, 7, 6, 13, 0, 1));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 2007, DateTime(-1999, 7, 6, 13, 4, 0));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 3599, DateTime(-1999, 7, 6, 13, 30, 32));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 3600, DateTime(-1999, 7, 6, 13, 30, 33));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 3601, DateTime(-1999, 7, 6, 13, 30, 34));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), 7200, DateTime(-1999, 7, 6, 14, 30, 33));
testDT(DateTime(-1999, 7, 6, 23, 0, 0), 432_123, DateTime(-1999, 7, 11, 23, 2, 3));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -1, DateTime(-1999, 7, 6, 12, 30, 32));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -2, DateTime(-1999, 7, 6, 12, 30, 31));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -3, DateTime(-1999, 7, 6, 12, 30, 30));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -4, DateTime(-1999, 7, 6, 12, 30, 29));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -5, DateTime(-1999, 7, 6, 12, 30, 28));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -10, DateTime(-1999, 7, 6, 12, 30, 23));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -15, DateTime(-1999, 7, 6, 12, 30, 18));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -33, DateTime(-1999, 7, 6, 12, 30, 0));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -34, DateTime(-1999, 7, 6, 12, 29, 59));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -35, DateTime(-1999, 7, 6, 12, 29, 58));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -59, DateTime(-1999, 7, 6, 12, 29, 34));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -60, DateTime(-1999, 7, 6, 12, 29, 33));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -61, DateTime(-1999, 7, 6, 12, 29, 32));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -1833, DateTime(-1999, 7, 6, 12, 0, 0));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -1834, DateTime(-1999, 7, 6, 11, 59, 59));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -3600, DateTime(-1999, 7, 6, 11, 30, 33));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -3601, DateTime(-1999, 7, 6, 11, 30, 32));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -5134, DateTime(-1999, 7, 6, 11, 4, 59));
testDT(DateTime(-1999, 7, 6, 12, 30, 33), -7200, DateTime(-1999, 7, 6, 10, 30, 33));
testDT(DateTime(-1999, 7, 6, 23, 0, 0), -432_123, DateTime(-1999, 7, 1, 22, 57, 57));
testDT(DateTime(-1999, 7, 6, 12, 30, 0), 1, DateTime(-1999, 7, 6, 12, 30, 1));
testDT(DateTime(-1999, 7, 6, 12, 30, 0), 0, DateTime(-1999, 7, 6, 12, 30, 0));
testDT(DateTime(-1999, 7, 6, 12, 30, 0), -1, DateTime(-1999, 7, 6, 12, 29, 59));
testDT(DateTime(-1999, 7, 6, 12, 0, 0), 1, DateTime(-1999, 7, 6, 12, 0, 1));
testDT(DateTime(-1999, 7, 6, 12, 0, 0), 0, DateTime(-1999, 7, 6, 12, 0, 0));
testDT(DateTime(-1999, 7, 6, 12, 0, 0), -1, DateTime(-1999, 7, 6, 11, 59, 59));
testDT(DateTime(-1999, 7, 6, 0, 0, 0), 1, DateTime(-1999, 7, 6, 0, 0, 1));
testDT(DateTime(-1999, 7, 6, 0, 0, 0), 0, DateTime(-1999, 7, 6, 0, 0, 0));
testDT(DateTime(-1999, 7, 6, 0, 0, 0), -1, DateTime(-1999, 7, 5, 23, 59, 59));
testDT(DateTime(-1999, 7, 5, 23, 59, 59), 1, DateTime(-1999, 7, 6, 0, 0, 0));
testDT(DateTime(-1999, 7, 5, 23, 59, 59), 0, DateTime(-1999, 7, 5, 23, 59, 59));
testDT(DateTime(-1999, 7, 5, 23, 59, 59), -1, DateTime(-1999, 7, 5, 23, 59, 58));
testDT(DateTime(-2000, 12, 31, 23, 59, 59), 1, DateTime(-1999, 1, 1, 0, 0, 0));
testDT(DateTime(-2000, 12, 31, 23, 59, 59), 0, DateTime(-2000, 12, 31, 23, 59, 59));
testDT(DateTime(-2000, 12, 31, 23, 59, 59), -1, DateTime(-2000, 12, 31, 23, 59, 58));
testDT(DateTime(-2000, 1, 1, 0, 0, 0), 1, DateTime(-2000, 1, 1, 0, 0, 1));
testDT(DateTime(-2000, 1, 1, 0, 0, 0), 0, DateTime(-2000, 1, 1, 0, 0, 0));
testDT(DateTime(-2000, 1, 1, 0, 0, 0), -1, DateTime(-2001, 12, 31, 23, 59, 59));
//Test Both
testDT(DateTime(1, 1, 1, 0, 0, 0), -1, DateTime(0, 12, 31, 23, 59, 59));
testDT(DateTime(0, 12, 31, 23, 59, 59), 1, DateTime(1, 1, 1, 0, 0, 0));
testDT(DateTime(0, 1, 1, 0, 0, 0), -1, DateTime(-1, 12, 31, 23, 59, 59));
testDT(DateTime(-1, 12, 31, 23, 59, 59), 1, DateTime(0, 1, 1, 0, 0, 0));
testDT(DateTime(-1, 1, 1, 11, 30, 33), 63_165_600L, DateTime(1, 1, 1, 13, 30, 33));
testDT(DateTime(1, 1, 1, 13, 30, 33), -63_165_600L, DateTime(-1, 1, 1, 11, 30, 33));
testDT(DateTime(-1, 1, 1, 11, 30, 33), 63_165_617L, DateTime(1, 1, 1, 13, 30, 50));
testDT(DateTime(1, 1, 1, 13, 30, 50), -63_165_617L, DateTime(-1, 1, 1, 11, 30, 33));
const cdt = DateTime(1999, 7, 6, 12, 30, 33);
immutable idt = DateTime(1999, 7, 6, 12, 30, 33);
static assert(!__traits(compiles, cdt._addSeconds(4)));
static assert(!__traits(compiles, idt._addSeconds(4)));
}
Date _date;
TimeOfDay _tod;
}
//==============================================================================
// Section with intervals.
//==============================================================================
/++
Represents an interval of time.
An $(D Interval) has a starting point and an end point. The interval of time
is therefore the time starting at the starting point up to, but not
including, the end point. e.g.
$(BOOKTABLE,
$(TR $(TD [January 5th, 2010 - March 10th, 2010$(RPAREN)))
$(TR $(TD [05:00:30 - 12:00:00$(RPAREN)))
$(TR $(TD [1982-01-04T08:59:00 - 2010-07-04T12:00:00$(RPAREN)))
)
A range can be obtained from an $(D Interval), allowing iteration over
that interval, with the exact time points which are iterated over depending
on the function which generates the range.
+/
struct Interval(TP)
{
public:
/++
Params:
begin = The time point which begins the interval.
end = The time point which ends (but is not included in) the
interval.
Throws:
$(LREF DateTimeException) if $(D_PARAM end) is before $(D_PARAM begin).
Examples:
--------------------
Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
--------------------
+/
this(U)(in TP begin, in U end) pure
if(is(Unqual!TP == Unqual!U))
{
if(!_valid(begin, end))
throw new DateTimeException("Arguments would result in an invalid Interval.");
_begin = cast(TP)begin;
_end = cast(TP)end;
}
/++
Params:
begin = The time point which begins the interval.
duration = The duration from the starting point to the end point.
Throws:
$(LREF DateTimeException) if the resulting $(D end) is before
$(D begin).
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), dur!"years"(3)) ==
Interval!Date(Date(1996, 1, 2), Date(1999, 1, 2)));
--------------------
+/
this(D)(in TP begin, in D duration) pure
if(__traits(compiles, begin + duration))
{
_begin = cast(TP)begin;
_end = begin + duration;
if(!_valid(_begin, _end))
throw new DateTimeException("Arguments would result in an invalid Interval.");
}
/++
Params:
rhs = The $(LREF2 .Interval, Interval) to assign to this one.
+/
ref Interval opAssign(const ref Interval rhs) pure nothrow
{
_begin = cast(TP)rhs._begin;
_end = cast(TP)rhs._end;
return this;
}
/++
Params:
rhs = The $(LREF2 .Interval, Interval) to assign to this one.
+/
ref Interval opAssign(Interval rhs) pure nothrow
{
_begin = cast(TP)rhs._begin;
_end = cast(TP)rhs._end;
return this;
}
/++
The starting point of the interval. It is included in the interval.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).begin ==
Date(1996, 1, 2));
--------------------
+/
@property TP begin() const pure nothrow
{
return cast(TP)_begin;
}
/++
The starting point of the interval. It is included in the interval.
Params:
timePoint = The time point to set $(D begin) to.
Throws:
$(LREF DateTimeException) if the resulting interval would be invalid.
+/
@property void begin(TP timePoint) pure
{
if(!_valid(timePoint, _end))
throw new DateTimeException("Arguments would result in an invalid Interval.");
_begin = timePoint;
}
/++
The end point of the interval. It is excluded from the interval.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).end ==
Date(2012, 3, 1));
--------------------
+/
@property TP end() const pure nothrow
{
return cast(TP)_end;
}
/++
The end point of the interval. It is excluded from the interval.
Params:
timePoint = The time point to set end to.
Throws:
$(LREF DateTimeException) if the resulting interval would be invalid.
+/
@property void end(TP timePoint) pure
{
if(!_valid(_begin, timePoint))
throw new DateTimeException("Arguments would result in an invalid Interval.");
_end = timePoint;
}
/++
Returns the duration between $(D begin) and $(D end).
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).length ==
dur!"days"(5903));
--------------------
+/
@property auto length() const pure nothrow
{
return _end - _begin;
}
/++
Whether the interval's length is 0, that is, whether $(D begin == end).
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(1996, 1, 2)).empty);
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).empty);
--------------------
+/
@property bool empty() const pure nothrow
{
return _begin == _end;
}
/++
Whether the given time point is within this interval.
Params:
timePoint = The time point to check for inclusion in this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
Date(1994, 12, 24)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
Date(2000, 1, 5)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
Date(2012, 3, 1)));
--------------------
+/
bool contains(in TP timePoint) const pure
{
_enforceNotEmpty();
return timePoint >= _begin && timePoint < _end;
}
/++
Whether the given interval is completely within this interval.
Params:
interval = The interval to check for inclusion in this interval.
Throws:
$(LREF DateTimeException) if either interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
Interval!Date(Date(1998, 2, 28), Date(2013, 5, 1))));
--------------------
+/
bool contains(in Interval interval) const pure
{
_enforceNotEmpty();
interval._enforceNotEmpty();
return interval._begin >= _begin &&
interval._begin < _end &&
interval._end <= _end;
}
/++
Whether the given interval is completely within this interval.
Always returns false (unless this interval is empty), because an
interval going to positive infinity can never be contained in a finite
interval.
Params:
interval = The interval to check for inclusion in this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
PosInfInterval!Date(Date(1999, 5, 4))));
--------------------
+/
bool contains(in PosInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return false;
}
/++
Whether the given interval is completely within this interval.
Always returns false (unless this interval is empty), because an
interval beginning at negative infinity can never be contained in a
finite interval.
Params:
interval = The interval to check for inclusion in this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(
NegInfInterval!Date(Date(1996, 5, 4))));
--------------------
+/
bool contains(in NegInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return false;
}
/++
Whether this interval is before the given time point.
Params:
timePoint = The time point to check whether this interval is before
it.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
Date(1994, 12, 24)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
Date(2000, 1, 5)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
Date(2012, 3, 1)));
--------------------
+/
bool isBefore(in TP timePoint) const pure
{
_enforceNotEmpty();
return _end <= timePoint;
}
/++
Whether this interval is before the given interval and does not
intersect with it.
Params:
interval = The interval to check for against this interval.
Throws:
$(LREF DateTimeException) if either interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
Interval!Date(Date(2012, 3, 1), Date(2013, 5, 1))));
--------------------
+/
bool isBefore(in Interval interval) const pure
{
_enforceNotEmpty();
interval._enforceNotEmpty();
return _end <= interval._begin;
}
/++
Whether this interval is before the given interval and does not
intersect with it.
Params:
interval = The interval to check for against this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
PosInfInterval!Date(Date(2013, 3, 7))));
--------------------
+/
bool isBefore(in PosInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return _end <= interval._begin;
}
/++
Whether this interval is before the given interval and does not
intersect with it.
Always returns false (unless this interval is empty) because a finite
interval can never be before an interval beginning at negative infinity.
Params:
interval = The interval to check for against this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(
NegInfInterval!Date(Date(1996, 5, 4))));
--------------------
+/
bool isBefore(in NegInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return false;
}
/++
Whether this interval is after the given time point.
Params:
timePoint = The time point to check whether this interval is after
it.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
Date(1994, 12, 24)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
Date(2000, 1, 5)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
Date(2012, 3, 1)));
--------------------
+/
bool isAfter(in TP timePoint) const pure
{
_enforceNotEmpty();
return timePoint < _begin;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Params:
interval = The interval to check against this interval.
Throws:
$(LREF DateTimeException) if either interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
--------------------
+/
bool isAfter(in Interval interval) const pure
{
_enforceNotEmpty();
interval._enforceNotEmpty();
return _begin >= interval._end;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Always returns false (unless this interval is empty) because a finite
interval can never be after an interval going to positive infinity.
Params:
interval = The interval to check against this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
PosInfInterval!Date(Date(1999, 5, 4))));
--------------------
+/
bool isAfter(in PosInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return false;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Params:
interval = The interval to check against this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(
NegInfInterval!Date(Date(1996, 1, 2))));
--------------------
+/
bool isAfter(in NegInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return _begin >= interval._end;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this interval.
Throws:
$(LREF DateTimeException) if either interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
--------------------
+/
bool intersects(in Interval interval) const pure
{
_enforceNotEmpty();
interval._enforceNotEmpty();
return interval._begin < _end && interval._end > _begin;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
PosInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool intersects(in PosInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return _end > interval._begin;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
NegInfInterval!Date(Date(1996, 1, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(
NegInfInterval!Date(Date(2000, 1, 2))));
--------------------
+/
bool intersects(in NegInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return _begin < interval._end;
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect or if
either interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
Interval!Date(Date(1996, 1 , 2), Date(2000, 8, 2)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) ==
Interval!Date(Date(1999, 1 , 12), Date(2011, 9, 17)));
--------------------
+/
Interval intersection(in Interval interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
auto begin = _begin > interval._begin ? _begin : interval._begin;
auto end = _end < interval._end ? _end : interval._end;
return Interval(begin, end);
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect or if
this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(
PosInfInterval!Date(Date(1990, 7, 6))) ==
Interval!Date(Date(1996, 1 , 2), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(
PosInfInterval!Date(Date(1999, 1, 12))) ==
Interval!Date(Date(1999, 1 , 12), Date(2012, 3, 1)));
--------------------
+/
Interval intersection(in PosInfInterval!TP interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
return Interval(_begin > interval._begin ? _begin : interval._begin, _end);
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect or if
this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(
NegInfInterval!Date(Date(1999, 7, 6))) ==
Interval!Date(Date(1996, 1 , 2), Date(1999, 7, 6)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(
NegInfInterval!Date(Date(2013, 1, 12))) ==
Interval!Date(Date(1996, 1 , 2), Date(2012, 3, 1)));
--------------------
+/
Interval intersection(in NegInfInterval!TP interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
return Interval(_begin, _end < interval._end ? _end : interval._end);
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Throws:
$(LREF DateTimeException) if either interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(1990, 7, 6), Date(1996, 1, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(2012, 3, 1), Date(2013, 9, 17))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(1989, 3, 1), Date(2012, 3, 1))));
--------------------
+/
bool isAdjacent(in Interval interval) const pure
{
_enforceNotEmpty();
interval._enforceNotEmpty();
return _begin == interval._end || _end == interval._begin;
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
PosInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool isAdjacent(in PosInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return _end == interval._begin;
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
NegInfInterval!Date(Date(1996, 1, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(
NegInfInterval!Date(Date(2000, 1, 2))));
--------------------
+/
bool isAdjacent(in NegInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return _begin == interval._end;
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect and are
not adjacent or if either interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
Interval!Date(Date(1990, 7 , 6), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(
Interval!Date(Date(2012, 3, 1), Date(2013, 5, 7))) ==
Interval!Date(Date(1996, 1 , 2), Date(2013, 5, 7)));
--------------------
+/
Interval merge(in Interval interval) const
{
import std.format : format;
enforce(this.isAdjacent(interval) || this.intersects(interval),
new DateTimeException(format("%s and %s are not adjacent and do not intersect.", this, interval)));
auto begin = _begin < interval._begin ? _begin : interval._begin;
auto end = _end > interval._end ? _end : interval._end;
return Interval(begin, end);
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect and are
not adjacent or if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(
PosInfInterval!Date(Date(1990, 7, 6))) ==
PosInfInterval!Date(Date(1990, 7 , 6)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(
PosInfInterval!Date(Date(2012, 3, 1))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
--------------------
+/
PosInfInterval!TP merge(in PosInfInterval!TP interval) const
{
import std.format : format;
enforce(this.isAdjacent(interval) || this.intersects(interval),
new DateTimeException(format("%s and %s are not adjacent and do not intersect.", this, interval)));
return PosInfInterval!TP(_begin < interval._begin ? _begin : interval._begin);
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect and are not
adjacent or if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(
NegInfInterval!Date(Date(1996, 1, 2))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(
NegInfInterval!Date(Date(2013, 1, 12))) ==
NegInfInterval!Date(Date(2013, 1 , 12)));
--------------------
+/
NegInfInterval!TP merge(in NegInfInterval!TP interval) const
{
import std.format : format;
enforce(this.isAdjacent(interval) || this.intersects(interval),
new DateTimeException(format("%s and %s are not adjacent and do not intersect.", this, interval)));
return NegInfInterval!TP(_end > interval._end ? _end : interval._end);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this interval.
Throws:
$(LREF DateTimeException) if either interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
Interval!Date(Date(1990, 7, 6), Date(1991, 1, 8))) ==
Interval!Date(Date(1990, 7 , 6), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
Interval!Date(Date(2012, 3, 1), Date(2013, 5, 7))) ==
Interval!Date(Date(1996, 1 , 2), Date(2013, 5, 7)));
--------------------
+/
Interval span(in Interval interval) const pure
{
_enforceNotEmpty();
interval._enforceNotEmpty();
auto begin = _begin < interval._begin ? _begin : interval._begin;
auto end = _end > interval._end ? _end : interval._end;
return Interval(begin, end);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
PosInfInterval!Date(Date(1990, 7, 6))) ==
PosInfInterval!Date(Date(1990, 7 , 6)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
PosInfInterval!Date(Date(2050, 1, 1))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
--------------------
+/
PosInfInterval!TP span(in PosInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return PosInfInterval!TP(_begin < interval._begin ? _begin : interval._begin);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this interval.
Throws:
$(LREF DateTimeException) if this interval is empty.
Examples:
--------------------
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
NegInfInterval!Date(Date(1602, 5, 21))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(
NegInfInterval!Date(Date(2013, 1, 12))) ==
NegInfInterval!Date(Date(2013, 1 , 12)));
--------------------
+/
NegInfInterval!TP span(in NegInfInterval!TP interval) const pure
{
_enforceNotEmpty();
return NegInfInterval!TP(_end > interval._end ? _end : interval._end);
}
/++
Shifts the interval forward or backwards in time by the given duration
(a positive duration shifts the interval forward; a negative duration
shifts it backward). Effectively, it does $(D begin += duration) and
$(D end += duration).
Params:
duration = The duration to shift the interval by.
Throws:
$(LREF DateTimeException) this interval is empty or if the resulting
interval would be invalid.
Examples:
--------------------
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 4, 5));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 4, 5));
interval1.shift(dur!"days"(50));
assert(interval1 == Interval!Date(Date(1996, 2, 21), Date(2012, 5, 25)));
interval2.shift(dur!"days"(-50));
assert(interval2 == Interval!Date(Date(1995, 11, 13), Date(2012, 2, 15)));
--------------------
+/
void shift(D)(D duration) pure
if(__traits(compiles, begin + duration))
{
_enforceNotEmpty();
auto begin = _begin + duration;
auto end = _end + duration;
if(!_valid(begin, end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_begin = begin;
_end = end;
}
static if(__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
Shifts the interval forward or backwards in time by the given number
of years and/or months (a positive number of years and months shifts
the interval forward; a negative number shifts it backward).
It adds the years the given years and months to both begin and end.
It effectively calls $(D add!"years"()) and then $(D add!"months"())
on begin and end with the given number of years and months.
Params:
years = The number of years to shift the interval by.
months = The number of months to shift the interval by.
allowOverflow = Whether the days should be allowed to overflow
on $(D begin) and $(D end), causing their month
to increment.
Throws:
$(LREF DateTimeException) if this interval is empty or if the
resulting interval would be invalid.
Examples:
--------------------
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
interval1.shift(2);
assert(interval1 == Interval!Date(Date(1998, 1, 2), Date(2014, 3, 1)));
interval2.shift(-2);
assert(interval2 == Interval!Date(Date(1994, 1, 2), Date(2010, 3, 1)));
--------------------
+/
void shift(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if(isIntegral!T)
{
_enforceNotEmpty();
auto begin = _begin;
auto end = _end;
begin.add!"years"(years, allowOverflow);
begin.add!"months"(months, allowOverflow);
end.add!"years"(years, allowOverflow);
end.add!"months"(months, allowOverflow);
enforce(_valid(begin, end), new DateTimeException("Argument would result in an invalid Interval."));
_begin = begin;
_end = end;
}
}
/++
Expands the interval forwards and/or backwards in time. Effectively,
it does $(D begin -= duration) and/or $(D end += duration). Whether
it expands forwards and/or backwards in time is determined by
$(D_PARAM dir).
Params:
duration = The duration to expand the interval by.
dir = The direction in time to expand the interval.
Throws:
$(LREF DateTimeException) this interval is empty or if the resulting
interval would be invalid.
Examples:
--------------------
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
interval1.expand(2);
assert(interval1 == Interval!Date(Date(1994, 1, 2), Date(2014, 3, 1)));
interval2.expand(-2);
assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
--------------------
+/
void expand(D)(D duration, Direction dir = Direction.both) pure
if(__traits(compiles, begin + duration))
{
_enforceNotEmpty();
switch(dir)
{
case Direction.both:
{
auto begin = _begin - duration;
auto end = _end + duration;
if(!_valid(begin, end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_begin = begin;
_end = end;
return;
}
case Direction.fwd:
{
auto end = _end + duration;
if(!_valid(_begin, end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_end = end;
return;
}
case Direction.bwd:
{
auto begin = _begin - duration;
if(!_valid(begin, _end))
throw new DateTimeException("Argument would result in an invalid Interval.");
_begin = begin;
return;
}
default:
assert(0, "Invalid Direction.");
}
}
static if(__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
Expands the interval forwards and/or backwards in time. Effectively,
it subtracts the given number of months/years from $(D begin) and
adds them to $(D end). Whether it expands forwards and/or backwards
in time is determined by $(D_PARAM dir).
Params:
years = The number of years to expand the interval by.
months = The number of months to expand the interval by.
allowOverflow = Whether the days should be allowed to overflow
on $(D begin) and $(D end), causing their month
to increment.
dir = The direction in time to expand the interval.
Throws:
$(LREF DateTimeException) if this interval is empty or if the
resulting interval would be invalid.
Examples:
--------------------
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
interval1.expand(2);
assert(interval1 == Interval!Date(Date(1994, 1, 2), Date(2014, 3, 1)));
interval2.expand(-2);
assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
--------------------
+/
void expand(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes, Direction dir = Direction.both)
if(isIntegral!T)
{
_enforceNotEmpty();
switch(dir)
{
case Direction.both:
{
auto begin = _begin;
auto end = _end;
begin.add!"years"(-years, allowOverflow);
begin.add!"months"(-months, allowOverflow);
end.add!"years"(years, allowOverflow);
end.add!"months"(months, allowOverflow);
enforce(_valid(begin, end), new DateTimeException("Argument would result in an invalid Interval."));
_begin = begin;
_end = end;
return;
}
case Direction.fwd:
{
auto end = _end;
end.add!"years"(years, allowOverflow);
end.add!"months"(months, allowOverflow);
enforce(_valid(_begin, end), new DateTimeException("Argument would result in an invalid Interval."));
_end = end;
return;
}
case Direction.bwd:
{
auto begin = _begin;
begin.add!"years"(-years, allowOverflow);
begin.add!"months"(-months, allowOverflow);
enforce(_valid(begin, _end), new DateTimeException("Argument would result in an invalid Interval."));
_begin = begin;
return;
}
default:
assert(0, "Invalid Direction.");
}
}
}
/++
Returns a range which iterates forward over the interval, starting
at $(D begin), using $(D_PARAM func) to generate each successive time
point.
The range's $(D front) is the interval's $(D begin). $(D_PARAM func) is
used to generate the next $(D front) when $(D popFront) is called. If
$(D_PARAM popFirst) is $(D PopFirst.yes), then $(D popFront) is called
before the range is returned (so that $(D front) is a time point which
$(D_PARAM func) would generate).
If $(D_PARAM func) ever generates a time point less than or equal to the
current $(D front) of the range, then a $(LREF DateTimeException) will be
thrown. The range will be empty and iteration complete when
$(D_PARAM func) generates a time point equal to or beyond the $(D end)
of the interval.
There are helper functions in this module which generate common
delegates to pass to $(D fwdRange). Their documentation starts with
"Range-generating function," making them easily searchable.
Params:
func = The function used to generate the time points of the
range over the interval.
popFirst = Whether $(D popFront) should be called on the range
before returning it.
Throws:
$(LREF DateTimeException) if this interval is empty.
Warning:
$(D_PARAM func) must be logically pure. Ideally, $(D_PARAM func)
would be a function pointer to a pure function, but forcing
$(D_PARAM func) to be pure is far too restrictive to be useful, and
in order to have the ease of use of having functions which generate
functions to pass to $(D fwdRange), $(D_PARAM func) must be a
delegate.
If $(D_PARAM func) retains state which changes as it is called, then
some algorithms will not work correctly, because the range's
$(D save) will have failed to have really saved the range's state.
To avoid such bugs, don't pass a delegate which is
not logically pure to $(D fwdRange). If $(D_PARAM func) is given the
same time point with two different calls, it must return the same
result both times.
Of course, none of the functions in this module have this problem,
so it's only relevant if when creating a custom delegate.
Examples:
--------------------
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = (in Date date) //For iterating over even-numbered days.
{
if((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
};
auto range = interval.fwdRange(func);
//An odd day. Using PopFirst.yes would have made this Date(2010, 9, 2).
assert(range.front == Date(2010, 9, 1));
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(range.empty);
--------------------
+/
IntervalRange!(TP, Direction.fwd) fwdRange(TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
{
_enforceNotEmpty();
auto range = IntervalRange!(TP, Direction.fwd)(this, func);
if(popFirst == PopFirst.yes)
range.popFront();
return range;
}
/++
Returns a range which iterates backwards over the interval, starting
at $(D end), using $(D_PARAM func) to generate each successive time
point.
The range's $(D front) is the interval's $(D end). $(D_PARAM func) is
used to generate the next $(D front) when $(D popFront) is called. If
$(D_PARAM popFirst) is $(D PopFirst.yes), then $(D popFront) is called
before the range is returned (so that $(D front) is a time point which
$(D_PARAM func) would generate).
If $(D_PARAM func) ever generates a time point greater than or equal to
the current $(D front) of the range, then a $(LREF DateTimeException) will
be thrown. The range will be empty and iteration complete when
$(D_PARAM func) generates a time point equal to or less than the
$(D begin) of the interval.
There are helper functions in this module which generate common
delegates to pass to $(D bwdRange). Their documentation starts with
"Range-generating function," making them easily searchable.
Params:
func = The function used to generate the time points of the
range over the interval.
popFirst = Whether $(D popFront) should be called on the range
before returning it.
Throws:
$(LREF DateTimeException) if this interval is empty.
Warning:
$(D_PARAM func) must be logically pure. Ideally, $(D_PARAM func)
would be a function pointer to a pure function, but forcing
$(D_PARAM func) to be pure is far too restrictive to be useful, and
in order to have the ease of use of having functions which generate
functions to pass to $(D fwdRange), $(D_PARAM func) must be a
delegate.
If $(D_PARAM func) retains state which changes as it is called, then
some algorithms will not work correctly, because the range's
$(D save) will have failed to have really saved the range's state.
To avoid such bugs, don't pass a delegate which is
not logically pure to $(D fwdRange). If $(D_PARAM func) is given the
same time point with two different calls, it must return the same
result both times.
Of course, none of the functions in this module have this problem,
so it's only relevant for custom delegates.
Examples:
--------------------
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = (in Date date) //For iterating over even-numbered days.
{
if((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
};
auto range = interval.bwdRange(func);
//An odd day. Using PopFirst.yes would have made this Date(2010, 9, 8).
assert(range.front == Date(2010, 9, 9));
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.empty);
--------------------
+/
IntervalRange!(TP, Direction.bwd) bwdRange(TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
{
_enforceNotEmpty();
auto range = IntervalRange!(TP, Direction.bwd)(this, func);
if(popFirst == PopFirst.yes)
range.popFront();
return range;
}
/+
Converts this interval to a string.
+/
//Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't
//have versions of toString() with extra modifiers, so we define one version
//with modifiers and one without.
string toString()
{
return _toStringImpl();
}
/++
Converts this interval to a string.
+/
//Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't
//have versions of toString() with extra modifiers, so we define one version
//with modifiers and one without.
string toString() const nothrow
{
return _toStringImpl();
}
private:
/+
Since we have two versions of toString, we have _toStringImpl
so that they can share implementations.
+/
string _toStringImpl() const nothrow
{
import std.format : format;
try
return format("[%s - %s)", _begin, _end);
catch(Exception e)
assert(0, "format() threw.");
}
/+
Throws:
$(LREF DateTimeException) if this interval is empty.
+/
void _enforceNotEmpty(size_t line = __LINE__) const pure
{
if(empty)
throw new DateTimeException("Invalid operation for an empty Interval.", __FILE__, line);
}
/+
Whether the given values form a valid time interval.
Params:
begin = The starting point of the interval.
end = The end point of the interval.
+/
static bool _valid(in TP begin, in TP end) pure nothrow
{
return begin <= end;
}
pure invariant()
{
assert(_valid(_begin, _end), "Invariant Failure: begin is not before or equal to end.");
}
TP _begin;
TP _end;
}
//Test Interval's constructors.
unittest
{
assertThrown!DateTimeException(Interval!Date(Date(2010, 1, 1), Date(1, 1, 1)));
Interval!Date(Date.init, Date.init);
Interval!TimeOfDay(TimeOfDay.init, TimeOfDay.init);
Interval!DateTime(DateTime.init, DateTime.init);
Interval!SysTime(SysTime(0), SysTime(0));
Interval!DateTime(DateTime.init, dur!"days"(7));
//Verify Examples.
Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
assert(Interval!Date(Date(1996, 1, 2), dur!"weeks"(3)) == Interval!Date(Date(1996, 1, 2), Date(1996, 1, 23)));
assert(Interval!Date(Date(1996, 1, 2), dur!"days"(3)) == Interval!Date(Date(1996, 1, 2), Date(1996, 1, 5)));
assert(Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), dur!"hours"(3)) == Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), DateTime(1996, 1, 2, 15, 0, 0)));
assert(Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), dur!"minutes"(3)) == Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), DateTime(1996, 1, 2, 12, 3, 0)));
assert(Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), dur!"seconds"(3)) == Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), DateTime(1996, 1, 2, 12, 0, 3)));
assert(Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), dur!"msecs"(3000)) == Interval!DateTime(DateTime(1996, 1, 2, 12, 0, 0), DateTime(1996, 1, 2, 12, 0, 3)));
}
//Test Interval's begin.
unittest
{
assert(Interval!Date(Date(1, 1, 1), Date(2010, 1, 1)).begin == Date(1, 1, 1));
assert(Interval!Date(Date(2010, 1, 1), Date(2010, 1, 1)).begin == Date(2010, 1, 1));
assert(Interval!Date(Date(1997, 12, 31), Date(1998, 1, 1)).begin == Date(1997, 12, 31));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.begin));
static assert(__traits(compiles, iInterval.begin));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).begin == Date(1996, 1, 2));
}
//Test Interval's end.
unittest
{
assert(Interval!Date(Date(1, 1, 1), Date(2010, 1, 1)).end == Date(2010, 1, 1));
assert(Interval!Date(Date(2010, 1, 1), Date(2010, 1, 1)).end == Date(2010, 1, 1));
assert(Interval!Date(Date(1997, 12, 31), Date(1998, 1, 1)).end == Date(1998, 1, 1));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.end));
static assert(__traits(compiles, iInterval.end));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).end == Date(2012, 3, 1));
}
//Test Interval's length.
unittest
{
assert(Interval!Date(Date(2010, 1, 1), Date(2010, 1, 1)).length == dur!"days"(0));
assert(Interval!Date(Date(2010, 1, 1), Date(2010, 4, 1)).length == dur!"days"(90));
assert(Interval!TimeOfDay(TimeOfDay(0, 30, 0), TimeOfDay(12, 22, 7)).length == dur!"seconds"(42_727));
assert(Interval!DateTime(DateTime(2010, 1, 1, 0, 30, 0), DateTime(2010, 1, 2, 12, 22, 7)).length == dur!"seconds"(129_127));
assert(Interval!SysTime(SysTime(DateTime(2010, 1, 1, 0, 30, 0)), SysTime(DateTime(2010, 1, 2, 12, 22, 7))).length == dur!"seconds"(129_127));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.length));
static assert(__traits(compiles, iInterval.length));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).length == dur!"days"(5903));
}
//Test Interval's empty.
unittest
{
assert(Interval!Date(Date(2010, 1, 1), Date(2010, 1, 1)).empty);
assert(!Interval!Date(Date(2010, 1, 1), Date(2010, 4, 1)).empty);
assert(!Interval!TimeOfDay(TimeOfDay(0, 30, 0), TimeOfDay(12, 22, 7)).empty);
assert(!Interval!DateTime(DateTime(2010, 1, 1, 0, 30, 0), DateTime(2010, 1, 2, 12, 22, 7)).empty);
assert(!Interval!SysTime(SysTime(DateTime(2010, 1, 1, 0, 30, 0)), SysTime(DateTime(2010, 1, 2, 12, 22, 7))).empty);
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.empty));
static assert(__traits(compiles, iInterval.empty));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(1996, 1, 2)).empty);
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).empty);
}
//Test Interval's contains(time point).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).contains(Date(2010, 7, 4)));
assert(!interval.contains(Date(2009, 7, 4)));
assert(!interval.contains(Date(2010, 7, 3)));
assert(interval.contains(Date(2010, 7, 4)));
assert(interval.contains(Date(2010, 7, 5)));
assert(interval.contains(Date(2011, 7, 1)));
assert(interval.contains(Date(2012, 1, 6)));
assert(!interval.contains(Date(2012, 1, 7)));
assert(!interval.contains(Date(2012, 1, 8)));
assert(!interval.contains(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, interval.contains(cdate)));
static assert(__traits(compiles, cInterval.contains(cdate)));
static assert(__traits(compiles, iInterval.contains(cdate)));
//Verify Examples.
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(Date(1994, 12, 24)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(Date(2000, 1, 5)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(Date(2012, 3, 1)));
}
//Test Interval's contains(Interval).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(interval.contains(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).contains(interval));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).contains(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(interval.contains(interval));
assert(!interval.contains(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!interval.contains(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!interval.contains(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!interval.contains(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!interval.contains(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!interval.contains(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(interval.contains(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(interval.contains(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(interval.contains(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!interval.contains(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!interval.contains(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!interval.contains(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).contains(interval));
assert(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).contains(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).contains(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).contains(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).contains(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).contains(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).contains(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).contains(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).contains(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).contains(interval));
assert(!Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).contains(interval));
assert(!Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).contains(interval));
assert(!interval.contains(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.contains(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.contains(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.contains(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.contains(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.contains(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!interval.contains(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.contains(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.contains(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.contains(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.contains(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.contains(NegInfInterval!Date(Date(2012, 1, 8))));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.contains(interval)));
static assert(__traits(compiles, interval.contains(cInterval)));
static assert(__traits(compiles, interval.contains(iInterval)));
static assert(__traits(compiles, interval.contains(posInfInterval)));
static assert(__traits(compiles, interval.contains(cPosInfInterval)));
static assert(__traits(compiles, interval.contains(iPosInfInterval)));
static assert(__traits(compiles, interval.contains(negInfInterval)));
static assert(__traits(compiles, interval.contains(cNegInfInterval)));
static assert(__traits(compiles, interval.contains(iNegInfInterval)));
static assert(__traits(compiles, cInterval.contains(interval)));
static assert(__traits(compiles, cInterval.contains(cInterval)));
static assert(__traits(compiles, cInterval.contains(iInterval)));
static assert(__traits(compiles, cInterval.contains(posInfInterval)));
static assert(__traits(compiles, cInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, cInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, cInterval.contains(negInfInterval)));
static assert(__traits(compiles, cInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, cInterval.contains(iNegInfInterval)));
static assert(__traits(compiles, iInterval.contains(interval)));
static assert(__traits(compiles, iInterval.contains(cInterval)));
static assert(__traits(compiles, iInterval.contains(iInterval)));
static assert(__traits(compiles, iInterval.contains(posInfInterval)));
static assert(__traits(compiles, iInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, iInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, iInterval.contains(negInfInterval)));
static assert(__traits(compiles, iInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, iInterval.contains(iNegInfInterval)));
//Verify Examples.
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(Interval!Date(Date(1998, 2, 28), Date(2013, 5, 1))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(PosInfInterval!Date(Date(1999, 5, 4))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).contains(NegInfInterval!Date(Date(1996, 5, 4))));
}
//Test Interval's isBefore(time point).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).isBefore(Date(2010, 7, 4)));
assert(!interval.isBefore(Date(2009, 7, 3)));
assert(!interval.isBefore(Date(2010, 7, 3)));
assert(!interval.isBefore(Date(2010, 7, 4)));
assert(!interval.isBefore(Date(2010, 7, 5)));
assert(!interval.isBefore(Date(2011, 7, 1)));
assert(!interval.isBefore(Date(2012, 1, 6)));
assert(interval.isBefore(Date(2012, 1, 7)));
assert(interval.isBefore(Date(2012, 1, 8)));
assert(interval.isBefore(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, interval.isBefore(cdate)));
static assert(__traits(compiles, cInterval.isBefore(cdate)));
static assert(__traits(compiles, iInterval.isBefore(cdate)));
//Verify Examples.
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(Date(1994, 12, 24)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(Date(2000, 1, 5)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(Date(2012, 3, 1)));
}
//Test Interval's isBefore(Interval).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(interval.isBefore(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).isBefore(interval));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).isBefore(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!interval.isBefore(interval));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!interval.isBefore(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!interval.isBefore(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!interval.isBefore(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(interval.isBefore(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(interval.isBefore(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).isBefore(interval));
assert(!Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).isBefore(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).isBefore(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).isBefore(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).isBefore(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).isBefore(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).isBefore(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).isBefore(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).isBefore(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).isBefore(interval));
assert(!Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).isBefore(interval));
assert(!Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).isBefore(interval));
assert(!interval.isBefore(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.isBefore(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.isBefore(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.isBefore(PosInfInterval!Date(Date(2012, 1, 6))));
assert(interval.isBefore(PosInfInterval!Date(Date(2012, 1, 7))));
assert(interval.isBefore(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!interval.isBefore(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.isBefore(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.isBefore(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.isBefore(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.isBefore(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.isBefore(NegInfInterval!Date(Date(2012, 1, 8))));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.isBefore(interval)));
static assert(__traits(compiles, interval.isBefore(cInterval)));
static assert(__traits(compiles, interval.isBefore(iInterval)));
static assert(__traits(compiles, interval.isBefore(posInfInterval)));
static assert(__traits(compiles, interval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, interval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, interval.isBefore(negInfInterval)));
static assert(__traits(compiles, interval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, interval.isBefore(iNegInfInterval)));
static assert(__traits(compiles, cInterval.isBefore(interval)));
static assert(__traits(compiles, cInterval.isBefore(cInterval)));
static assert(__traits(compiles, cInterval.isBefore(iInterval)));
static assert(__traits(compiles, cInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, cInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, cInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, cInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, cInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, cInterval.isBefore(iNegInfInterval)));
static assert(__traits(compiles, iInterval.isBefore(interval)));
static assert(__traits(compiles, iInterval.isBefore(cInterval)));
static assert(__traits(compiles, iInterval.isBefore(iInterval)));
static assert(__traits(compiles, iInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, iInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, iInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, iInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, iInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, iInterval.isBefore(iNegInfInterval)));
//Verify Examples.
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(Interval!Date(Date(2012, 3, 1), Date(2013, 5, 1))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(PosInfInterval!Date(Date(1999, 5, 4))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(PosInfInterval!Date(Date(2013, 3, 7))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isBefore(NegInfInterval!Date(Date(1996, 5, 4))));
}
//Test Interval's isAfter(time point).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).isAfter(Date(2010, 7, 4)));
assert(interval.isAfter(Date(2009, 7, 4)));
assert(interval.isAfter(Date(2010, 7, 3)));
assert(!interval.isAfter(Date(2010, 7, 4)));
assert(!interval.isAfter(Date(2010, 7, 5)));
assert(!interval.isAfter(Date(2011, 7, 1)));
assert(!interval.isAfter(Date(2012, 1, 6)));
assert(!interval.isAfter(Date(2012, 1, 7)));
assert(!interval.isAfter(Date(2012, 1, 8)));
assert(!interval.isAfter(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, interval.isAfter(cdate)));
static assert(__traits(compiles, cInterval.isAfter(cdate)));
static assert(__traits(compiles, iInterval.isAfter(cdate)));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(Date(1994, 12, 24)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(Date(2000, 1, 5)));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(Date(2012, 3, 1)));
}
//Test Interval's isAfter(Interval).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(interval.isAfter(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).isAfter(interval));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).isAfter(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!interval.isAfter(interval));
assert(interval.isAfter(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!interval.isAfter(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(interval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!interval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!interval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!interval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!interval.isAfter(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!interval.isAfter(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!interval.isAfter(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!interval.isAfter(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!interval.isAfter(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!interval.isAfter(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).isAfter(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).isAfter(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).isAfter(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).isAfter(interval));
assert(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).isAfter(interval));
assert(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).isAfter(interval));
assert(!interval.isAfter(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.isAfter(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.isAfter(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.isAfter(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.isAfter(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.isAfter(PosInfInterval!Date(Date(2012, 1, 8))));
assert(interval.isAfter(NegInfInterval!Date(Date(2010, 7, 3))));
assert(interval.isAfter(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.isAfter(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.isAfter(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.isAfter(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.isAfter(NegInfInterval!Date(Date(2012, 1, 8))));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.isAfter(interval)));
static assert(__traits(compiles, interval.isAfter(cInterval)));
static assert(__traits(compiles, interval.isAfter(iInterval)));
static assert(__traits(compiles, interval.isAfter(posInfInterval)));
static assert(__traits(compiles, interval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, interval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, interval.isAfter(negInfInterval)));
static assert(__traits(compiles, interval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, interval.isAfter(iNegInfInterval)));
static assert(__traits(compiles, cInterval.isAfter(interval)));
static assert(__traits(compiles, cInterval.isAfter(cInterval)));
static assert(__traits(compiles, cInterval.isAfter(iInterval)));
static assert(__traits(compiles, cInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, cInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, cInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, cInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, cInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, cInterval.isAfter(iNegInfInterval)));
static assert(__traits(compiles, iInterval.isAfter(interval)));
static assert(__traits(compiles, iInterval.isAfter(cInterval)));
static assert(__traits(compiles, iInterval.isAfter(iInterval)));
static assert(__traits(compiles, iInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, iInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, iInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, iInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, iInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, iInterval.isAfter(iNegInfInterval)));
//Verify Examples.
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(PosInfInterval!Date(Date(1999, 5, 4))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAfter(NegInfInterval!Date(Date(1996, 1, 2))));
}
//Test Interval's intersects().
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(interval.intersects(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).intersects(interval));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).intersects(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(interval.intersects(interval));
assert(!interval.intersects(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(interval.intersects(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!interval.intersects(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(interval.intersects(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(interval.intersects(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(interval.intersects(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(interval.intersects(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(interval.intersects(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(interval.intersects(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(interval.intersects(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!interval.intersects(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!interval.intersects(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).intersects(interval));
assert(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).intersects(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).intersects(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).intersects(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).intersects(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).intersects(interval));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).intersects(interval));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).intersects(interval));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).intersects(interval));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).intersects(interval));
assert(!Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).intersects(interval));
assert(!Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).intersects(interval));
assert(interval.intersects(PosInfInterval!Date(Date(2010, 7, 3))));
assert(interval.intersects(PosInfInterval!Date(Date(2010, 7, 4))));
assert(interval.intersects(PosInfInterval!Date(Date(2010, 7, 5))));
assert(interval.intersects(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.intersects(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.intersects(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!interval.intersects(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.intersects(NegInfInterval!Date(Date(2010, 7, 4))));
assert(interval.intersects(NegInfInterval!Date(Date(2010, 7, 5))));
assert(interval.intersects(NegInfInterval!Date(Date(2012, 1, 6))));
assert(interval.intersects(NegInfInterval!Date(Date(2012, 1, 7))));
assert(interval.intersects(NegInfInterval!Date(Date(2012, 1, 8))));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.intersects(interval)));
static assert(__traits(compiles, interval.intersects(cInterval)));
static assert(__traits(compiles, interval.intersects(iInterval)));
static assert(__traits(compiles, interval.intersects(posInfInterval)));
static assert(__traits(compiles, interval.intersects(cPosInfInterval)));
static assert(__traits(compiles, interval.intersects(iPosInfInterval)));
static assert(__traits(compiles, interval.intersects(negInfInterval)));
static assert(__traits(compiles, interval.intersects(cNegInfInterval)));
static assert(__traits(compiles, interval.intersects(iNegInfInterval)));
static assert(__traits(compiles, cInterval.intersects(interval)));
static assert(__traits(compiles, cInterval.intersects(cInterval)));
static assert(__traits(compiles, cInterval.intersects(iInterval)));
static assert(__traits(compiles, cInterval.intersects(posInfInterval)));
static assert(__traits(compiles, cInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, cInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, cInterval.intersects(negInfInterval)));
static assert(__traits(compiles, cInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, cInterval.intersects(iNegInfInterval)));
static assert(__traits(compiles, iInterval.intersects(interval)));
static assert(__traits(compiles, iInterval.intersects(cInterval)));
static assert(__traits(compiles, iInterval.intersects(iInterval)));
static assert(__traits(compiles, iInterval.intersects(posInfInterval)));
static assert(__traits(compiles, iInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, iInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, iInterval.intersects(negInfInterval)));
static assert(__traits(compiles, iInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, iInterval.intersects(iNegInfInterval)));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(PosInfInterval!Date(Date(1999, 5, 4))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(PosInfInterval!Date(Date(2012, 3, 1))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(NegInfInterval!Date(Date(1996, 1, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersects(NegInfInterval!Date(Date(2000, 1, 2))));
}
//Test Interval's intersection().
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
assertThrown!DateTimeException(interval.intersection(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).intersection(interval));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 4), dur!"days"(0)).intersection(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(interval.intersection(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assertThrown!DateTimeException(interval.intersection(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assertThrown!DateTimeException(interval.intersection(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assertThrown!DateTimeException(interval.intersection(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).intersection(interval));
assertThrown!DateTimeException(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).intersection(interval));
assertThrown!DateTimeException(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).intersection(interval));
assertThrown!DateTimeException(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).intersection(interval));
assertThrown!DateTimeException(interval.intersection(PosInfInterval!Date(Date(2012, 1, 7))));
assertThrown!DateTimeException(interval.intersection(PosInfInterval!Date(Date(2012, 1, 8))));
assertThrown!DateTimeException(interval.intersection(NegInfInterval!Date(Date(2010, 7, 3))));
assertThrown!DateTimeException(interval.intersection(NegInfInterval!Date(Date(2010, 7, 4))));
assert(interval.intersection(interval) == interval);
assert(interval.intersection(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.intersection(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 4), Date(2010, 7, 5)));
assert(interval.intersection(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.intersection(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.intersection(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)));
assert(interval.intersection(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)));
assert(interval.intersection(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(interval.intersection(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).intersection(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).intersection(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2010, 7, 5)));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).intersection(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).intersection(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).intersection(interval) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).intersection(interval) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).intersection(interval) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).intersection(interval) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(interval.intersection(PosInfInterval!Date(Date(2010, 7, 3))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.intersection(PosInfInterval!Date(Date(2010, 7, 4))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.intersection(PosInfInterval!Date(Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)));
assert(interval.intersection(PosInfInterval!Date(Date(2012, 1, 6))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(interval.intersection(NegInfInterval!Date(Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 4), Date(2010, 7, 5)));
assert(interval.intersection(NegInfInterval!Date(Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 6)));
assert(interval.intersection(NegInfInterval!Date(Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.intersection(NegInfInterval!Date(Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.intersection(interval)));
static assert(__traits(compiles, interval.intersection(cInterval)));
static assert(__traits(compiles, interval.intersection(iInterval)));
static assert(__traits(compiles, interval.intersection(posInfInterval)));
static assert(__traits(compiles, interval.intersection(cPosInfInterval)));
static assert(__traits(compiles, interval.intersection(iPosInfInterval)));
static assert(__traits(compiles, interval.intersection(negInfInterval)));
static assert(__traits(compiles, interval.intersection(cNegInfInterval)));
static assert(__traits(compiles, interval.intersection(iNegInfInterval)));
static assert(__traits(compiles, cInterval.intersection(interval)));
static assert(__traits(compiles, cInterval.intersection(cInterval)));
static assert(__traits(compiles, cInterval.intersection(iInterval)));
static assert(__traits(compiles, cInterval.intersection(posInfInterval)));
static assert(__traits(compiles, cInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, cInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, cInterval.intersection(negInfInterval)));
static assert(__traits(compiles, cInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, cInterval.intersection(iNegInfInterval)));
static assert(__traits(compiles, iInterval.intersection(interval)));
static assert(__traits(compiles, iInterval.intersection(cInterval)));
static assert(__traits(compiles, iInterval.intersection(iInterval)));
static assert(__traits(compiles, iInterval.intersection(posInfInterval)));
static assert(__traits(compiles, iInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, iInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, iInterval.intersection(negInfInterval)));
static assert(__traits(compiles, iInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, iInterval.intersection(iNegInfInterval)));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == Interval!Date(Date(1996, 1 , 2), Date(2000, 8, 2)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) == Interval!Date(Date(1999, 1 , 12), Date(2011, 9, 17)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(PosInfInterval!Date(Date(1990, 7, 6))) == Interval!Date(Date(1996, 1 , 2), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(PosInfInterval!Date(Date(1999, 1, 12))) == Interval!Date(Date(1999, 1 , 12), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(NegInfInterval!Date(Date(1999, 7, 6))) == Interval!Date(Date(1996, 1 , 2), Date(1999, 7, 6)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).intersection(NegInfInterval!Date(Date(2013, 1, 12))) == Interval!Date(Date(1996, 1 , 2), Date(2012, 3, 1)));
}
//Test Interval's isAdjacent().
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static void testInterval(in Interval!Date interval1, in Interval!Date interval2)
{
interval1.isAdjacent(interval2);
}
assertThrown!DateTimeException(testInterval(interval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), interval));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!interval.isAdjacent(interval));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(interval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!interval.isAdjacent(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!interval.isAdjacent(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!interval.isAdjacent(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(interval.isAdjacent(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!interval.isAdjacent(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).isAdjacent(interval));
assert(!Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).isAdjacent(interval));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).isAdjacent(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).isAdjacent(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).isAdjacent(interval));
assert(!Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).isAdjacent(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).isAdjacent(interval));
assert(!Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).isAdjacent(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).isAdjacent(interval));
assert(!Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).isAdjacent(interval));
assert(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).isAdjacent(interval));
assert(!Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).isAdjacent(interval));
assert(!interval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!interval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 6))));
assert(interval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!interval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 3))));
assert(interval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!interval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!interval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!interval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!interval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 8))));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.isAdjacent(interval)));
static assert(__traits(compiles, interval.isAdjacent(cInterval)));
static assert(__traits(compiles, interval.isAdjacent(iInterval)));
static assert(__traits(compiles, interval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, interval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, interval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, interval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, interval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, interval.isAdjacent(iNegInfInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(interval)));
static assert(__traits(compiles, cInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, cInterval.isAdjacent(iNegInfInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(interval)));
static assert(__traits(compiles, iInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, iInterval.isAdjacent(iNegInfInterval)));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(1990, 7, 6), Date(1996, 1, 2))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(2012, 3, 1), Date(2013, 9, 17))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(1989, 3, 1), Date(2012, 3, 1))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(PosInfInterval!Date(Date(1999, 5, 4))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(PosInfInterval!Date(Date(2012, 3, 1))));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(NegInfInterval!Date(Date(1996, 1, 2))));
assert(!Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).isAdjacent(NegInfInterval!Date(Date(2000, 1, 2))));
}
//Test Interval's merge().
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static void testInterval(I)(in Interval!Date interval1, in I interval2)
{
interval1.merge(interval2);
}
assertThrown!DateTimeException(testInterval(interval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), interval));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(interval, Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assertThrown!DateTimeException(testInterval(interval, Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)), interval));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)), interval));
assertThrown!DateTimeException(testInterval(interval, PosInfInterval!Date(Date(2012, 1, 8))));
assertThrown!DateTimeException(testInterval(interval, NegInfInterval!Date(Date(2010, 7, 3))));
assert(interval.merge(interval) == interval);
assert(interval.merge(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)));
assert(interval.merge(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(interval.merge(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(interval.merge(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(interval.merge(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)));
assert(interval.merge(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.merge(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.merge(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.merge(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(interval.merge(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).merge(interval) ==
Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).merge(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).merge(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).merge(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).merge(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).merge(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).merge(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).merge(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).merge(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).merge(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(interval.merge(PosInfInterval!Date(Date(2010, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(interval.merge(PosInfInterval!Date(Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.merge(PosInfInterval!Date(Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.merge(PosInfInterval!Date(Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.merge(PosInfInterval!Date(Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.merge(NegInfInterval!Date(Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.merge(NegInfInterval!Date(Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.merge(NegInfInterval!Date(Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.merge(NegInfInterval!Date(Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.merge(NegInfInterval!Date(Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.merge(interval)));
static assert(__traits(compiles, interval.merge(cInterval)));
static assert(__traits(compiles, interval.merge(iInterval)));
static assert(__traits(compiles, interval.merge(posInfInterval)));
static assert(__traits(compiles, interval.merge(cPosInfInterval)));
static assert(__traits(compiles, interval.merge(iPosInfInterval)));
static assert(__traits(compiles, interval.merge(negInfInterval)));
static assert(__traits(compiles, interval.merge(cNegInfInterval)));
static assert(__traits(compiles, interval.merge(iNegInfInterval)));
static assert(__traits(compiles, cInterval.merge(interval)));
static assert(__traits(compiles, cInterval.merge(cInterval)));
static assert(__traits(compiles, cInterval.merge(iInterval)));
static assert(__traits(compiles, cInterval.merge(posInfInterval)));
static assert(__traits(compiles, cInterval.merge(cPosInfInterval)));
static assert(__traits(compiles, cInterval.merge(iPosInfInterval)));
static assert(__traits(compiles, cInterval.merge(negInfInterval)));
static assert(__traits(compiles, cInterval.merge(cNegInfInterval)));
static assert(__traits(compiles, cInterval.merge(iNegInfInterval)));
static assert(__traits(compiles, iInterval.merge(interval)));
static assert(__traits(compiles, iInterval.merge(cInterval)));
static assert(__traits(compiles, iInterval.merge(iInterval)));
static assert(__traits(compiles, iInterval.merge(posInfInterval)));
static assert(__traits(compiles, iInterval.merge(cPosInfInterval)));
static assert(__traits(compiles, iInterval.merge(iPosInfInterval)));
static assert(__traits(compiles, iInterval.merge(negInfInterval)));
static assert(__traits(compiles, iInterval.merge(cNegInfInterval)));
static assert(__traits(compiles, iInterval.merge(iNegInfInterval)));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == Interval!Date(Date(1990, 7 , 6), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(Interval!Date(Date(2012, 3, 1), Date(2013, 5, 7))) == Interval!Date(Date(1996, 1 , 2), Date(2013, 5, 7)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(PosInfInterval!Date(Date(1990, 7, 6))) == PosInfInterval!Date(Date(1990, 7 , 6)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(PosInfInterval!Date(Date(2012, 3, 1))) == PosInfInterval!Date(Date(1996, 1 , 2)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(NegInfInterval!Date(Date(1996, 1, 2))) == NegInfInterval!Date(Date(2012, 3 , 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).merge(NegInfInterval!Date(Date(2013, 1, 12))) == NegInfInterval!Date(Date(2013, 1 , 12)));
}
//Test Interval's span().
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static void testInterval(in Interval!Date interval1, in Interval!Date interval2)
{
interval1.span(interval2);
}
assertThrown!DateTimeException(testInterval(interval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), interval));
assertThrown!DateTimeException(testInterval(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(interval.span(interval) == interval);
assert(interval.span(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))) ==
Interval!Date(Date(2010, 7, 1), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)));
assert(interval.span(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)));
assert(interval.span(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(interval.span(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(interval.span(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(interval.span(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 9)));
assert(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)).span(interval) ==
Interval!Date(Date(2010, 7, 1), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)).span(interval) ==
Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3)));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)).span(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)).span(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)).span(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)).span(interval) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8)));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)).span(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)).span(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)).span(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)).span(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)).span(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)).span(interval) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 9)));
assert(interval.span(PosInfInterval!Date(Date(2010, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(interval.span(PosInfInterval!Date(Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.span(PosInfInterval!Date(Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.span(PosInfInterval!Date(Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.span(PosInfInterval!Date(Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.span(PosInfInterval!Date(Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(interval.span(NegInfInterval!Date(Date(2010, 7, 3))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.span(NegInfInterval!Date(Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.span(NegInfInterval!Date(Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.span(NegInfInterval!Date(Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.span(NegInfInterval!Date(Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(interval.span(NegInfInterval!Date(Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, interval.span(interval)));
static assert(__traits(compiles, interval.span(cInterval)));
static assert(__traits(compiles, interval.span(iInterval)));
static assert(__traits(compiles, interval.span(posInfInterval)));
static assert(__traits(compiles, interval.span(cPosInfInterval)));
static assert(__traits(compiles, interval.span(iPosInfInterval)));
static assert(__traits(compiles, interval.span(negInfInterval)));
static assert(__traits(compiles, interval.span(cNegInfInterval)));
static assert(__traits(compiles, interval.span(iNegInfInterval)));
static assert(__traits(compiles, cInterval.span(interval)));
static assert(__traits(compiles, cInterval.span(cInterval)));
static assert(__traits(compiles, cInterval.span(iInterval)));
static assert(__traits(compiles, cInterval.span(posInfInterval)));
static assert(__traits(compiles, cInterval.span(cPosInfInterval)));
static assert(__traits(compiles, cInterval.span(iPosInfInterval)));
static assert(__traits(compiles, cInterval.span(negInfInterval)));
static assert(__traits(compiles, cInterval.span(cNegInfInterval)));
static assert(__traits(compiles, cInterval.span(iNegInfInterval)));
static assert(__traits(compiles, iInterval.span(interval)));
static assert(__traits(compiles, iInterval.span(cInterval)));
static assert(__traits(compiles, iInterval.span(iInterval)));
static assert(__traits(compiles, iInterval.span(posInfInterval)));
static assert(__traits(compiles, iInterval.span(cPosInfInterval)));
static assert(__traits(compiles, iInterval.span(iPosInfInterval)));
static assert(__traits(compiles, iInterval.span(negInfInterval)));
static assert(__traits(compiles, iInterval.span(cNegInfInterval)));
static assert(__traits(compiles, iInterval.span(iNegInfInterval)));
//Verify Examples.
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(Interval!Date(Date(1990, 7, 6), Date(1991, 1, 8))) == Interval!Date(Date(1990, 7 , 6), Date(2012, 3, 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(Interval!Date(Date(2012, 3, 1), Date(2013, 5, 7))) == Interval!Date(Date(1996, 1 , 2), Date(2013, 5, 7)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(PosInfInterval!Date(Date(1990, 7, 6))) == PosInfInterval!Date(Date(1990, 7 , 6)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(PosInfInterval!Date(Date(2050, 1, 1))) == PosInfInterval!Date(Date(1996, 1 , 2)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(NegInfInterval!Date(Date(1602, 5, 21))) == NegInfInterval!Date(Date(2012, 3 , 1)));
assert(Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1)).span(NegInfInterval!Date(Date(2013, 1, 12))) == NegInfInterval!Date(Date(2013, 1 , 12)));
}
//Test Interval's shift(duration).
unittest
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static void testIntervalFail(Interval!Date interval, in Duration duration)
{
interval.shift(duration);
}
assertThrown!DateTimeException(testIntervalFail(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), dur!"days"(1)));
static void testInterval(I)(I interval, in Duration duration, in I expected, size_t line = __LINE__)
{
interval.shift(duration);
assert(interval == expected);
}
testInterval(interval, dur!"days"(22), Interval!Date(Date(2010, 7, 26), Date(2012, 1, 29)));
testInterval(interval, dur!"days"(-22), Interval!Date(Date(2010, 6, 12), Date(2011, 12, 16)));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(!__traits(compiles, cInterval.shift(dur!"days"(5))));
static assert(!__traits(compiles, iInterval.shift(dur!"days"(5))));
//Verify Examples.
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 4, 5));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 4, 5));
interval1.shift(dur!"days"(50));
assert(interval1 == Interval!Date(Date(1996, 2, 21), Date(2012, 5, 25)));
interval2.shift(dur!"days"(-50));
assert(interval2 == Interval!Date(Date(1995, 11, 13), Date(2012, 2, 15)));
}
//Test Interval's shift(int, int, AllowDayOverflow).
unittest
{
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static void testIntervalFail(Interval!Date interval, int years, int months)
{
interval.shift(years, months);
}
assertThrown!DateTimeException(testIntervalFail(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), 1, 0));
static void testInterval(I)(I interval, int years, int months, AllowDayOverflow allow, in I expected, size_t line = __LINE__)
{
interval.shift(years, months, allow);
assert(interval == expected);
}
testInterval(interval, 5, 0, AllowDayOverflow.yes, Interval!Date(Date(2015, 7, 4), Date(2017, 1, 7)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, Interval!Date(Date(2005, 7, 4), Date(2007, 1, 7)));
auto interval2 = Interval!Date(Date(2000, 1, 29), Date(2010, 5, 31));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, Interval!Date(Date(2001, 3, 1), Date(2011, 7, 1)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, Interval!Date(Date(2000, 12, 29), Date(2011, 5, 1)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, Interval!Date(Date(1998, 12, 29), Date(2009, 5, 1)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, Interval!Date(Date(1999, 3, 1), Date(2009, 7, 1)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, Interval!Date(Date(2001, 2, 28), Date(2011, 6, 30)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, Interval!Date(Date(2000, 12, 29), Date(2011, 4, 30)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, Interval!Date(Date(1998, 12, 29), Date(2009, 4, 30)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, Interval!Date(Date(1999, 2, 28), Date(2009, 6, 30)));
}
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(!__traits(compiles, cInterval.shift(5)));
static assert(!__traits(compiles, iInterval.shift(5)));
//Verify Examples.
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
interval1.shift(2);
assert(interval1 == Interval!Date(Date(1998, 1, 2), Date(2014, 3, 1)));
interval2.shift(-2);
assert(interval2 == Interval!Date(Date(1994, 1, 2), Date(2010, 3, 1)));
}
//Test Interval's expand(Duration).
unittest
{
auto interval = Interval!Date(Date(2000, 7, 4), Date(2012, 1, 7));
static void testIntervalFail(I)(I interval, in Duration duration)
{
interval.expand(duration);
}
assertThrown!DateTimeException(testIntervalFail(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), dur!"days"(1)));
assertThrown!DateTimeException(testIntervalFail(Interval!Date(Date(2010, 7, 4), Date(2010, 7, 5)), dur!"days"(-5)));
static void testInterval(I)(I interval, in Duration duration, in I expected, size_t line = __LINE__)
{
interval.expand(duration);
assert(interval == expected);
}
testInterval(interval, dur!"days"(22), Interval!Date(Date(2000, 6, 12), Date(2012, 1, 29)));
testInterval(interval, dur!"days"(-22), Interval!Date(Date(2000, 7, 26), Date(2011, 12, 16)));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(!__traits(compiles, cInterval.expand(dur!"days"(5))));
static assert(!__traits(compiles, iInterval.expand(dur!"days"(5))));
//Verify Examples.
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
interval1.expand(dur!"days"(2));
assert(interval1 == Interval!Date(Date(1995, 12, 31), Date(2012, 3, 3)));
interval2.expand(dur!"days"(-2));
assert(interval2 == Interval!Date(Date(1996, 1, 4), Date(2012, 2, 28)));
}
//Test Interval's expand(int, int, AllowDayOverflow, Direction)
unittest
{
{
auto interval = Interval!Date(Date(2000, 7, 4), Date(2012, 1, 7));
static void testIntervalFail(Interval!Date interval, int years, int months)
{
interval.expand(years, months);
}
assertThrown!DateTimeException(testIntervalFail(Interval!Date(Date(2010, 7, 4), dur!"days"(0)), 1, 0));
assertThrown!DateTimeException(testIntervalFail(Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)), -5, 0));
static void testInterval(I)(I interval, int years, int months, AllowDayOverflow allow, Direction dir, in I expected, size_t line = __LINE__)
{
interval.expand(years, months, allow, dir);
assert(interval == expected);
}
testInterval(interval, 5, 0, AllowDayOverflow.yes, Direction.both, Interval!Date(Date(1995, 7, 4), Date(2017, 1, 7)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, Direction.both, Interval!Date(Date(2005, 7, 4), Date(2007, 1, 7)));
testInterval(interval, 5, 0, AllowDayOverflow.yes, Direction.fwd, Interval!Date(Date(2000, 7, 4), Date(2017, 1, 7)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, Direction.fwd, Interval!Date(Date(2000, 7, 4), Date(2007, 1, 7)));
testInterval(interval, 5, 0, AllowDayOverflow.yes, Direction.bwd, Interval!Date(Date(1995, 7, 4), Date(2012, 1, 7)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, Direction.bwd, Interval!Date(Date(2005, 7, 4), Date(2012, 1, 7)));
auto interval2 = Interval!Date(Date(2000, 1, 29), Date(2010, 5, 31));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, Direction.both, Interval!Date(Date(1998, 12, 29), Date(2011, 7, 1)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, Direction.both, Interval!Date(Date(1999, 3, 1), Date(2011, 5, 1)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, Direction.both, Interval!Date(Date(2001, 3, 1), Date(2009, 5, 1)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, Direction.both, Interval!Date(Date(2000, 12, 29), Date(2009, 7, 1)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, Direction.both, Interval!Date(Date(1998, 12, 29), Date(2011, 6, 30)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, Direction.both, Interval!Date(Date(1999, 2, 28), Date(2011, 4, 30)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, Direction.both, Interval!Date(Date(2001, 2, 28), Date(2009, 4, 30)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, Direction.both, Interval!Date(Date(2000, 12, 29), Date(2009, 6, 30)));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2011, 7, 1)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2011, 5, 1)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2009, 5, 1)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2009, 7, 1)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2011, 6, 30)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2011, 4, 30)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2009, 4, 30)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, Direction.fwd, Interval!Date(Date(2000, 1, 29), Date(2009, 6, 30)));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, Direction.bwd, Interval!Date(Date(1998, 12, 29), Date(2010, 5, 31)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, Direction.bwd, Interval!Date(Date(1999, 3, 1), Date(2010, 5, 31)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, Direction.bwd, Interval!Date(Date(2001, 3, 1), Date(2010, 5, 31)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, Direction.bwd, Interval!Date(Date(2000, 12, 29), Date(2010, 5, 31)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, Direction.bwd, Interval!Date(Date(1998, 12, 29), Date(2010, 5, 31)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, Direction.bwd, Interval!Date(Date(1999, 2, 28), Date(2010, 5, 31)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, Direction.bwd, Interval!Date(Date(2001, 2, 28), Date(2010, 5, 31)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, Direction.bwd, Interval!Date(Date(2000, 12, 29), Date(2010, 5, 31)));
}
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(!__traits(compiles, cInterval.expand(5)));
static assert(!__traits(compiles, iInterval.expand(5)));
//Verify Examples.
auto interval1 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
auto interval2 = Interval!Date(Date(1996, 1, 2), Date(2012, 3, 1));
interval1.expand(2);
assert(interval1 == Interval!Date(Date(1994, 1, 2), Date(2014, 3, 1)));
interval2.expand(-2);
assert(interval2 == Interval!Date(Date(1998, 1, 2), Date(2010, 3, 1)));
}
//Test Interval's fwdRange.
unittest
{
{
auto interval = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 21));
static void testInterval1(Interval!Date interval)
{
interval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
}
assertThrown!DateTimeException(testInterval1(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
static void testInterval2(Interval!Date interval)
{
interval.fwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri)).popFront();
}
assertThrown!DateTimeException(testInterval2(interval));
assert(!interval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri)).empty);
assert(interval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri), PopFirst.yes).empty);
assert(Interval!Date(Date(2010, 9, 12), Date(2010, 10, 1)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri)).front ==
Date(2010, 9, 12));
assert(Interval!Date(Date(2010, 9, 12), Date(2010, 10, 1)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri), PopFirst.yes).front ==
Date(2010, 9, 17));
}
//Verify Examples.
{
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = delegate (in Date date)
{
if((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
};
auto range = interval.fwdRange(func);
assert(range.front == Date(2010, 9, 1)); //An odd day. Using PopFirst.yes would have made this Date(2010, 9, 2).
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(range.empty);
}
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri))));
static assert(__traits(compiles, iInterval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri))));
}
//Test Interval's bwdRange.
unittest
{
{
auto interval = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 21));
static void testInterval1(Interval!Date interval)
{
interval.bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
}
assertThrown!DateTimeException(testInterval1(Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
static void testInterval2(Interval!Date interval)
{
interval.bwdRange(everyDayOfWeek!(Date, Direction.fwd)(DayOfWeek.fri)).popFront();
}
assertThrown!DateTimeException(testInterval2(interval));
assert(!interval.bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri)).empty);
assert(interval.bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri), PopFirst.yes).empty);
assert(Interval!Date(Date(2010, 9, 19), Date(2010, 10, 1)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri)).front ==
Date(2010, 10, 1));
assert(Interval!Date(Date(2010, 9, 19), Date(2010, 10, 1)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri), PopFirst.yes).front ==
Date(2010, 9, 24));
}
//Verify Examples.
{
auto interval = Interval!Date(Date(2010, 9, 1), Date(2010, 9, 9));
auto func = delegate (in Date date)
{
if((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
};
auto range = interval.bwdRange(func);
assert(range.front == Date(2010, 9, 9)); //An odd day. Using PopFirst.yes would have made this Date(2010, 9, 8).
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.empty);
}
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.bwdRange(everyDayOfWeek!Date(DayOfWeek.fri))));
static assert(__traits(compiles, iInterval.bwdRange(everyDayOfWeek!Date(DayOfWeek.fri))));
}
//Test Interval's toString().
unittest
{
assert(Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).toString() == "[2010-Jul-04 - 2012-Jan-07)");
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cInterval.toString()));
static assert(__traits(compiles, iInterval.toString()));
}
/++
Represents an interval of time which has positive infinity as its end point.
Any ranges which iterate over a $(D PosInfInterval) are infinite. So, the
main purpose of using $(D PosInfInterval) is to create an infinite range
which starts at a fixed point in time and goes to positive infinity.
+/
struct PosInfInterval(TP)
{
public:
/++
Params:
begin = The time point which begins the interval.
Examples:
--------------------
auto interval = PosInfInterval!Date(Date(1996, 1, 2));
--------------------
+/
this(in TP begin) pure nothrow
{
_begin = cast(TP)begin;
}
/++
Params:
rhs = The $(D PosInfInterval) to assign to this one.
+/
ref PosInfInterval opAssign(const ref PosInfInterval rhs) pure nothrow
{
_begin = cast(TP)rhs._begin;
return this;
}
/++
Params:
rhs = The $(D PosInfInterval) to assign to this one.
+/
ref PosInfInterval opAssign(PosInfInterval rhs) pure nothrow
{
_begin = cast(TP)rhs._begin;
return this;
}
/++
The starting point of the interval. It is included in the interval.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).begin == Date(1996, 1, 2));
--------------------
+/
@property TP begin() const pure nothrow
{
return cast(TP)_begin;
}
/++
The starting point of the interval. It is included in the interval.
Params:
timePoint = The time point to set $(D begin) to.
+/
@property void begin(TP timePoint) pure nothrow
{
_begin = timePoint;
}
/++
Whether the interval's length is 0. Always returns false.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).empty);
--------------------
+/
@property bool empty() const pure nothrow
{
return false;
}
/++
Whether the given time point is within this interval.
Params:
timePoint = The time point to check for inclusion in this interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(Date(1994, 12, 24)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(Date(2000, 1, 5)));
--------------------
+/
bool contains(TP timePoint) const pure nothrow
{
return timePoint >= _begin;
}
/++
Whether the given interval is completely within this interval.
Params:
interval = The interval to check for inclusion in this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(
Interval!Date(Date(1998, 2, 28), Date(2013, 5, 1))));
--------------------
+/
bool contains(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return interval._begin >= _begin;
}
/++
Whether the given interval is completely within this interval.
Params:
interval = The interval to check for inclusion in this interval.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(
PosInfInterval!Date(Date(1995, 7, 2))));
--------------------
+/
bool contains(in PosInfInterval interval) const pure nothrow
{
return interval._begin >= _begin;
}
/++
Whether the given interval is completely within this interval.
Always returns false because an interval going to positive infinity
can never contain an interval beginning at negative infinity.
Params:
interval = The interval to check for inclusion in this interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(
NegInfInterval!Date(Date(1996, 5, 4))));
--------------------
+/
bool contains(in NegInfInterval!TP interval) const pure nothrow
{
return false;
}
/++
Whether this interval is before the given time point.
Always returns false because an interval going to positive infinity
can never be before any time point.
Params:
timePoint = The time point to check whether this interval is before
it.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(Date(1994, 12, 24)));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(Date(2000, 1, 5)));
--------------------
+/
bool isBefore(in TP timePoint) const pure nothrow
{
return false;
}
/++
Whether this interval is before the given interval and does not
intersect it.
Always returns false (unless the given interval is empty) because an
interval going to positive infinity can never be before any other
interval.
Params:
interval = The interval to check for against this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
--------------------
+/
bool isBefore(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return false;
}
/++
Whether this interval is before the given interval and does not
intersect it.
Always returns false because an interval going to positive infinity can
never be before any other interval.
Params:
interval = The interval to check for against this interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(
PosInfInterval!Date(Date(1992, 5, 4))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(
PosInfInterval!Date(Date(2013, 3, 7))));
--------------------
+/
bool isBefore(in PosInfInterval interval) const pure nothrow
{
return false;
}
/++
Whether this interval is before the given interval and does not
intersect it.
Always returns false because an interval going to positive infinity can
never be before any other interval.
Params:
interval = The interval to check for against this interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(
NegInfInterval!Date(Date(1996, 5, 4))));
--------------------
+/
bool isBefore(in NegInfInterval!TP interval) const pure nothrow
{
return false;
}
/++
Whether this interval is after the given time point.
Params:
timePoint = The time point to check whether this interval is after
it.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Date(1994, 12, 24)));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Date(2000, 1, 5)));
--------------------
+/
bool isAfter(in TP timePoint) const pure nothrow
{
return timePoint < _begin;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Params:
interval = The interval to check against this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
--------------------
+/
bool isAfter(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return _begin >= interval._end;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Always returns false because an interval going to positive infinity can
never be after another interval going to positive infinity.
Params:
interval = The interval to check against this interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
PosInfInterval!Date(Date(1990, 1, 7))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
PosInfInterval!Date(Date(1999, 5, 4))));
--------------------
+/
bool isAfter(in PosInfInterval interval) const pure nothrow
{
return false;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Params:
interval = The interval to check against this interval.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
NegInfInterval!Date(Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(
NegInfInterval!Date(Date(2000, 7, 1))));
--------------------
+/
bool isAfter(in NegInfInterval!TP interval) const pure nothrow
{
return _begin >= interval._end;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).intersects(
Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
--------------------
+/
bool intersects(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return interval._end > _begin;
}
/++
Whether the given interval overlaps this interval.
Always returns true because two intervals going to positive infinity
always overlap.
Params:
interval = The interval to check for intersection with this
interval.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(
PosInfInterval!Date(Date(1990, 1, 7))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(
PosInfInterval!Date(Date(1999, 5, 4))));
--------------------
+/
bool intersects(in PosInfInterval interval) const pure nothrow
{
return true;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this
interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).intersects(
NegInfInterval!Date(Date(1996, 1, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(
NegInfInterval!Date(Date(2000, 7, 1))));
--------------------
+/
bool intersects(in NegInfInterval!TP interval) const pure nothrow
{
return _begin < interval._end;
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect or if
the given interval is empty.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
Interval!Date(Date(1996, 1 , 2), Date(2000, 8, 2)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) ==
Interval!Date(Date(1999, 1 , 12), Date(2011, 9, 17)));
--------------------
+/
Interval!TP intersection(in Interval!TP interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
auto begin = _begin > interval._begin ? _begin : interval._begin;
return Interval!TP(begin, interval._end);
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
PosInfInterval!Date(Date(1990, 7, 6))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
PosInfInterval!Date(Date(1999, 1, 12))) ==
PosInfInterval!Date(Date(1999, 1 , 12)));
--------------------
+/
PosInfInterval intersection(in PosInfInterval interval) const pure nothrow
{
return PosInfInterval(_begin < interval._begin ? interval._begin : _begin);
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
NegInfInterval!Date(Date(1999, 7, 6))) ==
Interval!Date(Date(1996, 1 , 2), Date(1999, 7, 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(
NegInfInterval!Date(Date(2013, 1, 12))) ==
Interval!Date(Date(1996, 1 , 2), Date(2013, 1, 12)));
--------------------
+/
Interval!TP intersection(in NegInfInterval!TP interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
return Interval!TP(_begin, interval._end);
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(
Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1999, 1, 12)).isAdjacent(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
--------------------
+/
bool isAdjacent(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return _begin == interval._end;
}
/++
Whether the given interval is adjacent to this interval.
Always returns false because two intervals going to positive infinity
can never be adjacent to one another.
Params:
interval = The interval to check whether its adjecent to this
interval.
Examples:
--------------------
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(
PosInfInterval!Date(Date(1990, 1, 7))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(
PosInfInterval!Date(Date(1996, 1, 2))));
--------------------
+/
bool isAdjacent(in PosInfInterval interval) const pure nothrow
{
return false;
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(
NegInfInterval!Date(Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(
NegInfInterval!Date(Date(2000, 7, 1))));
--------------------
+/
bool isAdjacent(in NegInfInterval!TP interval) const pure nothrow
{
return _begin == interval._end;
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect and are
not adjacent or if the given interval is empty.
Note:
There is no overload for $(D merge) which takes a
$(D NegInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
--------------------
+/
PosInfInterval merge(in Interval!TP interval) const
{
import std.format : format;
enforce(this.isAdjacent(interval) || this.intersects(interval),
new DateTimeException(format("%s and %s are not adjacent and do not intersect.", this, interval)));
return PosInfInterval(_begin < interval._begin ? _begin : interval._begin);
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Note:
There is no overload for $(D merge) which takes a
$(D NegInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(
PosInfInterval!Date(Date(1990, 7, 6))) ==
PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(
PosInfInterval!Date(Date(1999, 1, 12))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
--------------------
+/
PosInfInterval merge(in PosInfInterval interval) const pure nothrow
{
return PosInfInterval(_begin < interval._begin ? _begin : interval._begin);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this
interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Note:
There is no overload for $(D span) which takes a
$(D NegInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(
Interval!Date(Date(500, 8, 9), Date(1602, 1, 31))) ==
PosInfInterval!Date(Date(500, 8, 9)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
--------------------
+/
PosInfInterval span(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return PosInfInterval(_begin < interval._begin ? _begin : interval._begin);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this
interval.
Note:
There is no overload for $(D span) which takes a
$(D NegInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(
PosInfInterval!Date(Date(1990, 7, 6))) ==
PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(
PosInfInterval!Date(Date(1999, 1, 12))) ==
PosInfInterval!Date(Date(1996, 1 , 2)));
--------------------
+/
PosInfInterval span(in PosInfInterval interval) const pure nothrow
{
return PosInfInterval(_begin < interval._begin ? _begin : interval._begin);
}
/++
Shifts the $(D begin) of this interval forward or backwards in time by
the given duration (a positive duration shifts the interval forward; a
negative duration shifts it backward). Effectively, it does
$(D begin += duration).
Params:
duration = The duration to shift the interval by.
Examples:
--------------------
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.shift(dur!"days"(50));
assert(interval1 == PosInfInterval!Date(Date(1996, 2, 21)));
interval2.shift(dur!"days"(-50));
assert(interval2 == PosInfInterval!Date(Date(1995, 11, 13)));
--------------------
+/
void shift(D)(D duration) pure nothrow
if(__traits(compiles, begin + duration))
{
_begin += duration;
}
static if(__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
Shifts the $(D begin) of this interval forward or backwards in time
by the given number of years and/or months (a positive number of years
and months shifts the interval forward; a negative number shifts it
backward). It adds the years the given years and months to
$(D begin). It effectively calls $(D add!"years"()) and then
$(D add!"months"()) on $(D begin) with the given number of years and
months.
Params:
years = The number of years to shift the interval by.
months = The number of months to shift the interval by.
allowOverflow = Whether the days should be allowed to overflow
on $(D begin), causing its month to increment.
Throws:
$(LREF DateTimeException) if this interval is empty or if the
resulting interval would be invalid.
Examples:
--------------------
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.shift(dur!"days"(50));
assert(interval1 == PosInfInterval!Date(Date(1996, 2, 21)));
interval2.shift(dur!"days"(-50));
assert(interval2 == PosInfInterval!Date(Date(1995, 11, 13)));
--------------------
+/
void shift(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if(isIntegral!T)
{
auto begin = _begin;
begin.add!"years"(years, allowOverflow);
begin.add!"months"(months, allowOverflow);
_begin = begin;
}
}
/++
Expands the interval backwards in time. Effectively, it does
$(D begin -= duration).
Params:
duration = The duration to expand the interval by.
Examples:
--------------------
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.expand(dur!"days"(2));
assert(interval1 == PosInfInterval!Date(Date(1995, 12, 31)));
interval2.expand(dur!"days"(-2));
assert(interval2 == PosInfInterval!Date(Date(1996, 1, 4)));
--------------------
+/
void expand(D)(D duration) pure nothrow
if(__traits(compiles, begin + duration))
{
_begin -= duration;
}
static if(__traits(compiles, begin.add!"months"(1)) &&
__traits(compiles, begin.add!"years"(1)))
{
/++
Expands the interval forwards and/or backwards in time. Effectively,
it subtracts the given number of months/years from $(D begin).
Params:
years = The number of years to expand the interval by.
months = The number of months to expand the interval by.
allowOverflow = Whether the days should be allowed to overflow
on $(D begin), causing its month to increment.
Throws:
$(LREF DateTimeException) if this interval is empty or if the
resulting interval would be invalid.
Examples:
--------------------
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.expand(2);
assert(interval1 == PosInfInterval!Date(Date(1994, 1, 2)));
interval2.expand(-2);
assert(interval2 == PosInfInterval!Date(Date(1998, 1, 2)));
--------------------
+/
void expand(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if(isIntegral!T)
{
auto begin = _begin;
begin.add!"years"(-years, allowOverflow);
begin.add!"months"(-months, allowOverflow);
_begin = begin;
return;
}
}
/++
Returns a range which iterates forward over the interval, starting
at $(D begin), using $(D_PARAM func) to generate each successive time
point.
The range's $(D front) is the interval's $(D begin). $(D_PARAM func) is
used to generate the next $(D front) when $(D popFront) is called. If
$(D_PARAM popFirst) is $(D PopFirst.yes), then $(D popFront) is called
before the range is returned (so that $(D front) is a time point which
$(D_PARAM func) would generate).
If $(D_PARAM func) ever generates a time point less than or equal to the
current $(D front) of the range, then a $(LREF DateTimeException) will be
thrown.
There are helper functions in this module which generate common
delegates to pass to $(D fwdRange). Their documentation starts with
"Range-generating function," to make them easily searchable.
Params:
func = The function used to generate the time points of the
range over the interval.
popFirst = Whether $(D popFront) should be called on the range
before returning it.
Throws:
$(LREF DateTimeException) if this interval is empty.
Warning:
$(D_PARAM func) must be logically pure. Ideally, $(D_PARAM func)
would be a function pointer to a pure function, but forcing
$(D_PARAM func) to be pure is far too restrictive to be useful, and
in order to have the ease of use of having functions which generate
functions to pass to $(D fwdRange), $(D_PARAM func) must be a
delegate.
If $(D_PARAM func) retains state which changes as it is called, then
some algorithms will not work correctly, because the range's
$(D save) will have failed to have really saved the range's state.
To avoid such bugs, don't pass a delegate which is
not logically pure to $(D fwdRange). If $(D_PARAM func) is given the
same time point with two different calls, it must return the same
result both times.
Of course, none of the functions in this module have this problem,
so it's only relevant for custom delegates.
Examples:
--------------------
auto interval = PosInfInterval!Date(Date(2010, 9, 1));
auto func = (in Date date) //For iterating over even-numbered days.
{
if((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
};
auto range = interval.fwdRange(func);
//An odd day. Using PopFirst.yes would have made this Date(2010, 9, 2).
assert(range.front == Date(2010, 9, 1));
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(!range.empty);
--------------------
+/
PosInfIntervalRange!(TP) fwdRange(TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
{
auto range = PosInfIntervalRange!(TP)(this, func);
if(popFirst == PopFirst.yes)
range.popFront();
return range;
}
/+
Converts this interval to a string.
+/
//Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't
//have versions of toString() with extra modifiers, so we define one version
//with modifiers and one without.
string toString()
{
return _toStringImpl();
}
/++
Converts this interval to a string.
+/
//Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't
//have versions of toString() with extra modifiers, so we define one version
//with modifiers and one without.
string toString() const nothrow
{
return _toStringImpl();
}
private:
/+
Since we have two versions of toString(), we have _toStringImpl()
so that they can share implementations.
+/
string _toStringImpl() const nothrow
{
import std.format : format;
try
return format("[%s - ∞)", _begin);
catch(Exception e)
assert(0, "format() threw.");
}
TP _begin;
}
//Test PosInfInterval's constructor.
unittest
{
PosInfInterval!Date(Date.init);
PosInfInterval!TimeOfDay(TimeOfDay.init);
PosInfInterval!DateTime(DateTime.init);
PosInfInterval!SysTime(SysTime(0));
//Verify Examples.
auto interval = PosInfInterval!Date(Date(1996, 1, 2));
}
//Test PosInfInterval's begin.
unittest
{
assert(PosInfInterval!Date(Date(1, 1, 1)).begin == Date(1, 1, 1));
assert(PosInfInterval!Date(Date(2010, 1, 1)).begin == Date(2010, 1, 1));
assert(PosInfInterval!Date(Date(1997, 12, 31)).begin == Date(1997, 12, 31));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(__traits(compiles, cPosInfInterval.begin));
static assert(__traits(compiles, iPosInfInterval.begin));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).begin == Date(1996, 1, 2));
}
//Test PosInfInterval's empty.
unittest
{
assert(!PosInfInterval!Date(Date(2010, 1, 1)).empty);
assert(!PosInfInterval!TimeOfDay(TimeOfDay(0, 30, 0)).empty);
assert(!PosInfInterval!DateTime(DateTime(2010, 1, 1, 0, 30, 0)).empty);
assert(!PosInfInterval!SysTime(SysTime(DateTime(2010, 1, 1, 0, 30, 0))).empty);
const cPosInfInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iPosInfInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
static assert(__traits(compiles, cPosInfInterval.empty));
static assert(__traits(compiles, iPosInfInterval.empty));
//Verify Examples.
assert(!PosInfInterval!Date(Date(1996, 1, 2)).empty);
}
//Test PosInfInterval's contains(time point).
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
assert(!posInfInterval.contains(Date(2009, 7, 4)));
assert(!posInfInterval.contains(Date(2010, 7, 3)));
assert(posInfInterval.contains(Date(2010, 7, 4)));
assert(posInfInterval.contains(Date(2010, 7, 5)));
assert(posInfInterval.contains(Date(2011, 7, 1)));
assert(posInfInterval.contains(Date(2012, 1, 6)));
assert(posInfInterval.contains(Date(2012, 1, 7)));
assert(posInfInterval.contains(Date(2012, 1, 8)));
assert(posInfInterval.contains(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(__traits(compiles, posInfInterval.contains(cdate)));
static assert(__traits(compiles, cPosInfInterval.contains(cdate)));
static assert(__traits(compiles, iPosInfInterval.contains(cdate)));
//Verify Examples.
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(Date(1994, 12, 24)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(Date(2000, 1, 5)));
}
//Test PosInfInterval's contains(Interval).
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.contains(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(posInfInterval.contains(posInfInterval));
assert(!posInfInterval.contains(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!posInfInterval.contains(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!posInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!posInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!posInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!posInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(posInfInterval.contains(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(posInfInterval.contains(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(posInfInterval.contains(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(posInfInterval.contains(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(posInfInterval.contains(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(posInfInterval.contains(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!posInfInterval.contains(PosInfInterval!Date(Date(2010, 7, 3))));
assert(posInfInterval.contains(PosInfInterval!Date(Date(2010, 7, 4))));
assert(posInfInterval.contains(PosInfInterval!Date(Date(2010, 7, 5))));
assert(posInfInterval.contains(PosInfInterval!Date(Date(2012, 1, 6))));
assert(posInfInterval.contains(PosInfInterval!Date(Date(2012, 1, 7))));
assert(posInfInterval.contains(PosInfInterval!Date(Date(2012, 1, 8))));
assert(PosInfInterval!Date(Date(2010, 7, 3)).contains(posInfInterval));
assert(PosInfInterval!Date(Date(2010, 7, 4)).contains(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 5)).contains(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 6)).contains(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 7)).contains(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 8)).contains(posInfInterval));
assert(!posInfInterval.contains(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!posInfInterval.contains(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.contains(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.contains(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.contains(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.contains(NegInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.contains(interval)));
static assert(__traits(compiles, posInfInterval.contains(cInterval)));
static assert(__traits(compiles, posInfInterval.contains(iInterval)));
static assert(__traits(compiles, posInfInterval.contains(posInfInterval)));
static assert(__traits(compiles, posInfInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, posInfInterval.contains(negInfInterval)));
static assert(__traits(compiles, posInfInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, posInfInterval.contains(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(interval)));
static assert(__traits(compiles, cPosInfInterval.contains(cInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(iInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(negInfInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.contains(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(interval)));
static assert(__traits(compiles, iPosInfInterval.contains(cInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(iInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(negInfInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.contains(iNegInfInterval)));
//Verify Examples.
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(Interval!Date(Date(1998, 2, 28), Date(2013, 5, 1))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).contains(PosInfInterval!Date(Date(1999, 5, 4))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(PosInfInterval!Date(Date(1995, 7, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).contains(NegInfInterval!Date(Date(1996, 5, 4))));
}
//Test PosInfInterval's isBefore(time point).
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
assert(!posInfInterval.isBefore(Date(2009, 7, 3)));
assert(!posInfInterval.isBefore(Date(2010, 7, 3)));
assert(!posInfInterval.isBefore(Date(2010, 7, 4)));
assert(!posInfInterval.isBefore(Date(2010, 7, 5)));
assert(!posInfInterval.isBefore(Date(2011, 7, 1)));
assert(!posInfInterval.isBefore(Date(2012, 1, 6)));
assert(!posInfInterval.isBefore(Date(2012, 1, 7)));
assert(!posInfInterval.isBefore(Date(2012, 1, 8)));
assert(!posInfInterval.isBefore(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(__traits(compiles, posInfInterval.isBefore(cdate)));
static assert(__traits(compiles, cPosInfInterval.isBefore(cdate)));
static assert(__traits(compiles, iPosInfInterval.isBefore(cdate)));
//Verify Examples.
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(Date(1994, 12, 24)));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(Date(2000, 1, 5)));
}
//Test PosInfInterval's isBefore(Interval).
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.isBefore(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!posInfInterval.isBefore(posInfInterval));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!posInfInterval.isBefore(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!posInfInterval.isBefore(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!posInfInterval.isBefore(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.isBefore(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.isBefore(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.isBefore(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.isBefore(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!PosInfInterval!Date(Date(2010, 7, 3)).isBefore(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 4)).isBefore(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 5)).isBefore(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 6)).isBefore(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 7)).isBefore(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 8)).isBefore(posInfInterval));
assert(!posInfInterval.isBefore(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!posInfInterval.isBefore(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.isBefore(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.isBefore(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.isBefore(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.isBefore(NegInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.isBefore(interval)));
static assert(__traits(compiles, posInfInterval.isBefore(cInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(iInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, posInfInterval.isBefore(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(interval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(cInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(iInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isBefore(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(interval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(cInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(iInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isBefore(iNegInfInterval)));
//Verify Examples.
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(PosInfInterval!Date(Date(1992, 5, 4))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(PosInfInterval!Date(Date(2013, 3, 7))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isBefore(NegInfInterval!Date(Date(1996, 5, 4))));
}
//Test PosInfInterval's isAfter(time point).
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
assert(posInfInterval.isAfter(Date(2009, 7, 3)));
assert(posInfInterval.isAfter(Date(2010, 7, 3)));
assert(!posInfInterval.isAfter(Date(2010, 7, 4)));
assert(!posInfInterval.isAfter(Date(2010, 7, 5)));
assert(!posInfInterval.isAfter(Date(2011, 7, 1)));
assert(!posInfInterval.isAfter(Date(2012, 1, 6)));
assert(!posInfInterval.isAfter(Date(2012, 1, 7)));
assert(!posInfInterval.isAfter(Date(2012, 1, 8)));
assert(!posInfInterval.isAfter(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(__traits(compiles, posInfInterval.isAfter(cdate)));
static assert(__traits(compiles, cPosInfInterval.isAfter(cdate)));
static assert(__traits(compiles, iPosInfInterval.isAfter(cdate)));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Date(1994, 12, 24)));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Date(2000, 1, 5)));
}
//Test PosInfInterval's isAfter(Interval).
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.isAfter(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!posInfInterval.isAfter(posInfInterval));
assert(posInfInterval.isAfter(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(posInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!posInfInterval.isAfter(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!posInfInterval.isAfter(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!posInfInterval.isAfter(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.isAfter(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.isAfter(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.isAfter(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.isAfter(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!PosInfInterval!Date(Date(2010, 7, 3)).isAfter(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 4)).isAfter(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 5)).isAfter(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 6)).isAfter(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 7)).isAfter(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 8)).isAfter(posInfInterval));
assert(posInfInterval.isAfter(NegInfInterval!Date(Date(2010, 7, 3))));
assert(posInfInterval.isAfter(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.isAfter(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.isAfter(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.isAfter(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.isAfter(NegInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.isAfter(interval)));
static assert(__traits(compiles, posInfInterval.isAfter(cInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(iInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, posInfInterval.isAfter(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(interval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(cInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(iInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAfter(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(interval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(cInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(iInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAfter(iNegInfInterval)));
//Verify Examples.
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAfter(Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(PosInfInterval!Date(Date(1990, 1, 7))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(PosInfInterval!Date(Date(1999, 5, 4))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAfter(NegInfInterval!Date(Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAfter(NegInfInterval!Date(Date(2000, 7, 1))));
}
//Test PosInfInterval's intersects().
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.intersects(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(posInfInterval.intersects(posInfInterval));
assert(!posInfInterval.intersects(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(posInfInterval.intersects(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!posInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(posInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(posInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(posInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(posInfInterval.intersects(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(posInfInterval.intersects(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(posInfInterval.intersects(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(posInfInterval.intersects(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(posInfInterval.intersects(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(posInfInterval.intersects(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(posInfInterval.intersects(PosInfInterval!Date(Date(2010, 7, 3))));
assert(posInfInterval.intersects(PosInfInterval!Date(Date(2010, 7, 4))));
assert(posInfInterval.intersects(PosInfInterval!Date(Date(2010, 7, 5))));
assert(posInfInterval.intersects(PosInfInterval!Date(Date(2012, 1, 6))));
assert(posInfInterval.intersects(PosInfInterval!Date(Date(2012, 1, 7))));
assert(posInfInterval.intersects(PosInfInterval!Date(Date(2012, 1, 8))));
assert(PosInfInterval!Date(Date(2010, 7, 3)).intersects(posInfInterval));
assert(PosInfInterval!Date(Date(2010, 7, 4)).intersects(posInfInterval));
assert(PosInfInterval!Date(Date(2010, 7, 5)).intersects(posInfInterval));
assert(PosInfInterval!Date(Date(2012, 1, 6)).intersects(posInfInterval));
assert(PosInfInterval!Date(Date(2012, 1, 7)).intersects(posInfInterval));
assert(PosInfInterval!Date(Date(2012, 1, 8)).intersects(posInfInterval));
assert(!posInfInterval.intersects(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!posInfInterval.intersects(NegInfInterval!Date(Date(2010, 7, 4))));
assert(posInfInterval.intersects(NegInfInterval!Date(Date(2010, 7, 5))));
assert(posInfInterval.intersects(NegInfInterval!Date(Date(2012, 1, 6))));
assert(posInfInterval.intersects(NegInfInterval!Date(Date(2012, 1, 7))));
assert(posInfInterval.intersects(NegInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.intersects(interval)));
static assert(__traits(compiles, posInfInterval.intersects(cInterval)));
static assert(__traits(compiles, posInfInterval.intersects(iInterval)));
static assert(__traits(compiles, posInfInterval.intersects(posInfInterval)));
static assert(__traits(compiles, posInfInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, posInfInterval.intersects(negInfInterval)));
static assert(__traits(compiles, posInfInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, posInfInterval.intersects(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(interval)));
static assert(__traits(compiles, cPosInfInterval.intersects(cInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(iInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(negInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersects(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(interval)));
static assert(__traits(compiles, iPosInfInterval.intersects(cInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(iInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(negInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersects(iNegInfInterval)));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).intersects(Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(PosInfInterval!Date(Date(1990, 1, 7))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(PosInfInterval!Date(Date(1999, 5, 4))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).intersects(NegInfInterval!Date(Date(1996, 1, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersects(NegInfInterval!Date(Date(2000, 7, 1))));
}
//Test PosInfInterval's intersection().
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(I, J)(in I interval1, in J interval2)
{
interval1.intersection(interval2);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assertThrown!DateTimeException(testInterval(posInfInterval, NegInfInterval!Date(Date(2010, 7, 3))));
assertThrown!DateTimeException(testInterval(posInfInterval, NegInfInterval!Date(Date(2010, 7, 4))));
assert(posInfInterval.intersection(posInfInterval) ==
posInfInterval);
assert(posInfInterval.intersection(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
Interval!Date(Date(2010, 7, 4), Date(2013, 7, 3)));
assert(posInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 4), Date(2010, 7, 5)));
assert(posInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(posInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
assert(posInfInterval.intersection(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)));
assert(posInfInterval.intersection(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)));
assert(posInfInterval.intersection(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(posInfInterval.intersection(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8)));
assert(posInfInterval.intersection(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8)));
assert(posInfInterval.intersection(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))) ==
Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9)));
assert(posInfInterval.intersection(PosInfInterval!Date(Date(2010, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.intersection(PosInfInterval!Date(Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.intersection(PosInfInterval!Date(Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 5)));
assert(posInfInterval.intersection(PosInfInterval!Date(Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2012, 1, 6)));
assert(posInfInterval.intersection(PosInfInterval!Date(Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2012, 1, 7)));
assert(posInfInterval.intersection(PosInfInterval!Date(Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2012, 1, 8)));
assert(PosInfInterval!Date(Date(2010, 7, 3)).intersection(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2010, 7, 4)).intersection(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2010, 7, 5)).intersection(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 5)));
assert(PosInfInterval!Date(Date(2012, 1, 6)).intersection(posInfInterval) ==
PosInfInterval!Date(Date(2012, 1, 6)));
assert(PosInfInterval!Date(Date(2012, 1, 7)).intersection(posInfInterval) ==
PosInfInterval!Date(Date(2012, 1, 7)));
assert(PosInfInterval!Date(Date(2012, 1, 8)).intersection(posInfInterval) ==
PosInfInterval!Date(Date(2012, 1, 8)));
assert(posInfInterval.intersection(NegInfInterval!Date(Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 4), Date(2010, 7, 5)));
assert(posInfInterval.intersection(NegInfInterval!Date(Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 6)));
assert(posInfInterval.intersection(NegInfInterval!Date(Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)));
assert(posInfInterval.intersection(NegInfInterval!Date(Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1, 8)));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.intersection(interval)));
static assert(__traits(compiles, posInfInterval.intersection(cInterval)));
static assert(__traits(compiles, posInfInterval.intersection(iInterval)));
static assert(__traits(compiles, posInfInterval.intersection(posInfInterval)));
static assert(__traits(compiles, posInfInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, posInfInterval.intersection(negInfInterval)));
static assert(__traits(compiles, posInfInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, posInfInterval.intersection(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(interval)));
static assert(__traits(compiles, cPosInfInterval.intersection(cInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(iInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(negInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.intersection(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(interval)));
static assert(__traits(compiles, iPosInfInterval.intersection(cInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(iInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(negInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.intersection(iNegInfInterval)));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == Interval!Date(Date(1996, 1 , 2), Date(2000, 8, 2)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) == Interval!Date(Date(1999, 1 , 12), Date(2011, 9, 17)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(PosInfInterval!Date(Date(1990, 7, 6))) == PosInfInterval!Date(Date(1996, 1 , 2)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(PosInfInterval!Date(Date(1999, 1, 12))) == PosInfInterval!Date(Date(1999, 1 , 12)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(NegInfInterval!Date(Date(1999, 7, 6))) == Interval!Date(Date(1996, 1 , 2), Date(1999, 7, 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).intersection(NegInfInterval!Date(Date(2013, 1, 12))) == Interval!Date(Date(1996, 1 , 2), Date(2013, 1, 12)));
}
//Test PosInfInterval's isAdjacent().
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.isAdjacent(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!posInfInterval.isAdjacent(posInfInterval));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!posInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!posInfInterval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!posInfInterval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 8))));
assert(!PosInfInterval!Date(Date(2010, 7, 3)).isAdjacent(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 4)).isAdjacent(posInfInterval));
assert(!PosInfInterval!Date(Date(2010, 7, 5)).isAdjacent(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 6)).isAdjacent(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 7)).isAdjacent(posInfInterval));
assert(!PosInfInterval!Date(Date(2012, 1, 8)).isAdjacent(posInfInterval));
assert(!posInfInterval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 3))));
assert(posInfInterval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!posInfInterval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!posInfInterval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!posInfInterval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!posInfInterval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.isAdjacent(interval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, posInfInterval.isAdjacent(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(interval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.isAdjacent(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(interval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.isAdjacent(iNegInfInterval)));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(Interval!Date(Date(1989, 3, 1), Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1999, 1, 12)).isAdjacent(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(PosInfInterval!Date(Date(1990, 1, 7))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(PosInfInterval!Date(Date(1996, 1, 2))));
assert(PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(NegInfInterval!Date(Date(1996, 1, 2))));
assert(!PosInfInterval!Date(Date(1996, 1, 2)).isAdjacent(NegInfInterval!Date(Date(2000, 7, 1))));
}
//Test PosInfInterval's merge().
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.merge(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(posInfInterval.merge(posInfInterval) ==
posInfInterval);
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 1)));
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(PosInfInterval!Date(Date(2010, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.merge(PosInfInterval!Date(Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(PosInfInterval!Date(Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(PosInfInterval!Date(Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(PosInfInterval!Date(Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.merge(PosInfInterval!Date(Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2010, 7, 3)).merge(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(PosInfInterval!Date(Date(2010, 7, 4)).merge(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2010, 7, 5)).merge(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2012, 1, 6)).merge(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2012, 1, 7)).merge(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2012, 1, 8)).merge(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
static assert(!__traits(compiles, posInfInterval.merge(NegInfInterval!Date(Date(2010, 7, 3)))));
static assert(!__traits(compiles, posInfInterval.merge(NegInfInterval!Date(Date(2010, 7, 4)))));
static assert(!__traits(compiles, posInfInterval.merge(NegInfInterval!Date(Date(2010, 7, 5)))));
static assert(!__traits(compiles, posInfInterval.merge(NegInfInterval!Date(Date(2012, 1, 6)))));
static assert(!__traits(compiles, posInfInterval.merge(NegInfInterval!Date(Date(2012, 1, 7)))));
static assert(!__traits(compiles, posInfInterval.merge(NegInfInterval!Date(Date(2012, 1, 8)))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.merge(interval)));
static assert(__traits(compiles, posInfInterval.merge(cInterval)));
static assert(__traits(compiles, posInfInterval.merge(iInterval)));
static assert(__traits(compiles, posInfInterval.merge(posInfInterval)));
static assert(__traits(compiles, posInfInterval.merge(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.merge(iPosInfInterval)));
static assert(!__traits(compiles, posInfInterval.merge(negInfInterval)));
static assert(!__traits(compiles, posInfInterval.merge(cNegInfInterval)));
static assert(!__traits(compiles, posInfInterval.merge(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.merge(interval)));
static assert(__traits(compiles, cPosInfInterval.merge(cInterval)));
static assert(__traits(compiles, cPosInfInterval.merge(iInterval)));
static assert(__traits(compiles, cPosInfInterval.merge(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.merge(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.merge(iPosInfInterval)));
static assert(!__traits(compiles, cPosInfInterval.merge(negInfInterval)));
static assert(!__traits(compiles, cPosInfInterval.merge(cNegInfInterval)));
static assert(!__traits(compiles, cPosInfInterval.merge(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.merge(interval)));
static assert(__traits(compiles, iPosInfInterval.merge(cInterval)));
static assert(__traits(compiles, iPosInfInterval.merge(iInterval)));
static assert(__traits(compiles, iPosInfInterval.merge(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.merge(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.merge(iPosInfInterval)));
static assert(!__traits(compiles, iPosInfInterval.merge(negInfInterval)));
static assert(!__traits(compiles, iPosInfInterval.merge(cNegInfInterval)));
static assert(!__traits(compiles, iPosInfInterval.merge(iNegInfInterval)));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) == PosInfInterval!Date(Date(1996, 1 , 2)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(PosInfInterval!Date(Date(1990, 7, 6))) == PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).merge(PosInfInterval!Date(Date(1999, 1, 12))) == PosInfInterval!Date(Date(1996, 1 , 2)));
}
//Test PosInfInterval's span().
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(in PosInfInterval!Date posInfInterval, in Interval!Date interval)
{
posInfInterval.span(interval);
}
assertThrown!DateTimeException(testInterval(posInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(posInfInterval.span(posInfInterval) ==
posInfInterval);
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 1)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 1)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(PosInfInterval!Date(Date(2010, 7, 3))) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(posInfInterval.span(PosInfInterval!Date(Date(2010, 7, 4))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(PosInfInterval!Date(Date(2010, 7, 5))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(PosInfInterval!Date(Date(2012, 1, 6))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(PosInfInterval!Date(Date(2012, 1, 7))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(posInfInterval.span(PosInfInterval!Date(Date(2012, 1, 8))) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2010, 7, 3)).span(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 3)));
assert(PosInfInterval!Date(Date(2010, 7, 4)).span(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2010, 7, 5)).span(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2012, 1, 6)).span(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2012, 1, 7)).span(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
assert(PosInfInterval!Date(Date(2012, 1, 8)).span(posInfInterval) ==
PosInfInterval!Date(Date(2010, 7, 4)));
static assert(!__traits(compiles, posInfInterval.span(NegInfInterval!Date(Date(2010, 7, 3)))));
static assert(!__traits(compiles, posInfInterval.span(NegInfInterval!Date(Date(2010, 7, 4)))));
static assert(!__traits(compiles, posInfInterval.span(NegInfInterval!Date(Date(2010, 7, 5)))));
static assert(!__traits(compiles, posInfInterval.span(NegInfInterval!Date(Date(2012, 1, 6)))));
static assert(!__traits(compiles, posInfInterval.span(NegInfInterval!Date(Date(2012, 1, 7)))));
static assert(!__traits(compiles, posInfInterval.span(NegInfInterval!Date(Date(2012, 1, 8)))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, posInfInterval.span(interval)));
static assert(__traits(compiles, posInfInterval.span(cInterval)));
static assert(__traits(compiles, posInfInterval.span(iInterval)));
static assert(__traits(compiles, posInfInterval.span(posInfInterval)));
static assert(__traits(compiles, posInfInterval.span(cPosInfInterval)));
static assert(__traits(compiles, posInfInterval.span(iPosInfInterval)));
static assert(!__traits(compiles, posInfInterval.span(negInfInterval)));
static assert(!__traits(compiles, posInfInterval.span(cNegInfInterval)));
static assert(!__traits(compiles, posInfInterval.span(iNegInfInterval)));
static assert(__traits(compiles, cPosInfInterval.span(interval)));
static assert(__traits(compiles, cPosInfInterval.span(cInterval)));
static assert(__traits(compiles, cPosInfInterval.span(iInterval)));
static assert(__traits(compiles, cPosInfInterval.span(posInfInterval)));
static assert(__traits(compiles, cPosInfInterval.span(cPosInfInterval)));
static assert(__traits(compiles, cPosInfInterval.span(iPosInfInterval)));
static assert(!__traits(compiles, cPosInfInterval.span(negInfInterval)));
static assert(!__traits(compiles, cPosInfInterval.span(cNegInfInterval)));
static assert(!__traits(compiles, cPosInfInterval.span(iNegInfInterval)));
static assert(__traits(compiles, iPosInfInterval.span(interval)));
static assert(__traits(compiles, iPosInfInterval.span(cInterval)));
static assert(__traits(compiles, iPosInfInterval.span(iInterval)));
static assert(__traits(compiles, iPosInfInterval.span(posInfInterval)));
static assert(__traits(compiles, iPosInfInterval.span(cPosInfInterval)));
static assert(__traits(compiles, iPosInfInterval.span(iPosInfInterval)));
static assert(!__traits(compiles, iPosInfInterval.span(negInfInterval)));
static assert(!__traits(compiles, iPosInfInterval.span(cNegInfInterval)));
static assert(!__traits(compiles, iPosInfInterval.span(iNegInfInterval)));
//Verify Examples.
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(Interval!Date(Date(500, 8, 9), Date(1602, 1, 31))) == PosInfInterval!Date(Date(500, 8, 9)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))) == PosInfInterval!Date(Date(1996, 1 , 2)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(PosInfInterval!Date(Date(1990, 7, 6))) == PosInfInterval!Date(Date(1990, 7 , 6)));
assert(PosInfInterval!Date(Date(1996, 1, 2)).span(PosInfInterval!Date(Date(1999, 1, 12))) == PosInfInterval!Date(Date(1996, 1 , 2)));
}
//Test PosInfInterval's shift().
unittest
{
auto interval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(I)(I interval, in Duration duration, in I expected, size_t line = __LINE__)
{
interval.shift(duration);
assert(interval == expected);
}
testInterval(interval, dur!"days"(22), PosInfInterval!Date(Date(2010, 7, 26)));
testInterval(interval, dur!"days"(-22), PosInfInterval!Date(Date(2010, 6, 12)));
const cInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(!__traits(compiles, cInterval.shift(dur!"days"(5))));
static assert(!__traits(compiles, iInterval.shift(dur!"days"(5))));
//Verify Examples.
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.shift(dur!"days"(50));
assert(interval1 == PosInfInterval!Date(Date(1996, 2, 21)));
interval2.shift(dur!"days"(-50));
assert(interval2 == PosInfInterval!Date(Date(1995, 11, 13)));
}
//Test PosInfInterval's shift(int, int, AllowDayOverflow).
unittest
{
{
auto interval = PosInfInterval!Date(Date(2010, 7, 4));
static void testInterval(I)(I interval, int years, int months, AllowDayOverflow allow, in I expected, size_t line = __LINE__)
{
interval.shift(years, months, allow);
assert(interval == expected);
}
testInterval(interval, 5, 0, AllowDayOverflow.yes, PosInfInterval!Date(Date(2015, 7, 4)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, PosInfInterval!Date(Date(2005, 7, 4)));
auto interval2 = PosInfInterval!Date(Date(2000, 1, 29));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, PosInfInterval!Date(Date(2001, 3, 1)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, PosInfInterval!Date(Date(2000, 12, 29)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, PosInfInterval!Date(Date(1998, 12, 29)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, PosInfInterval!Date(Date(1999, 3, 1)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, PosInfInterval!Date(Date(2001, 2, 28)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, PosInfInterval!Date(Date(2000, 12, 29)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, PosInfInterval!Date(Date(1998, 12, 29)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, PosInfInterval!Date(Date(1999, 2, 28)));
}
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(!__traits(compiles, cPosInfInterval.shift(1)));
static assert(!__traits(compiles, iPosInfInterval.shift(1)));
//Verify Examples.
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.shift(2);
assert(interval1 == PosInfInterval!Date(Date(1998, 1, 2)));
interval2.shift(-2);
assert(interval2 == PosInfInterval!Date(Date(1994, 1, 2)));
}
//Test PosInfInterval's expand().
unittest
{
auto interval = PosInfInterval!Date(Date(2000, 7, 4));
static void testInterval(I)(I interval, in Duration duration, in I expected, size_t line = __LINE__)
{
interval.expand(duration);
assert(interval == expected);
}
testInterval(interval, dur!"days"(22), PosInfInterval!Date(Date(2000, 6, 12)));
testInterval(interval, dur!"days"(-22), PosInfInterval!Date(Date(2000, 7, 26)));
const cInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(!__traits(compiles, cInterval.expand(dur!"days"(5))));
static assert(!__traits(compiles, iInterval.expand(dur!"days"(5))));
//Verify Examples.
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.expand(dur!"days"(2));
assert(interval1 == PosInfInterval!Date(Date(1995, 12, 31)));
interval2.expand(dur!"days"(-2));
assert(interval2 == PosInfInterval!Date(Date(1996, 1, 4)));
}
//Test PosInfInterval's expand(int, int, AllowDayOverflow).
unittest
{
{
auto interval = PosInfInterval!Date(Date(2000, 7, 4));
static void testInterval(I)(I interval, int years, int months, AllowDayOverflow allow, in I expected, size_t line = __LINE__)
{
interval.expand(years, months, allow);
assert(interval == expected);
}
testInterval(interval, 5, 0, AllowDayOverflow.yes, PosInfInterval!Date(Date(1995, 7, 4)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, PosInfInterval!Date(Date(2005, 7, 4)));
auto interval2 = PosInfInterval!Date(Date(2000, 1, 29));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, PosInfInterval!Date(Date(1998, 12, 29)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, PosInfInterval!Date(Date(1999, 3, 1)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, PosInfInterval!Date(Date(2001, 3, 1)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, PosInfInterval!Date(Date(2000, 12, 29)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, PosInfInterval!Date(Date(1998, 12, 29)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, PosInfInterval!Date(Date(1999, 2, 28)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, PosInfInterval!Date(Date(2001, 2, 28)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, PosInfInterval!Date(Date(2000, 12, 29)));
}
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(!__traits(compiles, cPosInfInterval.expand(1)));
static assert(!__traits(compiles, iPosInfInterval.expand(1)));
//Verify Examples.
auto interval1 = PosInfInterval!Date(Date(1996, 1, 2));
auto interval2 = PosInfInterval!Date(Date(1996, 1, 2));
interval1.expand(2);
assert(interval1 == PosInfInterval!Date(Date(1994, 1, 2)));
interval2.expand(-2);
assert(interval2 == PosInfInterval!Date(Date(1998, 1, 2)));
}
//Test PosInfInterval's fwdRange().
unittest
{
auto posInfInterval = PosInfInterval!Date(Date(2010, 9, 19));
static void testInterval(PosInfInterval!Date posInfInterval)
{
posInfInterval.fwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri)).popFront();
}
assertThrown!DateTimeException(testInterval(posInfInterval));
assert(PosInfInterval!Date(Date(2010, 9, 12)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri)).front ==
Date(2010, 9, 12));
assert(PosInfInterval!Date(Date(2010, 9, 12)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri), PopFirst.yes).front ==
Date(2010, 9, 17));
//Verify Examples.
auto interval = PosInfInterval!Date(Date(2010, 9, 1));
auto func = delegate (in Date date)
{
if((date.day & 1) == 0)
return date + dur!"days"(2);
return date + dur!"days"(1);
};
auto range = interval.fwdRange(func);
assert(range.front == Date(2010, 9, 1)); //An odd day. Using PopFirst.yes would have made this Date(2010, 9, 2).
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(!range.empty);
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(__traits(compiles, cPosInfInterval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri))));
static assert(__traits(compiles, iPosInfInterval.fwdRange(everyDayOfWeek!Date(DayOfWeek.fri))));
}
//Test PosInfInterval's toString().
unittest
{
assert(PosInfInterval!Date(Date(2010, 7, 4)).toString() == "[2010-Jul-04 - ∞)");
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
static assert(__traits(compiles, cPosInfInterval.toString()));
static assert(__traits(compiles, iPosInfInterval.toString()));
}
/++
Represents an interval of time which has negative infinity as its starting
point.
Any ranges which iterate over a $(D NegInfInterval) are infinite. So, the
main purpose of using $(D NegInfInterval) is to create an infinite range
which starts at negative infinity and goes to a fixed end point.
Iterate over it in reverse.
+/
struct NegInfInterval(TP)
{
public:
/++
Params:
end = The time point which ends the interval.
Examples:
--------------------
auto interval = PosInfInterval!Date(Date(1996, 1, 2));
--------------------
+/
this(in TP end) pure nothrow
{
_end = cast(TP)end;
}
/++
Params:
rhs = The $(D NegInfInterval) to assign to this one.
+/
ref NegInfInterval opAssign(const ref NegInfInterval rhs) pure nothrow
{
_end = cast(TP)rhs._end;
return this;
}
/++
Params:
rhs = The $(D NegInfInterval) to assign to this one.
+/
ref NegInfInterval opAssign(NegInfInterval rhs) pure nothrow
{
_end = cast(TP)rhs._end;
return this;
}
/++
The end point of the interval. It is excluded from the interval.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).end == Date(2012, 3, 1));
--------------------
+/
@property TP end() const pure nothrow
{
return cast(TP)_end;
}
/++
The end point of the interval. It is excluded from the interval.
Params:
timePoint = The time point to set end to.
+/
@property void end(TP timePoint) pure nothrow
{
_end = timePoint;
}
/++
Whether the interval's length is 0. Always returns false.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(1996, 1, 2)).empty);
--------------------
+/
@property bool empty() const pure nothrow
{
return false;
}
/++
Whether the given time point is within this interval.
Params:
timePoint = The time point to check for inclusion in this interval.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(Date(1994, 12, 24)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(Date(2000, 1, 5)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(Date(2012, 3, 1)));
--------------------
+/
bool contains(TP timePoint) const pure nothrow
{
return timePoint < _end;
}
/++
Whether the given interval is completely within this interval.
Params:
interval = The interval to check for inclusion in this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(
Interval!Date(Date(1998, 2, 28), Date(2013, 5, 1))));
--------------------
+/
bool contains(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return interval._end <= _end;
}
/++
Whether the given interval is completely within this interval.
Always returns false because an interval beginning at negative
infinity can never contain an interval going to positive infinity.
Params:
interval = The interval to check for inclusion in this interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(
PosInfInterval!Date(Date(1999, 5, 4))));
--------------------
+/
bool contains(in PosInfInterval!TP interval) const pure nothrow
{
return false;
}
/++
Whether the given interval is completely within this interval.
Params:
interval = The interval to check for inclusion in this interval.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(
NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(
NegInfInterval!Date(Date(2013, 7, 9))));
--------------------
+/
bool contains(in NegInfInterval interval) const pure nothrow
{
return interval._end <= _end;
}
/++
Whether this interval is before the given time point.
Params:
timePoint = The time point to check whether this interval is
before it.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Date(1994, 12, 24)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Date(2000, 1, 5)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Date(2012, 3, 1)));
--------------------
+/
bool isBefore(in TP timePoint) const pure nothrow
{
return timePoint >= _end;
}
/++
Whether this interval is before the given interval and does not
intersect it.
Params:
interval = The interval to check for against this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
--------------------
+/
bool isBefore(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return _end <= interval._begin;
}
/++
Whether this interval is before the given interval and does not
intersect it.
Params:
interval = The interval to check for against this interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
PosInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool isBefore(in PosInfInterval!TP interval) const pure nothrow
{
return _end <= interval._begin;
}
/++
Whether this interval is before the given interval and does not
intersect it.
Always returns false because an interval beginning at negative
infinity can never be before another interval beginning at negative
infinity.
Params:
interval = The interval to check for against this interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(
NegInfInterval!Date(Date(2013, 7, 9))));
--------------------
+/
bool isBefore(in NegInfInterval interval) const pure nothrow
{
return false;
}
/++
Whether this interval is after the given time point.
Always returns false because an interval beginning at negative infinity
can never be after any time point.
Params:
timePoint = The time point to check whether this interval is after
it.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Date(1994, 12, 24)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Date(2000, 1, 5)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Date(2012, 3, 1)));
--------------------
+/
bool isAfter(in TP timePoint) const pure nothrow
{
return false;
}
/++
Whether this interval is after the given interval and does not
intersect it.
Always returns false (unless the given interval is empty) because an
interval beginning at negative infinity can never be after any other
interval.
Params:
interval = The interval to check against this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
--------------------
+/
bool isAfter(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return false;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Always returns false because an interval beginning at negative infinity
can never be after any other interval.
Params:
interval = The interval to check against this interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
PosInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool isAfter(in PosInfInterval!TP interval) const pure nothrow
{
return false;
}
/++
Whether this interval is after the given interval and does not intersect
it.
Always returns false because an interval beginning at negative infinity
can never be after any other interval.
Params:
interval = The interval to check against this interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(
NegInfInterval!Date(Date(2013, 7, 9))));
--------------------
+/
bool isAfter(in NegInfInterval interval) const pure nothrow
{
return false;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(
Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).intersects(
Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
--------------------
+/
bool intersects(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return interval._begin < _end;
}
/++
Whether the given interval overlaps this interval.
Params:
interval = The interval to check for intersection with this
interval.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).intersects(
PosInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool intersects(in PosInfInterval!TP interval) const pure nothrow
{
return interval._begin < _end;
}
/++
Whether the given interval overlaps this interval.
Always returns true because two intervals beginning at negative infinity
always overlap.
Params:
interval = The interval to check for intersection with this interval.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(
NegInfInterval!Date(Date(1996, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(
NegInfInterval!Date(Date(2013, 7, 9))));
--------------------
+/
bool intersects(in NegInfInterval!TP interval) const pure nothrow
{
return true;
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect or if
the given interval is empty.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
Interval!Date(Date(1990, 7 , 6), Date(2000, 8, 2)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(
Interval!Date(Date(1999, 1, 12), Date(2015, 9, 2))) ==
Interval!Date(Date(1999, 1 , 12), Date(2012, 3, 1)));
--------------------
+/
Interval!TP intersection(in Interval!TP interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
auto end = _end < interval._end ? _end : interval._end;
return Interval!TP(interval._begin, end);
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(
PosInfInterval!Date(Date(1990, 7, 6))) ==
Interval!Date(Date(1990, 7 , 6), Date(2012, 3, 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(
PosInfInterval!Date(Date(1999, 1, 12))) ==
Interval!Date(Date(1999, 1 , 12), Date(2012, 3, 1)));
--------------------
+/
Interval!TP intersection(in PosInfInterval!TP interval) const
{
import std.format : format;
enforce(this.intersects(interval), new DateTimeException(format("%s and %s do not intersect.", this, interval)));
return Interval!TP(interval._begin, _end);
}
/++
Returns the intersection of two intervals
Params:
interval = The interval to intersect with this interval.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(
NegInfInterval!Date(Date(1999, 7, 6))) ==
NegInfInterval!Date(Date(1999, 7 , 6)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(
NegInfInterval!Date(Date(2013, 1, 12))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
--------------------
+/
NegInfInterval intersection(in NegInfInterval interval) const nothrow
{
return NegInfInterval(_end < interval._end ? _end : interval._end);
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(1999, 1, 12), Date(2012, 3, 1))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(2012, 3, 1), Date(2019, 2, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
--------------------
+/
bool isAdjacent(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return interval._begin == _end;
}
/++
Whether the given interval is adjacent to this interval.
Params:
interval = The interval to check whether its adjecent to this
interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
PosInfInterval!Date(Date(1999, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
PosInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool isAdjacent(in PosInfInterval!TP interval) const pure nothrow
{
return interval._begin == _end;
}
/++
Whether the given interval is adjacent to this interval.
Always returns false because two intervals beginning at negative
infinity can never be adjacent to one another.
Params:
interval = The interval to check whether its adjecent to this
interval.
Examples:
--------------------
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(
NegInfInterval!Date(Date(2012, 3, 1))));
--------------------
+/
bool isAdjacent(in NegInfInterval interval) const pure nothrow
{
return false;
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Throws:
$(LREF DateTimeException) if the two intervals do not intersect and are
not adjacent or if the given interval is empty.
Note:
There is no overload for $(D merge) which takes a
$(D PosInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(
Interval!Date(Date(1999, 1, 12), Date(2015, 9, 2))) ==
NegInfInterval!Date(Date(2015, 9 , 2)));
--------------------
+/
NegInfInterval merge(in Interval!TP interval) const
{
import std.format : format;
enforce(this.isAdjacent(interval) || this.intersects(interval),
new DateTimeException(format("%s and %s are not adjacent and do not intersect.", this, interval)));
return NegInfInterval(_end > interval._end ? _end : interval._end);
}
/++
Returns the union of two intervals
Params:
interval = The interval to merge with this interval.
Note:
There is no overload for $(D merge) which takes a
$(D PosInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(
NegInfInterval!Date(Date(1999, 7, 6))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(
NegInfInterval!Date(Date(2013, 1, 12))) ==
NegInfInterval!Date(Date(2013, 1 , 12)));
--------------------
+/
NegInfInterval merge(in NegInfInterval interval) const pure nothrow
{
return NegInfInterval(_end > interval._end ? _end : interval._end);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this
interval.
Throws:
$(LREF DateTimeException) if the given interval is empty.
Note:
There is no overload for $(D span) which takes a
$(D PosInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(
Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(
Interval!Date(Date(1999, 1, 12), Date(2015, 9, 2))) ==
NegInfInterval!Date(Date(2015, 9 , 2)));
assert(NegInfInterval!Date(Date(1600, 1, 7)).span(
Interval!Date(Date(2012, 3, 11), Date(2017, 7, 1))) ==
NegInfInterval!Date(Date(2017, 7 , 1)));
--------------------
+/
NegInfInterval span(in Interval!TP interval) const pure
{
interval._enforceNotEmpty();
return NegInfInterval(_end > interval._end ? _end : interval._end);
}
/++
Returns an interval that covers from the earliest time point of two
intervals up to (but not including) the latest time point of two
intervals.
Params:
interval = The interval to create a span together with this
interval.
Note:
There is no overload for $(D span) which takes a
$(D PosInfInterval), because an interval
going from negative infinity to positive infinity
is not possible.
Examples:
--------------------
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(
NegInfInterval!Date(Date(1999, 7, 6))) ==
NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(
NegInfInterval!Date(Date(2013, 1, 12))) ==
NegInfInterval!Date(Date(2013, 1 , 12)));
--------------------
+/
NegInfInterval span(in NegInfInterval interval) const pure nothrow
{
return NegInfInterval(_end > interval._end ? _end : interval._end);
}
/++
Shifts the $(D end) of this interval forward or backwards in time by the
given duration (a positive duration shifts the interval forward; a
negative duration shifts it backward). Effectively, it does
$(D end += duration).
Params:
duration = The duration to shift the interval by.
Examples:
--------------------
auto interval1 = NegInfInterval!Date(Date(2012, 4, 5));
auto interval2 = NegInfInterval!Date(Date(2012, 4, 5));
interval1.shift(dur!"days"(50));
assert(interval1 == NegInfInterval!Date(Date(2012, 5, 25)));
interval2.shift(dur!"days"(-50));
assert(interval2 == NegInfInterval!Date( Date(2012, 2, 15)));
--------------------
+/
void shift(D)(D duration) pure nothrow
if(__traits(compiles, end + duration))
{
_end += duration;
}
static if(__traits(compiles, end.add!"months"(1)) &&
__traits(compiles, end.add!"years"(1)))
{
/++
Shifts the $(D end) of this interval forward or backwards in time by
the given number of years and/or months (a positive number of years
and months shifts the interval forward; a negative number shifts it
backward). It adds the years the given years and months to end. It
effectively calls $(D add!"years"()) and then $(D add!"months"())
on end with the given number of years and months.
Params:
years = The number of years to shift the interval by.
months = The number of months to shift the interval by.
allowOverflow = Whether the days should be allowed to overflow
on $(D end), causing its month to increment.
Throws:
$(LREF DateTimeException) if empty is true or if the resulting
interval would be invalid.
Examples:
--------------------
auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));
interval1.shift(2);
assert(interval1 == NegInfInterval!Date(Date(2014, 3, 1)));
interval2.shift(-2);
assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
--------------------
+/
void shift(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if(isIntegral!T)
{
auto end = _end;
end.add!"years"(years, allowOverflow);
end.add!"months"(months, allowOverflow);
_end = end;
}
}
/++
Expands the interval forwards in time. Effectively, it does
$(D end += duration).
Params:
duration = The duration to expand the interval by.
Examples:
--------------------
auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));
interval1.expand(dur!"days"(2));
assert(interval1 == NegInfInterval!Date(Date(2012, 3, 3)));
interval2.expand(dur!"days"(-2));
assert(interval2 == NegInfInterval!Date(Date(2012, 2, 28)));
--------------------
+/
void expand(D)(D duration) pure nothrow
if(__traits(compiles, end + duration))
{
_end += duration;
}
static if(__traits(compiles, end.add!"months"(1)) &&
__traits(compiles, end.add!"years"(1)))
{
/++
Expands the interval forwards and/or backwards in time. Effectively,
it adds the given number of months/years to end.
Params:
years = The number of years to expand the interval by.
months = The number of months to expand the interval by.
allowOverflow = Whether the days should be allowed to overflow
on $(D end), causing their month to increment.
Throws:
$(LREF DateTimeException) if empty is true or if the resulting
interval would be invalid.
Examples:
--------------------
auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));
interval1.expand(2);
assert(interval1 == NegInfInterval!Date(Date(2014, 3, 1)));
interval2.expand(-2);
assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
--------------------
+/
void expand(T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
if(isIntegral!T)
{
auto end = _end;
end.add!"years"(years, allowOverflow);
end.add!"months"(months, allowOverflow);
_end = end;
return;
}
}
/++
Returns a range which iterates backwards over the interval, starting
at $(D end), using $(D_PARAM func) to generate each successive time
point.
The range's $(D front) is the interval's $(D end). $(D_PARAM func) is
used to generate the next $(D front) when $(D popFront) is called. If
$(D_PARAM popFirst) is $(D PopFirst.yes), then $(D popFront) is called
before the range is returned (so that $(D front) is a time point which
$(D_PARAM func) would generate).
If $(D_PARAM func) ever generates a time point greater than or equal to
the current $(D front) of the range, then a $(LREF DateTimeException) will
be thrown.
There are helper functions in this module which generate common
delegates to pass to $(D bwdRange). Their documentation starts with
"Range-generating function," to make them easily searchable.
Params:
func = The function used to generate the time points of the
range over the interval.
popFirst = Whether $(D popFront) should be called on the range
before returning it.
Throws:
$(LREF DateTimeException) if this interval is empty.
Warning:
$(D_PARAM func) must be logically pure. Ideally, $(D_PARAM func)
would be a function pointer to a pure function, but forcing
$(D_PARAM func) to be pure is far too restrictive to be useful, and
in order to have the ease of use of having functions which generate
functions to pass to $(D fwdRange), $(D_PARAM func) must be a
delegate.
If $(D_PARAM func) retains state which changes as it is called, then
some algorithms will not work correctly, because the range's
$(D save) will have failed to have really saved the range's state.
To avoid such bugs, don't pass a delegate which is
not logically pure to $(D fwdRange). If $(D_PARAM func) is given the
same time point with two different calls, it must return the same
result both times.
Of course, none of the functions in this module have this problem,
so it's only relevant for custom delegates.
Examples:
--------------------
auto interval = NegInfInterval!Date(Date(2010, 9, 9));
auto func = (in Date date) //For iterating over even-numbered days.
{
if((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
};
auto range = interval.bwdRange(func);
assert(range.front == Date(2010, 9, 9)); //An odd day. Using PopFirst.yes would have made this Date(2010, 9, 8).
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(!range.empty);
--------------------
+/
NegInfIntervalRange!(TP) bwdRange(TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
{
auto range = NegInfIntervalRange!(TP)(this, func);
if(popFirst == PopFirst.yes)
range.popFront();
return range;
}
/+
Converts this interval to a string.
+/
//Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't
//have versions of toString() with extra modifiers, so we define one version
//with modifiers and one without.
string toString()
{
return _toStringImpl();
}
/++
Converts this interval to a string.
+/
//Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't
//have versions of toString() with extra modifiers, so we define one version
//with modifiers and one without.
string toString() const nothrow
{
return _toStringImpl();
}
private:
/+
Since we have two versions of toString(), we have _toStringImpl()
so that they can share implementations.
+/
string _toStringImpl() const nothrow
{
import std.format : format;
try
return format("[-∞ - %s)", _end);
catch(Exception e)
assert(0, "format() threw.");
}
TP _end;
}
//Test NegInfInterval's constructor.
unittest
{
NegInfInterval!Date(Date.init);
NegInfInterval!TimeOfDay(TimeOfDay.init);
NegInfInterval!DateTime(DateTime.init);
NegInfInterval!SysTime(SysTime(0));
}
//Test NegInfInterval's end.
unittest
{
assert(NegInfInterval!Date(Date(2010, 1, 1)).end == Date(2010, 1, 1));
assert(NegInfInterval!Date(Date(2010, 1, 1)).end == Date(2010, 1, 1));
assert(NegInfInterval!Date(Date(1998, 1, 1)).end == Date(1998, 1, 1));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, cNegInfInterval.end));
static assert(__traits(compiles, iNegInfInterval.end));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).end == Date(2012, 3, 1));
}
//Test NegInfInterval's empty.
unittest
{
assert(!NegInfInterval!Date(Date(2010, 1, 1)).empty);
assert(!NegInfInterval!TimeOfDay(TimeOfDay(0, 30, 0)).empty);
assert(!NegInfInterval!DateTime(DateTime(2010, 1, 1, 0, 30, 0)).empty);
assert(!NegInfInterval!SysTime(SysTime(DateTime(2010, 1, 1, 0, 30, 0))).empty);
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, cNegInfInterval.empty));
static assert(__traits(compiles, iNegInfInterval.empty));
//Verify Examples.
assert(!NegInfInterval!Date(Date(1996, 1, 2)).empty);
}
//Test NegInfInterval's contains(time point).
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
assert(negInfInterval.contains(Date(2009, 7, 4)));
assert(negInfInterval.contains(Date(2010, 7, 3)));
assert(negInfInterval.contains(Date(2010, 7, 4)));
assert(negInfInterval.contains(Date(2010, 7, 5)));
assert(negInfInterval.contains(Date(2011, 7, 1)));
assert(negInfInterval.contains(Date(2012, 1, 6)));
assert(!negInfInterval.contains(Date(2012, 1, 7)));
assert(!negInfInterval.contains(Date(2012, 1, 8)));
assert(!negInfInterval.contains(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.contains(cdate)));
static assert(__traits(compiles, cNegInfInterval.contains(cdate)));
static assert(__traits(compiles, iNegInfInterval.contains(cdate)));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(Date(1994, 12, 24)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(Date(2000, 1, 5)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(Date(2012, 3, 1)));
}
//Test NegInfInterval's contains(Interval).
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(in NegInfInterval!Date negInfInterval, in Interval!Date interval)
{
negInfInterval.contains(interval);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(negInfInterval.contains(negInfInterval));
assert(negInfInterval.contains(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!negInfInterval.contains(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(negInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(negInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(negInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!negInfInterval.contains(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(negInfInterval.contains(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(negInfInterval.contains(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(negInfInterval.contains(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!negInfInterval.contains(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!negInfInterval.contains(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!negInfInterval.contains(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(negInfInterval.contains(NegInfInterval!Date(Date(2010, 7, 3))));
assert(negInfInterval.contains(NegInfInterval!Date(Date(2010, 7, 4))));
assert(negInfInterval.contains(NegInfInterval!Date(Date(2010, 7, 5))));
assert(negInfInterval.contains(NegInfInterval!Date(Date(2012, 1, 6))));
assert(negInfInterval.contains(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.contains(NegInfInterval!Date(Date(2012, 1, 8))));
assert(!NegInfInterval!Date(Date(2010, 7, 3)).contains(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 4)).contains(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 5)).contains(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 6)).contains(negInfInterval));
assert(NegInfInterval!Date(Date(2012, 1, 7)).contains(negInfInterval));
assert(NegInfInterval!Date(Date(2012, 1, 8)).contains(negInfInterval));
assert(!negInfInterval.contains(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.contains(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.contains(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.contains(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!negInfInterval.contains(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.contains(PosInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.contains(interval)));
static assert(__traits(compiles, negInfInterval.contains(cInterval)));
static assert(__traits(compiles, negInfInterval.contains(iInterval)));
static assert(__traits(compiles, negInfInterval.contains(posInfInterval)));
static assert(__traits(compiles, negInfInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, negInfInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.contains(negInfInterval)));
static assert(__traits(compiles, negInfInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.contains(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(interval)));
static assert(__traits(compiles, cNegInfInterval.contains(cInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(iInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(posInfInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.contains(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(interval)));
static assert(__traits(compiles, iNegInfInterval.contains(cInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(iInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(posInfInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(cPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.contains(iNegInfInterval)));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(Interval!Date(Date(1998, 2, 28), Date(2013, 5, 1))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(PosInfInterval!Date(Date(1999, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).contains(NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).contains(NegInfInterval!Date(Date(2013, 7, 9))));
}
//Test NegInfInterval's isBefore(time point).
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
assert(!negInfInterval.isBefore(Date(2009, 7, 4)));
assert(!negInfInterval.isBefore(Date(2010, 7, 3)));
assert(!negInfInterval.isBefore(Date(2010, 7, 4)));
assert(!negInfInterval.isBefore(Date(2010, 7, 5)));
assert(!negInfInterval.isBefore(Date(2011, 7, 1)));
assert(!negInfInterval.isBefore(Date(2012, 1, 6)));
assert(negInfInterval.isBefore(Date(2012, 1, 7)));
assert(negInfInterval.isBefore(Date(2012, 1, 8)));
assert(negInfInterval.isBefore(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.isBefore(cdate)));
static assert(__traits(compiles, cNegInfInterval.isBefore(cdate)));
static assert(__traits(compiles, iNegInfInterval.isBefore(cdate)));
//Verify Examples.
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Date(1994, 12, 24)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Date(2000, 1, 5)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Date(2012, 3, 1)));
}
//Test NegInfInterval's isBefore(Interval).
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(in NegInfInterval!Date negInfInterval, in Interval!Date interval)
{
negInfInterval.isBefore(interval);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!negInfInterval.isBefore(negInfInterval));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!negInfInterval.isBefore(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(negInfInterval.isBefore(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(negInfInterval.isBefore(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!negInfInterval.isBefore(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.isBefore(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.isBefore(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.isBefore(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!negInfInterval.isBefore(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.isBefore(NegInfInterval!Date(Date(2012, 1, 8))));
assert(!NegInfInterval!Date(Date(2010, 7, 3)).isBefore(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 4)).isBefore(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 5)).isBefore(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 6)).isBefore(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 7)).isBefore(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 8)).isBefore(negInfInterval));
assert(!negInfInterval.isBefore(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.isBefore(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.isBefore(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.isBefore(PosInfInterval!Date(Date(2012, 1, 6))));
assert(negInfInterval.isBefore(PosInfInterval!Date(Date(2012, 1, 7))));
assert(negInfInterval.isBefore(PosInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.isBefore(interval)));
static assert(__traits(compiles, negInfInterval.isBefore(cInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(iInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.isBefore(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(interval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(cInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(iInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isBefore(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(interval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(cInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(iInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(posInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(cPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isBefore(iNegInfInterval)));
//Verify Examples.
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isBefore(Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(PosInfInterval!Date(Date(1999, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isBefore(PosInfInterval!Date(Date(2012, 3, 1))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isBefore(NegInfInterval!Date(Date(2013, 7, 9))));
}
//Test NegInfInterval's isAfter(time point).
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
assert(!negInfInterval.isAfter(Date(2009, 7, 4)));
assert(!negInfInterval.isAfter(Date(2010, 7, 3)));
assert(!negInfInterval.isAfter(Date(2010, 7, 4)));
assert(!negInfInterval.isAfter(Date(2010, 7, 5)));
assert(!negInfInterval.isAfter(Date(2011, 7, 1)));
assert(!negInfInterval.isAfter(Date(2012, 1, 6)));
assert(!negInfInterval.isAfter(Date(2012, 1, 7)));
assert(!negInfInterval.isAfter(Date(2012, 1, 8)));
assert(!negInfInterval.isAfter(Date(2013, 1, 7)));
const cdate = Date(2010, 7, 6);
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.isAfter(cdate)));
static assert(__traits(compiles, cNegInfInterval.isAfter(cdate)));
static assert(__traits(compiles, iNegInfInterval.isAfter(cdate)));
}
//Test NegInfInterval's isAfter(Interval).
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(in NegInfInterval!Date negInfInterval, in Interval!Date interval)
{
negInfInterval.isAfter(interval);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!negInfInterval.isAfter(negInfInterval));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!negInfInterval.isAfter(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!negInfInterval.isAfter(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.isAfter(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.isAfter(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.isAfter(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!negInfInterval.isAfter(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.isAfter(NegInfInterval!Date(Date(2012, 1, 8))));
assert(!NegInfInterval!Date(Date(2010, 7, 3)).isAfter(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 4)).isAfter(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 5)).isAfter(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 6)).isAfter(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 7)).isAfter(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 8)).isAfter(negInfInterval));
assert(!negInfInterval.isAfter(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.isAfter(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.isAfter(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.isAfter(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!negInfInterval.isAfter(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.isAfter(PosInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.isAfter(interval)));
static assert(__traits(compiles, negInfInterval.isAfter(cInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(iInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.isAfter(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(interval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(cInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(iInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAfter(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(interval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(cInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(iInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(posInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(cPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAfter(iNegInfInterval)));
//Verify Examples.
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Date(1994, 12, 24)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Date(2000, 1, 5)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Date(2012, 3, 1)));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(PosInfInterval!Date(Date(1999, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(PosInfInterval!Date(Date(2012, 3, 1))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAfter(NegInfInterval!Date(Date(2013, 7, 9))));
}
//Test NegInfInterval's intersects().
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(in NegInfInterval!Date negInfInterval, in Interval!Date interval)
{
negInfInterval.intersects(interval);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(negInfInterval.intersects(negInfInterval));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(negInfInterval.intersects(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(negInfInterval.intersects(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(negInfInterval.intersects(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(!negInfInterval.intersects(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!negInfInterval.intersects(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(negInfInterval.intersects(NegInfInterval!Date(Date(2010, 7, 3))));
assert(negInfInterval.intersects(NegInfInterval!Date(Date(2010, 7, 4))));
assert(negInfInterval.intersects(NegInfInterval!Date(Date(2010, 7, 5))));
assert(negInfInterval.intersects(NegInfInterval!Date(Date(2012, 1, 6))));
assert(negInfInterval.intersects(NegInfInterval!Date(Date(2012, 1, 7))));
assert(negInfInterval.intersects(NegInfInterval!Date(Date(2012, 1, 8))));
assert(NegInfInterval!Date(Date(2010, 7, 3)).intersects(negInfInterval));
assert(NegInfInterval!Date(Date(2010, 7, 4)).intersects(negInfInterval));
assert(NegInfInterval!Date(Date(2010, 7, 5)).intersects(negInfInterval));
assert(NegInfInterval!Date(Date(2012, 1, 6)).intersects(negInfInterval));
assert(NegInfInterval!Date(Date(2012, 1, 7)).intersects(negInfInterval));
assert(NegInfInterval!Date(Date(2012, 1, 8)).intersects(negInfInterval));
assert(negInfInterval.intersects(PosInfInterval!Date(Date(2010, 7, 3))));
assert(negInfInterval.intersects(PosInfInterval!Date(Date(2010, 7, 4))));
assert(negInfInterval.intersects(PosInfInterval!Date(Date(2010, 7, 5))));
assert(negInfInterval.intersects(PosInfInterval!Date(Date(2012, 1, 6))));
assert(!negInfInterval.intersects(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.intersects(PosInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.intersects(interval)));
static assert(__traits(compiles, negInfInterval.intersects(cInterval)));
static assert(__traits(compiles, negInfInterval.intersects(iInterval)));
static assert(__traits(compiles, negInfInterval.intersects(posInfInterval)));
static assert(__traits(compiles, negInfInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, negInfInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.intersects(negInfInterval)));
static assert(__traits(compiles, negInfInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.intersects(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(interval)));
static assert(__traits(compiles, cNegInfInterval.intersects(cInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(iInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(posInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersects(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(interval)));
static assert(__traits(compiles, iNegInfInterval.intersects(cInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(iInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(posInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(cPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersects(iNegInfInterval)));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(Interval!Date(Date(1999, 1, 12), Date(2011, 9, 17))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).intersects(Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(PosInfInterval!Date(Date(1999, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).intersects(PosInfInterval!Date(Date(2012, 3, 1))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(NegInfInterval!Date(Date(1996, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersects(NegInfInterval!Date(Date(2013, 7, 9))));
}
//Test NegInfInterval's intersection().
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(I, J)(in I interval1, in J interval2)
{
interval1.intersection(interval2);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assertThrown!DateTimeException(testInterval(negInfInterval, PosInfInterval!Date(Date(2012, 1, 7))));
assertThrown!DateTimeException(testInterval(negInfInterval, PosInfInterval!Date(Date(2012, 1, 8))));
assert(negInfInterval.intersection(negInfInterval) ==
negInfInterval);
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))) ==
Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
Interval!Date(Date(2010, 7, 1), Date(2012, 1, 7)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6)));
assert(negInfInterval.intersection(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7)));
assert(negInfInterval.intersection(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(negInfInterval.intersection(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7)));
assert(negInfInterval.intersection(NegInfInterval!Date(Date(2010, 7, 3))) ==
NegInfInterval!Date(Date(2010, 7, 3)));
assert(negInfInterval.intersection(NegInfInterval!Date(Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2010, 7, 4)));
assert(negInfInterval.intersection(NegInfInterval!Date(Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2010, 7, 5)));
assert(negInfInterval.intersection(NegInfInterval!Date(Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 6)));
assert(negInfInterval.intersection(NegInfInterval!Date(Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.intersection(NegInfInterval!Date(Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2010, 7, 3)).intersection(negInfInterval) ==
NegInfInterval!Date(Date(2010, 7, 3)));
assert(NegInfInterval!Date(Date(2010, 7, 4)).intersection(negInfInterval) ==
NegInfInterval!Date(Date(2010, 7, 4)));
assert(NegInfInterval!Date(Date(2010, 7, 5)).intersection(negInfInterval) ==
NegInfInterval!Date(Date(2010, 7, 5)));
assert(NegInfInterval!Date(Date(2012, 1, 6)).intersection(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 6)));
assert(NegInfInterval!Date(Date(2012, 1, 7)).intersection(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 8)).intersection(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.intersection(PosInfInterval!Date(Date(2010, 7, 3))) ==
Interval!Date(Date(2010, 7, 3), Date(2012, 1 ,7)));
assert(negInfInterval.intersection(PosInfInterval!Date(Date(2010, 7, 4))) ==
Interval!Date(Date(2010, 7, 4), Date(2012, 1 ,7)));
assert(negInfInterval.intersection(PosInfInterval!Date(Date(2010, 7, 5))) ==
Interval!Date(Date(2010, 7, 5), Date(2012, 1 ,7)));
assert(negInfInterval.intersection(PosInfInterval!Date(Date(2012, 1, 6))) ==
Interval!Date(Date(2012, 1, 6), Date(2012, 1 ,7)));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.intersection(interval)));
static assert(__traits(compiles, negInfInterval.intersection(cInterval)));
static assert(__traits(compiles, negInfInterval.intersection(iInterval)));
static assert(__traits(compiles, negInfInterval.intersection(posInfInterval)));
static assert(__traits(compiles, negInfInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, negInfInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.intersection(negInfInterval)));
static assert(__traits(compiles, negInfInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.intersection(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(interval)));
static assert(__traits(compiles, cNegInfInterval.intersection(cInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(iInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(posInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.intersection(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(interval)));
static assert(__traits(compiles, iNegInfInterval.intersection(cInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(iInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(posInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(cPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.intersection(iNegInfInterval)));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == Interval!Date(Date(1990, 7 , 6), Date(2000, 8, 2)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(Interval!Date(Date(1999, 1, 12), Date(2015, 9, 2))) == Interval!Date(Date(1999, 1 , 12), Date(2012, 3, 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(PosInfInterval!Date(Date(1990, 7, 6))) == Interval!Date(Date(1990, 7 , 6), Date(2012, 3, 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(PosInfInterval!Date(Date(1999, 1, 12))) == Interval!Date(Date(1999, 1 , 12), Date(2012, 3, 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(NegInfInterval!Date(Date(1999, 7, 6))) == NegInfInterval!Date(Date(1999, 7 , 6)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).intersection(NegInfInterval!Date(Date(2013, 1, 12))) == NegInfInterval!Date(Date(2012, 3 , 1)));
}
//Test NegInfInterval's isAdjacent().
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(in NegInfInterval!Date negInfInterval, in Interval!Date interval)
{
negInfInterval.isAdjacent(interval);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(!negInfInterval.isAdjacent(negInfInterval));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))));
assert(negInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))));
assert(!negInfInterval.isAdjacent(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(!negInfInterval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.isAdjacent(NegInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 6))));
assert(!negInfInterval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.isAdjacent(NegInfInterval!Date(Date(2012, 1, 8))));
assert(!NegInfInterval!Date(Date(2010, 7, 3)).isAdjacent(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 4)).isAdjacent(negInfInterval));
assert(!NegInfInterval!Date(Date(2010, 7, 5)).isAdjacent(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 6)).isAdjacent(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 7)).isAdjacent(negInfInterval));
assert(!NegInfInterval!Date(Date(2012, 1, 8)).isAdjacent(negInfInterval));
assert(!negInfInterval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 3))));
assert(!negInfInterval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 4))));
assert(!negInfInterval.isAdjacent(PosInfInterval!Date(Date(2010, 7, 5))));
assert(!negInfInterval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 6))));
assert(negInfInterval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 7))));
assert(!negInfInterval.isAdjacent(PosInfInterval!Date(Date(2012, 1, 8))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.isAdjacent(interval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.isAdjacent(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(interval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.isAdjacent(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(interval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(cInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(iInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(posInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(cPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.isAdjacent(iNegInfInterval)));
//Verify Examples.
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(1999, 1, 12), Date(2012, 3, 1))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(2012, 3, 1), Date(2019, 2, 2))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(Interval!Date(Date(2022, 10, 19), Date(2027, 6, 3))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(PosInfInterval!Date(Date(1999, 5, 4))));
assert(NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(PosInfInterval!Date(Date(2012, 3, 1))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(NegInfInterval!Date(Date(1996, 5, 4))));
assert(!NegInfInterval!Date(Date(2012, 3, 1)).isAdjacent(NegInfInterval!Date(Date(2012, 3, 1))));
}
//Test NegInfInterval's merge().
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(I, J)(in I interval1, in J interval2)
{
interval1.merge(interval2);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))));
assert(negInfInterval.merge(negInfInterval) ==
negInfInterval);
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
NegInfInterval!Date(Date(2013, 7, 3)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(negInfInterval.merge(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(negInfInterval.merge(NegInfInterval!Date(Date(2010, 7, 3))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(NegInfInterval!Date(Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(NegInfInterval!Date(Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(NegInfInterval!Date(Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(NegInfInterval!Date(Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.merge(NegInfInterval!Date(Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(NegInfInterval!Date(Date(2010, 7, 3)).merge(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2010, 7, 4)).merge(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2010, 7, 5)).merge(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 6)).merge(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 7)).merge(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 8)).merge(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 8)));
static assert(!__traits(compiles, negInfInterval.merge(PosInfInterval!Date(Date(2010, 7, 3)))));
static assert(!__traits(compiles, negInfInterval.merge(PosInfInterval!Date(Date(2010, 7, 4)))));
static assert(!__traits(compiles, negInfInterval.merge(PosInfInterval!Date(Date(2010, 7, 5)))));
static assert(!__traits(compiles, negInfInterval.merge(PosInfInterval!Date(Date(2012, 1, 6)))));
static assert(!__traits(compiles, negInfInterval.merge(PosInfInterval!Date(Date(2012, 1, 7)))));
static assert(!__traits(compiles, negInfInterval.merge(PosInfInterval!Date(Date(2012, 1, 8)))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.merge(interval)));
static assert(__traits(compiles, negInfInterval.merge(cInterval)));
static assert(__traits(compiles, negInfInterval.merge(iInterval)));
static assert(!__traits(compiles, negInfInterval.merge(posInfInterval)));
static assert(!__traits(compiles, negInfInterval.merge(cPosInfInterval)));
static assert(!__traits(compiles, negInfInterval.merge(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.merge(negInfInterval)));
static assert(__traits(compiles, negInfInterval.merge(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.merge(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.merge(interval)));
static assert(__traits(compiles, cNegInfInterval.merge(cInterval)));
static assert(__traits(compiles, cNegInfInterval.merge(iInterval)));
static assert(!__traits(compiles, cNegInfInterval.merge(posInfInterval)));
static assert(!__traits(compiles, cNegInfInterval.merge(cPosInfInterval)));
static assert(!__traits(compiles, cNegInfInterval.merge(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.merge(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.merge(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.merge(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.merge(interval)));
static assert(__traits(compiles, iNegInfInterval.merge(cInterval)));
static assert(__traits(compiles, iNegInfInterval.merge(iInterval)));
static assert(!__traits(compiles, iNegInfInterval.merge(posInfInterval)));
static assert(!__traits(compiles, iNegInfInterval.merge(cPosInfInterval)));
static assert(!__traits(compiles, iNegInfInterval.merge(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.merge(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.merge(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.merge(iNegInfInterval)));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(Interval!Date(Date(1999, 1, 12), Date(2015, 9, 2))) == NegInfInterval!Date(Date(2015, 9 , 2)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(NegInfInterval!Date(Date(1999, 7, 6))) == NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).merge(NegInfInterval!Date(Date(2013, 1, 12))) == NegInfInterval!Date(Date(2013, 1 , 12)));
}
//Test NegInfInterval's span().
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(I, J)(in I interval1, in J interval2)
{
interval1.span(interval2);
}
assertThrown!DateTimeException(testInterval(negInfInterval, Interval!Date(Date(2010, 7, 4), dur!"days"(0))));
assert(negInfInterval.span(negInfInterval) ==
negInfInterval);
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 1), Date(2010, 7, 3))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 1), Date(2013, 7, 3))) ==
NegInfInterval!Date(Date(2013, 7, 3)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 3), Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2010, 7, 5), Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(Interval!Date(Date(2012, 1, 6), Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(negInfInterval.span(Interval!Date(Date(2012, 1, 7), Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(negInfInterval.span(Interval!Date(Date(2012, 1, 8), Date(2012, 1, 9))) ==
NegInfInterval!Date(Date(2012, 1, 9)));
assert(negInfInterval.span(NegInfInterval!Date(Date(2010, 7, 3))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(NegInfInterval!Date(Date(2010, 7, 4))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(NegInfInterval!Date(Date(2010, 7, 5))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(NegInfInterval!Date(Date(2012, 1, 6))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(NegInfInterval!Date(Date(2012, 1, 7))) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(negInfInterval.span(NegInfInterval!Date(Date(2012, 1, 8))) ==
NegInfInterval!Date(Date(2012, 1, 8)));
assert(NegInfInterval!Date(Date(2010, 7, 3)).span(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2010, 7, 4)).span(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2010, 7, 5)).span(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 6)).span(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 7)).span(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 7)));
assert(NegInfInterval!Date(Date(2012, 1, 8)).span(negInfInterval) ==
NegInfInterval!Date(Date(2012, 1, 8)));
static assert(!__traits(compiles, negInfInterval.span(PosInfInterval!Date(Date(2010, 7, 3)))));
static assert(!__traits(compiles, negInfInterval.span(PosInfInterval!Date(Date(2010, 7, 4)))));
static assert(!__traits(compiles, negInfInterval.span(PosInfInterval!Date(Date(2010, 7, 5)))));
static assert(!__traits(compiles, negInfInterval.span(PosInfInterval!Date(Date(2012, 1, 6)))));
static assert(!__traits(compiles, negInfInterval.span(PosInfInterval!Date(Date(2012, 1, 7)))));
static assert(!__traits(compiles, negInfInterval.span(PosInfInterval!Date(Date(2012, 1, 8)))));
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
const cInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
immutable iInterval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
immutable iPosInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, negInfInterval.span(interval)));
static assert(__traits(compiles, negInfInterval.span(cInterval)));
static assert(__traits(compiles, negInfInterval.span(iInterval)));
static assert(!__traits(compiles, negInfInterval.span(posInfInterval)));
static assert(!__traits(compiles, negInfInterval.span(cPosInfInterval)));
static assert(!__traits(compiles, negInfInterval.span(iPosInfInterval)));
static assert(__traits(compiles, negInfInterval.span(negInfInterval)));
static assert(__traits(compiles, negInfInterval.span(cNegInfInterval)));
static assert(__traits(compiles, negInfInterval.span(iNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.span(interval)));
static assert(__traits(compiles, cNegInfInterval.span(cInterval)));
static assert(__traits(compiles, cNegInfInterval.span(iInterval)));
static assert(!__traits(compiles, cNegInfInterval.span(posInfInterval)));
static assert(!__traits(compiles, cNegInfInterval.span(cPosInfInterval)));
static assert(!__traits(compiles, cNegInfInterval.span(iPosInfInterval)));
static assert(__traits(compiles, cNegInfInterval.span(negInfInterval)));
static assert(__traits(compiles, cNegInfInterval.span(cNegInfInterval)));
static assert(__traits(compiles, cNegInfInterval.span(iNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.span(interval)));
static assert(__traits(compiles, iNegInfInterval.span(cInterval)));
static assert(__traits(compiles, iNegInfInterval.span(iInterval)));
static assert(!__traits(compiles, iNegInfInterval.span(posInfInterval)));
static assert(!__traits(compiles, iNegInfInterval.span(cPosInfInterval)));
static assert(!__traits(compiles, iNegInfInterval.span(iPosInfInterval)));
static assert(__traits(compiles, iNegInfInterval.span(negInfInterval)));
static assert(__traits(compiles, iNegInfInterval.span(cNegInfInterval)));
static assert(__traits(compiles, iNegInfInterval.span(iNegInfInterval)));
//Verify Examples.
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(Interval!Date(Date(1990, 7, 6), Date(2000, 8, 2))) == NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(Interval!Date(Date(1999, 1, 12), Date(2015, 9, 2))) == NegInfInterval!Date(Date(2015, 9 , 2)));
assert(NegInfInterval!Date(Date(1600, 1, 7)).span(Interval!Date(Date(2012, 3, 11), Date(2017, 7, 1))) == NegInfInterval!Date(Date(2017, 7 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(NegInfInterval!Date(Date(1999, 7, 6))) == NegInfInterval!Date(Date(2012, 3 , 1)));
assert(NegInfInterval!Date(Date(2012, 3, 1)).span(NegInfInterval!Date(Date(2013, 1, 12))) == NegInfInterval!Date(Date(2013, 1 , 12)));
}
//Test NegInfInterval's shift().
unittest
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(I)(I interval, in Duration duration, in I expected, size_t line = __LINE__)
{
interval.shift(duration);
assert(interval == expected);
}
testInterval(interval, dur!"days"(22), NegInfInterval!Date(Date(2012, 1, 29)));
testInterval(interval, dur!"days"(-22), NegInfInterval!Date(Date(2011, 12, 16)));
const cInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(!__traits(compiles, cInterval.shift(dur!"days"(5))));
static assert(!__traits(compiles, iInterval.shift(dur!"days"(5))));
//Verify Examples.
auto interval1 = NegInfInterval!Date(Date(2012, 4, 5));
auto interval2 = NegInfInterval!Date(Date(2012, 4, 5));
interval1.shift(dur!"days"(50));
assert(interval1 == NegInfInterval!Date(Date(2012, 5, 25)));
interval2.shift(dur!"days"(-50));
assert(interval2 == NegInfInterval!Date( Date(2012, 2, 15)));
}
//Test NegInfInterval's shift(int, int, AllowDayOverflow).
unittest
{
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
static void testIntervalFail(I)(I interval, int years, int months)
{
interval.shift(years, months);
}
static void testInterval(I)(I interval, int years, int months, AllowDayOverflow allow, in I expected, size_t line = __LINE__)
{
interval.shift(years, months, allow);
assert(interval == expected);
}
testInterval(interval, 5, 0, AllowDayOverflow.yes, NegInfInterval!Date(Date(2017, 1, 7)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, NegInfInterval!Date(Date(2007, 1, 7)));
auto interval2 = NegInfInterval!Date(Date(2010, 5, 31));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2011, 7, 1)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2011, 5, 1)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2009, 5, 1)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2009, 7, 1)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, NegInfInterval!Date(Date(2011, 6, 30)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, NegInfInterval!Date(Date(2011, 4, 30)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, NegInfInterval!Date(Date(2009, 4, 30)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, NegInfInterval!Date(Date(2009, 6, 30)));
}
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(!__traits(compiles, cNegInfInterval.shift(1)));
static assert(!__traits(compiles, iNegInfInterval.shift(1)));
//Verify Examples.
auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));
interval1.shift(2);
assert(interval1 == NegInfInterval!Date(Date(2014, 3, 1)));
interval2.shift(-2);
assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
}
//Test NegInfInterval's expand().
unittest
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(I)(I interval, in Duration duration, in I expected, size_t line = __LINE__)
{
interval.expand(duration);
assert(interval == expected);
}
testInterval(interval, dur!"days"(22), NegInfInterval!Date(Date(2012, 1, 29)));
testInterval(interval, dur!"days"(-22), NegInfInterval!Date(Date(2011, 12, 16)));
const cInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(!__traits(compiles, cInterval.expand(dur!"days"(5))));
static assert(!__traits(compiles, iInterval.expand(dur!"days"(5))));
//Verify Examples.
auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));
interval1.expand(dur!"days"(2));
assert(interval1 == NegInfInterval!Date(Date(2012, 3, 3)));
interval2.expand(dur!"days"(-2));
assert(interval2 == NegInfInterval!Date(Date(2012, 2, 28)));
}
//Test NegInfInterval's expand(int, int, AllowDayOverflow).
unittest
{
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(I)(I interval, int years, int months, AllowDayOverflow allow, in I expected, size_t line = __LINE__)
{
interval.expand(years, months, allow);
assert(interval == expected);
}
testInterval(interval, 5, 0, AllowDayOverflow.yes, NegInfInterval!Date(Date(2017, 1, 7)));
testInterval(interval, -5, 0, AllowDayOverflow.yes, NegInfInterval!Date(Date(2007, 1, 7)));
auto interval2 = NegInfInterval!Date(Date(2010, 5, 31));
testInterval(interval2, 1, 1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2011, 7, 1)));
testInterval(interval2, 1, -1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2011, 5, 1)));
testInterval(interval2, -1, -1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2009, 5, 1)));
testInterval(interval2, -1, 1, AllowDayOverflow.yes, NegInfInterval!Date(Date(2009, 7, 1)));
testInterval(interval2, 1, 1, AllowDayOverflow.no, NegInfInterval!Date(Date(2011, 6, 30)));
testInterval(interval2, 1, -1, AllowDayOverflow.no, NegInfInterval!Date(Date(2011, 4, 30)));
testInterval(interval2, -1, -1, AllowDayOverflow.no, NegInfInterval!Date(Date(2009, 4, 30)));
testInterval(interval2, -1, 1, AllowDayOverflow.no, NegInfInterval!Date( Date(2009, 6, 30)));
}
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(!__traits(compiles, cNegInfInterval.expand(1)));
static assert(!__traits(compiles, iNegInfInterval.expand(1)));
//Verify Examples.
auto interval1 = NegInfInterval!Date(Date(2012, 3, 1));
auto interval2 = NegInfInterval!Date(Date(2012, 3, 1));
interval1.expand(2);
assert(interval1 == NegInfInterval!Date(Date(2014, 3, 1)));
interval2.expand(-2);
assert(interval2 == NegInfInterval!Date(Date(2010, 3, 1)));
}
//Test NegInfInterval's bwdRange().
unittest
{
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static void testInterval(NegInfInterval!Date negInfInterval)
{
negInfInterval.bwdRange(everyDayOfWeek!(Date, Direction.fwd)(DayOfWeek.fri)).popFront();
}
assertThrown!DateTimeException(testInterval(negInfInterval));
assert(NegInfInterval!Date(Date(2010, 10, 1)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri)).front ==
Date(2010, 10, 1));
assert(NegInfInterval!Date(Date(2010, 10, 1)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri), PopFirst.yes).front ==
Date(2010, 9, 24));
//Verify Examples.
auto interval = NegInfInterval!Date(Date(2010, 9, 9));
auto func = delegate (in Date date)
{
if((date.day & 1) == 0)
return date - dur!"days"(2);
return date - dur!"days"(1);
};
auto range = interval.bwdRange(func);
//An odd day. Using PopFirst.yes would have made this Date(2010, 9, 8).
assert(range.front == Date(2010, 9, 9));
range.popFront();
assert(range.front == Date(2010, 9, 8));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 4));
range.popFront();
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(!range.empty);
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, cNegInfInterval.bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri))));
static assert(__traits(compiles, iNegInfInterval.bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri))));
}
//Test NegInfInterval's toString().
unittest
{
assert(NegInfInterval!Date(Date(2012, 1, 7)).toString() == "[-∞ - 2012-Jan-07)");
const cNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
immutable iNegInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
static assert(__traits(compiles, cNegInfInterval.toString()));
static assert(__traits(compiles, iNegInfInterval.toString()));
}
/++
Range-generating function.
Returns a delegate which returns the next time point with the given
$(D DayOfWeek) in a range.
Using this delegate allows iteration over successive time points which
are all the same day of the week. e.g. passing $(D DayOfWeek.mon) to
$(D everyDayOfWeek) would result in a delegate which could be used to
iterate over all of the Mondays in a range.
Params:
dir = The direction to iterate in. If passing the return value to
$(D fwdRange), use $(D Direction.fwd). If passing it to
$(D bwdRange), use $(D Direction.bwd).
dayOfWeek = The week that each time point in the range will be.
+/
static TP delegate(in TP) everyDayOfWeek(TP, Direction dir = Direction.fwd)(DayOfWeek dayOfWeek) nothrow
if(isTimePoint!TP &&
(dir == Direction.fwd || dir == Direction.bwd) &&
__traits(hasMember, TP, "dayOfWeek") &&
!__traits(isStaticFunction, TP.dayOfWeek) &&
is(typeof(TP.dayOfWeek) == DayOfWeek))
{
TP func(in TP tp)
{
TP retval = cast(TP)tp;
immutable days = daysToDayOfWeek(retval.dayOfWeek, dayOfWeek);
static if(dir == Direction.fwd)
immutable adjustedDays = days == 0 ? 7 : days;
else
immutable adjustedDays = days == 0 ? -7 : days - 7;
return retval += dur!"days"(adjustedDays);
}
return &func;
}
///
unittest
{
auto interval = Interval!Date(Date(2010, 9, 2), Date(2010, 9, 27));
auto func = everyDayOfWeek!Date(DayOfWeek.mon);
auto range = interval.fwdRange(func);
//A Thursday. Using PopFirst.yes would have made this Date(2010, 9, 6).
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2010, 9, 6));
range.popFront();
assert(range.front == Date(2010, 9, 13));
range.popFront();
assert(range.front == Date(2010, 9, 20));
range.popFront();
assert(range.empty);
}
unittest
{
auto funcFwd = everyDayOfWeek!Date(DayOfWeek.mon);
auto funcBwd = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.mon);
assert(funcFwd(Date(2010, 8, 28)) == Date(2010, 8, 30));
assert(funcFwd(Date(2010, 8, 29)) == Date(2010, 8, 30));
assert(funcFwd(Date(2010, 8, 30)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 8, 31)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 9, 1)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 9, 2)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 9, 3)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 9, 4)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 9, 5)) == Date(2010, 9, 6));
assert(funcFwd(Date(2010, 9, 6)) == Date(2010, 9, 13));
assert(funcFwd(Date(2010, 9, 7)) == Date(2010, 9, 13));
assert(funcBwd(Date(2010, 8, 28)) == Date(2010, 8, 23));
assert(funcBwd(Date(2010, 8, 29)) == Date(2010, 8, 23));
assert(funcBwd(Date(2010, 8, 30)) == Date(2010, 8, 23));
assert(funcBwd(Date(2010, 8, 31)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 1)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 2)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 3)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 4)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 5)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 6)) == Date(2010, 8, 30));
assert(funcBwd(Date(2010, 9, 7)) == Date(2010, 9, 6));
static assert(!__traits(compiles, everyDayOfWeek!(TimeOfDay)(DayOfWeek.mon)));
static assert(__traits(compiles, everyDayOfWeek!(DateTime)(DayOfWeek.mon)));
static assert(__traits(compiles, everyDayOfWeek!(SysTime)(DayOfWeek.mon)));
}
/++
Range-generating function.
Returns a delegate which returns the next time point with the given month
which would be reached by adding months to the given time point.
So, using this delegate allows iteration over successive time points
which are in the same month but different years. For example,
iterate over each successive December 25th in an interval by starting with a
date which had the 25th as its day and passed $(D Month.dec) to
$(D everyMonth) to create the delegate.
Since it wouldn't really make sense to be iterating over a specific month
and end up with some of the time points in the succeeding month or two years
after the previous time point, $(D AllowDayOverflow.no) is always used when
calculating the next time point.
Params:
dir = The direction to iterate in. If passing the return value to
$(D fwdRange), use $(D Direction.fwd). If passing it to
$(D bwdRange), use $(D Direction.bwd).
month = The month that each time point in the range will be in.
+/
static TP delegate(in TP) everyMonth(TP, Direction dir = Direction.fwd)(int month)
if(isTimePoint!TP &&
(dir == Direction.fwd || dir == Direction.bwd) &&
__traits(hasMember, TP, "month") &&
!__traits(isStaticFunction, TP.month) &&
is(typeof(TP.month) == Month))
{
enforceValid!"months"(month);
TP func(in TP tp)
{
TP retval = cast(TP)tp;
immutable months = monthsToMonth(retval.month, month);
static if(dir == Direction.fwd)
immutable adjustedMonths = months == 0 ? 12 : months;
else
immutable adjustedMonths = months == 0 ? -12 : months - 12;
retval.add!"months"(adjustedMonths, AllowDayOverflow.no);
if(retval.month != month)
{
retval.add!"months"(-1);
assert(retval.month == month);
}
return retval;
}
return &func;
}
///
unittest
{
auto interval = Interval!Date(Date(2000, 1, 30), Date(2004, 8, 5));
auto func = everyMonth!(Date)(Month.feb);
auto range = interval.fwdRange(func);
//Using PopFirst.yes would have made this Date(2010, 2, 29).
assert(range.front == Date(2000, 1, 30));
range.popFront();
assert(range.front == Date(2000, 2, 29));
range.popFront();
assert(range.front == Date(2001, 2, 28));
range.popFront();
assert(range.front == Date(2002, 2, 28));
range.popFront();
assert(range.front == Date(2003, 2, 28));
range.popFront();
assert(range.front == Date(2004, 2, 28));
range.popFront();
assert(range.empty);
}
unittest
{
auto funcFwd = everyMonth!Date(Month.jun);
auto funcBwd = everyMonth!(Date, Direction.bwd)(Month.jun);
assert(funcFwd(Date(2010, 5, 31)) == Date(2010, 6, 30));
assert(funcFwd(Date(2010, 6, 30)) == Date(2011, 6, 30));
assert(funcFwd(Date(2010, 7, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2010, 8, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2010, 9, 30)) == Date(2011, 6, 30));
assert(funcFwd(Date(2010, 10, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2010, 11, 30)) == Date(2011, 6, 30));
assert(funcFwd(Date(2010, 12, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2011, 1, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2011, 2, 28)) == Date(2011, 6, 28));
assert(funcFwd(Date(2011, 3, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2011, 4, 30)) == Date(2011, 6, 30));
assert(funcFwd(Date(2011, 5, 31)) == Date(2011, 6, 30));
assert(funcFwd(Date(2011, 6, 30)) == Date(2012, 6, 30));
assert(funcFwd(Date(2011, 7, 31)) == Date(2012, 6, 30));
assert(funcBwd(Date(2010, 5, 31)) == Date(2009, 6, 30));
assert(funcBwd(Date(2010, 6, 30)) == Date(2009, 6, 30));
assert(funcBwd(Date(2010, 7, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2010, 8, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2010, 9, 30)) == Date(2010, 6, 30));
assert(funcBwd(Date(2010, 10, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2010, 11, 30)) == Date(2010, 6, 30));
assert(funcBwd(Date(2010, 12, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2011, 1, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2011, 2, 28)) == Date(2010, 6, 28));
assert(funcBwd(Date(2011, 3, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2011, 4, 30)) == Date(2010, 6, 30));
assert(funcBwd(Date(2011, 5, 31)) == Date(2010, 6, 30));
assert(funcBwd(Date(2011, 6, 30)) == Date(2010, 6, 30));
assert(funcBwd(Date(2011, 7, 30)) == Date(2011, 6, 30));
static assert(!__traits(compiles, everyMonth!(TimeOfDay)(Month.jan)));
static assert(__traits(compiles, everyMonth!(DateTime)(Month.jan)));
static assert(__traits(compiles, everyMonth!(SysTime)(Month.jan)));
}
/++
Range-generating function.
Returns a delegate which returns the next time point which is the given
duration later.
Using this delegate allows iteration over successive time points which
are apart by the given duration e.g. passing $(D dur!"days"(3)) to
$(D everyDuration) would result in a delegate which could be used to iterate
over a range of days which are each 3 days apart.
Params:
dir = The direction to iterate in. If passing the return value to
$(D fwdRange), use $(D Direction.fwd). If passing it to
$(D bwdRange), use $(D Direction.bwd).
duration = The duration which separates each successive time point in
the range.
+/
static TP delegate(in TP) everyDuration(TP, Direction dir = Direction.fwd, D)
(D duration) nothrow
if(isTimePoint!TP &&
__traits(compiles, TP.init + duration) &&
(dir == Direction.fwd || dir == Direction.bwd))
{
TP func(in TP tp)
{
static if(dir == Direction.fwd)
return tp + duration;
else
return tp - duration;
}
return &func;
}
///
unittest
{
auto interval = Interval!Date(Date(2010, 9, 2), Date(2010, 9, 27));
auto func = everyDuration!Date(dur!"days"(8));
auto range = interval.fwdRange(func);
//Using PopFirst.yes would have made this Date(2010, 9, 10).
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2010, 9, 10));
range.popFront();
assert(range.front == Date(2010, 9, 18));
range.popFront();
assert(range.front == Date(2010, 9, 26));
range.popFront();
assert(range.empty);
}
unittest
{
auto funcFwd = everyDuration!Date(dur!"days"(27));
auto funcBwd = everyDuration!(Date, Direction.bwd)(dur!"days"(27));
assert(funcFwd(Date(2009, 12, 25)) == Date(2010, 1, 21));
assert(funcFwd(Date(2009, 12, 26)) == Date(2010, 1, 22));
assert(funcFwd(Date(2009, 12, 27)) == Date(2010, 1, 23));
assert(funcFwd(Date(2009, 12, 28)) == Date(2010, 1, 24));
assert(funcBwd(Date(2010, 1, 21)) == Date(2009, 12, 25));
assert(funcBwd(Date(2010, 1, 22)) == Date(2009, 12, 26));
assert(funcBwd(Date(2010, 1, 23)) == Date(2009, 12, 27));
assert(funcBwd(Date(2010, 1, 24)) == Date(2009, 12, 28));
static assert(__traits(compiles, everyDuration!Date(dur!"hnsecs"(1))));
static assert(__traits(compiles, everyDuration!TimeOfDay(dur!"hnsecs"(1))));
static assert(__traits(compiles, everyDuration!DateTime(dur!"hnsecs"(1))));
static assert(__traits(compiles, everyDuration!SysTime(dur!"hnsecs"(1))));
}
/++
Range-generating function.
Returns a delegate which returns the next time point which is the given
number of years, month, and duration later.
The difference between this version of $(D everyDuration) and the version
which just takes a $(CXREF time, Duration) is that this one also takes the number of
years and months (along with an $(D AllowDayOverflow) to indicate whether
adding years and months should allow the days to overflow).
Note that if iterating forward, $(D add!"years"()) is called on the given
time point, then $(D add!"months"()), and finally the duration is added
to it. However, if iterating backwards, the duration is added first, then
$(D add!"months"()) is called, and finally $(D add!"years"()) is called.
That way, going backwards generates close to the same time points that
iterating forward does, but since adding years and months is not entirely
reversible (due to possible day overflow, regardless of whether
$(D AllowDayOverflow.yes) or $(D AllowDayOverflow.no) is used), it can't be
guaranteed that iterating backwards will give the same time points as
iterating forward would have (even assuming that the end of the range is a
time point which would be returned by the delegate when iterating forward
from $(D begin)).
Params:
dir = The direction to iterate in. If passing the return
value to $(D fwdRange), use $(D Direction.fwd). If
passing it to $(D bwdRange), use $(D Direction.bwd).
years = The number of years to add to the time point passed to
the delegate.
months = The number of months to add to the time point passed to
the delegate.
allowOverflow = Whether the days should be allowed to overflow on
$(D begin) and $(D end), causing their month to
increment.
duration = The duration to add to the time point passed to the
delegate.
+/
static TP delegate(in TP) everyDuration(TP, Direction dir = Direction.fwd, D)
(int years,
int months = 0,
AllowDayOverflow allowOverflow = AllowDayOverflow.yes,
D duration = dur!"days"(0)) nothrow
if(isTimePoint!TP &&
__traits(compiles, TP.init + duration) &&
__traits(compiles, TP.init.add!"years"(years)) &&
__traits(compiles, TP.init.add!"months"(months)) &&
(dir == Direction.fwd || dir == Direction.bwd))
{
TP func(in TP tp)
{
static if(dir == Direction.fwd)
{
TP retval = cast(TP)tp;
retval.add!"years"(years, allowOverflow);
retval.add!"months"(months, allowOverflow);
return retval + duration;
}
else
{
TP retval = tp - duration;
retval.add!"months"(-months, allowOverflow);
retval.add!"years"(-years, allowOverflow);
return retval;
}
}
return &func;
}
///
unittest
{
auto interval = Interval!Date(Date(2010, 9, 2), Date(2025, 9, 27));
auto func = everyDuration!Date(4, 1, AllowDayOverflow.yes, dur!"days"(2));
auto range = interval.fwdRange(func);
//Using PopFirst.yes would have made this Date(2014, 10, 12).
assert(range.front == Date(2010, 9, 2));
range.popFront();
assert(range.front == Date(2014, 10, 4));
range.popFront();
assert(range.front == Date(2018, 11, 6));
range.popFront();
assert(range.front == Date(2022, 12, 8));
range.popFront();
assert(range.empty);
}
unittest
{
{
auto funcFwd = everyDuration!Date(1, 2, AllowDayOverflow.yes, dur!"days"(3));
auto funcBwd = everyDuration!(Date, Direction.bwd)(1, 2, AllowDayOverflow.yes, dur!"days"(3));
assert(funcFwd(Date(2009, 12, 25)) == Date(2011, 2, 28));
assert(funcFwd(Date(2009, 12, 26)) == Date(2011, 3, 1));
assert(funcFwd(Date(2009, 12, 27)) == Date(2011, 3, 2));
assert(funcFwd(Date(2009, 12, 28)) == Date(2011, 3, 3));
assert(funcFwd(Date(2009, 12, 29)) == Date(2011, 3, 4));
assert(funcBwd(Date(2011, 2, 28)) == Date(2009, 12, 25));
assert(funcBwd(Date(2011, 3, 1)) == Date(2009, 12, 26));
assert(funcBwd(Date(2011, 3, 2)) == Date(2009, 12, 27));
assert(funcBwd(Date(2011, 3, 3)) == Date(2009, 12, 28));
assert(funcBwd(Date(2011, 3, 4)) == Date(2010, 1, 1));
}
{
auto funcFwd = everyDuration!Date(1, 2, AllowDayOverflow.no, dur!"days"(3));
auto funcBwd = everyDuration!(Date, Direction.bwd)(1, 2, AllowDayOverflow.yes, dur!"days"(3));
assert(funcFwd(Date(2009, 12, 25)) == Date(2011, 2, 28));
assert(funcFwd(Date(2009, 12, 26)) == Date(2011, 3, 1));
assert(funcFwd(Date(2009, 12, 27)) == Date(2011, 3, 2));
assert(funcFwd(Date(2009, 12, 28)) == Date(2011, 3, 3));
assert(funcFwd(Date(2009, 12, 29)) == Date(2011, 3, 3));
assert(funcBwd(Date(2011, 2, 28)) == Date(2009, 12, 25));
assert(funcBwd(Date(2011, 3, 1)) == Date(2009, 12, 26));
assert(funcBwd(Date(2011, 3, 2)) == Date(2009, 12, 27));
assert(funcBwd(Date(2011, 3, 3)) == Date(2009, 12, 28));
assert(funcBwd(Date(2011, 3, 4)) == Date(2010, 1, 1));
}
static assert(__traits(compiles, everyDuration!Date(1, 2, AllowDayOverflow.yes, dur!"hnsecs"(1))));
static assert(!__traits(compiles, everyDuration!TimeOfDay(1, 2, AllowDayOverflow.yes, dur!"hnsecs"(1))));
static assert(__traits(compiles, everyDuration!DateTime(1, 2, AllowDayOverflow.yes, dur!"hnsecs"(1))));
static assert(__traits(compiles, everyDuration!SysTime(1, 2, AllowDayOverflow.yes, dur!"hnsecs"(1))));
}
//TODO Add function to create a range generating function based on a date recurrence pattern string.
// This may or may not involve creating a date recurrence pattern class of some sort - probably
// yes if we want to make it easy to build them. However, there is a standard recurrence
// pattern string format which we'd want to support with a range generator (though if we have
// the class/struct, we'd probably want a version of the range generating function which took
// that rather than a string).
//==============================================================================
// Section with ranges.
//==============================================================================
/++
A range over an $(LREF2 .Interval, Interval).
$(D IntervalRange) is only ever constructed by $(LREF2 .Interval, Interval). However, when
it is constructed, it is given a function, $(D func), which is used to
generate the time points which are iterated over. $(D func) takes a time
point and returns a time point of the same type. For instance,
to iterate over all of the days in
the interval $(D Interval!Date), pass a function to $(LREF2 .Interval, Interval)'s $(D fwdRange)
where that function took a $(LREF Date) and returned a $(LREF Date) which was one
day later. That function would then be used by $(D IntervalRange)'s
$(D popFront) to iterate over the $(LREF Date)s in the interval.
If $(D dir == Direction.fwd), then a range iterates forward in time, whereas
if $(D dir == Direction.bwd), then it iterates backwards in time. So, if
$(D dir == Direction.fwd) then $(D front == interval.begin), whereas if
$(D dir == Direction.bwd) then $(D front == interval.end). $(D func) must
generate a time point going in the proper direction of iteration, or a
$(LREF DateTimeException) will be thrown. So, to iterate forward in
time, the time point that $(D func) generates must be later in time than the
one passed to it. If it's either identical or earlier in time, then a
$(LREF DateTimeException) will be thrown. To iterate backwards, then
the generated time point must be before the time point which was passed in.
If the generated time point is ever passed the edge of the range in the
proper direction, then the edge of that range will be used instead. So, if
iterating forward, and the generated time point is past the interval's
$(D end), then $(D front) becomes $(D end). If iterating backwards, and the
generated time point is before $(D begin), then $(D front) becomes
$(D begin). In either case, the range would then be empty.
Also note that while normally the $(D begin) of an interval is included in
it and its $(D end) is excluded from it, if $(D dir == Direction.bwd), then
$(D begin) is treated as excluded and $(D end) is treated as included. This
allows for the same behavior in both directions. This works because none of
$(LREF2 .Interval, Interval)'s functions which care about whether $(D begin) or $(D end) is
included or excluded are ever called by $(D IntervalRange). $(D interval)
returns a normal interval, regardless of whether $(D dir == Direction.fwd)
or if $(D dir == Direction.bwd), so any $(LREF2 .Interval, Interval) functions which are
called on it which care about whether $(D begin) or $(D end) are included or
excluded will treat $(D begin) as included and $(D end) as excluded.
+/
struct IntervalRange(TP, Direction dir)
if(isTimePoint!TP && dir != Direction.both)
{
public:
/++
Params:
rhs = The $(D IntervalRange) to assign to this one.
+/
ref IntervalRange opAssign(ref IntervalRange rhs) pure nothrow
{
_interval = rhs._interval;
_func = rhs._func;
return this;
}
/++ Ditto +/
ref IntervalRange opAssign(IntervalRange rhs) pure nothrow
{
return this = rhs;
}
/++
Whether this $(D IntervalRange) is empty.
+/
@property bool empty() const pure nothrow
{
return _interval.empty;
}
/++
The first time point in the range.
Throws:
$(LREF DateTimeException) if the range is empty.
+/
@property TP front() const pure
{
_enforceNotEmpty();
static if(dir == Direction.fwd)
return _interval.begin;
else
return _interval.end;
}
/++
Pops $(D front) from the range, using $(D func) to generate the next
time point in the range. If the generated time point is beyond the edge
of the range, then $(D front) is set to that edge, and the range is then
empty. So, if iterating forwards, and the generated time point is
greater than the interval's $(D end), then $(D front) is set to
$(D end). If iterating backwards, and the generated time point is less
than the interval's $(D begin), then $(D front) is set to $(D begin).
Throws:
$(LREF DateTimeException) if the range is empty or if the generated
time point is in the wrong direction (i.e. if iterating
forward and the generated time point is before $(D front), or if
iterating backwards and the generated time point is after
$(D front)).
+/
void popFront()
{
_enforceNotEmpty();
static if(dir == Direction.fwd)
{
auto begin = _func(_interval.begin);
if(begin > _interval.end)
begin = _interval.end;
_enforceCorrectDirection(begin);
_interval.begin = begin;
}
else
{
auto end = _func(_interval.end);
if(end < _interval.begin)
end = _interval.begin;
_enforceCorrectDirection(end);
_interval.end = end;
}
}
/++
Returns a copy of $(D this).
+/
@property IntervalRange save() pure nothrow
{
return this;
}
/++
The interval that this $(D IntervalRange) currently covers.
+/
@property Interval!TP interval() const pure nothrow
{
return cast(Interval!TP)_interval;
}
/++
The function used to generate the next time point in the range.
+/
TP delegate(in TP) func() pure nothrow @property
{
return _func;
}
/++
The $(D Direction) that this range iterates in.
+/
@property Direction direction() const pure nothrow
{
return dir;
}
private:
/+
Params:
interval = The interval that this range covers.
func = The function used to generate the time points which are
iterated over.
+/
this(in Interval!TP interval, TP delegate(in TP) func) pure nothrow
{
_func = func;
_interval = interval;
}
/+
Throws:
$(LREF DateTimeException) if this interval is empty.
+/
void _enforceNotEmpty(size_t line = __LINE__) const pure
{
if(empty)
throw new DateTimeException("Invalid operation for an empty IntervalRange.", __FILE__, line);
}
/+
Throws:
$(LREF DateTimeException) if $(D_PARAM newTP) is in the wrong
direction.
+/
void _enforceCorrectDirection(in TP newTP, size_t line = __LINE__) const
{
import std.format : format;
static if(dir == Direction.fwd)
{
enforce(newTP > _interval._begin,
new DateTimeException(format("Generated time point is before previous begin: prev [%s] new [%s]",
interval._begin,
newTP),
__FILE__,
line));
}
else
{
enforce(newTP < _interval._end,
new DateTimeException(format("Generated time point is after previous end: prev [%s] new [%s]",
interval._end,
newTP),
__FILE__,
line));
}
}
Interval!TP _interval;
TP delegate(in TP) _func;
}
//Test that IntervalRange satisfies the range predicates that it's supposed to satisfy.
unittest
{
static assert(isInputRange!(IntervalRange!(Date, Direction.fwd)));
static assert(isForwardRange!(IntervalRange!(Date, Direction.fwd)));
//Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=4895
//static assert(!isOutputRange!(IntervalRange!(Date, Direction.fwd), Date));
static assert(!isBidirectionalRange!(IntervalRange!(Date, Direction.fwd)));
static assert(!isRandomAccessRange!(IntervalRange!(Date, Direction.fwd)));
static assert(!hasSwappableElements!(IntervalRange!(Date, Direction.fwd)));
static assert(!hasAssignableElements!(IntervalRange!(Date, Direction.fwd)));
static assert(!hasLength!(IntervalRange!(Date, Direction.fwd)));
static assert(!isInfinite!(IntervalRange!(Date, Direction.fwd)));
static assert(!hasSlicing!(IntervalRange!(Date, Direction.fwd)));
static assert(is(ElementType!(IntervalRange!(Date, Direction.fwd)) == Date));
static assert(is(ElementType!(IntervalRange!(TimeOfDay, Direction.fwd)) == TimeOfDay));
static assert(is(ElementType!(IntervalRange!(DateTime, Direction.fwd)) == DateTime));
static assert(is(ElementType!(IntervalRange!(SysTime, Direction.fwd)) == SysTime));
}
//Test construction of IntervalRange.
unittest
{
{
Date dateFunc(in Date date)
{
return date;
}
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto ir = IntervalRange!(Date, Direction.fwd)(interval, &dateFunc);
}
{
TimeOfDay todFunc(in TimeOfDay tod)
{
return tod;
}
auto interval = Interval!TimeOfDay(TimeOfDay(12, 1, 7), TimeOfDay(14, 0, 0));
auto ir = IntervalRange!(TimeOfDay, Direction.fwd)(interval, &todFunc);
}
{
DateTime dtFunc(in DateTime dt)
{
return dt;
}
auto interval = Interval!DateTime(DateTime(2010, 7, 4, 12, 1, 7), DateTime(2012, 1, 7, 14, 0, 0));
auto ir = IntervalRange!(DateTime, Direction.fwd)(interval, &dtFunc);
}
{
SysTime stFunc(in SysTime st)
{
return cast(SysTime)st;
}
auto interval = Interval!SysTime(SysTime(DateTime(2010, 7, 4, 12, 1, 7)), SysTime(DateTime(2012, 1, 7, 14, 0, 0)));
auto ir = IntervalRange!(SysTime, Direction.fwd)(interval, &stFunc);
}
}
//Test IntervalRange's empty().
unittest
{
//fwd
{
auto range = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 21)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
assert(!range.empty);
range.popFront();
assert(range.empty);
const cRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
static assert(__traits(compiles, cRange.empty));
//Apparently, creating an immutable IntervalRange!Date doesn't work, so we can't test if
//empty works with it. However, since an immutable range is pretty useless, it's no great loss.
}
//bwd
{
auto range = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 21)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
assert(!range.empty);
range.popFront();
assert(range.empty);
const cRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
static assert(__traits(compiles, cRange.empty));
//Apparently, creating an immutable IntervalRange!Date doesn't work, so we can't test if
//empty works with it. However, since an immutable range is pretty useless, it's no great loss.
}
}
//Test IntervalRange's front.
unittest
{
//fwd
{
auto emptyRange = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 20)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
assertThrown!DateTimeException((in IntervalRange!(Date, Direction.fwd) range){range.front;}(emptyRange));
auto range = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed));
assert(range.front == Date(2010, 7, 4));
auto poppedRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
assert(poppedRange.front == Date(2010, 7, 7));
const cRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
static assert(__traits(compiles, cRange.front));
}
//bwd
{
auto emptyRange = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 20)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
assertThrown!DateTimeException((in IntervalRange!(Date, Direction.bwd) range){range.front;}(emptyRange));
auto range = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed));
assert(range.front == Date(2012, 1, 7));
auto poppedRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
assert(poppedRange.front == Date(2012, 1, 4));
const cRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
static assert(__traits(compiles, cRange.front));
}
}
//Test IntervalRange's popFront().
unittest
{
//fwd
{
auto emptyRange = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 20)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
assertThrown!DateTimeException((IntervalRange!(Date, Direction.fwd) range){range.popFront();}(emptyRange));
auto range = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
foreach(date; range)
{
assert(date == expected);
expected += dur!"days"(7);
}
assert(walkLength(range) == 79);
const cRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
static assert(__traits(compiles, cRange.front));
}
//bwd
{
auto emptyRange = Interval!Date(Date(2010, 9, 19), Date(2010, 9, 20)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
assertThrown!DateTimeException((IntervalRange!(Date, Direction.bwd) range){range.popFront();}(emptyRange));
auto range = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
foreach(date; range)
{
assert(date == expected);
expected += dur!"days"(-7);
}
assert(walkLength(range) == 79);
const cRange = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
static assert(!__traits(compiles, cRange.popFront()));
}
}
//Test IntervalRange's save.
unittest
{
//fwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.save == range);
}
//bwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.save == range);
}
}
//Test IntervalRange's interval.
unittest
{
//fwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.interval == interval);
const cRange = range;
static assert(__traits(compiles, cRange.interval));
}
//bwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.interval == interval);
const cRange = range;
static assert(__traits(compiles, cRange.interval));
}
}
//Test IntervalRange's func.
unittest
{
//fwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.func == func);
}
//bwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.func == func);
}
}
//Test IntervalRange's direction.
unittest
{
//fwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.direction == Direction.fwd);
const cRange = range;
static assert(__traits(compiles, cRange.direction));
}
//bwd
{
auto interval = Interval!Date(Date(2010, 7, 4), Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.direction == Direction.bwd);
const cRange = range;
static assert(__traits(compiles, cRange.direction));
}
}
/++
A range over a $(D PosInfInterval). It is an infinite range.
$(D PosInfIntervalRange) is only ever constructed by $(D PosInfInterval).
However, when it is constructed, it is given a function, $(D func), which
is used to generate the time points which are iterated over. $(D func)
takes a time point and returns a time point of the same type. For
instance, to iterate
over all of the days in the interval $(D PosInfInterval!Date), pass a function to
$(D PosInfInterval)'s $(D fwdRange) where that function took a $(LREF Date) and
returned a $(LREF Date) which was one day later. That function would then be
used by $(D PosInfIntervalRange)'s $(D popFront) to iterate over the
$(LREF Date)s in the interval - though obviously, since the range is infinite,
use a function such as $(D std.range.take) with it rather than
iterating over $(I all) of the dates.
As the interval goes to positive infinity, the range is always iterated over
forwards, never backwards. $(D func) must generate a time point going in
the proper direction of iteration, or a $(LREF DateTimeException) will be
thrown. So, the time points that $(D func) generates must be later in time
than the one passed to it. If it's either identical or earlier in time, then
a $(LREF DateTimeException) will be thrown.
+/
struct PosInfIntervalRange(TP)
if(isTimePoint!TP)
{
public:
/++
Params:
rhs = The $(D PosInfIntervalRange) to assign to this one.
+/
ref PosInfIntervalRange opAssign(ref PosInfIntervalRange rhs) pure nothrow
{
_interval = rhs._interval;
_func = rhs._func;
return this;
}
/++ Ditto +/
ref PosInfIntervalRange opAssign(PosInfIntervalRange rhs) pure nothrow
{
return this = rhs;
}
/++
This is an infinite range, so it is never empty.
+/
enum bool empty = false;
/++
The first time point in the range.
+/
@property TP front() const pure nothrow
{
return _interval.begin;
}
/++
Pops $(D front) from the range, using $(D func) to generate the next
time point in the range.
Throws:
$(LREF DateTimeException) if the generated time point is less than
$(D front).
+/
void popFront()
{
auto begin = _func(_interval.begin);
_enforceCorrectDirection(begin);
_interval.begin = begin;
}
/++
Returns a copy of $(D this).
+/
@property PosInfIntervalRange save() pure nothrow
{
return this;
}
/++
The interval that this range currently covers.
+/
@property PosInfInterval!TP interval() const pure nothrow
{
return cast(PosInfInterval!TP)_interval;
}
/++
The function used to generate the next time point in the range.
+/
TP delegate(in TP) func() pure nothrow @property
{
return _func;
}
private:
/+
Params:
interval = The interval that this range covers.
func = The function used to generate the time points which are
iterated over.
+/
this(in PosInfInterval!TP interval, TP delegate(in TP) func) pure nothrow
{
_func = func;
_interval = interval;
}
/+
Throws:
$(LREF DateTimeException) if $(D_PARAME newTP) is in the wrong
direction.
+/
void _enforceCorrectDirection(in TP newTP, size_t line = __LINE__) const
{
import std.format : format;
enforce(newTP > _interval._begin,
new DateTimeException(format("Generated time point is before previous begin: prev [%s] new [%s]",
interval._begin,
newTP),
__FILE__,
line));
}
PosInfInterval!TP _interval;
TP delegate(in TP) _func;
}
//Test that PosInfIntervalRange satisfies the range predicates that it's supposed to satisfy.
unittest
{
static assert(isInputRange!(PosInfIntervalRange!Date));
static assert(isForwardRange!(PosInfIntervalRange!Date));
static assert(isInfinite!(PosInfIntervalRange!Date));
//Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=4895
//static assert(!isOutputRange!(PosInfIntervalRange!Date, Date));
static assert(!isBidirectionalRange!(PosInfIntervalRange!Date));
static assert(!isRandomAccessRange!(PosInfIntervalRange!Date));
static assert(!hasSwappableElements!(PosInfIntervalRange!Date));
static assert(!hasAssignableElements!(PosInfIntervalRange!Date));
static assert(!hasLength!(PosInfIntervalRange!Date));
static assert(!hasSlicing!(PosInfIntervalRange!Date));
static assert(is(ElementType!(PosInfIntervalRange!Date) == Date));
static assert(is(ElementType!(PosInfIntervalRange!TimeOfDay) == TimeOfDay));
static assert(is(ElementType!(PosInfIntervalRange!DateTime) == DateTime));
static assert(is(ElementType!(PosInfIntervalRange!SysTime) == SysTime));
}
//Test construction of PosInfIntervalRange.
unittest
{
{
Date dateFunc(in Date date)
{
return date;
}
auto posInfInterval = PosInfInterval!Date(Date(2010, 7, 4));
auto ir = PosInfIntervalRange!Date(posInfInterval, &dateFunc);
}
{
TimeOfDay todFunc(in TimeOfDay tod)
{
return tod;
}
auto posInfInterval = PosInfInterval!TimeOfDay(TimeOfDay(12, 1, 7));
auto ir = PosInfIntervalRange!(TimeOfDay)(posInfInterval, &todFunc);
}
{
DateTime dtFunc(in DateTime dt)
{
return dt;
}
auto posInfInterval = PosInfInterval!DateTime(DateTime(2010, 7, 4, 12, 1, 7));
auto ir = PosInfIntervalRange!(DateTime)(posInfInterval, &dtFunc);
}
{
SysTime stFunc(in SysTime st)
{
return cast(SysTime)st;
}
auto posInfInterval = PosInfInterval!SysTime(SysTime(DateTime(2010, 7, 4, 12, 1, 7)));
auto ir = PosInfIntervalRange!(SysTime)(posInfInterval, &stFunc);
}
}
//Test PosInfIntervalRange's front.
unittest
{
auto range = PosInfInterval!Date(Date(2010, 7, 4)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed));
assert(range.front == Date(2010, 7, 4));
auto poppedRange = PosInfInterval!Date(Date(2010, 7, 4)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
assert(poppedRange.front == Date(2010, 7, 7));
const cRange = PosInfInterval!Date(Date(2010, 7, 4)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
static assert(__traits(compiles, cRange.front));
}
//Test PosInfIntervalRange's popFront().
unittest
{
import std.range;
auto range = PosInfInterval!Date(Date(2010, 7, 4)).fwdRange(everyDayOfWeek!Date(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
foreach(date; take(range, 79))
{
assert(date == expected);
expected += dur!"days"(7);
}
const cRange = PosInfInterval!Date(Date(2010, 7, 4)).fwdRange(everyDayOfWeek!Date(DayOfWeek.fri));
static assert(!__traits(compiles, cRange.popFront()));
}
//Test PosInfIntervalRange's save.
unittest
{
auto interval = PosInfInterval!Date(Date(2010, 7, 4));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.save == range);
}
//Test PosInfIntervalRange's interval.
unittest
{
auto interval = PosInfInterval!Date(Date(2010, 7, 4));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.interval == interval);
const cRange = range;
static assert(__traits(compiles, cRange.interval));
}
//Test PosInfIntervalRange's func.
unittest
{
auto interval = PosInfInterval!Date(Date(2010, 7, 4));
auto func = everyDayOfWeek!Date(DayOfWeek.fri);
auto range = interval.fwdRange(func);
assert(range.func == func);
}
/++
A range over a $(D NegInfInterval). It is an infinite range.
$(D NegInfIntervalRange) is only ever constructed by $(D NegInfInterval).
However, when it is constructed, it is given a function, $(D func), which
is used to generate the time points which are iterated over. $(D func)
takes a time point and returns a time point of the same type. For
instance, to iterate
over all of the days in the interval $(D NegInfInterval!Date), pass a function to
$(D NegInfInterval)'s $(D bwdRange) where that function took a $(LREF Date) and
returned a $(LREF Date) which was one day earlier. That function would then be
used by $(D NegInfIntervalRange)'s $(D popFront) to iterate over the
$(LREF Date)s in the interval - though obviously, since the range is infinite,
use a function such as $(D std.range.take) with it rather than
iterating over $(I all) of the dates.
As the interval goes to negative infinity, the range is always iterated over
backwards, never forwards. $(D func) must generate a time point going in
the proper direction of iteration, or a $(LREF DateTimeException) will be
thrown. So, the time points that $(D func) generates must be earlier in time
than the one passed to it. If it's either identical or later in time, then a
$(LREF DateTimeException) will be thrown.
Also note that while normally the $(D end) of an interval is excluded from
it, $(D NegInfIntervalRange) treats it as if it were included. This allows
for the same behavior as with $(D PosInfIntervalRange). This works
because none of $(D NegInfInterval)'s functions which care about whether
$(D end) is included or excluded are ever called by
$(D NegInfIntervalRange). $(D interval) returns a normal interval, so any
$(D NegInfInterval) functions which are called on it which care about
whether $(D end) is included or excluded will treat $(D end) as excluded.
+/
struct NegInfIntervalRange(TP)
if(isTimePoint!TP)
{
public:
/++
Params:
rhs = The $(D NegInfIntervalRange) to assign to this one.
+/
ref NegInfIntervalRange opAssign(ref NegInfIntervalRange rhs) pure nothrow
{
_interval = rhs._interval;
_func = rhs._func;
return this;
}
/++ Ditto +/
ref NegInfIntervalRange opAssign(NegInfIntervalRange rhs) pure nothrow
{
return this = rhs;
}
/++
This is an infinite range, so it is never empty.
+/
enum bool empty = false;
/++
The first time point in the range.
+/
@property TP front() const pure nothrow
{
return _interval.end;
}
/++
Pops $(D front) from the range, using $(D func) to generate the next
time point in the range.
Throws:
$(LREF DateTimeException) if the generated time point is greater than
$(D front).
+/
void popFront()
{
auto end = _func(_interval.end);
_enforceCorrectDirection(end);
_interval.end = end;
}
/++
Returns a copy of $(D this).
+/
@property NegInfIntervalRange save() pure nothrow
{
return this;
}
/++
The interval that this range currently covers.
+/
@property NegInfInterval!TP interval() const pure nothrow
{
return cast(NegInfInterval!TP)_interval;
}
/++
The function used to generate the next time point in the range.
+/
TP delegate(in TP) func() pure nothrow @property
{
return _func;
}
private:
/+
Params:
interval = The interval that this range covers.
func = The function used to generate the time points which are
iterated over.
+/
this(in NegInfInterval!TP interval, TP delegate(in TP) func) pure nothrow
{
_func = func;
_interval = interval;
}
/+
Throws:
$(LREF DateTimeException) if $(D_PARAM newTP) is in the wrong
direction.
+/
void _enforceCorrectDirection(in TP newTP, size_t line = __LINE__) const
{
import std.format : format;
enforce(newTP < _interval._end,
new DateTimeException(format("Generated time point is before previous end: prev [%s] new [%s]",
interval._end,
newTP),
__FILE__,
line));
}
NegInfInterval!TP _interval;
TP delegate(in TP) _func;
}
//Test that NegInfIntervalRange satisfies the range predicates that it's supposed to satisfy.
unittest
{
static assert(isInputRange!(NegInfIntervalRange!Date));
static assert(isForwardRange!(NegInfIntervalRange!Date));
static assert(isInfinite!(NegInfIntervalRange!Date));
//Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=4895
//static assert(!isOutputRange!(NegInfIntervalRange!Date, Date));
static assert(!isBidirectionalRange!(NegInfIntervalRange!Date));
static assert(!isRandomAccessRange!(NegInfIntervalRange!Date));
static assert(!hasSwappableElements!(NegInfIntervalRange!Date));
static assert(!hasAssignableElements!(NegInfIntervalRange!Date));
static assert(!hasLength!(NegInfIntervalRange!Date));
static assert(!hasSlicing!(NegInfIntervalRange!Date));
static assert(is(ElementType!(NegInfIntervalRange!Date) == Date));
static assert(is(ElementType!(NegInfIntervalRange!TimeOfDay) == TimeOfDay));
static assert(is(ElementType!(NegInfIntervalRange!DateTime) == DateTime));
}
//Test construction of NegInfIntervalRange.
unittest
{
{
Date dateFunc(in Date date)
{
return date;
}
auto negInfInterval = NegInfInterval!Date(Date(2012, 1, 7));
auto ir = NegInfIntervalRange!Date(negInfInterval, &dateFunc);
}
{
TimeOfDay todFunc(in TimeOfDay tod)
{
return tod;
}
auto negInfInterval = NegInfInterval!TimeOfDay(TimeOfDay(14, 0, 0));
auto ir = NegInfIntervalRange!(TimeOfDay)(negInfInterval, &todFunc);
}
{
DateTime dtFunc(in DateTime dt)
{
return dt;
}
auto negInfInterval = NegInfInterval!DateTime(DateTime(2012, 1, 7, 14, 0, 0));
auto ir = NegInfIntervalRange!(DateTime)(negInfInterval, &dtFunc);
}
{
SysTime stFunc(in SysTime st)
{
return cast(SysTime)(st);
}
auto negInfInterval = NegInfInterval!SysTime(SysTime(DateTime(2012, 1, 7, 14, 0, 0)));
auto ir = NegInfIntervalRange!(SysTime)(negInfInterval, &stFunc);
}
}
//Test NegInfIntervalRange's front.
unittest
{
auto range = NegInfInterval!Date(Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed));
assert(range.front == Date(2012, 1, 7));
auto poppedRange = NegInfInterval!Date(Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
assert(poppedRange.front == Date(2012, 1, 4));
const cRange = NegInfInterval!Date(Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
static assert(__traits(compiles, cRange.front));
}
//Test NegInfIntervalRange's popFront().
unittest
{
import std.range;
auto range = NegInfInterval!Date(Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.wed), PopFirst.yes);
auto expected = range.front;
foreach(date; take(range, 79))
{
assert(date == expected);
expected += dur!"days"(-7);
}
const cRange = NegInfInterval!Date(Date(2012, 1, 7)).bwdRange(everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri));
static assert(!__traits(compiles, cRange.popFront()));
}
//Test NegInfIntervalRange's save.
unittest
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.save == range);
}
//Test NegInfIntervalRange's interval.
unittest
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.interval == interval);
const cRange = range;
static assert(__traits(compiles, cRange.interval));
}
//Test NegInfIntervalRange's func.
unittest
{
auto interval = NegInfInterval!Date(Date(2012, 1, 7));
auto func = everyDayOfWeek!(Date, Direction.bwd)(DayOfWeek.fri);
auto range = interval.bwdRange(func);
assert(range.func == func);
}
//==============================================================================
// Section with time zones.
//==============================================================================
/++
Represents a time zone. It is used with $(LREF SysTime) to indicate the time
zone of a $(LREF SysTime).
+/
abstract class TimeZone
{
public:
/++
The name of the time zone per the TZ Database. This is the name used to
get a $(LREF2 .TimeZone, TimeZone) by name with $(D TimeZone.getTimeZone).
See_Also:
$(WEB en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ
Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of
Time Zones)
+/
@property string name() @safe const nothrow
{
return _name;
}
/++
Typically, the abbreviation (generally 3 or 4 letters) for the time zone
when DST is $(I not) in effect (e.g. PST). It is not necessarily unique.
However, on Windows, it may be the unabbreviated name (e.g. Pacific
Standard Time). Regardless, it is not the same as name.
+/
@property string stdName() @safe const nothrow
{
return _stdName;
}
/++
Typically, the abbreviation (generally 3 or 4 letters) for the time zone
when DST $(I is) in effect (e.g. PDT). It is not necessarily unique.
However, on Windows, it may be the unabbreviated name (e.g. Pacific
Daylight Time). Regardless, it is not the same as name.
+/
@property string dstName() @safe const nothrow
{
return _dstName;
}
/++
Whether this time zone has Daylight Savings Time at any point in time.
Note that for some time zone types it may not have DST for current dates
but will still return true for $(D hasDST) because the time zone did at
some point have DST.
+/
@property abstract bool hasDST() @safe const nothrow;
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in UTC time (i.e. std time) and returns whether DST is effect in this
time zone at the given point in time.
Params:
stdTime = The UTC time that needs to be checked for DST in this time
zone.
+/
abstract bool dstInEffect(long stdTime) @safe const nothrow;
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in UTC time (i.e. std time) and converts it to this time zone's time.
Params:
stdTime = The UTC time that needs to be adjusted to this time zone's
time.
+/
abstract long utcToTZ(long stdTime) @safe const nothrow;
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in this time zone's time and converts it to UTC (i.e. std time).
Params:
adjTime = The time in this time zone that needs to be adjusted to
UTC time.
+/
abstract long tzToUTC(long adjTime) @safe const nothrow;
/++
Returns what the offset from UTC is at the given std time.
It includes the DST offset in effect at that time (if any).
Params:
stdTime = The UTC time for which to get the offset from UTC for this
time zone.
+/
Duration utcOffsetAt(long stdTime) @safe const nothrow
{
return dur!"hnsecs"(utcToTZ(stdTime) - stdTime);
}
/++
Returns a $(LREF2 .TimeZone, TimeZone) with the give name per the TZ Database.
This returns a $(LREF PosixTimeZone) on Posix systems and a
$(LREF WindowsTimeZone) on Windows systems. For
$(LREF PosixTimeZone) on Windows, call $(D PosixTimeZone.getTimeZone)
directly and give it the location of the TZ Database time zone files on
disk.
On Windows, the given TZ Database name is converted to the corresponding
time zone name on Windows prior to calling
$(D WindowsTimeZone.getTimeZone). This function allows for
the same time zone names on both Windows and Posix systems.
See_Also:
$(WEB en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ
Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of
Time Zones)<br>
$(WEB unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html,
Windows <-> TZ Database Name Conversion Table)
Params:
name = The TZ Database name of the desired time zone
Throws:
$(LREF DateTimeException) if the given time zone could not be found.
Examples:
--------------------
auto tz = TimeZone.getTimeZone("America/Los_Angeles");
--------------------
+/
static immutable(TimeZone) getTimeZone(string name) @safe
{
version(Posix)
return PosixTimeZone.getTimeZone(name);
else version(Windows)
{
import std.format : format;
auto windowsTZName = tzDatabaseNameToWindowsTZName(name);
if(windowsTZName != null)
{
try
return WindowsTimeZone.getTimeZone(windowsTZName);
catch(DateTimeException dte)
{
auto oldName = _getOldName(windowsTZName);
if(oldName != null)
return WindowsTimeZone.getTimeZone(oldName);
throw dte;
}
}
else
throw new DateTimeException(format("%s does not have an equivalent Windows time zone.", name));
}
}
// The purpose of this is to handle the case where a Windows time zone is
// new and exists on an up-to-date Windows box but does not exist on Windows
// boxes which have not been properly updated. The "date added" is included
// on the theory that we'll be able to remove them at some point in the
// the future once enough time has passed, and that way, we know how much
// time has passed.
private static string _getOldName(string windowsTZName) @safe pure nothrow
{
switch(windowsTZName)
{
case "Belarus Standard Time": return "Kaliningrad Standard Time"; // Added 2014-10-08
case "Russia Time Zone 10": return "Magadan Standard Time"; // Added 2014-10-08
case "Russia Time Zone 11": return "Magadan Standard Time"; // Added 2014-10-08
case "Russia Time Zone 3": return "Russian Standard Time"; // Added 2014-10-08
default: return null;
}
}
//Since reading in the time zone files could be expensive, most unit tests
//are consolidated into this one unittest block which minimizes how often it
//reads a time zone file.
unittest
{
import std.path : buildPath;
import std.file : exists, isFile;
import std.conv : to;
import std.format : format;
version(Posix) scope(exit) clearTZEnvVar();
static immutable(TimeZone) testTZ(string tzName,
string stdName,
string dstName,
Duration utcOffset,
Duration dstOffset,
bool north = true)
{
scope(failure) writefln("Failed time zone: %s", tzName);
immutable tz = TimeZone.getTimeZone(tzName);
immutable hasDST = dstOffset != dur!"hnsecs"(0);
version(Posix)
assert(tz.name == tzName);
else version(Windows)
assert(tz.name == stdName);
//assert(tz.stdName == stdName); //Locale-dependent
//assert(tz.dstName == dstName); //Locale-dependent
assert(tz.hasDST == hasDST);
immutable stdDate = DateTime(2010, north ? 1 : 7, 1, 6, 0, 0);
immutable dstDate = DateTime(2010, north ? 7 : 1, 1, 6, 0, 0);
auto std = SysTime(stdDate, tz);
auto dst = SysTime(dstDate, tz);
auto stdUTC = SysTime(stdDate - utcOffset, UTC());
auto dstUTC = SysTime(stdDate - utcOffset + dstOffset, UTC());
assert(!std.dstInEffect);
assert(dst.dstInEffect == hasDST);
assert(tz.utcOffsetAt(std.stdTime) == utcOffset);
assert(tz.utcOffsetAt(dst.stdTime) == utcOffset + dstOffset);
assert(cast(DateTime)std == stdDate);
assert(cast(DateTime)dst == dstDate);
assert(std == stdUTC);
version(Posix)
{
setTZEnvVar(tzName);
static void testTM(in SysTime st)
{
time_t unixTime = st.toUnixTime();
tm* osTimeInfo = localtime(&unixTime);
tm ourTimeInfo = st.toTM();
assert(ourTimeInfo.tm_sec == osTimeInfo.tm_sec);
assert(ourTimeInfo.tm_min == osTimeInfo.tm_min);
assert(ourTimeInfo.tm_hour == osTimeInfo.tm_hour);
assert(ourTimeInfo.tm_mday == osTimeInfo.tm_mday);
assert(ourTimeInfo.tm_mon == osTimeInfo.tm_mon);
assert(ourTimeInfo.tm_year == osTimeInfo.tm_year);
assert(ourTimeInfo.tm_wday == osTimeInfo.tm_wday);
assert(ourTimeInfo.tm_yday == osTimeInfo.tm_yday);
assert(ourTimeInfo.tm_isdst == osTimeInfo.tm_isdst);
assert(ourTimeInfo.tm_gmtoff == osTimeInfo.tm_gmtoff);
assert(to!string(ourTimeInfo.tm_zone) ==
to!string(osTimeInfo.tm_zone));
}
testTM(std);
testTM(dst);
//Apparently, right/ does not exist on Mac OS X. I don't know
//whether or not it exists on FreeBSD. It's rather pointless
//normally, since the Posix standard requires that leap seconds
//be ignored, so it does make some sense that right/ wouldn't
//be there, but since PosixTimeZone _does_ use leap seconds if
//the time zone file does, we'll test that functionality if the
//appropriate files exist.
if(buildPath(PosixTimeZone.defaultTZDatabaseDir, "right", tzName).exists)
{
auto leapTZ = PosixTimeZone.getTimeZone("right/" ~ tzName);
assert(leapTZ.name == "right/" ~ tzName);
//assert(leapTZ.stdName == stdName); //Locale-dependent
//assert(leapTZ.dstName == dstName); //Locale-dependent
assert(leapTZ.hasDST == hasDST);
auto leapSTD = SysTime(std.stdTime, leapTZ);
auto leapDST = SysTime(dst.stdTime, leapTZ);
assert(!leapSTD.dstInEffect);
assert(leapDST.dstInEffect == hasDST);
assert(leapSTD.stdTime == std.stdTime);
assert(leapDST.stdTime == dst.stdTime);
//Whenever a leap second is added/removed,
//this will have to be adjusted.
//enum leapDiff = convert!("seconds", "hnsecs")(25);
//assert(leapSTD.adjTime - leapDiff == std.adjTime);
//assert(leapDST.adjTime - leapDiff == dst.adjTime);
}
}
return tz;
}
auto dstSwitches = [/+America/Los_Angeles+/ tuple(DateTime(2012, 3, 11), DateTime(2012, 11, 4), 2, 2),
/+America/New_York+/ tuple(DateTime(2012, 3, 11), DateTime(2012, 11, 4), 2, 2),
///+America/Santiago+/ tuple(DateTime(2011, 8, 21), DateTime(2011, 5, 8), 0, 0),
/+Europe/London+/ tuple(DateTime(2012, 3, 25), DateTime(2012, 10, 28), 1, 2),
/+Europe/Paris+/ tuple(DateTime(2012, 3, 25), DateTime(2012, 10, 28), 2, 3),
/+Australia/Adelaide+/ tuple(DateTime(2012, 10, 7), DateTime(2012, 4, 1), 2, 3)];
version(Posix)
{
version(FreeBSD) enum utcZone = "Etc/UTC";
else version(linux) enum utcZone = "UTC";
else version(OSX) enum utcZone = "UTC";
else version(Android) enum utcZone = "UTC";
else static assert(0, "The location of the UTC timezone file on this Posix platform must be set.");
auto tzs = [testTZ("America/Los_Angeles", "PST", "PDT", dur!"hours"(-8), dur!"hours"(1)),
testTZ("America/New_York", "EST", "EDT", dur!"hours"(-5), dur!"hours"(1)),
//testTZ("America/Santiago", "CLT", "CLST", dur!"hours"(-4), dur!"hours"(1), false),
testTZ("Europe/London", "GMT", "BST", dur!"hours"(0), dur!"hours"(1)),
testTZ("Europe/Paris", "CET", "CEST", dur!"hours"(1), dur!"hours"(1)),
//Per www.timeanddate.com, it should be "CST" and "CDT",
//but the OS insists that it's "CST" for both. We should
//probably figure out how to report an error in the TZ
//database and report it.
testTZ("Australia/Adelaide", "CST", "CST",
dur!"hours"(9) + dur!"minutes"(30), dur!"hours"(1), false)];
testTZ(utcZone, "UTC", "UTC", dur!"hours"(0), dur!"hours"(0));
assertThrown!DateTimeException(PosixTimeZone.getTimeZone("hello_world"));
}
else version(Windows)
{
auto tzs = [testTZ("America/Los_Angeles", "Pacific Standard Time",
"Pacific Daylight Time", dur!"hours"(-8), dur!"hours"(1)),
testTZ("America/New_York", "Eastern Standard Time",
"Eastern Daylight Time", dur!"hours"(-5), dur!"hours"(1)),
//testTZ("America/Santiago", "Pacific SA Standard Time",
//"Pacific SA Daylight Time", dur!"hours"(-4), dur!"hours"(1), false),
testTZ("Europe/London", "GMT Standard Time",
"GMT Daylight Time", dur!"hours"(0), dur!"hours"(1)),
testTZ("Europe/Paris", "Romance Standard Time",
"Romance Daylight Time", dur!"hours"(1), dur!"hours"(1)),
testTZ("Australia/Adelaide", "Cen. Australia Standard Time",
"Cen. Australia Daylight Time",
dur!"hours"(9) + dur!"minutes"(30), dur!"hours"(1), false)];
testTZ("Atlantic/Reykjavik", "Greenwich Standard Time",
"Greenwich Daylight Time", dur!"hours"(0), dur!"hours"(0));
assertThrown!DateTimeException(WindowsTimeZone.getTimeZone("hello_world"));
}
else
assert(0, "OS not supported.");
foreach(i; 0 .. tzs.length)
{
auto tz = tzs[i];
immutable spring = dstSwitches[i][2];
immutable fall = dstSwitches[i][3];
auto stdOffset = SysTime(dstSwitches[i][0] + dur!"days"(-1), tz).utcOffset;
auto dstOffset = stdOffset + dur!"hours"(1);
//Verify that creating a SysTime in the given time zone results
//in a SysTime with the correct std time during and surrounding
//a DST switch.
foreach(hour; -12 .. 13)
{
auto st = SysTime(dstSwitches[i][0] + dur!"hours"(hour), tz);
immutable targetHour = hour < 0 ? hour + 24 : hour;
static void testHour(SysTime st, int hour, string tzName, size_t line = __LINE__)
{
enforce(st.hour == hour,
new AssertError(format("[%s] [%s]: [%s] [%s]", st, tzName, st.hour, hour),
__FILE__, line));
}
void testOffset1(Duration offset, bool dstInEffect, size_t line = __LINE__)
{
AssertError msg(string tag)
{
return new AssertError(format("%s [%s] [%s]: [%s] [%s] [%s]",
tag, st, tz.name, st.utcOffset, stdOffset, dstOffset),
__FILE__, line);
}
enforce(st.dstInEffect == dstInEffect, msg("1"));
enforce(st.utcOffset == offset, msg("2"));
enforce((st + dur!"minutes"(1)).utcOffset == offset, msg("3"));
}
if(hour == spring)
{
testHour(st, spring + 1, tz.name);
testHour(st + dur!"minutes"(1), spring + 1, tz.name);
}
else
{
testHour(st, targetHour, tz.name);
testHour(st + dur!"minutes"(1), targetHour, tz.name);
}
if(hour < spring)
testOffset1(stdOffset, false);
else
testOffset1(dstOffset, true);
st = SysTime(dstSwitches[i][1] + dur!"hours"(hour), tz);
testHour(st, targetHour, tz.name);
//Verify that 01:00 is the first 01:00 (or whatever hour before the switch is).
if(hour == fall - 1)
testHour(st + dur!"hours"(1), targetHour, tz.name);
if(hour < fall)
testOffset1(dstOffset, true);
else
testOffset1(stdOffset, false);
}
//Verify that converting a time in UTC to a time in another
//time zone results in the correct time during and surrounding
//a DST switch.
bool first = true;
auto springSwitch = SysTime(dstSwitches[i][0] + dur!"hours"(spring), UTC()) - stdOffset;
auto fallSwitch = SysTime(dstSwitches[i][1] + dur!"hours"(fall), UTC()) - dstOffset;
//@@@BUG@@@ 3659 makes this necessary.
auto fallSwitchMinus1 = fallSwitch - dur!"hours"(1);
foreach(hour; -24 .. 25)
{
auto utc = SysTime(dstSwitches[i][0] + dur!"hours"(hour), UTC());
auto local = utc.toOtherTZ(tz);
void testOffset2(Duration offset, size_t line = __LINE__)
{
AssertError msg(string tag)
{
return new AssertError(format("%s [%s] [%s]: [%s] [%s]", tag, hour, tz.name, utc, local),
__FILE__, line);
}
enforce((utc + offset).hour == local.hour, msg("1"));
enforce((utc + offset + dur!"minutes"(1)).hour == local.hour, msg("2"));
}
if(utc < springSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
utc = SysTime(dstSwitches[i][1] + dur!"hours"(hour), UTC());
local = utc.toOtherTZ(tz);
if(utc == fallSwitch || utc == fallSwitchMinus1)
{
if(first)
{
testOffset2(dstOffset);
first = false;
}
else
testOffset2(stdOffset);
}
else if(utc > fallSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
}
}
}
/++
Returns a list of the names of the time zones installed on the system.
Providing a sub-name narrows down the list of time zones (which
can number in the thousands). For example,
passing in "America" as the sub-name returns only the time zones which
begin with "America".
On Windows, this function will convert the Windows time zone names to
the corresponding TZ Database names with
$(D windowsTZNameToTZDatabaseName). To get the actual Windows time
zone names, use $(D WindowsTimeZone.getInstalledTZNames) directly.
Params:
subName = The first part of the time zones desired.
Throws:
$(D FileException) on Posix systems if it fails to read from disk.
$(LREF DateTimeException) on Windows systems if it fails to read the
registry.
+/
static string[] getInstalledTZNames(string subName = "") @safe
{
version(Posix)
return PosixTimeZone.getInstalledTZNames(subName);
else version(Windows)
{
import std.array : appender;
import std.algorithm : startsWith, sort;
import std.format : format;
auto windowsNames = WindowsTimeZone.getInstalledTZNames();
auto retval = appender!(string[])();
foreach(winName; windowsNames)
{
auto tzName = windowsTZNameToTZDatabaseName(winName);
version(unittest)
{
import std.string;
assert(tzName !is null, format("TZName which is missing: %s", winName));
}
if(tzName !is null && tzName.startsWith(subName))
retval.put(tzName);
}
sort(retval.data);
return retval.data;
}
}
unittest
{
static void testPZSuccess(string tzName)
{
scope(failure) writefln("TZName which threw: %s", tzName);
TimeZone.getTimeZone(tzName);
}
auto tzNames = getInstalledTZNames();
// This was not previously tested, and it's currently failing, so I'm
// leaving it commented out until I can sort it out.
//assert(equal(tzNames, tzNames.uniq()));
foreach(tzName; tzNames)
assertNotThrown!DateTimeException(testPZSuccess(tzName));
}
private:
/+
Params:
name = The TZ Database name for the time zone.
stdName = The abbreviation for the time zone during std time.
dstName = The abbreviation for the time zone during DST.
+/
this(string name, string stdName, string dstName) @safe immutable pure
{
_name = name;
_stdName = stdName;
_dstName = dstName;
}
immutable string _name;
immutable string _stdName;
immutable string _dstName;
}
/++
A TimeZone which represents the current local time zone on
the system running your program.
This uses the underlying C calls to adjust the time rather than using
specific D code based off of system settings to calculate the time such as
$(LREF PosixTimeZone) and $(LREF WindowsTimeZone) do. That also means that it will
use whatever the current time zone is on the system, even if the system's
time zone changes while the program is running.
+/
final class LocalTime : TimeZone
{
public:
/++
$(LREF LocalTime) is a singleton class. $(LREF LocalTime) returns its only
instance.
+/
static immutable(LocalTime) opCall() @trusted pure nothrow
{
alias FuncType = @safe pure nothrow immutable(LocalTime) function();
return (cast(FuncType)&singleton)();
}
version(StdDdoc)
{
/++
The name of the time zone per the TZ Database. This is the name used to
get a $(LREF2 .TimeZone, TimeZone) by name with $(D TimeZone.getTimeZone).
Note that this always returns the empty string. This is because time
zones cannot be uniquely identified by the attributes given by the
OS (such as the $(D stdName) and $(D dstName)), and neither Posix
systems nor Windows systems provide an easy way to get the TZ
Database name of the local time zone.
See_Also:
$(WEB en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ
Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, List
of Time Zones)
+/
@property override string name() @safe const nothrow;
}
/++
Typically, the abbreviation (generally 3 or 4 letters) for the time zone
when DST is $(I not) in effect (e.g. PST). It is not necessarily unique.
However, on Windows, it may be the unabbreviated name (e.g. Pacific
Standard Time). Regardless, it is not the same as name.
This property is overridden because the local time of the system could
change while the program is running and we need to determine it
dynamically rather than it being fixed like it would be with most time
zones.
+/
@property override string stdName() @trusted const nothrow
{
version(Posix)
{
import std.conv : to;
try
return to!string(tzname[0]);
catch(Exception e)
assert(0, "to!string(tzname[0]) failed.");
}
else version(Windows)
{
try
{
TIME_ZONE_INFORMATION tzInfo;
GetTimeZoneInformation(&tzInfo);
//Cannot use to!string() like this should, probably due to bug http://d.puremagic.com/issues/show_bug.cgi?id=5016
//return to!string(tzInfo.StandardName);
wchar[32] str;
foreach(i, ref wchar c; str)
c = tzInfo.StandardName[i];
string retval;
foreach(dchar c; str)
{
if(c == '\0')
break;
retval ~= c;
}
return retval;
}
catch(Exception e)
assert(0, "GetTimeZoneInformation() threw.");
}
}
unittest
{
assert(LocalTime().stdName !is null);
version(Posix)
{
scope(exit) clearTZEnvVar();
setTZEnvVar("America/Los_Angeles");
assert(LocalTime().stdName == "PST");
setTZEnvVar("America/New_York");
assert(LocalTime().stdName == "EST");
}
}
/++
Typically, the abbreviation (generally 3 or 4 letters) for the time zone
when DST $(I is) in effect (e.g. PDT). It is not necessarily unique.
However, on Windows, it may be the unabbreviated name (e.g. Pacific
Daylight Time). Regardless, it is not the same as name.
This property is overridden because the local time of the system could
change while the program is running and we need to determine it
dynamically rather than it being fixed like it would be with most time
zones.
+/
@property override string dstName() @trusted const nothrow
{
version(Posix)
{
import std.conv : to;
try
return to!string(tzname[1]);
catch(Exception e)
assert(0, "to!string(tzname[1]) failed.");
}
else version(Windows)
{
try
{
TIME_ZONE_INFORMATION tzInfo;
GetTimeZoneInformation(&tzInfo);
//Cannot use to!string() like this should, probably due to bug http://d.puremagic.com/issues/show_bug.cgi?id=5016
//return to!string(tzInfo.DaylightName);
wchar[32] str;
foreach(i, ref wchar c; str)
c = tzInfo.DaylightName[i];
string retval;
foreach(dchar c; str)
{
if(c == '\0')
break;
retval ~= c;
}
return retval;
}
catch(Exception e)
assert(0, "GetTimeZoneInformation() threw.");
}
}
unittest
{
assert(LocalTime().dstName !is null);
version(Posix)
{
scope(exit) clearTZEnvVar();
version(FreeBSD)
{
// A bug on FreeBSD 9+ makes it so that this test fails.
// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=168862
}
else
{
setTZEnvVar("America/Los_Angeles");
assert(LocalTime().dstName == "PDT");
}
setTZEnvVar("America/New_York");
assert(LocalTime().dstName == "EDT");
}
}
/++
Whether this time zone has Daylight Savings Time at any point in time.
Note that for some time zone types it may not have DST for current
dates but will still return true for $(D hasDST) because the time zone
did at some point have DST.
+/
@property override bool hasDST() @trusted const nothrow
{
version(Posix)
{
static if(is(typeof(daylight)))
return cast(bool)(daylight);
else
{
try
{
auto currYear = (cast(Date)Clock.currTime()).year;
auto janOffset = SysTime(Date(currYear, 1, 4), cast(immutable)this).stdTime -
SysTime(Date(currYear, 1, 4), UTC()).stdTime;
auto julyOffset = SysTime(Date(currYear, 7, 4), cast(immutable)this).stdTime -
SysTime(Date(currYear, 7, 4), UTC()).stdTime;
return janOffset != julyOffset;
}
catch(Exception e)
assert(0, "Clock.currTime() threw.");
}
}
else version(Windows)
{
try
{
TIME_ZONE_INFORMATION tzInfo;
GetTimeZoneInformation(&tzInfo);
return tzInfo.DaylightDate.wMonth != 0;
}
catch(Exception e)
assert(0, "GetTimeZoneInformation() threw.");
}
}
unittest
{
LocalTime().hasDST;
version(Posix)
{
scope(exit) clearTZEnvVar();
setTZEnvVar("America/Los_Angeles");
assert(LocalTime().hasDST);
setTZEnvVar("America/New_York");
assert(LocalTime().hasDST);
setTZEnvVar("UTC");
assert(!LocalTime().hasDST);
}
}
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in UTC time (i.e. std time) and returns whether DST is in effect in this
time zone at the given point in time.
Params:
stdTime = The UTC time that needs to be checked for DST in this time
zone.
+/
override bool dstInEffect(long stdTime) @trusted const nothrow
{
time_t unixTime = stdTimeToUnixTime(stdTime);
version(Posix)
{
tm* timeInfo = localtime(&unixTime);
return cast(bool)(timeInfo.tm_isdst);
}
else version(Windows)
{
//Apparently Windows isn't smart enough to deal with negative time_t.
if(unixTime >= 0)
{
tm* timeInfo = localtime(&unixTime);
if(timeInfo)
return cast(bool)(timeInfo.tm_isdst);
}
TIME_ZONE_INFORMATION tzInfo;
try
GetTimeZoneInformation(&tzInfo);
catch(Exception e)
assert(0, "The impossible happened. GetTimeZoneInformation() threw.");
return WindowsTimeZone._dstInEffect(&tzInfo, stdTime);
}
}
unittest
{
auto currTime = Clock.currStdTime;
LocalTime().dstInEffect(currTime);
}
/++
Returns hnsecs in the local time zone using the standard C function
calls on Posix systems and the standard Windows system calls on Windows
systems to adjust the time to the appropriate time zone from std time.
Params:
stdTime = The UTC time that needs to be adjusted to this time zone's
time.
See_Also:
$(D TimeZone.utcToTZ)
+/
override long utcToTZ(long stdTime) @trusted const nothrow
{
version(Posix)
{
time_t unixTime = stdTimeToUnixTime(stdTime);
tm* timeInfo = localtime(&unixTime);
return stdTime + convert!("seconds", "hnsecs")(timeInfo.tm_gmtoff);
}
else version(Windows)
{
TIME_ZONE_INFORMATION tzInfo;
try
GetTimeZoneInformation(&tzInfo);
catch(Exception e)
assert(0, "GetTimeZoneInformation() threw.");
return WindowsTimeZone._utcToTZ(&tzInfo, stdTime, hasDST);
}
}
unittest
{
LocalTime().utcToTZ(0);
}
/++
Returns std time using the standard C function calls on Posix systems
and the standard Windows system calls on Windows systems to adjust the
time to UTC from the appropriate time zone.
See_Also:
$(D TimeZone.tzToUTC)
Params:
adjTime = The time in this time zone that needs to be adjusted to
UTC time.
+/
override long tzToUTC(long adjTime) @trusted const nothrow
{
version(Posix)
{
time_t unixTime = stdTimeToUnixTime(adjTime);
immutable past = unixTime - cast(time_t)convert!("days", "seconds")(1);
tm* timeInfo = localtime(past < unixTime ? &past : &unixTime);
immutable pastOffset = timeInfo.tm_gmtoff;
immutable future = unixTime + cast(time_t)convert!("days", "seconds")(1);
timeInfo = localtime(future > unixTime ? &future : &unixTime);
immutable futureOffset = timeInfo.tm_gmtoff;
if(pastOffset == futureOffset)
return adjTime - convert!("seconds", "hnsecs")(pastOffset);
if(pastOffset < futureOffset)
unixTime -= cast(time_t)convert!("hours", "seconds")(1);
unixTime -= pastOffset;
timeInfo = localtime(&unixTime);
return adjTime - convert!("seconds", "hnsecs")(timeInfo.tm_gmtoff);
}
else version(Windows)
{
TIME_ZONE_INFORMATION tzInfo;
try
GetTimeZoneInformation(&tzInfo);
catch(Exception e)
assert(0, "GetTimeZoneInformation() threw.");
return WindowsTimeZone._tzToUTC(&tzInfo, adjTime, hasDST);
}
}
unittest
{
import std.format : format;
assert(LocalTime().tzToUTC(LocalTime().utcToTZ(0)) == 0);
assert(LocalTime().utcToTZ(LocalTime().tzToUTC(0)) == 0);
assert(LocalTime().tzToUTC(LocalTime().utcToTZ(0)) == 0);
assert(LocalTime().utcToTZ(LocalTime().tzToUTC(0)) == 0);
version(Posix)
{
scope(exit) clearTZEnvVar();
auto tzInfos = [tuple("America/Los_Angeles", DateTime(2012, 3, 11), DateTime(2012, 11, 4), 2, 2),
tuple("America/New_York", DateTime(2012, 3, 11), DateTime(2012, 11, 4), 2, 2),
//tuple("America/Santiago", DateTime(2011, 8, 21), DateTime(2011, 5, 8), 0, 0),
tuple("Atlantic/Azores", DateTime(2011, 3, 27), DateTime(2011, 10, 30), 0, 1),
tuple("Europe/London", DateTime(2012, 3, 25), DateTime(2012, 10, 28), 1, 2),
tuple("Europe/Paris", DateTime(2012, 3, 25), DateTime(2012, 10, 28), 2, 3),
tuple("Australia/Adelaide", DateTime(2012, 10, 7), DateTime(2012, 4, 1), 2, 3)];
foreach(i; 0 .. tzInfos.length)
{
auto tzName = tzInfos[i][0];
setTZEnvVar(tzName);
immutable spring = tzInfos[i][3];
immutable fall = tzInfos[i][4];
auto stdOffset = SysTime(tzInfos[i][1] + dur!"hours"(-12)).utcOffset;
auto dstOffset = stdOffset + dur!"hours"(1);
//Verify that creating a SysTime in the given time zone results
//in a SysTime with the correct std time during and surrounding
//a DST switch.
foreach(hour; -12 .. 13)
{
auto st = SysTime(tzInfos[i][1] + dur!"hours"(hour));
immutable targetHour = hour < 0 ? hour + 24 : hour;
static void testHour(SysTime st, int hour, string tzName, size_t line = __LINE__)
{
enforce(st.hour == hour,
new AssertError(format("[%s] [%s]: [%s] [%s]", st, tzName, st.hour, hour),
__FILE__, line));
}
void testOffset1(Duration offset, bool dstInEffect, size_t line = __LINE__)
{
AssertError msg(string tag)
{
return new AssertError(format("%s [%s] [%s]: [%s] [%s] [%s]",
tag, st, tzName, st.utcOffset, stdOffset, dstOffset),
__FILE__, line);
}
enforce(st.dstInEffect == dstInEffect, msg("1"));
enforce(st.utcOffset == offset, msg("2"));
enforce((st + dur!"minutes"(1)).utcOffset == offset, msg("3"));
}
if(hour == spring)
{
testHour(st, spring + 1, tzName);
testHour(st + dur!"minutes"(1), spring + 1, tzName);
}
else
{
testHour(st, targetHour, tzName);
testHour(st + dur!"minutes"(1), targetHour, tzName);
}
if(hour < spring)
testOffset1(stdOffset, false);
else
testOffset1(dstOffset, true);
st = SysTime(tzInfos[i][2] + dur!"hours"(hour));
testHour(st, targetHour, tzName);
//Verify that 01:00 is the first 01:00 (or whatever hour before the switch is).
if(hour == fall - 1)
testHour(st + dur!"hours"(1), targetHour, tzName);
if(hour < fall)
testOffset1(dstOffset, true);
else
testOffset1(stdOffset, false);
}
//Verify that converting a time in UTC to a time in another
//time zone results in the correct time during and surrounding
//a DST switch.
bool first = true;
auto springSwitch = SysTime(tzInfos[i][1] + dur!"hours"(spring), UTC()) - stdOffset;
auto fallSwitch = SysTime(tzInfos[i][2] + dur!"hours"(fall), UTC()) - dstOffset;
//@@@BUG@@@ 3659 makes this necessary.
auto fallSwitchMinus1 = fallSwitch - dur!"hours"(1);
foreach(hour; -24 .. 25)
{
auto utc = SysTime(tzInfos[i][1] + dur!"hours"(hour), UTC());
auto local = utc.toLocalTime();
void testOffset2(Duration offset, size_t line = __LINE__)
{
AssertError msg(string tag)
{
return new AssertError(format("%s [%s] [%s]: [%s] [%s]", tag, hour, tzName, utc, local),
__FILE__, line);
}
enforce((utc + offset).hour == local.hour, msg("1"));
enforce((utc + offset + dur!"minutes"(1)).hour == local.hour, msg("2"));
}
if(utc < springSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
utc = SysTime(tzInfos[i][2] + dur!"hours"(hour), UTC());
local = utc.toLocalTime();
if(utc == fallSwitch || utc == fallSwitchMinus1)
{
if(first)
{
testOffset2(dstOffset);
first = false;
}
else
testOffset2(stdOffset);
}
else if(utc > fallSwitch)
testOffset2(stdOffset);
else
testOffset2(dstOffset);
}
}
}
}
private:
this() @safe immutable pure
{
super("", "", "");
}
static immutable LocalTime _localTime = new immutable(LocalTime)();
// Use low-lock singleton pattern with _tzsetWasCalled (see http://dconf.org/talks/simcha.html)
static bool _lowLock;
static shared bool _tzsetWasCalled;
// This is done so that we can maintain purity in spite of doing an impure
// operation the first time that LocalTime() is called.
static immutable(LocalTime) singleton() @trusted
{
if(!_lowLock)
{
synchronized
{
if(!_tzsetWasCalled)
{
tzset();
_tzsetWasCalled = true;
}
}
_lowLock = true;
}
return _localTime;
}
}
/++
A $(LREF2 .TimeZone, TimeZone) which represents UTC.
+/
final class UTC : TimeZone
{
public:
/++
$(D UTC) is a singleton class. $(D UTC) returns its only instance.
+/
static immutable(UTC) opCall() @safe pure nothrow
{
return _utc;
}
/++
Always returns false.
+/
@property override bool hasDST() @safe const nothrow
{
return false;
}
/++
Always returns false.
+/
override bool dstInEffect(long stdTime) @safe const nothrow
{
return false;
}
/++
Returns the given hnsecs without changing them at all.
Params:
stdTime = The UTC time that needs to be adjusted to this time zone's
time.
See_Also:
$(D TimeZone.utcToTZ)
+/
override long utcToTZ(long stdTime) @safe const nothrow
{
return stdTime;
}
unittest
{
assert(UTC().utcToTZ(0) == 0);
version(Posix)
{
scope(exit) clearTZEnvVar();
setTZEnvVar("UTC");
auto std = SysTime(Date(2010, 1, 1));
auto dst = SysTime(Date(2010, 7, 1));
assert(UTC().utcToTZ(std.stdTime) == std.stdTime);
assert(UTC().utcToTZ(dst.stdTime) == dst.stdTime);
}
}
/++
Returns the given hnsecs without changing them at all.
See_Also:
$(D TimeZone.tzToUTC)
Params:
adjTime = The time in this time zone that needs to be adjusted to
UTC time.
+/
override long tzToUTC(long adjTime) @safe const nothrow
{
return adjTime;
}
unittest
{
assert(UTC().tzToUTC(0) == 0);
version(Posix)
{
scope(exit) clearTZEnvVar();
setTZEnvVar("UTC");
auto std = SysTime(Date(2010, 1, 1));
auto dst = SysTime(Date(2010, 7, 1));
assert(UTC().tzToUTC(std.stdTime) == std.stdTime);
assert(UTC().tzToUTC(dst.stdTime) == dst.stdTime);
}
}
/++
Returns a $(CXREF time, Duration) of 0.
Params:
stdTime = The UTC time for which to get the offset from UTC for this
time zone.
+/
override Duration utcOffsetAt(long stdTime) @safe const nothrow
{
return dur!"hnsecs"(0);
}
private:
this() @safe immutable pure
{
super("UTC", "UTC", "UTC");
}
static immutable UTC _utc = new immutable(UTC)();
}
/++
Represents a time zone with an offset (in minutes, west is negative) from
UTC but no DST.
It's primarily used as the time zone in the result of $(LREF SysTime)'s
$(D fromISOString), $(D fromISOExtString), and $(D fromSimpleString).
$(D name) and $(D dstName) are always the empty string since this time zone
has no DST, and while it may be meant to represent a time zone which is in
the TZ Database, obviously it's not likely to be following the exact rules
of any of the time zones in the TZ Database, so it makes no sense to set it.
+/
final class SimpleTimeZone : TimeZone
{
public:
/++
Always returns false.
+/
@property override bool hasDST() @safe const nothrow
{
return false;
}
/++
Always returns false.
+/
override bool dstInEffect(long stdTime) @safe const nothrow
{
return false;
}
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in UTC time (i.e. std time) and converts it to this time zone's time.
Params:
stdTime = The UTC time that needs to be adjusted to this time zone's
time.
+/
override long utcToTZ(long stdTime) @safe const nothrow
{
return stdTime + _utcOffset.total!"hnsecs";
}
unittest
{
auto west = new immutable SimpleTimeZone(dur!"hours"(-8));
auto east = new immutable SimpleTimeZone(dur!"hours"(8));
assert(west.utcToTZ(0) == -288_000_000_000L);
assert(east.utcToTZ(0) == 288_000_000_000L);
assert(west.utcToTZ(54_321_234_567_890L) == 54_033_234_567_890L);
const cstz = west;
static assert(__traits(compiles, west.utcToTZ(50002)));
static assert(__traits(compiles, cstz.utcToTZ(50002)));
}
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in this time zone's time and converts it to UTC (i.e. std time).
Params:
adjTime = The time in this time zone that needs to be adjusted to
UTC time.
+/
override long tzToUTC(long adjTime) @safe const nothrow
{
return adjTime - _utcOffset.total!"hnsecs";
}
unittest
{
auto west = new immutable SimpleTimeZone(dur!"hours"(-8));
auto east = new immutable SimpleTimeZone(dur!"hours"(8));
assert(west.tzToUTC(-288_000_000_000L) == 0);
assert(east.tzToUTC(288_000_000_000L) == 0);
assert(west.tzToUTC(54_033_234_567_890L) == 54_321_234_567_890L);
const cstz = west;
static assert(__traits(compiles, west.tzToUTC(20005)));
static assert(__traits(compiles, cstz.tzToUTC(20005)));
}
/++
Returns utcOffset as a $(CXREF time, Duration).
Params:
stdTime = The UTC time for which to get the offset from UTC for this
time zone.
+/
override Duration utcOffsetAt(long stdTime) @safe const nothrow
{
return _utcOffset;
}
/++
Params:
utcOffset = This time zone's offset from UTC with west of UTC being
negative (it is added to UTC to get the adjusted time).
stdName = The $(D stdName) for this time zone.
+/
this(Duration utcOffset, string stdName = "") @safe immutable pure
{
//FIXME This probably needs to be changed to something like (-12 - 13).
enforce!DateTimeException(abs(utcOffset) < dur!"minutes"(1440),
"Offset from UTC must be within range (-24:00 - 24:00).");
super("", stdName, "");
this._utcOffset = utcOffset;
}
/++
$(RED Deprecated. Please use the overload which takes a Duration. This
overload will be removed in December 2014).
Params:
utcOffset = This time zone's offset from UTC in minutes with west of
negative (it is added to UTC to get the adjusted time).
stdName = The $(D stdName) for this time zone.
+/
deprecated("Please use the overload which takes a Duration.")
this(int utcOffset, string stdName = "") @safe immutable pure
{
this(dur!"minutes"(utcOffset), stdName);
}
unittest
{
auto stz = new immutable SimpleTimeZone(dur!"hours"(-8), "PST");
assert(stz.name == "");
assert(stz.stdName == "PST");
assert(stz.dstName == "");
assert(stz.utcOffset == dur!"hours"(-8));
}
/++
The amount of time the offset from UTC is (negative is west of UTC,
positive is east).
+/
@property Duration utcOffset() @safe const pure nothrow
{
return _utcOffset;
}
private:
/+
Returns a time zone as a string with an offset from UTC.
Time zone offsets will be in the form +HH:MM or -HH:MM.
Params:
utcOffset = The number of minutes offset from UTC (negative means
west).
+/
static string toISOString(Duration utcOffset) @safe pure
{
import std.format : format;
immutable absOffset = abs(utcOffset);
enforce!DateTimeException(absOffset < dur!"minutes"(1440),
"Offset from UTC must be within range (-24:00 - 24:00).");
int hours;
int minutes;
absOffset.split!("hours", "minutes")(hours, minutes);
return format(utcOffset < Duration.zero ? "-%02d:%02d" : "+%02d:%02d", hours, minutes);
}
unittest
{
static string testSTZInvalid(Duration offset)
{
return SimpleTimeZone.toISOString(offset);
}
assertThrown!DateTimeException(testSTZInvalid(dur!"minutes"(1440)));
assertThrown!DateTimeException(testSTZInvalid(dur!"minutes"(-1440)));
assert(toISOString(dur!"minutes"(0)) == "+00:00");
assert(toISOString(dur!"minutes"(1)) == "+00:01");
assert(toISOString(dur!"minutes"(10)) == "+00:10");
assert(toISOString(dur!"minutes"(59)) == "+00:59");
assert(toISOString(dur!"minutes"(60)) == "+01:00");
assert(toISOString(dur!"minutes"(90)) == "+01:30");
assert(toISOString(dur!"minutes"(120)) == "+02:00");
assert(toISOString(dur!"minutes"(480)) == "+08:00");
assert(toISOString(dur!"minutes"(1439)) == "+23:59");
assert(toISOString(dur!"minutes"(-1)) == "-00:01");
assert(toISOString(dur!"minutes"(-10)) == "-00:10");
assert(toISOString(dur!"minutes"(-59)) == "-00:59");
assert(toISOString(dur!"minutes"(-60)) == "-01:00");
assert(toISOString(dur!"minutes"(-90)) == "-01:30");
assert(toISOString(dur!"minutes"(-120)) == "-02:00");
assert(toISOString(dur!"minutes"(-480)) == "-08:00");
assert(toISOString(dur!"minutes"(-1439)) == "-23:59");
}
/+
Takes a time zone as a string with an offset from UTC and returns a
$(LREF SimpleTimeZone) which matches.
The accepted formats for time zone offsets
are +H, -H, +HH, -HH, +H:MM, -H:MM, +HH:MM, and -HH:MM.
Params:
isoString = A string which represents a time zone in the ISO format.
+/
static immutable(SimpleTimeZone) fromISOString(S)(S isoString) @safe pure
if(isSomeString!S)
{
import std.ascii : isDigit;
import std.string : strip;
import std.conv : to;
import std.algorithm : startsWith, countUntil, all;
import std.format : format;
auto dstr = to!dstring(strip(isoString));
enforce(dstr.startsWith('-', '+'), new DateTimeException("Invalid ISO String"));
auto sign = dstr.startsWith('-') ? -1 : 1;
dstr.popFront();
enforce(!dstr.empty, new DateTimeException("Invalid ISO String"));
immutable colon = dstr.countUntil(':');
dstring hoursStr;
dstring minutesStr;
if(colon != -1)
{
hoursStr = dstr[0 .. colon];
minutesStr = dstr[colon + 1 .. $];
enforce(minutesStr.length == 2, new DateTimeException(format("Invalid ISO String: %s", dstr)));
}
else
hoursStr = dstr;
enforce(all!isDigit(hoursStr), new DateTimeException(format("Invalid ISO String: %s", dstr)));
enforce(all!isDigit(minutesStr), new DateTimeException(format("Invalid ISO String: %s", dstr)));
immutable hours = to!int(hoursStr);
immutable minutes = minutesStr.empty ? 0 : to!int(minutesStr);
return new immutable SimpleTimeZone(sign * (dur!"hours"(hours) + dur!"minutes"(minutes)));
}
unittest
{
assertThrown!DateTimeException(SimpleTimeZone.fromISOString(""));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("Z"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("-"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("+"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("-:"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("+:"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("-1:"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("+1:"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("1"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("-24:00"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("+24:00"));
assertThrown!DateTimeException(SimpleTimeZone.fromISOString("+1:0"));
assert(SimpleTimeZone.fromISOString("+00:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(0))).utcOffset);
assert(SimpleTimeZone.fromISOString("+00:01").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(1))).utcOffset);
assert(SimpleTimeZone.fromISOString("+00:10").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(10))).utcOffset);
assert(SimpleTimeZone.fromISOString("+00:59").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(59))).utcOffset);
assert(SimpleTimeZone.fromISOString("+01:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(60))).utcOffset);
assert(SimpleTimeZone.fromISOString("+01:30").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(90))).utcOffset);
assert(SimpleTimeZone.fromISOString("+02:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(120))).utcOffset);
assert(SimpleTimeZone.fromISOString("+08:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(480))).utcOffset);
assert(SimpleTimeZone.fromISOString("+23:59").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(1439))).utcOffset);
assert(SimpleTimeZone.fromISOString("-00:01").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-1))).utcOffset);
assert(SimpleTimeZone.fromISOString("-00:10").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-10))).utcOffset);
assert(SimpleTimeZone.fromISOString("-00:59").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-59))).utcOffset);
assert(SimpleTimeZone.fromISOString("-01:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-60))).utcOffset);
assert(SimpleTimeZone.fromISOString("-01:30").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-90))).utcOffset);
assert(SimpleTimeZone.fromISOString("-02:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-120))).utcOffset);
assert(SimpleTimeZone.fromISOString("-08:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-480))).utcOffset);
assert(SimpleTimeZone.fromISOString("-23:59").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-1439))).utcOffset);
assert(SimpleTimeZone.fromISOString("+0").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(0))).utcOffset);
assert(SimpleTimeZone.fromISOString("+1").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(60))).utcOffset);
assert(SimpleTimeZone.fromISOString("+2").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(120))).utcOffset);
assert(SimpleTimeZone.fromISOString("+23").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(1380))).utcOffset);
assert(SimpleTimeZone.fromISOString("+2").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(120))).utcOffset);
assert(SimpleTimeZone.fromISOString("+0").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(0))).utcOffset);
assert(SimpleTimeZone.fromISOString("+1").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(60))).utcOffset);
assert(SimpleTimeZone.fromISOString("+2").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(120))).utcOffset);
assert(SimpleTimeZone.fromISOString("+23").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(1380))).utcOffset);
assert(SimpleTimeZone.fromISOString("+1:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(60))).utcOffset);
assert(SimpleTimeZone.fromISOString("+1:01").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(61))).utcOffset);
assert(SimpleTimeZone.fromISOString("-0").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(0))).utcOffset);
assert(SimpleTimeZone.fromISOString("-1").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-60))).utcOffset);
assert(SimpleTimeZone.fromISOString("-2").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-120))).utcOffset);
assert(SimpleTimeZone.fromISOString("-23").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-1380))).utcOffset);
assert(SimpleTimeZone.fromISOString("-1:00").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-60))).utcOffset);
assert(SimpleTimeZone.fromISOString("-1:01").utcOffset ==
(new immutable SimpleTimeZone(dur!"minutes"(-61))).utcOffset);
}
//Test that converting from an ISO string to a SimpleTimeZone to an ISO String works properly.
unittest
{
static void testSTZ(in string isoString, int expectedOffset, size_t line = __LINE__)
{
auto stz = SimpleTimeZone.fromISOString(isoString);
assert(stz.utcOffset == dur!"minutes"(expectedOffset));
auto result = SimpleTimeZone.toISOString(stz.utcOffset);
assert(result == isoString);
}
testSTZ("+00:00", 0);
testSTZ("+00:01", 1);
testSTZ("+00:10", 10);
testSTZ("+00:59", 59);
testSTZ("+01:00", 60);
testSTZ("+01:30", 90);
testSTZ("+02:00", 120);
testSTZ("+08:00", 480);
testSTZ("+08:00", 480);
testSTZ("+23:59", 1439);
testSTZ("-00:01", -1);
testSTZ("-00:10", -10);
testSTZ("-00:59", -59);
testSTZ("-01:00", -60);
testSTZ("-01:30", -90);
testSTZ("-02:00", -120);
testSTZ("-08:00", -480);
testSTZ("-08:00", -480);
testSTZ("-23:59", -1439);
}
immutable Duration _utcOffset;
}
/++
Represents a time zone from a TZ Database time zone file. Files from the TZ
Database are how Posix systems hold their time zone information.
Unfortunately, Windows does not use the TZ Database. To use the TZ Database,
use $(D PosixTimeZone) (which reads its information from the TZ Database
files on disk) on Windows by providing the TZ Database files and telling
$(D PosixTimeZone.getTimeZone) where the directory holding them is.
To get a $(D PosixTimeZone), either call $(D PosixTimeZone.getTimeZone)
(which allows specifying the location the time zone files) or call
$(D TimeZone.getTimeZone) (which will give a $(D PosixTimeZone) on Posix
systems and a $(LREF WindowsTimeZone) on Windows systems).
Note:
Unless your system's local time zone deals with leap seconds (which is
highly unlikely), then the only way to get a time zone which
takes leap seconds into account is to use $(LREF PosixTimeZone) with a
time zone whose name starts with "right/". Those time zone files do
include leap seconds, and $(LREF PosixTimeZone) will take them into account
(though posix systems which use a "right/" time zone as their local time
zone will $(I not) take leap seconds into account even though they're
in the file).
See_Also:
$(WEB www.iana.org/time-zones, Home of the TZ Database files)<br>
$(WEB en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of Time
Zones)
+/
final class PosixTimeZone : TimeZone
{
import std.stdio : File;
import std.path : buildNormalizedPath, extension;
import std.file : isDir, isFile, exists, dirEntries, SpanMode, DirEntry;
import std.string : strip, representation;
import std.algorithm : countUntil, canFind, startsWith;
public:
/++
Whether this time zone has Daylight Savings Time at any point in time.
Note that for some time zone types it may not have DST for current
dates but will still return true for $(D hasDST) because the time zone
did at some point have DST.
+/
@property override bool hasDST() @safe const nothrow
{
return _hasDST;
}
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in UTC time (i.e. std time) and returns whether DST is in effect in this
time zone at the given point in time.
Params:
stdTime = The UTC time that needs to be checked for DST in this time
zone.
+/
override bool dstInEffect(long stdTime) @safe const nothrow
{
assert(!_transitions.empty);
immutable unixTime = stdTimeToUnixTime(stdTime);
immutable found = countUntil!"b < a.timeT"(_transitions, unixTime);
if(found == -1)
return _transitions.back.ttInfo.isDST;
immutable transition = found == 0 ? _transitions[0] : _transitions[found - 1];
return transition.ttInfo.isDST;
}
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in UTC time (i.e. std time) and converts it to this time zone's time.
Params:
stdTime = The UTC time that needs to be adjusted to this time zone's
time.
+/
override long utcToTZ(long stdTime) @safe const nothrow
{
assert(!_transitions.empty);
immutable leapSecs = calculateLeapSeconds(stdTime);
immutable unixTime = stdTimeToUnixTime(stdTime);
immutable found = countUntil!"b < a.timeT"(_transitions, unixTime);
if(found == -1)
return stdTime + convert!("seconds", "hnsecs")(_transitions.back.ttInfo.utcOffset + leapSecs);
immutable transition = found == 0 ? _transitions[0] : _transitions[found - 1];
return stdTime + convert!("seconds", "hnsecs")(transition.ttInfo.utcOffset + leapSecs);
}
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D.
in this time zone's time and converts it to UTC (i.e. std time).
Params:
adjTime = The time in this time zone that needs to be adjusted to
UTC time.
+/
override long tzToUTC(long adjTime) @safe const nothrow
{
assert(!_transitions.empty);
immutable leapSecs = calculateLeapSeconds(adjTime);
time_t unixTime = stdTimeToUnixTime(adjTime);
immutable past = unixTime - convert!("days", "seconds")(1);
immutable future = unixTime + convert!("days", "seconds")(1);
immutable pastFound = countUntil!"b < a.timeT"(_transitions, past);
if(pastFound == -1)
return adjTime - convert!("seconds", "hnsecs")(_transitions.back.ttInfo.utcOffset + leapSecs);
immutable futureFound = countUntil!"b < a.timeT"(_transitions[pastFound .. $], future);
immutable pastTrans = pastFound == 0 ? _transitions[0] : _transitions[pastFound - 1];
if(futureFound == 0)
return adjTime - convert!("seconds", "hnsecs")(pastTrans.ttInfo.utcOffset + leapSecs);
immutable futureTrans = futureFound == -1 ? _transitions.back
: _transitions[pastFound + futureFound - 1];
immutable pastOffset = pastTrans.ttInfo.utcOffset;
if(pastOffset < futureTrans.ttInfo.utcOffset)
unixTime -= convert!("hours", "seconds")(1);
immutable found = countUntil!"b < a.timeT"(_transitions[pastFound .. $], unixTime - pastOffset);
if(found == -1)
return adjTime - convert!("seconds", "hnsecs")(_transitions.back.ttInfo.utcOffset + leapSecs);
immutable transition = found == 0 ? pastTrans : _transitions[pastFound + found - 1];
return adjTime - convert!("seconds", "hnsecs")(transition.ttInfo.utcOffset + leapSecs);
}
version(Posix)
{
/++
The default directory where the TZ Database files are. It's empty
for Windows, since Windows doesn't have them.
+/
enum defaultTZDatabaseDir = "/usr/share/zoneinfo/";
}
else version(Windows)
{
/++ The default directory where the TZ Database files are. It's empty
for Windows, since Windows doesn't have them.
+/
enum defaultTZDatabaseDir = "";
}
/++
Returns a $(LREF2 .TimeZone, TimeZone) with the give name per the TZ Database. The time
zone information is fetched from the TZ Database time zone files in the
given directory.
See_Also:
$(WEB en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ
Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of
Time Zones)
Params:
name = The TZ Database name of the desired time zone
tzDatabaseDir = The directory where the TZ Database files are
located. Because these files are not located on
Windows systems, provide them
and give their location here to
use $(LREF PosixTimeZone)s.
Throws:
$(LREF DateTimeException) if the given time zone could not be found or
$(D FileException) if the TZ Database file could not be opened.
Examples:
--------------------
auto tz = PosixTimeZone.getTimeZone("America/Los_Angeles");
assert(tz.name == "America/Los_Angeles");
assert(tz.stdName == "PST");
assert(tz.dstName == "PDT");
--------------------
+/
//TODO make it possible for tzDatabaseDir to be gzipped tar file rather than an uncompressed
// directory.
static immutable(PosixTimeZone) getTimeZone(string name, string tzDatabaseDir = defaultTZDatabaseDir) @trusted
{
import std.algorithm : sort;
import std.range : retro;
import std.format : format;
name = strip(name);
enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
immutable file = buildNormalizedPath(tzDatabaseDir, name);
enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file)));
enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
auto tzFile = File(file);
immutable gmtZone = file.representation().canFind("GMT");
try
{
_enforceValidTZFile(readVal!(char[])(tzFile, 4) == "TZif");
immutable char tzFileVersion = readVal!char(tzFile);
_enforceValidTZFile(tzFileVersion == '\0' || tzFileVersion == '2' || tzFileVersion == '3');
{
auto zeroBlock = readVal!(ubyte[])(tzFile, 15);
bool allZeroes = true;
foreach(val; zeroBlock)
{
if(val != 0)
{
allZeroes = false;
break;
}
}
_enforceValidTZFile(allZeroes);
}
//The number of UTC/local indicators stored in the file.
auto tzh_ttisgmtcnt = readVal!int(tzFile);
//The number of standard/wall indicators stored in the file.
auto tzh_ttisstdcnt = readVal!int(tzFile);
//The number of leap seconds for which data is stored in the file.
auto tzh_leapcnt = readVal!int(tzFile);
//The number of "transition times" for which data is stored in the file.
auto tzh_timecnt = readVal!int(tzFile);
//The number of "local time types" for which data is stored in the file (must not be zero).
auto tzh_typecnt = readVal!int(tzFile);
_enforceValidTZFile(tzh_typecnt != 0);
//The number of characters of "timezone abbreviation strings" stored in the file.
auto tzh_charcnt = readVal!int(tzFile);
//time_ts where DST transitions occur.
auto transitionTimeTs = new long[](tzh_timecnt);
foreach(ref transition; transitionTimeTs)
transition = readVal!int(tzFile);
//Indices into ttinfo structs indicating the changes
//to be made at the corresponding DST transition.
auto ttInfoIndices = new ubyte[](tzh_timecnt);
foreach(ref ttInfoIndex; ttInfoIndices)
ttInfoIndex = readVal!ubyte(tzFile);
//ttinfos which give info on DST transitions.
auto tempTTInfos = new TempTTInfo[](tzh_typecnt);
foreach(ref ttInfo; tempTTInfos)
ttInfo = readVal!TempTTInfo(tzFile);
//The array of time zone abbreviation characters.
auto tzAbbrevChars = readVal!(char[])(tzFile, tzh_charcnt);
auto leapSeconds = new LeapSecond[](tzh_leapcnt);
foreach(ref leapSecond; leapSeconds)
{
//The time_t when the leap second occurs.
auto timeT = readVal!int(tzFile);
//The total number of leap seconds to be applied after
//the corresponding leap second.
auto total = readVal!int(tzFile);
leapSecond = LeapSecond(timeT, total);
}
//Indicate whether each corresponding DST transition were specified
//in standard time or wall clock time.
auto transitionIsStd = new bool[](tzh_ttisstdcnt);
foreach(ref isStd; transitionIsStd)
isStd = readVal!bool(tzFile);
//Indicate whether each corresponding DST transition associated with
//local time types are specified in UTC or local time.
auto transitionInUTC = new bool[](tzh_ttisgmtcnt);
foreach(ref inUTC; transitionInUTC)
inUTC = readVal!bool(tzFile);
_enforceValidTZFile(!tzFile.eof);
//If version 2 or 3, the information is duplicated in 64-bit.
if(tzFileVersion == '2' || tzFileVersion == '3')
{
_enforceValidTZFile(readVal!(char[])(tzFile, 4) == "TZif");
immutable char tzFileVersion2 = readVal!(char)(tzFile);
_enforceValidTZFile(tzFileVersion2 == '2' || tzFileVersion2 == '3');
{
auto zeroBlock = readVal!(ubyte[])(tzFile, 15);
bool allZeroes = true;
foreach(val; zeroBlock)
{
if(val != 0)
{
allZeroes = false;
break;
}
}
_enforceValidTZFile(allZeroes);
}
//The number of UTC/local indicators stored in the file.
tzh_ttisgmtcnt = readVal!int(tzFile);
//The number of standard/wall indicators stored in the file.
tzh_ttisstdcnt = readVal!int(tzFile);
//The number of leap seconds for which data is stored in the file.
tzh_leapcnt = readVal!int(tzFile);
//The number of "transition times" for which data is stored in the file.
tzh_timecnt = readVal!int(tzFile);
//The number of "local time types" for which data is stored in the file (must not be zero).
tzh_typecnt = readVal!int(tzFile);
_enforceValidTZFile(tzh_typecnt != 0);
//The number of characters of "timezone abbreviation strings" stored in the file.
tzh_charcnt = readVal!int(tzFile);
//time_ts where DST transitions occur.
transitionTimeTs = new long[](tzh_timecnt);
foreach(ref transition; transitionTimeTs)
transition = readVal!long(tzFile);
//Indices into ttinfo structs indicating the changes
//to be made at the corresponding DST transition.
ttInfoIndices = new ubyte[](tzh_timecnt);
foreach(ref ttInfoIndex; ttInfoIndices)
ttInfoIndex = readVal!ubyte(tzFile);
//ttinfos which give info on DST transitions.
tempTTInfos = new TempTTInfo[](tzh_typecnt);
foreach(ref ttInfo; tempTTInfos)
ttInfo = readVal!TempTTInfo(tzFile);
//The array of time zone abbreviation characters.
tzAbbrevChars = readVal!(char[])(tzFile, tzh_charcnt);
leapSeconds = new LeapSecond[](tzh_leapcnt);
foreach(ref leapSecond; leapSeconds)
{
//The time_t when the leap second occurs.
auto timeT = readVal!long(tzFile);
//The total number of leap seconds to be applied after
//the corresponding leap second.
auto total = readVal!int(tzFile);
leapSecond = LeapSecond(timeT, total);
}
//Indicate whether each corresponding DST transition were specified
//in standard time or wall clock time.
transitionIsStd = new bool[](tzh_ttisstdcnt);
foreach(ref isStd; transitionIsStd)
isStd = readVal!bool(tzFile);
//Indicate whether each corresponding DST transition associated with
//local time types are specified in UTC or local time.
transitionInUTC = new bool[](tzh_ttisgmtcnt);
foreach(ref inUTC; transitionInUTC)
inUTC = readVal!bool(tzFile);
}
_enforceValidTZFile(tzFile.readln().strip().empty);
auto posixEnvStr = tzFile.readln().strip();
_enforceValidTZFile(tzFile.readln().strip().empty);
_enforceValidTZFile(tzFile.eof);
auto transitionTypes = new TransitionType*[](tempTTInfos.length);
foreach(i, ref ttype; transitionTypes)
{
bool isStd = false;
if(i < transitionIsStd.length && !transitionIsStd.empty)
isStd = transitionIsStd[i];
bool inUTC = false;
if(i < transitionInUTC.length && !transitionInUTC.empty)
inUTC = transitionInUTC[i];
ttype = new TransitionType(isStd, inUTC);
}
auto ttInfos = new immutable(TTInfo)*[](tempTTInfos.length);
foreach(i, ref ttInfo; ttInfos)
{
auto tempTTInfo = tempTTInfos[i];
if(gmtZone)
tempTTInfo.tt_gmtoff = -tempTTInfo.tt_gmtoff;
auto abbrevChars = tzAbbrevChars[tempTTInfo.tt_abbrind .. $];
string abbrev = abbrevChars[0 .. abbrevChars.countUntil('\0')].idup;
ttInfo = new immutable(TTInfo)(tempTTInfos[i], abbrev);
}
auto tempTransitions = new TempTransition[](transitionTimeTs.length);
foreach(i, ref tempTransition; tempTransitions)
{
immutable ttiIndex = ttInfoIndices[i];
auto transitionTimeT = transitionTimeTs[i];
auto ttype = transitionTypes[ttiIndex];
auto ttInfo = ttInfos[ttiIndex];
tempTransition = TempTransition(transitionTimeT, ttInfo, ttype);
}
if(tempTransitions.empty)
{
_enforceValidTZFile(ttInfos.length == 1 && transitionTypes.length == 1);
tempTransitions ~= TempTransition(0, ttInfos[0], transitionTypes[0]);
}
sort!"a.timeT < b.timeT"(tempTransitions);
sort!"a.timeT < b.timeT"(leapSeconds);
auto transitions = new Transition[](tempTransitions.length);
foreach(i, ref transition; transitions)
{
auto tempTransition = tempTransitions[i];
auto transitionTimeT = tempTransition.timeT;
auto ttInfo = tempTransition.ttInfo;
auto ttype = tempTransition.ttype;
_enforceValidTZFile(i == 0 || transitionTimeT > tempTransitions[i - 1].timeT);
transition = Transition(transitionTimeT, ttInfo);
}
string stdName;
string dstName;
bool hasDST = false;
foreach(transition; retro(transitions))
{
auto ttInfo = transition.ttInfo;
if(ttInfo.isDST)
{
if(dstName.empty)
dstName = ttInfo.abbrev;
hasDST = true;
}
else
{
if(stdName.empty)
stdName = ttInfo.abbrev;
}
if(!stdName.empty && !dstName.empty)
break;
}
return new immutable PosixTimeZone(transitions.idup, leapSeconds.idup, name, stdName, dstName, hasDST);
}
catch(DateTimeException dte)
throw dte;
catch(Exception e)
throw new DateTimeException("Not a valid TZ data file", __FILE__, __LINE__, e);
}
/++
Returns a list of the names of the time zones installed on the system.
Providing a sub-name narrows down the list of time zones (which
can number in the thousands). For example,
passing in "America" as the sub-name returns only the time zones which
begin with "America".
Params:
subName = The first part of the desired time zones.
tzDatabaseDir = The directory where the TZ Database files are
located.
Throws:
$(D FileException) if it fails to read from disk.
+/
static string[] getInstalledTZNames(string subName = "", string tzDatabaseDir = defaultTZDatabaseDir) @trusted
{
import std.array : appender;
import std.algorithm : sort;
import std.format : format;
version(Posix)
subName = strip(subName);
else version(Windows)
{
import std.array : replace;
import std.path : dirSeparator;
subName = replace(strip(subName), "/", dirSeparator);
}
enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
auto timezones = appender!(string[])();
foreach(DirEntry dentry; dirEntries(tzDatabaseDir, SpanMode.depth))
{
if(dentry.isFile)
{
auto tzName = dentry.name[tzDatabaseDir.length .. $];
if(!tzName.extension().empty ||
!tzName.startsWith(subName) ||
tzName == "+VERSION")
{
continue;
}
timezones.put(tzName);
}
}
sort(timezones.data);
return timezones.data;
}
version(Posix) unittest
{
static void testPTZSuccess(string tzName)
{
scope(failure) writefln("TZName which threw: %s", tzName);
PosixTimeZone.getTimeZone(tzName);
}
static void testPTZFailure(string tzName)
{
scope(success) writefln("TZName which was supposed to throw: %s", tzName);
PosixTimeZone.getTimeZone(tzName);
}
auto tzNames = getInstalledTZNames();
foreach(tzName; tzNames)
assertNotThrown!DateTimeException(testPTZSuccess(tzName));
foreach(DirEntry dentry; dirEntries(defaultTZDatabaseDir, SpanMode.depth))
{
if(dentry.isFile)
{
auto tzName = dentry.name[defaultTZDatabaseDir.length .. $];
if(!canFind(tzNames, tzName))
assertThrown!DateTimeException(testPTZFailure(tzName));
}
}
}
private:
/+
Holds information on when a time transition occures (usually a
transition to or from DST) as well as a pointer to the $(D TTInfo) which
holds information on the utc offset past the transition.
+/
struct Transition
{
this(long timeT, immutable (TTInfo)* ttInfo) @safe pure
{
this.timeT = timeT;
this.ttInfo = ttInfo;
}
long timeT;
immutable (TTInfo)* ttInfo;
}
/+
Holds information on when a leap second occurs.
+/
struct LeapSecond
{
this(long timeT, int total) @safe pure
{
this.timeT = timeT;
this.total = total;
}
long timeT;
int total;
}
/+
Holds information on the utc offset after a transition as well as
whether DST is in effect after that transition.
+/
struct TTInfo
{
this(in TempTTInfo tempTTInfo, string abbrev) @safe immutable pure
{
utcOffset = tempTTInfo.tt_gmtoff;
isDST = tempTTInfo.tt_isdst;
this.abbrev = abbrev;
}
immutable int utcOffset; /// Offset from UTC.
immutable bool isDST; /// Whether DST is in effect.
immutable string abbrev; /// The current abbreviation for the time zone.
}
/+
Struct used to hold information relating to $(D TTInfo) while organizing
the time zone information prior to putting it in its final form.
+/
struct TempTTInfo
{
this(int gmtOff, bool isDST, ubyte abbrInd) @safe pure
{
tt_gmtoff = gmtOff;
tt_isdst = isDST;
tt_abbrind = abbrInd;
}
int tt_gmtoff;
bool tt_isdst;
ubyte tt_abbrind;
}
/+
Struct used to hold information relating to $(D Transition) while
organizing the time zone information prior to putting it in its final
form.
+/
struct TempTransition
{
this(long timeT, immutable (TTInfo)* ttInfo, TransitionType* ttype) @safe pure
{
this.timeT = timeT;
this.ttInfo = ttInfo;
this.ttype = ttype;
}
long timeT;
immutable (TTInfo)* ttInfo;
TransitionType* ttype;
}
/+
Struct used to hold information relating to $(D Transition) and
$(D TTInfo) while organizing the time zone information prior to putting
it in its final form.
+/
struct TransitionType
{
this(bool isStd, bool inUTC) @safe pure
{
this.isStd = isStd;
this.inUTC = inUTC;
}
/// Whether the transition is in std time (as opposed to wall clock time).
bool isStd;
/// Whether the transition is in UTC (as opposed to local time).
bool inUTC;
}
/+
Reads an int from a TZ file.
+/
static T readVal(T)(ref File tzFile) @trusted
if((isIntegral!T || isSomeChar!T) || is(Unqual!T == bool))
{
import std.bitmanip;
T[1] buff;
_enforceValidTZFile(!tzFile.eof);
tzFile.rawRead(buff);
return bigEndianToNative!T(cast(ubyte[T.sizeof])buff);
}
/+
Reads an array of values from a TZ file.
+/
static T readVal(T)(ref File tzFile, size_t length) @trusted
if(isArray!T)
{
auto buff = new T(length);
_enforceValidTZFile(!tzFile.eof);
tzFile.rawRead(buff);
return buff;
}
/+
Reads a $(D TempTTInfo) from a TZ file.
+/
static T readVal(T)(ref File tzFile) @safe
if(is(T == TempTTInfo))
{
return TempTTInfo(readVal!int(tzFile),
readVal!bool(tzFile),
readVal!ubyte(tzFile));
}
/+
Throws:
$(LREF DateTimeException) if $(D result) is false.
+/
static void _enforceValidTZFile(bool result, size_t line = __LINE__) @safe pure
{
if(!result)
throw new DateTimeException("Not a valid tzdata file.", __FILE__, line);
}
int calculateLeapSeconds(long stdTime) @safe const pure nothrow
{
if(_leapSeconds.empty)
return 0;
immutable unixTime = stdTimeToUnixTime(stdTime);
if(_leapSeconds.front.timeT >= unixTime)
return 0;
immutable found = countUntil!"b < a.timeT"(_leapSeconds, unixTime);
if(found == -1)
return _leapSeconds.back.total;
immutable leapSecond = found == 0 ? _leapSeconds[0] : _leapSeconds[found - 1];
return leapSecond.total;
}
this(immutable Transition[] transitions,
immutable LeapSecond[] leapSeconds,
string name,
string stdName,
string dstName,
bool hasDST) @safe immutable pure
{
if(dstName.empty && !stdName.empty)
dstName = stdName;
else if(stdName.empty && !dstName.empty)
stdName = dstName;
super(name, stdName, dstName);
if(!transitions.empty)
{
foreach(i, transition; transitions[0 .. $-1])
_enforceValidTZFile(transition.timeT < transitions[i + 1].timeT);
}
foreach(i, leapSecond; leapSeconds)
_enforceValidTZFile(i == leapSeconds.length - 1 || leapSecond.timeT < leapSeconds[i + 1].timeT);
_transitions = transitions;
_leapSeconds = leapSeconds;
_hasDST = hasDST;
}
/// List of times when the utc offset changes.
immutable Transition[] _transitions;
/// List of leap second occurrences.
immutable LeapSecond[] _leapSeconds;
/// Whether DST is in effect for this time zone at any point in time.
immutable bool _hasDST;
}
version(StdDdoc)
{
/++
$(BLUE This class is Windows-Only.)
Represents a time zone from the Windows registry. Unfortunately, Windows
does not use the TZ Database. To use the TZ Database, use
$(LREF PosixTimeZone) (which reads its information from the TZ Database
files on disk) on Windows by providing the TZ Database files and telling
$(D PosixTimeZone.getTimeZone) where the directory holding them is.
The TZ Database files and Windows' time zone information frequently
do not match. Windows has many errors with regards to when DST switches
occur (especially for historical dates). Also, the TZ Database files
include far more time zones than Windows does. So, for accurate
time zone information, use the TZ Database files with
$(LREF PosixTimeZone) rather than $(LREF WindowsTimeZone). However, because
$(LREF WindowsTimeZone) uses Windows system calls to deal with the time,
it's far more likely to match the behavior of other Windows programs.
Be aware of the differences when selecting a method.
$(LREF WindowsTimeZone) does not exist on Posix systems.
To get a $(LREF WindowsTimeZone), either call
$(D WindowsTimeZone.getTimeZone) or call $(D TimeZone.getTimeZone)
(which will give a $(LREF PosixTimeZone) on Posix systems and a
$(LREF WindowsTimeZone) on Windows systems).
See_Also:
$(WEB www.iana.org/time-zones, Home of the TZ Database files)
+/
final class WindowsTimeZone : TimeZone
{
public:
/++
Whether this time zone has Daylight Savings Time at any point in
time. Note that for some time zone types it may not have DST for
current dates but will still return true for $(D hasDST) because the
time zone did at some point have DST.
+/
@property override bool hasDST() @safe const nothrow;
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st,
1 A.D. in UTC time (i.e. std time) and returns whether DST is in
effect in this time zone at the given point in time.
Params:
stdTime = The UTC time that needs to be checked for DST in this
time zone.
+/
override bool dstInEffect(long stdTime) @safe const nothrow;
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st,
1 A.D. in UTC time (i.e. std time) and converts it to this time
zone's time.
Params:
stdTime = The UTC time that needs to be adjusted to this time
zone's time.
+/
override long utcToTZ(long stdTime) @safe const nothrow;
/++
Takes the number of hnsecs (100 ns) since midnight, January 1st,
1 A.D. in this time zone's time and converts it to UTC (i.e. std
time).
Params:
adjTime = The time in this time zone that needs to be adjusted
to UTC time.
+/
override long tzToUTC(long adjTime) @safe const nothrow;
/++
Returns a $(LREF2 .TimeZone, TimeZone) with the given name per the Windows time
zone names. The time zone information is fetched from the Windows
registry.
See_Also:
$(WEB en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ
Database)<br>
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, List
of Time Zones)
Params:
name = The TZ Database name of the desired time zone.
Throws:
$(LREF DateTimeException) if the given time zone could not be
found.
Examples:
--------------------
auto tz = TimeZone.getTimeZone("America/Los_Angeles");
--------------------
+/
static immutable(WindowsTimeZone) getTimeZone(string name) @safe;
/++
Returns a list of the names of the time zones installed on the
system. The list returned by WindowsTimeZone contains the Windows
TZ names, not the TZ Database names. However,
$(D TimeZone.getinstalledTZNames) will return the TZ Database names
which are equivalent to the Windows TZ names.
+/
static string[] getInstalledTZNames() @safe;
private:
version(Windows) {}
else
alias TIME_ZONE_INFORMATION = void*;
static bool _dstInEffect(const TIME_ZONE_INFORMATION* tzInfo, long stdTime) nothrow;
static long _utcToTZ(const TIME_ZONE_INFORMATION* tzInfo, long stdTime, bool hasDST) nothrow;
static long _tzToUTC(const TIME_ZONE_INFORMATION* tzInfo, long adjTime, bool hasDST) nothrow;
this() immutable pure
{
super("", "", "");
}
}
}
else version(Windows)
{
final class WindowsTimeZone : TimeZone
{
import std.format : format;
import std.conv : to;
import std.algorithm : sort;
import std.array : appender;
public:
@property override bool hasDST() @safe const nothrow
{
return _tzInfo.DaylightDate.wMonth != 0;
}
override bool dstInEffect(long stdTime) @safe const nothrow
{
return _dstInEffect(&_tzInfo, stdTime);
}
override long utcToTZ(long stdTime) @safe const nothrow
{
return _utcToTZ(&_tzInfo, stdTime, hasDST);
}
override long tzToUTC(long adjTime) @safe const nothrow
{
return _tzToUTC(&_tzInfo, adjTime, hasDST);
}
static immutable(WindowsTimeZone) getTimeZone(string name) @trusted
{
import std.utf : toUTF16;
scope baseKey = Registry.localMachine.getKey(`Software\Microsoft\Windows NT\CurrentVersion\Time Zones`);
foreach (tzKeyName; baseKey.keyNames)
{
if (tzKeyName != name)
continue;
scope tzKey = baseKey.getKey(tzKeyName);
scope stdVal = tzKey.getValue("Std");
auto stdName = stdVal.value_SZ;
scope dstVal = tzKey.getValue("Dlt");
auto dstName = dstVal.value_SZ;
scope tziVal = tzKey.getValue("TZI");
auto binVal = tziVal.value_BINARY;
assert(binVal.length == REG_TZI_FORMAT.sizeof);
auto tziFmt = cast(REG_TZI_FORMAT*)binVal.ptr;
TIME_ZONE_INFORMATION tzInfo;
auto wstdName = toUTF16(stdName);
auto wdstName = toUTF16(dstName);
auto wstdNameLen = wstdName.length > 32 ? 32 : wstdName.length;
auto wdstNameLen = wdstName.length > 32 ? 32 : wdstName.length;
tzInfo.Bias = tziFmt.Bias;
tzInfo.StandardName[0 .. wstdNameLen] = wstdName[0 .. wstdNameLen];
tzInfo.StandardName[wstdNameLen .. $] = '\0';
tzInfo.StandardDate = tziFmt.StandardDate;
tzInfo.StandardBias = tziFmt.StandardBias;
tzInfo.DaylightName[0 .. wdstNameLen] = wdstName[0 .. wdstNameLen];
tzInfo.DaylightName[wdstNameLen .. $] = '\0';
tzInfo.DaylightDate = tziFmt.DaylightDate;
tzInfo.DaylightBias = tziFmt.DaylightBias;
return new immutable WindowsTimeZone(name, tzInfo);
}
throw new DateTimeException(format("Failed to find time zone: %s", name));
}
static string[] getInstalledTZNames() @trusted
{
auto timezones = appender!(string[])();
scope baseKey = Registry.localMachine.getKey(`Software\Microsoft\Windows NT\CurrentVersion\Time Zones`);
foreach (tzKeyName; baseKey.keyNames)
{
timezones.put(tzKeyName);
}
sort(timezones.data);
return timezones.data;
}
unittest
{
static void testWTZSuccess(string tzName)
{
scope(failure) writefln("TZName which threw: %s", tzName);
WindowsTimeZone.getTimeZone(tzName);
}
auto tzNames = getInstalledTZNames();
foreach(tzName; tzNames)
assertNotThrown!DateTimeException(testWTZSuccess(tzName));
}
private:
static bool _dstInEffect(const TIME_ZONE_INFORMATION* tzInfo, long stdTime) @trusted nothrow
{
try
{
if(tzInfo.DaylightDate.wMonth == 0)
return false;
auto utcDateTime = cast(DateTime)SysTime(stdTime, UTC());
//The limits of what SystemTimeToTzSpecificLocalTime will accept.
if(utcDateTime.year < 1601)
{
if(utcDateTime.month == Month.feb && utcDateTime.day == 29)
utcDateTime.day = 28;
utcDateTime.year = 1601;
}
else if(utcDateTime.year > 30_827)
{
if(utcDateTime.month == Month.feb && utcDateTime.day == 29)
utcDateTime.day = 28;
utcDateTime.year = 30_827;
}
//SystemTimeToTzSpecificLocalTime doesn't act correctly at the
//beginning or end of the year (bleh). Unless some bizarre time
//zone changes DST on January 1st or December 31st, this should
//fix the problem.
if(utcDateTime.month == Month.jan)
{
if(utcDateTime.day == 1)
utcDateTime.day = 2;
}
else if(utcDateTime.month == Month.dec && utcDateTime.day == 31)
utcDateTime.day = 30;
SYSTEMTIME utcTime = void;
SYSTEMTIME otherTime = void;
utcTime.wYear = utcDateTime.year;
utcTime.wMonth = utcDateTime.month;
utcTime.wDay = utcDateTime.day;
utcTime.wHour = utcDateTime.hour;
utcTime.wMinute = utcDateTime.minute;
utcTime.wSecond = utcDateTime.second;
utcTime.wMilliseconds = 0;
immutable result = SystemTimeToTzSpecificLocalTime(cast(TIME_ZONE_INFORMATION*)tzInfo,
&utcTime,
&otherTime);
assert(result);
immutable otherDateTime = DateTime(otherTime.wYear,
otherTime.wMonth,
otherTime.wDay,
otherTime.wHour,
otherTime.wMinute,
otherTime.wSecond);
immutable diff = utcDateTime - otherDateTime;
immutable minutes = diff.total!"minutes" - tzInfo.Bias;
if(minutes == tzInfo.DaylightBias)
return true;
assert(minutes == tzInfo.StandardBias);
return false;
}
catch(Exception e)
assert(0, "DateTime's constructor threw.");
}
unittest
{
TIME_ZONE_INFORMATION tzInfo;
GetTimeZoneInformation(&tzInfo);
foreach(year; [1600, 1601, 30_827, 30_828])
WindowsTimeZone._dstInEffect(&tzInfo, SysTime(DateTime(year, 1, 1)).stdTime);
}
static long _utcToTZ(const TIME_ZONE_INFORMATION* tzInfo, long stdTime, bool hasDST) @safe nothrow
{
if(hasDST && WindowsTimeZone._dstInEffect(tzInfo, stdTime))
return stdTime - convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.DaylightBias);
return stdTime - convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.StandardBias);
}
static long _tzToUTC(const TIME_ZONE_INFORMATION* tzInfo, long adjTime, bool hasDST) @trusted nothrow
{
if(hasDST)
{
try
{
bool dstInEffectForLocalDateTime(DateTime localDateTime)
{
//The limits of what SystemTimeToTzSpecificLocalTime will accept.
if(localDateTime.year < 1601)
{
if(localDateTime.month == Month.feb && localDateTime.day == 29)
localDateTime.day = 28;
localDateTime.year = 1601;
}
else if(localDateTime.year > 30_827)
{
if(localDateTime.month == Month.feb && localDateTime.day == 29)
localDateTime.day = 28;
localDateTime.year = 30_827;
}
//SystemTimeToTzSpecificLocalTime doesn't act correctly at the
//beginning or end of the year (bleh). Unless some bizarre time
//zone changes DST on January 1st or December 31st, this should
//fix the problem.
if(localDateTime.month == Month.jan)
{
if(localDateTime.day == 1)
localDateTime.day = 2;
}
else if(localDateTime.month == Month.dec && localDateTime.day == 31)
localDateTime.day = 30;
SYSTEMTIME utcTime = void;
SYSTEMTIME localTime = void;
localTime.wYear = localDateTime.year;
localTime.wMonth = localDateTime.month;
localTime.wDay = localDateTime.day;
localTime.wHour = localDateTime.hour;
localTime.wMinute = localDateTime.minute;
localTime.wSecond = localDateTime.second;
localTime.wMilliseconds = 0;
immutable result = TzSpecificLocalTimeToSystemTime(cast(TIME_ZONE_INFORMATION*)tzInfo,
&localTime,
&utcTime);
assert(result);
immutable utcDateTime = DateTime(utcTime.wYear,
utcTime.wMonth,
utcTime.wDay,
utcTime.wHour,
utcTime.wMinute,
utcTime.wSecond);
immutable diff = localDateTime - utcDateTime;
immutable minutes = -tzInfo.Bias - diff.total!"minutes";
if(minutes == tzInfo.DaylightBias)
return true;
assert(minutes == tzInfo.StandardBias);
return false;
}
auto localDateTime = cast(DateTime)SysTime(adjTime, UTC());
auto localDateTimeBefore = localDateTime - dur!"hours"(1);
auto localDateTimeAfter = localDateTime + dur!"hours"(1);
auto dstInEffectNow = dstInEffectForLocalDateTime(localDateTime);
auto dstInEffectBefore = dstInEffectForLocalDateTime(localDateTimeBefore);
auto dstInEffectAfter = dstInEffectForLocalDateTime(localDateTimeAfter);
bool isDST;
if(dstInEffectBefore && dstInEffectNow && dstInEffectAfter)
isDST = true;
else if(!dstInEffectBefore && !dstInEffectNow && !dstInEffectAfter)
isDST = false;
else if(!dstInEffectBefore && dstInEffectAfter)
isDST = false;
else if(dstInEffectBefore && !dstInEffectAfter)
isDST = dstInEffectNow;
else
assert(0, "Bad Logic.");
if(isDST)
return adjTime + convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.DaylightBias);
}
catch(Exception e)
assert(0, "SysTime's constructor threw.");
}
return adjTime + convert!("minutes", "hnsecs")(tzInfo.Bias + tzInfo.StandardBias);
}
this(string name, TIME_ZONE_INFORMATION tzInfo) @safe immutable pure
{
super(name, to!string(tzInfo.StandardName.ptr), to!string(tzInfo.DaylightName.ptr));
_tzInfo = tzInfo;
}
TIME_ZONE_INFORMATION _tzInfo;
}
}
version(StdDdoc)
{
/++
$(BLUE This function is Posix-Only.)
Sets the local time zone on Posix systems with the TZ
Database name by setting the TZ environment variable.
Unfortunately, there is no way to do it on Windows using the TZ
Database name, so this function only exists on Posix systems.
+/
void setTZEnvVar(string tzDatabaseName) @safe nothrow;
/++
$(BLUE This function is Posix-Only.)
Clears the TZ environment variable.
+/
void clearTZEnvVar() @safe nothrow;
}
else version(Posix)
{
void setTZEnvVar(string tzDatabaseName) @trusted nothrow
{
import std.internal.cstring : tempCString;
import std.path : buildNormalizedPath;
try
{
immutable value = buildNormalizedPath(PosixTimeZone.defaultTZDatabaseDir, tzDatabaseName);
setenv("TZ", value.tempCString(), 1);
tzset();
}
catch(Exception e)
assert(0, "The impossible happened. setenv or tzset threw.");
}
void clearTZEnvVar() @trusted nothrow
{
try
{
unsetenv("TZ");
tzset();
}
catch(Exception e)
assert(0, "The impossible happened. unsetenv or tzset threw.");
}
}
/++
Converts the given TZ Database name to the corresponding Windows time zone
name.
Note that in a few cases, a TZ Dabatase name corresponds to two different
Windows time zone names. So, while in most cases converting from one to the
other and back again will result in the same time zone name started
with, in a few case, it'll get a different name.
Also, there are far more TZ Database names than Windows time zones, so some
of the more exotic TZ Database names don't have corresponding Windows time
zone names.
Returns null if the given time zone name cannot be converted.
See_Also:
$(WEB unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html,
Windows <-> TZ Database Name Conversion Table)
Params:
tzName = The TZ Database name to convert.
+/
string tzDatabaseNameToWindowsTZName(string tzName) @safe pure nothrow @nogc
{
switch(tzName)
{
case "Africa/Abidjan": return "Greenwich Standard Time";
case "Africa/Accra": return "Greenwich Standard Time";
case "Africa/Addis_Ababa": return "E. Africa Standard Time";
case "Africa/Algiers": return "W. Central Africa Standard Time";
case "Africa/Asmera": return "E. Africa Standard Time";
case "Africa/Bamako": return "Greenwich Standard Time";
case "Africa/Bangui": return "W. Central Africa Standard Time";
case "Africa/Banjul": return "Greenwich Standard Time";
case "Africa/Bissau": return "Greenwich Standard Time";
case "Africa/Blantyre": return "South Africa Standard Time";
case "Africa/Brazzaville": return "W. Central Africa Standard Time";
case "Africa/Bujumbura": return "South Africa Standard Time";
case "Africa/Cairo": return "Egypt Standard Time";
case "Africa/Casablanca": return "Morocco Standard Time";
case "Africa/Ceuta": return "Romance Standard Time";
case "Africa/Conakry": return "Greenwich Standard Time";
case "Africa/Dakar": return "Greenwich Standard Time";
case "Africa/Dar_es_Salaam": return "E. Africa Standard Time";
case "Africa/Djibouti": return "E. Africa Standard Time";
case "Africa/Douala": return "W. Central Africa Standard Time";
case "Africa/El_Aaiun": return "Morocco Standard Time";
case "Africa/Freetown": return "Greenwich Standard Time";
case "Africa/Gaborone": return "South Africa Standard Time";
case "Africa/Harare": return "South Africa Standard Time";
case "Africa/Johannesburg": return "South Africa Standard Time";
case "Africa/Juba": return "E. Africa Standard Time";
case "Africa/Kampala": return "E. Africa Standard Time";
case "Africa/Khartoum": return "E. Africa Standard Time";
case "Africa/Kigali": return "South Africa Standard Time";
case "Africa/Kinshasa": return "W. Central Africa Standard Time";
case "Africa/Lagos": return "W. Central Africa Standard Time";
case "Africa/Libreville": return "W. Central Africa Standard Time";
case "Africa/Lome": return "Greenwich Standard Time";
case "Africa/Luanda": return "W. Central Africa Standard Time";
case "Africa/Lubumbashi": return "South Africa Standard Time";
case "Africa/Lusaka": return "South Africa Standard Time";
case "Africa/Malabo": return "W. Central Africa Standard Time";
case "Africa/Maputo": return "South Africa Standard Time";
case "Africa/Maseru": return "South Africa Standard Time";
case "Africa/Mbabane": return "South Africa Standard Time";
case "Africa/Mogadishu": return "E. Africa Standard Time";
case "Africa/Monrovia": return "Greenwich Standard Time";
case "Africa/Nairobi": return "E. Africa Standard Time";
case "Africa/Ndjamena": return "W. Central Africa Standard Time";
case "Africa/Niamey": return "W. Central Africa Standard Time";
case "Africa/Nouakchott": return "Greenwich Standard Time";
case "Africa/Ouagadougou": return "Greenwich Standard Time";
case "Africa/Porto-Novo": return "W. Central Africa Standard Time";
case "Africa/Sao_Tome": return "Greenwich Standard Time";
case "Africa/Tripoli": return "Libya Standard Time";
case "Africa/Tunis": return "W. Central Africa Standard Time";
case "Africa/Windhoek": return "Namibia Standard Time";
case "America/Anchorage": return "Alaskan Standard Time";
case "America/Anguilla": return "SA Western Standard Time";
case "America/Antigua": return "SA Western Standard Time";
case "America/Araguaina": return "SA Eastern Standard Time";
case "America/Argentina/La_Rioja": return "Argentina Standard Time";
case "America/Argentina/Rio_Gallegos": return "Argentina Standard Time";
case "America/Argentina/Salta": return "Argentina Standard Time";
case "America/Argentina/San_Juan": return "Argentina Standard Time";
case "America/Argentina/San_Luis": return "Argentina Standard Time";
case "America/Argentina/Tucuman": return "Argentina Standard Time";
case "America/Argentina/Ushuaia": return "Argentina Standard Time";
case "America/Aruba": return "SA Western Standard Time";
case "America/Asuncion": return "Paraguay Standard Time";
case "America/Bahia": return "Bahia Standard Time";
case "America/Bahia_Banderas": return "Central Standard Time (Mexico)";
case "America/Barbados": return "SA Western Standard Time";
case "America/Belem": return "SA Eastern Standard Time";
case "America/Belize": return "Central America Standard Time";
case "America/Blanc-Sablon": return "SA Western Standard Time";
case "America/Boa_Vista": return "SA Western Standard Time";
case "America/Bogota": return "SA Pacific Standard Time";
case "America/Boise": return "Mountain Standard Time";
case "America/Buenos_Aires": return "Argentina Standard Time";
case "America/Cambridge_Bay": return "Mountain Standard Time";
case "America/Campo_Grande": return "Central Brazilian Standard Time";
case "America/Cancun": return "Central Standard Time (Mexico)";
case "America/Caracas": return "Venezuela Standard Time";
case "America/Catamarca": return "Argentina Standard Time";
case "America/Cayenne": return "SA Eastern Standard Time";
case "America/Cayman": return "SA Pacific Standard Time";
case "America/Chicago": return "Central Standard Time";
case "America/Chihuahua": return "Mountain Standard Time (Mexico)";
case "America/Coral_Harbour": return "SA Pacific Standard Time";
case "America/Cordoba": return "Argentina Standard Time";
case "America/Costa_Rica": return "Central America Standard Time";
case "America/Creston": return "US Mountain Standard Time";
case "America/Cuiaba": return "Central Brazilian Standard Time";
case "America/Curacao": return "SA Western Standard Time";
case "America/Danmarkshavn": return "UTC";
case "America/Dawson": return "Pacific Standard Time";
case "America/Dawson_Creek": return "US Mountain Standard Time";
case "America/Denver": return "Mountain Standard Time";
case "America/Detroit": return "Eastern Standard Time";
case "America/Dominica": return "SA Western Standard Time";
case "America/Edmonton": return "Mountain Standard Time";
case "America/Eirunepe": return "SA Pacific Standard Time";
case "America/El_Salvador": return "Central America Standard Time";
case "America/Fortaleza": return "SA Eastern Standard Time";
case "America/Glace_Bay": return "Atlantic Standard Time";
case "America/Godthab": return "Greenland Standard Time";
case "America/Goose_Bay": return "Atlantic Standard Time";
case "America/Grand_Turk": return "SA Western Standard Time";
case "America/Grenada": return "SA Western Standard Time";
case "America/Guadeloupe": return "SA Western Standard Time";
case "America/Guatemala": return "Central America Standard Time";
case "America/Guayaquil": return "SA Pacific Standard Time";
case "America/Guyana": return "SA Western Standard Time";
case "America/Halifax": return "Atlantic Standard Time";
case "America/Havana": return "Eastern Standard Time";
case "America/Hermosillo": return "US Mountain Standard Time";
case "America/Indiana/Knox": return "Central Standard Time";
case "America/Indiana/Marengo": return "US Eastern Standard Time";
case "America/Indiana/Petersburg": return "Eastern Standard Time";
case "America/Indiana/Tell_City": return "Central Standard Time";
case "America/Indiana/Vevay": return "US Eastern Standard Time";
case "America/Indiana/Vincennes": return "Eastern Standard Time";
case "America/Indiana/Winamac": return "Eastern Standard Time";
case "America/Indianapolis": return "US Eastern Standard Time";
case "America/Inuvik": return "Mountain Standard Time";
case "America/Iqaluit": return "Eastern Standard Time";
case "America/Jamaica": return "SA Pacific Standard Time";
case "America/Jujuy": return "Argentina Standard Time";
case "America/Juneau": return "Alaskan Standard Time";
case "America/Kentucky/Monticello": return "Eastern Standard Time";
case "America/Kralendijk": return "SA Western Standard Time";
case "America/La_Paz": return "SA Western Standard Time";
case "America/Lima": return "SA Pacific Standard Time";
case "America/Los_Angeles": return "Pacific Standard Time";
case "America/Louisville": return "Eastern Standard Time";
case "America/Lower_Princes": return "SA Western Standard Time";
case "America/Maceio": return "SA Eastern Standard Time";
case "America/Managua": return "Central America Standard Time";
case "America/Manaus": return "SA Western Standard Time";
case "America/Marigot": return "SA Western Standard Time";
case "America/Martinique": return "SA Western Standard Time";
case "America/Matamoros": return "Central Standard Time";
case "America/Mazatlan": return "Mountain Standard Time (Mexico)";
case "America/Mendoza": return "Argentina Standard Time";
case "America/Menominee": return "Central Standard Time";
case "America/Merida": return "Central Standard Time (Mexico)";
case "America/Mexico_City": return "Central Standard Time (Mexico)";
case "America/Moncton": return "Atlantic Standard Time";
case "America/Monterrey": return "Central Standard Time (Mexico)";
case "America/Montevideo": return "Montevideo Standard Time";
case "America/Montreal": return "Eastern Standard Time";
case "America/Montserrat": return "SA Western Standard Time";
case "America/Nassau": return "Eastern Standard Time";
case "America/New_York": return "Eastern Standard Time";
case "America/Nipigon": return "Eastern Standard Time";
case "America/Nome": return "Alaskan Standard Time";
case "America/Noronha": return "UTC-02";
case "America/North_Dakota/Beulah": return "Central Standard Time";
case "America/North_Dakota/Center": return "Central Standard Time";
case "America/North_Dakota/New_Salem": return "Central Standard Time";
case "America/Ojinaga": return "Mountain Standard Time";
case "America/Panama": return "SA Pacific Standard Time";
case "America/Pangnirtung": return "Eastern Standard Time";
case "America/Paramaribo": return "SA Eastern Standard Time";
case "America/Phoenix": return "US Mountain Standard Time";
case "America/Port-au-Prince": return "Eastern Standard Time";
case "America/Port_of_Spain": return "SA Western Standard Time";
case "America/Porto_Velho": return "SA Western Standard Time";
case "America/Puerto_Rico": return "SA Western Standard Time";
case "America/Rainy_River": return "Central Standard Time";
case "America/Rankin_Inlet": return "Central Standard Time";
case "America/Recife": return "SA Eastern Standard Time";
case "America/Regina": return "Canada Central Standard Time";
case "America/Resolute": return "Central Standard Time";
case "America/Rio_Branco": return "SA Pacific Standard Time";
case "America/Santa_Isabel": return "Pacific Standard Time (Mexico)";
case "America/Santarem": return "SA Eastern Standard Time";
case "America/Santiago": return "Pacific SA Standard Time";
case "America/Santo_Domingo": return "SA Western Standard Time";
case "America/Sao_Paulo": return "E. South America Standard Time";
case "America/Scoresbysund": return "Azores Standard Time";
case "America/Sitka": return "Alaskan Standard Time";
case "America/St_Barthelemy": return "SA Western Standard Time";
case "America/St_Johns": return "Newfoundland Standard Time";
case "America/St_Kitts": return "SA Western Standard Time";
case "America/St_Lucia": return "SA Western Standard Time";
case "America/St_Thomas": return "SA Western Standard Time";
case "America/St_Vincent": return "SA Western Standard Time";
case "America/Swift_Current": return "Canada Central Standard Time";
case "America/Tegucigalpa": return "Central America Standard Time";
case "America/Thule": return "Atlantic Standard Time";
case "America/Thunder_Bay": return "Eastern Standard Time";
case "America/Tijuana": return "Pacific Standard Time";
case "America/Toronto": return "Eastern Standard Time";
case "America/Tortola": return "SA Western Standard Time";
case "America/Vancouver": return "Pacific Standard Time";
case "America/Whitehorse": return "Pacific Standard Time";
case "America/Winnipeg": return "Central Standard Time";
case "America/Yakutat": return "Alaskan Standard Time";
case "America/Yellowknife": return "Mountain Standard Time";
case "Antarctica/Casey": return "W. Australia Standard Time";
case "Antarctica/Davis": return "SE Asia Standard Time";
case "Antarctica/DumontDUrville": return "West Pacific Standard Time";
case "Antarctica/Macquarie": return "Central Pacific Standard Time";
case "Antarctica/Mawson": return "West Asia Standard Time";
case "Antarctica/McMurdo": return "New Zealand Standard Time";
case "Antarctica/Palmer": return "Pacific SA Standard Time";
case "Antarctica/Rothera": return "SA Eastern Standard Time";
case "Antarctica/Syowa": return "E. Africa Standard Time";
case "Antarctica/Vostok": return "Central Asia Standard Time";
case "Arctic/Longyearbyen": return "W. Europe Standard Time";
case "Asia/Aden": return "Arab Standard Time";
case "Asia/Almaty": return "Central Asia Standard Time";
case "Asia/Amman": return "Jordan Standard Time";
case "Asia/Anadyr": return "Russia Time Zone 11";
case "Asia/Aqtau": return "West Asia Standard Time";
case "Asia/Aqtobe": return "West Asia Standard Time";
case "Asia/Ashgabat": return "West Asia Standard Time";
case "Asia/Baghdad": return "Arabic Standard Time";
case "Asia/Bahrain": return "Arab Standard Time";
case "Asia/Baku": return "Azerbaijan Standard Time";
case "Asia/Bangkok": return "SE Asia Standard Time";
case "Asia/Beirut": return "Middle East Standard Time";
case "Asia/Bishkek": return "Central Asia Standard Time";
case "Asia/Brunei": return "Singapore Standard Time";
case "Asia/Calcutta": return "India Standard Time";
case "Asia/Chita": return "North Asia East Standard Time";
case "Asia/Choibalsan": return "Ulaanbaatar Standard Time";
case "Asia/Colombo": return "Sri Lanka Standard Time";
case "Asia/Damascus": return "Syria Standard Time";
case "Asia/Dhaka": return "Bangladesh Standard Time";
case "Asia/Dili": return "Tokyo Standard Time";
case "Asia/Dubai": return "Arabian Standard Time";
case "Asia/Dushanbe": return "West Asia Standard Time";
case "Asia/Hong_Kong": return "China Standard Time";
case "Asia/Hovd": return "SE Asia Standard Time";
case "Asia/Irkutsk": return "North Asia East Standard Time";
case "Asia/Jakarta": return "SE Asia Standard Time";
case "Asia/Jayapura": return "Tokyo Standard Time";
case "Asia/Jerusalem": return "Israel Standard Time";
case "Asia/Kabul": return "Afghanistan Standard Time";
case "Asia/Kamchatka": return "Russia Time Zone 11";
case "Asia/Karachi": return "Pakistan Standard Time";
case "Asia/Katmandu": return "Nepal Standard Time";
case "Asia/Khandyga": return "Yakutsk Standard Time";
case "Asia/Krasnoyarsk": return "North Asia Standard Time";
case "Asia/Kuala_Lumpur": return "Singapore Standard Time";
case "Asia/Kuching": return "Singapore Standard Time";
case "Asia/Kuwait": return "Arab Standard Time";
case "Asia/Macau": return "China Standard Time";
case "Asia/Magadan": return "Magadan Standard Time";
case "Asia/Makassar": return "Singapore Standard Time";
case "Asia/Manila": return "Singapore Standard Time";
case "Asia/Muscat": return "Arabian Standard Time";
case "Asia/Nicosia": return "GTB Standard Time";
case "Asia/Novokuznetsk": return "North Asia Standard Time";
case "Asia/Novosibirsk": return "N. Central Asia Standard Time";
case "Asia/Omsk": return "N. Central Asia Standard Time";
case "Asia/Oral": return "West Asia Standard Time";
case "Asia/Phnom_Penh": return "SE Asia Standard Time";
case "Asia/Pontianak": return "SE Asia Standard Time";
case "Asia/Pyongyang": return "Korea Standard Time";
case "Asia/Qatar": return "Arab Standard Time";
case "Asia/Qyzylorda": return "Central Asia Standard Time";
case "Asia/Rangoon": return "Myanmar Standard Time";
case "Asia/Riyadh": return "Arab Standard Time";
case "Asia/Saigon": return "SE Asia Standard Time";
case "Asia/Sakhalin": return "Vladivostok Standard Time";
case "Asia/Samarkand": return "West Asia Standard Time";
case "Asia/Seoul": return "Korea Standard Time";
case "Asia/Shanghai": return "China Standard Time";
case "Asia/Singapore": return "Singapore Standard Time";
case "Asia/Srednekolymsk": return "Russia Time Zone 10";
case "Asia/Taipei": return "Taipei Standard Time";
case "Asia/Tashkent": return "West Asia Standard Time";
case "Asia/Tbilisi": return "Georgian Standard Time";
case "Asia/Tehran": return "Iran Standard Time";
case "Asia/Thimphu": return "Bangladesh Standard Time";
case "Asia/Tokyo": return "Tokyo Standard Time";
case "Asia/Ulaanbaatar": return "Ulaanbaatar Standard Time";
case "Asia/Urumqi": return "Central Asia Standard Time";
case "Asia/Ust-Nera": return "Vladivostok Standard Time";
case "Asia/Vientiane": return "SE Asia Standard Time";
case "Asia/Vladivostok": return "Vladivostok Standard Time";
case "Asia/Yakutsk": return "Yakutsk Standard Time";
case "Asia/Yekaterinburg": return "Ekaterinburg Standard Time";
case "Asia/Yerevan": return "Caucasus Standard Time";
case "Atlantic/Azores": return "Azores Standard Time";
case "Atlantic/Bermuda": return "Atlantic Standard Time";
case "Atlantic/Canary": return "GMT Standard Time";
case "Atlantic/Cape_Verde": return "Cape Verde Standard Time";
case "Atlantic/Faeroe": return "GMT Standard Time";
case "Atlantic/Madeira": return "GMT Standard Time";
case "Atlantic/Reykjavik": return "Greenwich Standard Time";
case "Atlantic/South_Georgia": return "UTC-02";
case "Atlantic/St_Helena": return "Greenwich Standard Time";
case "Atlantic/Stanley": return "SA Eastern Standard Time";
case "Australia/Adelaide": return "Cen. Australia Standard Time";
case "Australia/Brisbane": return "E. Australia Standard Time";
case "Australia/Broken_Hill": return "Cen. Australia Standard Time";
case "Australia/Currie": return "Tasmania Standard Time";
case "Australia/Darwin": return "AUS Central Standard Time";
case "Australia/Hobart": return "Tasmania Standard Time";
case "Australia/Lindeman": return "E. Australia Standard Time";
case "Australia/Melbourne": return "AUS Eastern Standard Time";
case "Australia/Perth": return "W. Australia Standard Time";
case "Australia/Sydney": return "AUS Eastern Standard Time";
case "CST6CDT": return "Central Standard Time";
case "EST5EDT": return "Eastern Standard Time";
case "Etc/GMT": return "UTC";
case "Etc/GMT+1": return "Cape Verde Standard Time";
case "Etc/GMT+10": return "Hawaiian Standard Time";
case "Etc/GMT+11": return "UTC-11";
case "Etc/GMT+12": return "Dateline Standard Time";
case "Etc/GMT+2": return "UTC-02";
case "Etc/GMT+3": return "SA Eastern Standard Time";
case "Etc/GMT+4": return "SA Western Standard Time";
case "Etc/GMT+5": return "SA Pacific Standard Time";
case "Etc/GMT+6": return "Central America Standard Time";
case "Etc/GMT+7": return "US Mountain Standard Time";
case "Etc/GMT-1": return "W. Central Africa Standard Time";
case "Etc/GMT-10": return "West Pacific Standard Time";
case "Etc/GMT-11": return "Central Pacific Standard Time";
case "Etc/GMT-12": return "UTC+12";
case "Etc/GMT-13": return "Tonga Standard Time";
case "Etc/GMT-14": return "Line Islands Standard Time";
case "Etc/GMT-2": return "South Africa Standard Time";
case "Etc/GMT-3": return "E. Africa Standard Time";
case "Etc/GMT-4": return "Arabian Standard Time";
case "Etc/GMT-5": return "West Asia Standard Time";
case "Etc/GMT-6": return "Central Asia Standard Time";
case "Etc/GMT-7": return "SE Asia Standard Time";
case "Etc/GMT-8": return "Singapore Standard Time";
case "Etc/GMT-9": return "Tokyo Standard Time";
case "Europe/Amsterdam": return "W. Europe Standard Time";
case "Europe/Andorra": return "W. Europe Standard Time";
case "Europe/Athens": return "GTB Standard Time";
case "Europe/Belgrade": return "Central Europe Standard Time";
case "Europe/Berlin": return "W. Europe Standard Time";
case "Europe/Bratislava": return "Central Europe Standard Time";
case "Europe/Brussels": return "Romance Standard Time";
case "Europe/Bucharest": return "GTB Standard Time";
case "Europe/Budapest": return "Central Europe Standard Time";
case "Europe/Busingen": return "W. Europe Standard Time";
case "Europe/Chisinau": return "GTB Standard Time";
case "Europe/Copenhagen": return "Romance Standard Time";
case "Europe/Dublin": return "GMT Standard Time";
case "Europe/Gibraltar": return "W. Europe Standard Time";
case "Europe/Guernsey": return "GMT Standard Time";
case "Europe/Helsinki": return "FLE Standard Time";
case "Europe/Isle_of_Man": return "GMT Standard Time";
case "Europe/Istanbul": return "Turkey Standard Time";
case "Europe/Jersey": return "GMT Standard Time";
case "Europe/Kaliningrad": return "Kaliningrad Standard Time";
case "Europe/Kiev": return "FLE Standard Time";
case "Europe/Lisbon": return "GMT Standard Time";
case "Europe/Ljubljana": return "Central Europe Standard Time";
case "Europe/London": return "GMT Standard Time";
case "Europe/Luxembourg": return "W. Europe Standard Time";
case "Europe/Madrid": return "Romance Standard Time";
case "Europe/Malta": return "W. Europe Standard Time";
case "Europe/Mariehamn": return "FLE Standard Time";
case "Europe/Minsk": return "Belarus Standard Time";
case "Europe/Monaco": return "W. Europe Standard Time";
case "Europe/Moscow": return "Russian Standard Time";
case "Europe/Oslo": return "W. Europe Standard Time";
case "Europe/Paris": return "Romance Standard Time";
case "Europe/Podgorica": return "Central Europe Standard Time";
case "Europe/Prague": return "Central Europe Standard Time";
case "Europe/Riga": return "FLE Standard Time";
case "Europe/Rome": return "W. Europe Standard Time";
case "Europe/Samara": return "Russia Time Zone 3";
case "Europe/San_Marino": return "W. Europe Standard Time";
case "Europe/Sarajevo": return "Central European Standard Time";
case "Europe/Simferopol": return "Russian Standard Time";
case "Europe/Skopje": return "Central European Standard Time";
case "Europe/Sofia": return "FLE Standard Time";
case "Europe/Stockholm": return "W. Europe Standard Time";
case "Europe/Tallinn": return "FLE Standard Time";
case "Europe/Tirane": return "Central Europe Standard Time";
case "Europe/Uzhgorod": return "FLE Standard Time";
case "Europe/Vaduz": return "W. Europe Standard Time";
case "Europe/Vatican": return "W. Europe Standard Time";
case "Europe/Vienna": return "W. Europe Standard Time";
case "Europe/Vilnius": return "FLE Standard Time";
case "Europe/Volgograd": return "Russian Standard Time";
case "Europe/Warsaw": return "Central European Standard Time";
case "Europe/Zagreb": return "Central European Standard Time";
case "Europe/Zaporozhye": return "FLE Standard Time";
case "Europe/Zurich": return "W. Europe Standard Time";
case "Indian/Antananarivo": return "E. Africa Standard Time";
case "Indian/Chagos": return "Central Asia Standard Time";
case "Indian/Christmas": return "SE Asia Standard Time";
case "Indian/Cocos": return "Myanmar Standard Time";
case "Indian/Comoro": return "E. Africa Standard Time";
case "Indian/Kerguelen": return "West Asia Standard Time";
case "Indian/Mahe": return "Mauritius Standard Time";
case "Indian/Maldives": return "West Asia Standard Time";
case "Indian/Mauritius": return "Mauritius Standard Time";
case "Indian/Mayotte": return "E. Africa Standard Time";
case "Indian/Reunion": return "Mauritius Standard Time";
case "MST7MDT": return "Mountain Standard Time";
case "PST8PDT": return "Pacific Standard Time";
case "Pacific/Apia": return "Samoa Standard Time";
case "Pacific/Auckland": return "New Zealand Standard Time";
case "Pacific/Efate": return "Central Pacific Standard Time";
case "Pacific/Enderbury": return "Tonga Standard Time";
case "Pacific/Fakaofo": return "Tonga Standard Time";
case "Pacific/Fiji": return "Fiji Standard Time";
case "Pacific/Funafuti": return "UTC+12";
case "Pacific/Galapagos": return "Central America Standard Time";
case "Pacific/Guadalcanal": return "Central Pacific Standard Time";
case "Pacific/Guam": return "West Pacific Standard Time";
case "Pacific/Honolulu": return "Hawaiian Standard Time";
case "Pacific/Johnston": return "Hawaiian Standard Time";
case "Pacific/Kiritimati": return "Line Islands Standard Time";
case "Pacific/Kosrae": return "Central Pacific Standard Time";
case "Pacific/Kwajalein": return "UTC+12";
case "Pacific/Majuro": return "UTC+12";
case "Pacific/Midway": return "UTC-11";
case "Pacific/Nauru": return "UTC+12";
case "Pacific/Niue": return "UTC-11";
case "Pacific/Noumea": return "Central Pacific Standard Time";
case "Pacific/Pago_Pago": return "UTC-11";
case "Pacific/Palau": return "Tokyo Standard Time";
case "Pacific/Ponape": return "Central Pacific Standard Time";
case "Pacific/Port_Moresby": return "West Pacific Standard Time";
case "Pacific/Rarotonga": return "Hawaiian Standard Time";
case "Pacific/Saipan": return "West Pacific Standard Time";
case "Pacific/Tahiti": return "Hawaiian Standard Time";
case "Pacific/Tarawa": return "UTC+12";
case "Pacific/Tongatapu": return "Tonga Standard Time";
case "Pacific/Truk": return "West Pacific Standard Time";
case "Pacific/Wake": return "UTC+12";
case "Pacific/Wallis": return "UTC+12";
default: return null;
}
}
version(Windows) unittest
{
import std.format : format;
foreach(tzName; TimeZone.getInstalledTZNames())
assert(tzDatabaseNameToWindowsTZName(tzName) !is null, format("TZName which failed: %s", tzName));
}
/++
Converts the given Windows time zone name to a corresponding TZ Database
name.
Returns null if the given time zone name cannot be converted.
See_Also:
$(WEB unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html,
Windows <-> TZ Database Name Conversion Table)
Params:
tzName = The TZ Database name to convert.
+/
string windowsTZNameToTZDatabaseName(string tzName) @safe pure nothrow @nogc
{
switch(tzName)
{
case "AUS Central Standard Time": return "Australia/Darwin";
case "AUS Eastern Standard Time": return "Australia/Sydney";
case "Afghanistan Standard Time": return "Asia/Kabul";
case "Alaskan Standard Time": return "America/Anchorage";
case "Arab Standard Time": return "Asia/Riyadh";
case "Arabian Standard Time": return "Asia/Dubai";
case "Arabic Standard Time": return "Asia/Baghdad";
case "Argentina Standard Time": return "America/Buenos_Aires";
case "Atlantic Standard Time": return "America/Halifax";
case "Azerbaijan Standard Time": return "Asia/Baku";
case "Azores Standard Time": return "Atlantic/Azores";
case "Bahia Standard Time": return "America/Bahia";
case "Bangladesh Standard Time": return "Asia/Dhaka";
case "Belarus Standard Time": return "Europe/Minsk";
case "Canada Central Standard Time": return "America/Regina";
case "Cape Verde Standard Time": return "Atlantic/Cape_Verde";
case "Caucasus Standard Time": return "Asia/Yerevan";
case "Cen. Australia Standard Time": return "Australia/Adelaide";
case "Central America Standard Time": return "America/Guatemala";
case "Central Asia Standard Time": return "Asia/Almaty";
case "Central Brazilian Standard Time": return "America/Cuiaba";
case "Central Europe Standard Time": return "Europe/Budapest";
case "Central European Standard Time": return "Europe/Warsaw";
case "Central Pacific Standard Time": return "Pacific/Guadalcanal";
case "Central Standard Time": return "America/Chicago";
case "Central Standard Time (Mexico)": return "America/Mexico_City";
case "China Standard Time": return "Asia/Shanghai";
case "Dateline Standard Time": return "Etc/GMT+12";
case "E. Africa Standard Time": return "Africa/Nairobi";
case "E. Australia Standard Time": return "Australia/Brisbane";
// This doesn't appear to be in the current stuff from MS, but the autotester
// is failing without it (probably because its time zone data hasn't been
// updated recently enough).
case "E. Europe Standard Time": return "Europe/Minsk";
case "E. South America Standard Time": return "America/Sao_Paulo";
case "Eastern Standard Time": return "America/New_York";
case "Egypt Standard Time": return "Africa/Cairo";
case "Ekaterinburg Standard Time": return "Asia/Yekaterinburg";
case "FLE Standard Time": return "Europe/Kiev";
case "Fiji Standard Time": return "Pacific/Fiji";
case "GMT Standard Time": return "Europe/London";
case "GTB Standard Time": return "Europe/Athens";
case "Georgian Standard Time": return "Asia/Tbilisi";
case "Greenland Standard Time": return "America/Godthab";
case "Greenwich Standard Time": return "Atlantic/Reykjavik";
case "Hawaiian Standard Time": return "Pacific/Honolulu";
case "India Standard Time": return "Asia/Calcutta";
case "Iran Standard Time": return "Asia/Tehran";
case "Israel Standard Time": return "Asia/Jerusalem";
case "Jordan Standard Time": return "Asia/Amman";
case "Kaliningrad Standard Time": return "Europe/Kaliningrad";
// Same as with E. Europe Standard Time.
case "Kamchatka Standard Time": return "Asia/Kamchatka";
case "Korea Standard Time": return "Asia/Seoul";
case "Libya Standard Time": return "Africa/Tripoli";
case "Line Islands Standard Time": return "Pacific/Kiritimati";
case "Magadan Standard Time": return "Asia/Magadan";
case "Mauritius Standard Time": return "Indian/Mauritius";
// Same as with E. Europe Standard Time.
case "Mexico Standard Time": return "America/Mexico_City";
// Same as with E. Europe Standard Time.
case "Mexico Standard Time 2": return "America/Chihuahua";
// Same as with E. Europe Standard Time.
case "Mid-Atlantic Standard Time": return "Etc/GMT+2";
case "Middle East Standard Time": return "Asia/Beirut";
case "Montevideo Standard Time": return "America/Montevideo";
case "Morocco Standard Time": return "Africa/Casablanca";
case "Mountain Standard Time": return "America/Denver";
case "Mountain Standard Time (Mexico)": return "America/Chihuahua";
case "Myanmar Standard Time": return "Asia/Rangoon";
case "N. Central Asia Standard Time": return "Asia/Novosibirsk";
case "Namibia Standard Time": return "Africa/Windhoek";
case "Nepal Standard Time": return "Asia/Katmandu";
case "New Zealand Standard Time": return "Pacific/Auckland";
case "Newfoundland Standard Time": return "America/St_Johns";
case "North Asia East Standard Time": return "Asia/Irkutsk";
case "North Asia Standard Time": return "Asia/Krasnoyarsk";
case "Pacific SA Standard Time": return "America/Santiago";
case "Pacific Standard Time": return "America/Los_Angeles";
case "Pacific Standard Time (Mexico)": return "America/Santa_Isabel";
case "Pakistan Standard Time": return "Asia/Karachi";
case "Paraguay Standard Time": return "America/Asuncion";
case "Romance Standard Time": return "Europe/Paris";
case "Russia Time Zone 10": return "Asia/Srednekolymsk";
case "Russia Time Zone 11": return "Asia/Anadyr";
case "Russia Time Zone 3": return "Europe/Samara";
case "Russian Standard Time": return "Europe/Moscow";
case "SA Eastern Standard Time": return "America/Cayenne";
case "SA Pacific Standard Time": return "America/Bogota";
case "SA Western Standard Time": return "America/La_Paz";
case "SE Asia Standard Time": return "Asia/Bangkok";
case "Samoa Standard Time": return "Pacific/Apia";
case "Singapore Standard Time": return "Asia/Singapore";
case "South Africa Standard Time": return "Africa/Johannesburg";
case "Sri Lanka Standard Time": return "Asia/Colombo";
case "Syria Standard Time": return "Asia/Damascus";
case "Taipei Standard Time": return "Asia/Taipei";
case "Tasmania Standard Time": return "Australia/Hobart";
case "Tokyo Standard Time": return "Asia/Tokyo";
case "Tonga Standard Time": return "Pacific/Tongatapu";
case "Turkey Standard Time": return "Europe/Istanbul";
case "US Eastern Standard Time": return "America/Indianapolis";
case "US Mountain Standard Time": return "America/Phoenix";
case "UTC": return "Etc/GMT";
case "UTC+12": return "Etc/GMT-12";
case "UTC-02": return "Etc/GMT+2";
case "UTC-11": return "Etc/GMT+11";
case "Ulaanbaatar Standard Time": return "Asia/Ulaanbaatar";
case "Venezuela Standard Time": return "America/Caracas";
case "Vladivostok Standard Time": return "Asia/Vladivostok";
case "W. Australia Standard Time": return "Australia/Perth";
case "W. Central Africa Standard Time": return "Africa/Lagos";
case "W. Europe Standard Time": return "Europe/Berlin";
case "West Asia Standard Time": return "Asia/Tashkent";
case "West Pacific Standard Time": return "Pacific/Port_Moresby";
case "Yakutsk Standard Time": return "Asia/Yakutsk";
default: return null;
}
}
version(Windows) unittest
{
import std.format : format;
foreach(tzName; WindowsTimeZone.getInstalledTZNames())
assert(windowsTZNameToTZDatabaseName(tzName) !is null, format("TZName which failed: %s", tzName));
}
//==============================================================================
// Section with StopWatch and Benchmark Code.
//==============================================================================
/++
$(D StopWatch) measures time as precisely as possible.
This class uses a high-performance counter. On Windows systems, it uses
$(D QueryPerformanceCounter), and on Posix systems, it uses
$(D clock_gettime) if available, and $(D gettimeofday) otherwise.
But the precision of $(D StopWatch) differs from system to system. It is
impossible to for it to be the same from system to system since the precision
of the system clock varies from system to system, and other system-dependent
and situation-dependent stuff (such as the overhead of a context switch
between threads) can also affect $(D StopWatch)'s accuracy.
Examples:
--------------------
void foo()
{
StopWatch sw;
enum n = 100;
TickDuration[n] times;
TickDuration last = TickDuration.from!"seconds"(0);
foreach(i; 0..n)
{
sw.start(); //start/resume mesuring.
foreach(unused; 0..1_000_000)
bar();
sw.stop(); //stop/pause measuring.
//Return value of peek() after having stopped are the always same.
writeln((i + 1) * 1_000_000, " times done, lap time: ",
sw.peek().msecs, "[ms]");
times[i] = sw.peek() - last;
last = sw.peek();
}
real sum = 0;
// To know the number of seconds,
// use properties of TickDuration.
// (seconds, msecs, usecs, hnsecs)
foreach(t; times)
sum += t.hnsecs;
writeln("Average time: ", sum/n, " hnsecs");
}
--------------------
+/
@safe struct StopWatch
{
public:
//Verify Example
@safe unittest
{
void writeln(S...)(S args){}
static void bar() {}
StopWatch sw;
enum n = 100;
TickDuration[n] times;
TickDuration last = TickDuration.from!"seconds"(0);
foreach(i; 0..n)
{
sw.start(); //start/resume mesuring.
foreach(unused; 0..1_000_000)
bar();
sw.stop(); //stop/pause measuring.
//Return value of peek() after having stopped are the always same.
writeln((i + 1) * 1_000_000, " times done, lap time: ",
sw.peek().msecs, "[ms]");
times[i] = sw.peek() - last;
last = sw.peek();
}
real sum = 0;
// To get the number of seconds,
// use properties of TickDuration.
// (seconds, msecs, usecs, hnsecs)
foreach(t; times)
sum += t.hnsecs;
writeln("Average time: ", sum/n, " hnsecs");
}
/++
Auto start with constructor.
+/
this(AutoStart autostart)
{
if(autostart)
start();
}
@safe unittest
{
auto sw = StopWatch(AutoStart.yes);
sw.stop();
}
///
bool opEquals(const StopWatch rhs) const pure nothrow
{
return opEquals(rhs);
}
/// ditto
bool opEquals(const ref StopWatch rhs) const pure nothrow
{
return _timeStart == rhs._timeStart &&
_timeMeasured == rhs._timeMeasured;
}
/++
Resets the stop watch.
+/
void reset()
{
if(_flagStarted)
{
// Set current system time if StopWatch is measuring.
_timeStart = Clock.currSystemTick;
}
else
{
// Set zero if StopWatch is not measuring.
_timeStart.length = 0;
}
_timeMeasured.length = 0;
}
@safe unittest
{
StopWatch sw;
sw.start();
sw.stop();
sw.reset();
assert(sw.peek().to!("seconds", real)() == 0);
}
/++
Starts the stop watch.
+/
void start()
{
assert(!_flagStarted);
_flagStarted = true;
_timeStart = Clock.currSystemTick;
}
@trusted unittest
{
StopWatch sw;
sw.start();
auto t1 = sw.peek();
bool doublestart = true;
try
sw.start();
catch(AssertError e)
doublestart = false;
assert(!doublestart);
sw.stop();
assert((t1 - sw.peek()).to!("seconds", real)() <= 0);
}
/++
Stops the stop watch.
+/
void stop()
{
assert(_flagStarted);
_flagStarted = false;
_timeMeasured += Clock.currSystemTick - _timeStart;
}
@trusted unittest
{
StopWatch sw;
sw.start();
sw.stop();
auto t1 = sw.peek();
bool doublestop = true;
try
sw.stop();
catch(AssertError e)
doublestop = false;
assert(!doublestop);
assert((t1 - sw.peek()).to!("seconds", real)() == 0);
}
/++
Peek at the amount of time which has passed since the stop watch was
started.
+/
TickDuration peek() const
{
if(_flagStarted)
return Clock.currSystemTick - _timeStart + _timeMeasured;
return _timeMeasured;
}
@safe unittest
{
StopWatch sw;
sw.start();
auto t1 = sw.peek();
sw.stop();
auto t2 = sw.peek();
auto t3 = sw.peek();
assert(t1 <= t2);
assert(t2 == t3);
}
/++
Set the amount of time which has been measured since the stop watch was
started.
+/
void setMeasured(TickDuration d)
{
reset();
_timeMeasured = d;
}
@safe unittest
{
StopWatch sw;
TickDuration t0;
t0.length = 100;
sw.setMeasured(t0);
auto t1 = sw.peek();
assert(t0 == t1);
}
/++
Confirm whether this stopwatch is measuring time.
+/
bool running() @property const pure nothrow
{
return _flagStarted;
}
@safe unittest
{
StopWatch sw1;
assert(!sw1.running);
sw1.start();
assert(sw1.running);
sw1.stop();
assert(!sw1.running);
StopWatch sw2 = AutoStart.yes;
assert(sw2.running);
sw2.stop();
assert(!sw2.running);
sw2.start();
assert(sw2.running);
}
private:
// true if observing.
bool _flagStarted = false;
// TickDuration at the time of StopWatch starting measurement.
TickDuration _timeStart;
// Total time that StopWatch ran.
TickDuration _timeMeasured;
}
/++
Benchmarks code for speed assessment and comparison.
Params:
fun = aliases of callable objects (e.g. function names). Each should
take no arguments.
n = The number of times each function is to be executed.
Returns:
The amount of time (as a $(CXREF time, TickDuration)) that it took to
call each function $(D n) times. The first value is the length of time
that it took to call $(D fun[0]) $(D n) times. The second value is the
length of time it took to call $(D fun[1]) $(D n) times. Etc.
Note that casting the TickDurations to $(CXREF time, Duration)s will make
the results easier to deal with (and it may change in the future that
benchmark will return an array of Durations rather than TickDurations).
See_Also:
$(LREF measureTime)
+/
TickDuration[fun.length] benchmark(fun...)(uint n)
{
TickDuration[fun.length] result;
StopWatch sw;
sw.start();
foreach(i, unused; fun)
{
sw.reset();
foreach(j; 0 .. n)
fun[i]();
result[i] = sw.peek();
}
return result;
}
///
unittest
{
import std.conv : to;
int a;
void f0() {}
void f1() {auto b = a;}
void f2() {auto b = to!string(a);}
auto r = benchmark!(f0, f1, f2)(10_000);
auto f0Result = to!Duration(r[0]); // time f0 took to run 10,000 times
auto f1Result = to!Duration(r[1]); // time f1 took to run 10,000 times
auto f2Result = to!Duration(r[2]); // time f2 took to run 10,000 times
}
@safe unittest
{
int a;
void f0() {}
//void f1() {auto b = to!(string)(a);}
void f2() {auto b = (a);}
auto r = benchmark!(f0, f2)(100);
}
/++
Return value of benchmark with two functions comparing.
+/
@safe struct ComparingBenchmarkResult
{
/++
Evaluation value
This returns the evaluation value of performance as the ratio of
baseFunc's time over targetFunc's time. If performance is high, this
returns a high value.
+/
@property real point() const pure nothrow
{
return _baseTime.length / cast(const real)_targetTime.length;
}
/++
The time required of the base function
+/
@property public TickDuration baseTime() const pure nothrow
{
return _baseTime;
}
/++
The time required of the target function
+/
@property public TickDuration targetTime() const pure nothrow
{
return _targetTime;
}
private:
this(TickDuration baseTime, TickDuration targetTime) pure nothrow
{
_baseTime = baseTime;
_targetTime = targetTime;
}
TickDuration _baseTime;
TickDuration _targetTime;
}
/++
Benchmark with two functions comparing.
Params:
baseFunc = The function to become the base of the speed.
targetFunc = The function that wants to measure speed.
times = The number of times each function is to be executed.
Examples:
--------------------
void f1() {
// ...
}
void f2() {
// ...
}
void main() {
auto b = comparingBenchmark!(f1, f2, 0x80);
writeln(b.point);
}
--------------------
+/
ComparingBenchmarkResult comparingBenchmark(alias baseFunc,
alias targetFunc,
int times = 0xfff)()
{
auto t = benchmark!(baseFunc, targetFunc)(times);
return ComparingBenchmarkResult(t[0], t[1]);
}
@safe unittest
{
void f1x() {}
void f2x() {}
@safe void f1o() {}
@safe void f2o() {}
auto b1 = comparingBenchmark!(f1o, f2o, 1)(); // OK
//static auto b2 = comparingBenchmark!(f1x, f2x, 1); // NG
}
unittest
{
void f1x() {}
void f2x() {}
@safe void f1o() {}
@safe void f2o() {}
auto b1 = comparingBenchmark!(f1o, f2o, 1)(); // OK
auto b2 = comparingBenchmark!(f1x, f2x, 1)(); // OK
}
//Bug# 8450
unittest
{
@safe void safeFunc() {}
@trusted void trustFunc() {}
@system void sysFunc() {}
auto safeResult = comparingBenchmark!((){safeFunc();}, (){safeFunc();})();
auto trustResult = comparingBenchmark!((){trustFunc();}, (){trustFunc();})();
auto sysResult = comparingBenchmark!((){sysFunc();}, (){sysFunc();})();
auto mixedResult1 = comparingBenchmark!((){safeFunc();}, (){trustFunc();})();
auto mixedResult2 = comparingBenchmark!((){trustFunc();}, (){sysFunc();})();
auto mixedResult3 = comparingBenchmark!((){safeFunc();}, (){sysFunc();})();
}
//==============================================================================
// Section with public helper functions and templates.
//==============================================================================
/++
Whether the given type defines all of the necessary functions for it to
function as a time point.
+/
template isTimePoint(T)
{
enum isTimePoint = hasMin!T &&
hasMax!T &&
hasOverloadedOpBinaryWithDuration!T &&
hasOverloadedOpAssignWithDuration!T &&
hasOverloadedOpBinaryWithSelf!T;
}
unittest
{
static assert(isTimePoint!(Date));
static assert(isTimePoint!(DateTime));
static assert(isTimePoint!(TimeOfDay));
static assert(isTimePoint!(SysTime));
static assert(isTimePoint!(const Date));
static assert(isTimePoint!(const DateTime));
static assert(isTimePoint!(const TimeOfDay));
static assert(isTimePoint!(const SysTime));
static assert(isTimePoint!(immutable Date));
static assert(isTimePoint!(immutable DateTime));
static assert(isTimePoint!(immutable TimeOfDay));
static assert(isTimePoint!(immutable SysTime));
}
/++
Whether the given Gregorian Year is a leap year.
Params:
year = The year to to be tested.
+/
static bool yearIsLeapYear(int year) @safe pure nothrow
{
if(year % 400 == 0)
return true;
if(year % 100 == 0)
return false;
return year % 4 == 0;
}
unittest
{
import std.format : format;
foreach(year; [1, 2, 3, 5, 6, 7, 100, 200, 300, 500, 600, 700, 1998, 1999,
2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011])
{
assert(!yearIsLeapYear(year), format("year: %s.", year));
assert(!yearIsLeapYear(-year), format("year: %s.", year));
}
foreach(year; [0, 4, 8, 400, 800, 1600, 1996, 2000, 2004, 2008, 2012])
{
assert(yearIsLeapYear(year), format("year: %s.", year));
assert(yearIsLeapYear(-year), format("year: %s.", year));
}
}
/++
Converts a $(D time_t) (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).
Params:
unixTime = The $(D time_t) to convert.
+/
long unixTimeToStdTime(time_t unixTime) @safe pure nothrow
{
return 621_355_968_000_000_000L + convert!("seconds", "hnsecs")(unixTime);
}
unittest
{
assert(unixTimeToStdTime(0) == 621_355_968_000_000_000L); //Midnight, January 1st, 1970
assert(unixTimeToStdTime(86_400) == 621_355_968_000_000_000L + 864_000_000_000L); //Midnight, January 2nd, 1970
assert(unixTimeToStdTime(-86_400) == 621_355_968_000_000_000L - 864_000_000_000L); //Midnight, December 31st, 1969
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");
}
/++
Converts std time (which uses midnight, January 1st, 1 A.D. UTC as its epoch
and hnsecs as its units) to $(D time_t) (which uses midnight, January 1st,
1970 UTC as its epoch and seconds as its units). If $(D time_t) is 32 bits,
rather than 64, and the result can't fit in a 32-bit value, then the closest
value that can be held in 32 bits will be used (so $(D time_t.max) if it
goes over and $(D time_t.min) if it goes under).
Note:
While Windows systems require that $(D time_t) be non-negative (in spite
of $(D time_t) being signed), this function still returns negative
numbers on Windows, since it's more flexible to allow negative time_t
for those who need it. If on Windows and using the
standard C functions or Win32 API functions which take a $(D time_t),
check whether the return value of
$(D stdTimeToUnixTime) is non-negative.
Params:
stdTime = The std time to convert.
+/
time_t stdTimeToUnixTime(long stdTime) @safe pure nothrow
{
immutable unixTime = convert!("hnsecs", "seconds")(stdTime - 621_355_968_000_000_000L);
static if(time_t.sizeof >= long.sizeof)
return cast(time_t)unixTime;
else
{
if(unixTime > 0)
{
if(unixTime > time_t.max)
return time_t.max;
return cast(time_t)unixTime;
}
if(unixTime < time_t.min)
return time_t.min;
return cast(time_t)unixTime;
}
}
unittest
{
assert(stdTimeToUnixTime(621_355_968_000_000_000L) == 0); //Midnight, January 1st, 1970
assert(stdTimeToUnixTime(621_355_968_000_000_000L + 864_000_000_000L) == 86_400); //Midnight, January 2nd, 1970
assert(stdTimeToUnixTime(621_355_968_000_000_000L - 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);
}
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:
$(LREF DateTimeException) 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:
$(LREF DateTimeException) 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:
$(LREF DateTimeException) if the given $(D FILETIME) cannot be
represented as the return value.
+/
long FILETIMEToStdTime(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:
$(LREF DateTimeException) if the given $(D FILETIME) will not fit in a
$(LREF SysTime).
+/
SysTime FILETIMEToSysTime(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:
$(LREF DateTimeException) 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:
$(LREF DateTimeException) 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);
return SysTime(dt, msecs(st.wMilliseconds), tz);
}
unittest
{
auto sysTime = Clock.currTime(UTC());
SYSTEMTIME st = void;
GetSystemTime(&st);
auto converted = SYSTEMTIMEToSysTime(&st, UTC());
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;
}
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(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(const FILETIME* ft, immutable TimeZone tz = LocalTime()) @safe
{
auto sysTime = SysTime(FILETIMEToStdTime(ft), UTC());
sysTime.timezone = tz;
return sysTime;
}
unittest
{
auto sysTime = Clock.currTime(UTC());
SYSTEMTIME st = void;
GetSystemTime(&st);
FILETIME ft = void;
SystemTimeToFileTime(&st, &ft);
auto converted = FILETIMEToSysTime(&ft);
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);
}
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:
$(LREF DateTimeException) 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);
}
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:
$(LREF DateTimeException) 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;
}
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
$(WEB 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 $(LREF SimpleTimeZone) with a
utc offset of $(D 0) is used rather than $(LREF UTC), whereas $(D "+0000")
uses $(LREF UTC).
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:
$(LREF DateTimeException) 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.functional : not;
import std.ascii : isDigit;
import std.typecons : Rebindable;
import std.string : capitalize, format;
import std.conv : to;
import std.algorithm : find, all;
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(std.ascii.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 = std.ascii.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 && std.ascii.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);
}
///
unittest
{
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.string;
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);
}
unittest
{
import std.algorithm;
import std.ascii;
import std.format : format;
import std.range;
import std.string;
import std.typecons;
import std.typetuple;
static struct Rand3Letters
{
enum empty = false;
@property auto front() { return _mon; }
void popFront()
{
import std.random;
_mon = rndGen.map!(a => letters[a % letters.length])().take(3).array().assumeUnique();
}
string _mon;
static auto start() { Rand3Letters retval; retval.popFront(); return retval; }
}
foreach(cr; TypeTuple!(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);}))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
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;
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().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().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.
unittest
{
import std.algorithm;
import std.ascii;
import std.format : format;
import std.range;
import std.string;
import std.typecons;
import std.typetuple;
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());
foreach(cr; TypeTuple!(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);}))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
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);
}
}
}();
}
/++
Whether all of the given strings are valid units of time.
$(D "nsecs") is not considered a valid unit of time. Nothing in std.datetime
can handle precision greater than hnsecs, and the few functions in core.time
which deal with "nsecs" deal with it explicitly.
+/
bool validTimeUnits(string[] units...) @safe pure nothrow
{
import std.algorithm : canFind;
foreach(str; units)
{
if(!canFind(timeStrings[], str))
return false;
}
return true;
}
/++
Compares two time unit strings. $(D "years") are the largest units and
$(D "hnsecs") are the smallest.
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
Throws:
$(LREF DateTimeException) if either of the given strings is not a valid
time unit string.
+/
int cmpTimeUnits(string lhs, string rhs) @safe pure
{
import std.format : format;
import std.algorithm : countUntil;
auto tstrings = timeStrings;
immutable indexOfLHS = countUntil(tstrings, lhs);
immutable indexOfRHS = countUntil(tstrings, rhs);
enforce(indexOfLHS != -1, format("%s is not a valid TimeString", lhs));
enforce(indexOfRHS != -1, format("%s is not a valid TimeString", rhs));
if(indexOfLHS < indexOfRHS)
return -1;
if(indexOfLHS > indexOfRHS)
return 1;
return 0;
}
unittest
{
foreach(i, outerUnits; timeStrings)
{
assert(cmpTimeUnits(outerUnits, outerUnits) == 0);
//For some reason, $ won't compile.
foreach(innerUnits; timeStrings[i+1 .. timeStrings.length])
assert(cmpTimeUnits(outerUnits, innerUnits) == -1);
}
foreach(i, outerUnits; timeStrings)
{
foreach(innerUnits; timeStrings[0 .. i])
assert(cmpTimeUnits(outerUnits, innerUnits) == 1);
}
}
/++
Compares two time unit strings at compile time. $(D "years") are the largest
units and $(D "hnsecs") are the smallest.
This template is used instead of $(D cmpTimeUnits) because exceptions
can't be thrown at compile time and $(D cmpTimeUnits) must enforce that
the strings it's given are valid time unit strings. This template uses a
template constraint instead.
Returns:
$(BOOKTABLE,
$(TR $(TD this < rhs) $(TD < 0))
$(TR $(TD this == rhs) $(TD 0))
$(TR $(TD this > rhs) $(TD > 0))
)
+/
template CmpTimeUnits(string lhs, string rhs)
if(validTimeUnits(lhs, rhs))
{
enum CmpTimeUnits = cmpTimeUnitsCTFE(lhs, rhs);
}
/+
Helper function for $(D CmpTimeUnits).
+/
private int cmpTimeUnitsCTFE(string lhs, string rhs) @safe pure nothrow
{
import std.algorithm : countUntil;
auto tstrings = timeStrings;
immutable indexOfLHS = countUntil(tstrings, lhs);
immutable indexOfRHS = countUntil(tstrings, rhs);
if(indexOfLHS < indexOfRHS)
return -1;
if(indexOfLHS > indexOfRHS)
return 1;
return 0;
}
unittest
{
import std.format : format;
import std.string;
import std.typecons;
import std.typetuple;
static string genTest(size_t index)
{
auto currUnits = timeStrings[index];
auto test = format(`assert(CmpTimeUnits!("%s", "%s") == 0);`, currUnits, currUnits);
foreach(units; timeStrings[index + 1 .. $])
test ~= format(`assert(CmpTimeUnits!("%s", "%s") == -1);`, currUnits, units);
foreach(units; timeStrings[0 .. index])
test ~= format(`assert(CmpTimeUnits!("%s", "%s") == 1);`, currUnits, units);
return test;
}
static assert(timeStrings.length == 10);
foreach(n; TypeTuple!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
mixin(genTest(n));
}
/++
Returns whether the given value is valid for the given unit type when in a
time point. Naturally, a duration is not held to a particular range, but
the values in a time point are (e.g. a month must be in the range of
1 - 12 inclusive).
Params:
units = The units of time to validate.
value = The number to validate.
+/
bool valid(string units)(int value) @safe pure nothrow
if(units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds")
{
static if(units == "months")
return value >= Month.jan && value <= Month.dec;
else static if(units == "hours")
return value >= 0 && value <= TimeOfDay.maxHour;
else static if(units == "minutes")
return value >= 0 && value <= TimeOfDay.maxMinute;
else static if(units == "seconds")
return value >= 0 && value <= TimeOfDay.maxSecond;
}
///
unittest
{
assert(valid!"hours"(12));
assert(!valid!"hours"(32));
assert(valid!"months"(12));
assert(!valid!"months"(13));
}
/++
Returns whether the given day is valid for the given year and month.
Params:
units = The units of time to validate.
year = The year of the day to validate.
month = The month of the day to validate.
day = The day to validate.
+/
bool valid(string units)(int year, int month, int day) @safe pure nothrow
if(units == "days")
{
return day > 0 && day <= maxDay(year, month);
}
/++
Params:
units = The units of time to validate.
value = The number to validate.
file = The file that the $(LREF DateTimeException) will list if thrown.
line = The line number that the $(LREF DateTimeException) will list if
thrown.
Throws:
$(LREF DateTimeException) if $(D valid!units(value)) is false.
+/
void enforceValid(string units)(int value, string file = __FILE__, size_t line = __LINE__) @safe pure
if(units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds")
{
import std.format : format;
static if(units == "months")
{
if(!valid!units(value))
throw new DateTimeException(format("%s is not a valid month of the year.", value), file, line);
}
else static if(units == "hours")
{
if(!valid!units(value))
throw new DateTimeException(format("%s is not a valid hour of the day.", value), file, line);
}
else static if(units == "minutes")
{
if(!valid!units(value))
throw new DateTimeException(format("%s is not a valid minute of an hour.", value), file, line);
}
else static if(units == "seconds")
{
if(!valid!units(value))
throw new DateTimeException(format("%s is not a valid second of a minute.", value), file, line);
}
}
/++
Params:
units = The units of time to validate.
year = The year of the day to validate.
month = The month of the day to validate.
day = The day to validate.
file = The file that the $(LREF DateTimeException) will list if thrown.
line = The line number that the $(LREF DateTimeException) will list if
thrown.
Throws:
$(LREF DateTimeException) if $(D valid!"days"(year, month, day)) is false.
+/
void enforceValid(string units)
(int year, Month month, int day, string file = __FILE__, size_t line = __LINE__) @safe pure
if(units == "days")
{
import std.format : format;
if(!valid!"days"(year, month, day))
throw new DateTimeException(format("%s is not a valid day in %s in %s", day, month, year), file, line);
}
/++
Returns the number of months from the current months of the year to the
given month of the year. If they are the same, then the result is 0.
Params:
currMonth = The current month of the year.
month = The month of the year to get the number of months to.
+/
static int monthsToMonth(int currMonth, int month) @safe pure
{
enforceValid!"months"(currMonth);
enforceValid!"months"(month);
if(currMonth == month)
return 0;
if(currMonth < month)
return month - currMonth;
return (Month.dec - currMonth) + month;
}
unittest
{
assert(monthsToMonth(Month.jan, Month.jan) == 0);
assert(monthsToMonth(Month.jan, Month.feb) == 1);
assert(monthsToMonth(Month.jan, Month.mar) == 2);
assert(monthsToMonth(Month.jan, Month.apr) == 3);
assert(monthsToMonth(Month.jan, Month.may) == 4);
assert(monthsToMonth(Month.jan, Month.jun) == 5);
assert(monthsToMonth(Month.jan, Month.jul) == 6);
assert(monthsToMonth(Month.jan, Month.aug) == 7);
assert(monthsToMonth(Month.jan, Month.sep) == 8);
assert(monthsToMonth(Month.jan, Month.oct) == 9);
assert(monthsToMonth(Month.jan, Month.nov) == 10);
assert(monthsToMonth(Month.jan, Month.dec) == 11);
assert(monthsToMonth(Month.may, Month.jan) == 8);
assert(monthsToMonth(Month.may, Month.feb) == 9);
assert(monthsToMonth(Month.may, Month.mar) == 10);
assert(monthsToMonth(Month.may, Month.apr) == 11);
assert(monthsToMonth(Month.may, Month.may) == 0);
assert(monthsToMonth(Month.may, Month.jun) == 1);
assert(monthsToMonth(Month.may, Month.jul) == 2);
assert(monthsToMonth(Month.may, Month.aug) == 3);
assert(monthsToMonth(Month.may, Month.sep) == 4);
assert(monthsToMonth(Month.may, Month.oct) == 5);
assert(monthsToMonth(Month.may, Month.nov) == 6);
assert(monthsToMonth(Month.may, Month.dec) == 7);
assert(monthsToMonth(Month.oct, Month.jan) == 3);
assert(monthsToMonth(Month.oct, Month.feb) == 4);
assert(monthsToMonth(Month.oct, Month.mar) == 5);
assert(monthsToMonth(Month.oct, Month.apr) == 6);
assert(monthsToMonth(Month.oct, Month.may) == 7);
assert(monthsToMonth(Month.oct, Month.jun) == 8);
assert(monthsToMonth(Month.oct, Month.jul) == 9);
assert(monthsToMonth(Month.oct, Month.aug) == 10);
assert(monthsToMonth(Month.oct, Month.sep) == 11);
assert(monthsToMonth(Month.oct, Month.oct) == 0);
assert(monthsToMonth(Month.oct, Month.nov) == 1);
assert(monthsToMonth(Month.oct, Month.dec) == 2);
assert(monthsToMonth(Month.dec, Month.jan) == 1);
assert(monthsToMonth(Month.dec, Month.feb) == 2);
assert(monthsToMonth(Month.dec, Month.mar) == 3);
assert(monthsToMonth(Month.dec, Month.apr) == 4);
assert(monthsToMonth(Month.dec, Month.may) == 5);
assert(monthsToMonth(Month.dec, Month.jun) == 6);
assert(monthsToMonth(Month.dec, Month.jul) == 7);
assert(monthsToMonth(Month.dec, Month.aug) == 8);
assert(monthsToMonth(Month.dec, Month.sep) == 9);
assert(monthsToMonth(Month.dec, Month.oct) == 10);
assert(monthsToMonth(Month.dec, Month.nov) == 11);
assert(monthsToMonth(Month.dec, Month.dec) == 0);
}
/++
Returns the number of days from the current day of the week to the given
day of the week. If they are the same, then the result is 0.
Params:
currDoW = The current day of the week.
dow = The day of the week to get the number of days to.
+/
static int daysToDayOfWeek(DayOfWeek currDoW, DayOfWeek dow) @safe pure nothrow
{
if(currDoW == dow)
return 0;
if(currDoW < dow)
return dow - currDoW;
return (DayOfWeek.sat - currDoW) + dow + 1;
}
unittest
{
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.sun) == 0);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.mon) == 1);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.tue) == 2);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.wed) == 3);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.thu) == 4);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.fri) == 5);
assert(daysToDayOfWeek(DayOfWeek.sun, DayOfWeek.sat) == 6);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.sun) == 6);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.mon) == 0);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.tue) == 1);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.wed) == 2);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.thu) == 3);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.fri) == 4);
assert(daysToDayOfWeek(DayOfWeek.mon, DayOfWeek.sat) == 5);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.sun) == 5);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.mon) == 6);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.tue) == 0);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.wed) == 1);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.thu) == 2);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.fri) == 3);
assert(daysToDayOfWeek(DayOfWeek.tue, DayOfWeek.sat) == 4);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.sun) == 4);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.mon) == 5);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.tue) == 6);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.wed) == 0);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.thu) == 1);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.fri) == 2);
assert(daysToDayOfWeek(DayOfWeek.wed, DayOfWeek.sat) == 3);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.sun) == 3);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.mon) == 4);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.tue) == 5);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.wed) == 6);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.thu) == 0);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.fri) == 1);
assert(daysToDayOfWeek(DayOfWeek.thu, DayOfWeek.sat) == 2);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.sun) == 2);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.mon) == 3);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.tue) == 4);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.wed) == 5);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.thu) == 6);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.fri) == 0);
assert(daysToDayOfWeek(DayOfWeek.fri, DayOfWeek.sat) == 1);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.sun) == 1);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.mon) == 2);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.tue) == 3);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.wed) == 4);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.thu) == 5);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.fri) == 6);
assert(daysToDayOfWeek(DayOfWeek.sat, DayOfWeek.sat) == 0);
}
version(StdDdoc)
{
/++
Function for starting to a stop watch time when the function is called
and stopping it when its return value goes out of scope and is destroyed.
When the value that is returned by this function is destroyed,
$(D func) will run. $(D func) is a unary function that takes a
$(CXREF time, TickDuration).
Examples:
--------------------
{
auto mt = measureTime!((TickDuration a)
{ /+ do something when the scope is exited +/ });
// do something that needs to be timed
}
--------------------
which is functionally equivalent to
--------------------
{
auto sw = StopWatch(AutoStart.yes);
scope(exit)
{
TickDuration a = sw.peek();
/+ do something when the scope is exited +/
}
// do something that needs to be timed
}
--------------------
See_Also:
$(LREF benchmark)
+/
auto measureTime(alias func)();
}
else
{
@safe auto measureTime(alias func)()
if(isSafe!((){StopWatch sw; unaryFun!func(sw.peek());}))
{
struct Result
{
private StopWatch _sw = void;
this(AutoStart as)
{
_sw = StopWatch(as);
}
~this()
{
unaryFun!(func)(_sw.peek());
}
}
return Result(AutoStart.yes);
}
auto measureTime(alias func)()
if(!isSafe!((){StopWatch sw; unaryFun!func(sw.peek());}))
{
struct Result
{
private StopWatch _sw = void;
this(AutoStart as)
{
_sw = StopWatch(as);
}
~this()
{
unaryFun!(func)(_sw.peek());
}
}
return Result(AutoStart.yes);
}
}
// Verify Example.
unittest
{
{
auto mt = measureTime!((TickDuration a)
{ /+ do something when the scope is exited +/ });
// do something that needs to be timed
}
{
auto sw = StopWatch(AutoStart.yes);
scope(exit)
{
TickDuration a = sw.peek();
/+ do something when the scope is exited +/
}
// do something that needs to be timed
}
}
@safe unittest
{
import std.math : isNaN;
@safe static void func(TickDuration td)
{
assert(!td.to!("seconds", real)().isNaN());
}
auto mt = measureTime!(func)();
/+
with (measureTime!((a){assert(a.seconds);}))
{
// doSomething();
// @@@BUG@@@ doesn't work yet.
}
+/
}
unittest
{
import std.math : isNaN;
static void func(TickDuration td)
{
assert(!td.to!("seconds", real)().isNaN());
}
auto mt = measureTime!(func)();
/+
with (measureTime!((a){assert(a.seconds);}))
{
// doSomething();
// @@@BUG@@@ doesn't work yet.
}
+/
}
//Bug# 8450
unittest
{
@safe void safeFunc() {}
@trusted void trustFunc() {}
@system void sysFunc() {}
auto safeResult = measureTime!((a){safeFunc();})();
auto trustResult = measureTime!((a){trustFunc();})();
auto sysResult = measureTime!((a){sysFunc();})();
}
//==============================================================================
// Private Section.
//==============================================================================
private:
//==============================================================================
// Section with private enums and constants.
//==============================================================================
enum daysInYear = 365; // The number of days in a non-leap year.
enum daysInLeapYear = 366; // The numbef or days in a leap year.
enum daysIn4Years = daysInYear * 3 + daysInLeapYear; /// Number of days in 4 years.
enum daysIn100Years = daysIn4Years * 25 - 1; // The number of days in 100 years.
enum daysIn400Years = daysIn100Years * 4 + 1; // The number of days in 400 years.
/+
Array of integers representing the last days of each month in a year.
+/
immutable int[13] lastDayNonLeap = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
/+
Array of integers representing the last days of each month in a leap year.
+/
immutable int[13] lastDayLeap = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];
/+
Array of the short (three letter) names of each month.
+/
immutable string[12] _monthNames = ["Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"];
//==============================================================================
// Section with private helper functions and templates.
//==============================================================================
/+
Template to help with converting between time units.
+/
template hnsecsPer(string units)
if(CmpTimeUnits!(units, "months") < 0)
{
static if(units == "hnsecs")
enum hnsecsPer = 1L;
else static if(units == "usecs")
enum hnsecsPer = 10L;
else static if(units == "msecs")
enum hnsecsPer = 1000 * hnsecsPer!"usecs";
else static if(units == "seconds")
enum hnsecsPer = 1000 * hnsecsPer!"msecs";
else static if(units == "minutes")
enum hnsecsPer = 60 * hnsecsPer!"seconds";
else static if(units == "hours")
enum hnsecsPer = 60 * hnsecsPer!"minutes";
else static if(units == "days")
enum hnsecsPer = 24 * hnsecsPer!"hours";
else static if(units == "weeks")
enum hnsecsPer = 7 * hnsecsPer!"days";
}
/+
Splits out a particular unit from hnsecs and gives the value for that
unit and the remaining hnsecs. It really shouldn't be used unless unless
all units larger than the given units have already been split out.
Params:
units = The units to split out.
hnsecs = The current total hnsecs. Upon returning, it is the hnsecs left
after splitting out the given units.
Returns:
The number of the given units from converting hnsecs to those units.
+/
long splitUnitsFromHNSecs(string units)(ref long hnsecs) @safe pure nothrow
if(validTimeUnits(units) &&
CmpTimeUnits!(units, "months") < 0)
{
immutable value = convert!("hnsecs", units)(hnsecs);
hnsecs -= convert!(units, "hnsecs")(value);
return value;
}
unittest
{
auto hnsecs = 2595000000007L;
immutable days = splitUnitsFromHNSecs!"days"(hnsecs);
assert(days == 3);
assert(hnsecs == 3000000007);
immutable minutes = splitUnitsFromHNSecs!"minutes"(hnsecs);
assert(minutes == 5);
assert(hnsecs == 7);
}
/+
This function is used to split out the units without getting the remaining
hnsecs.
See_Also:
$(LREF splitUnitsFromHNSecs)
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);
}
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.
See_Also:
$(LREF splitUnitsFromHNSecs)
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);
}
unittest
{
auto hnsecs = 2595000000007L;
auto returned = removeUnitsFromHNSecs!"days"(hnsecs);
assert(returned == 3000000007);
assert(hnsecs == 2595000000007L);
}
/+
The maximum valid Day in the given month in the given year.
Params:
year = The year to get the day for.
month = The month of the Gregorian Calendar to get the day for.
+/
static ubyte maxDay(int year, int month) @safe pure nothrow
in
{
assert(valid!"months"(month));
}
body
{
switch(month)
{
case Month.jan, Month.mar, Month.may, Month.jul, Month.aug, Month.oct, Month.dec:
return 31;
case Month.feb:
return yearIsLeapYear(year) ? 29 : 28;
case Month.apr, Month.jun, Month.sep, Month.nov:
return 30;
default:
assert(0, "Invalid month.");
}
}
unittest
{
//Test A.D.
assert(maxDay(1999, 1) == 31);
assert(maxDay(1999, 2) == 28);
assert(maxDay(1999, 3) == 31);
assert(maxDay(1999, 4) == 30);
assert(maxDay(1999, 5) == 31);
assert(maxDay(1999, 6) == 30);
assert(maxDay(1999, 7) == 31);
assert(maxDay(1999, 8) == 31);
assert(maxDay(1999, 9) == 30);
assert(maxDay(1999, 10) == 31);
assert(maxDay(1999, 11) == 30);
assert(maxDay(1999, 12) == 31);
assert(maxDay(2000, 1) == 31);
assert(maxDay(2000, 2) == 29);
assert(maxDay(2000, 3) == 31);
assert(maxDay(2000, 4) == 30);
assert(maxDay(2000, 5) == 31);
assert(maxDay(2000, 6) == 30);
assert(maxDay(2000, 7) == 31);
assert(maxDay(2000, 8) == 31);
assert(maxDay(2000, 9) == 30);
assert(maxDay(2000, 10) == 31);
assert(maxDay(2000, 11) == 30);
assert(maxDay(2000, 12) == 31);
//Test B.C.
assert(maxDay(-1999, 1) == 31);
assert(maxDay(-1999, 2) == 28);
assert(maxDay(-1999, 3) == 31);
assert(maxDay(-1999, 4) == 30);
assert(maxDay(-1999, 5) == 31);
assert(maxDay(-1999, 6) == 30);
assert(maxDay(-1999, 7) == 31);
assert(maxDay(-1999, 8) == 31);
assert(maxDay(-1999, 9) == 30);
assert(maxDay(-1999, 10) == 31);
assert(maxDay(-1999, 11) == 30);
assert(maxDay(-1999, 12) == 31);
assert(maxDay(-2000, 1) == 31);
assert(maxDay(-2000, 2) == 29);
assert(maxDay(-2000, 3) == 31);
assert(maxDay(-2000, 4) == 30);
assert(maxDay(-2000, 5) == 31);
assert(maxDay(-2000, 6) == 30);
assert(maxDay(-2000, 7) == 31);
assert(maxDay(-2000, 8) == 31);
assert(maxDay(-2000, 9) == 30);
assert(maxDay(-2000, 10) == 31);
assert(maxDay(-2000, 11) == 30);
assert(maxDay(-2000, 12) == 31);
}
/+
Returns the day of the week for the given day of the Gregorian Calendar.
Params:
day = The day of the Gregorian Calendar for which to get the day of
the week.
+/
DayOfWeek getDayOfWeek(int day) @safe pure nothrow
{
//January 1st, 1 A.D. was a Monday
if(day >= 0)
return cast(DayOfWeek)(day % 7);
else
{
immutable dow = cast(DayOfWeek)((day % 7) + 7);
if(dow == 7)
return DayOfWeek.sun;
else
return dow;
}
}
unittest
{
//Test A.D.
assert(getDayOfWeek(SysTime(Date(1, 1, 1)).dayOfGregorianCal) == DayOfWeek.mon);
assert(getDayOfWeek(SysTime(Date(1, 1, 2)).dayOfGregorianCal) == DayOfWeek.tue);
assert(getDayOfWeek(SysTime(Date(1, 1, 3)).dayOfGregorianCal) == DayOfWeek.wed);
assert(getDayOfWeek(SysTime(Date(1, 1, 4)).dayOfGregorianCal) == DayOfWeek.thu);
assert(getDayOfWeek(SysTime(Date(1, 1, 5)).dayOfGregorianCal) == DayOfWeek.fri);
assert(getDayOfWeek(SysTime(Date(1, 1, 6)).dayOfGregorianCal) == DayOfWeek.sat);
assert(getDayOfWeek(SysTime(Date(1, 1, 7)).dayOfGregorianCal) == DayOfWeek.sun);
assert(getDayOfWeek(SysTime(Date(1, 1, 8)).dayOfGregorianCal) == DayOfWeek.mon);
assert(getDayOfWeek(SysTime(Date(1, 1, 9)).dayOfGregorianCal) == DayOfWeek.tue);
assert(getDayOfWeek(SysTime(Date(2, 1, 1)).dayOfGregorianCal) == DayOfWeek.tue);
assert(getDayOfWeek(SysTime(Date(3, 1, 1)).dayOfGregorianCal) == DayOfWeek.wed);
assert(getDayOfWeek(SysTime(Date(4, 1, 1)).dayOfGregorianCal) == DayOfWeek.thu);
assert(getDayOfWeek(SysTime(Date(5, 1, 1)).dayOfGregorianCal) == DayOfWeek.sat);
assert(getDayOfWeek(SysTime(Date(2000, 1, 1)).dayOfGregorianCal) == DayOfWeek.sat);
assert(getDayOfWeek(SysTime(Date(2010, 8, 22)).dayOfGregorianCal) == DayOfWeek.sun);
assert(getDayOfWeek(SysTime(Date(2010, 8, 23)).dayOfGregorianCal) == DayOfWeek.mon);
assert(getDayOfWeek(SysTime(Date(2010, 8, 24)).dayOfGregorianCal) == DayOfWeek.tue);
assert(getDayOfWeek(SysTime(Date(2010, 8, 25)).dayOfGregorianCal) == DayOfWeek.wed);
assert(getDayOfWeek(SysTime(Date(2010, 8, 26)).dayOfGregorianCal) == DayOfWeek.thu);
assert(getDayOfWeek(SysTime(Date(2010, 8, 27)).dayOfGregorianCal) == DayOfWeek.fri);
assert(getDayOfWeek(SysTime(Date(2010, 8, 28)).dayOfGregorianCal) == DayOfWeek.sat);
assert(getDayOfWeek(SysTime(Date(2010, 8, 29)).dayOfGregorianCal) == DayOfWeek.sun);
//Test B.C.
assert(getDayOfWeek(SysTime(Date(0, 12, 31)).dayOfGregorianCal) == DayOfWeek.sun);
assert(getDayOfWeek(SysTime(Date(0, 12, 30)).dayOfGregorianCal) == DayOfWeek.sat);
assert(getDayOfWeek(SysTime(Date(0, 12, 29)).dayOfGregorianCal) == DayOfWeek.fri);
assert(getDayOfWeek(SysTime(Date(0, 12, 28)).dayOfGregorianCal) == DayOfWeek.thu);
assert(getDayOfWeek(SysTime(Date(0, 12, 27)).dayOfGregorianCal) == DayOfWeek.wed);
assert(getDayOfWeek(SysTime(Date(0, 12, 26)).dayOfGregorianCal) == DayOfWeek.tue);
assert(getDayOfWeek(SysTime(Date(0, 12, 25)).dayOfGregorianCal) == DayOfWeek.mon);
assert(getDayOfWeek(SysTime(Date(0, 12, 24)).dayOfGregorianCal) == DayOfWeek.sun);
assert(getDayOfWeek(SysTime(Date(0, 12, 23)).dayOfGregorianCal) == DayOfWeek.sat);
}
/+
Returns the string representation of the given month.
+/
string monthToString(Month month) @safe pure
{
import std.format : format;
assert(month >= Month.jan && month <= Month.dec, format("Invalid month: %s", month));
return _monthNames[month - Month.jan];
}
unittest
{
assert(monthToString(Month.jan) == "Jan");
assert(monthToString(Month.feb) == "Feb");
assert(monthToString(Month.mar) == "Mar");
assert(monthToString(Month.apr) == "Apr");
assert(monthToString(Month.may) == "May");
assert(monthToString(Month.jun) == "Jun");
assert(monthToString(Month.jul) == "Jul");
assert(monthToString(Month.aug) == "Aug");
assert(monthToString(Month.sep) == "Sep");
assert(monthToString(Month.oct) == "Oct");
assert(monthToString(Month.nov) == "Nov");
assert(monthToString(Month.dec) == "Dec");
}
/+
Returns the Month corresponding to the given string.
Params:
monthStr = The string representation of the month to get the Month for.
Throws:
$(LREF DateTimeException) if the given month is not a valid month string.
+/
Month monthFromString(string monthStr) @safe pure
{
import std.format : format;
switch(monthStr)
{
case "Jan":
return Month.jan;
case "Feb":
return Month.feb;
case "Mar":
return Month.mar;
case "Apr":
return Month.apr;
case "May":
return Month.may;
case "Jun":
return Month.jun;
case "Jul":
return Month.jul;
case "Aug":
return Month.aug;
case "Sep":
return Month.sep;
case "Oct":
return Month.oct;
case "Nov":
return Month.nov;
case "Dec":
return Month.dec;
default:
throw new DateTimeException(format("Invalid month %s", monthStr));
}
}
unittest
{
foreach(badStr; ["Ja", "Janu", "Januar", "Januarys", "JJanuary", "JANUARY",
"JAN", "january", "jaNuary", "jaN", "jaNuaRy", "jAn"])
{
scope(failure) writeln(badStr);
assertThrown!DateTimeException(monthFromString(badStr));
}
foreach(month; EnumMembers!Month)
{
scope(failure) writeln(month);
assert(monthFromString(monthToString(month)) == month);
}
}
/+
The time units which are one step smaller than the given units.
+/
template nextSmallerTimeUnits(string units)
if(validTimeUnits(units) &&
timeStrings.front != units)
{
import std.algorithm : countUntil;
enum nextSmallerTimeUnits = timeStrings[countUntil(timeStrings, units) - 1];
}
unittest
{
assert(nextSmallerTimeUnits!"years" == "months");
assert(nextSmallerTimeUnits!"months" == "weeks");
assert(nextSmallerTimeUnits!"weeks" == "days");
assert(nextSmallerTimeUnits!"days" == "hours");
assert(nextSmallerTimeUnits!"hours" == "minutes");
assert(nextSmallerTimeUnits!"minutes" == "seconds");
assert(nextSmallerTimeUnits!"seconds" == "msecs");
assert(nextSmallerTimeUnits!"msecs" == "usecs");
assert(nextSmallerTimeUnits!"usecs" == "hnsecs");
static assert(!__traits(compiles, nextSmallerTimeUnits!"hnsecs"));
}
/+
The time units which are one step larger than the given units.
+/
template nextLargerTimeUnits(string units)
if(validTimeUnits(units) &&
timeStrings.back != units)
{
import std.algorithm : countUntil;
enum nextLargerTimeUnits = timeStrings[countUntil(timeStrings, units) + 1];
}
unittest
{
assert(nextLargerTimeUnits!"hnsecs" == "usecs");
assert(nextLargerTimeUnits!"usecs" == "msecs");
assert(nextLargerTimeUnits!"msecs" == "seconds");
assert(nextLargerTimeUnits!"seconds" == "minutes");
assert(nextLargerTimeUnits!"minutes" == "hours");
assert(nextLargerTimeUnits!"hours" == "days");
assert(nextLargerTimeUnits!"days" == "weeks");
assert(nextLargerTimeUnits!"weeks" == "months");
assert(nextLargerTimeUnits!"months" == "years");
static assert(!__traits(compiles, nextLargerTimeUnits!"years"));
}
/+
Returns the given hnsecs as an ISO string of fractional seconds.
+/
static string fracSecsToISOString(int hnsecs) @safe pure nothrow
{
import std.format : format;
assert(hnsecs >= 0);
try
{
if(hnsecs == 0)
return "";
string isoString = format(".%07d", hnsecs);
while(isoString[$ - 1] == '0')
isoString.popBack();
return isoString;
}
catch(Exception e)
assert(0, "format() threw.");
}
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.ascii : isDigit;
import std.string : representation;
import std.conv : to;
import std.algorithm : all;
if(isoString.empty)
return Duration.zero;
auto str = isoString.representation;
enforce(str[0] == '.', new DateTimeException("Invalid ISO String"));
str.popFront();
enforce(!str.empty && str.length <= 7, new DateTimeException("Invalid ISO String"));
enforce(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[]));
}
unittest
{
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(".00000000"));
assertThrown!DateTimeException(testFSInvalid(".00000001"));
assertThrown!DateTimeException(testFSInvalid("T"));
assertThrown!DateTimeException(testFSInvalid("T."));
assertThrown!DateTimeException(testFSInvalid(".T"));
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));
}
/+
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];
}
unittest
{
import std.algorithm;
import std.string;
import std.typecons;
import std.typetuple;
foreach(cr; TypeTuple!(function(string a){return cast(ubyte[])a;},
function(string a){return map!(b => cast(char)b)(a.representation);}))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
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(!std.ascii.isDigit(str[i]))
return -1;
num += str[i] - '0';
}
return num;
}
unittest
{
import std.conv : to;
import std.range;
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);
}
}
/+
Whether the given type defines the static property min which returns the
minimum value for the type.
+/
template hasMin(T)
{
enum hasMin = __traits(hasMember, T, "min") &&
__traits(isStaticFunction, T.min) &&
is(typeof(T.min) == Unqual!T);
}
unittest
{
static assert(hasMin!(Date));
static assert(hasMin!(TimeOfDay));
static assert(hasMin!(DateTime));
static assert(hasMin!(SysTime));
static assert(hasMin!(const Date));
static assert(hasMin!(const TimeOfDay));
static assert(hasMin!(const DateTime));
static assert(hasMin!(const SysTime));
static assert(hasMin!(immutable Date));
static assert(hasMin!(immutable TimeOfDay));
static assert(hasMin!(immutable SysTime));
}
/+
Whether the given type defines the static property max which returns the
maximum value for the type.
+/
template hasMax(T)
{
enum hasMax = __traits(hasMember, T, "max") &&
__traits(isStaticFunction, T.max) &&
is(typeof(T.max) == Unqual!T);
}
unittest
{
static assert(hasMax!(Date));
static assert(hasMax!(TimeOfDay));
static assert(hasMax!(DateTime));
static assert(hasMax!(SysTime));
static assert(hasMax!(const Date));
static assert(hasMax!(const TimeOfDay));
static assert(hasMax!(const DateTime));
static assert(hasMax!(const SysTime));
static assert(hasMax!(immutable Date));
static assert(hasMax!(immutable TimeOfDay));
static assert(hasMax!(immutable DateTime));
static assert(hasMax!(immutable SysTime));
}
/+
Whether the given type defines the overloaded opBinary operators that a time
point is supposed to define which work with time durations. Namely:
$(BOOKTABLE,
$(TR $(TD TimePoint opBinary"+"(duration)))
$(TR $(TD TimePoint opBinary"-"(duration)))
)
+/
template hasOverloadedOpBinaryWithDuration(T)
{
enum hasOverloadedOpBinaryWithDuration = __traits(compiles, T.init + dur!"days"(5)) &&
is(typeof(T.init + dur!"days"(5)) == Unqual!T) &&
__traits(compiles, T.init - dur!"days"(5)) &&
is(typeof(T.init - dur!"days"(5)) == Unqual!T) &&
__traits(compiles, T.init + TickDuration.from!"hnsecs"(5)) &&
is(typeof(T.init + TickDuration.from!"hnsecs"(5)) == Unqual!T) &&
__traits(compiles, T.init - TickDuration.from!"hnsecs"(5)) &&
is(typeof(T.init - TickDuration.from!"hnsecs"(5)) == Unqual!T);
}
unittest
{
static assert(hasOverloadedOpBinaryWithDuration!(Date));
static assert(hasOverloadedOpBinaryWithDuration!(TimeOfDay));
static assert(hasOverloadedOpBinaryWithDuration!(DateTime));
static assert(hasOverloadedOpBinaryWithDuration!(SysTime));
static assert(hasOverloadedOpBinaryWithDuration!(const Date));
static assert(hasOverloadedOpBinaryWithDuration!(const TimeOfDay));
static assert(hasOverloadedOpBinaryWithDuration!(const DateTime));
static assert(hasOverloadedOpBinaryWithDuration!(const SysTime));
static assert(hasOverloadedOpBinaryWithDuration!(immutable Date));
static assert(hasOverloadedOpBinaryWithDuration!(immutable TimeOfDay));
static assert(hasOverloadedOpBinaryWithDuration!(immutable DateTime));
static assert(hasOverloadedOpBinaryWithDuration!(immutable SysTime));
}
/+
Whether the given type defines the overloaded opOpAssign operators that a time point is supposed
to define. Namely:
$(BOOKTABLE,
$(TR $(TD TimePoint opOpAssign"+"(duration)))
$(TR $(TD TimePoint opOpAssign"-"(duration)))
)
+/
template hasOverloadedOpAssignWithDuration(T)
{
enum hasOverloadedOpAssignWithDuration = is(typeof(
{
auto d = dur!"days"(5);
auto td = TickDuration.from!"hnsecs"(5);
alias U = Unqual!T;
static assert(is(typeof(U.init += d) == U));
static assert(is(typeof(U.init -= d) == U));
static assert(is(typeof(U.init += td) == U));
static assert(is(typeof(U.init -= td) == U));
}));
}
unittest
{
static assert(hasOverloadedOpAssignWithDuration!(Date));
static assert(hasOverloadedOpAssignWithDuration!(TimeOfDay));
static assert(hasOverloadedOpAssignWithDuration!(DateTime));
static assert(hasOverloadedOpAssignWithDuration!(SysTime));
static assert(hasOverloadedOpAssignWithDuration!(const Date));
static assert(hasOverloadedOpAssignWithDuration!(const TimeOfDay));
static assert(hasOverloadedOpAssignWithDuration!(const DateTime));
static assert(hasOverloadedOpAssignWithDuration!(const SysTime));
static assert(hasOverloadedOpAssignWithDuration!(immutable Date));
static assert(hasOverloadedOpAssignWithDuration!(immutable TimeOfDay));
static assert(hasOverloadedOpAssignWithDuration!(immutable DateTime));
static assert(hasOverloadedOpAssignWithDuration!(immutable SysTime));
}
/+
Whether the given type defines the overloaded opBinary operator that a time point is supposed
to define which works with itself. Namely:
$(BOOKTABLE,
$(TR $(TD duration opBinary"-"(Date)))
)
+/
template hasOverloadedOpBinaryWithSelf(T)
{
enum hasOverloadedOpBinaryWithSelf = __traits(compiles, T.init - T.init) &&
is(Unqual!(typeof(T.init - T.init)) == Duration);
}
unittest
{
static assert(hasOverloadedOpBinaryWithSelf!(Date));
static assert(hasOverloadedOpBinaryWithSelf!(TimeOfDay));
static assert(hasOverloadedOpBinaryWithSelf!(DateTime));
static assert(hasOverloadedOpBinaryWithSelf!(SysTime));
static assert(hasOverloadedOpBinaryWithSelf!(const Date));
static assert(hasOverloadedOpBinaryWithSelf!(const TimeOfDay));
static assert(hasOverloadedOpBinaryWithSelf!(const DateTime));
static assert(hasOverloadedOpBinaryWithSelf!(const SysTime));
static assert(hasOverloadedOpBinaryWithSelf!(immutable Date));
static assert(hasOverloadedOpBinaryWithSelf!(immutable TimeOfDay));
static assert(hasOverloadedOpBinaryWithSelf!(immutable DateTime));
static assert(hasOverloadedOpBinaryWithSelf!(immutable SysTime));
}
version(unittest)
{
import std.typecons;
import std.algorithm;
//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()
{
immutable lt = LocalTime().utcToTZ(0);
currLocalDiffFromUTC = dur!"hnsecs"(lt);
immutable otherTZ = lt < 0 ? TimeZone.getTimeZone("Australia/Sydney")
: TimeZone.getTimeZone("America/Denver");
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(9999999)];
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);
}
}
}
}
unittest
{
/* Issue 6642 */
static assert(!hasUnsharedAliasing!Date);
static assert(!hasUnsharedAliasing!TimeOfDay);
static assert(!hasUnsharedAliasing!DateTime);
static assert(!hasUnsharedAliasing!SysTime);
}
// This script is for regenerating tzDatabaseNameToWindowsTZName and
// windowsTZNameToTZDatabaseName from
// http://unicode.org/cldr/data/common/supplemental/windowsZones.xml
/+
#!/bin/rdmd
import std.algorithm;
import std.array;
import std.conv;
import std.datetime;
import std.exception;
import std.path;
import std.stdio;
import std.string;
int main(string[] args)
{
if(args.length != 4 || args[1].baseName != "windowsZones.xml")
{
stderr.writeln("genTZs.d windowsZones.xml <nix2WinFile> <win2NixFile>");
return -1;
}
string[][string] win2Nix;
string[][string] nix2Win;
immutable f1 = `<mapZone other="`;
immutable f2 = `type="`;
auto file = File(args[1]);
foreach(line; file.byLine())
{
line = line.find(f1);
if(line.empty)
continue;
line = line[f1.length .. $];
auto next = line.find('"');
auto win = to!string(line[0 .. $ - next.length]);
line = next.find(f2);
line = line[f2.length .. $];
next = line.find('"');
auto nixes = to!string(line[0 .. $ - next.length]).split();
if(auto l = win in win2Nix)
*l ~= nixes;
else
win2Nix[win] = nixes;
foreach(nix; nixes)
{
if(auto w = nix in nix2Win)
*w ~= win;
else
nix2Win[nix] = [win];
}
}
foreach(nix; nix2Win.byKey())
{
auto wins = nix2Win[nix];
nix2Win[nix] = wins.sort().uniq().array();
}
foreach(win; win2Nix.byKey())
{
auto nixes = win2Nix[win];
win2Nix[win] = nixes.sort().uniq().array();
}
// AFAIK, there should be no cases of a TZ Database time zone converting to
// multiple windows time zones.
foreach(nix, wins; nix2Win)
enforce(wins.length == 1, format("%s -> %s", nix, wins));
// We'll try to eliminate multiples by favoring a conversion if it's already
// in Phobos, but if it's new, then the correct one will have to be chosen
// manually from the results.
string[] haveMultiple;
foreach(win, nixes; win2Nix)
{
if(nixes.length > 1)
haveMultiple ~= win;
}
bool[string] haveConflicts;
foreach(win; haveMultiple)
{
if(auto curr = windowsTZNameToTZDatabaseName(win))
{
if(auto other = curr in nix2Win)
{
if((*other)[0] == win)
{
win2Nix[win] = [curr];
continue;
}
}
}
haveConflicts[win] = true;
writefln("Warning: %s -> %s", win, win2Nix[win]);
}
string[] nix2WinLines = [
`string tzDatabaseNameToWindowsTZName(string tzName) @safe pure nothrow @nogc`,
`{`,
` switch(tzName)`,
` {`];
foreach(nix; nix2Win.keys.sort())
nix2WinLines ~= format(` case "%s": return "%s";`, nix, nix2Win[nix][0]);
nix2WinLines ~= [
` default: return null;`,
` }`,
`}`];
string[] win2NixLines = [
`string windowsTZNameToTZDatabaseName(string tzName) @safe pure nothrow @nogc`,
`{`,
` switch(tzName)`,
` {`];
foreach(win; win2Nix.keys.sort())
{
immutable hasMultiple = cast(bool)(win in haveConflicts);
foreach(nix; win2Nix[win])
win2NixLines ~= format(` case "%s": return "%s";%s`, win, nix, hasMultiple ? " FIXME" : "");
}
win2NixLines ~= [
` default: return null;`,
` }`,
`}`];
auto nix2WinFile = args[2];
std.file.write(nix2WinFile, nix2WinLines.join("\n"));
auto win2NixFile = args[3];
std.file.write(win2NixFile, win2NixLines.join("\n"));
return 0;
}
+/
|
D
|
/Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/Objects-normal/x86_64/NestedDiff.o : /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Diff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/NestedExtendedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/NestedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/GenericPatch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedPatch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Diff+UIKit.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch+Sort.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/LinkedList.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch+Apply.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedPatch+Apply.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Differ/Differ-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/Objects-normal/x86_64/NestedDiff~partial.swiftmodule : /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Diff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/NestedExtendedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/NestedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/GenericPatch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedPatch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Diff+UIKit.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch+Sort.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/LinkedList.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch+Apply.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedPatch+Apply.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Differ/Differ-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/Objects-normal/x86_64/NestedDiff~partial.swiftdoc : /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Diff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/NestedExtendedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/NestedDiff.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/GenericPatch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedPatch.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Diff+UIKit.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch+Sort.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/LinkedList.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/Patch+Apply.swift /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Differ/Sources/Differ/ExtendedPatch+Apply.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Pods/Target\ Support\ Files/Differ/Differ-umbrella.h /Users/nikhilsridhar/Desktop/Dyce/DyceAppIOS/Build/Intermediates/Pods.build/Debug-iphonesimulator/Differ.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
module gui.widgetfeature;
import gui.event : Event;
import gui.widget : Widget;
import gui.style;
class WidgetFeature
{
EventUsed send(Event event, Widget widget) { return EventUsed.no; }
void update(Widget widget) {}
void draw(Widget widget) {}
}
public import gui.widgetfeature.boxrenderer;
public import gui.widgetfeature.dragger;
public import gui.widgetfeature.textrenderer;
public import gui.widgetfeature.windowdragger;
public import gui.widgetfeature.windowresizer;
public import gui.widgetfeature.ninegridrenderer;
|
D
|
/Users/Trupti/Desktop/Eva/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/EnumOperators.o : /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/FromJSON.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ToJSON.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Mappable.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ImmutableMappable.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformType.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformOf.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/URLTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DataTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DateTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ISO8601DateTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/EnumTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DateFormatterTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/HexColorTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DictionaryTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Map.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Mapper.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/MapError.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Operators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformOperators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/EnumOperators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/IntegerOperators.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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/Trupti/Desktop/Eva/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/Trupti/Desktop/Eva/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Trupti/Desktop/Eva/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/EnumOperators~partial.swiftmodule : /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/FromJSON.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ToJSON.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Mappable.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ImmutableMappable.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformType.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformOf.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/URLTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DataTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DateTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ISO8601DateTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/EnumTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DateFormatterTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/HexColorTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DictionaryTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Map.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Mapper.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/MapError.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Operators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformOperators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/EnumOperators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/IntegerOperators.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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/Trupti/Desktop/Eva/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/Trupti/Desktop/Eva/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/Trupti/Desktop/Eva/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/Objects-normal/x86_64/EnumOperators~partial.swiftdoc : /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/FromJSON.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ToJSON.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Mappable.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ImmutableMappable.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformType.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformOf.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/URLTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DataTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DateTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/ISO8601DateTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/EnumTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/NSDecimalNumberTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DateFormatterTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/HexColorTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/CustomDateFormatTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/DictionaryTransform.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Map.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Mapper.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/MapError.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/Operators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/TransformOperators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/EnumOperators.swift /Users/Trupti/Desktop/Eva/Pods/ObjectMapper/Sources/IntegerOperators.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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/Trupti/Desktop/Eva/Pods/Target\ Support\ Files/ObjectMapper/ObjectMapper-umbrella.h /Users/Trupti/Desktop/Eva/build/Pods.build/Debug-iphonesimulator/ObjectMapper.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/NewsDemo.build/Debug-iphonesimulator/NewsDemo.build/Objects-normal/x86_64/DetailView.o : /Users/Zhongli/Desktop/NewsDemo/NewsDemo/AppDelegate.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/ViewController.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/DetailView.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/FirstView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.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/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+GIF.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImage-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefresh-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+ForceDecode.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSImage+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIButton+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+HighlightedWebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageFrame.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSData+ImageContentType.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCacheConfig.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/NSBundle+MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIScrollView+MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIView+MJExtension.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIScrollView+MJExtension.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCacheOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloaderOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshStateHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshGifHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshNormalHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageGIFCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageImageIOCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageManager.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCodersManager.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImagePrefetcher.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCoderHelper.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackStateFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoStateFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackGifFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoGifFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackNormalFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoNormalFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+MultiFormat.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCompat.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshComponent.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshConst.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Modules/module.modulemap /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Modules/module.modulemap
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/NewsDemo.build/Debug-iphonesimulator/NewsDemo.build/Objects-normal/x86_64/DetailView~partial.swiftmodule : /Users/Zhongli/Desktop/NewsDemo/NewsDemo/AppDelegate.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/ViewController.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/DetailView.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/FirstView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.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/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+GIF.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImage-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefresh-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+ForceDecode.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSImage+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIButton+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+HighlightedWebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageFrame.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSData+ImageContentType.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCacheConfig.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/NSBundle+MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIScrollView+MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIView+MJExtension.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIScrollView+MJExtension.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCacheOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloaderOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshStateHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshGifHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshNormalHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageGIFCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageImageIOCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageManager.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCodersManager.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImagePrefetcher.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCoderHelper.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackStateFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoStateFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackGifFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoGifFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackNormalFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoNormalFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+MultiFormat.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCompat.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshComponent.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshConst.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Modules/module.modulemap /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Modules/module.modulemap
/Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Intermediates.noindex/NewsDemo.build/Debug-iphonesimulator/NewsDemo.build/Objects-normal/x86_64/DetailView~partial.swiftdoc : /Users/Zhongli/Desktop/NewsDemo/NewsDemo/AppDelegate.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/ViewController.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/DetailView.swift /Users/Zhongli/Desktop/NewsDemo/NewsDemo/FirstView.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/Alamofire.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/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+GIF.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImage-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefresh-umbrella.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+ForceDecode.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSImage+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIButton+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+WebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+HighlightedWebCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCache.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageFrame.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSData+ImageContentType.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCacheConfig.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/NSBundle+MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIScrollView+MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefresh.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIView+MJExtension.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/UIScrollView+MJExtension.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCacheOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloaderOperation.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshStateHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshGifHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshNormalHeader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloader.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageGIFCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageImageIOCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCoder.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageManager.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCodersManager.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImagePrefetcher.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCoderHelper.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackStateFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoStateFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackGifFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoGifFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshBackNormalFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoNormalFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshAutoFooter.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+MultiFormat.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCompat.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Headers/Alamofire-Swift.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshComponent.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Headers/MJRefreshConst.h /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Modules/module.modulemap /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap /Users/Zhongli/Desktop/NewsDemo/DerivedData/NewsDemo/Build/Products/Debug-iphonesimulator/MJRefresh/MJRefresh.framework/Modules/module.modulemap
|
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.variable.service.impl.persistence.entity.data.impl.MybatisVariableInstanceDataManager;
import std.array;
import hunt.collection;
import hunt.collection.HashMap;
import hunt.collection.List;
import hunt.collection.Map;
import hunt.collection.Set;
import hunt.collection.ArrayList;
import flow.common.db.AbstractDataManager;
//import flow.common.db.DbSqlSession;
import flow.common.db.SingleCachedEntityMatcher;
//import flow.common.persistence.cache.CachedEntityMatcher;
import flow.variable.service.impl.persistence.entity.VariableInstanceEntity;
import flow.variable.service.impl.persistence.entity.VariableInstanceEntityImpl;
import flow.variable.service.impl.persistence.entity.data.VariableInstanceDataManager;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceByExecutionIdMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceByScopeIdAndScopeTypeAndVariableNameMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceByScopeIdAndScopeTypeAndVariableNamesMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceByScopeIdAndScopeTypeMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceBySubScopeIdAndScopeTypeAndVariableNameMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceBySubScopeIdAndScopeTypeAndVariableNamesMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceBySubScopeIdAndScopeTypeMatcher;
//import flow.variable.service.impl.persistence.entity.data.impl.cachematcher.VariableInstanceByTaskIdMatcher;
import hunt.logging;
import hunt.entity;
import hunt.Exceptions;
import flow.common.AbstractEngineConfiguration;
import flow.common.persistence.entity.Entity;
import flow.common.interceptor.CommandContext;
import flow.common.api.DataManger;
import flow.common.context.Context;
import flow.engine.impl.util.CommandContextUtil;
/**
* @author Joram Barrez
*/
class MybatisVariableInstanceDataManager : EntityRepository!( VariableInstanceEntityImpl , string), VariableInstanceDataManager ,DataManger {
alias findById = CrudRepository!( VariableInstanceEntityImpl , string).findById;
alias insert = CrudRepository!( VariableInstanceEntityImpl , string).insert;
alias update = CrudRepository!( VariableInstanceEntityImpl , string).update;
//protected CachedEntityMatcher!VariableInstanceEntity variableInstanceByExecutionIdMatcher
// = new VariableInstanceByExecutionIdMatcher();
//
//protected CachedEntityMatcher!VariableInstanceEntity variableInstanceByTaskIdMatcher
// = new VariableInstanceByTaskIdMatcher();
//
//protected CachedEntityMatcher!VariableInstanceEntity variableInstanceByScopeIdAndScopeTypeMatcher
// = new VariableInstanceByScopeIdAndScopeTypeMatcher();
//protected SingleCachedEntityMatcher!VariableInstanceEntity variableInstanceByScopeIdAndScopeTypeAndVariableNameMatcher
// = new VariableInstanceByScopeIdAndScopeTypeAndVariableNameMatcher();
//protected CachedEntityMatcher!VariableInstanceEntity variableInstanceByScopeIdAndScopeTypeAndVariableNamesMatcher
// = new VariableInstanceByScopeIdAndScopeTypeAndVariableNamesMatcher();
//
//protected CachedEntityMatcher!VariableInstanceEntity variableInstanceBySubScopeIdAndScopeTypeMatcher
// = new VariableInstanceBySubScopeIdAndScopeTypeMatcher();
//protected SingleCachedEntityMatcher!VariableInstanceEntity variableInstanceBySubScopeIdAndScopeTypeAndVariableNameMatcher
// = new VariableInstanceBySubScopeIdAndScopeTypeAndVariableNameMatcher();
//protected CachedEntityMatcher!VariableInstanceEntity variableInstanceBySubScopeIdAndScopeTypeAndVariableNamesMatcher
// = new VariableInstanceBySubScopeIdAndScopeTypeAndVariableNamesMatcher();
//
//
//public Class<? extends VariableInstanceEntity> getManagedEntityClass() {
// return VariableInstanceEntityImpl.class;
//}
TypeInfo getTypeInfo()
{
return typeid(MybatisVariableInstanceDataManager);
}
this()
{
super(entityManagerFactory.currentEntityManager());
}
public VariableInstanceEntity findById(string entityId) {
if (entityId is null) {
return null;
}
//return find(entityId);
auto entity = CommandContextUtil.getEntityCache().findInCache(typeid(VariableInstanceEntityImpl),entityId);
if (entity !is null)
{
return cast(VariableInstanceEntity)entity;
}
VariableInstanceEntity dbData = cast(VariableInstanceEntity)(find(entityId));
if (dbData !is null)
{
CommandContextUtil.getEntityCache().put(dbData, true , typeid(VariableInstanceEntityImpl), this);
}
return dbData;
//if (entityId is null) {
// return null;
//}
//
//return find(entityId);
// Cache
//EntityImpl cachedEntity = getEntityCache().findInCache(getManagedEntityClass(), entityId);
//if (cachedEntity !is null) {
// return cachedEntity;
//}
// Database
//return getDbSqlSession().selectById(getManagedEntityClass(), entityId, false);
}
//
public void insert(VariableInstanceEntity entity) {
//insert(cast(VariableInstanceEntityImpl)entity);
//getDbSqlSession().insert(entity);
if (entity.getId() is null)
{
string id = Context.getCommandContext().getCurrentEngineConfiguration().getIdGenerator().getNextId();
//if (dbSqlSessionFactory.isUsePrefixId()) {
// id = entity.getIdPrefix() + id;
//}
entity.setId(id);
}
entity.setInserted(true);
insertJob[entity] = this;
CommandContextUtil.getEntityCache().put(entity, false, typeid(VariableInstanceEntityImpl), this);
}
public void insertTrans(Entity entity , EntityManager db)
{
//auto em = _manager ? _manager : createEntityManager;
VariableInstanceEntityImpl tmp = cast(VariableInstanceEntityImpl)entity;
db.persist!VariableInstanceEntityImpl(tmp);
}
public VariableInstanceEntity update(VariableInstanceEntity entity) {
return update(cast(VariableInstanceEntityImpl)entity);
//getDbSqlSession().update(entity);
//return entity;
}
public void dele(string id) {
VariableInstanceEntity entity = findById(id);
if (entity !is null)
{
deleteJob[entity] = this;
entity.setDeleted(true);
//remove(cast(VariableInstanceEntityImpl)entity);
}
//delete(entity);
}
public void dele(VariableInstanceEntity entity) {
if (entity !is null)
{
deleteJob[entity] = this;
entity.setDeleted(true);
//remove(cast(VariableInstanceEntityImpl)entity);
}
//getDbSqlSession().delete(entity);
}
void deleteTrans(Entity entity , EntityManager db)
{
db.remove!VariableInstanceEntityImpl(cast(VariableInstanceEntityImpl)entity);
}
public void updateTrans(Entity entity , EntityManager db)
{
db.merge!VariableInstanceEntityImpl(cast(VariableInstanceEntityImpl)entity);
}
public VariableInstanceEntity create() {
VariableInstanceEntityImpl variableInstanceEntity = new VariableInstanceEntityImpl();
variableInstanceEntity.setRevision(0); // For backwards compatibility, variables / HistoricVariableUpdate assumes revision 0 for the first time
return variableInstanceEntity;
}
public List!VariableInstanceEntity findVariableInstancesByTaskId(string taskId) {
VariableInstanceEntityImpl[] objs = findAll(new Condition("%s = %s" , field.taskId , taskId));
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; objs)
{
list.add(cast(VariableInstanceEntity)v);
}
return list;
//return new ArrayList!VariableInstanceEntity(objs);
// return getList("selectVariablesByTaskId", taskId, variableInstanceByTaskIdMatcher, true);
}
public List!VariableInstanceEntity findVariableInstancesByTaskIds(Set!string taskIds) {
List!VariableInstanceEntity lts = new ArrayList!VariableInstanceEntity;
foreach (string taskId ; taskIds)
{
List!VariableInstanceEntity ls = findVariableInstancesByTaskId(taskId);
if (ls.size != 0)
{
lts.addAll(ls);
}
}
return lts;
//return getDbSqlSession().selectList("selectVariablesByTaskIds", taskIds);
}
public List!VariableInstanceEntity findVariableInstancesByExecutionId(string executionId) {
//return getList("selectVariablesByExecutionId", executionId, variableInstanceByExecutionIdMatcher, true);
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.executionId = :executionId and (u.taskId is null or u.taskId = '')");
select.setParameter("executionId",executionId);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list;
//return new ArrayList!VariableInstanceEntity(ls);
}
public List!VariableInstanceEntity findVariableInstancesByExecutionIds(Set!string executionIds) {
if (executionIds.size == 0)
{
return null;
}
scope(exit)
{
_manager.close();
}
VariableInstanceEntityImpl[] ls = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl a WHERE a.executionId IN (" ~ executionIds.toArray().join(",") ~ ") and (u.taskId is null or u.taskId = '');")
.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list;
//return new ArrayList!VariableInstanceEntity(ls);
// return getDbSqlSession().selectList("selectVariablesByExecutionIds", executionIds);
}
public VariableInstanceEntity findVariableInstanceByExecutionAndName(string executionId, string variableName) {
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.executionId = :executionId and u.name = :variableName and (u.taskId is null or u.taskId = '')");
select.setParameter("executionId",executionId);
select.setParameter("variableName",variableName);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list.isEmpty()? null : list.get(0);
//return new ArrayList!VariableInstanceEntity(ls);
//Map<string, string> params = new HashMap<>(2);
//params.put("executionId", executionId);
//params.put("name", variableName);
//return (VariableInstanceEntity) getDbSqlSession().selectOne("selectVariableInstanceByExecutionAndName", params);
}
public List!VariableInstanceEntity findVariableInstancesByExecutionAndNames(string executionId, Collection!string names) {
implementationMissing(false);
return null;
//Map<string, Object> params = new HashMap<>(2);
//params.put("executionId", executionId);
//params.put("names", names);
//return getDbSqlSession().selectList("selectVariableInstancesByExecutionAndNames", params);
}
public VariableInstanceEntity findVariableInstanceByTaskAndName(string taskId, string variableName) {
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.name = :variableName and u.taskId = :taskId ");
select.setParameter("variableName",variableName);
select.setParameter("taskId",taskId);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list.isEmpty()? null : list.get(0);
//return new ArrayList!VariableInstanceEntity(ls);
//Map<string, string> params = new HashMap<>(2);
//params.put("taskId", taskId);
//params.put("name", variableName);
//return (VariableInstanceEntity) getDbSqlSession().selectOne("selectVariableInstanceByTaskAndName", params);
}
public List!VariableInstanceEntity findVariableInstancesByTaskAndNames(string taskId, Collection!string names) {
implementationMissing(false);
return null;
//Map<string, Object> params = new HashMap<>(2);
//params.put("taskId", taskId);
//params.put("names", names);
//return getDbSqlSession().selectList("selectVariableInstancesByTaskAndNames", params);
}
public List!VariableInstanceEntity findVariableInstanceByScopeIdAndScopeType(string scopeId, string scopeType) {
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.scopeId = :scopeId and u.scopeType = :scopeType and (u.subScopeId is null or u.subScopeId = '')");
select.setParameter("scopeId",scopeId);
select.setParameter("scopeType",scopeType);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list;
//return new ArrayList!VariableInstanceEntity(ls);
//Map<string, Object> params = new HashMap<>(2);
//params.put("scopeId", scopeId);
//params.put("scopeType", scopeType);
//return getList("selectVariableInstancesByScopeIdAndScopeType", params, variableInstanceByScopeIdAndScopeTypeMatcher, true);
}
public VariableInstanceEntity findVariableInstanceByScopeIdAndScopeTypeAndName(string scopeId, string scopeType, string variableName) {
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.scopeId = :scopeId and u.scopeType = :scopeType and u.name = :variableName and (u.subScopeId is null or u.subScopeId = '')");
select.setParameter("scopeId",scopeId);
select.setParameter("scopeType",scopeType);
select.setParameter("variableName",variableName);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list.isEmpty() ? null : list.get(0);
//return new ArrayList!VariableInstanceEntity(ls);
//Map<string, string> params = new HashMap<>(3);
//params.put("scopeId", scopeId);
//params.put("scopeType", scopeType);
//params.put("variableName", variableName);
//return getEntity("selectVariableInstanceByScopeIdAndScopeTypeAndName", params, variableInstanceByScopeIdAndScopeTypeAndVariableNameMatcher, true);
}
public List!VariableInstanceEntity findVariableInstancesByScopeIdAndScopeTypeAndNames(string scopeId, string scopeType, Collection!string variableNames) {
implementationMissing(false);
return null;
//Map<string, Object> params = new HashMap<>(3);
//params.put("scopeId", scopeId);
//params.put("scopeType", scopeType);
//params.put("variableNames", variableNames);
//return getList("selectVariableInstanceByScopeIdAndScopeTypeAndNames", params, variableInstanceByScopeIdAndScopeTypeAndVariableNamesMatcher, true);
}
public List!VariableInstanceEntity findVariableInstanceBySubScopeIdAndScopeType(string subScopeId, string scopeType) {
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.subScopeId = :subScopeId and u.scopeType = :scopeType");
select.setParameter("subScopeId",subScopeId);
select.setParameter("scopeType",scopeType);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list;
//return new ArrayList!VariableInstanceEntity(ls);
//Map<string, Object> params = new HashMap<>(2);
//params.put("subScopeId", subScopeId);
//params.put("scopeType", scopeType);
//return getList("selectVariableInstancesBySubScopeIdAndScopeType", params, variableInstanceBySubScopeIdAndScopeTypeMatcher, true);
}
public VariableInstanceEntity findVariableInstanceBySubScopeIdAndScopeTypeAndName(string subScopeId, string scopeType, string variableName) {
scope(exit)
{
_manager.close();
}
auto select = _manager.createQuery!(VariableInstanceEntityImpl)("SELECT * FROM VariableInstanceEntityImpl u where u.subScopeId = :subScopeId and u.scopeType = :scopeType and u.name = :variableName ");
select.setParameter("subScopeId",subScopeId);
select.setParameter("scopeType",scopeType);
select.setParameter("variableName",variableName);
VariableInstanceEntityImpl[] ls = select.getResultList();
List!VariableInstanceEntity list = new ArrayList!VariableInstanceEntity;
foreach(VariableInstanceEntityImpl v ; ls)
{
list.add(cast(VariableInstanceEntity)v);
}
return list.isEmpty() ? null : list.get(0);
//return new ArrayList!VariableInstanceEntity(ls);
//Map<string, string> params = new HashMap<>(3);
//params.put("subScopeId", subScopeId);
//params.put("scopeType", scopeType);
//params.put("variableName", variableName);
//return getEntity("selectVariableInstanceBySubScopeIdAndScopeTypeAndName", params, variableInstanceBySubScopeIdAndScopeTypeAndVariableNameMatcher, true);
}
public List!VariableInstanceEntity findVariableInstancesBySubScopeIdAndScopeTypeAndNames(string subScopeId, string scopeType, Collection!string variableNames) {
implementationMissing(false);
return null;
//Map<string, Object> params = new HashMap<>(3);
//params.put("subScopeId", subScopeId);
//params.put("scopeType", scopeType);
//params.put("variableNames", variableNames);
//return getList("selectVariableInstanceBySubScopeIdAndScopeTypeAndNames", params, variableInstanceBySubScopeIdAndScopeTypeAndVariableNamesMatcher, true);
}
public void deleteVariablesByTaskId(string taskId) {
scope(exit)
{
_manager.close();
}
auto update = _manager.createQuery!(VariableInstanceEntityImpl)("DELETE FROM VariableInstanceEntityImpl u WHERE u.taskId = :taskId");
update.setParameter("taskId",taskId);
try{
update.exec();
}
catch(Exception e)
{
logError("deleteVariablesByTaskId error : %s",e.msg);
}
//DbSqlSession dbSqlSession = getDbSqlSession();
//if (isEntityInserted(dbSqlSession, "task", taskId)) {
// deleteCachedEntities(dbSqlSession, variableInstanceByTaskIdMatcher, taskId);
//} else {
// bulkDelete("deleteVariableInstancesByTaskId", variableInstanceByTaskIdMatcher, taskId);
//}
}
public void deleteVariablesByExecutionId(string executionId) {
scope(exit)
{
_manager.close();
}
auto update = _manager.createQuery!(VariableInstanceEntityImpl)("DELETE FROM VariableInstanceEntityImpl u WHERE u.executionId = :executionId");
update.setParameter("executionId",executionId);
try{
update.exec();
}
catch(Exception e)
{
logError("deleteVariablesByExecutionId error : %s",e.msg);
}
//DbSqlSession dbSqlSession = getDbSqlSession();
//if (isEntityInserted(dbSqlSession, "execution", executionId)) {
// deleteCachedEntities(dbSqlSession, variableInstanceByExecutionIdMatcher, executionId);
//} else {
// bulkDelete("deleteVariableInstancesByExecutionId", variableInstanceByExecutionIdMatcher, executionId);
//}
}
public void deleteByScopeIdAndScopeType(string scopeId, string scopeType) {
scope(exit)
{
_manager.close();
}
auto update = _manager.createQuery!(VariableInstanceEntityImpl)("DELETE FROM VariableInstanceEntityImpl u WHERE u.scopeId = :scopeId and u.scopeType = :scopeType");
update.setParameter("scopeId",scopeId);
update.setParameter("scopeType",scopeType);
try{
update.exec();
}
catch(Exception e)
{
logError("deleteByScopeIdAndScopeType error : %s",e.msg);
}
//Map<string, Object> params = new HashMap<>(3);
//params.put("scopeId", scopeId);
//params.put("scopeType", scopeType);
//bulkDelete("deleteVariablesByScopeIdAndScopeType", variableInstanceByScopeIdAndScopeTypeMatcher, params);
}
}
|
D
|
module app.controller.IndexController;
import hunt.framework;
import app.message.ResultMessage;
import app.exception.MessageException;
/**
*
*/
class IndexController : Controller
{
mixin MakeController;
@Action
Response index()
{
return new RedirectResponse(request(), "/index.html");
}
@Action
Response options()
{
auto resultMessage = new ResultMessage;
resultMessage.code = CODE.SUCCESS;
resultMessage.message = "ok";
return new JsonResponse(resultMessage);
}
}
|
D
|
/*
* Copyright 2017 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.
*/
package androidx.webkit.internal.codegen;
import com.squareup.javapoet.JavaFile;
import androidx.webkit.internal.codegen.representations.ClassRepr;
/**
* Contains a bunch of utility methods for generating WebView Support Library boundary interfaces.
*/
public class BoundaryGeneration {
private static final String BOUNDARY_INTERFACE_PACKAGE = "org.chromium.support_lib_boundary";
private static final String INDENT = " "; // 4 white spaces.
/**
* Create a WebView Support Library boundary interface given the class representation
* {@classRepr}.
*/
public static JavaFile createBoundaryInterface(ClassRepr classRepr) {
return JavaFile.builder(BOUNDARY_INTERFACE_PACKAGE, classRepr.createBoundaryInterface())
.indent(INDENT)
.build();
}
}
|
D
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
public import QtCore.qglobal;
#ifdef Q_OS_WIN
public import QtCore.QThread;
public import QtCore.QAbstractEventDispatcher;
public import QtCore.qt_windows;
// Convenience macros for handling HRESULT values
#define RETURN_IF_FAILED(msg, ret) \
if (FAILED(hr)) { \
qErrnoWarning(hr, msg); \
ret; \
}
#define RETURN_HR_IF_FAILED(msg) RETURN_IF_FAILED(msg, return hr)
#define RETURN_OK_IF_FAILED(msg) RETURN_IF_FAILED(msg, return S_OK)
#define RETURN_FALSE_IF_FAILED(msg) RETURN_IF_FAILED(msg, return false)
#define RETURN_VOID_IF_FAILED(msg) RETURN_IF_FAILED(msg, return)
#define Q_ASSERT_SUCCEEDED(hr) \
Q_ASSERT_X(SUCCEEDED(hr), Q_FUNC_INFO, qPrintable(qt_error_string(hr)));
#ifdef Q_OS_WINRT
#ifdef QT_BUILD_CORE_LIB
#endif
// Environment ------------------------------------------------------
errno_t qt_winrt_getenv_s(size_t*, char*, size_t, const char*);
errno_t qt_winrt__putenv_s(const char*, const char*);
void qt_winrt_tzset();
void qt_winrt__tzset();
// As Windows Runtime lacks some standard functions used in Qt, these got
// reimplemented. Other projects do this as well. /+inline+/ functions are used
// that there is a central place to disable functions for newer versions if
// they get available. There are no defines used anymore, because this
// will break member functions of classes which are called like these
// functions.
// The other declarations available in this file are being used per
// define inside qplatformdefs.h of the corresponding WinRT mkspec.
#define generate_inline_return_func0(funcname, returntype) \
/+inline+/ returntype funcname() \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(); \
}
#define generate_inline_return_func1(funcname, returntype, param1) \
/+inline+/ returntype funcname(param1 p1) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1); \
}
#define generate_inline_return_func2(funcname, returntype, param1, param2) \
/+inline+/ returntype funcname(param1 p1, param2 p2) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2); \
}
#define generate_inline_return_func3(funcname, returntype, param1, param2, param3) \
/+inline+/ returntype funcname(param1 p1, param2 p2, param3 p3) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3); \
}
#define generate_inline_return_func4(funcname, returntype, param1, param2, param3, param4) \
/+inline+/ returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4); \
}
#define generate_inline_return_func5(funcname, returntype, param1, param2, param3, param4, param5) \
/+inline+/ returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5); \
}
#define generate_inline_return_func6(funcname, returntype, param1, param2, param3, param4, param5, param6) \
/+inline+/ returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5, p6); \
}
#define generate_inline_return_func7(funcname, returntype, param1, param2, param3, param4, param5, param6, param7) \
/+inline+/ returntype funcname(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, param7 p7) \
{ \
return QT_PREPEND_NAMESPACE(qt_winrt_##funcname)(p1, p2, p3, p4, p5, p6, p7); \
}
typedef unsigned (__stdcall *StartAdressExFunc)(void *);
typedef void(*StartAdressFunc)(void *);
typedef int ( __cdecl *CompareFunc ) (const(void)* , const(void)* ) ;
generate_inline_return_func4(getenv_s, errno_t, size_t *, char *, size_t, const(char)* )
generate_inline_return_func2(_putenv_s, errno_t, const(char)* , const(char)* )
generate_inline_return_func0(tzset, void)
generate_inline_return_func0(_tzset, void)
namespace Microsoft { namespace WRL { template <typename T> extern(C++) class ComPtr; } }
namespace QWinRTFunctions {
// Synchronization methods
enum AwaitStyle
{
YieldThread = 0,
ProcessThreadEvents = 1,
ProcessMainThreadEvents = 2
}
template <typename T>
static /+inline+/ HRESULT _await_impl(ref const(Microsoft::WRL::ComPtr<T>) asyncOp, AwaitStyle awaitStyle)
{
Microsoft::WRL::ComPtr<IAsyncInfo> asyncInfo;
HRESULT hr = asyncOp.As(&asyncInfo);
if (FAILED(hr))
return hr;
AsyncStatus status;
switch (awaitStyle) {
case ProcessMainThreadEvents:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
QCoreApplication::processEvents();
break;
case ProcessThreadEvents:
if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) {
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
dispatcher->processEvents(QEventLoop::AllEvents);
break;
}
// fall through
default:
case YieldThread:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
QThread::yieldCurrentThread();
break;
}
if (FAILED(hr) || status != Completed) {
HRESULT ec;
hr = asyncInfo->get_ErrorCode(&ec);
if (FAILED(hr))
return hr;
return ec;
}
return hr;
}
template <typename T>
static /+inline+/ HRESULT await(ref const(Microsoft::WRL::ComPtr<T>) asyncOp, AwaitStyle awaitStyle = YieldThread)
{
HRESULT hr = _await_impl(asyncOp, awaitStyle);
if (FAILED(hr))
return hr;
return asyncOp->GetResults();
}
template <typename T, typename U>
static /+inline+/ HRESULT await(ref const(Microsoft::WRL::ComPtr<T>) asyncOp, U *results, AwaitStyle awaitStyle = YieldThread)
{
HRESULT hr = _await_impl(asyncOp, awaitStyle);
if (FAILED(hr))
return hr;
return asyncOp->GetResults(results);
}
} // QWinRTFunctions
#endif // Q_OS_WINRT
#endif // Q_OS_WIN
#endif // QFUNCTIONS_WINRT_H
|
D
|
/**
* This module contains a collection of bit-level operations.
*
* Copyright: Copyright Don Clugston 2005 - 2009.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Don Clugston, Sean Kelly, Walter Bright, Alex Rønne Petersen
* Source: $(DRUNTIMESRC core/_bitop.d)
*/
/* Copyright Don Clugston 2005 - 2009.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module core.bitop;
nothrow:
@safe:
version( D_InlineAsm_X86_64 )
version = AsmX86;
else version( D_InlineAsm_X86 )
version = AsmX86;
version (X86_64)
version = AnyX86;
else version (X86)
version = AnyX86;
/**
* Scans the bits in v starting with bit 0, looking
* for the first set bit.
* Returns:
* The bit number of the first bit set.
* The return value is undefined if v is zero.
* Example:
* ---
* import core.bitop;
*
* int main()
* {
* assert(bsf(0x21) == 0);
* return 0;
* }
* ---
*/
int bsf(size_t v) pure;
unittest
{
assert(bsf(0x21) == 0);
}
/**
* Scans the bits in v from the most significant bit
* to the least significant bit, looking
* for the first set bit.
* Returns:
* The bit number of the first bit set.
* The return value is undefined if v is zero.
* Example:
* ---
* import core.bitop;
*
* int main()
* {
* assert(bsr(0x21) == 5);
* return 0;
* }
* ---
*/
int bsr(size_t v) pure;
unittest
{
assert(bsr(0x21) == 5);
}
/**
* Tests the bit.
*/
int bt(in size_t* p, size_t bitnum) pure;
/**
* Tests and complements the bit.
*/
int btc(size_t* p, size_t bitnum) pure;
/**
* Tests and resets (sets to 0) the bit.
*/
int btr(size_t* p, size_t bitnum) pure;
/**
* Tests and sets the bit.
* Params:
* p = a non-NULL pointer to an array of size_ts.
* index = a bit number, starting with bit 0 of p[0],
* and progressing. It addresses bits like the expression:
---
p[index / (size_t.sizeof*8)] & (1 << (index & ((size_t.sizeof*8) - 1)))
---
* Returns:
* A non-zero value if the bit was set, and a zero
* if it was clear.
*
* Example:
* ---
import std.stdio;
import core.bitop;
int main()
{
size_t array[2];
array[0] = 2;
array[1] = 0x100;
assert(btc(array, 35) == 0);
assert(array[0] == 2);
assert(array[1] == 0x108);
assert(btc(array, 35) == -1);
assert(array[0] == 2);
assert(array[1] == 0x100);
assert(bts(array, 35) == 0);
assert(array[0] == 2);
assert(array[1] == 0x108);
assert(btr(array, 35) == -1);
assert(array[0] == 2);
assert(array[1] == 0x100);
assert(bt(array, 1) == -1);
assert(array[0] == 2);
assert(array[1] == 0x100);
return 0;
}
* ---
*/
int bts(size_t* p, size_t bitnum) pure;
unittest
{
size_t array[2];
array[0] = 2;
array[1] = 0x100;
assert(btc(array.ptr, 35) == 0);
if (size_t.sizeof == 8)
{
assert(array[0] == 0x8_0000_0002);
assert(array[1] == 0x100);
}
else
{
assert(array[0] == 2);
assert(array[1] == 0x108);
}
assert(btc(array.ptr, 35) == -1);
assert(array[0] == 2);
assert(array[1] == 0x100);
assert(bts(array.ptr, 35) == 0);
if (size_t.sizeof == 8)
{
assert(array[0] == 0x8_0000_0002);
assert(array[1] == 0x100);
}
else
{
assert(array[0] == 2);
assert(array[1] == 0x108);
}
assert(btr(array.ptr, 35) == -1);
assert(array[0] == 2);
assert(array[1] == 0x100);
assert(bt(array.ptr, 1) == -1);
assert(array[0] == 2);
assert(array[1] == 0x100);
}
/**
* Swaps bytes in a 4 byte uint end-to-end, i.e. byte 0 becomes
* byte 3, byte 1 becomes byte 2, byte 2 becomes byte 1, byte 3
* becomes byte 0.
*/
uint bswap(uint v) pure;
version (DigitalMars) version (AnyX86) @system // not pure
{
/**
* Reads I/O port at port_address.
*/
ubyte inp(uint port_address);
/**
* ditto
*/
ushort inpw(uint port_address);
/**
* ditto
*/
uint inpl(uint port_address);
/**
* Writes and returns value to I/O port at port_address.
*/
ubyte outp(uint port_address, ubyte value);
/**
* ditto
*/
ushort outpw(uint port_address, ushort value);
/**
* ditto
*/
uint outpl(uint port_address, uint value);
}
/**
* Calculates the number of set bits in a 32-bit integer.
*/
int popcnt( uint x ) pure
{
// Avoid branches, and the potential for cache misses which
// could be incurred with a table lookup.
// We need to mask alternate bits to prevent the
// sum from overflowing.
// add neighbouring bits. Each bit is 0 or 1.
x = x - ((x>>1) & 0x5555_5555);
// now each two bits of x is a number 00,01 or 10.
// now add neighbouring pairs
x = ((x&0xCCCC_CCCC)>>2) + (x&0x3333_3333);
// now each nibble holds 0000-0100. Adding them won't
// overflow any more, so we don't need to mask any more
// Now add the nibbles, then the bytes, then the words
// We still need to mask to prevent double-counting.
// Note that if we used a rotate instead of a shift, we
// wouldn't need the masks, and could just divide the sum
// by 8 to account for the double-counting.
// On some CPUs, it may be faster to perform a multiply.
x += (x>>4);
x &= 0x0F0F_0F0F;
x += (x>>8);
x &= 0x00FF_00FF;
x += (x>>16);
x &= 0xFFFF;
return x;
}
unittest
{
assert( popcnt( 0 ) == 0 );
assert( popcnt( 7 ) == 3 );
assert( popcnt( 0xAA )== 4 );
assert( popcnt( 0x8421_1248 ) == 8 );
assert( popcnt( 0xFFFF_FFFF ) == 32 );
assert( popcnt( 0xCCCC_CCCC ) == 16 );
assert( popcnt( 0x7777_7777 ) == 24 );
}
/**
* Reverses the order of bits in a 32-bit integer.
*/
@trusted uint bitswap( uint x ) pure
{
version (AsmX86)
{
version (D_InlineAsm_X86_64)
asm { naked; mov EAX, EDI; }
asm
{
// Author: Tiago Gasiba.
naked;
mov EDX, EAX;
shr EAX, 1;
and EDX, 0x5555_5555;
and EAX, 0x5555_5555;
shl EDX, 1;
or EAX, EDX;
mov EDX, EAX;
shr EAX, 2;
and EDX, 0x3333_3333;
and EAX, 0x3333_3333;
shl EDX, 2;
or EAX, EDX;
mov EDX, EAX;
shr EAX, 4;
and EDX, 0x0f0f_0f0f;
and EAX, 0x0f0f_0f0f;
shl EDX, 4;
or EAX, EDX;
bswap EAX;
ret;
}
}
else
{
// swap odd and even bits
x = ((x >> 1) & 0x5555_5555) | ((x & 0x5555_5555) << 1);
// swap consecutive pairs
x = ((x >> 2) & 0x3333_3333) | ((x & 0x3333_3333) << 2);
// swap nibbles
x = ((x >> 4) & 0x0F0F_0F0F) | ((x & 0x0F0F_0F0F) << 4);
// swap bytes
x = ((x >> 8) & 0x00FF_00FF) | ((x & 0x00FF_00FF) << 8);
// swap 2-byte long pairs
x = ( x >> 16 ) | ( x << 16);
return x;
}
}
unittest
{
assert( bitswap( 0x8000_0100 ) == 0x0080_0001 );
foreach(i; 0 .. 32)
assert(bitswap(1 << i) == 1 << 32 - i - 1);
}
|
D
|
import std.algorithm, std.conv, std.range, std.stdio, std.string;
version(unittest) {} else
void main()
{
auto x = readln.chomp.to!int;
writeln(x ^^ 3);
}
|
D
|
// EXTRA_SOURCES: imports/ice10086y.d
// EXTRA_SOURCES: imports/ice10086x.d
import imports.ice10086y;
import imports.ice10086x;
void main() { test(); }
static if (0)
{
/* this is a reduced one-file version that triggers a seg fault
because the use of OPframeptr gets inlined, and the offests
to it are not updated.
Compile with: -O -inline
*/
pragma(inline, false)
auto bind(alias f, bindValues...)()
{
pragma(inline, false)
auto bind(Types...)(Types values)
{
return f(bindValues, values);
}
return bind();
}
struct SS
{
int a1 = 123;
}
pragma(inline, false)
@safe auto ff(SS rr)
{
return rr;
}
// pragma(inline, false)
@safe auto gg(SS ss) // this getting inlined triggers the problem
{
return bind!(ff, ss);
}
pragma(inline, false)
void test()
{
SS s1;
auto zb = bind!(gg, s1)();
assert(zb.a1 == 123);
}
void main() { test(); }
}
|
D
|
/*
TEST_OUTPUT:
---
fail_compilation/fail261.d(18): Error: invalid `foreach` aggregate `range`, define `opApply()`, range primitives, or use `.tupleof`
---
*/
//import std.stdio;
struct MyRange
{
}
void main()
{
MyRange range;
foreach (r; range)
{
//writefln("%s", r.toString());
}
}
|
D
|
/Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Rhabit.build/Debug-iphonesimulator/Rhabit.build/Objects-normal/x86_64/loginViewController.o : /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/loginViewController.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/SecondViewController.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/AppDelegate.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/FirstViewController.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
/Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Rhabit.build/Debug-iphonesimulator/Rhabit.build/Objects-normal/x86_64/loginViewController~partial.swiftmodule : /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/loginViewController.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/SecondViewController.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/AppDelegate.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/FirstViewController.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
/Users/markmoussa/HackathonProjects/Rhabit/DerivedData/Rhabit/Build/Intermediates/Rhabit.build/Debug-iphonesimulator/Rhabit.build/Objects-normal/x86_64/loginViewController~partial.swiftdoc : /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/loginViewController.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/SecondViewController.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/AppDelegate.swift /Users/markmoussa/HackathonProjects/Rhabit/Rhabit/FirstViewController.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
|
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.accessibility.AccessibleAdapter;
import dwt.accessibility.AccessibleListener;
import dwt.accessibility.AccessibleEvent;
/**
* This adapter class provides default implementations for the
* methods described by the <code>AccessibleListener</code> interface.
* <p>
* Classes that wish to deal with <code>AccessibleEvent</code>s can
* extend this class and override only the methods that they are
* interested in.
* </p><p>
* Note: Accessibility clients use child identifiers to specify
* whether they want information about a control or one of its children.
* Child identifiers are increasing integers beginning with 0.
* The identifier CHILDID_SELF represents the control itself.
* </p>
*
* @see AccessibleListener
* @see AccessibleEvent
* @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*
* @since 2.0
*/
public abstract class AccessibleAdapter : AccessibleListener {
/**
* Sent when an accessibility client requests the name
* of the control, or the name of a child of the control.
* The default behavior is to do nothing.
* <p>
* Return the name of the control or specified child in the
* <code>result</code> field of the event object. Returning
* an empty string tells the client that the control or child
* does not have a name, and returning null tells the client
* to use the platform name.
* </p>
*
* @param e an event object containing the following fields:<ul>
* <li>childID [IN] - an identifier specifying the control or one of its children</li>
* <li>result [OUT] - the requested name string, or null</li>
* </ul>
*/
public void getName(AccessibleEvent e) {
}
/**
* Sent when an accessibility client requests the help string
* of the control, or the help string of a child of the control.
* The default behavior is to do nothing.
* <p>
* The information in this property should be similar to the help
* provided by toolTipText. It describes what the control or child
* does or how to use it, as opposed to getDescription, which
* describes appearance.
* </p><p>
* Return the help string of the control or specified child in
* the <code>result</code> field of the event object. Returning
* an empty string tells the client that the control or child
* does not have a help string, and returning null tells the
* client to use the platform help string.
* </p>
*
* @param e an event object containing the following fields:<ul>
* <li>childID [IN] - an identifier specifying the control or one of its children</li>
* <li>result [OUT] - the requested help string, or null</li>
* </ul>
*/
public void getHelp(AccessibleEvent e) {
}
/**
* Sent when an accessibility client requests the keyboard shortcut
* of the control, or the keyboard shortcut of a child of the control.
* The default behavior is to do nothing.
* <p>
* A keyboard shortcut can either be a mnemonic, or an accelerator.
* As a general rule, if the control or child can receive keyboard focus,
* then you should expose its mnemonic, and if it cannot receive keyboard
* focus, then you should expose its accelerator.
* </p><p>
* Return the keyboard shortcut string of the control or specified child
* in the <code>result</code> field of the event object. Returning an
* empty string tells the client that the control or child does not
* have a keyboard shortcut string, and returning null tells the client
* to use the platform keyboard shortcut string.
* </p>
*
* @param e an event object containing the following fields:<ul>
* <li>childID [IN] - an identifier specifying the control or one of its children</li>
* <li>result [OUT] - the requested keyboard shortcut string (example: "ALT+N"), or null</li>
* </ul>
*/
public void getKeyboardShortcut(AccessibleEvent e) {
}
/**
* Sent when an accessibility client requests a description
* of the control, or a description of a child of the control.
* The default behavior is to do nothing.
* <p>
* This is a textual description of the control or child's visual
* appearance, which is typically only necessary if it cannot be
* determined from other properties such as role.
* </p><p>
* Return the description of the control or specified child in
* the <code>result</code> field of the event object. Returning
* an empty string tells the client that the control or child
* does not have a description, and returning null tells the
* client to use the platform description.
* </p>
*
* @param e an event object containing the following fields:<ul>
* <li>childID [IN] - an identifier specifying the control or one of its children</li>
* <li>result [OUT] - the requested description string, or null</li>
* </ul>
*/
public void getDescription(AccessibleEvent e) {
}
}
|
D
|
/Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/MyMVVMRxSwiftExample.build/Debug-iphonesimulator/MyMVVMRxSwiftExample.build/Objects-normal/x86_64/MemoComposeVC.o : /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoComposeVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoDetailsVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoListVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Service/MemoStorage/MemoryStorage.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/Scene.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Service/MemoStorgeType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/ViewModelBindbleType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/SceneCoordinatorType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/SceneDelegate.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/AppDelegate.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/TransitionModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoComposeViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/CommonViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoDetailsViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoListViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Model/Memo.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/SceneCoordinator.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreData.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Modules/RxCoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Modules/Action.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Modules/Differentiator.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Modules/RxDataSources.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Modules/NSObject_Rx.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Headers/RxCoreData-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Headers/Action-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Headers/Differentiator-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Headers/RxDataSources-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Headers/NSObject+Rx-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Headers/RxCoreData-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Headers/Action-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Headers/Differentiator-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Headers/RxDataSources-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Headers/NSObject_Rx-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/MyMVVMRxSwiftExample.build/Debug-iphonesimulator/MyMVVMRxSwiftExample.build/Objects-normal/x86_64/MemoComposeVC~partial.swiftmodule : /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoComposeVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoDetailsVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoListVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Service/MemoStorage/MemoryStorage.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/Scene.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Service/MemoStorgeType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/ViewModelBindbleType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/SceneCoordinatorType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/SceneDelegate.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/AppDelegate.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/TransitionModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoComposeViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/CommonViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoDetailsViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoListViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Model/Memo.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/SceneCoordinator.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreData.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Modules/RxCoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Modules/Action.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Modules/Differentiator.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Modules/RxDataSources.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Modules/NSObject_Rx.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Headers/RxCoreData-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Headers/Action-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Headers/Differentiator-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Headers/RxDataSources-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Headers/NSObject+Rx-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Headers/RxCoreData-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Headers/Action-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Headers/Differentiator-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Headers/RxDataSources-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Headers/NSObject_Rx-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/MyMVVMRxSwiftExample.build/Debug-iphonesimulator/MyMVVMRxSwiftExample.build/Objects-normal/x86_64/MemoComposeVC~partial.swiftdoc : /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoComposeVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoDetailsVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/MemoListVC.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Service/MemoStorage/MemoryStorage.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/Scene.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Service/MemoStorgeType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewController/ViewModelBindbleType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/SceneCoordinatorType.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/SceneDelegate.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/AppDelegate.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/TransitionModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoComposeViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/CommonViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoDetailsViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/ViewModel/MemoListViewModel.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Model/Memo.swift /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/MyMVVMRxSwiftExample/Scene/SceneCoordinator.swift /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/ObjectiveC.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreData.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreImage.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/QuartzCore.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Dispatch.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Metal.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Darwin.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreFoundation.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/CoreGraphics.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/Swift.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/UIKit.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/lib/swift/SwiftOnoneSupport.swiftmodule/x86_64.swiftinterface /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Combine.framework/Modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftinterface /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreData.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/RxCocoa.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Modules/RxCoreData.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Modules/Action.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Modules/Differentiator.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Modules/RxDataSources.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Modules/NSObject_Rx.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/RxRelay.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RX.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Headers/RxCoreData-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Headers/Action-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Headers/Differentiator-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Headers/RxDataSources-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Headers/NSObject+Rx-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-umbrella.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXObjCRuntime.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoaRuntime.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXKVOObserver.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/RxCocoa-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Headers/RxCoreData-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Headers/Action-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Headers/Differentiator-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Headers/RxDataSources-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Headers/RxSwift-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Headers/NSObject_Rx-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Headers/RxRelay-Swift.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Headers/_RXDelegateProxy.h /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCocoa/RxCocoa.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxCoreData/RxCoreData.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Action/Action.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/Differentiator/Differentiator.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxDataSources/RxDataSources.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxSwift/RxSwift.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/NSObject+Rx/NSObject_Rx.framework/Modules/module.modulemap /Users/MohamedNawar/Desktop/MyMVVMRxSwiftExample/build/Debug-iphonesimulator/RxRelay/RxRelay.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;
void main() {
auto s = readln.split.map!(to!int);
auto H = s[0];
auto W = s[1];
auto D = s[2];
auto N = max(H, W) * 3;
auto B = new int[][](N, N);
int[] colors = [1, 2, 3, 4];
for (int i = 0; i * D < N; ++i)
for (int j = 0; j * D < N; ++j)
for (int a = 0; a < D; a++)
for (int b = 0; b < D; b++)
if (i * D + a < N && j * D + b < N)
B[i*D+a][j*D+b] = colors[i%2*2+j%2];
auto ans = new int[][](H, W);
auto color = " RYGB";
foreach (i; 0..H) {
foreach (j; 0..W) {
int ni = i + j;
int nj = i - j + W;
ans[i][j] = B[ni][nj];
}
}
ans.each!(an => an.map!(a => color[a]).writeln);
}
|
D
|
/Users/wangqian/Desktop/perfect/PerfectTemplate/.build/x86_64-apple-macosx10.10/debug/PerfectCRUD.build/Join.swift.o : /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/PerfectCRUD.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Like.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Table.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Where.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Database.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Update.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Create.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Delete.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/Coding.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Logging.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Logical.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/In.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Join.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Expression.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Comparison.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingNames.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingBindings.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingKeyPaths.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingJoins.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/InInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/ComparisonInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/EqualityInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingRows.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Select.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Insert.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Equality.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 /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/wangqian/Desktop/perfect/PerfectTemplate/.build/x86_64-apple-macosx10.10/debug/PerfectCRUD.build/Join~partial.swiftmodule : /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/PerfectCRUD.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Like.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Table.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Where.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Database.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Update.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Create.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Delete.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/Coding.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Logging.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Logical.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/In.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Join.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Expression.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Comparison.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingNames.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingBindings.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingKeyPaths.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingJoins.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/InInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/ComparisonInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/EqualityInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingRows.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Select.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Insert.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Equality.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 /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/wangqian/Desktop/perfect/PerfectTemplate/.build/x86_64-apple-macosx10.10/debug/PerfectCRUD.build/Join~partial.swiftdoc : /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/PerfectCRUD.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Like.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Table.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Where.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Database.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Update.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Create.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Delete.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/Coding.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Logging.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Logical.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/In.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Join.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Expression.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Comparison.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingNames.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingBindings.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingKeyPaths.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingJoins.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/InInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/ComparisonInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/EqualityInts.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Coding/CodingRows.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Select.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Insert.swift /Users/wangqian/Desktop/perfect/PerfectTemplate/.build/checkouts/Perfect-CRUD.git-7099260549736980491/Sources/PerfectCRUD/Expression/Equality.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 /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
|
/Users/Laird/Code/Projects/AllergyAlert/DerivedData/AllergyAlert/SwiftMigration/AllergyAlert/Intermediates/AllergyAlert.build/Debug-iphonesimulator/AllergyAlert.build/Objects-normal/x86_64/DataService.o : /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/BarcodeScannerViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/DataService.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/ViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/ProductViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/AppDelegate.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/Constants.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/Models.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/SwiftOnoneSupport.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/QuartzCore.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/Laird/Code/Projects/AllergyAlert/DerivedData/AllergyAlert/SwiftMigration/AllergyAlert/Intermediates/AllergyAlert.build/Debug-iphonesimulator/AllergyAlert.build/Objects-normal/x86_64/DataService~partial.swiftmodule : /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/BarcodeScannerViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/DataService.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/ViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/ProductViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/AppDelegate.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/Constants.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/Models.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/SwiftOnoneSupport.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/QuartzCore.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/Laird/Code/Projects/AllergyAlert/DerivedData/AllergyAlert/SwiftMigration/AllergyAlert/Intermediates/AllergyAlert.build/Debug-iphonesimulator/AllergyAlert.build/Objects-normal/x86_64/DataService~partial.swiftdoc : /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/BarcodeScannerViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/DataService.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/ViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/ProductViewController.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/AppDelegate.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/Constants.swift /Users/Laird/Code/Projects/AllergyAlert/AllergyAlert/Models.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/SwiftOnoneSupport.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/QuartzCore.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
|
D
|
program foo;
var
i : integer;
a : integer;
q : real;
p : real;
begin
i := 3 + 1;
a := i+1;
q := 3.14 * 1.0;
p := q * 10.0;
a := (q = 1.0);
a := (1<4);
a := (1.3 > 3);
a := (2 <> 2.3333);
a := not(1=2);
a := -2345;
q := -p;
end.
|
D
|
/Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/x86_64-apple-macosx/debug/TemplateKit.build/Tag/Var.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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/TemplateKit.build/Tag/Var~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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/TemplateKit.build/Tag/Var~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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/TemplateKit.build/Tag/Var~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppUsers/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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
|
import gfm.math;
import iregioncontainer;
interface IRegion
{
int getRank();
IRegionContainer getContainer();
void setContainer(IRegionContainer);
vec3i getSite();
int getSiteIndex();
}
|
D
|
module commands;
import std, jcli, finder, parser, emitter;
@CommandDefault("Searches any provided folders for .lst files, and then produces a coverage report.")
struct DefaultCommand
{
@ArgOverflow
string[] locations;
void onExecute()
{
const files = findFiles(this.locations);
CoverageFile[] coverages;
foreach(f; files)
coverages ~= parseFile(f);
const output = emit(coverages);
std.file.write("index.html", output);
}
}
|
D
|
// 1.
CHAIN
IF ~InParty("O#Tiax")
See("O#Tiax")
!StateCheck("O#Tiax",CD_STATE_NOTVALID)
!StateCheck("T#Dace",CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("G#XB.DaceTiaxToBBanter1","GLOBAL",0)~ THEN BT#DAC25 DaceTiaxToBBanter#1.1
@0 /* Been wonderin'… are you always this high-strung? */
DO ~SetGlobal("G#XB.DaceTiaxToBBanter1","GLOBAL",1)~
== BO#TIA25 @1 /* Tiax is not high-strung! He is perfectly relaxed and at ease among his subjects, and experiences no nervousness whatsoever, especially when he is thinking about his duties to the Great Cyric! */
== BT#DAC25 @2 /* Yeah, this is what I'm talkin' about, bunny. Like a squirrel on coffee. You like some, by the way? */
== BO#TIA25 @3 /* (sniff) Coffee? For the Great Tiax? He would like some, yes... most definitely with sugar. */
== BT#DAC25 @4 /* Here you go, then, darlin'. Your head may be screwed on wrong, but you're a damn fine companion all the same. */
== BO#TIA25 @5 /* Um... Tiax thanks you? */
== BT#DAC25 @6 /* Anytime. */
EXIT
|
D
|
/Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Intermediates/OtelApp.build/Debug-iphonesimulator/OtelApp.build/Objects-normal/x86_64/CheckInViewController.o : /Users/sunilvg/Desktop/updation/OtelApp/Offer.swift /Users/sunilvg/Desktop/updation/OtelApp/User.swift /Users/sunilvg/Desktop/updation/OtelApp/AppConfig.swift /Users/sunilvg/Desktop/updation/OtelApp/ServiceCaller.swift /Users/sunilvg/Desktop/updation/OtelApp/HomeViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/HomeCollectionViewCell.swift /Users/sunilvg/Desktop/updation/OtelApp/AsyncUser.swift /Users/sunilvg/Desktop/updation/OtelApp/OffersViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OtelApp/LoginViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OfferTableViewCell.swift /Users/sunilvg/Desktop/updation/OtelApp/CardView.swift /Users/sunilvg/Desktop/updation/OtelApp/ProfileViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OtelApp/AppDelegate.swift /Users/sunilvg/Desktop/updation/OtelApp/CheckInViewController.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/SwiftOnoneSupport.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/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCacheOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+WebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+HighlightedWebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+MultiFormat.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+GIF.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIButton+WebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImagePrefetcher.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageManager.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloaderOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloader.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDecoder.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCompat.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSData+ImageContentType.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImage-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Modules/module.modulemap /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVRadialGradientLayer.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressAnimatedView.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVIndefiniteAnimatedView.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
/Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Intermediates/OtelApp.build/Debug-iphonesimulator/OtelApp.build/Objects-normal/x86_64/CheckInViewController~partial.swiftmodule : /Users/sunilvg/Desktop/updation/OtelApp/Offer.swift /Users/sunilvg/Desktop/updation/OtelApp/User.swift /Users/sunilvg/Desktop/updation/OtelApp/AppConfig.swift /Users/sunilvg/Desktop/updation/OtelApp/ServiceCaller.swift /Users/sunilvg/Desktop/updation/OtelApp/HomeViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/HomeCollectionViewCell.swift /Users/sunilvg/Desktop/updation/OtelApp/AsyncUser.swift /Users/sunilvg/Desktop/updation/OtelApp/OffersViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OtelApp/LoginViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OfferTableViewCell.swift /Users/sunilvg/Desktop/updation/OtelApp/CardView.swift /Users/sunilvg/Desktop/updation/OtelApp/ProfileViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OtelApp/AppDelegate.swift /Users/sunilvg/Desktop/updation/OtelApp/CheckInViewController.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/SwiftOnoneSupport.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/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCacheOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+WebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+HighlightedWebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+MultiFormat.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+GIF.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIButton+WebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImagePrefetcher.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageManager.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloaderOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloader.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDecoder.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCompat.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSData+ImageContentType.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImage-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Modules/module.modulemap /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVRadialGradientLayer.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressAnimatedView.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVIndefiniteAnimatedView.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
/Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Intermediates/OtelApp.build/Debug-iphonesimulator/OtelApp.build/Objects-normal/x86_64/CheckInViewController~partial.swiftdoc : /Users/sunilvg/Desktop/updation/OtelApp/Offer.swift /Users/sunilvg/Desktop/updation/OtelApp/User.swift /Users/sunilvg/Desktop/updation/OtelApp/AppConfig.swift /Users/sunilvg/Desktop/updation/OtelApp/ServiceCaller.swift /Users/sunilvg/Desktop/updation/OtelApp/HomeViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/HomeCollectionViewCell.swift /Users/sunilvg/Desktop/updation/OtelApp/AsyncUser.swift /Users/sunilvg/Desktop/updation/OtelApp/OffersViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OtelApp/LoginViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OfferTableViewCell.swift /Users/sunilvg/Desktop/updation/OtelApp/CardView.swift /Users/sunilvg/Desktop/updation/OtelApp/ProfileViewController.swift /Users/sunilvg/Desktop/updation/OtelApp/OtelApp/AppDelegate.swift /Users/sunilvg/Desktop/updation/OtelApp/CheckInViewController.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/SwiftOnoneSupport.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/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIView+WebCacheOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+WebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImageView+HighlightedWebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+MultiFormat.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIImage+GIF.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/UIButton+WebCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImagePrefetcher.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageManager.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloaderOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageOperation.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDownloader.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageDecoder.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImageCompat.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDImageCache.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/NSData+ImageContentType.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Headers/SDWebImage-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SDWebImage/SDWebImage.framework/Modules/module.modulemap /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/SwiftyJSON.swiftmodule/x86_64.swiftmodule /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-Swift.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Headers/SwiftyJSON-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SwiftyJSON/SwiftyJSON.framework/Modules/module.modulemap /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVRadialGradientLayer.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressAnimatedView.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVIndefiniteAnimatedView.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Headers/SVProgressHUD-umbrella.h /Users/sunilvg/Desktop/updation/OtelApp/DerivedData/OtelApp/Build/Products/Debug-iphonesimulator/SVProgressHUD/SVProgressHUD.framework/Modules/module.modulemap /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.swiftmodule
|
D
|
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Vapor.build/Droplet/Droplet+Responder.swift.o : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Message+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Response+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Body+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+FormData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/FormData+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/StructuredData+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/Request+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Log+Convenience.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Resource.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/HTTP+Node.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/AcceptLanguage.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cache/Config+Cache.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Configurable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSONRepresentable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/StringInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/RequestInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Vapor+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/MediaType.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Config+Middleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Date/DateMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/File+Response.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Resolve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Serve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/DumpConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Config+ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoEncoding.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Chaining.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Droplet+Routing.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Config+Log.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RoutesLog.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Config+Hash.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogLevel.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Config+Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/ProviderInstall.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/HashProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CipherProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Int+Random.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Version.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSConfiguration.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RouteCollection.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Subscription.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mailgun.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Config+Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Responder.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileManager.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/ConsoleLogger.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/Config+Cipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoCipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/CryptoHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/BCryptHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/StaticViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/EngineServer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/SecurityLayer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/AbortError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider+Resources.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Directories.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Bytes.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/InitProtocols.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Sessions/Config+Sessions.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Responder+Helpers.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/WebSockets/WebSockets.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Exports.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/EngineClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/FoundationClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Response+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Request+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Event.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/Accept.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+Multipart.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/Abort.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer+Request.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/Config+View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorView.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/Config+ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Config+ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/URI.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/JSON.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/SMTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/HTTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/TLS.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/FormData.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Node.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cache.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/PathIndexable.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Routing.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Random.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Crypto.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Branches.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cookies.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Configs.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sessions.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/WebSockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/BCrypt.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Multipart.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Transport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/checkouts/engine.git--7533756970564908605/Sources/CHTTP/include/http_parser.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/checkouts/ctls.git--2818177660473049491/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Vapor.build/Droplet+Responder~partial.swiftmodule : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Message+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Response+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Body+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+FormData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/FormData+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/StructuredData+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/Request+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Log+Convenience.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Resource.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/HTTP+Node.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/AcceptLanguage.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cache/Config+Cache.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Configurable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSONRepresentable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/StringInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/RequestInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Vapor+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/MediaType.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Config+Middleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Date/DateMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/File+Response.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Resolve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Serve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/DumpConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Config+ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoEncoding.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Chaining.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Droplet+Routing.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Config+Log.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RoutesLog.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Config+Hash.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogLevel.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Config+Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/ProviderInstall.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/HashProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CipherProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Int+Random.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Version.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSConfiguration.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RouteCollection.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Subscription.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mailgun.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Config+Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Responder.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileManager.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/ConsoleLogger.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/Config+Cipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoCipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/CryptoHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/BCryptHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/StaticViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/EngineServer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/SecurityLayer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/AbortError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider+Resources.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Directories.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Bytes.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/InitProtocols.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Sessions/Config+Sessions.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Responder+Helpers.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/WebSockets/WebSockets.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Exports.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/EngineClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/FoundationClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Response+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Request+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Event.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/Accept.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+Multipart.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/Abort.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer+Request.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/Config+View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorView.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/Config+ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Config+ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/URI.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/JSON.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/SMTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/HTTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/TLS.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/FormData.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Node.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cache.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/PathIndexable.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Routing.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Random.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Crypto.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Branches.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cookies.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Configs.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sessions.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/WebSockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/BCrypt.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Multipart.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Transport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/checkouts/engine.git--7533756970564908605/Sources/CHTTP/include/http_parser.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/checkouts/ctls.git--2818177660473049491/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Vapor.build/Droplet+Responder~partial.swiftdoc : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Message+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Response+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/HTTP/Body+JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSON.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+FormData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewData.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/FormData+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/StructuredData+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/FormURLEncoded/Request+FormURLEncoded.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Log+Convenience.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Resource.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/HTTP+Node.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/AcceptLanguage.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cache/Config+Cache.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Configurable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/JSON/JSONRepresentable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/StringInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/RequestInitializable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Config+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Vapor+Console.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/MediaType.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Config+Middleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Date/DateMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorMiddleware.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/File+Response.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Resolve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Serve.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/DumpConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/Config+ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Serve/ServerConfig.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoEncoding.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Middleware/Chaining.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/Droplet+Routing.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/Config+Log.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RoutesLog.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Config+Hash.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogLevel.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Config+Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mail.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/ProviderInstall.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/LogProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/HashProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CipherProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactoryProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/Int+Random.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Commands/Version.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/CORS/CORSConfiguration.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Routing/RouteCollection.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Subscription.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Mail/Mailgun.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Config+Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet+Responder.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/File/FileManager.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Log/ConsoleLogger.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/Config+Cipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Cipher/CryptoCipher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/CryptoHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Hash/BCryptHasher.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/StaticViewRenderer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/EngineServer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/SecurityLayer.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/AbortError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Provider/Provider+Resources.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Config/Directories.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Bytes.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/InitProtocols.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Sessions/Config+Sessions.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Responder+Helpers.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/WebSockets/WebSockets.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Utilities/Exports.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Droplet/Droplet.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/EngineClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/FoundationClient.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Response+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Request+Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Content/Content.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Event/Event.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/HTTP/Accept.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Multipart/Request+Multipart.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/Abort.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/ViewRenderer+Request.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/Config+View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/View/View.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Error/ErrorView.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/Config+ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Server/ServerFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/Config+ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/vapor.git-5567719720411555524/Sources/Vapor/Engine/Client/ClientFactory.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/URI.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/JSON.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/SMTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/HTTP.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/TLS.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/FormData.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Node.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cache.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/PathIndexable.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Routing.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Random.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Crypto.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Branches.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Cookies.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Configs.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sessions.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Sockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/WebSockets.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/BCrypt.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Multipart.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Transport.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/checkouts/engine.git--7533756970564908605/Sources/CHTTP/include/http_parser.h /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/checkouts/ctls.git--2818177660473049491/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
|
D
|
<?xml version="1.0" encoding="UTF-8"?>
<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
<pageList>
<availablePage>
<emfPageIdentifier href="model.notation#_XPLPgCpvEeOfjLJLqMMGqw"/>
</availablePage>
<availablePage>
<emfPageIdentifier href="model.notation#_XKU10CqdEeOfjLJLqMMGqw"/>
</availablePage>
<availablePage>
<emfPageIdentifier href="model.notation#_-hKqkCqjEeOfjLJLqMMGqw"/>
</availablePage>
<availablePage>
<emfPageIdentifier href="model.notation#_upWyYCtpEeOfjLJLqMMGqw"/>
</availablePage>
<availablePage>
<emfPageIdentifier href="model.notation#_Mvc4YCzMEeOfjLJLqMMGqw"/>
</availablePage>
<availablePage>
<emfPageIdentifier href="model.notation#_K3fNACzTEeOfjLJLqMMGqw"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="model.notation#_XPLPgCpvEeOfjLJLqMMGqw"/>
</children>
<children>
<emfPageIdentifier href="model.notation#_XKU10CqdEeOfjLJLqMMGqw"/>
</children>
<children>
<emfPageIdentifier href="model.notation#_-hKqkCqjEeOfjLJLqMMGqw"/>
</children>
<children>
<emfPageIdentifier href="model.notation#_upWyYCtpEeOfjLJLqMMGqw"/>
</children>
<children>
<emfPageIdentifier href="model.notation#_Mvc4YCzMEeOfjLJLqMMGqw"/>
</children>
<children>
<emfPageIdentifier href="model.notation#_K3fNACzTEeOfjLJLqMMGqw"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
/+
Copyright (c) 2005-2006 Eric Anderton
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
+/
/**
Array wrapper template that provides exponential reserve characteristics
for tuning purposes.
**/
module ddl.ExpContainer;
//import ddl.omf.OMFBinary;
/**
Exponential reserve array template.
At times, the memory reserve behavior of the GC can actually create a
very large number of temporaries within the memory pool. In such cases,
overriding this behavior by creating an artifical reserve can yield
dramatic improvments in memory consumption and performance.
This container is optimized for opCatAssign() operations, as it will
attempt to store elements into its reserve space before reallocating.
Reallocation is performed by doubling the size of the reserve array
each time the reserve is exhausted. Therefore, the developer must be
very careful to only apply this container under small memory usage
scenarios.
TODO: use malloc()/realloc() here instead of new/GC.
TODO: set gc.scanRoot() for BaseType.sizeof >= ptr_t.sizeof
**/
struct ExpContainer(T){
//auto b = T;
alias T BaseType;//really it was typeof(T) BaseType, but it didn't compile 'cos of FIXUPP....
alias T[] ArrayType;
alias ExpContainer!(T) ContainerType;
static DefaultReserve = 100;
ArrayType data;
uint len;
public uint length(){
return len;
}
public void length(uint value){
this.len = value;
}
public void* ptr(){
return data.ptr;
}
public ArrayType all(){
return this.data[0..this.length];
}
public ArrayType dup(){
return this.data[0..this.length].dup;
}
public void reserve(uint length){
data.length = length;
}
public ContainerType opCatAssign(BaseType elem){
if(this.length < data.length){
this.data[this.length] = elem;
}
else if((data.length * BaseType.sizeof) <= 4096){
if(this.data.length == 0) this.data.length = DefaultReserve;
else this.data.length = this.data.length * 2;
}
else{
this.data ~= elem;
}
this.length = this.length + 1;
return *this;
}
public ContainerType opCat(BaseType elem){
ContainerType result;
result.data = this.data ~ elem;
result.length = result.data.length;
return result;
}
public ContainerType opSlice(uint start,uint end){
ContainerType result;
result.data = this.data[start..end];
result.length = result.data.length;
return result;
}
public BaseType opIndex(uint idx){
return this.data[idx];
}
public int opApply(int delegate(inout int,inout BaseType) dg){
int result = 0;
for (int i = 0; i < this.length; i++){
result = dg(i,this.data[i]);
if (result)
break;
}
return result;
}
public int opApply(int delegate(inout BaseType) dg){
int result = 0;
for (uint i = 0; i < this.length; i++){
result = dg(this.data[i]);
if (result)
break;
}
return result;
}
}
|
D
|
META
{
Parser = Game;
MergeMode = true;
Engine = G2A;
};
func void b_enter_newworld()
{
Hlp_PrintConsole("HookTest 1");
var int x;
var string y;
x = 5000;
y = IntToString(x);
Hlp_PrintConsole(y);
b_enter_newworld_Old();
};
|
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_1_BeT-5111261185.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</availablePage>
</pageList>
<sashModel currentSelection="//@sashModel/@windows.0/@children.0">
<windows>
<children xsi:type="di:TabFolder">
<children>
<emfPageIdentifier href="VAR_1_BeT-5111261185.notation#_copSALmGEeKQQp7P9cQvNQ"/>
</children>
</children>
</windows>
</sashModel>
</di:SashWindowsMngr>
|
D
|
/**
* Compiler runtime function symbols
*
* Compiler implementation of the
* $(LINK2 https://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1994-1998 by Symantec
* Copyright (C) 2000-2021 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: https://github.com/dlang/dmd/blob/master/src/dmd/backend/_rtlsym.d
* Documentation: https://dlang.org/phobos/dmd_backend_rtlsym.html
*/
module dmd.backend.rtlsym;
import dmd.backend.cc : Symbol;
enum RTLSYM
{
THROW,
THROWC,
THROWDWARF,
MONITOR_HANDLER,
MONITOR_PROLOG,
MONITOR_EPILOG,
DCOVER,
DCOVER2,
DASSERT,
DASSERTP,
DASSERT_MSG,
DUNITTEST,
DUNITTESTP,
DUNITTEST_MSG,
DARRAY,
DARRAYP,
DARRAY_SLICEP,
DARRAY_INDEXP,
DINVARIANT,
MEMCPY,
MEMSET8,
MEMSET16,
MEMSET32,
MEMSET64,
MEMSET128,
MEMSET128ii,
MEMSET80,
MEMSET160,
MEMSETFLOAT,
MEMSETDOUBLE,
MEMSETSIMD,
MEMSETN,
MODULO,
MONITORENTER,
MONITOREXIT,
CRITICALENTER,
CRITICALEXIT,
SWITCH_STRING, // unused
SWITCH_USTRING, // unused
SWITCH_DSTRING, // unused
DSWITCHERR,
DHIDDENFUNC,
NEWCLASS,
NEWTHROW,
NEWARRAYT,
NEWARRAYIT,
NEWITEMT,
NEWITEMIT,
NEWARRAYMTX,
NEWARRAYMITX,
ARRAYLITERALTX,
ASSOCARRAYLITERALTX,
CALLFINALIZER,
CALLINTERFACEFINALIZER,
DELCLASS,
DELINTERFACE,
DELSTRUCT,
ALLOCMEMORY,
DELARRAYT,
DELMEMORY,
INTERFACE,
DYNAMIC_CAST,
INTERFACE_CAST,
FATEXIT,
ARRAYCATT,
ARRAYCATNTX,
ARRAYAPPENDT,
ARRAYAPPENDCTX,
ARRAYAPPENDCD,
ARRAYAPPENDWD,
ARRAYSETLENGTHT,
ARRAYSETLENGTHIT,
ARRAYCOPY,
ARRAYASSIGN,
ARRAYASSIGN_R,
ARRAYASSIGN_L,
ARRAYCTOR,
ARRAYSETASSIGN,
ARRAYSETCTOR,
ARRAYCAST, // unused
ARRAYEQ, // unused
ARRAYEQ2,
ARRAYCMP, // unused
ARRAYCMP2, // unused
ARRAYCMPCHAR, // unused
OBJ_EQ, // unused
OBJ_CMP, // unused
EXCEPT_HANDLER2,
EXCEPT_HANDLER3,
CPP_HANDLER,
D_HANDLER,
D_LOCAL_UNWIND2,
LOCAL_UNWIND2,
UNWIND_RESUME,
PERSONALITY,
BEGIN_CATCH,
CXA_BEGIN_CATCH,
CXA_END_CATCH,
TLS_INDEX,
TLS_ARRAY,
AHSHIFT,
HDIFFN,
HDIFFF,
INTONLY,
EXCEPT_LIST,
SETJMP3,
LONGJMP,
ALLOCA,
CPP_LONGJMP,
PTRCHK,
CHKSTK,
TRACE_PRO_N,
TRACE_PRO_F,
TRACE_EPI_N,
TRACE_EPI_F,
TRACE_CPRO,
TRACE_CEPI,
TRACENEWCLASS,
TRACENEWARRAYT,
TRACENEWARRAYIT,
TRACENEWARRAYMTX,
TRACENEWARRAYMITX,
TRACENEWITEMT,
TRACENEWITEMIT,
TRACECALLFINALIZER,
TRACECALLINTERFACEFINALIZER,
TRACEDELCLASS,
TRACEDELINTERFACE,
TRACEDELSTRUCT,
TRACEDELARRAYT,
TRACEDELMEMORY,
TRACEARRAYLITERALTX,
TRACEASSOCARRAYLITERALTX,
TRACEARRAYCATT,
TRACEARRAYCATNTX,
TRACEARRAYAPPENDT,
TRACEARRAYAPPENDCTX,
TRACEARRAYAPPENDCD,
TRACEARRAYAPPENDWD,
TRACEARRAYSETLENGTHT,
TRACEARRAYSETLENGTHIT,
TRACEALLOCMEMORY,
C_ASSERT,
C__ASSERT,
C__ASSERT_FAIL,
C__ASSERT_RTN,
CXA_ATEXIT
}
extern (C++):
nothrow:
@safe:
Symbol *getRtlsym(RTLSYM i);
Symbol *getRtlsymPersonality();
|
D
|
module test.codec.websocket.model;
import hunt.http.codec.websocket.model.ExtensionConfig;
import hunt.Assert;
import hunt.util.Test;
import java.util.HashMap;
import java.util.Map;
public class ExtensionConfigTest {
private void assertConfig(ExtensionConfig cfg, string expectedName, Map!(string, string) expectedParams) {
string prefix = "ExtensionConfig";
Assert.assertThat(prefix ~ ".Name", cfg.getName(), is(expectedName));
prefix += ".getParameters()";
Map!(string, string) actualParams = cfg.getParameters();
Assert.assertThat(prefix, actualParams, notNullValue());
Assert.assertThat(prefix ~ ".size", actualParams.size(), is(expectedParams.size()));
for (string expectedKey : expectedParams.keySet()) {
Assert.assertThat(prefix ~ ".containsKey(" ~ expectedKey ~ ")", actualParams.containsKey(expectedKey), is(true));
string expectedValue = expectedParams.get(expectedKey);
string actualValue = actualParams.get(expectedKey);
Assert.assertThat(prefix ~ ".containsKey(" ~ expectedKey ~ ")", actualValue, is(expectedValue));
}
}
public void testParseMuxExample() {
ExtensionConfig cfg = ExtensionConfig.parse("mux; max-channels=4; flow-control");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("max-channels", "4");
expectedParams.put("flow-control", null);
assertConfig(cfg, "mux", expectedParams);
}
public void testParsePerMessageCompressExample1() {
ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=foo");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("method", "foo");
assertConfig(cfg, "permessage-compress", expectedParams);
}
public void testParsePerMessageCompressExample2() {
ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo; x=10\"");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("method", "foo; x=10");
assertConfig(cfg, "permessage-compress", expectedParams);
}
public void testParsePerMessageCompressExample3() {
ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo, bar\"");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("method", "foo, bar");
assertConfig(cfg, "permessage-compress", expectedParams);
}
public void testParsePerMessageCompressExample4() {
ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo; use_x, foo\"");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("method", "foo; use_x, foo");
assertConfig(cfg, "permessage-compress", expectedParams);
}
public void testParsePerMessageCompressExample5() {
ExtensionConfig cfg = ExtensionConfig.parse("permessage-compress; method=\"foo; x=\\\"Hello World\\\", bar\"");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("method", "foo; x=\"Hello World\", bar");
assertConfig(cfg, "permessage-compress", expectedParams);
}
public void testParseSimple_BasicParameters() {
ExtensionConfig cfg = ExtensionConfig.parse("bar; baz=2");
Map!(string, string) expectedParams = new HashMap<>();
expectedParams.put("baz", "2");
assertConfig(cfg, "bar", expectedParams);
}
public void testParseSimple_NoParameters() {
ExtensionConfig cfg = ExtensionConfig.parse("foo");
Map!(string, string) expectedParams = new HashMap<>();
assertConfig(cfg, "foo", expectedParams);
}
}
|
D
|
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 1984-1995 by Symantec
* Copyright (C) 2000-2018 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/backend/dcgcv.d, backend/dcgcv.d)
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/dcgcv.d
*/
module dmd.backend.dcgcv;
version (Windows)
{
version (SCPP)
version = COMPILE;
version (MARS)
version = COMPILE;
}
version (COMPILE)
{
import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import dmd.backend.cc;
import dmd.backend.cdef;
import dmd.backend.cgcv;
import dmd.backend.code;
import dmd.backend.code_x86;
import dmd.backend.cv4;
import dmd.backend.dlist;
import dmd.backend.dvec;
import dmd.backend.el;
import dmd.backend.global;
import dmd.backend.memh;
import dmd.backend.obj;
import dmd.backend.outbuf;
import dmd.backend.ty;
import dmd.backend.type;
import dmd.backend.barray;
version (SCPP)
{
import cpp;
import msgs2;
import parser;
}
version (MARS)
{
import dmd.backend.varstats;
}
extern (C++):
enum SYMDEB_TDB = false;
extern (C) void TOOFFSET(void* p, targ_size_t value)
{
switch (_tysize[TYnptr])
{
case 2: *cast(ushort*)p = cast(ushort)value; break;
case 4: *cast(uint*) p = cast(uint) value; break;
case 8: *cast(ulong*) p = cast(ulong) value; break;
default:
assert(0);
}
}
extern __gshared char* ftdbname;
// Convert from SFL protections to CV4 protections
uint SFLtoATTR(uint sfl) { return 4 - ((sfl & SFLpmask) >> 5); }
__gshared
{
/* Dynamic array of debtyp_t's */
private Barray!(debtyp_t*) debtyp;
private vec_t debtypvec; // vector of used entries
enum DEBTYPVECDIM = 16001; //8009 //3001 // dimension of debtypvec (should be prime)
enum DEBTYPHASHDIM = 1009;
private uint[DEBTYPHASHDIM] debtyphash;
private Outbuffer *reset_symbuf; // Keep pointers to reset symbols
idx_t DEB_NULL() { return cgcv.deb_offset; } // index of null debug type record
/* This limitation is because of 4K page sizes
* in optlink/cv/cvhashes.asm
*/
enum CVIDMAX = (0xFF0-20); // the -20 is picked by trial and error
enum LOCATsegrel = 0xC000;
/* Unfortunately, the fixup stuff is different for EASY OMF and Microsoft */
enum EASY_LCFDoffset = (LOCATsegrel | 0x1404);
enum EASY_LCFDpointer = (LOCATsegrel | 0x1800);
enum LCFD32offset = (LOCATsegrel | 0x2404);
enum LCFD32pointer = (LOCATsegrel | 0x2C00);
enum LCFD16pointer = (LOCATsegrel | 0x0C00);
version (MARS)
extern Cgcv cgcv; // already declared in cgcv.d
else
Cgcv cgcv;
}
version (MARS)
enum MARS = true;
else
enum MARS = false;
/******************************************
* Return number of bytes consumed in OBJ file by a name.
*/
int cv_stringbytes(const(char)* name)
{
int len = cast(int)strlen(name);
if (config.fulltypes == CV8)
return len + 1;
if (len > CVIDMAX)
len = CVIDMAX;
return len + ((len > 255) ? 4 : 1);
}
/******************************************
* Stuff a namestring into p.
* Returns:
* number of bytes consumed
*/
int cv_namestring(ubyte *p, const(char)* name, int length = -1)
{
size_t len = (length >= 0) ? length : strlen(name);
if (config.fulltypes == CV8)
{
size_t numBytesWritten = len + ((length < 0) ? 1 : 0);
memcpy(p, name, numBytesWritten);
if(config.flags2 & CFG2gms)
{
for(int i = 0; i < len; i++)
{
if(p[i] == '.')
p[i] = '@';
}
}
return cast(int)numBytesWritten;
}
if (len > 255)
{ p[0] = 0xFF;
p[1] = 0;
if (len > CVIDMAX)
len = CVIDMAX;
TOWORD(p + 2,cast(uint)len);
memcpy(p + 4,name,len);
len += 4;
}
else
{ p[0] = cast(ubyte)len;
memcpy(p + 1,name,len);
len++;
}
return cast(int)len;
}
/***********************************
* Compute debug register number for symbol s.
* Returns:
* 0..7 byte registers
* 8..15 word registers
* 16..23 dword registers
*/
private int cv_regnum(Symbol *s)
{
uint reg = s.Sreglsw;
if (s.Sclass == SCpseudo)
{
version (SCPP)
reg = pseudoreg[reg];
}
else
{
assert(reg < 8);
assert(s.Sfl == FLreg);
switch (type_size(s.Stype))
{
case LONGSIZE:
case 3: reg += 8;
goto case;
case SHORTSIZE: reg += 8;
goto case;
case CHARSIZE: break;
case LLONGSIZE:
reg += (s.Sregmsw << 8) + (16 << 8) + 16;
if (config.fulltypes == CV4)
reg += (1 << 8);
break;
default:
static if (0)
{
symbol_print(s);
type_print(s.Stype);
printf("size = %d\n",type_size(s.Stype));
}
assert(0);
}
}
if (config.fulltypes == CV4)
reg++;
return reg;
}
/***********************************
* Allocate a debtyp_t.
*/
debtyp_t * debtyp_alloc(uint length)
{
debtyp_t *d;
uint pad = 0;
//printf("len = %u, x%x\n", length, length);
if (config.fulltypes == CV8)
{ // length+2 must lie on 4 byte boundary
pad = ((length + 2 + 3) & ~3) - (length + 2);
length += pad;
}
debug
{
const len = debtyp_t.sizeof - (d.data).sizeof + length;
assert(len < 4 * 4096 - 100);
d = cast(debtyp_t *) mem_malloc(len /*+ 1*/);
memset(d, 0xAA, len);
// (cast(char*)d)[len] = 0x2E;
}
else
{
assert(length < 0x10000);
d = cast(debtyp_t *) malloc(debtyp_t.sizeof - (d.data).sizeof + length);
}
d.length = cast(ushort)length;
if (pad)
{
__gshared const ubyte[3] padx = [0xF3, 0xF2, 0xF1];
memcpy(d.data.ptr + length - pad, padx.ptr + 3 - pad, pad);
}
//printf("debtyp_alloc(%d) = %p\n", length, d);
return d;
}
/***********************************
* Free a debtyp_t.
*/
private void debtyp_free(debtyp_t *d)
{
//printf("debtyp_free(length = %d, %p)\n", d.length, d);
//fflush(stdout);
debug
{
uint len = debtyp_t.sizeof - (d.data).sizeof + d.length;
assert(len < 4 * 4096 - 100);
// assert((cast(char*)d)[len] == 0x2E);
memset(d, 0x55, len);
mem_free(d);
}
else
{
free(d);
}
}
static if (0)
{
void debtyp_check(debtyp_t *d,int linnum)
{ int i;
__gshared char c;
//printf("linnum = %d\n",linnum);
//printf(" length = %d\n",d.length);
for (i = 0; i < d.length; i++)
c = d.data.ptr[i];
}
void debtyp_check(debtyp_t* d) { debtyp_check(d,__LINE__); }
}
else
{
void debtyp_check(debtyp_t* d) { }
}
/***********************************
* Search for debtyp_t in debtyp[]. If it is there, return the index
* of it, and free d. Otherwise, add it.
* Returns:
* index in debtyp[]
*/
idx_t cv_debtyp(debtyp_t *d)
{
ushort length;
uint hashi;
assert(d);
length = d.length;
//printf("length = %3d\n",length);
static if (SYMDEB_TDB)
{
if (config.fulltypes == CVTDB)
{
idx_t result;
static if (1)
{
assert(length);
debtyp_check(d);
result = tdb_typidx(&d.length);
}
else
{
ubyte *buf;
// Allocate buffer
buf = malloc(6 + length);
if (!buf)
err_nomem(); // out of memory
// Fill the buffer
TOLONG(buf,cgcv.signature);
memcpy(buf + 4,cast(char *)d + uint.sizeof,2 + length);
static if (0)
{
{int i;
for (i=0;i<length;i++)
printf("%02x ",buf[6+i]);
printf("\n");
}
}
result = tdb_typidx(buf,6 + length);
}
//printf("result = x%x\n",result);
debtyp_free(d);
return result;
}
}
if (length)
{ uint hash;
hash = length;
if (length >= uint.sizeof)
{
// Hash consists of the sum of the first 4 bytes with the last 4 bytes
union U { ubyte* cp; uint* up; }
U un = void;
un.cp = d.data.ptr;
hash += *un.up;
un.cp += length - uint.sizeof;
hash += *un.up;
}
hashi = hash % DEBTYPHASHDIM;
hash %= DEBTYPVECDIM;
//printf(" hashi = %d", hashi);
if (vec_testbit(hash,debtypvec))
{
//printf(" test");
// Threaded list is much faster
for (uint u = debtyphash[hashi]; u; u = debtyp[u].prev)
//for (uint u = debtyp.length; u--; )
{
if (length == debtyp[u].length &&
memcmp(d.data.ptr,debtyp[u].data.ptr,length) == 0)
{ debtyp_free(d);
//printf(" match %d\n",u);
return u + cgcv.deb_offset;
}
}
}
else
vec_setbit(hash,debtypvec);
}
else
hashi = 1;
//printf(" add %d\n",debtyp.length);
d.prev = debtyphash[hashi];
debtyphash[hashi] = cast(uint)debtyp.length;
/* It's not already in the array, so add it */
L1:
debtyp.push(d);
version (SCPP)
{
if (debtyp.length >= 0xE000)
err_fatal(EM_2manytypes,0xE000); // too many types
}
return cast(uint)debtyp.length - 1 + cgcv.deb_offset;
}
idx_t cv_numdebtypes()
{
return cast(idx_t)debtyp.length;
}
/****************************
* Store a null record at DEB_NULL.
*/
void cv_init()
{ debtyp_t *d;
//printf("cv_init()\n");
// Initialize statics
debtyp.setLength(0);
if (!ftdbname)
ftdbname = cast(char *)"symc.tdb".ptr;
memset(&cgcv,0,cgcv.sizeof);
cgcv.sz_idx = 2;
cgcv.LCFDoffset = LCFD32offset;
cgcv.LCFDpointer = LCFD16pointer;
debtypvec = vec_calloc(DEBTYPVECDIM);
memset(debtyphash.ptr,0,debtyphash.sizeof);
if (reset_symbuf)
{
Symbol **p = cast(Symbol **)reset_symbuf.buf;
const size_t n = reset_symbuf.size() / (Symbol *).sizeof;
for (size_t i = 0; i < n; ++i)
symbol_reset(p[i]);
reset_symbuf.setsize(0);
}
else
{
reset_symbuf = cast(Outbuffer*) calloc(1, Outbuffer.sizeof);
assert(reset_symbuf);
reset_symbuf.enlarge(10 * (Symbol *).sizeof);
}
/* Reset for different OBJ file formats */
if (I32 || I64)
{
// Adjust values in old CV tables for 32 bit ints
dttab[TYenum] = dttab[TYlong];
dttab[TYint] = dttab[TYlong];
dttab[TYuint] = dttab[TYulong];
// Adjust Codeview 4 values for 32 bit ints and 32 bit pointer offsets
dttab4[TYenum] = 0x74;
dttab4[TYint] = 0x74;
dttab4[TYuint] = 0x75;
if (I64)
{
dttab4[TYptr] = 0x600;
dttab4[TYnptr] = 0x600;
}
else
{
dttab4[TYptr] = 0x400;
dttab4[TYnptr] = 0x400;
}
dttab4[TYsptr] = 0x400;
dttab4[TYcptr] = 0x400;
dttab4[TYfptr] = 0x500;
if (config.flags & CFGeasyomf)
{ cgcv.LCFDoffset = EASY_LCFDoffset;
cgcv.LCFDpointer = EASY_LCFDpointer;
assert(config.fulltypes == CVOLD);
}
else
cgcv.LCFDpointer = LCFD32pointer;
if (config.exe & EX_flat)
cgcv.FD_code = 0x10;
}
if (config.fulltypes >= CV4)
{ int flags;
__gshared ushort[5] memmodel = [0,0x100,0x20,0x120,0x120];
char[1 + (VERSION).sizeof] version_;
ubyte[8 + (version_).sizeof] debsym;
// Put out signature indicating CV4 format
switch (config.fulltypes)
{
case CV4:
cgcv.signature = 1;
break;
case CV8:
cgcv.signature = 4;
break;
default:
{ const(char)* x = "1MYS";
cgcv.signature = *cast(int *) x;
break;
}
}
cgcv.deb_offset = 0x1000;
if (config.fulltypes == CV8)
{ cgcv.sz_idx = 4;
return; // figure out rest later
}
if (config.fulltypes >= CVSYM)
{ cgcv.sz_idx = 4;
if (!(config.flags2 & CFG2phgen))
cgcv.deb_offset = 0x80000000;
}
objmod.write_bytes(SegData[DEBSYM],4,&cgcv.signature);
// Allocate an LF_ARGLIST with no arguments
if (config.fulltypes == CV4)
{ d = debtyp_alloc(4);
TOWORD(d.data.ptr,LF_ARGLIST);
TOWORD(d.data.ptr + 2,0);
}
else
{ d = debtyp_alloc(6);
TOWORD(d.data.ptr,LF_ARGLIST);
TOLONG(d.data.ptr + 2,0);
}
// Put out S_COMPILE record
TOWORD(debsym.ptr + 2,S_COMPILE);
switch (config.target_cpu)
{
case TARGET_8086: debsym[4] = 0; break;
case TARGET_80286: debsym[4] = 2; break;
case TARGET_80386: debsym[4] = 3; break;
case TARGET_80486: debsym[4] = 4; break;
case TARGET_Pentium:
case TARGET_PentiumMMX:
debsym[4] = 5; break;
case TARGET_PentiumPro:
case TARGET_PentiumII:
debsym[4] = 6; break;
default: assert(0);
}
debsym[5] = (CPP != 0); // 0==C, 1==C++
flags = (config.inline8087) ? (0<<3) : (1<<3);
if (I32)
flags |= 0x80; // 32 bit addresses
flags |= memmodel[config.memmodel];
TOWORD(debsym.ptr + 6,flags);
version_[0] = 'Z';
strcpy(version_.ptr + 1,VERSION);
cv_namestring(debsym.ptr + 8,version_.ptr);
TOWORD(debsym.ptr,6 + (version_).sizeof);
objmod.write_bytes(SegData[DEBSYM],8 + (version_).sizeof,debsym.ptr);
static if (SYMDEB_TDB)
{
// Put out S_TDBNAME record
if (config.fulltypes == CVTDB)
{
ubyte[50] buf = void;
pstate.STtdbtimestamp = tdb_gettimestamp();
size_t len = cv_stringbytes(ftdbname);
ubyte *ds = (8 + len <= buf.sizeof) ? buf : cast(ubyte *) malloc(8 + len);
assert(ds);
TOWORD(ds,6 + len);
TOWORD(ds + 2,S_TDBNAME);
TOLONG(ds + 4,pstate.STtdbtimestamp);
cv_namestring(ds + 8,ftdbname);
objmod.write_bytes(SegData[DEBSYM],8 + len,ds);
if (ds != buf)
free(ds);
}
}
}
else
{
assert(0);
}
if (config.fulltypes == CVTDB)
cgcv.deb_offset = cv_debtyp(d);
else
cv_debtyp(d);
}
/////////////////////////// CodeView 4 ///////////////////////////////
/***********************************
* Return number of bytes required to store a numeric leaf.
*/
uint cv4_numericbytes(uint value)
{ uint u;
if (value < 0x8000)
u = 2;
else if (value < 0x10000)
u = 4;
else
u = 6;
return u;
}
/********************************
* Store numeric leaf.
* Must use exact same number of bytes as cv4_numericbytes().
*/
void cv4_storenumeric(ubyte *p, uint value)
{
if (value < 0x8000)
TOWORD(p,value);
else if (value < 0x10000)
{ TOWORD(p,LF_USHORT);
p += 2;
TOWORD(p,value);
}
else
{ TOWORD(p,LF_ULONG);
*cast(targ_ulong *)(p + 2) = cast(uint) value;
}
}
/***********************************
* Return number of bytes required to store a signed numeric leaf.
* Params:
* value = value to store
* Returns:
* number of bytes required for storing value
*/
uint cv4_signednumericbytes(int value)
{
uint u;
if (value >= 0 && value < 0x8000)
u = 2;
else if (value == cast(short)value)
u = 4;
else
u = 6;
return u;
}
/********************************
* Store signed numeric leaf.
* Must use exact same number of bytes as cv4_signednumericbytes().
* Params:
* p = address where to store value
* value = value to store
*/
void cv4_storesignednumeric(ubyte *p, int value)
{
if (value >= 0 && value < 0x8000)
TOWORD(p, value);
else if (value == cast(short)value)
{
TOWORD(p, LF_SHORT);
TOWORD(p + 2, value);
}
else
{
TOWORD(p,LF_LONG);
TOLONG(p + 2, value);
}
}
/*********************************
* Generate a type index for a parameter list.
*/
idx_t cv4_arglist(type *t,uint *pnparam)
{ uint u;
uint nparam;
idx_t paramidx;
debtyp_t *d;
param_t *p;
// Compute nparam, number of parameters
nparam = 0;
for (p = t.Tparamtypes; p; p = p.Pnext)
nparam++;
*pnparam = nparam;
// Construct an LF_ARGLIST of those parameters
if (nparam == 0)
{
if (config.fulltypes == CV8)
{
d = debtyp_alloc(2 + 4 + 4);
TOWORD(d.data.ptr,LF_ARGLIST_V2);
TOLONG(d.data.ptr + 2,1);
TOLONG(d.data.ptr + 6,0);
paramidx = cv_debtyp(d);
}
else
paramidx = DEB_NULL;
}
else
{
switch (config.fulltypes)
{
case CV8:
d = debtyp_alloc(2 + 4 + nparam * 4);
TOWORD(d.data.ptr,LF_ARGLIST_V2);
TOLONG(d.data.ptr + 2,nparam);
p = t.Tparamtypes;
for (u = 0; u < nparam; u++)
{ TOLONG(d.data.ptr + 6 + u * 4,cv4_typidx(p.Ptype));
p = p.Pnext;
}
break;
case CV4:
d = debtyp_alloc(2 + 2 + nparam * 2);
TOWORD(d.data.ptr,LF_ARGLIST);
TOWORD(d.data.ptr + 2,nparam);
p = t.Tparamtypes;
for (u = 0; u < nparam; u++)
{ TOWORD(d.data.ptr + 4 + u * 2,cv4_typidx(p.Ptype));
p = p.Pnext;
}
break;
default:
d = debtyp_alloc(2 + 4 + nparam * 4);
TOWORD(d.data.ptr,LF_ARGLIST);
TOLONG(d.data.ptr + 2,nparam);
p = t.Tparamtypes;
for (u = 0; u < nparam; u++)
{ TOLONG(d.data.ptr + 6 + u * 4,cv4_typidx(p.Ptype));
p = p.Pnext;
}
break;
}
paramidx = cv_debtyp(d);
}
return paramidx;
}
/*****************************
* Build LF_METHODLIST for overloaded member function.
* Output:
* *pcount # of entries in method list
* Returns:
* type index of method list
* 0 don't do this one
*/
version (SCPP)
{
private int cv4_methodlist(Symbol *sf,int *pcount)
{ int count;
int mlen;
Symbol *s;
debtyp_t *d;
ubyte *p;
ushort attribute;
symbol_debug(sf);
// First, compute how big the method list is
count = 0;
mlen = 2;
for (s = sf; s; s = s.Sfunc.Foversym)
{
if (s.Sclass == SCtypedef || s.Sclass == SCfunctempl)
continue;
if (s.Sfunc.Fflags & Fnodebug)
continue;
if (s.Sfunc.Fflags & Fintro)
mlen += 4;
mlen += cgcv.sz_idx * 2;
count++;
}
if (!count)
return 0;
// Allocate and fill it in
d = debtyp_alloc(mlen);
p = d.data.ptr;
TOWORD(p,LF_METHODLIST);
p += 2;
for (s = sf; s; s = s.Sfunc.Foversym)
{
if (s.Sclass == SCtypedef || s.Sclass == SCfunctempl)
continue;
if (s.Sfunc.Fflags & Fnodebug)
continue;
attribute = cast(ushort)SFLtoATTR(s.Sflags);
// Make sure no overlapping bits
assert((Fvirtual | Fpure | Fintro | Fstatic) == (Fvirtual ^ Fpure ^ Fintro ^ Fstatic));
switch ((s.Sfunc.Fflags & (Fvirtual | Fstatic)) |
(s.Sfunc.Fflags & (Fpure | Fintro)))
{
// BUG: should we have 0x0C, friend functions?
case Fstatic: attribute |= 0x08; break;
case Fvirtual: attribute |= 0x04; break;
case Fvirtual | Fintro: attribute |= 0x10; break;
case Fvirtual | Fpure: attribute |= 0x14; break;
case Fvirtual | Fintro | Fpure: attribute |= 0x18; break;
case 0:
break;
default:
symbol_print(s);
assert(0);
}
TOIDX(p,attribute);
p += cgcv.sz_idx;
TOIDX(p,cv4_symtypidx(s));
p += cgcv.sz_idx;
if (s.Sfunc.Fflags & Fintro)
{ TOLONG(p,cpp_vtbloffset(cast(Classsym *)s.Sscope,s));
p += 4;
}
}
assert(p - d.data.ptr == mlen);
*pcount = count;
return cv_debtyp(d);
}
}
/**********************************
* Pretty-print indentifier for CV4 types.
*/
version (SCPP)
{
private char * cv4_prettyident(Symbol *s)
{ Symbol *stmp;
char *p;
stmp = s.Sscope;
s.Sscope = null; // trick cpp_prettyident into leaving off ::
p = cpp_prettyident(s);
s.Sscope = cast(Classsym *)stmp;
return p;
}
}
/****************************
* Return type index of struct.
* Input:
* s struct tag symbol
* flags
* 0 generate a reference to s
* 1 just saw the definition of s
* 2 saw key function for class s
* 3 no longer have a key function for class s
*/
idx_t cv4_struct(Classsym *s,int flags)
{ targ_size_t size;
debtyp_t* d,dt;
uint len;
uint nfields,fnamelen;
idx_t typidx;
type *t;
symlist_t sl;
struct_t *st;
char *id;
version (SCPP)
{
baseclass_t *b;
}
uint numidx;
uint leaf;
uint property;
uint attribute;
ubyte *p;
int refonly;
int i;
int count; // COUNT field in LF_CLASS
symbol_debug(s);
assert(config.fulltypes >= CV4);
st = s.Sstruct;
if (st.Sflags & STRanonymous) // if anonymous class/union
return 0;
//printf("cv4_struct(%s,%d)\n",s.Sident.ptr,flags);
t = s.Stype;
//printf("t = %p, Tflags = x%x\n", t, t.Tflags);
type_debug(t);
// Determine if we should do a reference or a definition
refonly = 1; // assume reference only
if (MARS || t.Tflags & TFsizeunknown || st.Sflags & STRoutdef)
{
//printf("ref only\n");
}
else
{
// We have a definition that we have not put out yet
switch (flags)
{
case 0: // reference to s
version (SCPP)
{
if (!CPP ||
config.flags2 & (CFG2fulltypes | CFG2hdrdebug) ||
!(st.Sflags & STRvtblext))
refonly = 0;
}
else
{
refonly = 0;
}
break;
case 1: // saw def of s
if (!s.Stypidx) // if not forward referenced
return 0;
version (SCPP)
{
if (!CPP ||
config.flags2 & CFG2fulltypes ||
!(st.Sflags & STRvtblext))
refonly = 0;
}
break;
version (SCPP)
{
case 2: // saw key func for s
if (config.flags2 & CFG2fulltypes)
return 0;
refonly = 0;
break;
case 3: // no longer have key func for s
if (!s.Stypidx || config.flags2 & CFG2fulltypes)
return 0;
refonly = 0;
break;
}
default:
assert(0);
}
}
if (MARS || refonly)
{
if (s.Stypidx) // if reference already generated
{ //assert(s.Stypidx - cgcv.deb_offset < debtyp.length);
return s.Stypidx; // use already existing reference
}
size = 0;
property = 0x80; // class is forward referenced
}
else
{ size = type_size(t);
st.Sflags |= STRoutdef;
property = 0;
}
version (SCPP)
{
if (CPP)
{
if (s.Sscope) // if class is nested
property |= 8;
if (st.Sctor || st.Sdtor)
property |= 2; // class has ctors and/or dtors
if (st.Sopoverload)
property |= 4; // class has overloaded operators
if (st.Scastoverload)
property |= 0x40; // class has casting methods
if (st.Sopeq && !(st.Sopeq.Sfunc.Fflags & Fnodebug))
property |= 0x20; // class has overloaded assignment
}
}
id = prettyident(s);
if (config.fulltypes == CV4)
{ numidx = (st.Sflags & STRunion) ? 8 : 12;
len = numidx + cv4_numericbytes(cast(uint)size);
d = debtyp_alloc(len + cv_stringbytes(id));
cv4_storenumeric(d.data.ptr + numidx,cast(uint)size);
}
else
{ numidx = (st.Sflags & STRunion) ? 10 : 18;
len = numidx + 4;
d = debtyp_alloc(len + cv_stringbytes(id));
TOLONG(d.data.ptr + numidx,cast(uint)size);
}
len += cv_namestring(d.data.ptr + len,id);
switch (s.Sclass)
{
case SCstruct:
leaf = LF_STRUCTURE;
if (st.Sflags & STRunion)
{ leaf = LF_UNION;
break;
}
if (st.Sflags & STRclass)
leaf = LF_CLASS;
goto L1;
L1:
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 8,0); // dList
else
TOLONG(d.data.ptr + 10,0); // dList
if (CPP)
{
version (SCPP)
{
debtyp_t *vshape;
uint n;
ubyte descriptor;
list_t vl;
vl = st.Svirtual;
n = list_nitems(vl);
if (n == 0) // if no virtual functions
{
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 10,0); // vshape is 0
else
TOLONG(d.data.ptr + 14,0); // vshape is 0
}
else
{
vshape = debtyp_alloc(4 + (n + 1) / 2);
TOWORD(vshape.data.ptr,LF_VTSHAPE);
TOWORD(vshape.data.ptr + 2,1);
n = 0;
descriptor = 0;
for (; vl; vl = list_next(vl))
{ mptr_t *m;
tym_t ty;
m = list_mptr(vl);
symbol_debug(m.MPf);
ty = tybasic(m.MPf.ty());
assert(tyfunc(ty));
if (_tysize[TYint] == 4)
descriptor |= 5;
if (tyfarfunc(ty))
descriptor++;
vshape.data.ptr[4 + n / 2] = descriptor;
descriptor <<= 4;
n++;
}
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 10,cv_debtyp(vshape)); // vshape
else
TOLONG(d.data.ptr + 14,cv_debtyp(vshape)); // vshape
}
}
}
else
{
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 10,0); // vshape
else
TOLONG(d.data.ptr + 14,0); // vshape
}
break;
default:
symbol_print(s);
assert(0);
}
TOWORD(d.data.ptr,leaf);
// Assign a number to prevent infinite recursion if a struct member
// references the same struct.
if (config.fulltypes == CVTDB)
{
static if (SYMDEB_TDB)
{
TOWORD(d.data.ptr + 2,0); // number of fields
TOLONG(d.data.ptr + 6,0); // field list is 0
TOWORD(d.data.ptr + 4,property | 0x80); // set fwd ref bit
static if (0)
{
printf("fwd struct ref\n");
{int i;
printf("len = %d, length = %d\n",len,d.length);
for (i=0;i<d.length;i++)
printf("%02x ",d.data.ptr[i]);
printf("\n");
}
}
debtyp_check(d);
s.Stypidx = tdb_typidx(&d.length); // forward reference it
}
}
else
{
d.length = 0; // so cv_debtyp() will allocate new
s.Stypidx = cv_debtyp(d);
d.length = cast(ushort)len; // restore length
}
reset_symbuf.write((&s)[0 .. 1]);
if (refonly) // if reference only
{
//printf("refonly\n");
TOWORD(d.data.ptr + 2,0); // count: number of fields is 0
if (config.fulltypes == CV4)
{ TOWORD(d.data.ptr + 4,0); // field list is 0
TOWORD(d.data.ptr + 6,property);
}
else
{ TOLONG(d.data.ptr + 6,0); // field list is 0
TOWORD(d.data.ptr + 4,property);
}
return s.Stypidx;
}
version (MARS)
util_progress();
else
file_progress();
// Compute the number of fields, and the length of the fieldlist record
nfields = 0;
fnamelen = 2;
version (SCPP)
{
if (CPP)
{
// Base classes come first
for (b = st.Sbase; b; b = b.BCnext)
{
if (b.BCflags & BCFvirtual) // skip virtual base classes
continue;
nfields++;
fnamelen += ((config.fulltypes == CV4) ? 6 : 8) +
cv4_numericbytes(b.BCoffset);
}
// Now virtual base classes (direct and indirect)
for (b = st.Svirtbase; b; b = b.BCnext)
{
nfields++;
fnamelen += ((config.fulltypes == CV4) ? 8 : 12) +
cv4_numericbytes(st.Svbptr_off) +
cv4_numericbytes(b.BCvbtbloff / _tysize[TYint]);
}
// Now friend classes
i = list_nitems(st.Sfriendclass);
nfields += i;
fnamelen += i * ((config.fulltypes == CV4) ? 4 : 8);
// Now friend functions
for (sl = st.Sfriendfuncs; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
symbol_debug(sf);
if (sf.Sclass == SCfunctempl)
continue;
nfields++;
fnamelen += ((config.fulltypes == CV4) ? 4 : 6) +
cv_stringbytes(cpp_unmangleident(sf.Sident.ptr));
}
}
}
count = nfields;
for (sl = st.Sfldlst; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
targ_size_t offset;
symbol_debug(sf);
char *sfid = sf.Sident.ptr;
switch (sf.Sclass)
{
case SCmember:
case SCfield:
if (CPP && sf == s.Sstruct.Svptr)
fnamelen += ((config.fulltypes == CV4) ? 4 : 8);
else
{ offset = sf.Smemoff;
fnamelen += ((config.fulltypes == CV4) ? 6 : 8) +
cv4_numericbytes(cast(uint)offset) + cv_stringbytes(sfid);
}
break;
version (SCPP)
{
case SCstruct:
if (sf.Sstruct.Sflags & STRanonymous)
continue;
if (sf.Sstruct.Sflags & STRnotagname)
sfid = cpp_name_none.ptr;
property |= 0x10; // class contains nested classes
goto Lnest2;
case SCenum:
if (sf.Senum.SEflags & SENnotagname)
sfid = cpp_name_none.ptr;
goto Lnest2;
case SCtypedef:
Lnest2:
fnamelen += ((config.fulltypes == CV4) ? 4 : 8) +
cv_stringbytes(sfid);
break;
case SCextern:
case SCcomdef:
case SCglobal:
case SCstatic:
case SCinline:
case SCsinline:
case SCeinline:
case SCcomdat:
if (tyfunc(sf.ty()))
{ Symbol *so;
int nfuncs;
nfuncs = 0;
for (so = sf; so; so = so.Sfunc.Foversym)
{
if (so.Sclass == SCtypedef ||
so.Sclass == SCfunctempl ||
so.Sfunc.Fflags & Fnodebug) // if compiler generated
continue; // skip it
nfuncs++;
}
if (nfuncs == 0)
continue;
if (nfuncs > 1)
count += nfuncs - 1;
sfid = cv4_prettyident(sf);
}
fnamelen += ((config.fulltypes == CV4) ? 6 : 8) +
cv_stringbytes(sfid);
break;
}
default:
continue;
}
nfields++;
count++;
}
TOWORD(d.data.ptr + 2,count);
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 6,property);
else
TOWORD(d.data.ptr + 4,property);
// Generate fieldlist type record
dt = debtyp_alloc(fnamelen);
p = dt.data.ptr;
TOWORD(p,LF_FIELDLIST);
// And fill it in
p += 2;
version (SCPP)
{
if (CPP)
{
// Put out real base classes
for (b = st.Sbase; b; b = b.BCnext)
{ targ_size_t offset;
if (b.BCflags & BCFvirtual) // skip virtual base classes
continue;
offset = b.BCoffset;
typidx = cv4_symtypidx(b.BCbase);
attribute = (b.BCflags & BCFpmask);
if (attribute & 4)
attribute = 1;
else
attribute = 4 - attribute;
TOWORD(p,LF_BCLASS);
if (config.fulltypes == CV4)
{ TOWORD(p + 2,typidx);
TOWORD(p + 4,attribute);
p += 6;
}
else
{ TOLONG(p + 4,typidx);
TOWORD(p + 2,attribute);
p += 8;
}
cv4_storenumeric(p,offset);
p += cv4_numericbytes(offset);
}
// Now direct followed by indirect virtual base classes
i = LF_VBCLASS;
do
{
for (b = st.Svirtbase; b; b = b.BCnext)
{ targ_size_t vbpoff,vboff;
type *vbptype; // type of virtual base pointer
idx_t vbpidx;
if (baseclass_find(st.Sbase,b.BCbase)) // if direct vbase
{ if (i == LF_IVBCLASS)
continue;
}
else
{ if (i == LF_VBCLASS)
continue;
}
typidx = cv4_symtypidx(b.BCbase);
vbptype = type_allocn(TYarray,tstypes[TYint]);
vbptype.Tflags |= TFsizeunknown;
vbptype = newpointer(vbptype);
vbptype.Tcount++;
vbpidx = cv4_typidx(vbptype);
type_free(vbptype);
attribute = (b.BCflags & BCFpmask);
if (attribute & 4)
attribute = 1;
else
attribute = 4 - attribute;
vbpoff = st.Svbptr_off;
vboff = b.BCvbtbloff / _tysize[TYint];
if (config.fulltypes == CV4)
{ TOWORD(p,i);
TOWORD(p + 2,typidx);
TOWORD(p + 4,vbpidx);
TOWORD(p + 6,attribute);
p += 8;
}
else
{ TOWORD(p,i);
TOLONG(p + 4,typidx); // btype
TOLONG(p + 8,vbpidx); // vbtype
TOWORD(p + 2,attribute);
p += 12;
}
cv4_storenumeric(p,vbpoff);
p += cv4_numericbytes(vbpoff);
cv4_storenumeric(p,vboff);
p += cv4_numericbytes(vboff);
}
i ^= LF_VBCLASS ^ LF_IVBCLASS; // toggle between them
} while (i != LF_VBCLASS);
// Now friend classes
for (sl = s.Sstruct.Sfriendclass; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
symbol_debug(sf);
typidx = cv4_symtypidx(sf);
if (config.fulltypes == CV4)
{ TOWORD(p,LF_FRIENDCLS);
TOWORD(p + 2,typidx);
p += 4;
}
else
{ TOLONG(p,LF_FRIENDCLS);
TOLONG(p + 4,typidx);
p += 8;
}
}
// Now friend functions
for (sl = s.Sstruct.Sfriendfuncs; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
symbol_debug(sf);
if (sf.Sclass == SCfunctempl)
continue;
typidx = cv4_symtypidx(sf);
TOWORD(p,LF_FRIENDFCN);
if (config.fulltypes == CV4)
{ TOWORD(p + 2,typidx);
p += 4;
}
else
{ TOLONG(p + 2,typidx);
p += 6;
}
p += cv_namestring(p,cpp_unmangleident(sf.Sident.ptr));
}
}
}
for (sl = s.Sstruct.Sfldlst; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
targ_size_t offset;
symbol_debug(sf);
char *sfid = sf.Sident.ptr;
switch (sf.Sclass)
{
case SCfield:
{ debtyp_t *db;
if (config.fulltypes == CV4)
{ db = debtyp_alloc(6);
TOWORD(db.data.ptr,LF_BITFIELD);
db.data.ptr[2] = sf.Swidth;
db.data.ptr[3] = sf.Sbit;
TOWORD(db.data.ptr + 4,cv4_symtypidx(sf));
}
else
{ db = debtyp_alloc(8);
TOWORD(db.data.ptr,LF_BITFIELD);
db.data.ptr[6] = sf.Swidth;
db.data.ptr[7] = sf.Sbit;
TOLONG(db.data.ptr + 2,cv4_symtypidx(sf));
}
typidx = cv_debtyp(db);
goto L3;
}
case SCmember:
typidx = cv4_symtypidx(sf);
L3:
version (SCPP)
{
if (CPP && sf == s.Sstruct.Svptr)
{
if (config.fulltypes == CV4)
{ TOWORD(p,LF_VFUNCTAB);
TOWORD(p + 2,typidx);
p += 4;
}
else
{ TOLONG(p,LF_VFUNCTAB); // 0 fill 2 bytes
TOLONG(p + 4,typidx);
p += 8;
}
break;
}
}
offset = sf.Smemoff;
TOWORD(p,LF_MEMBER);
version (SCPP)
{
attribute = CPP ? SFLtoATTR(sf.Sflags) : 0;
assert((attribute & ~3) == 0);
}
else
{
attribute = 0;
}
if (config.fulltypes == CV4)
{ TOWORD(p + 2,typidx);
TOWORD(p + 4,attribute);
p += 6;
}
else
{ TOLONG(p + 4,typidx);
TOWORD(p + 2,attribute);
p += 8;
}
cv4_storenumeric(p,cast(uint)offset);
p += cv4_numericbytes(cast(uint)offset);
p += cv_namestring(p,sfid);
break;
version (SCPP)
{
case SCstruct:
if (sf.Sstruct.Sflags & STRanonymous)
continue;
if (sf.Sstruct.Sflags & STRnotagname)
sfid = cpp_name_none.ptr;
goto Lnest;
case SCenum:
if (sf.Senum.SEflags & SENnotagname)
sfid = cpp_name_none.ptr;
goto Lnest;
case SCtypedef:
Lnest:
TOWORD(p,LF_NESTTYPE);
typidx = cv4_symtypidx(sf);
if (config.fulltypes == CV4)
{ TOWORD(p + 2,typidx);
p += 4;
}
else
{ TOLONG(p + 4,typidx);
p += 8;
}
L2:
p += cv_namestring(p,sfid);
break;
case SCextern:
case SCcomdef:
case SCglobal:
case SCstatic:
case SCinline:
case SCsinline:
case SCeinline:
case SCcomdat:
if (tyfunc(sf.ty()))
{ int count2;
typidx = cv4_methodlist(sf,&count2);
if (!typidx)
break;
sfid = cv4_prettyident(sf);
TOWORD(p,LF_METHOD);
TOWORD(p + 2,count2);
p += 4;
TOIDX(p,typidx);
p += cgcv.sz_idx;
goto L2;
}
else
{
TOWORD(p,LF_STMEMBER);
typidx = cv4_symtypidx(sf);
attribute = SFLtoATTR(sf.Sflags);
if (config.fulltypes == CV4)
{ TOWORD(p + 2,typidx);
TOWORD(p + 4,attribute);
p += 6;
}
else
{ TOLONG(p + 4,typidx);
TOWORD(p + 2,attribute);
p += 8;
}
goto L2;
}
break;
}
default:
continue;
}
}
//printf("fnamelen = %d, p-dt.data = %d\n",fnamelen,p-dt.data);
assert(p - dt.data.ptr == fnamelen);
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 4,cv_debtyp(dt));
else
TOLONG(d.data.ptr + 6,cv_debtyp(dt));
static if (SYMDEB_TDB)
{
if (config.fulltypes == CVTDB)
{
s.Stypidx = cv_debtyp(d);
reset_symbuf.write(&s, (s).sizeof);
}
}
version (SCPP)
{
if (CPP)
{
symbol_debug(s);
if (st.Sflags & STRglobal)
list_prepend(&cgcv.list,s);
else
cv4_outsym(s);
}
}
return s.Stypidx;
}
/****************************
* Return type index of enum.
*/
version (SCPP)
{
private uint cv4_enum(Symbol *s)
{
debtyp_t* d,dt;
uint nfields,fnamelen;
uint len;
type *t;
type *tbase;
symlist_t sl;
uint property;
uint attribute;
int i;
char *id;
symbol_debug(s);
if (s.Stypidx) // if already converted
{ //assert(s.Stypidx - cgcv.deb_offset < debtyp.length);
return s.Stypidx;
}
//printf("cv4_enum(%s)\n",s.Sident.ptr);
t = s.Stype;
type_debug(t);
tbase = t.Tnext;
property = 0;
if (s.Senum.SEflags & SENforward)
property |= 0x80; // enum is forward referenced
id = s.Sident.ptr;
if (s.Senum.SEflags & SENnotagname)
id = cpp_name_none.ptr;
if (config.fulltypes == CV4)
{ len = 10;
d = debtyp_alloc(len + cv_stringbytes(id));
TOWORD(d.data.ptr,LF_ENUM);
TOWORD(d.data.ptr + 4,cv4_typidx(tbase));
TOWORD(d.data.ptr + 8,property);
}
else
{ len = 14;
d = debtyp_alloc(len + cv_stringbytes(id));
TOWORD(d.data.ptr,LF_ENUM);
TOLONG(d.data.ptr + 6,cv4_typidx(tbase));
TOWORD(d.data.ptr + 4,property);
}
len += cv_namestring(d.data.ptr + len,id);
// Assign a number to prevent infinite recursion if an enum member
// references the same enum.
if (config.fulltypes == CVTDB)
{
static if (SYMDEB_TDB)
{
debtyp_t *df;
TOWORD(d.data.ptr + 2,0);
TOWORD(d.data.ptr + 6,0);
debtyp_check(d);
s.Stypidx = tdb_typidx(&d.length); // forward reference it
}
}
else
{
d.length = 0; // so cv_debtyp() will allocate new
s.Stypidx = cv_debtyp(d);
d.length = cast(ushort)len; // restore length
}
reset_symbuf.write((&s)[0 .. 1]);
// Compute the number of fields, and the length of the fieldlist record
nfields = 0;
fnamelen = 2;
for (sl = s.Senum.SEenumlist; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
uint value;
symbol_debug(sf);
value = cast(uint)el_tolongt(sf.Svalue);
nfields++;
fnamelen += 4 + cv4_numericbytes(value) + cv_stringbytes(sf.Sident.ptr);
}
TOWORD(d.data.ptr + 2,nfields);
// If forward reference, then field list is 0
if (s.Senum.SEflags & SENforward)
{
TOWORD(d.data.ptr + 6,0);
return s.Stypidx;
}
// Generate fieldlist type record
dt = debtyp_alloc(fnamelen);
TOWORD(dt.data.ptr,LF_FIELDLIST);
// And fill it in
i = 2;
for (sl = s.Senum.SEenumlist; sl; sl = list_next(sl))
{ Symbol *sf = list_symbol(sl);
uint value;
symbol_debug(sf);
value = cast(uint)el_tolongt(sf.Svalue);
TOWORD(dt.data.ptr + i,LF_ENUMERATE);
attribute = SFLtoATTR(sf.Sflags);
TOWORD(dt.data.ptr + i + 2,attribute);
cv4_storenumeric(dt.data.ptr + i + 4,value);
i += 4 + cv4_numericbytes(value);
i += cv_namestring(dt.data.ptr + i,sf.Sident.ptr);
// If enum is not a member of a class, output enum members as constants
if (!isclassmember(s))
{ symbol_debug(sf);
cv4_outsym(sf);
}
}
assert(i == fnamelen);
if (config.fulltypes == CV4)
TOWORD(d.data.ptr + 6,cv_debtyp(dt));
else
TOLONG(d.data.ptr + 10,cv_debtyp(dt));
symbol_debug(s);
if (CPP)
cv4_outsym(s);
return s.Stypidx;
}
}
/************************************************
* Return 'calling convention' type of function.
*/
ubyte cv4_callconv(type *t)
{ ubyte call;
switch (tybasic(t.Tty))
{
case TYffunc: call = 1; break;
case TYfpfunc: call = 3; break;
case TYf16func: call = 3; break;
case TYfsfunc: call = 8; break;
case TYnsysfunc: call = 9; break;
case TYfsysfunc: call = 10; break;
case TYnfunc: call = 0; break;
case TYnpfunc: call = 2; break;
case TYnsfunc: call = 7; break;
case TYifunc: call = 1; break;
case TYjfunc: call = 2; break;
case TYmfunc: call = 11; break; // this call
default:
assert(0);
}
return call;
}
/**********************************************
* Return type index for the type of a symbol.
*/
version (MARS)
{
private uint cv4_symtypidx(Symbol *s)
{
return cv4_typidx(s.Stype);
}
}
version (SCPP)
{
private uint cv4_symtypidx(Symbol *s)
{ type *t;
debtyp_t *d;
ubyte *p;
if (!CPP)
return cv4_typidx(s.Stype);
symbol_debug(s);
if (isclassmember(s))
{ t = s.Stype;
if (tyfunc(t.Tty))
{ param_t *pa;
uint nparam;
idx_t paramidx;
idx_t thisidx;
uint u;
func_t *f;
ubyte call;
// It's a member function, which gets a special type record
f = s.Sfunc;
if (f.Fflags & Fstatic)
thisidx = dttab4[TYvoid];
else
{ type *tthis = cpp_thistype(s.Stype,cast(Classsym *)s.Sscope);
thisidx = cv4_typidx(tthis);
type_free(tthis);
}
paramidx = cv4_arglist(t,&nparam);
call = cv4_callconv(t);
if (config.fulltypes == CV4)
{
d = debtyp_alloc(18);
p = d.data.ptr;
TOWORD(p,LF_MFUNCTION);
TOWORD(p + 2,cv4_typidx(t.Tnext));
TOWORD(p + 4,cv4_symtypidx(s.Sscope));
TOWORD(p + 6,thisidx);
p[8] = call;
p[9] = 0; // reserved
TOWORD(p + 10,nparam);
TOWORD(p + 12,paramidx);
TOLONG(p + 14,0); // thisadjust
}
else
{
d = debtyp_alloc(26);
p = d.data.ptr;
TOWORD(p,LF_MFUNCTION);
TOLONG(p + 2,cv4_typidx(t.Tnext));
TOLONG(p + 6,cv4_symtypidx(s.Sscope));
TOLONG(p + 10,thisidx);
p[14] = call;
p[15] = 0; // reserved
TOWORD(p + 16,nparam);
TOLONG(p + 18,paramidx);
TOLONG(p + 22,0); // thisadjust
}
return cv_debtyp(d);
}
}
return cv4_typidx(s.Stype);
}
}
/***********************************
* Return CV4 type index for a type.
*/
uint cv4_typidx(type *t)
{ uint typidx;
uint u;
uint next;
uint key;
debtyp_t *d;
targ_size_t size;
tym_t tym;
tym_t tycv;
tym_t tymnext;
type *tv;
uint dt;
uint attribute;
ubyte call;
//printf("cv4_typidx(%p)\n",t);
if (!t)
return dttab4[TYint]; // assume int
type_debug(t);
next = cv4_typidx(t.Tnext);
tycv = t.Tty;
tym = tybasic(tycv);
tycv &= mTYconst | mTYvolatile | mTYimmutable;
attribute = 0;
L1:
dt = dttab4[tym];
switch (tym)
{
case TYllong:
if (t.Tnext)
goto Ldelegate;
assert(dt);
typidx = dt;
break;
case TYullong:
if (t.Tnext)
goto Ldarray;
assert(dt);
typidx = dt;
break;
case TYvoid:
case TYchar:
case TYschar:
case TYuchar:
case TYchar16:
case TYshort:
case TYushort:
case TYint:
case TYuint:
case TYulong:
case TYlong:
case TYfloat:
case TYdouble:
case TYdouble_alias:
case TYldouble:
case TYifloat:
case TYidouble:
case TYildouble:
case TYcfloat:
case TYcdouble:
case TYcldouble:
case TYbool:
case TYwchar_t:
case TYdchar:
assert(dt);
typidx = dt;
break;
case TYnptr:
version (MARS)
{
if (t.Tkey)
goto Laarray;
}
goto Lptr;
case TYsptr:
case TYcptr:
Lptr:
attribute |= I32 ? 10 : 0; goto L2;
case TYfptr:
case TYvptr: attribute |= I32 ? 11 : 1; goto L2;
case TYhptr: attribute |= 2; goto L2;
L2:
if (config.fulltypes == CV4)
{
// This is a hack to duplicate bugs in VC, so that the VC
// debugger will work.
tymnext = t.Tnext ? t.Tnext.Tty : TYint;
if (tymnext & (mTYconst | mTYimmutable | mTYvolatile) &&
!tycv &&
tyarithmetic(tymnext) &&
!(attribute & 0xE0)
)
{
typidx = dt | dttab4[tybasic(tymnext)];
break;
}
}
if ((next & 0xFF00) == 0 && !(attribute & 0xE0))
typidx = next | dt;
else
{
if (tycv & (mTYconst | mTYimmutable))
attribute |= 0x400;
if (tycv & mTYvolatile)
attribute |= 0x200;
tycv = 0;
switch (config.fulltypes)
{
case CV4:
d = debtyp_alloc(6);
TOWORD(d.data.ptr,LF_POINTER);
TOWORD(d.data.ptr + 2,attribute);
TOWORD(d.data.ptr + 4,next);
break;
case CV8:
d = debtyp_alloc(10);
TOWORD(d.data.ptr,0x1002);
TOLONG(d.data.ptr + 2,next);
// see https://github.com/Microsoft/microsoft-pdb/blob/master/include/cvinfo.h#L1514
// add size and pointer type (PTR_64 or PTR_NEAR32)
attribute |= (I64 ? (8 << 13) | 0xC : (4 << 13) | 0xA);
// convert reference to r-value reference to remove & from type display in debugger
if (attribute & 0x20)
attribute |= 0x80;
TOLONG(d.data.ptr + 6,attribute);
break;
default:
d = debtyp_alloc(10);
TOWORD(d.data.ptr,LF_POINTER);
TOLONG(d.data.ptr + 2,attribute);
TOLONG(d.data.ptr + 6,next);
break;
}
typidx = cv_debtyp(d);
}
break;
Ldarray:
switch (config.fulltypes)
{
version (MARS)
{
case CV8:
{
typidx = cv8_darray(t, next);
break;
}
}
case CV4:
static if (1)
{
d = debtyp_alloc(12);
TOWORD(d.data.ptr, LF_OEM);
TOWORD(d.data.ptr + 2, OEM);
TOWORD(d.data.ptr + 4, 1); // 1 = dynamic array
TOWORD(d.data.ptr + 6, 2); // count of type indices to follow
TOWORD(d.data.ptr + 8, 0x12); // index type, T_LONG
TOWORD(d.data.ptr + 10, next); // element type
}
else
{
d = debtyp_alloc(6);
TOWORD(d.data.ptr,LF_DYN_ARRAY);
TOWORD(d.data.ptr + 2, 0x12); // T_LONG
TOWORD(d.data.ptr + 4, next);
}
typidx = cv_debtyp(d);
break;
default:
assert(0);
}
break;
Laarray:
version (MARS)
{
key = cv4_typidx(t.Tkey);
switch (config.fulltypes)
{
case CV8:
typidx = cv8_daarray(t, key, next);
break;
case CV4:
static if (1)
{
d = debtyp_alloc(12);
TOWORD(d.data.ptr, LF_OEM);
TOWORD(d.data.ptr + 2, OEM);
TOWORD(d.data.ptr + 4, 2); // 2 = associative array
TOWORD(d.data.ptr + 6, 2); // count of type indices to follow
TOWORD(d.data.ptr + 8, key); // key type
TOWORD(d.data.ptr + 10, next); // element type
}
else
{
d = debtyp_alloc(6);
TOWORD(d.data.ptr,LF_ASSOC_ARRAY);
TOWORD(d.data.ptr + 2, key); // key type
TOWORD(d.data.ptr + 4, next); // element type
}
typidx = cv_debtyp(d);
break;
default:
assert(0);
}
}
break;
Ldelegate:
switch (config.fulltypes)
{
version (MARS)
{
case CV8:
typidx = cv8_ddelegate(t, next);
break;
}
case CV4:
tv = type_fake(TYnptr);
tv.Tcount++;
key = cv4_typidx(tv);
type_free(tv);
static if (1)
{
d = debtyp_alloc(12);
TOWORD(d.data.ptr, LF_OEM);
TOWORD(d.data.ptr + 2, OEM);
TOWORD(d.data.ptr + 4, 3); // 3 = delegate
TOWORD(d.data.ptr + 6, 2); // count of type indices to follow
TOWORD(d.data.ptr + 8, key); // type of 'this', which is void*
TOWORD(d.data.ptr + 10, next); // function type
}
else
{
d = debtyp_alloc(6);
TOWORD(d.data.ptr,LF_DELEGATE);
TOWORD(d.data.ptr + 2, key); // type of 'this', which is void*
TOWORD(d.data.ptr + 4, next); // function type
}
typidx = cv_debtyp(d);
break;
default:
assert(0);
}
break;
case TYcent:
if (t.Tnext)
goto Ldelegate;
assert(dt);
typidx = dt;
break;
case TYucent:
if (t.Tnext)
goto Ldarray;
assert(dt);
typidx = dt;
break;
case TYarray:
{ if (t.Tflags & TFsizeunknown)
size = 0; // don't complain if don't know size
else
size = type_size(t);
Larray:
u = cv4_numericbytes(cast(uint)size);
uint idxtype = I32 ? 0x12 : 0x11; // T_LONG : T_SHORT
if (I64)
idxtype = 0x23; // T_UQUAD
if(next == dttab4[TYvoid]) // do not encode void[n], this confuses the debugger
next = dttab4[TYuchar]; // use ubyte instead
switch (config.fulltypes)
{
case CV8:
d = debtyp_alloc(10 + u + 1);
TOWORD(d.data.ptr,0x1503);
TOLONG(d.data.ptr + 2,next);
TOLONG(d.data.ptr + 6,idxtype);
d.data.ptr[10 + u] = 0; // no name
cv4_storenumeric(d.data.ptr + 10,cast(uint)size);
break;
case CV4:
d = debtyp_alloc(6 + u + 1);
TOWORD(d.data.ptr,LF_ARRAY);
TOWORD(d.data.ptr + 2,next);
TOWORD(d.data.ptr + 4,idxtype);
d.data.ptr[6 + u] = 0; // no name
cv4_storenumeric(d.data.ptr + 6,cast(uint)size);
break;
default:
d = debtyp_alloc(10 + u + 1);
TOWORD(d.data.ptr,LF_ARRAY);
TOLONG(d.data.ptr + 2,next);
TOLONG(d.data.ptr + 6,idxtype);
d.data.ptr[10 + u] = 0; // no name
cv4_storenumeric(d.data.ptr + 10,cast(uint)size);
break;
}
typidx = cv_debtyp(d);
break;
}
case TYffunc:
case TYfpfunc:
case TYf16func:
case TYfsfunc:
case TYnsysfunc:
case TYfsysfunc:
case TYnfunc:
case TYnpfunc:
case TYnsfunc:
case TYmfunc:
case TYjfunc:
case TYifunc:
{
param_t *p;
uint nparam;
idx_t paramidx;
call = cv4_callconv(t);
paramidx = cv4_arglist(t,&nparam);
// Construct an LF_PROCEDURE
switch (config.fulltypes)
{
case CV8:
d = debtyp_alloc(2 + 4 + 1 + 1 + 2 + 4);
TOWORD(d.data.ptr,LF_PROCEDURE_V2);
TOLONG(d.data.ptr + 2,next); // return type
d.data.ptr[6] = call;
d.data.ptr[7] = 0; // reserved
TOWORD(d.data.ptr + 8,nparam);
TOLONG(d.data.ptr + 10,paramidx);
break;
case CV4:
d = debtyp_alloc(2 + 2 + 1 + 1 + 2 + 2);
TOWORD(d.data.ptr,LF_PROCEDURE);
TOWORD(d.data.ptr + 2,next); // return type
d.data.ptr[4] = call;
d.data.ptr[5] = 0; // reserved
TOWORD(d.data.ptr + 6,nparam);
TOWORD(d.data.ptr + 8,paramidx);
break;
default:
d = debtyp_alloc(2 + 4 + 1 + 1 + 2 + 4);
TOWORD(d.data.ptr,LF_PROCEDURE);
TOLONG(d.data.ptr + 2,next); // return type
d.data.ptr[6] = call;
d.data.ptr[7] = 0; // reserved
TOWORD(d.data.ptr + 8,nparam);
TOLONG(d.data.ptr + 10,paramidx);
break;
}
typidx = cv_debtyp(d);
break;
}
case TYstruct:
{
if (config.fulltypes == CV8)
{
version (MARS)
{
typidx = cv8_fwdref(t.Ttag);
}
}
else
{
int foo = t.Ttag.Stypidx;
typidx = cv4_struct(t.Ttag,0);
//printf("struct '%s' %x %x\n", t.Ttag.Sident.ptr, foo, typidx);
}
break;
}
case TYenum:
if (CPP)
{
version (SCPP)
{
typidx = cv4_enum(t.Ttag);
}
}
else
typidx = dttab4[tybasic(t.Tnext.Tty)];
break;
version (SCPP)
{
case TYvtshape:
{ uint count;
ubyte *p;
ubyte descriptor;
count = 1 + list_nitems(t.Ttag.Sstruct.Svirtual);
d = debtyp_alloc(4 + ((count + 1) >> 1));
p = d.data.ptr;
TOWORD(p,LF_VTSHAPE);
TOWORD(p + 2,count);
descriptor = I32 ? 0x55 : (LARGECODE ? 0x11 : 0);
memset(p + 4,descriptor,(count + 1) >> 1);
typidx = cv_debtyp(d);
break;
}
case TYref:
case TYnref:
case TYfref:
attribute |= 0x20; // indicate reference pointer
goto case;
case TYmemptr:
tym = tybasic(tym_conv(t)); // convert to C data type
goto L1; // and try again
}
version (MARS)
{
case TYref:
case TYnref:
attribute |= 0x20; // indicate reference pointer
tym = TYnptr; // convert to C data type
goto L1; // and try again
}
case TYnullptr:
tym = TYnptr;
next = cv4_typidx(tstypes[TYvoid]); // rewrite as void*
t = tspvoid;
goto L1;
// vector types
case TYfloat4: size = 16; next = dttab4[TYfloat]; goto Larray;
case TYdouble2: size = 16; next = dttab4[TYdouble]; goto Larray;
case TYschar16: size = 16; next = dttab4[TYschar]; goto Larray;
case TYuchar16: size = 16; next = dttab4[TYuchar]; goto Larray;
case TYshort8: size = 16; next = dttab4[TYshort]; goto Larray;
case TYushort8: size = 16; next = dttab4[TYushort]; goto Larray;
case TYlong4: size = 16; next = dttab4[TYlong]; goto Larray;
case TYulong4: size = 16; next = dttab4[TYulong]; goto Larray;
case TYllong2: size = 16; next = dttab4[TYllong]; goto Larray;
case TYullong2: size = 16; next = dttab4[TYullong]; goto Larray;
case TYfloat8: size = 32; next = dttab4[TYfloat]; goto Larray;
case TYdouble4: size = 32; next = dttab4[TYdouble]; goto Larray;
case TYschar32: size = 32; next = dttab4[TYschar]; goto Larray;
case TYuchar32: size = 32; next = dttab4[TYuchar]; goto Larray;
case TYshort16: size = 32; next = dttab4[TYshort]; goto Larray;
case TYushort16: size = 32; next = dttab4[TYushort]; goto Larray;
case TYlong8: size = 32; next = dttab4[TYlong]; goto Larray;
case TYulong8: size = 32; next = dttab4[TYulong]; goto Larray;
case TYllong4: size = 32; next = dttab4[TYllong]; goto Larray;
case TYullong4: size = 32; next = dttab4[TYullong]; goto Larray;
case TYfloat16: size = 64; next = dttab4[TYfloat]; goto Larray;
case TYdouble8: size = 64; next = dttab4[TYdouble]; goto Larray;
case TYschar64: size = 64; next = dttab4[TYschar]; goto Larray;
case TYuchar64: size = 64; next = dttab4[TYuchar]; goto Larray;
case TYshort32: size = 64; next = dttab4[TYshort]; goto Larray;
case TYushort32: size = 64; next = dttab4[TYushort]; goto Larray;
case TYlong16: size = 64; next = dttab4[TYlong]; goto Larray;
case TYulong16: size = 64; next = dttab4[TYulong]; goto Larray;
case TYllong8: size = 64; next = dttab4[TYllong]; goto Larray;
case TYullong8: size = 64; next = dttab4[TYullong]; goto Larray;
default:
debug
WRTYxx(tym);
assert(0);
}
// Add in const and/or volatile modifiers
if (tycv & (mTYconst | mTYimmutable | mTYvolatile))
{ uint modifier;
modifier = (tycv & (mTYconst | mTYimmutable)) ? 1 : 0;
modifier |= (tycv & mTYvolatile) ? 2 : 0;
switch (config.fulltypes)
{
case CV8:
d = debtyp_alloc(8);
TOWORD(d.data.ptr,0x1001);
TOLONG(d.data.ptr + 2,typidx);
TOWORD(d.data.ptr + 6,modifier);
break;
case CV4:
d = debtyp_alloc(6);
TOWORD(d.data.ptr,LF_MODIFIER);
TOWORD(d.data.ptr + 2,modifier);
TOWORD(d.data.ptr + 4,typidx);
break;
default:
d = debtyp_alloc(10);
TOWORD(d.data.ptr,LF_MODIFIER);
TOLONG(d.data.ptr + 2,modifier);
TOLONG(d.data.ptr + 6,typidx);
break;
}
typidx = cv_debtyp(d);
}
assert(typidx);
return typidx;
}
/******************************************
* Write out symbol s.
*/
private void cv4_outsym(Symbol *s)
{
uint len;
type *t;
uint length;
uint u;
tym_t tym;
const(char)* id;
ubyte *debsym = null;
ubyte[64] buf = void;
//printf("cv4_outsym(%s)\n",s.Sident.ptr);
symbol_debug(s);
version (MARS)
{
if (s.Sflags & SFLnodebug)
return;
}
t = s.Stype;
type_debug(t);
tym = tybasic(t.Tty);
if (tyfunc(tym) && s.Sclass != SCtypedef)
{ int framedatum,targetdatum,fd;
char idfree;
idx_t typidx;
if (s != funcsym_p)
return;
version (SCPP)
{
if (CPP && isclassmember(s)) // if method
{ Outbuffer buf2;
param_tostring(&buf2,s.Stype);
buf2.prependBytes(cpp_prettyident(s));
char* s2 = buf2.toString();
const len2 = strlen(s2);
id = cast(char*)alloca(len2 + 1);
assert(id);
memcpy(cast(void*)id, s2, len2 + 1);
}
else
{
id = prettyident(s);
}
}
else
{
id = s.prettyIdent ? s.prettyIdent : s.Sident.ptr;
}
len = cv_stringbytes(id);
// Length of record
length = 2 + 2 + 4 * 3 + _tysize[TYint] * 4 + 2 + cgcv.sz_idx + 1;
debsym = (length + len <= (buf).sizeof) ? buf.ptr : cast(ubyte *) malloc(length + len);
assert(debsym);
memset(debsym,0,length + len);
// Symbol type
u = (s.Sclass == SCstatic) ? S_LPROC16 : S_GPROC16;
if (I32)
u += S_GPROC32 - S_GPROC16;
TOWORD(debsym + 2,u);
if (config.fulltypes == CV4)
{
// Offsets
if (I32)
{ TOLONG(debsym + 16,cast(uint)s.Ssize); // proc length
TOLONG(debsym + 20,cast(uint)startoffset); // debug start
TOLONG(debsym + 24,cast(uint)retoffset); // debug end
u = 28; // offset to fixup
}
else
{ TOWORD(debsym + 16,cast(uint)s.Ssize); // proc length
TOWORD(debsym + 18,cast(uint)startoffset); // debug start
TOWORD(debsym + 20,cast(uint)retoffset); // debug end
u = 22; // offset to fixup
}
length += cv_namestring(debsym + u + _tysize[TYint] + 2 + cgcv.sz_idx + 1,id);
typidx = cv4_symtypidx(s);
TOIDX(debsym + u + _tysize[TYint] + 2,typidx); // proc type
debsym[u + _tysize[TYint] + 2 + cgcv.sz_idx] = tyfarfunc(tym) ? 4 : 0;
TOWORD(debsym,length - 2);
}
else
{
// Offsets
if (I32)
{ TOLONG(debsym + 16 + cgcv.sz_idx,cast(uint)s.Ssize); // proc length
TOLONG(debsym + 20 + cgcv.sz_idx,cast(uint)startoffset); // debug start
TOLONG(debsym + 24 + cgcv.sz_idx,cast(uint)retoffset); // debug end
u = 28; // offset to fixup
}
else
{ TOWORD(debsym + 16 + cgcv.sz_idx,cast(uint)s.Ssize); // proc length
TOWORD(debsym + 18 + cgcv.sz_idx,cast(uint)startoffset); // debug start
TOWORD(debsym + 20 + cgcv.sz_idx,cast(uint)retoffset); // debug end
u = 22; // offset to fixup
}
u += cgcv.sz_idx;
length += cv_namestring(debsym + u + _tysize[TYint] + 2 + 1,id);
typidx = cv4_symtypidx(s);
TOIDX(debsym + 16,typidx); // proc type
debsym[u + _tysize[TYint] + 2] = tyfarfunc(tym) ? 4 : 0;
TOWORD(debsym,length - 2);
}
uint soffset = cast(uint)Offset(DEBSYM);
objmod.write_bytes(SegData[DEBSYM],length,debsym);
// Put out fixup for function start offset
objmod.reftoident(DEBSYM,soffset + u,s,0,CFseg | CFoff);
}
else
{ targ_size_t base;
int reg;
uint fd;
uint idx1,idx2;
uint value;
uint fixoff;
idx_t typidx;
typidx = cv4_typidx(t);
version (MARS)
{
id = s.prettyIdent ? s.prettyIdent : prettyident(s);
}
else
{
id = prettyident(s);
}
len = cast(uint)strlen(id);
debsym = (39 + IDOHD + len <= (buf).sizeof) ? buf.ptr : cast(ubyte *) malloc(39 + IDOHD + len);
assert(debsym);
switch (s.Sclass)
{
case SCparameter:
case SCregpar:
if (s.Sfl == FLreg)
{
s.Sfl = FLpara;
cv4_outsym(s);
s.Sfl = FLreg;
goto case_register;
}
base = Para.size - BPoff; // cancel out add of BPoff
goto L1;
case SCauto:
if (s.Sfl == FLreg)
goto case_register;
case_auto:
base = Auto.size;
L1:
if (s.Sscope) // local variables moved into the closure cannot be emitted directly
goto Lret;
TOWORD(debsym + 2,I32 ? S_BPREL32 : S_BPREL16);
if (config.fulltypes == CV4)
{ TOOFFSET(debsym + 4,s.Soffset + base + BPoff);
TOIDX(debsym + 4 + _tysize[TYint],typidx);
}
else
{ TOOFFSET(debsym + 4 + cgcv.sz_idx,s.Soffset + base + BPoff);
TOIDX(debsym + 4,typidx);
}
length = 2 + 2 + _tysize[TYint] + cgcv.sz_idx;
length += cv_namestring(debsym + length,id);
TOWORD(debsym,length - 2);
break;
case SCbprel:
base = -BPoff;
goto L1;
case SCfastpar:
if (s.Sfl != FLreg)
{ base = Fast.size;
goto L1;
}
goto case_register;
case SCregister:
if (s.Sfl != FLreg)
goto case_auto;
goto case_register;
case SCpseudo:
case_register:
TOWORD(debsym + 2,S_REGISTER);
reg = cv_regnum(s);
TOIDX(debsym + 4,typidx);
TOWORD(debsym + 4 + cgcv.sz_idx,reg);
length = 2 * 3 + cgcv.sz_idx;
length += 1 + cv_namestring(debsym + length,id);
TOWORD(debsym,length - 2);
break;
case SCextern:
case SCcomdef:
// Common blocks have a non-zero Sxtrnnum and an UNKNOWN seg
if (!(s.Sxtrnnum && s.Sseg == UNKNOWN)) // if it's not really a common block
{
goto Lret;
}
goto case;
case SCglobal:
case SCcomdat:
u = S_GDATA16;
goto L2;
case SCstatic:
case SClocstat:
u = S_LDATA16;
L2:
if (I32)
u += S_GDATA32 - S_GDATA16;
TOWORD(debsym + 2,u);
if (config.fulltypes == CV4)
{
fixoff = 4;
length = 2 + 2 + _tysize[TYint] + 2;
TOOFFSET(debsym + fixoff,s.Soffset);
TOWORD(debsym + fixoff + _tysize[TYint],0);
TOIDX(debsym + length,typidx);
}
else
{
fixoff = 8;
length = 2 + 2 + _tysize[TYint] + 2;
TOOFFSET(debsym + fixoff,s.Soffset);
TOWORD(debsym + fixoff + _tysize[TYint],0); // segment
TOIDX(debsym + 4,typidx);
}
length += cgcv.sz_idx;
length += cv_namestring(debsym + length,id);
TOWORD(debsym,length - 2);
assert(length <= 40 + len);
if (s.Sseg == UNKNOWN || s.Sclass == SCcomdat) // if common block
{
if (config.exe & EX_flat)
{
fd = 0x16;
idx1 = DGROUPIDX;
idx2 = s.Sxtrnnum;
}
else
{
fd = 0x26;
idx1 = idx2 = s.Sxtrnnum;
}
}
else if (s.ty() & (mTYfar | mTYcs))
{
fd = 0x04;
idx1 = idx2 = SegData[s.Sseg].segidx;
}
else
{ fd = 0x14;
idx1 = DGROUPIDX;
idx2 = SegData[s.Sseg].segidx;
}
/* Because of the linker limitations, the length cannot
* exceed 0x1000.
* See optlink\cv\cvhashes.asm
*/
assert(length <= 0x1000);
if (idx2 != 0)
{ uint offset = cast(uint)Offset(DEBSYM);
objmod.write_bytes(SegData[DEBSYM],length,debsym);
objmod.write_long(DEBSYM,offset + fixoff,cast(uint)s.Soffset,
cgcv.LCFDpointer + fd,idx1,idx2);
}
goto Lret;
static if (1)
{
case SCtypedef:
s.Stypidx = typidx;
reset_symbuf.write((&s)[0 .. 1]);
goto L4;
case SCstruct:
if (s.Sstruct.Sflags & STRnotagname)
goto Lret;
goto L4;
case SCenum:
version (SCPP)
{
if (CPP && s.Senum.SEflags & SENnotagname)
goto Lret;
}
L4:
// Output a 'user-defined type' for the tag name
TOWORD(debsym + 2,S_UDT);
TOIDX(debsym + 4,typidx);
length = 2 + 2 + cgcv.sz_idx;
length += cv_namestring(debsym + length,id);
TOWORD(debsym,length - 2);
list_subtract(&cgcv.list,s);
break;
case SCconst:
// The only constants are enum members
value = cast(uint)el_tolongt(s.Svalue);
TOWORD(debsym + 2,S_CONST);
TOIDX(debsym + 4,typidx);
length = 4 + cgcv.sz_idx;
cv4_storenumeric(debsym + length,value);
length += cv4_numericbytes(value);
length += cv_namestring(debsym + length,id);
TOWORD(debsym,length - 2);
break;
}
default:
goto Lret;
}
assert(length <= 40 + len);
objmod.write_bytes(SegData[DEBSYM],length,debsym);
}
Lret:
if (debsym != buf.ptr)
free(debsym);
}
/******************************************
* Write out any deferred symbols.
*/
private void cv_outlist()
{
while (cgcv.list)
cv_outsym(cast(Symbol *) list_pop(&cgcv.list));
}
/******************************************
* Write out symbol table for current function.
*/
private void cv4_func(Funcsym *s)
{
SYMIDX si;
int endarg;
cv4_outsym(s); // put out function symbol
version (MARS)
{
__gshared Funcsym* sfunc;
__gshared int cntOpenBlocks;
sfunc = s;
cntOpenBlocks = 0;
struct cv4
{
// record for CV record S_BLOCK32
struct block32_data
{
ushort len;
ushort id;
uint pParent;
uint pEnd;
uint length;
uint offset;
ushort seg;
ubyte[2] name;
}
extern (C++):
static void endArgs()
{
__gshared ushort[2] endargs = [ 2, S_ENDARG ];
objmod.write_bytes(SegData[DEBSYM],(endargs).sizeof,endargs.ptr);
}
static void beginBlock(int offset, int length)
{
if (++cntOpenBlocks >= 255)
return; // optlink does not like more than 255 scope blocks
uint soffset = cast(uint)Offset(DEBSYM);
// parent and end to be filled by linker
block32_data block32 = { (block32_data).sizeof - 2, S_BLOCK32, 0, 0, length, 0, 0, [ 0, '\0' ] };
objmod.write_bytes(SegData[DEBSYM], (block32).sizeof, &block32);
size_t offOffset = cast(char*)&block32.offset - cast(char*)&block32;
objmod.reftoident(DEBSYM, soffset + offOffset, sfunc, offset + sfunc.Soffset, CFseg | CFoff);
}
static void endBlock()
{
if (cntOpenBlocks-- >= 255)
return; // optlink does not like more than 255 scope blocks
__gshared ushort[2] endargs = [ 2, S_END ];
objmod.write_bytes(SegData[DEBSYM],(endargs).sizeof,endargs.ptr);
}
}
varStats_writeSymbolTable(&globsym, &cv4_outsym, &cv4.endArgs, &cv4.beginBlock, &cv4.endBlock);
}
else
{
symtab_t* symtab = &globsym;
// Put out local symbols
endarg = 0;
for (si = 0; si < symtab.top; si++)
{ //printf("globsym.tab[%d] = %p\n",si,globsym.tab[si]);
Symbol *sa = symtab.tab[si];
cv4_outsym(sa);
}
}
// Put out function return record
if (1)
{ ubyte[2+2+2+1+1+4] sreturn = void;
ushort flags;
ubyte style;
tym_t ty;
tym_t tyret;
uint u;
u = 2+2+1;
ty = tybasic(s.ty());
flags = tyrevfunc(ty) ? 0 : 1;
flags |= typfunc(ty) ? 0 : 2;
TOWORD(sreturn.ptr + 4,flags);
tyret = tybasic(s.Stype.Tnext.Tty);
switch (tyret)
{
case TYvoid:
default:
style = 0;
break;
case TYbool:
case TYchar:
case TYschar:
case TYuchar:
sreturn[7] = 1;
sreturn[8] = 1; // AL
goto L1;
case TYwchar_t:
case TYchar16:
case TYshort:
case TYushort:
goto case_ax;
case TYint:
case TYuint:
case TYsptr:
case TYcptr:
case TYnullptr:
case TYnptr:
case TYnref:
if (I32)
goto case_eax;
else
goto case_ax;
case TYfloat:
case TYifloat:
if (config.exe & EX_flat)
goto case_st0;
goto case;
case TYlong:
case TYulong:
case TYdchar:
if (I32)
goto case_eax;
else
goto case_dxax;
case TYfptr:
case TYhptr:
if (I32)
goto case_edxeax;
else
goto case_dxax;
case TYvptr:
if (I32)
goto case_edxebx;
else
goto case_dxbx;
case TYdouble:
case TYidouble:
case TYdouble_alias:
if (config.exe & EX_flat)
goto case_st0;
if (I32)
goto case_edxeax;
else
goto case_axbxcxdx;
case TYllong:
case TYullong:
assert(I32);
goto case_edxeax;
case TYldouble:
case TYildouble:
goto case_st0;
case TYcfloat:
case TYcdouble:
case TYcldouble:
goto case_st01;
case_ax:
sreturn[7] = 1;
sreturn[8] = 9; // AX
goto L1;
case_eax:
sreturn[7] = 1;
sreturn[8] = 17; // EAX
goto L1;
case_dxax:
sreturn[7] = 2;
sreturn[8] = 11; // DX
sreturn[9] = 9; // AX
goto L1;
case_dxbx:
sreturn[7] = 2;
sreturn[8] = 11; // DX
sreturn[9] = 12; // BX
goto L1;
case_axbxcxdx:
sreturn[7] = 4;
sreturn[8] = 9; // AX
sreturn[9] = 12; // BX
sreturn[10] = 10; // CX
sreturn[11] = 11; // DX
goto L1;
case_edxeax:
sreturn[7] = 2;
sreturn[8] = 19; // EDX
sreturn[9] = 17; // EAX
goto L1;
case_edxebx:
sreturn[7] = 2;
sreturn[8] = 19; // EDX
sreturn[9] = 20; // EBX
goto L1;
case_st0:
sreturn[7] = 1;
sreturn[8] = 128; // ST0
goto L1;
case_st01:
sreturn[7] = 2;
sreturn[8] = 128; // ST0 (imaginary)
sreturn[9] = 129; // ST1 (real)
goto L1;
L1:
style = 1;
u += sreturn[7] + 1;
break;
}
sreturn[6] = style;
TOWORD(sreturn.ptr,u);
TOWORD(sreturn.ptr + 2,S_RETURN);
objmod.write_bytes(SegData[DEBSYM],u + 2,sreturn.ptr);
}
// Put out end scope
{ __gshared ushort[2] endproc = [ 2,S_END ];
objmod.write_bytes(SegData[DEBSYM],(endproc).sizeof,endproc.ptr);
}
cv_outlist();
}
//////////////////////////////////////////////////////////
/******************************************
* Write out data to .OBJ file.
*/
void cv_term()
{
//printf("cv_term(): debtyp.length = %d\n",debtyp.length);
segidx_t typeseg = objmod.seg_debugT();
switch (config.fulltypes)
{
case CV4:
case CVSYM:
cv_outlist();
goto case;
case CV8:
objmod.write_bytes(SegData[typeseg],4,&cgcv.signature);
if (debtyp.length != 1 || config.fulltypes == CV8)
{
for (uint u = 0; u < debtyp.length; u++)
{ debtyp_t *d = debtyp[u];
objmod.write_bytes(SegData[typeseg],2 + d.length,cast(char *)d + uint.sizeof);
debtyp_free(d);
}
}
else if (debtyp.length)
{
debtyp_free(debtyp[0]);
}
break;
static if (SYMDEB_TDB)
{
case CVTDB:
cv_outlist();
static if (1)
{
tdb_term();
}
else
{
{ ubyte *buf;
ubyte *p;
size_t len;
// Calculate size of buffer
len = 4;
for (uint u = 0; u < debtyp.length; u++)
{ debtyp_t *d = debtyp[u];
len += 2 + d.length;
}
// Allocate buffer
buf = malloc(len);
if (!buf)
err_nomem(); // out of memory
// Fill the buffer
TOLONG(buf,cgcv.signature);
p = buf + 4;
for (uint u = 0; u < debtyp.length; u++)
{ debtyp_t *d = debtyp[u];
len = 2 + d.length;
memcpy(p,cast(char *)d + uint.sizeof,len);
p += len;
}
tdb_write(buf,len,debtyp.length);
}
}
break;
}
default:
assert(0);
}
// debtyp.dtor(); // save for later
vec_free(debtypvec);
debtypvec = null;
}
/******************************************
* Write out symbol table for current function.
*/
static if (TARGET_WINDOS)
{
void cv_func(Funcsym *s)
{
version (SCPP)
{
if (errcnt) // if we had any errors
return; // don't bother putting stuff in .OBJ file
}
//printf("cv_func('%s')\n",s.Sident.ptr);
version (MARS)
{
if (s.Sflags & SFLnodebug)
return;
}
else
{
if (CPP && s.Sfunc.Fflags & Fnodebug) // if don't generate debug info
return;
}
switch (config.fulltypes)
{
case CV4:
case CVSYM:
case CVTDB:
cv4_func(s);
break;
default:
assert(0);
}
}
}
/******************************************
* Write out symbol table for current function.
*/
static if (TARGET_WINDOS)
{
void cv_outsym(Symbol *s)
{
//printf("cv_outsym('%s')\n",s.Sident.ptr);
symbol_debug(s);
version (MARS)
{
if (s.Sflags & SFLnodebug)
return;
}
switch (config.fulltypes)
{
case CV4:
case CVSYM:
case CVTDB:
cv4_outsym(s);
break;
version (MARS)
{
case CV8:
cv8_outsym(s);
break;
}
default:
assert(0);
}
}
}
/******************************************
* Return cv type index for a type.
*/
uint cv_typidx(type *t)
{ uint ti;
//printf("cv_typidx(%p)\n",t);
switch (config.fulltypes)
{
case CV4:
case CVTDB:
case CVSYM:
case CV8:
ti = cv4_typidx(t);
break;
default:
debug
printf("fulltypes = %d\n",config.fulltypes);
assert(0);
}
return ti;
}
}
|
D
|
module tpl.typetuple;
/**
* Создаёт кортеж типов в виде цепочки из нуля и более типов.
* Пример:
* ---
* import tpl.typetuple;
* alias КортежТипа!(цел, дво) TL;
*
* цел foo(TL td) // то же что и цел foo(цел, дво);
* {
* return td[0] + cast(цел)td[1];
* }
* ---
*
* Пример:
* ---
* КортежТипа!(TL, сим)
* // это равнозначно с:
* КортежТипа!(цел, дво, сим)
* ---
*/
template КортежТипа(ТСписок...)
{
alias ТСписок КортежТипа;
}
/**
* Возвращает индекс первого случая типа T, найденного в
* цепи из ноль или более типов в ТСписке.
* Если не найден, будет получен ответ -1.
* Пример:
* ---
* import tpl.typetuple;
* //import stdrus;
*
* проц foo()
* {
* пишифнс("Индексом дол является ",
* Индекс_у!(дол, КортежТипа!(цел, дол, дво)));
* // выводит: Индексом дол является 1
* }
* ---
*/
template Индекс_у(T, ТСписок...)
{
static if (ТСписок.length == 0)
const цел Индекс_у = -1;
else static if (is(T == ТСписок[0]))
const цел Индекс_у = 0;
else
const цел Индекс_у =
(Индекс_у!(T, ТСписок[1 .. length]) == -1)
? -1
: 1 + Индекс_у!(T, ТСписок[1 .. length]);
}
/**
* Returns a typetuple created from ТСписок with the first occurrence,
* if any, of T removed.
* Example:
* ---
* Вырезать!(дол, цел, дол, double, сим)
* // is the same as:
* КортежТипа!(цел, double, сим)
* ---
*/
template Вырезать(T, ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок Вырезать;
else static if (is(T == ТСписок[0]))
alias ТСписок[1 .. length] Вырезать;
else
alias КортежТипа!(ТСписок[0], Вырезать!(T, ТСписок[1 .. length])) Вырезать;
}
/**
* Returns a typetuple created from ТСписок with the all occurrences,
* if any, of T removed.
* Example:
* ---
* alias КортежТипа!(цел, дол, дол, цел) TL;
*
* ВырезатьВсе!(дол, TL)
* // is the same as:
* КортежТипа!(цел, цел)
* ---
*/
template ВырезатьВсе(T, ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок ВырезатьВсе;
else static if (is(T == ТСписок[0]))
alias ВырезатьВсе!(T, ТСписок[1 .. length]) ВырезатьВсе;
else
alias КортежТипа!(ТСписок[0], ВырезатьВсе!(T, ТСписок[1 .. length])) ВырезатьВсе;
}
/**
* Returns a typetuple created from ТСписок with the all duplicate
* типы removed.
* Example:
* ---
* alias КортежТипа!(цел, дол, дол, цел, float) TL;
*
* БезДубликатов!(TL)
* // is the same as:
* КортежТипа!(цел, дол, float)
* ---
*/
template БезДубликатов(ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок БезДубликатов;
else
alias КортежТипа!(ТСписок[0], БезДубликатов!(ВырезатьВсе!(ТСписок[0], ТСписок[1 .. length]))) БезДубликатов;
}
/**
* Returns a typetuple created from ТСписок with the first occurrence
* of тип T, if found, replaced with тип U.
* Example:
* ---
* alias КортежТипа!(цел, дол, дол, цел, float) TL;
*
* Заменить!(дол, сим, TL)
* // is the same as:
* КортежТипа!(цел, сим, дол, цел, float)
* ---
*/
template Заменить(T, U, ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок Заменить;
else static if (is(T == ТСписок[0]))
alias КортежТипа!(U, ТСписок[1 .. length]) Заменить;
else
alias КортежТипа!(ТСписок[0], Заменить!(T, U, ТСписок[1 .. length])) Заменить;
}
/**
* Returns a typetuple created from ТСписок with all occurrences
* of тип T, if found, replaced with тип U.
* Example:
* ---
* alias КортежТипа!(цел, дол, дол, цел, float) TL;
*
* ЗаменитьВсе!(дол, сим, TL)
* // is the same as:
* КортежТипа!(цел, сим, сим, цел, float)
* ---
*/
template ЗаменитьВсе(T, U, ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок ЗаменитьВсе;
else static if (is(T == ТСписок[0]))
alias КортежТипа!(U, ЗаменитьВсе!(T, U, ТСписок[1 .. length])) ЗаменитьВсе;
else
alias КортежТипа!(ТСписок[0], ЗаменитьВсе!(T, U, ТСписок[1 .. length])) ЗаменитьВсе;
}
/**
* Returns a typetuple created from ТСписок with the order reversed.
* Example:
* ---
* alias КортежТипа!(цел, дол, дол, цел, float) TL;
*
* Реверсировать!(TL)
* // is the same as:
* КортежТипа!(float, цел, дол, дол, цел)
* ---
*/
template Реверсировать(ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок Реверсировать;
else
alias КортежТипа!(Реверсировать!(ТСписок[1 .. length]), ТСписок[0]) Реверсировать;
}
/**
* Returns the тип from ТСписок that is the most derived from тип T.
* If none are found, T is returned.
* Example:
* ---
* class A { }
* class B : A { }
* class C : B { }
* alias КортежТипа!(A, C, B) TL;
*
* ПоследнийПроизводный!(Object, TL) x; // x is declared as тип C
* ---
*/
template ПоследнийПроизводный(T, ТСписок...)
{
static if (ТСписок.length == 0)
alias T ПоследнийПроизводный;
else static if (is(ТСписок[0] : T))
alias ПоследнийПроизводный!(ТСписок[0], ТСписок[1 .. length]) ПоследнийПроизводный;
else
alias ПоследнийПроизводный!(T, ТСписок[1 .. length]) ПоследнийПроизводный;
}
/**
* Returns the typetuple ТСписок with the типы sorted so that the most
* derived типы come first.
* Example:
* ---
* class A { }
* class B : A { }
* class C : B { }
* alias КортежТипа!(A, C, B) TL;
*
* ПроизводныйВперёд!(TL)
* // is the same as:
* КортежТипа!(C, B, A)
* ---
*/
template ПроизводныйВперёд(ТСписок...)
{
static if (ТСписок.length == 0)
alias ТСписок ПроизводныйВперёд;
else
alias КортежТипа!(ПоследнийПроизводный!(ТСписок[0], ТСписок[1 .. length]),
ПроизводныйВперёд!(ЗаменитьВсе!(ПоследнийПроизводный!(ТСписок[0], ТСписок[1 .. length]),
ТСписок[0],
ТСписок[1 .. length]))) ПроизводныйВперёд;
}
|
D
|
/Users/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/Sources/Extensions/UIView+Extensions.swift.o : /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/DataService.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/AppDelegate.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/WelcomeViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/ExamplesViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AppRootViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AboutViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/SummaryViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Navigator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Coordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/OnboardingCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AppCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/ExamplesCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AboutCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UILabel+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIViewController+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIView+Extensions.swift /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/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.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/QuartzCore.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/Metal.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/SafariServices.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/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/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/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.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/System/Library/Frameworks/Metal.framework/Headers/Metal.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/AppKit.framework/Headers/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/Sources/Extensions/UIView+Extensions~partial.swiftmodule : /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/DataService.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/AppDelegate.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/WelcomeViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/ExamplesViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AppRootViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AboutViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/SummaryViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Navigator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Coordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/OnboardingCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AppCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/ExamplesCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AboutCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UILabel+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIViewController+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIView+Extensions.swift /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/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.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/QuartzCore.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/Metal.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/SafariServices.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/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/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/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.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/System/Library/Frameworks/Metal.framework/Headers/Metal.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/AppKit.framework/Headers/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/Sources/Extensions/UIView+Extensions~partial.swiftdoc : /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/DataService.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/AppDelegate.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/WelcomeViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/ExamplesViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AppRootViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AboutViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/SummaryViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Navigator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Coordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/OnboardingCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AppCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/ExamplesCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AboutCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UILabel+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIViewController+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIView+Extensions.swift /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/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.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/QuartzCore.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/Metal.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/SafariServices.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/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/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/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.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/System/Library/Frameworks/Metal.framework/Headers/Metal.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/AppKit.framework/Headers/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/Sources/Extensions/UIView+Extensions~partial.swiftsourceinfo : /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/DataService.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/AppDelegate.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/WelcomeViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/ExamplesViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AppRootViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/AboutViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/ViewControllers/SummaryViewController.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Navigator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Main/Coordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/OnboardingCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AppCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/ExamplesCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Coordinators/AboutCoordinator.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UILabel+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIViewController+Extensions.swift /Users/tito/Desktop/Backup/Projects/Coordinator/Sources/Extensions/UIView+Extensions.swift /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/CoreData.swiftmodule/x86_64-apple-macos.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/prebuilt-modules/CoreImage.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/QuartzCore.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/Metal.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/SafariServices.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/AppKit.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/tito/Desktop/Backup/Projects/Coordinator/.build/x86_64-apple-macosx/debug/Coordinator_Example.build/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/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.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/System/Library/Frameworks/Metal.framework/Headers/Metal.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/AppKit.framework/Headers/AppKit.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
|
module android.java.android.net.wifi.aware.AttachCallback_d_interface;
import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers;
static import arsd.jni;
import import1 = android.java.java.lang.Class_d_interface;
import import0 = android.java.android.net.wifi.aware.WifiAwareSession_d_interface;
final class AttachCallback : IJavaObject {
static immutable string[] _d_canCastTo = [
];
@Import this(arsd.jni.Default);
@Import void onAttached(import0.WifiAwareSession);
@Import void onAttachFailed();
@Import import1.Class getClass();
@Import int hashCode();
@Import bool equals(IJavaObject);
@Import @JavaName("toString") string toString_();
override string toString() { return arsd.jni.javaObjectToString(this); }
@Import void notify();
@Import void notifyAll();
@Import void wait(long);
@Import void wait(long, int);
@Import void wait();
mixin IJavaObjectImplementation!(false);
public static immutable string _javaParameterString = "Landroid/net/wifi/aware/AttachCallback;";
}
|
D
|
// Written in the D programming language.
/**
A one-stop shop for converting values from one type to another.
Copyright: Copyright Digital Mars 2007-.
License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP digitalmars.com, Walter Bright),
$(HTTP erdani.org, Andrei Alexandrescu),
Shin Fujishiro,
Adam D. Ruppe,
Kenji Hara
Source: $(PHOBOSSRC std/_conv.d)
*/
module std.conv;
public import std.ascii : LetterCase;
import std.meta;
import std.range.primitives;
import std.traits;
// Same as std.string.format, but "self-importing".
// Helps reduce code and imports, particularly in static asserts.
// Also helps with missing imports errors.
package template convFormat()
{
import std.format : format;
alias convFormat = format;
}
/* ************* Exceptions *************** */
/**
* Thrown on conversion errors.
*/
class ConvException : Exception
{
@safe pure nothrow
this(string s, string fn = __FILE__, size_t ln = __LINE__)
{
super(s, fn, ln);
}
}
private string convError_unexpected(S)(S source)
{
return source.empty ? "end of input" : text("'", source.front, "'");
}
private auto convError(S, T)(S source, string fn = __FILE__, size_t ln = __LINE__)
{
return new ConvException(
text("Unexpected ", convError_unexpected(source),
" when converting from type "~S.stringof~" to type "~T.stringof),
fn, ln);
}
private auto convError(S, T)(S source, int radix, string fn = __FILE__, size_t ln = __LINE__)
{
return new ConvException(
text("Unexpected ", convError_unexpected(source),
" when converting from type "~S.stringof~" base ", radix,
" to type "~T.stringof),
fn, ln);
}
@safe pure/* nothrow*/ // lazy parameter bug
private auto parseError(lazy string msg, string fn = __FILE__, size_t ln = __LINE__)
{
return new ConvException(text("Can't parse string: ", msg), fn, ln);
}
private void parseCheck(alias source)(dchar c, string fn = __FILE__, size_t ln = __LINE__)
{
if (source.empty)
throw parseError(text("unexpected end of input when expecting", "\"", c, "\""));
if (source.front != c)
throw parseError(text("\"", c, "\" is missing"), fn, ln);
source.popFront();
}
private
{
T toStr(T, S)(S src)
if (isSomeString!T)
{
// workaround for Bugzilla 14198
static if (is(S == bool) && is(typeof({ T s = "string"; })))
{
return src ? "true" : "false";
}
else
{
import std.format : FormatSpec, formatValue;
import std.array : appender;
auto w = appender!T();
FormatSpec!(ElementEncodingType!T) f;
formatValue(w, src, f);
return w.data;
}
}
template isExactSomeString(T)
{
enum isExactSomeString = isSomeString!T && !is(T == enum);
}
template isEnumStrToStr(S, T)
{
enum isEnumStrToStr = isImplicitlyConvertible!(S, T) &&
is(S == enum) && isExactSomeString!T;
}
template isNullToStr(S, T)
{
enum isNullToStr = isImplicitlyConvertible!(S, T) &&
(is(Unqual!S == typeof(null))) && isExactSomeString!T;
}
template isRawStaticArray(T, A...)
{
enum isRawStaticArray =
A.length == 0 &&
isStaticArray!T &&
!is(T == class) &&
!is(T == interface) &&
!is(T == struct) &&
!is(T == union);
}
}
/**
* Thrown on conversion overflow errors.
*/
class ConvOverflowException : ConvException
{
@safe pure nothrow
this(string s, string fn = __FILE__, size_t ln = __LINE__)
{
super(s, fn, ln);
}
}
/**
The `to` template converts a value from one type _to another.
The source type is deduced and the target type must be specified, for example the
expression `to!int(42.0)` converts the number 42 from
`double` _to `int`. The conversion is "safe", i.e.,
it checks for overflow; `to!int(4.2e10)` would throw the
`ConvOverflowException` exception. Overflow checks are only
inserted when necessary, e.g., `to!double(42)` does not do
any checking because any `int` fits in a `double`.
Conversions from string _to numeric types differ from the C equivalents
`atoi()` and `atol()` by checking for overflow and not allowing whitespace.
For conversion of strings _to signed types, the grammar recognized is:
<pre>
$(I Integer): $(I Sign UnsignedInteger)
$(I UnsignedInteger)
$(I Sign):
$(B +)
$(B -)
</pre>
For conversion _to unsigned types, the grammar recognized is:
<pre>
$(I UnsignedInteger):
$(I DecimalDigit)
$(I DecimalDigit) $(I UnsignedInteger)
</pre>
*/
template to(T)
{
T to(A...)(A args)
if (!isRawStaticArray!A)
{
return toImpl!T(args);
}
// Fix issue 6175
T to(S)(ref S arg)
if (isRawStaticArray!S)
{
return toImpl!T(arg);
}
}
/**
* Converting a value _to its own type (useful mostly for generic code)
* simply returns its argument.
*/
@safe pure unittest
{
int a = 42;
int b = to!int(a);
double c = to!double(3.14); // c is double with value 3.14
}
/**
* Converting among numeric types is a safe way _to cast them around.
*
* Conversions from floating-point types _to integral types allow loss of
* precision (the fractional part of a floating-point number). The
* conversion is truncating towards zero, the same way a cast would
* truncate. (_To round a floating point value when casting _to an
* integral, use `roundTo`.)
*/
@safe pure unittest
{
import std.exception : assertThrown;
int a = 420;
assert(to!long(a) == a);
assertThrown!ConvOverflowException(to!byte(a));
assert(to!int(4.2e6) == 4200000);
assertThrown!ConvOverflowException(to!uint(-3.14));
assert(to!uint(3.14) == 3);
assert(to!uint(3.99) == 3);
assert(to!int(-3.99) == -3);
}
/**
* When converting strings _to numeric types, note that the D hexadecimal and binary
* literals are not handled. Neither the prefixes that indicate the base, nor the
* horizontal bar used _to separate groups of digits are recognized. This also
* applies to the suffixes that indicate the type.
*
* _To work around this, you can specify a radix for conversions involving numbers.
*/
@safe pure unittest
{
auto str = to!string(42, 16);
assert(str == "2A");
auto i = to!int(str, 16);
assert(i == 42);
}
/**
* Conversions from integral types _to floating-point types always
* succeed, but might lose accuracy. The largest integers with a
* predecessor representable in floating-point format are `2^24-1` for
* `float`, `2^53-1` for `double`, and `2^64-1` for `real` (when
* `real` is 80-bit, e.g. on Intel machines).
*/
@safe pure unittest
{
// 2^24 - 1, largest proper integer representable as float
int a = 16_777_215;
assert(to!int(to!float(a)) == a);
assert(to!int(to!float(-a)) == -a);
}
/**
* Converting an array _to another array type works by converting each
* element in turn. Associative arrays can be converted _to associative
* arrays as long as keys and values can in turn be converted.
*/
@safe pure unittest
{
import std.string : split;
int[] a = [1, 2, 3];
auto b = to!(float[])(a);
assert(b == [1.0f, 2, 3]);
string str = "1 2 3 4 5 6";
auto numbers = to!(double[])(split(str));
assert(numbers == [1.0, 2, 3, 4, 5, 6]);
int[string] c;
c["a"] = 1;
c["b"] = 2;
auto d = to!(double[wstring])(c);
assert(d["a"w] == 1 && d["b"w] == 2);
}
/**
* Conversions operate transitively, meaning that they work on arrays and
* associative arrays of any complexity.
*
* This conversion works because `to!short` applies _to an `int`, `to!wstring`
* applies _to a `string`, `to!string` applies _to a `double`, and
* `to!(double[])` applies _to an `int[]`. The conversion might throw an
* exception because `to!short` might fail the range check.
*/
@safe unittest
{
int[string][double[int[]]] a;
auto b = to!(short[wstring][string[double[]]])(a);
}
/**
* Object-to-object conversions by dynamic casting throw exception when
* the source is non-null and the target is null.
*/
@safe pure unittest
{
import std.exception : assertThrown;
// Testing object conversions
class A {}
class B : A {}
class C : A {}
A a1 = new A, a2 = new B, a3 = new C;
assert(to!B(a2) is a2);
assert(to!C(a3) is a3);
assertThrown!ConvException(to!B(a3));
}
/**
* Stringize conversion from all types is supported.
* $(UL
* $(LI String _to string conversion works for any two string types having
* ($(D char), $(D wchar), $(D dchar)) character widths and any
* combination of qualifiers (mutable, $(D const), or $(D immutable)).)
* $(LI Converts array (other than strings) _to string.
* Each element is converted by calling $(D to!T).)
* $(LI Associative array _to string conversion.
* Each element is printed by calling $(D to!T).)
* $(LI Object _to string conversion calls $(D toString) against the object or
* returns $(D "null") if the object is null.)
* $(LI Struct _to string conversion calls $(D toString) against the struct if
* it is defined.)
* $(LI For structs that do not define $(D toString), the conversion _to string
* produces the list of fields.)
* $(LI Enumerated types are converted _to strings as their symbolic names.)
* $(LI Boolean values are printed as $(D "true") or $(D "false").)
* $(LI $(D char), $(D wchar), $(D dchar) _to a string type.)
* $(LI Unsigned or signed integers _to strings.
* $(DL $(DT [special case])
* $(DD Convert integral value _to string in $(D_PARAM radix) radix.
* radix must be a value from 2 to 36.
* value is treated as a signed value only if radix is 10.
* The characters A through Z are used to represent values 10 through 36
* and their case is determined by the $(D_PARAM letterCase) parameter.)))
* $(LI All floating point types _to all string types.)
* $(LI Pointer to string conversions prints the pointer as a $(D size_t) value.
* If pointer is $(D char*), treat it as C-style strings.
* In that case, this function is $(D @system).))
*/
@system pure unittest
{
// @system due to cast and ptr
// Conversion representing dynamic/static array with string
long[] a = [ 1, 3, 5 ];
assert(to!string(a) == "[1, 3, 5]");
// Conversion representing associative array with string
int[string] associativeArray = ["0":1, "1":2];
assert(to!string(associativeArray) == `["0":1, "1":2]` ||
to!string(associativeArray) == `["1":2, "0":1]`);
// char* to string conversion
assert(to!string(cast(char*) null) == "");
assert(to!string("foo\0".ptr) == "foo");
// Conversion reinterpreting void array to string
auto w = "abcx"w;
const(void)[] b = w;
assert(b.length == 8);
auto c = to!(wchar[])(b);
assert(c == "abcx");
}
// Tests for issue 6175
@safe pure nothrow unittest
{
char[9] sarr = "blablabla";
auto darr = to!(char[])(sarr);
assert(sarr.ptr == darr.ptr);
assert(sarr.length == darr.length);
}
// Tests for issue 7348
@safe pure /+nothrow+/ unittest
{
assert(to!string(null) == "null");
assert(text(null) == "null");
}
// Tests for issue 11390
@safe pure /+nothrow+/ unittest
{
const(typeof(null)) ctn;
immutable(typeof(null)) itn;
assert(to!string(ctn) == "null");
assert(to!string(itn) == "null");
}
// Tests for issue 8729: do NOT skip leading WS
@safe pure unittest
{
import std.exception;
foreach (T; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
assertThrown!ConvException(to!T(" 0"));
assertThrown!ConvException(to!T(" 0", 8));
}
foreach (T; AliasSeq!(float, double, real))
{
assertThrown!ConvException(to!T(" 0"));
}
assertThrown!ConvException(to!bool(" true"));
alias NullType = typeof(null);
assertThrown!ConvException(to!NullType(" null"));
alias ARR = int[];
assertThrown!ConvException(to!ARR(" [1]"));
alias AA = int[int];
assertThrown!ConvException(to!AA(" [1:1]"));
}
/**
If the source type is implicitly convertible to the target type, $(D
to) simply performs the implicit conversion.
*/
private T toImpl(T, S)(S value)
if (isImplicitlyConvertible!(S, T) &&
!isEnumStrToStr!(S, T) && !isNullToStr!(S, T))
{
template isSignedInt(T)
{
enum isSignedInt = isIntegral!T && isSigned!T;
}
alias isUnsignedInt = isUnsigned;
// Conversion from integer to integer, and changing its sign
static if (isUnsignedInt!S && isSignedInt!T && S.sizeof == T.sizeof)
{ // unsigned to signed & same size
import std.exception : enforce;
enforce(value <= cast(S)T.max,
new ConvOverflowException("Conversion positive overflow"));
}
else static if (isSignedInt!S && isUnsignedInt!T)
{ // signed to unsigned
import std.exception : enforce;
enforce(0 <= value,
new ConvOverflowException("Conversion negative overflow"));
}
return value;
}
@safe pure nothrow unittest
{
enum E { a } // Issue 9523 - Allow identity enum conversion
auto e = to!E(E.a);
assert(e == E.a);
}
@safe pure nothrow unittest
{
int a = 42;
auto b = to!long(a);
assert(a == b);
}
// Tests for issue 6377
@safe pure unittest
{
import std.exception;
// Conversion between same size
foreach (S; AliasSeq!(byte, short, int, long))
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
alias U = Unsigned!S;
foreach (Sint; AliasSeq!(S, const S, immutable S))
foreach (Uint; AliasSeq!(U, const U, immutable U))
{
// positive overflow
Uint un = Uint.max;
assertThrown!ConvOverflowException(to!Sint(un),
text(Sint.stringof, ' ', Uint.stringof, ' ', un));
// negative overflow
Sint sn = -1;
assertThrown!ConvOverflowException(to!Uint(sn),
text(Sint.stringof, ' ', Uint.stringof, ' ', un));
}
}();
// Conversion between different size
foreach (i, S1; AliasSeq!(byte, short, int, long))
foreach ( S2; AliasSeq!(byte, short, int, long)[i+1..$])
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
alias U1 = Unsigned!S1;
alias U2 = Unsigned!S2;
static assert(U1.sizeof < S2.sizeof);
// small unsigned to big signed
foreach (Uint; AliasSeq!(U1, const U1, immutable U1))
foreach (Sint; AliasSeq!(S2, const S2, immutable S2))
{
Uint un = Uint.max;
assertNotThrown(to!Sint(un));
assert(to!Sint(un) == un);
}
// big unsigned to small signed
foreach (Uint; AliasSeq!(U2, const U2, immutable U2))
foreach (Sint; AliasSeq!(S1, const S1, immutable S1))
{
Uint un = Uint.max;
assertThrown(to!Sint(un));
}
static assert(S1.sizeof < U2.sizeof);
// small signed to big unsigned
foreach (Sint; AliasSeq!(S1, const S1, immutable S1))
foreach (Uint; AliasSeq!(U2, const U2, immutable U2))
{
Sint sn = -1;
assertThrown!ConvOverflowException(to!Uint(sn));
}
// big signed to small unsigned
foreach (Sint; AliasSeq!(S2, const S2, immutable S2))
foreach (Uint; AliasSeq!(U1, const U1, immutable U1))
{
Sint sn = -1;
assertThrown!ConvOverflowException(to!Uint(sn));
}
}();
}
/*
Converting static arrays forwards to their dynamic counterparts.
*/
private T toImpl(T, S)(ref S s)
if (isRawStaticArray!S)
{
return toImpl!(T, typeof(s[0])[])(s);
}
@safe pure nothrow unittest
{
char[4] test = ['a', 'b', 'c', 'd'];
static assert(!isInputRange!(Unqual!(char[4])));
assert(to!string(test) == test);
}
/**
When source type supports member template function opCast, it is used.
*/
private T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
is(typeof(S.init.opCast!T()) : T) &&
!isExactSomeString!T &&
!is(typeof(T(value))))
{
return value.opCast!T();
}
@safe pure unittest
{
static struct Test
{
struct T
{
this(S s) @safe pure { }
}
struct S
{
T opCast(U)() @safe pure { assert(false); }
}
}
cast(void)to!(Test.T)(Test.S());
// make sure std.conv.to is doing the same thing as initialization
Test.S s;
Test.T t = s;
}
@safe pure unittest
{
class B
{
T opCast(T)() { return 43; }
}
auto b = new B;
assert(to!int(b) == 43);
struct S
{
T opCast(T)() { return 43; }
}
auto s = S();
assert(to!int(s) == 43);
}
/**
When target type supports 'converting construction', it is used.
$(UL $(LI If target type is struct, $(D T(value)) is used.)
$(LI If target type is class, $(D new T(value)) is used.))
*/
private T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
is(T == struct) && is(typeof(T(value))))
{
return T(value);
}
// Bugzilla 3961
@safe pure unittest
{
struct Int
{
int x;
}
Int i = to!Int(1);
static struct Int2
{
int x;
this(int x) @safe pure { this.x = x; }
}
Int2 i2 = to!Int2(1);
static struct Int3
{
int x;
static Int3 opCall(int x) @safe pure
{
Int3 i;
i.x = x;
return i;
}
}
Int3 i3 = to!Int3(1);
}
// Bugzilla 6808
@safe pure unittest
{
static struct FakeBigInt
{
this(string s) @safe pure {}
}
string s = "101";
auto i3 = to!FakeBigInt(s);
}
/// ditto
private T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
is(T == class) && is(typeof(new T(value))))
{
return new T(value);
}
@safe pure unittest
{
static struct S
{
int x;
}
static class C
{
int x;
this(int x) @safe pure { this.x = x; }
}
static class B
{
int value;
this(S src) @safe pure { value = src.x; }
this(C src) @safe pure { value = src.x; }
}
S s = S(1);
auto b1 = to!B(s); // == new B(s)
assert(b1.value == 1);
C c = new C(2);
auto b2 = to!B(c); // == new B(c)
assert(b2.value == 2);
auto c2 = to!C(3); // == new C(3)
assert(c2.x == 3);
}
@safe pure unittest
{
struct S
{
class A
{
this(B b) @safe pure {}
}
class B : A
{
this() @safe pure { super(this); }
}
}
S.B b = new S.B();
S.A a = to!(S.A)(b); // == cast(S.A)b
// (do not run construction conversion like new S.A(b))
assert(b is a);
static class C : Object
{
this() @safe pure {}
this(Object o) @safe pure {}
}
Object oc = new C();
C a2 = to!C(oc); // == new C(a)
// Construction conversion overrides down-casting conversion
assert(a2 !is a); //
}
/**
Object-to-object conversions by dynamic casting throw exception when the source is
non-null and the target is null.
*/
private T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
(is(S == class) || is(S == interface)) && !is(typeof(value.opCast!T()) : T) &&
(is(T == class) || is(T == interface)) && !is(typeof(new T(value))))
{
static if (is(T == immutable))
{
// immutable <- immutable
enum isModConvertible = is(S == immutable);
}
else static if (is(T == const))
{
static if (is(T == shared))
{
// shared const <- shared
// shared const <- shared const
// shared const <- immutable
enum isModConvertible = is(S == shared) || is(S == immutable);
}
else
{
// const <- mutable
// const <- immutable
enum isModConvertible = !is(S == shared);
}
}
else
{
static if (is(T == shared))
{
// shared <- shared mutable
enum isModConvertible = is(S == shared) && !is(S == const);
}
else
{
// (mutable) <- (mutable)
enum isModConvertible = is(Unqual!S == S);
}
}
static assert(isModConvertible, "Bad modifier conversion: "~S.stringof~" to "~T.stringof);
auto result = ()@trusted{ return cast(T) value; }();
if (!result && value)
{
throw new ConvException("Cannot convert object of static type "
~S.classinfo.name~" and dynamic type "~value.classinfo.name
~" to type "~T.classinfo.name);
}
return result;
}
// Unittest for 6288
@safe pure unittest
{
import std.exception;
alias Identity(T) = T;
alias toConst(T) = const T;
alias toShared(T) = shared T;
alias toSharedConst(T) = shared const T;
alias toImmutable(T) = immutable T;
template AddModifier(int n) if (0 <= n && n < 5)
{
static if (n == 0) alias AddModifier = Identity;
else static if (n == 1) alias AddModifier = toConst;
else static if (n == 2) alias AddModifier = toShared;
else static if (n == 3) alias AddModifier = toSharedConst;
else static if (n == 4) alias AddModifier = toImmutable;
}
interface I {}
interface J {}
class A {}
class B : A {}
class C : B, I, J {}
class D : I {}
foreach (m1; AliasSeq!(0,1,2,3,4)) // enumerate modifiers
foreach (m2; AliasSeq!(0,1,2,3,4)) // ditto
(){ // avoid slow optimizations for large functions @@@BUG@@@ 2396
alias srcmod = AddModifier!m1;
alias tgtmod = AddModifier!m2;
// Compile time convertible equals to modifier convertible.
static if (isImplicitlyConvertible!(srcmod!Object, tgtmod!Object))
{
// Test runtime conversions: class to class, class to interface,
// interface to class, and interface to interface
// Check that the runtime conversion to succeed
srcmod!A ac = new srcmod!C();
srcmod!I ic = new srcmod!C();
assert(to!(tgtmod!C)(ac) !is null); // A(c) to C
assert(to!(tgtmod!I)(ac) !is null); // A(c) to I
assert(to!(tgtmod!C)(ic) !is null); // I(c) to C
assert(to!(tgtmod!J)(ic) !is null); // I(c) to J
// Check that the runtime conversion fails
srcmod!A ab = new srcmod!B();
srcmod!I id = new srcmod!D();
assertThrown(to!(tgtmod!C)(ab)); // A(b) to C
assertThrown(to!(tgtmod!I)(ab)); // A(b) to I
assertThrown(to!(tgtmod!C)(id)); // I(d) to C
assertThrown(to!(tgtmod!J)(id)); // I(d) to J
}
else
{
// Check that the conversion is rejected statically
static assert(!is(typeof(to!(tgtmod!C)(srcmod!A.init)))); // A to C
static assert(!is(typeof(to!(tgtmod!I)(srcmod!A.init)))); // A to I
static assert(!is(typeof(to!(tgtmod!C)(srcmod!I.init)))); // I to C
static assert(!is(typeof(to!(tgtmod!J)(srcmod!I.init)))); // I to J
}
}();
}
/**
Handles type _to string conversions
*/
private T toImpl(T, S)(S value)
if (!(isImplicitlyConvertible!(S, T) &&
!isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) &&
!isInfinite!S && isExactSomeString!T)
{
static if (isExactSomeString!S && value[0].sizeof == ElementEncodingType!T.sizeof)
{
// string-to-string with incompatible qualifier conversion
static if (is(ElementEncodingType!T == immutable))
{
// conversion (mutable|const) -> immutable
return value.idup;
}
else
{
// conversion (immutable|const) -> mutable
return value.dup;
}
}
else static if (isExactSomeString!S)
{
import std.array : appender;
// other string-to-string
//Use Appender directly instead of toStr, which also uses a formatedWrite
auto w = appender!T();
w.put(value);
return w.data;
}
else static if (isIntegral!S && !is(S == enum))
{
// other integral-to-string conversions with default radix
return toImpl!(T, S)(value, 10);
}
else static if (is(S == void[]) || is(S == const(void)[]) || is(S == immutable(void)[]))
{
import core.stdc.string : memcpy;
import std.exception : enforce;
// Converting void array to string
alias Char = Unqual!(ElementEncodingType!T);
auto raw = cast(const(ubyte)[]) value;
enforce(raw.length % Char.sizeof == 0,
new ConvException("Alignment mismatch in converting a "
~ S.stringof ~ " to a "
~ T.stringof));
auto result = new Char[raw.length / Char.sizeof];
()@trusted{ memcpy(result.ptr, value.ptr, value.length); }();
return cast(T) result;
}
else static if (isPointer!S && isSomeChar!(PointerTarget!S))
{
// This is unsafe because we cannot guarantee that the pointer is null terminated.
return () @system {
static if (is(S : const(char)*))
import core.stdc.string : strlen;
else
size_t strlen(S s) nothrow
{
S p = s;
while (*p++) {}
return p-s-1;
}
return toImpl!T(value ? value[0 .. strlen(value)].dup : null);
}();
}
else static if (isSomeString!T && is(S == enum))
{
static if (isSwitchable!(OriginalType!S) && EnumMembers!S.length <= 50)
{
switch (value)
{
foreach (member; NoDuplicates!(EnumMembers!S))
{
case member:
return to!T(enumRep!(immutable(T), S, member));
}
default:
}
}
else
{
foreach (member; EnumMembers!S)
{
if (value == member)
return to!T(enumRep!(immutable(T), S, member));
}
}
import std.format : FormatSpec, formatValue;
import std.array : appender;
//Default case, delegate to format
//Note: we don't call toStr directly, to avoid duplicate work.
auto app = appender!T();
app.put("cast(");
app.put(S.stringof);
app.put(')');
FormatSpec!char f;
formatValue(app, cast(OriginalType!S)value, f);
return app.data;
}
else
{
// other non-string values runs formatting
return toStr!T(value);
}
}
// Bugzilla 14042
@system unittest
{
immutable(char)* ptr = "hello".ptr;
auto result = ptr.to!(char[]);
}
// Bugzilla 8384
@system unittest
{
void test1(T)(T lp, string cmp)
{
foreach (e; AliasSeq!(char, wchar, dchar))
{
test2!(e[])(lp, cmp);
test2!(const(e)[])(lp, cmp);
test2!(immutable(e)[])(lp, cmp);
}
}
void test2(D, S)(S lp, string cmp)
{
assert(to!string(to!D(lp)) == cmp);
}
foreach (e; AliasSeq!("Hello, world!", "Hello, world!"w, "Hello, world!"d))
{
test1(e, "Hello, world!");
test1(e.ptr, "Hello, world!");
}
foreach (e; AliasSeq!("", ""w, ""d))
{
test1(e, "");
test1(e.ptr, "");
}
}
/*
Check whether type $(D T) can be used in a switch statement.
This is useful for compile-time generation of switch case statements.
*/
private template isSwitchable(E)
{
enum bool isSwitchable = is(typeof({
switch (E.init) { default: }
}));
}
//
@safe unittest
{
static assert(isSwitchable!int);
static assert(!isSwitchable!double);
static assert(!isSwitchable!real);
}
//Static representation of the index I of the enum S,
//In representation T.
//T must be an immutable string (avoids un-necessary initializations).
private template enumRep(T, S, S value)
if (is (T == immutable) && isExactSomeString!T && is(S == enum))
{
static T enumRep = toStr!T(value);
}
@safe pure unittest
{
import std.exception;
void dg()
{
// string to string conversion
alias Chars = AliasSeq!(char, wchar, dchar);
foreach (LhsC; Chars)
{
alias LhStrings = AliasSeq!(LhsC[], const(LhsC)[], immutable(LhsC)[]);
foreach (Lhs; LhStrings)
{
foreach (RhsC; Chars)
{
alias RhStrings = AliasSeq!(RhsC[], const(RhsC)[], immutable(RhsC)[]);
foreach (Rhs; RhStrings)
{
Lhs s1 = to!Lhs("wyda");
Rhs s2 = to!Rhs(s1);
//writeln(Lhs.stringof, " -> ", Rhs.stringof);
assert(s1 == to!Lhs(s2));
}
}
}
}
foreach (T; Chars)
{
foreach (U; Chars)
{
T[] s1 = to!(T[])("Hello, world!");
auto s2 = to!(U[])(s1);
assert(s1 == to!(T[])(s2));
auto s3 = to!(const(U)[])(s1);
assert(s1 == to!(T[])(s3));
auto s4 = to!(immutable(U)[])(s1);
assert(s1 == to!(T[])(s4));
}
}
}
dg();
assertCTFEable!dg;
}
@safe pure unittest
{
// Conversion representing bool value with string
bool b;
assert(to!string(b) == "false");
b = true;
assert(to!string(b) == "true");
}
@safe pure unittest
{
// Conversion representing character value with string
alias AllChars =
AliasSeq!( char, const( char), immutable( char),
wchar, const(wchar), immutable(wchar),
dchar, const(dchar), immutable(dchar));
foreach (Char1; AllChars)
{
foreach (Char2; AllChars)
{
Char1 c = 'a';
assert(to!(Char2[])(c)[0] == c);
}
uint x = 4;
assert(to!(Char1[])(x) == "4");
}
string s = "foo";
string s2;
foreach (char c; s)
{
s2 ~= to!string(c);
}
assert(s2 == "foo");
}
@safe pure nothrow unittest
{
import std.exception;
// Conversion representing integer values with string
foreach (Int; AliasSeq!(ubyte, ushort, uint, ulong))
{
assert(to!string(Int(0)) == "0");
assert(to!string(Int(9)) == "9");
assert(to!string(Int(123)) == "123");
}
foreach (Int; AliasSeq!(byte, short, int, long))
{
assert(to!string(Int(0)) == "0");
assert(to!string(Int(9)) == "9");
assert(to!string(Int(123)) == "123");
assert(to!string(Int(-0)) == "0");
assert(to!string(Int(-9)) == "-9");
assert(to!string(Int(-123)) == "-123");
assert(to!string(const(Int)(6)) == "6");
}
assert(wtext(int.max) == "2147483647"w);
assert(wtext(int.min) == "-2147483648"w);
assert(to!string(0L) == "0");
assertCTFEable!(
{
assert(to!string(1uL << 62) == "4611686018427387904");
assert(to!string(0x100000000) == "4294967296");
assert(to!string(-138L) == "-138");
});
}
@safe unittest // sprintf issue
{
double[2] a = [ 1.5, 2.5 ];
assert(to!string(a) == "[1.5, 2.5]");
}
@system unittest
{
// Conversion representing class object with string
class A
{
override string toString() const { return "an A"; }
}
A a;
assert(to!string(a) == "null");
a = new A;
assert(to!string(a) == "an A");
// Bug 7660
class C { override string toString() const { return "C"; } }
struct S { C c; alias c this; }
S s; s.c = new C();
assert(to!string(s) == "C");
}
@safe unittest
{
// Conversion representing struct object with string
struct S1
{
string toString() { return "wyda"; }
}
assert(to!string(S1()) == "wyda");
struct S2
{
int a = 42;
float b = 43.5;
}
S2 s2;
assert(to!string(s2) == "S2(42, 43.5)");
// Test for issue 8080
struct S8080
{
short[4] data;
alias data this;
string toString() { return "<S>"; }
}
S8080 s8080;
assert(to!string(s8080) == "<S>");
}
@safe unittest
{
// Conversion representing enum value with string
enum EB : bool { a = true }
enum EU : uint { a = 0, b = 1, c = 2 } // base type is unsigned
enum EI : int { a = -1, b = 0, c = 1 } // base type is signed (bug 7909)
enum EF : real { a = 1.414, b = 1.732, c = 2.236 }
enum EC : char { a = 'x', b = 'y' }
enum ES : string { a = "aaa", b = "bbb" }
foreach (E; AliasSeq!(EB, EU, EI, EF, EC, ES))
{
assert(to! string(E.a) == "a"c);
assert(to!wstring(E.a) == "a"w);
assert(to!dstring(E.a) == "a"d);
}
// Test an value not corresponding to an enum member.
auto o = cast(EU)5;
assert(to! string(o) == "cast(EU)5"c);
assert(to!wstring(o) == "cast(EU)5"w);
assert(to!dstring(o) == "cast(EU)5"d);
}
@safe unittest
{
enum E
{
foo,
doo = foo, // check duplicate switch statements
bar,
}
//Test regression 12494
assert(to!string(E.foo) == "foo");
assert(to!string(E.doo) == "foo");
assert(to!string(E.bar) == "bar");
foreach (S; AliasSeq!(string, wstring, dstring, const(char[]), const(wchar[]), const(dchar[])))
{
auto s1 = to!S(E.foo);
auto s2 = to!S(E.foo);
assert(s1 == s2);
// ensure we don't allocate when it's unnecessary
assert(s1 is s2);
}
foreach (S; AliasSeq!(char[], wchar[], dchar[]))
{
auto s1 = to!S(E.foo);
auto s2 = to!S(E.foo);
assert(s1 == s2);
// ensure each mutable array is unique
assert(s1 !is s2);
}
}
// ditto
@trusted pure private T toImpl(T, S)(S value, uint radix, LetterCase letterCase = LetterCase.upper)
if (isIntegral!S &&
isExactSomeString!T)
in
{
assert(radix >= 2 && radix <= 36);
}
body
{
alias EEType = Unqual!(ElementEncodingType!T);
T toStringRadixConvert(size_t bufLen)(uint runtimeRadix = 0)
{
Unsigned!(Unqual!S) div = void, mValue = unsigned(value);
size_t index = bufLen;
EEType[bufLen] buffer = void;
char baseChar = letterCase == LetterCase.lower ? 'a' : 'A';
char mod = void;
do
{
div = cast(S)(mValue / runtimeRadix );
mod = cast(ubyte)(mValue % runtimeRadix);
mod += mod < 10 ? '0' : baseChar - 10;
buffer[--index] = cast(char)mod;
mValue = div;
} while (mValue);
return cast(T)buffer[index .. $].dup;
}
import std.array;
switch (radix)
{
case 10:
// The (value+0) is so integral promotions happen to the type
return toChars!(10, EEType)(value + 0).array;
case 16:
// The unsigned(unsigned(value)+0) is so unsigned integral promotions happen to the type
if (letterCase == letterCase.upper)
return toChars!(16, EEType, LetterCase.upper)(unsigned(unsigned(value) + 0)).array;
else
return toChars!(16, EEType, LetterCase.lower)(unsigned(unsigned(value) + 0)).array;
case 2:
return toChars!(2, EEType)(unsigned(unsigned(value) + 0)).array;
case 8:
return toChars!(8, EEType)(unsigned(unsigned(value) + 0)).array;
default:
return toStringRadixConvert!(S.sizeof * 6)(radix);
}
}
@safe pure nothrow unittest
{
foreach (Int; AliasSeq!(uint, ulong))
{
assert(to!string(Int(16), 16) == "10");
assert(to!string(Int(15), 2u) == "1111");
assert(to!string(Int(1), 2u) == "1");
assert(to!string(Int(0x1234AF), 16u) == "1234AF");
assert(to!string(Int(0x1234BCD), 16u, LetterCase.upper) == "1234BCD");
assert(to!string(Int(0x1234AF), 16u, LetterCase.lower) == "1234af");
}
foreach (Int; AliasSeq!(int, long))
{
assert(to!string(Int(-10), 10u) == "-10");
}
assert(to!string(byte(-10), 16) == "F6");
assert(to!string(long.min) == "-9223372036854775808");
assert(to!string(long.max) == "9223372036854775807");
}
/**
Narrowing numeric-numeric conversions throw when the value does not
fit in the narrower type.
*/
private T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
(isNumeric!S || isSomeChar!S || isBoolean!S) &&
(isNumeric!T || isSomeChar!T || isBoolean!T) && !is(T == enum))
{
enum sSmallest = mostNegative!S;
enum tSmallest = mostNegative!T;
static if (sSmallest < 0)
{
// possible underflow converting from a signed
static if (tSmallest == 0)
{
immutable good = value >= 0;
}
else
{
static assert(tSmallest < 0);
immutable good = value >= tSmallest;
}
if (!good)
throw new ConvOverflowException("Conversion negative overflow");
}
static if (S.max > T.max)
{
// possible overflow
if (value > T.max)
throw new ConvOverflowException("Conversion positive overflow");
}
return (ref value)@trusted{ return cast(T) value; }(value);
}
@safe pure unittest
{
import std.exception;
dchar a = ' ';
assert(to!char(a) == ' ');
a = 300;
assert(collectException(to!char(a)));
dchar from0 = 'A';
char to0 = to!char(from0);
wchar from1 = 'A';
char to1 = to!char(from1);
char from2 = 'A';
char to2 = to!char(from2);
char from3 = 'A';
wchar to3 = to!wchar(from3);
char from4 = 'A';
dchar to4 = to!dchar(from4);
}
@safe unittest
{
import std.exception;
// Narrowing conversions from enum -> integral should be allowed, but they
// should throw at runtime if the enum value doesn't fit in the target
// type.
enum E1 : ulong { A = 1, B = 1UL<<48, C = 0 }
assert(to!int(E1.A) == 1);
assert(to!bool(E1.A) == true);
assertThrown!ConvOverflowException(to!int(E1.B)); // E1.B overflows int
assertThrown!ConvOverflowException(to!bool(E1.B)); // E1.B overflows bool
assert(to!bool(E1.C) == false);
enum E2 : long { A = -1L<<48, B = -1<<31, C = 1<<31 }
assertThrown!ConvOverflowException(to!int(E2.A)); // E2.A overflows int
assertThrown!ConvOverflowException(to!uint(E2.B)); // E2.B overflows uint
assert(to!int(E2.B) == -1<<31); // but does not overflow int
assert(to!int(E2.C) == 1<<31); // E2.C does not overflow int
enum E3 : int { A = -1, B = 1, C = 255, D = 0 }
assertThrown!ConvOverflowException(to!ubyte(E3.A));
assertThrown!ConvOverflowException(to!bool(E3.A));
assert(to!byte(E3.A) == -1);
assert(to!byte(E3.B) == 1);
assert(to!ubyte(E3.C) == 255);
assert(to!bool(E3.B) == true);
assertThrown!ConvOverflowException(to!byte(E3.C));
assertThrown!ConvOverflowException(to!bool(E3.C));
assert(to!bool(E3.D) == false);
}
/**
Array-to-array conversion (except when target is a string type)
converts each element in turn by using $(D to).
*/
private T toImpl(T, S)(S value)
if (!isImplicitlyConvertible!(S, T) &&
!isSomeString!S && isDynamicArray!S &&
!isExactSomeString!T && isArray!T)
{
alias E = typeof(T.init[0]);
static if (isStaticArray!T)
{
import std.exception : enforce;
auto res = to!(E[])(value);
enforce!ConvException(T.length == res.length,
convFormat("Length mismatch when converting to static array: %s vs %s", T.length, res.length));
return res[0 .. T.length];
}
else
{
import std.array : appender;
auto w = appender!(E[])();
w.reserve(value.length);
foreach (i, ref e; value)
{
w.put(to!E(e));
}
return w.data;
}
}
@safe pure unittest
{
import std.exception;
// array to array conversions
uint[] a = [ 1u, 2, 3 ];
auto b = to!(float[])(a);
assert(b == [ 1.0f, 2, 3 ]);
immutable(int)[3] d = [ 1, 2, 3 ];
b = to!(float[])(d);
assert(b == [ 1.0f, 2, 3 ]);
uint[][] e = [ a, a ];
auto f = to!(float[][])(e);
assert(f[0] == b && f[1] == b);
// Test for bug 8264
struct Wrap
{
string wrap;
alias wrap this;
}
Wrap[] warr = to!(Wrap[])(["foo", "bar"]); // should work
// Issue 12633
import std.conv : to;
const s2 = ["10", "20"];
immutable int[2] a3 = s2.to!(int[2]);
assert(a3 == [10, 20]);
// verify length mismatches are caught
immutable s4 = [1, 2, 3, 4];
foreach (i; [1, 4])
{
auto ex = collectException(s4[0 .. i].to!(int[2]));
assert(ex && ex.msg == "Length mismatch when converting to static array: 2 vs " ~ [cast(char)(i + '0')],
ex ? ex.msg : "Exception was not thrown!");
}
}
@safe unittest
{
auto b = [ 1.0f, 2, 3 ];
auto c = to!(string[])(b);
assert(c[0] == "1" && c[1] == "2" && c[2] == "3");
}
/**
Associative array to associative array conversion converts each key
and each value in turn.
*/
private T toImpl(T, S)(S value)
if (isAssociativeArray!S &&
isAssociativeArray!T && !is(T == enum))
{
/* This code is potentially unsafe.
*/
alias K2 = KeyType!T;
alias V2 = ValueType!T;
// While we are "building" the AA, we need to unqualify its values, and only re-qualify at the end
Unqual!V2[K2] result;
foreach (k1, v1; value)
{
// Cast values temporarily to Unqual!V2 to store them to result variable
result[to!K2(k1)] = cast(Unqual!V2) to!V2(v1);
}
// Cast back to original type
return cast(T)result;
}
@safe unittest
{
// hash to hash conversions
int[string] a;
a["0"] = 1;
a["1"] = 2;
auto b = to!(double[dstring])(a);
assert(b["0"d] == 1 && b["1"d] == 2);
}
@safe unittest // Bugzilla 8705, from doc
{
import std.exception;
int[string][double[int[]]] a;
auto b = to!(short[wstring][string[double[]]])(a);
a = [null:["hello":int.max]];
assertThrown!ConvOverflowException(to!(short[wstring][string[double[]]])(a));
}
@system unittest // Extra cases for AA with qualifiers conversion
{
int[][int[]] a;// = [[], []];
auto b = to!(immutable(short[])[immutable short[]])(a);
double[dstring][int[long[]]] c;
auto d = to!(immutable(short[immutable wstring])[immutable string[double[]]])(c);
}
private void testIntegralToFloating(Integral, Floating)()
{
Integral a = 42;
auto b = to!Floating(a);
assert(a == b);
assert(a == to!Integral(b));
}
private void testFloatingToIntegral(Floating, Integral)()
{
bool convFails(Source, Target, E)(Source src)
{
try
auto t = to!Target(src);
catch (E)
return true;
return false;
}
// convert some value
Floating a = 4.2e1;
auto b = to!Integral(a);
assert(is(typeof(b) == Integral) && b == 42);
// convert some negative value (if applicable)
a = -4.2e1;
static if (Integral.min < 0)
{
b = to!Integral(a);
assert(is(typeof(b) == Integral) && b == -42);
}
else
{
// no go for unsigned types
assert(convFails!(Floating, Integral, ConvOverflowException)(a));
}
// convert to the smallest integral value
a = 0.0 + Integral.min;
static if (Integral.min < 0)
{
a = -a; // -Integral.min not representable as an Integral
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
|| Floating.sizeof <= Integral.sizeof);
}
a = 0.0 + Integral.min;
assert(to!Integral(a) == Integral.min);
--a; // no more representable as an Integral
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
|| Floating.sizeof <= Integral.sizeof);
a = 0.0 + Integral.max;
assert(to!Integral(a) == Integral.max || Floating.sizeof <= Integral.sizeof);
++a; // no more representable as an Integral
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
|| Floating.sizeof <= Integral.sizeof);
// convert a value with a fractional part
a = 3.14;
assert(to!Integral(a) == 3);
a = 3.99;
assert(to!Integral(a) == 3);
static if (Integral.min < 0)
{
a = -3.14;
assert(to!Integral(a) == -3);
a = -3.99;
assert(to!Integral(a) == -3);
}
}
@safe pure unittest
{
alias AllInts = AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong);
alias AllFloats = AliasSeq!(float, double, real);
alias AllNumerics = AliasSeq!(AllInts, AllFloats);
// test with same type
{
foreach (T; AllNumerics)
{
T a = 42;
auto b = to!T(a);
assert(is(typeof(a) == typeof(b)) && a == b);
}
}
// test that floating-point numbers convert properly to largest ints
// see http://oregonstate.edu/~peterseb/mth351/docs/351s2001_fp80x87.html
// look for "largest fp integer with a predecessor"
{
// float
int a = 16_777_215; // 2^24 - 1
assert(to!int(to!float(a)) == a);
assert(to!int(to!float(-a)) == -a);
// double
long b = 9_007_199_254_740_991; // 2^53 - 1
assert(to!long(to!double(b)) == b);
assert(to!long(to!double(-b)) == -b);
// real
ulong c = 18_446_744_073_709_551_615UL; // 2^64 - 1
assert(to!ulong(to!real(c)) == c);
}
// test conversions floating => integral
{
// AllInts[0 .. $ - 1] should be AllInts
// @@@ BUG IN COMPILER @@@
foreach (Integral; AllInts[0 .. $ - 1])
{
foreach (Floating; AllFloats)
{
testFloatingToIntegral!(Floating, Integral)();
}
}
}
// test conversion integral => floating
{
foreach (Integral; AllInts[0 .. $ - 1])
{
foreach (Floating; AllFloats)
{
testIntegralToFloating!(Integral, Floating)();
}
}
}
// test parsing
{
foreach (T; AllNumerics)
{
// from type immutable(char)[2]
auto a = to!T("42");
assert(a == 42);
// from type char[]
char[] s1 = "42".dup;
a = to!T(s1);
assert(a == 42);
// from type char[2]
char[2] s2;
s2[] = "42";
a = to!T(s2);
assert(a == 42);
// from type immutable(wchar)[2]
a = to!T("42"w);
assert(a == 42);
}
}
}
@safe unittest
{
alias AllInts = AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong);
alias AllFloats = AliasSeq!(float, double, real);
alias AllNumerics = AliasSeq!(AllInts, AllFloats);
// test conversions to string
{
foreach (T; AllNumerics)
{
T a = 42;
assert(to!string(a) == "42");
assert(to!wstring(a) == "42"w);
assert(to!dstring(a) == "42"d);
// array test
T[] b = new T[2];
b[0] = 42;
b[1] = 33;
assert(to!string(b) == "[42, 33]");
}
}
// test array to string conversion
foreach (T ; AllNumerics)
{
auto a = [to!T(1), 2, 3];
assert(to!string(a) == "[1, 2, 3]");
}
// test enum to int conversion
enum Testing { Test1, Test2 }
Testing t;
auto a = to!string(t);
assert(a == "Test1");
}
/**
String, or string-like input range, to non-string conversion runs parsing.
$(UL
$(LI When the source is a wide string, it is first converted to a narrow
string and then parsed.)
$(LI When the source is a narrow string, normal text parsing occurs.))
*/
private T toImpl(T, S)(S value)
if (isInputRange!S && isSomeChar!(ElementEncodingType!S) &&
!isExactSomeString!T && is(typeof(parse!T(value))))
{
scope(success)
{
if (!value.empty)
{
throw convError!(S, T)(value);
}
}
return parse!T(value);
}
/// ditto
private T toImpl(T, S)(S value, uint radix)
if (isInputRange!S && isSomeChar!(ElementEncodingType!S) &&
!isExactSomeString!T && is(typeof(parse!T(value, radix))))
{
scope(success)
{
if (!value.empty)
{
throw convError!(S, T)(value);
}
}
return parse!T(value, radix);
}
@safe pure unittest
{
// Issue 6668 - ensure no collaterals thrown
try { to!uint("-1"); }
catch (ConvException e) { assert(e.next is null); }
}
@safe pure unittest
{
foreach (Str; AliasSeq!(string, wstring, dstring))
{
Str a = "123";
assert(to!int(a) == 123);
assert(to!double(a) == 123);
}
// 6255
auto n = to!int("FF", 16);
assert(n == 255);
}
// bugzilla 15800
@safe unittest
{
import std.utf : byCodeUnit, byChar, byWchar, byDchar;
assert(to!int(byCodeUnit("10")) == 10);
assert(to!int(byCodeUnit("10"), 10) == 10);
assert(to!int(byCodeUnit("10"w)) == 10);
assert(to!int(byCodeUnit("10"w), 10) == 10);
assert(to!int(byChar("10")) == 10);
assert(to!int(byChar("10"), 10) == 10);
assert(to!int(byWchar("10")) == 10);
assert(to!int(byWchar("10"), 10) == 10);
assert(to!int(byDchar("10")) == 10);
assert(to!int(byDchar("10"), 10) == 10);
}
/**
Convert a value that is implicitly convertible to the enum base type
into an Enum value. If the value does not match any enum member values
a ConvException is thrown.
Enums with floating-point or string base types are not supported.
*/
private T toImpl(T, S)(S value)
if (is(T == enum) && !is(S == enum)
&& is(typeof(value == OriginalType!T.init))
&& !isFloatingPoint!(OriginalType!T) && !isSomeString!(OriginalType!T))
{
foreach (Member; EnumMembers!T)
{
if (Member == value)
return Member;
}
throw new ConvException(convFormat("Value (%s) does not match any member value of enum '%s'", value, T.stringof));
}
@safe pure unittest
{
import std.exception;
enum En8143 : int { A = 10, B = 20, C = 30, D = 20 }
enum En8143[][] m3 = to!(En8143[][])([[10, 30], [30, 10]]);
static assert(m3 == [[En8143.A, En8143.C], [En8143.C, En8143.A]]);
En8143 en1 = to!En8143(10);
assert(en1 == En8143.A);
assertThrown!ConvException(to!En8143(5)); // matches none
En8143[][] m1 = to!(En8143[][])([[10, 30], [30, 10]]);
assert(m1 == [[En8143.A, En8143.C], [En8143.C, En8143.A]]);
}
/***************************************************************
Rounded conversion from floating point to integral.
Rounded conversions do not work with non-integral target types.
*/
template roundTo(Target)
{
Target roundTo(Source)(Source value)
{
import std.math : trunc;
static assert(isFloatingPoint!Source);
static assert(isIntegral!Target);
return to!Target(trunc(value + (value < 0 ? -0.5L : 0.5L)));
}
}
///
@safe unittest
{
assert(roundTo!int(3.14) == 3);
assert(roundTo!int(3.49) == 3);
assert(roundTo!int(3.5) == 4);
assert(roundTo!int(3.999) == 4);
assert(roundTo!int(-3.14) == -3);
assert(roundTo!int(-3.49) == -3);
assert(roundTo!int(-3.5) == -4);
assert(roundTo!int(-3.999) == -4);
assert(roundTo!(const int)(to!(const double)(-3.999)) == -4);
}
@safe unittest
{
import std.exception;
// boundary values
foreach (Int; AliasSeq!(byte, ubyte, short, ushort, int, uint))
{
assert(roundTo!Int(Int.min - 0.4L) == Int.min);
assert(roundTo!Int(Int.max + 0.4L) == Int.max);
assertThrown!ConvOverflowException(roundTo!Int(Int.min - 0.5L));
assertThrown!ConvOverflowException(roundTo!Int(Int.max + 0.5L));
}
}
/**
The $(D parse) family of functions works quite like the $(D to)
family, except that:
$(OL
$(LI It only works with character ranges as input.)
$(LI It takes the input by reference. (This means that rvalues - such
as string literals - are not accepted: use $(D to) instead.))
$(LI It advances the input to the position following the conversion.)
$(LI It does not throw if it could not convert the entire input.))
This overload converts an character input range to a `bool`.
Params:
Target = the type to convert to
s = the lvalue of an input range
Returns:
A `bool`
Throws:
A $(LREF ConvException) if the range does not represent a `bool`.
Note:
All character input range conversions using $(LREF to) are forwarded
to `parse` and do not require lvalues.
*/
Target parse(Target, Source)(ref Source s)
if (isInputRange!Source &&
isSomeChar!(ElementType!Source) &&
is(Unqual!Target == bool))
{
import std.ascii : toLower;
if (!s.empty)
{
auto c1 = toLower(s.front);
bool result = (c1 == 't');
if (result || c1 == 'f')
{
s.popFront();
foreach (c; result ? "rue" : "alse")
{
if (s.empty || toLower(s.front) != c)
goto Lerr;
s.popFront();
}
return result;
}
}
Lerr:
throw parseError("bool should be case-insensitive 'true' or 'false'");
}
///
@safe unittest
{
auto s = "true";
bool b = parse!bool(s);
assert(b);
}
@safe unittest
{
import std.exception;
import std.algorithm.comparison : equal;
struct InputString
{
string _s;
@property auto front() { return _s.front; }
@property bool empty() { return _s.empty; }
void popFront() { _s.popFront(); }
}
auto s = InputString("trueFALSETrueFalsetRUEfALSE");
assert(parse!bool(s) == true);
assert(s.equal("FALSETrueFalsetRUEfALSE"));
assert(parse!bool(s) == false);
assert(s.equal("TrueFalsetRUEfALSE"));
assert(parse!bool(s) == true);
assert(s.equal("FalsetRUEfALSE"));
assert(parse!bool(s) == false);
assert(s.equal("tRUEfALSE"));
assert(parse!bool(s) == true);
assert(s.equal("fALSE"));
assert(parse!bool(s) == false);
assert(s.empty);
foreach (ss; ["tfalse", "ftrue", "t", "f", "tru", "fals", ""])
{
s = InputString(ss);
assertThrown!ConvException(parse!bool(s));
}
}
/**
Parses a character input range to an integral value.
Params:
Target = the integral type to convert to
s = the lvalue of an input range
Returns:
A number of type `Target`
Throws:
A $(LREF ConvException) If an overflow occurred during conversion or
if no character of the input was meaningfully converted.
*/
Target parse(Target, Source)(ref Source s)
if (isSomeChar!(ElementType!Source) &&
isIntegral!Target && !is(Target == enum))
{
static if (Target.sizeof < int.sizeof)
{
// smaller types are handled like integers
auto v = .parse!(Select!(Target.min < 0, int, uint))(s);
auto result = ()@trusted{ return cast(Target) v; }();
if (result == v)
return result;
throw new ConvOverflowException("Overflow in integral conversion");
}
else
{
// int or larger types
static if (Target.min < 0)
bool sign = 0;
else
enum bool sign = 0;
enum char maxLastDigit = Target.min < 0 ? 7 : 5;
Unqual!(typeof(s.front)) c;
if (s.empty)
goto Lerr;
c = s.front;
static if (Target.min < 0)
{
switch (c)
{
case '-':
sign = true;
goto case '+';
case '+':
s.popFront();
if (s.empty)
goto Lerr;
c = s.front;
break;
default:
break;
}
}
c -= '0';
if (c <= 9)
{
Target v = cast(Target)c;
s.popFront();
while (!s.empty)
{
c = cast(typeof(c)) (s.front - '0');
if (c > 9)
break;
if (v >= 0 && (v < Target.max/10 ||
(v == Target.max/10 && c <= maxLastDigit + sign)))
{
// Note: `v` can become negative here in case of parsing
// the most negative value:
v = cast(Target) (v * 10 + c);
s.popFront();
}
else
throw new ConvOverflowException("Overflow in integral conversion");
}
if (sign)
v = -v;
return v;
}
Lerr:
throw convError!(Source, Target)(s);
}
}
///
@safe pure unittest
{
string s = "123";
auto a = parse!int(s);
assert(a == 123);
// parse only accepts lvalues
static assert(!__traits(compiles, parse!int("123")));
}
///
@safe pure unittest
{
import std.string : munch;
string test = "123 \t 76.14";
auto a = parse!uint(test);
assert(a == 123);
assert(test == " \t 76.14"); // parse bumps string
munch(test, " \t\n\r"); // skip ws
assert(test == "76.14");
auto b = parse!double(test);
assert(b == 76.14);
assert(test == "");
}
@safe pure unittest
{
foreach (Int; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
{
assert(to!Int("0") == 0);
static if (isSigned!Int)
{
assert(to!Int("+0") == 0);
assert(to!Int("-0") == 0);
}
}
static if (Int.sizeof >= byte.sizeof)
{
assert(to!Int("6") == 6);
assert(to!Int("23") == 23);
assert(to!Int("68") == 68);
assert(to!Int("127") == 0x7F);
static if (isUnsigned!Int)
{
assert(to!Int("255") == 0xFF);
}
static if (isSigned!Int)
{
assert(to!Int("+6") == 6);
assert(to!Int("+23") == 23);
assert(to!Int("+68") == 68);
assert(to!Int("+127") == 0x7F);
assert(to!Int("-6") == -6);
assert(to!Int("-23") == -23);
assert(to!Int("-68") == -68);
assert(to!Int("-128") == -128);
}
}
static if (Int.sizeof >= short.sizeof)
{
assert(to!Int("468") == 468);
assert(to!Int("32767") == 0x7FFF);
static if (isUnsigned!Int)
{
assert(to!Int("65535") == 0xFFFF);
}
static if (isSigned!Int)
{
assert(to!Int("+468") == 468);
assert(to!Int("+32767") == 0x7FFF);
assert(to!Int("-468") == -468);
assert(to!Int("-32768") == -32768);
}
}
static if (Int.sizeof >= int.sizeof)
{
assert(to!Int("2147483647") == 0x7FFFFFFF);
static if (isUnsigned!Int)
{
assert(to!Int("4294967295") == 0xFFFFFFFF);
}
static if (isSigned!Int)
{
assert(to!Int("+2147483647") == 0x7FFFFFFF);
assert(to!Int("-2147483648") == -2147483648);
}
}
static if (Int.sizeof >= long.sizeof)
{
assert(to!Int("9223372036854775807") == 0x7FFFFFFFFFFFFFFF);
static if (isUnsigned!Int)
{
assert(to!Int("18446744073709551615") == 0xFFFFFFFFFFFFFFFF);
}
static if (isSigned!Int)
{
assert(to!Int("+9223372036854775807") == 0x7FFFFFFFFFFFFFFF);
assert(to!Int("-9223372036854775808") == 0x8000000000000000);
}
}
}
}
@safe pure unittest
{
import std.exception;
// parsing error check
foreach (Int; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
{
immutable string[] errors1 =
[
"",
"-",
"+",
"-+",
" ",
" 0",
"0 ",
"- 0",
"1-",
"xx",
"123h",
"-+1",
"--1",
"+-1",
"++1",
];
foreach (j, s; errors1)
assertThrown!ConvException(to!Int(s));
}
// parse!SomeUnsigned cannot parse head sign.
static if (isUnsigned!Int)
{
immutable string[] errors2 =
[
"+5",
"-78",
];
foreach (j, s; errors2)
assertThrown!ConvException(to!Int(s));
}
}
// positive overflow check
foreach (i, Int; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong))
{
immutable string[] errors =
[
"128", // > byte.max
"256", // > ubyte.max
"32768", // > short.max
"65536", // > ushort.max
"2147483648", // > int.max
"4294967296", // > uint.max
"9223372036854775808", // > long.max
"18446744073709551616", // > ulong.max
];
foreach (j, s; errors[i..$])
assertThrown!ConvOverflowException(to!Int(s));
}
// negative overflow check
foreach (i, Int; AliasSeq!(byte, short, int, long))
{
immutable string[] errors =
[
"-129", // < byte.min
"-32769", // < short.min
"-2147483649", // < int.min
"-9223372036854775809", // < long.min
];
foreach (j, s; errors[i..$])
assertThrown!ConvOverflowException(to!Int(s));
}
}
@safe pure unittest
{
void checkErrMsg(string input, dchar charInMsg, dchar charNotInMsg)
{
try
{
int x = input.to!int();
assert(false, "Invalid conversion did not throw");
}
catch (ConvException e)
{
// Ensure error message contains failing character, not the character
// beyond.
import std.algorithm.searching : canFind;
assert( e.msg.canFind(charInMsg) &&
!e.msg.canFind(charNotInMsg));
}
catch (Exception e)
{
assert(false, "Did not throw ConvException");
}
}
checkErrMsg("@$", '@', '$');
checkErrMsg("@$123", '@', '$');
checkErrMsg("1@$23", '@', '$');
checkErrMsg("1@$", '@', '$');
checkErrMsg("1@$2", '@', '$');
checkErrMsg("12@$", '@', '$');
}
@safe pure unittest
{
import std.exception;
assertCTFEable!({ string s = "1234abc"; assert(parse! int(s) == 1234 && s == "abc"); });
assertCTFEable!({ string s = "-1234abc"; assert(parse! int(s) == -1234 && s == "abc"); });
assertCTFEable!({ string s = "1234abc"; assert(parse!uint(s) == 1234 && s == "abc"); });
}
// Issue 13931
@safe pure unittest
{
import std.exception;
assertThrown!ConvOverflowException("-21474836480".to!int());
assertThrown!ConvOverflowException("-92233720368547758080".to!long());
}
// Issue 14396
@safe pure unittest
{
struct StrInputRange
{
this (string s) { str = s; }
char front() const @property { return str[front_index]; }
char popFront() { return str[front_index++]; }
bool empty() const @property { return str.length <= front_index; }
string str;
size_t front_index = 0;
}
auto input = StrInputRange("777");
assert(parse!int(input) == 777);
}
/// ditto
Target parse(Target, Source)(ref Source s, uint radix)
if (isSomeChar!(ElementType!Source) &&
isIntegral!Target && !is(Target == enum))
in
{
assert(radix >= 2 && radix <= 36);
}
body
{
import core.checkedint : mulu, addu;
if (radix == 10)
return parse!Target(s);
immutable uint beyond = (radix < 10 ? '0' : 'a'-10) + radix;
Target v = 0;
bool atStart = true;
for (; !s.empty; s.popFront())
{
uint c = s.front;
if (c < '0')
break;
if (radix < 10)
{
if (c >= beyond)
break;
}
else
{
if (c > '9')
{
c |= 0x20;//poorman's tolower
if (c < 'a' || c >= beyond)
break;
c -= 'a'-10-'0';
}
}
bool overflow = false;
auto nextv = v.mulu(radix, overflow).addu(c - '0', overflow);
if (overflow || nextv > Target.max)
goto Loverflow;
v = cast(Target) nextv;
atStart = false;
}
if (atStart)
goto Lerr;
return v;
Loverflow:
throw new ConvOverflowException("Overflow in integral conversion");
Lerr:
throw convError!(Source, Target)(s, radix);
}
@safe pure unittest
{
string s; // parse doesn't accept rvalues
foreach (i; 2..37)
{
assert(parse!int(s = "0", i) == 0);
assert(parse!int(s = "1", i) == 1);
assert(parse!byte(s = "10", i) == i);
}
assert(parse!int(s = "0011001101101", 2) == 0b0011001101101);
assert(parse!int(s = "765", 8) == octal!765);
assert(parse!int(s = "fCDe", 16) == 0xfcde);
// 6609
assert(parse!int(s = "-42", 10) == -42);
}
@safe pure unittest // bugzilla 7302
{
import std.range : cycle;
auto r = cycle("2A!");
auto u = parse!uint(r, 16);
assert(u == 42);
assert(r.front == '!');
}
@safe pure unittest // bugzilla 13163
{
import std.exception;
foreach (s; ["fff", "123"])
assertThrown!ConvOverflowException(s.parse!ubyte(16));
}
Target parse(Target, Source)(ref Source s)
if (isExactSomeString!Source &&
is(Target == enum))
{
import std.algorithm.searching : startsWith;
Target result;
size_t longest_match = 0;
foreach (i, e; EnumMembers!Target)
{
auto ident = __traits(allMembers, Target)[i];
if (longest_match < ident.length && s.startsWith(ident))
{
result = e;
longest_match = ident.length ;
}
}
if (longest_match > 0)
{
s = s[longest_match .. $];
return result ;
}
throw new ConvException(
Target.stringof ~ " does not have a member named '"
~ to!string(s) ~ "'");
}
@safe unittest
{
import std.exception;
enum EB : bool { a = true, b = false, c = a }
enum EU { a, b, c }
enum EI { a = -1, b = 0, c = 1 }
enum EF : real { a = 1.414, b = 1.732, c = 2.236 }
enum EC : char { a = 'a', b = 'b', c = 'c' }
enum ES : string { a = "aaa", b = "bbb", c = "ccc" }
foreach (E; AliasSeq!(EB, EU, EI, EF, EC, ES))
{
assert(to!E("a"c) == E.a);
assert(to!E("b"w) == E.b);
assert(to!E("c"d) == E.c);
assertThrown!ConvException(to!E("d"));
}
}
@safe pure unittest // bugzilla 4744
{
enum A { member1, member11, member111 }
assert(to!A("member1" ) == A.member1 );
assert(to!A("member11" ) == A.member11 );
assert(to!A("member111") == A.member111);
auto s = "member1111";
assert(parse!A(s) == A.member111 && s == "1");
}
Target parse(Target, Source)(ref Source p)
if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) &&
isFloatingPoint!Target && !is(Target == enum))
{
import std.ascii : isDigit, isAlpha, toLower, toUpper, isHexDigit;
import std.exception : enforce;
import core.stdc.math : HUGE_VAL;
static immutable real[14] negtab =
[ 1e-4096L,1e-2048L,1e-1024L,1e-512L,1e-256L,1e-128L,1e-64L,1e-32L,
1e-16L,1e-8L,1e-4L,1e-2L,1e-1L,1.0L ];
static immutable real[13] postab =
[ 1e+4096L,1e+2048L,1e+1024L,1e+512L,1e+256L,1e+128L,1e+64L,1e+32L,
1e+16L,1e+8L,1e+4L,1e+2L,1e+1L ];
ConvException bailOut()(string msg = null, string fn = __FILE__, size_t ln = __LINE__)
{
if (msg == null)
msg = "Floating point conversion error";
return new ConvException(text(msg, " for input \"", p, "\"."), fn, ln);
}
enforce(!p.empty, bailOut());
char sign = 0; /* indicating + */
switch (p.front)
{
case '-':
sign++;
p.popFront();
enforce(!p.empty, bailOut());
if (toLower(p.front) == 'i')
goto case 'i';
enforce(!p.empty, bailOut());
break;
case '+':
p.popFront();
enforce(!p.empty, bailOut());
break;
case 'i': case 'I':
p.popFront();
enforce(!p.empty, bailOut());
if (toLower(p.front) == 'n')
{
p.popFront();
enforce(!p.empty, bailOut());
if (toLower(p.front) == 'f')
{
// 'inf'
p.popFront();
return sign ? -Target.infinity : Target.infinity;
}
}
goto default;
default: {}
}
bool isHex = false;
bool startsWithZero = p.front == '0';
if (startsWithZero)
{
p.popFront();
if (p.empty)
{
return (sign) ? -0.0 : 0.0;
}
isHex = p.front == 'x' || p.front == 'X';
}
real ldval = 0.0;
char dot = 0; /* if decimal point has been seen */
int exp = 0;
long msdec = 0, lsdec = 0;
ulong msscale = 1;
if (isHex)
{
int guard = 0;
int anydigits = 0;
uint ndigits = 0;
p.popFront();
while (!p.empty)
{
int i = p.front;
while (isHexDigit(i))
{
anydigits = 1;
i = isAlpha(i) ? ((i & ~0x20) - ('A' - 10)) : i - '0';
if (ndigits < 16)
{
msdec = msdec * 16 + i;
if (msdec)
ndigits++;
}
else if (ndigits == 16)
{
while (msdec >= 0)
{
exp--;
msdec <<= 1;
i <<= 1;
if (i & 0x10)
msdec |= 1;
}
guard = i << 4;
ndigits++;
exp += 4;
}
else
{
guard |= i;
exp += 4;
}
exp -= dot;
p.popFront();
if (p.empty)
break;
i = p.front;
if (i == '_')
{
p.popFront();
if (p.empty)
break;
i = p.front;
}
}
if (i == '.' && !dot)
{
p.popFront();
dot = 4;
}
else
break;
}
// Round up if (guard && (sticky || odd))
if (guard & 0x80 && (guard & 0x7F || msdec & 1))
{
msdec++;
if (msdec == 0) // overflow
{
msdec = 0x8000000000000000L;
exp++;
}
}
enforce(anydigits, bailOut());
enforce(!p.empty && (p.front == 'p' || p.front == 'P'),
bailOut("Floating point parsing: exponent is required"));
char sexp;
int e;
sexp = 0;
p.popFront();
if (!p.empty)
{
switch (p.front)
{
case '-': sexp++;
goto case;
case '+': p.popFront(); enforce(!p.empty,
new ConvException("Error converting input"~
" to floating point"));
break;
default: {}
}
}
ndigits = 0;
e = 0;
while (!p.empty && isDigit(p.front))
{
if (e < 0x7FFFFFFF / 10 - 10) // prevent integer overflow
{
e = e * 10 + p.front - '0';
}
p.popFront();
ndigits = 1;
}
exp += (sexp) ? -e : e;
enforce(ndigits, new ConvException("Error converting input"~
" to floating point"));
static if (real.mant_dig == 64)
{
if (msdec)
{
int e2 = 0x3FFF + 63;
// left justify mantissa
while (msdec >= 0)
{
msdec <<= 1;
e2--;
}
// Stuff mantissa directly into real
()@trusted{ *cast(long*)&ldval = msdec; }();
()@trusted{ (cast(ushort*)&ldval)[4] = cast(ushort) e2; }();
import std.math : ldexp;
// Exponent is power of 2, not power of 10
ldval = ldexp(ldval,exp);
}
}
else static if (real.mant_dig == 53)
{
if (msdec)
{
//Exponent bias + 52:
//After shifting 52 times left, exp must be 1
int e2 = 0x3FF + 52;
// right justify mantissa
// first 11 bits must be zero, rest is implied bit + mantissa
// shift one time less, do rounding, shift again
while ((msdec & 0xFFC0_0000_0000_0000) != 0)
{
msdec = ((cast(ulong)msdec) >> 1);
e2++;
}
//Have to shift one more time
//and do rounding
if ((msdec & 0xFFE0_0000_0000_0000) != 0)
{
auto roundUp = (msdec & 0x1);
msdec = ((cast(ulong)msdec) >> 1);
e2++;
if (roundUp)
{
msdec += 1;
//If mantissa was 0b1111... and we added +1
//the mantissa should be 0b10000 (think of implicit bit)
//and the exponent increased
if ((msdec & 0x0020_0000_0000_0000) != 0)
{
msdec = 0x0010_0000_0000_0000;
e2++;
}
}
}
// left justify mantissa
// bit 11 must be 1
while ((msdec & 0x0010_0000_0000_0000) == 0)
{
msdec <<= 1;
e2--;
}
// Stuff mantissa directly into double
// (first including implicit bit)
()@trusted{ *cast(long *)&ldval = msdec; }();
//Store exponent, now overwriting implicit bit
()@trusted{ *cast(long *)&ldval &= 0x000F_FFFF_FFFF_FFFF; }();
()@trusted{ *cast(long *)&ldval |= ((e2 & 0xFFFUL) << 52); }();
import std.math : ldexp;
// Exponent is power of 2, not power of 10
ldval = ldexp(ldval,exp);
}
}
else
static assert(false, "Floating point format of real type not supported");
goto L6;
}
else // not hex
{
if (toUpper(p.front) == 'N' && !startsWithZero)
{
// nan
p.popFront();
enforce(!p.empty && toUpper(p.front) == 'A',
new ConvException("error converting input to floating point"));
p.popFront();
enforce(!p.empty && toUpper(p.front) == 'N',
new ConvException("error converting input to floating point"));
// skip past the last 'n'
p.popFront();
return typeof(return).nan;
}
bool sawDigits = startsWithZero;
while (!p.empty)
{
int i = p.front;
while (isDigit(i))
{
sawDigits = true; /* must have at least 1 digit */
if (msdec < (0x7FFFFFFFFFFFL-10)/10)
msdec = msdec * 10 + (i - '0');
else if (msscale < (0xFFFFFFFF-10)/10)
{
lsdec = lsdec * 10 + (i - '0');
msscale *= 10;
}
else
{
exp++;
}
exp -= dot;
p.popFront();
if (p.empty)
break;
i = p.front;
if (i == '_')
{
p.popFront();
if (p.empty)
break;
i = p.front;
}
}
if (i == '.' && !dot)
{
p.popFront();
dot++;
}
else
{
break;
}
}
enforce(sawDigits, new ConvException("no digits seen"));
}
if (!p.empty && (p.front == 'e' || p.front == 'E'))
{
char sexp;
int e;
sexp = 0;
p.popFront();
enforce(!p.empty, new ConvException("Unexpected end of input"));
switch (p.front)
{
case '-': sexp++;
goto case;
case '+': p.popFront();
break;
default: {}
}
bool sawDigits = 0;
e = 0;
while (!p.empty && isDigit(p.front))
{
if (e < 0x7FFFFFFF / 10 - 10) // prevent integer overflow
{
e = e * 10 + p.front - '0';
}
p.popFront();
sawDigits = 1;
}
exp += (sexp) ? -e : e;
enforce(sawDigits, new ConvException("No digits seen."));
}
ldval = msdec;
if (msscale != 1) /* if stuff was accumulated in lsdec */
ldval = ldval * msscale + lsdec;
if (ldval)
{
uint u = 0;
int pow = 4096;
while (exp > 0)
{
while (exp >= pow)
{
ldval *= postab[u];
exp -= pow;
}
pow >>= 1;
u++;
}
while (exp < 0)
{
while (exp <= -pow)
{
ldval *= negtab[u];
enforce(ldval != 0, new ConvException("Range error"));
exp += pow;
}
pow >>= 1;
u++;
}
}
L6: // if overflow occurred
enforce(ldval != HUGE_VAL, new ConvException("Range error"));
L1:
return (sign) ? -ldval : ldval;
}
@safe unittest
{
import std.exception;
import std.math : isNaN, fabs;
// Compare reals with given precision
bool feq(in real rx, in real ry, in real precision = 0.000001L)
{
if (rx == ry)
return 1;
if (isNaN(rx))
return cast(bool)isNaN(ry);
if (isNaN(ry))
return 0;
return cast(bool)(fabs(rx - ry) <= precision);
}
// Make given typed literal
F Literal(F)(F f)
{
return f;
}
foreach (Float; AliasSeq!(float, double, real))
{
assert(to!Float("123") == Literal!Float(123));
assert(to!Float("+123") == Literal!Float(+123));
assert(to!Float("-123") == Literal!Float(-123));
assert(to!Float("123e2") == Literal!Float(123e2));
assert(to!Float("123e+2") == Literal!Float(123e+2));
assert(to!Float("123e-2") == Literal!Float(123e-2));
assert(to!Float("123.") == Literal!Float(123.0));
assert(to!Float(".375") == Literal!Float(.375));
assert(to!Float("1.23375E+2") == Literal!Float(1.23375E+2));
assert(to!Float("0") is 0.0);
assert(to!Float("-0") is -0.0);
assert(isNaN(to!Float("nan")));
assertThrown!ConvException(to!Float("\x00"));
}
// min and max
float f = to!float("1.17549e-38");
assert(feq(cast(real)f, cast(real)1.17549e-38));
assert(feq(cast(real)f, cast(real)float.min_normal));
f = to!float("3.40282e+38");
assert(to!string(f) == to!string(3.40282e+38));
// min and max
double d = to!double("2.22508e-308");
assert(feq(cast(real)d, cast(real)2.22508e-308));
assert(feq(cast(real)d, cast(real)double.min_normal));
d = to!double("1.79769e+308");
assert(to!string(d) == to!string(1.79769e+308));
assert(to!string(d) == to!string(double.max));
assert(to!string(to!real(to!string(real.max / 2L))) == to!string(real.max / 2L));
// min and max
real r = to!real(to!string(real.min_normal));
version(NetBSD)
{
// NetBSD notice
// to!string returns 3.3621e-4932L. It is less than real.min_normal and it is subnormal value
// Simple C code
// long double rd = 3.3621e-4932L;
// printf("%Le\n", rd);
// has unexpected result: 1.681050e-4932
//
// Bug report: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50937
}
else
{
assert(to!string(r) == to!string(real.min_normal));
}
r = to!real(to!string(real.max));
assert(to!string(r) == to!string(real.max));
}
//Tests for the double implementation
@safe unittest
{
static if (real.mant_dig == 53)
{
import core.stdc.stdlib, std.exception, std.math;
//Should be parsed exactly: 53 bit mantissa
string s = "0x1A_BCDE_F012_3456p10";
auto x = parse!real(s);
assert(x == 0x1A_BCDE_F012_3456p10L);
//1 bit is implicit
assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0xA_BCDE_F012_3456);
assert(strtod("0x1ABCDEF0123456p10", null) == x);
//Should be parsed exactly: 10 bit mantissa
s = "0x3FFp10";
x = parse!real(s);
assert(x == 0x03FFp10);
//1 bit is implicit
assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_F800_0000_0000);
assert(strtod("0x3FFp10", null) == x);
//60 bit mantissa, round up
s = "0xFFF_FFFF_FFFF_FFFFp10";
x = parse!real(s);
assert(approxEqual(x, 0xFFF_FFFF_FFFF_FFFFp10));
//1 bit is implicit
assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x0000_0000_0000_0000);
assert(strtod("0xFFFFFFFFFFFFFFFp10", null) == x);
//60 bit mantissa, round down
s = "0xFFF_FFFF_FFFF_FF90p10";
x = parse!real(s);
assert(approxEqual(x, 0xFFF_FFFF_FFFF_FF90p10));
//1 bit is implicit
assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_FFFF_FFFF_FFFF);
assert(strtod("0xFFFFFFFFFFFFF90p10", null) == x);
//61 bit mantissa, round up 2
s = "0x1F0F_FFFF_FFFF_FFFFp10";
x = parse!real(s);
assert(approxEqual(x, 0x1F0F_FFFF_FFFF_FFFFp10));
//1 bit is implicit
assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_1000_0000_0000);
assert(strtod("0x1F0FFFFFFFFFFFFFp10", null) == x);
//61 bit mantissa, round down 2
s = "0x1F0F_FFFF_FFFF_FF10p10";
x = parse!real(s);
assert(approxEqual(x, 0x1F0F_FFFF_FFFF_FF10p10));
//1 bit is implicit
assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_0FFF_FFFF_FFFF);
assert(strtod("0x1F0FFFFFFFFFFF10p10", null) == x);
//Huge exponent
s = "0x1F_FFFF_FFFF_FFFFp900";
x = parse!real(s);
assert(strtod("0x1FFFFFFFFFFFFFp900", null) == x);
//exponent too big -> converror
s = "";
assertThrown!ConvException(x = parse!real(s));
assert(strtod("0x1FFFFFFFFFFFFFp1024", null) == real.infinity);
//-exponent too big -> 0
s = "0x1FFFFFFFFFFFFFp-2000";
x = parse!real(s);
assert(x == 0);
assert(strtod("0x1FFFFFFFFFFFFFp-2000", null) == x);
}
}
@system unittest
{
import core.stdc.errno;
import core.stdc.stdlib;
errno = 0; // In case it was set by another unittest in a different module.
struct longdouble
{
static if (real.mant_dig == 64)
{
ushort[5] value;
}
else static if (real.mant_dig == 53)
{
ushort[4] value;
}
else
static assert(false, "Not implemented");
}
real ld;
longdouble x;
real ld1;
longdouble x1;
int i;
static if (real.mant_dig == 64)
enum s = "0x1.FFFFFFFFFFFFFFFEp-16382";
else static if (real.mant_dig == 53)
enum s = "0x1.FFFFFFFFFFFFFFFEp-1000";
else
static assert(false, "Floating point format for real not supported");
auto s2 = s.idup;
ld = parse!real(s2);
assert(s2.empty);
x = *cast(longdouble *)&ld;
static if (real.mant_dig == 64)
{
version (CRuntime_Microsoft)
ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod
else version (CRuntime_Bionic)
ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod
else
ld1 = strtold(s.ptr, null);
}
else
ld1 = strtold(s.ptr, null);
x1 = *cast(longdouble *)&ld1;
assert(x1 == x && ld1 == ld);
assert(!errno);
s2 = "1.0e5";
ld = parse!real(s2);
assert(s2.empty);
x = *cast(longdouble *)&ld;
ld1 = strtold("1.0e5", null);
x1 = *cast(longdouble *)&ld1;
}
@safe pure unittest
{
import std.exception;
// Bugzilla 4959
{
auto s = "0 ";
auto x = parse!double(s);
assert(s == " ");
assert(x == 0.0);
}
// Bugzilla 3369
assert(to!float("inf") == float.infinity);
assert(to!float("-inf") == -float.infinity);
// Bugzilla 6160
assert(6_5.536e3L == to!real("6_5.536e3")); // 2^16
assert(0x1000_000_000_p10 == to!real("0x1000_000_000_p10")); // 7.03687e+13
// Bugzilla 6258
assertThrown!ConvException(to!real("-"));
assertThrown!ConvException(to!real("in"));
// Bugzilla 7055
assertThrown!ConvException(to!float("INF2"));
//extra stress testing
auto ssOK = ["1.", "1.1.1", "1.e5", "2e1e", "2a", "2e1_1",
"inf", "-inf", "infa", "-infa", "inf2e2", "-inf2e2"];
auto ssKO = ["", " ", "2e", "2e+", "2e-", "2ee", "2e++1", "2e--1", "2e_1", "+inf"];
foreach (s; ssOK)
parse!double(s);
foreach (s; ssKO)
assertThrown!ConvException(parse!double(s));
}
/**
Parsing one character off a range returns the first element and calls `popFront`.
Params:
Target = the type to convert to
s = the lvalue of an input range
Returns:
A character of type `Target`
Throws:
A $(LREF ConvException) if the range is empty.
*/
Target parse(Target, Source)(ref Source s)
if (isSomeString!Source && !is(Source == enum) &&
staticIndexOf!(Unqual!Target, dchar, Unqual!(ElementEncodingType!Source)) >= 0)
{
if (s.empty)
throw convError!(Source, Target)(s);
static if (is(Unqual!Target == dchar))
{
Target result = s.front;
s.popFront();
return result;
}
else
{
// Special case: okay so parse a Char off a Char[]
Target result = s[0];
s = s[1 .. $];
return result;
}
}
@safe pure unittest
{
foreach (Str; AliasSeq!(string, wstring, dstring))
{
foreach (Char; AliasSeq!(char, wchar, dchar))
{
static if (is(Unqual!Char == dchar) ||
Char.sizeof == ElementEncodingType!Str.sizeof)
{
Str s = "aaa";
assert(parse!Char(s) == 'a');
assert(s == "aa");
}
}
}
}
/// ditto
Target parse(Target, Source)(ref Source s)
if (!isSomeString!Source && isInputRange!Source && isSomeChar!(ElementType!Source) &&
isSomeChar!Target && Target.sizeof >= ElementType!Source.sizeof && !is(Target == enum))
{
if (s.empty)
throw convError!(Source, Target)(s);
Target result = s.front;
s.popFront();
return result;
}
///
@safe pure unittest
{
auto s = "Hello, World!";
char first = parse!char(s);
assert(first == 'H');
assert(s == "ello, World!");
}
/*
Tests for to!bool and parse!bool
*/
@safe pure unittest
{
import std.exception;
assert (to!bool("TruE") == true);
assert (to!bool("faLse"d) == false);
assertThrown!ConvException(to!bool("maybe"));
auto t = "TrueType";
assert (parse!bool(t) == true);
assert (t == "Type");
auto f = "False killer whale"d;
assert (parse!bool(f) == false);
assert (f == " killer whale"d);
auto m = "maybe";
assertThrown!ConvException(parse!bool(m));
assert (m == "maybe"); // m shouldn't change on failure
auto s = "true";
auto b = parse!(const(bool))(s);
assert(b == true);
}
// input range to null literal conversions
Target parse(Target, Source)(ref Source s)
if (isInputRange!Source &&
isSomeChar!(ElementType!Source) &&
is(Unqual!Target == typeof(null)))
{
import std.ascii : toLower;
foreach (c; "null")
{
if (s.empty || toLower(s.front) != c)
throw parseError("null should be case-insensitive 'null'");
s.popFront();
}
return null;
}
@safe pure unittest
{
import std.exception;
alias NullType = typeof(null);
auto s1 = "null";
assert(parse!NullType(s1) is null);
assert(s1 == "");
auto s2 = "NUll"d;
assert(parse!NullType(s2) is null);
assert(s2 == "");
auto m = "maybe";
assertThrown!ConvException(parse!NullType(m));
assert(m == "maybe"); // m shouldn't change on failure
auto s = "NULL";
assert(parse!(const NullType)(s) is null);
}
//Used internally by parse Array/AA, to remove ascii whites
package void skipWS(R)(ref R r)
{
import std.ascii : isWhite;
static if (isSomeString!R)
{
//Implementation inspired from stripLeft.
foreach (i, dchar c; r)
{
if (!isWhite(c))
{
r = r[i .. $];
return;
}
}
r = r[0 .. 0]; //Empty string with correct type.
return;
}
else
{
for (; !r.empty && isWhite(r.front); r.popFront())
{}
}
}
/**
* Parses an array from a string given the left bracket (default $(D
* '[')), right bracket (default $(D ']')), and element separator (by
* default $(D ',')).
*/
Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',')
if (isExactSomeString!Source &&
isDynamicArray!Target && !is(Target == enum))
{
Target result;
parseCheck!s(lbracket);
skipWS(s);
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front == rbracket)
{
s.popFront();
return result;
}
for (;; s.popFront(), skipWS(s))
{
result ~= parseElement!(ElementType!Target)(s);
skipWS(s);
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front != comma)
break;
}
parseCheck!s(rbracket);
return result;
}
@safe unittest
{
int[] a = [1, 2, 3, 4, 5];
auto s = to!string(a);
assert(to!(int[])(s) == a);
}
@safe unittest
{
int[][] a = [ [1, 2] , [3], [4, 5] ];
auto s = to!string(a);
assert(to!(int[][])(s) == a);
}
@safe unittest
{
int[][][] ia = [ [[1,2],[3,4],[5]] , [[6],[],[7,8,9]] , [[]] ];
char[] s = to!(char[])(ia);
int[][][] ia2;
ia2 = to!(typeof(ia2))(s);
assert( ia == ia2);
}
@safe pure unittest
{
auto s1 = `[['h', 'e', 'l', 'l', 'o'], "world"]`;
auto a1 = parse!(string[])(s1);
assert(a1 == ["hello", "world"]);
auto s2 = `["aaa", "bbb", "ccc"]`;
auto a2 = parse!(string[])(s2);
assert(a2 == ["aaa", "bbb", "ccc"]);
}
@safe pure unittest
{
import std.exception;
//Check proper failure
auto s = "[ 1 , 2 , 3 ]";
foreach (i ; 0..s.length-1)
{
auto ss = s[0 .. i];
assertThrown!ConvException(parse!(int[])(ss));
}
int[] arr = parse!(int[])(s);
}
@safe pure unittest
{
//Checks parsing of strings with escaped characters
string s1 = `[
"Contains a\0null!",
"tab\there",
"line\nbreak",
"backslash \\ slash / question \?",
"number \x35 five",
"unicode \u65E5 sun",
"very long \U000065E5 sun"
]`;
//Note: escaped characters purposefully replaced and isolated to guarantee
//there are no typos in the escape syntax
string[] s2 = [
"Contains a" ~ '\0' ~ "null!",
"tab" ~ '\t' ~ "here",
"line" ~ '\n' ~ "break",
"backslash " ~ '\\' ~ " slash / question ?",
"number 5 five",
"unicode 日 sun",
"very long 日 sun"
];
assert(s2 == parse!(string[])(s1));
assert(s1.empty);
}
/// ditto
Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',')
if (isExactSomeString!Source &&
isStaticArray!Target && !is(Target == enum))
{
static if (hasIndirections!Target)
Target result = Target.init[0].init;
else
Target result = void;
parseCheck!s(lbracket);
skipWS(s);
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front == rbracket)
{
static if (result.length != 0)
goto Lmanyerr;
else
{
s.popFront();
return result;
}
}
for (size_t i = 0; ; s.popFront(), skipWS(s))
{
if (i == result.length)
goto Lmanyerr;
result[i++] = parseElement!(ElementType!Target)(s);
skipWS(s);
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front != comma)
{
if (i != result.length)
goto Lfewerr;
break;
}
}
parseCheck!s(rbracket);
return result;
Lmanyerr:
throw parseError(text("Too many elements in input, ", result.length, " elements expected."));
Lfewerr:
throw parseError(text("Too few elements in input, ", result.length, " elements expected."));
}
@safe pure unittest
{
import std.exception;
auto s1 = "[1,2,3,4]";
auto sa1 = parse!(int[4])(s1);
assert(sa1 == [1,2,3,4]);
auto s2 = "[[1],[2,3],[4]]";
auto sa2 = parse!(int[][3])(s2);
assert(sa2 == [[1],[2,3],[4]]);
auto s3 = "[1,2,3]";
assertThrown!ConvException(parse!(int[4])(s3));
auto s4 = "[1,2,3,4,5]";
assertThrown!ConvException(parse!(int[4])(s4));
}
/**
* Parses an associative array from a string given the left bracket (default $(D
* '[')), right bracket (default $(D ']')), key-value separator (default $(D
* ':')), and element seprator (by default $(D ',')).
*/
Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar keyval = ':', dchar comma = ',')
if (isExactSomeString!Source &&
isAssociativeArray!Target && !is(Target == enum))
{
alias KeyType = typeof(Target.init.keys[0]);
alias ValType = typeof(Target.init.values[0]);
Target result;
parseCheck!s(lbracket);
skipWS(s);
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front == rbracket)
{
s.popFront();
return result;
}
for (;; s.popFront(), skipWS(s))
{
auto key = parseElement!KeyType(s);
skipWS(s);
parseCheck!s(keyval);
skipWS(s);
auto val = parseElement!ValType(s);
skipWS(s);
result[key] = val;
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front != comma)
break;
}
parseCheck!s(rbracket);
return result;
}
@safe pure unittest
{
auto s1 = "[1:10, 2:20, 3:30]";
auto aa1 = parse!(int[int])(s1);
assert(aa1 == [1:10, 2:20, 3:30]);
auto s2 = `["aaa":10, "bbb":20, "ccc":30]`;
auto aa2 = parse!(int[string])(s2);
assert(aa2 == ["aaa":10, "bbb":20, "ccc":30]);
auto s3 = `["aaa":[1], "bbb":[2,3], "ccc":[4,5,6]]`;
auto aa3 = parse!(int[][string])(s3);
assert(aa3 == ["aaa":[1], "bbb":[2,3], "ccc":[4,5,6]]);
}
@safe pure unittest
{
import std.exception;
//Check proper failure
auto s = "[1:10, 2:20, 3:30]";
foreach (i ; 0 .. s.length-1)
{
auto ss = s[0 .. i];
assertThrown!ConvException(parse!(int[int])(ss));
}
int[int] aa = parse!(int[int])(s);
}
private dchar parseEscape(Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source))
{
parseCheck!s('\\');
if (s.empty)
throw parseError("Unterminated escape sequence");
dchar getHexDigit()(ref Source s_ = s) // workaround
{
import std.ascii : isAlpha, isHexDigit;
if (s_.empty)
throw parseError("Unterminated escape sequence");
s_.popFront();
if (s_.empty)
throw parseError("Unterminated escape sequence");
dchar c = s_.front;
if (!isHexDigit(c))
throw parseError("Hex digit is missing");
return isAlpha(c) ? ((c & ~0x20) - ('A' - 10)) : c - '0';
}
dchar result;
switch (s.front)
{
case '"': result = '\"'; break;
case '\'': result = '\''; break;
case '0': result = '\0'; break;
case '?': result = '\?'; break;
case '\\': result = '\\'; break;
case 'a': result = '\a'; break;
case 'b': result = '\b'; break;
case 'f': result = '\f'; break;
case 'n': result = '\n'; break;
case 'r': result = '\r'; break;
case 't': result = '\t'; break;
case 'v': result = '\v'; break;
case 'x':
result = getHexDigit() << 4;
result |= getHexDigit();
break;
case 'u':
result = getHexDigit() << 12;
result |= getHexDigit() << 8;
result |= getHexDigit() << 4;
result |= getHexDigit();
break;
case 'U':
result = getHexDigit() << 28;
result |= getHexDigit() << 24;
result |= getHexDigit() << 20;
result |= getHexDigit() << 16;
result |= getHexDigit() << 12;
result |= getHexDigit() << 8;
result |= getHexDigit() << 4;
result |= getHexDigit();
break;
default:
throw parseError("Unknown escape character " ~ to!string(s.front));
}
if (s.empty)
throw parseError("Unterminated escape sequence");
s.popFront();
return result;
}
@safe pure unittest
{
string[] s1 = [
`\"`, `\'`, `\?`, `\\`, `\a`, `\b`, `\f`, `\n`, `\r`, `\t`, `\v`, //Normal escapes
//`\141`, //@@@9621@@@ Octal escapes.
`\x61`,
`\u65E5`, `\U00012456`
//`\&`, `\"`, //@@@9621@@@ Named Character Entities.
];
const(dchar)[] s2 = [
'\"', '\'', '\?', '\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v', //Normal escapes
//'\141', //@@@9621@@@ Octal escapes.
'\x61',
'\u65E5', '\U00012456'
//'\&', '\"', //@@@9621@@@ Named Character Entities.
];
foreach (i ; 0 .. s1.length)
{
assert(s2[i] == parseEscape(s1[i]));
assert(s1[i].empty);
}
}
@safe pure unittest
{
import std.exception;
string[] ss = [
`hello!`, //Not an escape
`\`, //Premature termination
`\/`, //Not an escape
`\gggg`, //Not an escape
`\xzz`, //Not an hex
`\x0`, //Premature hex end
`\XB9`, //Not legal hex syntax
`\u!!`, //Not a unicode hex
`\777`, //Octal is larger than a byte //Note: Throws, but simply because octals are unsupported
`\u123`, //Premature hex end
`\U123123` //Premature hex end
];
foreach (s ; ss)
assertThrown!ConvException(parseEscape(s));
}
// Undocumented
Target parseElement(Target, Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) &&
isExactSomeString!Target)
{
import std.array : appender;
auto result = appender!Target();
// parse array of chars
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front == '[')
return parse!Target(s);
parseCheck!s('\"');
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front == '\"')
{
s.popFront();
return result.data;
}
while (true)
{
if (s.empty)
throw parseError("Unterminated quoted string");
switch (s.front)
{
case '\"':
s.popFront();
return result.data;
case '\\':
result.put(parseEscape(s));
break;
default:
result.put(s.front);
s.popFront();
break;
}
}
assert(0);
}
// ditto
Target parseElement(Target, Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) &&
isSomeChar!Target && !is(Target == enum))
{
Target c;
parseCheck!s('\'');
if (s.empty)
throw convError!(Source, Target)(s);
if (s.front != '\\')
{
c = s.front;
s.popFront();
}
else
c = parseEscape(s);
parseCheck!s('\'');
return c;
}
// ditto
Target parseElement(Target, Source)(ref Source s)
if (isInputRange!Source && isSomeChar!(ElementType!Source) &&
!isSomeString!Target && !isSomeChar!Target)
{
return parse!Target(s);
}
/***************************************************************
* Convenience functions for converting one or more arguments
* of any type into _text (the three character widths).
*/
string text(T...)(T args) if (T.length > 0) { return textImpl!string(args); }
// @@@DEPRECATED_2017-06@@@
deprecated("Calling `text` with 0 arguments is deprecated")
string text(T...)(T args) if (T.length == 0) { return textImpl!string(args); }
///ditto
wstring wtext(T...)(T args) if (T.length > 0) { return textImpl!wstring(args); }
// @@@DEPRECATED_2017-06@@@
deprecated("Calling `wtext` with 0 arguments is deprecated")
wstring wtext(T...)(T args) if (T.length == 0) { return textImpl!wstring(args); }
///ditto
dstring dtext(T...)(T args) if (T.length > 0) { return textImpl!dstring(args); }
///
@safe unittest
{
assert( text(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"c);
assert(wtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"w);
assert(dtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"d);
}
// @@@DEPRECATED_2017-06@@@
deprecated("Calling `dtext` with 0 arguments is deprecated")
dstring dtext(T...)(T args) if (T.length == 0) { return textImpl!dstring(args); }
private S textImpl(S, U...)(U args)
{
static if (U.length == 0)
{
return null;
}
else static if (U.length == 1)
{
return to!S(args[0]);
}
else
{
import std.array : appender;
auto app = appender!S();
foreach (arg; args)
app.put(to!S(arg));
return app.data;
}
}
/***************************************************************
The $(D octal) facility provides a means to declare a number in base 8.
Using $(D octal!177) or $(D octal!"177") for 127 represented in octal
(same as 0177 in C).
The rules for strings are the usual for literals: If it can fit in an
$(D int), it is an $(D int). Otherwise, it is a $(D long). But, if the
user specifically asks for a $(D long) with the $(D L) suffix, always
give the $(D long). Give an unsigned iff it is asked for with the $(D
U) or $(D u) suffix. _Octals created from integers preserve the type
of the passed-in integral.
See_Also:
$(LREF parse) for parsing octal strings at runtime.
*/
template octal(string num)
if (isOctalLiteral(num))
{
static if ((octalFitsInInt!num && !literalIsLong!num) && !literalIsUnsigned!num)
enum octal = octal!int(num);
else static if ((!octalFitsInInt!num || literalIsLong!num) && !literalIsUnsigned!num)
enum octal = octal!long(num);
else static if ((octalFitsInInt!num && !literalIsLong!num) && literalIsUnsigned!num)
enum octal = octal!uint(num);
else static if ((!octalFitsInInt!(num) || literalIsLong!(num)) && literalIsUnsigned!(num))
enum octal = octal!ulong(num);
else
static assert(false);
}
/// Ditto
template octal(alias decimalInteger)
if (isIntegral!(typeof(decimalInteger)))
{
enum octal = octal!(typeof(decimalInteger))(to!string(decimalInteger));
}
///
@safe unittest
{
// same as 0177
auto x = octal!177;
// octal is a compile-time device
enum y = octal!160;
// Create an unsigned octal
auto z = octal!"1_000_000u";
}
/*
Takes a string, num, which is an octal literal, and returns its
value, in the type T specified.
*/
private T octal(T)(string num)
{
assert(isOctalLiteral(num));
ulong pow = 1;
T value = 0;
foreach_reverse (immutable pos; 0 .. num.length)
{
char s = num[pos];
if (s < '0' || s > '7') // we only care about digits; skip the rest
// safe to skip - this is checked out in the assert so these
// are just suffixes
continue;
value += pow * (s - '0');
pow *= 8;
}
return value;
}
///
@system unittest
{
int a = octal!int("10");
assert(a == 8);
}
/*
Take a look at int.max and int.max+1 in octal and the logic for this
function follows directly.
*/
private template octalFitsInInt(string octalNum)
{
// note it is important to strip the literal of all
// non-numbers. kill the suffix and underscores lest they mess up
// the number of digits here that we depend on.
enum bool octalFitsInInt = strippedOctalLiteral(octalNum).length < 11 ||
strippedOctalLiteral(octalNum).length == 11 &&
strippedOctalLiteral(octalNum)[0] == '1';
}
private string strippedOctalLiteral(string original)
{
string stripped = "";
foreach (c; original)
if (c >= '0' && c <= '7')
stripped ~= c;
return stripped;
}
private template literalIsLong(string num)
{
static if (num.length > 1)
// can be xxL or xxLu according to spec
enum literalIsLong = (num[$-1] == 'L' || num[$-2] == 'L');
else
enum literalIsLong = false;
}
private template literalIsUnsigned(string num)
{
static if (num.length > 1)
// can be xxU or xxUL according to spec
enum literalIsUnsigned = (num[$-1] == 'u' || num[$-2] == 'u')
// both cases are allowed too
|| (num[$-1] == 'U' || num[$-2] == 'U');
else
enum literalIsUnsigned = false;
}
/*
Returns if the given string is a correctly formatted octal literal.
The format is specified in spec/lex.html. The leading zero is allowed, but
not required.
*/
private bool isOctalLiteral(string num)
{
if (num.length == 0)
return false;
// Must start with a number. To avoid confusion, literals that
// start with a '0' are not allowed
if (num[0] == '0' && num.length > 1)
return false;
if (num[0] < '0' || num[0] > '7')
return false;
foreach (i, c; num)
{
if ((c < '0' || c > '7') && c != '_') // not a legal character
{
if (i < num.length - 2)
return false;
else // gotta check for those suffixes
{
if (c != 'U' && c != 'u' && c != 'L')
return false;
if (i != num.length - 1)
{
// if we're not the last one, the next one must
// also be a suffix to be valid
char c2 = num[$-1];
if (c2 != 'U' && c2 != 'u' && c2 != 'L')
return false; // spam at the end of the string
if (c2 == c)
return false; // repeats are disallowed
}
}
}
}
return true;
}
@safe unittest
{
// ensure that you get the right types, even with embedded underscores
auto w = octal!"100_000_000_000";
static assert(!is(typeof(w) == int));
auto w2 = octal!"1_000_000_000";
static assert(is(typeof(w2) == int));
static assert(octal!"45" == 37);
static assert(octal!"0" == 0);
static assert(octal!"7" == 7);
static assert(octal!"10" == 8);
static assert(octal!"666" == 438);
static assert(octal!45 == 37);
static assert(octal!0 == 0);
static assert(octal!7 == 7);
static assert(octal!10 == 8);
static assert(octal!666 == 438);
static assert(octal!"66_6" == 438);
static assert(octal!2520046213 == 356535435);
static assert(octal!"2520046213" == 356535435);
static assert(octal!17777777777 == int.max);
static assert(!__traits(compiles, octal!823));
static assert(!__traits(compiles, octal!"823"));
static assert(!__traits(compiles, octal!"_823"));
static assert(!__traits(compiles, octal!"spam"));
static assert(!__traits(compiles, octal!"77%"));
static assert(is(typeof(octal!"17777777777") == int));
static assert(octal!"17777777777" == int.max);
static assert(is(typeof(octal!"20000000000U") == ulong)); // Shouldn't this be uint?
static assert(octal!"20000000000" == uint(int.max) + 1);
static assert(is(typeof(octal!"777777777777777777777") == long));
static assert(octal!"777777777777777777777" == long.max);
static assert(is(typeof(octal!"1000000000000000000000U") == ulong));
static assert(octal!"1000000000000000000000" == ulong(long.max) + 1);
int a;
long b;
// biggest value that should fit in an it
a = octal!"17777777777";
assert(a == int.max);
// should not fit in the int
static assert(!__traits(compiles, a = octal!"20000000000"));
// ... but should fit in a long
b = octal!"20000000000";
assert(b == 1L + int.max);
b = octal!"1L";
assert(b == 1);
b = octal!1L;
assert(b == 1);
}
/+
emplaceRef is a package function for phobos internal use. It works like
emplace, but takes its argument by ref (as opposed to "by pointer").
This makes it easier to use, easier to be safe, and faster in a non-inline
build.
Furthermore, emplaceRef optionally takes a type paremeter, which specifies
the type we want to build. This helps to build qualified objects on mutable
buffer, without breaking the type system with unsafe casts.
+/
package void emplaceRef(T, UT, Args...)(ref UT chunk, auto ref Args args)
{
static if (args.length == 0)
{
static assert (is(typeof({static T i;})),
convFormat("Cannot emplace a %1$s because %1$s.this() is annotated with @disable.", T.stringof));
static if (is(T == class)) static assert (!isAbstractClass!T,
T.stringof ~ " is abstract and it can't be emplaced");
emplaceInitializer(chunk);
}
else static if (
!is(T == struct) && Args.length == 1 /* primitives, enums, arrays */
||
Args.length == 1 && is(typeof({T t = args[0];})) /* conversions */
||
is(typeof(T(args))) /* general constructors */)
{
static struct S
{
T payload;
this(ref Args x)
{
static if (Args.length == 1)
static if (is(typeof(payload = x[0])))
payload = x[0];
else
payload = T(x[0]);
else
payload = T(x);
}
}
if (__ctfe)
{
static if (is(typeof(chunk = T(args))))
chunk = T(args);
else static if (args.length == 1 && is(typeof(chunk = args[0])))
chunk = args[0];
else assert(0, "CTFE emplace doesn't support "
~ T.stringof ~ " from " ~ Args.stringof);
}
else
{
S* p = () @trusted { return cast(S*) &chunk; }();
emplaceInitializer(*p);
p.__ctor(args);
}
}
else static if (is(typeof(chunk.__ctor(args))))
{
// This catches the rare case of local types that keep a frame pointer
emplaceInitializer(chunk);
chunk.__ctor(args);
}
else
{
//We can't emplace. Try to diagnose a disabled postblit.
static assert(!(Args.length == 1 && is(Args[0] : T)),
convFormat("Cannot emplace a %1$s because %1$s.this(this) is annotated with @disable.", T.stringof));
//We can't emplace.
static assert(false,
convFormat("%s cannot be emplaced from %s.", T.stringof, Args[].stringof));
}
}
// ditto
package void emplaceRef(UT, Args...)(ref UT chunk, auto ref Args args)
if (is(UT == Unqual!UT))
{
emplaceRef!(UT, UT)(chunk, args);
}
//emplace helper functions
private void emplaceInitializer(T)(ref T chunk) @trusted pure nothrow
{
static if (!hasElaborateAssign!T && isAssignable!T)
chunk = T.init;
else
{
import core.stdc.string : memcpy;
static immutable T init = T.init;
memcpy(&chunk, &init, T.sizeof);
}
}
// emplace
/**
Given a pointer $(D chunk) to uninitialized memory (but already typed
as $(D T)), constructs an object of non-$(D class) type $(D T) at that
address. If `T` is a class, initializes the class reference to null.
Returns: A pointer to the newly constructed object (which is the same
as $(D chunk)).
*/
T* emplace(T)(T* chunk) @safe pure nothrow
{
emplaceRef!T(*chunk);
return chunk;
}
///
@system unittest
{
static struct S
{
int i = 42;
}
S[2] s2 = void;
emplace(&s2);
assert(s2[0].i == 42 && s2[1].i == 42);
}
///
@system unittest
{
interface I {}
class K : I {}
K k = void;
emplace(&k);
assert(k is null);
I i = void;
emplace(&i);
assert(i is null);
}
/**
Given a pointer $(D chunk) to uninitialized memory (but already typed
as a non-class type $(D T)), constructs an object of type $(D T) at
that address from arguments $(D args). If `T` is a class, initializes
the class reference to `args[0]`.
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: A pointer to the newly constructed object (which is the same
as $(D chunk)).
*/
T* emplace(T, Args...)(T* chunk, auto ref Args args)
if (is(T == struct) || Args.length == 1)
{
emplaceRef!T(*chunk, args);
return chunk;
}
///
@system unittest
{
int a;
int b = 42;
assert(*emplace!int(&a, b) == 42);
}
@system unittest
{
shared int i;
emplace(&i, 42);
assert(i == 42);
}
private void testEmplaceChunk(void[] chunk, size_t typeSize, size_t typeAlignment, string typeName) @nogc pure nothrow
{
assert(chunk.length >= typeSize, "emplace: Chunk size too small.");
assert((cast(size_t)chunk.ptr) % typeAlignment == 0, "emplace: Chunk is not aligned.");
}
/**
Given a raw memory area $(D chunk), constructs an object of $(D class)
type $(D T) at that address. The constructor is passed the arguments
$(D Args).
Preconditions:
$(D chunk) must be at least as large as $(D T) needs
and should have an alignment multiple of $(D T)'s alignment. (The size
of a $(D class) instance is obtained by using $(D
__traits(classInstanceSize, T))).
Note:
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: The newly constructed object.
*/
T emplace(T, Args...)(void[] chunk, auto ref Args args)
if (is(T == class))
{
static assert (!isAbstractClass!T, T.stringof ~
" is abstract and it can't be emplaced");
enum classSize = __traits(classInstanceSize, T);
testEmplaceChunk(chunk, classSize, classInstanceAlignment!T, T.stringof);
auto result = cast(T) chunk.ptr;
// Initialize the object in its pre-ctor state
chunk[0 .. classSize] = typeid(T).initializer[];
// Call the ctor if any
static if (is(typeof(result.__ctor(args))))
{
// T defines a genuine constructor accepting args
// Go the classic route: write .init first, then call ctor
result.__ctor(args);
}
else
{
static assert(args.length == 0 && !is(typeof(&T.__ctor)),
"Don't know how to initialize an object of type "
~ T.stringof ~ " with arguments " ~ Args.stringof);
}
return result;
}
///
@system unittest
{
static class C
{
int i;
this(int i){this.i = i;}
}
auto buf = new void[__traits(classInstanceSize, C)];
auto c = emplace!C(buf, 5);
assert(c.i == 5);
}
@nogc pure nothrow unittest
{
int var = 6;
ubyte[__traits(classInstanceSize, __conv_EmplaceTestClass)] buf;
auto k = emplace!__conv_EmplaceTestClass(buf, 5, var);
assert(k.i == 5);
assert(var == 7);
}
/**
Given a raw memory area $(D chunk), constructs an object of non-$(D
class) type $(D T) at that address. The constructor is passed the
arguments $(D args), if any.
Preconditions:
$(D chunk) must be at least as large
as $(D T) needs and should have an alignment multiple of $(D T)'s
alignment.
Note:
This function can be $(D @trusted) if the corresponding constructor of
$(D T) is $(D @safe).
Returns: A pointer to the newly constructed object.
*/
T* emplace(T, Args...)(void[] chunk, auto ref Args args)
if (!is(T == class))
{
testEmplaceChunk(chunk, T.sizeof, T.alignof, T.stringof);
emplaceRef!(T, Unqual!T)(*cast(Unqual!T*) chunk.ptr, args);
return cast(T*) chunk.ptr;
}
///
@system unittest
{
struct S
{
int a, b;
}
auto buf = new void[S.sizeof];
S s;
s.a = 42;
s.b = 43;
auto s1 = emplace!S(buf, s);
assert(s1.a == 42 && s1.b == 43);
}
// Bulk of emplace unittests starts here
@system unittest /* unions */
{
static union U
{
string a;
int b;
struct
{
long c;
int[] d;
}
}
U u1 = void;
U u2 = { "hello" };
emplace(&u1, u2);
assert(u1.a == "hello");
}
version(unittest) private struct __conv_EmplaceTest
{
int i = 3;
this(int i)
{
assert(this.i == 3 && i == 5);
this.i = i;
}
this(int i, ref int j)
{
assert(i == 5 && j == 6);
this.i = i;
++j;
}
@disable:
this();
this(this);
void opAssign();
}
version(unittest) private class __conv_EmplaceTestClass
{
int i = 3;
this(int i) @nogc @safe pure nothrow
{
assert(this.i == 3 && i == 5);
this.i = i;
}
this(int i, ref int j) @nogc @safe pure nothrow
{
assert(i == 5 && j == 6);
this.i = i;
++j;
}
}
@system unittest // bugzilla 15772
{
abstract class Foo {}
class Bar: Foo {}
void[] memory;
// test in emplaceInitializer
static assert(!is(typeof(emplace!Foo(cast(Foo*) memory.ptr))));
static assert( is(typeof(emplace!Bar(cast(Bar*) memory.ptr))));
// test in the emplace overload that takes void[]
static assert(!is(typeof(emplace!Foo(memory))));
static assert( is(typeof(emplace!Bar(memory))));
}
@system unittest
{
struct S { @disable this(); }
S s = void;
static assert(!__traits(compiles, emplace(&s)));
emplace(&s, S.init);
}
@system unittest
{
struct S1
{}
struct S2
{
void opAssign(S2);
}
S1 s1 = void;
S2 s2 = void;
S1[2] as1 = void;
S2[2] as2 = void;
emplace(&s1);
emplace(&s2);
emplace(&as1);
emplace(&as2);
}
@system unittest
{
static struct S1
{
this(this) @disable;
}
static struct S2
{
this() @disable;
}
S1[2] ss1 = void;
S2[2] ss2 = void;
emplace(&ss1);
static assert(!__traits(compiles, emplace(&ss2)));
S1 s1 = S1.init;
S2 s2 = S2.init;
static assert(!__traits(compiles, emplace(&ss1, s1)));
emplace(&ss2, s2);
}
@system unittest
{
struct S
{
immutable int i;
}
S s = void;
S[2] ss1 = void;
S[2] ss2 = void;
emplace(&s, 5);
assert(s.i == 5);
emplace(&ss1, s);
assert(ss1[0].i == 5 && ss1[1].i == 5);
emplace(&ss2, ss1);
assert(ss2 == ss1);
}
//Start testing emplace-args here
@system unittest
{
interface I {}
class K : I {}
K k = null, k2 = new K;
assert(k !is k2);
emplace!K(&k, k2);
assert(k is k2);
I i = null;
assert(i !is k);
emplace!I(&i, k);
assert(i is k);
}
@system unittest
{
static struct S
{
int i = 5;
void opAssign(S){assert(0);}
}
S[2] sa = void;
S[2] sb;
emplace(&sa, sb);
assert(sa[0].i == 5 && sa[1].i == 5);
}
//Start testing emplace-struct here
// Test constructor branch
@system unittest
{
struct S
{
double x = 5, y = 6;
this(int a, int b)
{
assert(x == 5 && y == 6);
x = a;
y = b;
}
}
auto s1 = new void[S.sizeof];
auto s2 = S(42, 43);
assert(*emplace!S(cast(S*) s1.ptr, s2) == s2);
assert(*emplace!S(cast(S*) s1, 44, 45) == S(44, 45));
}
@system unittest
{
__conv_EmplaceTest k = void;
emplace(&k, 5);
assert(k.i == 5);
}
@system unittest
{
int var = 6;
__conv_EmplaceTest k = void;
emplace(&k, 5, var);
assert(k.i == 5);
assert(var == 7);
}
// Test matching fields branch
@system unittest
{
struct S { uint n; }
S s;
emplace!S(&s, 2U);
assert(s.n == 2);
}
@safe unittest
{
struct S { int a, b; this(int){} }
S s;
static assert(!__traits(compiles, emplace!S(&s, 2, 3)));
}
@system unittest
{
struct S { int a, b = 7; }
S s1 = void, s2 = void;
emplace!S(&s1, 2);
assert(s1.a == 2 && s1.b == 7);
emplace!S(&s2, 2, 3);
assert(s2.a == 2 && s2.b == 3);
}
//opAssign
@system unittest
{
static struct S
{
int i = 5;
void opAssign(int){assert(0);}
void opAssign(S){assert(0);}
}
S sa1 = void;
S sa2 = void;
S sb1 = S(1);
emplace(&sa1, sb1);
emplace(&sa2, 2);
assert(sa1.i == 1);
assert(sa2.i == 2);
}
//postblit precedence
@system unittest
{
//Works, but breaks in "-w -O" because of @@@9332@@@.
//Uncomment test when 9332 is fixed.
static struct S
{
int i;
this(S other){assert(false);}
this(int i){this.i = i;}
this(this){}
}
S a = void;
assert(is(typeof({S b = a;}))); //Postblit
assert(is(typeof({S b = S(a);}))); //Constructor
auto b = S(5);
emplace(&a, b);
assert(a.i == 5);
static struct S2
{
int* p;
this(const S2){}
}
static assert(!is(immutable S2 : S2));
S2 s2 = void;
immutable is2 = (immutable S2).init;
emplace(&s2, is2);
}
//nested structs and postblit
@system unittest
{
static struct S
{
int* p;
this(int i){p = [i].ptr;}
this(this)
{
if (p)
p = [*p].ptr;
}
}
static struct SS
{
S s;
void opAssign(const SS)
{
assert(0);
}
}
SS ssa = void;
SS ssb = SS(S(5));
emplace(&ssa, ssb);
assert(*ssa.s.p == 5);
assert(ssa.s.p != ssb.s.p);
}
//disabled postblit
@system unittest
{
static struct S1
{
int i;
@disable this(this);
}
S1 s1 = void;
emplace(&s1, 1);
assert(s1.i == 1);
static assert(!__traits(compiles, emplace(&s1, S1.init)));
static struct S2
{
int i;
@disable this(this);
this(ref S2){}
}
S2 s2 = void;
static assert(!__traits(compiles, emplace(&s2, 1)));
emplace(&s2, S2.init);
static struct SS1
{
S1 s;
}
SS1 ss1 = void;
emplace(&ss1);
static assert(!__traits(compiles, emplace(&ss1, SS1.init)));
static struct SS2
{
S2 s;
}
SS2 ss2 = void;
emplace(&ss2);
static assert(!__traits(compiles, emplace(&ss2, SS2.init)));
// SS1 sss1 = s1; //This doesn't compile
// SS1 sss1 = SS1(s1); //This doesn't compile
// So emplace shouldn't compile either
static assert(!__traits(compiles, emplace(&sss1, s1)));
static assert(!__traits(compiles, emplace(&sss2, s2)));
}
//Imutability
@system unittest
{
//Castable immutability
{
static struct S1
{
int i;
}
static assert(is( immutable(S1) : S1));
S1 sa = void;
auto sb = immutable(S1)(5);
emplace(&sa, sb);
assert(sa.i == 5);
}
//Un-castable immutability
{
static struct S2
{
int* p;
}
static assert(!is(immutable(S2) : S2));
S2 sa = void;
auto sb = immutable(S2)(null);
assert(!__traits(compiles, emplace(&sa, sb)));
}
}
@system unittest
{
static struct S
{
immutable int i;
immutable(int)* j;
}
S s = void;
emplace(&s, 1, null);
emplace(&s, 2, &s.i);
assert(s is S(2, &s.i));
}
//Context pointer
@system unittest
{
int i = 0;
{
struct S1
{
void foo(){++i;}
}
S1 sa = void;
S1 sb;
emplace(&sa, sb);
sa.foo();
assert(i == 1);
}
{
struct S2
{
void foo(){++i;}
this(this){}
}
S2 sa = void;
S2 sb;
emplace(&sa, sb);
sa.foo();
assert(i == 2);
}
}
//Alias this
@system unittest
{
static struct S
{
int i;
}
//By Ref
{
static struct SS1
{
int j;
S s;
alias s this;
}
S s = void;
SS1 ss = SS1(1, S(2));
emplace(&s, ss);
assert(s.i == 2);
}
//By Value
{
static struct SS2
{
int j;
S s;
S foo() @property{return s;}
alias foo this;
}
S s = void;
SS2 ss = SS2(1, S(2));
emplace(&s, ss);
assert(s.i == 2);
}
}
version(unittest)
{
//Ambiguity
struct __std_conv_S
{
int i;
this(__std_conv_SS ss) {assert(0);}
static opCall(__std_conv_SS ss)
{
__std_conv_S s; s.i = ss.j;
return s;
}
}
struct __std_conv_SS
{
int j;
__std_conv_S s;
ref __std_conv_S foo() return @property {s.i = j; return s;}
alias foo this;
}
static assert(is(__std_conv_SS : __std_conv_S));
@system unittest
{
__std_conv_S s = void;
__std_conv_SS ss = __std_conv_SS(1);
__std_conv_S sTest1 = ss; //this calls "SS alias this" (and not "S.this(SS)")
emplace(&s, ss); //"alias this" should take precedence in emplace over "opCall"
assert(s.i == 1);
}
}
//Nested classes
@system unittest
{
class A{}
static struct S
{
A a;
}
S s1 = void;
S s2 = S(new A);
emplace(&s1, s2);
assert(s1.a is s2.a);
}
//safety & nothrow & CTFE
@system unittest
{
//emplace should be safe for anything with no elaborate opassign
static struct S1
{
int i;
}
static struct S2
{
int i;
this(int j)@safe nothrow{i = j;}
}
int i;
S1 s1 = void;
S2 s2 = void;
auto pi = &i;
auto ps1 = &s1;
auto ps2 = &s2;
void foo() @safe nothrow
{
emplace(pi);
emplace(pi, 5);
emplace(ps1);
emplace(ps1, 5);
emplace(ps1, S1.init);
emplace(ps2);
emplace(ps2, 5);
emplace(ps2, S2.init);
}
foo();
T bar(T)() @property
{
T t/+ = void+/; //CTFE void illegal
emplace(&t, 5);
return t;
}
// CTFE
enum a = bar!int;
static assert(a == 5);
enum b = bar!S1;
static assert(b.i == 5);
enum c = bar!S2;
static assert(c.i == 5);
// runtime
auto aa = bar!int;
assert(aa == 5);
auto bb = bar!S1;
assert(bb.i == 5);
auto cc = bar!S2;
assert(cc.i == 5);
}
@system unittest
{
struct S
{
int[2] get(){return [1, 2];}
alias get this;
}
struct SS
{
int[2] ii;
}
struct ISS
{
int[2] ii;
}
S s;
SS ss = void;
ISS iss = void;
emplace(&ss, s);
emplace(&iss, s);
assert(ss.ii == [1, 2]);
assert(iss.ii == [1, 2]);
}
//disable opAssign
@system unittest
{
static struct S
{
@disable void opAssign(S);
}
S s;
emplace(&s, S.init);
}
//opCall
@system unittest
{
int i;
//Without constructor
{
static struct S1
{
int i;
static S1 opCall(int*){assert(0);}
}
S1 s = void;
static assert(!__traits(compiles, emplace(&s, 1)));
}
//With constructor
{
static struct S2
{
int i = 0;
static S2 opCall(int*){assert(0);}
static S2 opCall(int){assert(0);}
this(int i){this.i = i;}
}
S2 s = void;
emplace(&s, 1);
assert(s.i == 1);
}
//With postblit ambiguity
{
static struct S3
{
int i = 0;
static S3 opCall(ref S3){assert(0);}
}
S3 s = void;
emplace(&s, S3.init);
}
}
@safe unittest //@@@9559@@@
{
import std.algorithm.iteration : map;
import std.typecons : Nullable;
import std.array : array;
alias I = Nullable!int;
auto ints = [0, 1, 2].map!(i => i & 1 ? I.init : I(i))();
auto asArray = array(ints);
}
@system unittest //http://forum.dlang.org/post/nxbdgtdlmwscocbiypjs@forum.dlang.org
{
import std.array : array;
import std.datetime : SysTime, UTC;
import std.math : isNaN;
static struct A
{
double i;
}
static struct B
{
invariant()
{
if (j == 0)
assert(a.i.isNaN(), "why is 'j' zero?? and i is not NaN?");
else
assert(!a.i.isNaN());
}
SysTime when; // comment this line avoid the breakage
int j;
A a;
}
B b1 = B.init;
assert(&b1); // verify that default eyes invariants are ok;
auto b2 = B(SysTime(0, UTC()), 1, A(1));
assert(&b2);
auto b3 = B(SysTime(0, UTC()), 1, A(1));
assert(&b3);
auto arr = [b2, b3];
assert(arr[0].j == 1);
assert(arr[1].j == 1);
auto a2 = arr.array(); // << bang, invariant is raised, also if b2 and b3 are good
}
//static arrays
@system unittest
{
static struct S
{
int[2] ii;
}
static struct IS
{
immutable int[2] ii;
}
int[2] ii;
S s = void;
IS ims = void;
ubyte ub = 2;
emplace(&s, ub);
emplace(&s, ii);
emplace(&ims, ub);
emplace(&ims, ii);
uint[2] uu;
static assert(!__traits(compiles, {S ss = S(uu);}));
static assert(!__traits(compiles, emplace(&s, uu)));
}
@system unittest
{
int[2] sii;
int[2] sii2;
uint[2] uii;
uint[2] uii2;
emplace(&sii, 1);
emplace(&sii, 1U);
emplace(&uii, 1);
emplace(&uii, 1U);
emplace(&sii, sii2);
//emplace(&sii, uii2); //Sorry, this implementation doesn't know how to...
//emplace(&uii, sii2); //Sorry, this implementation doesn't know how to...
emplace(&uii, uii2);
emplace(&sii, sii2[]);
//emplace(&sii, uii2[]); //Sorry, this implementation doesn't know how to...
//emplace(&uii, sii2[]); //Sorry, this implementation doesn't know how to...
emplace(&uii, uii2[]);
}
@system unittest
{
bool allowDestruction = false;
struct S
{
int i;
this(this){}
~this(){assert(allowDestruction);}
}
S s = S(1);
S[2] ss1 = void;
S[2] ss2 = void;
S[2] ss3 = void;
emplace(&ss1, s);
emplace(&ss2, ss1);
emplace(&ss3, ss2[]);
assert(ss1[1] == s);
assert(ss2[1] == s);
assert(ss3[1] == s);
allowDestruction = true;
}
@system unittest
{
//Checks postblit, construction, and context pointer
int count = 0;
struct S
{
this(this)
{
++count;
}
~this()
{
--count;
}
}
S s;
{
S[4] ss = void;
emplace(&ss, s);
assert(count == 4);
}
assert(count == 0);
}
@system unittest
{
struct S
{
int i;
}
S s;
S[2][2][2] sss = void;
emplace(&sss, s);
}
@system unittest //Constness
{
import std.stdio;
int a = void;
emplaceRef!(const int)(a, 5);
immutable i = 5;
const(int)* p = void;
emplaceRef!(const int*)(p, &i);
struct S
{
int* p;
}
alias IS = immutable(S);
S s = void;
emplaceRef!IS(s, IS());
S[2] ss = void;
emplaceRef!(IS[2])(ss, IS());
IS[2] iss = IS.init;
emplaceRef!(IS[2])(ss, iss);
emplaceRef!(IS[2])(ss, iss[]);
}
pure nothrow @safe @nogc unittest
{
int i;
emplaceRef(i);
emplaceRef!int(i);
emplaceRef(i, 5);
emplaceRef!int(i, 5);
}
// Test attribute propagation for UDTs
pure nothrow @safe /* @nogc */ unittest
{
static struct Safe
{
this(this) pure nothrow @safe @nogc {}
}
Safe safe = void;
emplaceRef(safe, Safe());
Safe[1] safeArr = [Safe()];
Safe[1] uninitializedSafeArr = void;
emplaceRef(uninitializedSafeArr, safe);
emplaceRef(uninitializedSafeArr, safeArr);
static struct Unsafe
{
this(this) @system {}
}
Unsafe unsafe = void;
static assert(!__traits(compiles, emplaceRef(unsafe, Unsafe())));
Unsafe[1] unsafeArr = [Unsafe()];
Unsafe[1] uninitializedUnsafeArr = void;
static assert(!__traits(compiles, emplaceRef(uninitializedUnsafeArr, unsafe)));
static assert(!__traits(compiles, emplaceRef(uninitializedUnsafeArr, unsafeArr)));
}
@system unittest
{
// Issue 15313
static struct Node
{
int payload;
Node* next;
uint refs;
}
import core.stdc.stdlib : malloc;
void[] buf = malloc(Node.sizeof)[0 .. Node.sizeof];
import std.conv : emplace;
const Node* n = emplace!(const Node)(buf, 42, null, 10);
assert(n.payload == 42);
assert(n.next == null);
assert(n.refs == 10);
}
@system unittest
{
int var = 6;
auto k = emplace!__conv_EmplaceTest(new void[__conv_EmplaceTest.sizeof], 5, var);
assert(k.i == 5);
assert(var == 7);
}
@system unittest
{
class A
{
int x = 5;
int y = 42;
this(int z)
{
assert(x == 5 && y == 42);
x = y = z;
}
}
void[] buf;
static byte[__traits(classInstanceSize, A)] sbuf;
buf = sbuf[];
auto a = emplace!A(buf, 55);
assert(a.x == 55 && a.y == 55);
// emplace in bigger buffer
buf = new byte[](__traits(classInstanceSize, A) + 10);
a = emplace!A(buf, 55);
assert(a.x == 55 && a.y == 55);
// need ctor args
static assert(!is(typeof(emplace!A(buf))));
}
// Bulk of emplace unittests ends here
@safe unittest
{
import std.algorithm.comparison : equal;
import std.algorithm.iteration : map;
// Check fix for http://d.puremagic.com/issues/show_bug.cgi?id=2971
assert(equal(map!(to!int)(["42", "34", "345"]), [42, 34, 345]));
}
// Undocumented for the time being
void toTextRange(T, W)(T value, W writer)
if (isIntegral!T && isOutputRange!(W, char))
{
char[value.sizeof * 4] buffer = void;
uint i = cast(uint) (buffer.length - 1);
bool negative = value < 0;
Unqual!(Unsigned!T) v = negative ? -value : value;
while (v >= 10)
{
auto c = cast(uint) (v % 10);
v /= 10;
buffer[i--] = cast(char) (c + '0');
}
buffer[i] = cast(char) (v + '0'); //hexDigits[cast(uint) v];
if (negative)
buffer[--i] = '-';
put(writer, buffer[i .. $]);
}
@safe unittest
{
import std.array : appender;
auto result = appender!(char[])();
toTextRange(-1, result);
assert(result.data == "-1");
}
/**
Returns the corresponding _unsigned value for $(D x) (e.g. if $(D x) has type
$(D int), it returns $(D cast(uint) x)). The advantage compared to the cast
is that you do not need to rewrite the cast if $(D x) later changes type
(e.g from $(D int) to $(D long)).
Note that the result is always mutable even if the original type was const
or immutable. In order to retain the constness, use $(REF Unsigned, std,traits).
*/
auto unsigned(T)(T x) if (isIntegral!T)
{
return cast(Unqual!(Unsigned!T))x;
}
///
@safe unittest
{
immutable int s = 42;
auto u1 = unsigned(s); //not qualified
static assert(is(typeof(u1) == uint));
Unsigned!(typeof(s)) u2 = unsigned(s); //same qualification
static assert(is(typeof(u2) == immutable uint));
immutable u3 = unsigned(s); //explicitly qualified
}
@safe unittest
{
foreach (T; AliasSeq!(byte, ubyte))
{
static assert(is(typeof(unsigned(cast(T)1)) == ubyte));
static assert(is(typeof(unsigned(cast(const T)1)) == ubyte));
static assert(is(typeof(unsigned(cast(immutable T)1)) == ubyte));
}
foreach (T; AliasSeq!(short, ushort))
{
static assert(is(typeof(unsigned(cast(T)1)) == ushort));
static assert(is(typeof(unsigned(cast(const T)1)) == ushort));
static assert(is(typeof(unsigned(cast(immutable T)1)) == ushort));
}
foreach (T; AliasSeq!(int, uint))
{
static assert(is(typeof(unsigned(cast(T)1)) == uint));
static assert(is(typeof(unsigned(cast(const T)1)) == uint));
static assert(is(typeof(unsigned(cast(immutable T)1)) == uint));
}
foreach (T; AliasSeq!(long, ulong))
{
static assert(is(typeof(unsigned(cast(T)1)) == ulong));
static assert(is(typeof(unsigned(cast(const T)1)) == ulong));
static assert(is(typeof(unsigned(cast(immutable T)1)) == ulong));
}
}
auto unsigned(T)(T x) if (isSomeChar!T)
{
// All characters are unsigned
static assert(T.min == 0);
return cast(Unqual!T) x;
}
@safe unittest
{
foreach (T; AliasSeq!(char, wchar, dchar))
{
static assert(is(typeof(unsigned(cast(T)'A')) == T));
static assert(is(typeof(unsigned(cast(const T)'A')) == T));
static assert(is(typeof(unsigned(cast(immutable T)'A')) == T));
}
}
/**
Returns the corresponding _signed value for $(D x) (e.g. if $(D x) has type
$(D uint), it returns $(D cast(int) x)). The advantage compared to the cast
is that you do not need to rewrite the cast if $(D x) later changes type
(e.g from $(D uint) to $(D ulong)).
Note that the result is always mutable even if the original type was const
or immutable. In order to retain the constness, use $(REF Signed, std,traits).
*/
auto signed(T)(T x) if (isIntegral!T)
{
return cast(Unqual!(Signed!T))x;
}
///
@safe unittest
{
immutable uint u = 42;
auto s1 = signed(u); //not qualified
static assert(is(typeof(s1) == int));
Signed!(typeof(u)) s2 = signed(u); //same qualification
static assert(is(typeof(s2) == immutable int));
immutable s3 = signed(u); //explicitly qualified
}
@safe unittest
{
foreach (T; AliasSeq!(byte, ubyte))
{
static assert(is(typeof(signed(cast(T)1)) == byte));
static assert(is(typeof(signed(cast(const T)1)) == byte));
static assert(is(typeof(signed(cast(immutable T)1)) == byte));
}
foreach (T; AliasSeq!(short, ushort))
{
static assert(is(typeof(signed(cast(T)1)) == short));
static assert(is(typeof(signed(cast(const T)1)) == short));
static assert(is(typeof(signed(cast(immutable T)1)) == short));
}
foreach (T; AliasSeq!(int, uint))
{
static assert(is(typeof(signed(cast(T)1)) == int));
static assert(is(typeof(signed(cast(const T)1)) == int));
static assert(is(typeof(signed(cast(immutable T)1)) == int));
}
foreach (T; AliasSeq!(long, ulong))
{
static assert(is(typeof(signed(cast(T)1)) == long));
static assert(is(typeof(signed(cast(const T)1)) == long));
static assert(is(typeof(signed(cast(immutable T)1)) == long));
}
}
@safe unittest
{
// issue 10874
enum Test { a = 0 }
ulong l = 0;
auto t = l.to!Test;
}
/**
A wrapper on top of the built-in cast operator that allows one to restrict
casting of the original type of the value.
A common issue with using a raw cast is that it may silently continue to
compile even if the value's type has changed during refactoring,
which breaks the initial assumption about the cast.
Params:
From = The type to cast from. The programmer must ensure it is legal
to make this cast.
*/
template castFrom(From)
{
/**
Params:
To = The type _to cast _to.
value = The value _to cast. It must be of type $(D From),
otherwise a compile-time error is emitted.
Returns:
the value after the cast, returned by reference if possible.
*/
auto ref to(To, T)(auto ref T value) @system
{
static assert (
is(From == T),
"the value to cast is not of specified type '" ~ From.stringof ~
"', it is of type '" ~ T.stringof ~ "'"
);
static assert (
is(typeof(cast(To)value)),
"can't cast from '" ~ From.stringof ~ "' to '" ~ To.stringof ~ "'"
);
return cast(To) value;
}
///
@safe unittest
{
// Regular cast, which has been verified to be legal by the programmer:
{
long x;
auto y = cast(int) x;
}
// However this will still compile if 'x' is changed to be a pointer:
{
long* x;
auto y = cast(int) x;
}
// castFrom provides a more reliable alternative to casting:
{
long x;
auto y = castFrom!long.to!int(x);
}
// Changing the type of 'x' will now issue a compiler error,
// allowing bad casts to be caught before it's too late:
{
long* x;
static assert (
!__traits(compiles, castFrom!long.to!int(x))
);
// if cast is still needed, must be changed to:
auto y = castFrom!(long*).to!int(x);
}
}
}
/**
Check the correctness of a string for $(D hexString).
The result is true if and only if the input string is composed of whitespace
characters (\f\n\r\t\v lineSep paraSep nelSep) and
an even number of hexadecimal digits (regardless of the case).
*/
private bool isHexLiteral(String)(in String hexData)
{
import std.ascii : isHexDigit;
import std.uni : lineSep, paraSep, nelSep;
size_t i;
foreach (const dchar c; hexData)
{
switch (c)
{
case ' ':
case '\t':
case '\v':
case '\f':
case '\r':
case '\n':
case lineSep:
case paraSep:
case nelSep:
continue;
default:
break;
}
if (c.isHexDigit)
++i;
else
return false;
}
return !(i & 1);
}
///
@safe unittest
{
// test all the hex digits
static assert( ("0123456789abcdefABCDEF").isHexLiteral);
// empty or white strings are not valid
static assert( "\r\n\t".isHexLiteral);
// but are accepted if the count of hex digits is even
static assert( "A\r\n\tB".isHexLiteral);
}
@safe unittest
{
import std.ascii;
// empty/whites
static assert( "".isHexLiteral);
static assert( " \r".isHexLiteral);
static assert( whitespace.isHexLiteral);
static assert( ""w.isHexLiteral);
static assert( " \r"w.isHexLiteral);
static assert( ""d.isHexLiteral);
static assert( " \r"d.isHexLiteral);
static assert( "\u2028\u2029\u0085"d.isHexLiteral);
// odd x strings
static assert( !("5" ~ whitespace).isHexLiteral);
static assert( !"123".isHexLiteral);
static assert( !"1A3".isHexLiteral);
static assert( !"1 23".isHexLiteral);
static assert( !"\r\n\tC".isHexLiteral);
static assert( !"123"w.isHexLiteral);
static assert( !"1A3"w.isHexLiteral);
static assert( !"1 23"w.isHexLiteral);
static assert( !"\r\n\tC"w.isHexLiteral);
static assert( !"123"d.isHexLiteral);
static assert( !"1A3"d.isHexLiteral);
static assert( !"1 23"d.isHexLiteral);
static assert( !"\r\n\tC"d.isHexLiteral);
// even x strings with invalid charset
static assert( !"12gG".isHexLiteral);
static assert( !"2A 3q".isHexLiteral);
static assert( !"12gG"w.isHexLiteral);
static assert( !"2A 3q"w.isHexLiteral);
static assert( !"12gG"d.isHexLiteral);
static assert( !"2A 3q"d.isHexLiteral);
// valid x strings
static assert( ("5A" ~ whitespace).isHexLiteral);
static assert( ("5A 01A C FF de 1b").isHexLiteral);
static assert( ("0123456789abcdefABCDEF").isHexLiteral);
static assert( (" 012 34 5 6789 abcd ef\rAB\nCDEF").isHexLiteral);
static assert( ("5A 01A C FF de 1b"w).isHexLiteral);
static assert( ("0123456789abcdefABCDEF"w).isHexLiteral);
static assert( (" 012 34 5 6789 abcd ef\rAB\nCDEF"w).isHexLiteral);
static assert( ("5A 01A C FF de 1b"d).isHexLiteral);
static assert( ("0123456789abcdefABCDEF"d).isHexLiteral);
static assert( (" 012 34 5 6789 abcd ef\rAB\nCDEF"d).isHexLiteral);
// library version allows what's pointed by issue 10454
static assert( ("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF").isHexLiteral);
}
/**
Converts a hex literal to a string at compile time.
Takes a string made of hexadecimal digits and returns
the matching string by converting each pair of digits to a character.
The input string can also include white characters, which can be used
to keep the literal string readable in the source code.
The function is intended to replace the hexadecimal literal strings
starting with $(D 'x'), which could be removed to simplify the core language.
Params:
hexData = string to be converted.
Returns:
a $(D string), a $(D wstring) or a $(D dstring), according to the type of hexData.
*/
template hexString(string hexData)
if (hexData.isHexLiteral)
{
immutable hexString = hexStrImpl(hexData);
}
/// ditto
template hexString(wstring hexData)
if (hexData.isHexLiteral)
{
immutable hexString = hexStrImpl(hexData);
}
/// ditto
template hexString(dstring hexData)
if (hexData.isHexLiteral)
{
immutable hexString = hexStrImpl(hexData);
}
///
@safe unittest
{
// conversion at compile time
auto string1 = hexString!"304A314B";
assert(string1 == "0J1K");
auto string2 = hexString!"304A314B"w;
assert(string2 == "0J1K"w);
auto string3 = hexString!"304A314B"d;
assert(string3 == "0J1K"d);
}
/*
Takes a hexadecimal string literal and returns its representation.
hexData is granted to be a valid string by the caller.
C is granted to be a valid char type by the caller.
*/
@safe nothrow pure
private auto hexStrImpl(String)(String hexData)
{
import std.ascii;
alias C = Unqual!(ElementEncodingType!String);
C[] result;
result.length = hexData.length / 2;
size_t cnt;
ubyte v;
foreach (c; hexData)
{
if (c.isHexDigit)
{
ubyte x;
if (c >= '0' && c <= '9')
x = cast(ubyte)(c - '0');
else if (c >= 'a' && c <= 'f')
x = cast(ubyte)(c - ('a' - 10));
else if (c >= 'A' && c <= 'F')
x = cast(ubyte)(c - ('A' - 10));
if (cnt & 1)
{
v = cast(ubyte)((v << 4) | x);
result[cnt / 2] = v;
}
else
v = x;
++cnt;
}
}
result.length = cnt / 2;
return result;
}
@safe unittest
{
// compile time
assert(hexString!"46 47 48 49 4A 4B" == "FGHIJK");
assert(hexString!"30\r\n\t\f\v31 32 33 32 31 30" == "0123210");
assert(hexString!"ab cd" == hexString!"ABCD");
}
/**
* Convert integer to a range of characters.
* Intended to be lightweight and fast.
*
* Params:
* radix = 2, 8, 10, 16
* Char = character type for output
* letterCase = lower for deadbeef, upper for DEADBEEF
* value = integer to convert. Can be uint or ulong. If radix is 10, can also be
* int or long.
* Returns:
* Random access range with slicing and everything
*/
auto toChars(ubyte radix = 10, Char = char, LetterCase letterCase = LetterCase.lower, T)(T value)
pure nothrow @nogc @safe
if ((radix == 2 || radix == 8 || radix == 10 || radix == 16) &&
(is(Unqual!T == uint) || is(Unqual!T == ulong) ||
radix == 10 && (is(Unqual!T == int) || is(Unqual!T == long))))
{
alias UT = Unqual!T;
static if (radix == 10)
{
/* uint.max is 42_9496_7295
* int.max is 21_4748_3647
* ulong.max is 1844_6744_0737_0955_1615
* long.max is 922_3372_0368_5477_5807
*/
static struct Result
{
void initialize(UT value)
{
bool neg = false;
if (value < 10)
{
if (value >= 0)
{
lwr = 0;
upr = 1;
buf[0] = cast(char)(cast(uint)value + '0');
return;
}
value = -value;
neg = true;
}
auto i = cast(uint)buf.length - 1;
while (cast(Unsigned!UT)value >= 10)
{
buf[i] = cast(ubyte)('0' + cast(Unsigned!UT)value % 10);
value = unsigned(value) / 10;
--i;
}
buf[i] = cast(char)(cast(uint)value + '0');
if (neg)
{
buf[i - 1] = '-';
--i;
}
lwr = i;
upr = cast(uint)buf.length;
}
@property size_t length() { return upr - lwr; }
@property bool empty() { return upr == lwr; }
@property Char front() { return buf[lwr]; }
void popFront() { ++lwr; }
@property Char back() { return buf[upr - 1]; }
void popBack() { --upr; }
@property Result save() { return this; }
Char opIndex(size_t i) { return buf[lwr + i]; }
Result opSlice(size_t lwr, size_t upr)
{
Result result = void;
result.buf = buf;
result.lwr = cast(uint)(this.lwr + lwr);
result.upr = cast(uint)(this.lwr + upr);
return result;
}
private:
uint lwr = void, upr = void;
char[(UT.sizeof == 4) ? 10 + isSigned!T : 20] buf = void;
}
Result result = void;
result.initialize(value);
return result;
}
else
{
static if (radix == 2)
enum SHIFT = 1;
else static if (radix == 8)
enum SHIFT = 3;
else static if (radix == 16)
enum SHIFT = 4;
else
static assert(0);
static struct Result
{
this(UT value)
{
this.value = value;
ubyte len = 1;
while (value >>>= SHIFT)
++len;
this.len = len;
}
@property size_t length() { return len; }
@property bool empty() { return len == 0; }
@property Char front() { return opIndex(0); }
void popFront() { --len; }
@property Char back() { return opIndex(len - 1); }
void popBack()
{
value >>>= SHIFT;
--len;
}
@property Result save() { return this; }
Char opIndex(size_t i)
{
Char c = (value >>> ((len - i - 1) * SHIFT)) & ((1 << SHIFT) - 1);
return cast(Char)((radix < 10 || c < 10) ? c + '0'
: (letterCase == LetterCase.upper ? c + 'A' - 10
: c + 'a' - 10));
}
Result opSlice(size_t lwr, size_t upr)
{
Result result = void;
result.value = value >>> ((len - upr) * SHIFT);
result.len = cast(ubyte)(upr - lwr);
return result;
}
private:
UT value;
ubyte len;
}
return Result(value);
}
}
@safe unittest
{
import std.array;
import std.range;
{
assert(toChars!2(0u).array == "0");
assert(toChars!2(0Lu).array == "0");
assert(toChars!2(1u).array == "1");
assert(toChars!2(1Lu).array == "1");
auto r = toChars!2(2u);
assert(r.length == 2);
assert(r[0] == '1');
assert(r[1..2].array == "0");
auto s = r.save;
assert(r.array == "10");
assert(s.retro.array == "01");
}
{
assert(toChars!8(0u).array == "0");
assert(toChars!8(0Lu).array == "0");
assert(toChars!8(1u).array == "1");
assert(toChars!8(1234567Lu).array == "4553207");
auto r = toChars!8(8u);
assert(r.length == 2);
assert(r[0] == '1');
assert(r[1..2].array == "0");
auto s = r.save;
assert(r.array == "10");
assert(s.retro.array == "01");
}
{
assert(toChars!10(0u).array == "0");
assert(toChars!10(0Lu).array == "0");
assert(toChars!10(1u).array == "1");
assert(toChars!10(1234567Lu).array == "1234567");
assert(toChars!10(uint.max).array == "4294967295");
assert(toChars!10(ulong.max).array == "18446744073709551615");
auto r = toChars(10u);
assert(r.length == 2);
assert(r[0] == '1');
assert(r[1..2].array == "0");
auto s = r.save;
assert(r.array == "10");
assert(s.retro.array == "01");
}
{
assert(toChars!10(0).array == "0");
assert(toChars!10(0L).array == "0");
assert(toChars!10(1).array == "1");
assert(toChars!10(1234567L).array == "1234567");
assert(toChars!10(int.max).array == "2147483647");
assert(toChars!10(long.max).array == "9223372036854775807");
assert(toChars!10(-int.max).array == "-2147483647");
assert(toChars!10(-long.max).array == "-9223372036854775807");
assert(toChars!10(int.min).array == "-2147483648");
assert(toChars!10(long.min).array == "-9223372036854775808");
auto r = toChars!10(10);
assert(r.length == 2);
assert(r[0] == '1');
assert(r[1..2].array == "0");
auto s = r.save;
assert(r.array == "10");
assert(s.retro.array == "01");
}
{
assert(toChars!(16)(0u).array == "0");
assert(toChars!(16)(0Lu).array == "0");
assert(toChars!(16)(10u).array == "a");
assert(toChars!(16, char, LetterCase.upper)(0x12AF34567Lu).array == "12AF34567");
auto r = toChars!(16)(16u);
assert(r.length == 2);
assert(r[0] == '1');
assert(r[1..2].array == "0");
auto s = r.save;
assert(r.array == "10");
assert(s.retro.array == "01");
}
}
@safe unittest // opSlice (issue 16192)
{
import std.meta : AliasSeq;
static struct Test { ubyte radix; uint number; }
alias tests = AliasSeq!(
Test(2, 0b1_0110_0111u),
Test(2, 0b10_1100_1110u),
Test(8, octal!123456701u),
Test(8, octal!1234567012u),
Test(10, 123456789u),
Test(10, 1234567890u),
Test(16, 0x789ABCDu),
Test(16, 0x789ABCDEu),
);
foreach (test; tests)
{
enum ubyte radix = test.radix;
auto original = toChars!radix(test.number);
// opSlice vs popFront
auto r = original.save;
size_t i = 0;
for (; !r.empty; r.popFront(), ++i)
{
assert(original[i .. original.length].tupleof == r.tupleof);
// tupleof is used to work around issue 16216.
}
// opSlice vs popBack
r = original.save;
i = 0;
for (; !r.empty; r.popBack(), ++i)
{
assert(original[0 .. original.length - i].tupleof == r.tupleof);
}
// opSlice vs both popFront and popBack
r = original.save;
i = 0;
for (; r.length >= 2; r.popFront(), r.popBack(), ++i)
{
assert(original[i .. original.length - i].tupleof == r.tupleof);
}
}
}
|
D
|
/Users/zyang/SNGithub/Cosmos/Build/Intermediates/Cosmos.build/Debug-iphonesimulator/Cosmos.build/Objects-normal/x86_64/Triangle.o : /Users/zyang/SNGithub/Cosmos/Cosmos/Curve.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Shape+Creation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Wedge.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Checkerboard.swift /Users/zyang/SNGithub/Cosmos/Cosmos/RegularPolygon.swift /Users/zyang/SNGithub/Cosmos/Cosmos/EventSource.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIImage+AddRemove.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Bloom.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Rectangle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AstrologicalSignProvider.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ScreenRecorder.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ImageLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/HueAdjust.swift /Users/zyang/SNGithub/Cosmos/Cosmos/QuadCurve.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Vector.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AppDelegate.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Filter.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Stars.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsBig.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Shadow.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsBackground.swift /Users/zyang/SNGithub/Cosmos/Cosmos/PlayerLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Sepia.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsSmall.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Transform.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Pixel.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Shape.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Line.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Animation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Arc.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIGestureRecognizer+Closure.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuShadow.swift /Users/zyang/SNGithub/Cosmos/Cosmos/GradientLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StoredAnimation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuIcons.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Ellipse.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Foundation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Border.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Rect.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIViewController+C4View.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Size.swift /Users/zyang/SNGithub/Cosmos/Cosmos/TextShape.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Crop.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Color.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Star.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Circle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/LinearGradient.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Font.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Movie.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Point.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Sharpen.swift /Users/zyang/SNGithub/Cosmos/Cosmos/DotScreen.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Filter.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Timer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Path.swift /Users/zyang/SNGithub/Cosmos/Cosmos/InfiniteScrollView.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIView+AddRemove.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuSelector.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ViewAnimation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/CanvasController.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Animation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Generator.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+KeyValues.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Render.swift /Users/zyang/SNGithub/Cosmos/Cosmos/InfoPanel.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ColorBurn.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Gradient.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Triangle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Twirl.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Menu.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Math.swift /Users/zyang/SNGithub/Cosmos/Cosmos/SignLines.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Polygon.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Layer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ShapeLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Generator.swift /Users/zyang/SNGithub/Cosmos/Cosmos/GaussianBlur.swift /Users/zyang/SNGithub/Cosmos/Cosmos/WorkSpace.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIImage+Color.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AudioPlayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuRings.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/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/UIKit.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/zyang/SNGithub/Cosmos/Build/Intermediates/Cosmos.build/Debug-iphonesimulator/Cosmos.build/Objects-normal/x86_64/Triangle~partial.swiftmodule : /Users/zyang/SNGithub/Cosmos/Cosmos/Curve.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Shape+Creation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Wedge.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Checkerboard.swift /Users/zyang/SNGithub/Cosmos/Cosmos/RegularPolygon.swift /Users/zyang/SNGithub/Cosmos/Cosmos/EventSource.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIImage+AddRemove.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Bloom.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Rectangle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AstrologicalSignProvider.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ScreenRecorder.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ImageLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/HueAdjust.swift /Users/zyang/SNGithub/Cosmos/Cosmos/QuadCurve.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Vector.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AppDelegate.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Filter.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Stars.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsBig.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Shadow.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsBackground.swift /Users/zyang/SNGithub/Cosmos/Cosmos/PlayerLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Sepia.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsSmall.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Transform.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Pixel.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Shape.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Line.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Animation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Arc.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIGestureRecognizer+Closure.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuShadow.swift /Users/zyang/SNGithub/Cosmos/Cosmos/GradientLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StoredAnimation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuIcons.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Ellipse.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Foundation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Border.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Rect.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIViewController+C4View.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Size.swift /Users/zyang/SNGithub/Cosmos/Cosmos/TextShape.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Crop.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Color.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Star.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Circle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/LinearGradient.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Font.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Movie.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Point.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Sharpen.swift /Users/zyang/SNGithub/Cosmos/Cosmos/DotScreen.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Filter.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Timer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Path.swift /Users/zyang/SNGithub/Cosmos/Cosmos/InfiniteScrollView.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIView+AddRemove.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuSelector.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ViewAnimation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/CanvasController.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Animation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Generator.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+KeyValues.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Render.swift /Users/zyang/SNGithub/Cosmos/Cosmos/InfoPanel.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ColorBurn.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Gradient.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Triangle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Twirl.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Menu.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Math.swift /Users/zyang/SNGithub/Cosmos/Cosmos/SignLines.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Polygon.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Layer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ShapeLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Generator.swift /Users/zyang/SNGithub/Cosmos/Cosmos/GaussianBlur.swift /Users/zyang/SNGithub/Cosmos/Cosmos/WorkSpace.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIImage+Color.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AudioPlayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuRings.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/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/UIKit.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
/Users/zyang/SNGithub/Cosmos/Build/Intermediates/Cosmos.build/Debug-iphonesimulator/Cosmos.build/Objects-normal/x86_64/Triangle~partial.swiftdoc : /Users/zyang/SNGithub/Cosmos/Cosmos/Curve.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Shape+Creation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Wedge.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Checkerboard.swift /Users/zyang/SNGithub/Cosmos/Cosmos/RegularPolygon.swift /Users/zyang/SNGithub/Cosmos/Cosmos/EventSource.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIImage+AddRemove.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Bloom.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Rectangle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AstrologicalSignProvider.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ScreenRecorder.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ImageLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/HueAdjust.swift /Users/zyang/SNGithub/Cosmos/Cosmos/QuadCurve.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Vector.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AppDelegate.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Filter.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Stars.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsBig.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Shadow.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsBackground.swift /Users/zyang/SNGithub/Cosmos/Cosmos/PlayerLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Sepia.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StarsSmall.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Transform.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Pixel.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Shape.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Line.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Animation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Arc.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIGestureRecognizer+Closure.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuShadow.swift /Users/zyang/SNGithub/Cosmos/Cosmos/GradientLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/StoredAnimation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuIcons.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Ellipse.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Foundation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Border.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Rect.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIViewController+C4View.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Size.swift /Users/zyang/SNGithub/Cosmos/Cosmos/TextShape.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Crop.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Color.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Star.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Circle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/LinearGradient.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Font.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Movie.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Point.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Sharpen.swift /Users/zyang/SNGithub/Cosmos/Cosmos/DotScreen.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Filter.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Timer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Path.swift /Users/zyang/SNGithub/Cosmos/Cosmos/InfiniteScrollView.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIView+AddRemove.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuSelector.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ViewAnimation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/CanvasController.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Animation.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Generator.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+KeyValues.swift /Users/zyang/SNGithub/Cosmos/Cosmos/View+Render.swift /Users/zyang/SNGithub/Cosmos/Cosmos/InfoPanel.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ColorBurn.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Gradient.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Triangle.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Twirl.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Menu.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Math.swift /Users/zyang/SNGithub/Cosmos/Cosmos/SignLines.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Polygon.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Layer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/ShapeLayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/Image+Generator.swift /Users/zyang/SNGithub/Cosmos/Cosmos/GaussianBlur.swift /Users/zyang/SNGithub/Cosmos/Cosmos/WorkSpace.swift /Users/zyang/SNGithub/Cosmos/Cosmos/UIImage+Color.swift /Users/zyang/SNGithub/Cosmos/Cosmos/AudioPlayer.swift /Users/zyang/SNGithub/Cosmos/Cosmos/MenuRings.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/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/UIKit.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/AVFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreMedia.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreAudio.swiftmodule
|
D
|
// PERMUTE_ARGS:
// REQUIRED_ARGS: -deps=${RESULTS_DIR}/compilable/rdeps7016.deps -Icompilable/extra-files
// POST_SCRIPT: compilable/extra-files/rdepsOutput.sh
// COMPILED_IMPORTS: extra-files/rdeps7016a.d extra-files/rdeps7016b.d
module rdeps7016;
import rdeps7016a;
void main()
{
f();
}
|
D
|
/**
* The iz implementation of the observer pattern.
*/
module iz.observer;
import
iz.types, iz.memory, iz.containers;
version(unittest) import std.stdio;
/**
* Subject (one to many) interface.
*/
interface Subject
{
/// determines if anObserver is suitable for this subject.
bool acceptObserver(Object anObserver);
/// an observer can be added. it can to be tested with acceptObserver.
void addObserver(Object anObserver);
/// an observer wants to be removed.
void removeObserver(Object anObserver);
/// sends all data the observers are monitoring.
void updateObservers();
}
/**
* CustomSubject handles a list of obsever.
* Params:
* OT = the observer type, either an interface or a class.
*/
class CustomSubject(OT): Subject
if (is(OT == interface) || is(OT == class))
{
protected
{
DynamicList!OT _observers;
}
public
{
///
this()
{
_observers = construct!(DynamicList!OT);
}
~this()
{
_observers.destruct;
}
/// see the Subject interface.
void updateObservers()
{
/*virtual: send all values*/
}
/// see the Subject interface.
bool acceptObserver(Object observer)
{
return (cast(OT) observer !is null);
}
/// see the Subject interface.
void addObserver(Object observer)
{
if (!acceptObserver(observer))
return;
auto obs = cast(OT) observer;
if (_observers.find(obs) != -1)
return;
_observers.add(obs);
}
/// Calls addObserver() foreach object passed as argument.
void addObservers(Objs...)(Objs objs)
{
foreach(obj; objs)
addObserver(obj);
}
/// see the Subject interface.
void removeObserver(Object observer)
{
if (auto obs = cast(OT) observer)
_observers.remove(obs);
}
/// list of observers
DynamicList!OT observers()
{
return _observers;
}
}
}
/**
* ObserverInterconnector is in charge for inter-connecting subjects with
* their observers, whatever their specializations are.
*
* With this class, an observer can connect itself to the right subject(s)
* without having to know it. In the same fashion, the subjects gets their
* client list automatically filled.
*/
class ObserverInterconnector
{
private
{
DynamicList!Object _observers;
DynamicList!Object _subjects;
ptrdiff_t fUpdateCount;
}
public
{
///
this()
{
_observers = construct!(DynamicList!Object);
_subjects = construct!(DynamicList!Object);
}
~this()
{
_observers.destruct;
_subjects.destruct;
}
/**
* Several entities will be added.
* This Avoids any superfluous update while adding.
* Every beginUpdate() must be followed by an endUpdate().
*/
void beginUpdate()
{
++fUpdateCount;
}
/**
* Several subjects or observers have been added.
* Decrements a counter and update the entities if it's equal to 0.
*/
void endUpdate()
{
--fUpdateCount;
if (fUpdateCount > 0) return;
updateAll;
}
/**
* Adds an observer to the entity list.
*/
void addObserver(Object observer)
{
if (_observers.find(observer) != -1) return;
beginUpdate;
_observers.add(observer);
endUpdate;
}
/**
* Adds a list of observer to the entity list.
* Optimized for bulk adding.
*/
void addObservers(Objs...)(Objs objs)
{
beginUpdate;
foreach(obj; objs) addObserver(obj);
endUpdate;
}
/**
* Removes an observer from the entity list.
*/
void removeObserver(Object observer)
{
beginUpdate;
_observers.remove(observer);
foreach(immutable i; 0 .. _subjects.count)
(cast(Subject) _subjects[i]).removeObserver(observer);
endUpdate;
}
/**
* Adds a subject to the entity list.
*/
void addSubject(Object subject)
{
if (_subjects.find(subject) != -1) return;
if( (cast(Subject) subject) is null) return;
beginUpdate;
_subjects.add(subject);
endUpdate;
}
/**
* Adds several subjects to the entity list.
* Optimized for bulk adding.
*/
void addSubjects(Subjs...)(Subjs subjs)
{
beginUpdate;
foreach(subj; subjs) addSubject(subj);
endUpdate;
}
/**
* Removes a subject from the entity list.
*/
void removeSubject(Object subject)
{
beginUpdate;
_subjects.remove(subject);
endUpdate;
}
/**
* Updates the connections between the entities stored in the global list.
*
* It has usually not be called manually.
* During the process, each subject previously added is
* visited by each observer previously added.
*
* The complexity of the operation is usually reduced if beginUpdate()
* and endUpdate() are used adequatly.
*/
void updateObservers()
{
fUpdateCount = 0;
foreach(immutable subjectIx; 0 .. _subjects.count)
{
auto subject = cast(Subject) _subjects[subjectIx];
foreach(immutable observerIx; 0 .. _observers.count)
subject.addObserver(_observers[observerIx]);
}
}
/// ditto
alias updateAll = updateObservers;
}
}
unittest
{
interface PropObserver(T)
{
void min(T aValue);
void max(T aValue);
void def(T aValue);
}
alias IntPropObserver = PropObserver!int;
class Foo: IntPropObserver
{
int _min, _max, _def;
void min(int aValue){_min = aValue;}
void max(int aValue){_max = aValue;}
void def(int aValue){_def = aValue;}
}
alias UintPropObserver = PropObserver!uint;
class Bar: UintPropObserver
{
uint _min, _max, _def;
void min(uint aValue){_min = aValue;}
void max(uint aValue){_max = aValue;}
void def(uint aValue){_def = aValue;}
}
class IntPropSubject : CustomSubject!IntPropObserver
{
int _min = int.min;
int _max = int.max;
int _def = int.init;
final override void updateObservers()
{
for(auto i = 0; i < _observers.count; i++)
(cast(IntPropObserver)_observers[i]).min(_min);
for(auto i = 0; i < _observers.count; i++)
(cast(IntPropObserver)_observers[i]).max(_max);
for(auto i = 0; i < _observers.count; i++)
(cast(IntPropObserver)_observers[i]).def(_def);
}
}
class UintPropSubject : CustomSubject!UintPropObserver
{
uint _min = uint.min;
uint _max = uint.max;
uint _def = uint.init;
final override void updateObservers()
{
for(auto i = 0; i < _observers.count; i++)
(cast(UintPropObserver)_observers[i]).min(_min);
for(auto i = 0; i < _observers.count; i++)
(cast(UintPropObserver)_observers[i]).max(_max);
for(auto i = 0; i < _observers.count; i++)
(cast(UintPropObserver)_observers[i]).def(_def);
}
}
auto nots1 = construct!Object;
auto nots2 = construct!Object;
auto inter = construct!ObserverInterconnector;
auto isubj = construct!IntPropSubject;
auto iobs1 = construct!Foo;
auto iobs2 = construct!Foo;
auto iobs3 = construct!Foo;
auto usubj = construct!UintPropSubject;
auto uobs1 = construct!Bar;
auto uobs2 = construct!Bar;
auto uobs3 = construct!Bar;
scope(exit)
{
destruct(inter, isubj, usubj);
destruct(iobs1, iobs2, iobs3);
destruct(uobs1, uobs2, uobs3);
destruct(nots1, nots2);
}
inter.beginUpdate;
// add valid entities
inter.addSubjects(isubj, usubj);
inter.addObservers(iobs1, iobs2, iobs3);
inter.addObservers(uobs1, uobs2, uobs3);
// add invalid entities
inter.addSubjects(nots1, nots2);
inter.addObservers(nots1, nots2);
// not added twice
inter.addSubjects(isubj, usubj);
inter.endUpdate;
// check the subject and observers count
assert(inter._subjects.count == 2);
assert(inter._observers.count == 8);
assert(isubj._observers.count == 3);
assert(usubj._observers.count == 3);
inter.beginUpdate;
inter.removeObserver(iobs1);
inter.endUpdate;
assert(inter._subjects.count == 2);
assert(inter._observers.count == 7);
assert(isubj._observers.count == 2);
assert(usubj._observers.count == 3);
// update subject
isubj._min = -127;
isubj._max = 128;
isubj.updateObservers;
// iobs1 has been removed
assert(iobs1._min != -127);
assert(iobs1._max != 128);
// check observers
assert(iobs2._min == -127);
assert(iobs2._max == 128);
assert(iobs3._min == -127);
assert(iobs3._max == 128);
// update subject
usubj._min = 2;
usubj._max = 256;
usubj.updateObservers;
// check observers
assert(uobs1._min == 2);
assert(uobs1._max == 256);
assert(uobs2._min == 2);
assert(uobs2._max == 256);
assert(uobs3._min == 2);
assert(uobs3._max == 256);
writeln( "ObserverInterconnector passed the tests");
}
/**
* interface for an observer based on an enum.
* Params:
* E = an enum.
* T = variadic type of the parameters an observer monitors.
*/
interface EnumBasedObserver(E, T...)
if (is(E == enum))
{
/**
* The method called by a subject.
* Params:
* notification = the E member allowing to distinguish the "call reason".
* t = the parameters the observer is interested in.
*/
void subjectNotification(E notification, T t);
}
/**
* CustomSubject handles a list of obsever.
* This version only accept an observer if it's an EnumBasedObserver.
* Params:
* E = an enum.
* T = the variadic list of parameter types used in the notification.
*/
class CustomSubject(E, T...) : Subject
if (is(E == enum))
{
protected
{
alias ObserverType = EnumBasedObserver!(E,T);
DynamicList!ObserverType _observers;
}
public
{
///
this()
{
_observers = construct!(DynamicList!ObserverType);
}
~this()
{
_observers.destruct;
}
/// see the Subject interface.
void updateObservers()
{
/*virtual: send all values*/
}
/// see the Subject interface.
bool acceptObserver(Object observer)
{
return (cast(ObserverType) observer !is null);
}
/// see the Subject interface.
void addObserver(Object observer)
{
auto obs = cast(ObserverType) observer;
if (!obs)
return;
if (_observers.find(obs) != -1)
return;
_observers.add(obs);
}
/// Calls addObserver() foreach object passed as argument.
void addObservers(Objs...)(Objs objs)
{
foreach(obj; objs)
addObserver(obj);
}
/// see the Subject interface.
void removeObserver(Object observer)
{
auto obs = cast(ObserverType) observer;
if (!obs)
return;
_observers.remove(obs);
}
///
DynamicList!ObserverType observers()
{
return _observers;
}
}
}
unittest
{
enum DocumentNotification{opening, closing, saving, changed}
class Document {}
class Highlighter {}
class DocSubject : CustomSubject!(DocumentNotification, Document, Highlighter)
{
void notify(DocumentNotification dn)
{
foreach(obs;_observers)
(cast(ObserverType) obs)
.subjectNotification(dn, null, null);
}
}
class DocObserver: EnumBasedObserver!(DocumentNotification, Document, Highlighter)
{
DocumentNotification lastNotification;
void subjectNotification(DocumentNotification notification, Document doc, Highlighter hl)
{
lastNotification = notification;
}
}
auto inter = construct!ObserverInterconnector;
auto subj = construct!DocSubject;
auto obs1 = construct!DocObserver;
auto obs2 = construct!DocObserver;
auto obs3 = construct!DocObserver;
scope(exit) destruct(inter, subj, obs1, obs2, obs3);
inter.addSubject(subj);
inter.addObservers(obs1, obs2, obs3);
inter.addObservers(obs1, obs2, obs3);
assert(inter._observers.count == 3);
assert(subj._observers.count == 3);
subj.notify(DocumentNotification.changed);
assert(obs1.lastNotification == DocumentNotification.changed);
assert(obs2.lastNotification == DocumentNotification.changed);
assert(obs3.lastNotification == DocumentNotification.changed);
subj.notify(DocumentNotification.opening);
assert(obs1.lastNotification == DocumentNotification.opening);
assert(obs2.lastNotification == DocumentNotification.opening);
assert(obs3.lastNotification == DocumentNotification.opening);
writeln( "EnumBasedObserver passed the tests");
}
|
D
|
INSTANCE Mod_7476_OUT_Arzt_REL (Npc_Default)
{
// ------ NSC ------
name = "Heiler";
guild = GIL_OUT;
id = 7476;
voice = 0;
flags = 0;
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 4);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_COWARD;
// ------ Equippte Waffen ------
EquipItem (self, itmw_1h_bau_mace);
// ------ Inventory ------
// Händler
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Psionic.", Face_N_OldBald_Jeremiah, BodyTex_N, ITAR_SMITH);
Mdl_SetModelFatness (self, 0);
Mdl_ApplyOverlayMds (self, "Humans_Tired.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 35);
// ------ TA anmelden ------
daily_routine = Rtn_Start_7476;
};
FUNC VOID Rtn_Start_7476 ()
{
TA_Sit_Chair (08,00,22,00,"REL_CITY_242");
TA_Sit_Chair (22,00,08,00,"REL_CITY_242");
};
FUNC VOID Rtn_Tot_7476 ()
{
TA_Sit_Chair (08,00,22,00,"TOT");
TA_Sit_Chair (22,00,08,00,"TOT");
};
|
D
|
/***********************************************************************\
* objbase.d *
* *
* Windows API header module *
* *
* Translated from MinGW Windows headers *
* *
* Placed into public domain *
\***********************************************************************/
module os.win32.objbase;
//pragma(lib, "ole32.lib");
pragma(lib, "rulada.lib");
import os.win32.cguid, os.win32.objidl, os.win32.unknwn, os.win32.wtypes;
private import os.win32.basetyps, os.win32.objfwd, os.win32.rpcdce, os.win32.winbase,
os.win32.windef;
// DAC: Not needed for D?
//MACRO #define LISet32(li, v) ((li).HighPart=(v)<0?-1:0, (li).LowPart=(v))
//MACRO #define ULISet32(li, v) ((li).HighPart=0, (li).LowPart=(v))
const CLSCTX_ALL = CLSCTX.CLSCTX_INPROC_SERVER|CLSCTX.CLSCTX_INPROC_HANDLER|CLSCTX.CLSCTX_LOCAL_SERVER;
const CLSCTX_INPROC = CLSCTX.CLSCTX_INPROC_SERVER|CLSCTX.CLSCTX_INPROC_HANDLER;
const CLSCTX_SERVER = CLSCTX.CLSCTX_INPROC_SERVER|CLSCTX.CLSCTX_LOCAL_SERVER|CLSCTX.CLSCTX_REMOTE_SERVER;
const MARSHALINTERFACE_MIN=500;
const CWCSTORAGENAME=32;
const STGM_DIRECT = 0;
const STGM_TRANSACTED = 0x10000L;
const STGM_SIMPLE = 0x8000000L;
const STGM_READ = 0;
const STGM_WRITE = 1;
const STGM_READWRITE = 2;
const STGM_SHARE_DENY_NONE = 0x40;
const STGM_SHARE_DENY_READ = 0x30;
const STGM_SHARE_DENY_WRITE = 0x20;
const STGM_SHARE_EXCLUSIVE = 0x10;
const STGM_PRIORITY = 0x40000L;
const STGM_DELETEONRELEASE = 0x4000000;
const STGM_NOSCRATCH = 0x100000;
const STGM_CREATE = 0x1000;
const STGM_CONVERT = 0x20000;
const STGM_NOSNAPSHOT = 0x200000;
const STGM_FAILIFTHERE = 0;
const ASYNC_MODE_COMPATIBILITY = 1;
const ASYNC_MODE_DEFAULT = 0;
const STGTY_REPEAT = 256;
const STG_TOEND = 0xFFFFFFFF;
const STG_LAYOUT_SEQUENTIAL = 0;
const STG_LAYOUT_INTERLEAVED = 1;
const COM_RIGHTS_EXECUTE = 1;
const COM_RIGHTS_SAFE_FOR_SCRIPTING = 2;
const STGOPTIONS_VERSION = 2;
enum STGFMT {
STGFMT_STORAGE = 0,
STGFMT_FILE = 3,
STGFMT_ANY = 4,
STGFMT_DOCFILE = 5
}
struct STGOPTIONS {
USHORT usVersion;
USHORT reserved;
ULONG ulSectorSize;
WCHAR* pwcsTemplateFile;
}
enum REGCLS {
REGCLS_SINGLEUSE = 0,
REGCLS_MULTIPLEUSE = 1,
REGCLS_MULTI_SEPARATE = 2
}
/*
BOOL IsEqualGUID(GUID rguid1, GUID rguid2) {
return rguid1 == rguid2;
}
*/
extern (Windows) BOOL IsEqualGUID(
REFGUID rguid1,
REFGUID rguid2
);
alias IsEqualGUID IsEqualIID;
alias IsEqualGUID IsEqualCLSID;
enum COINIT {
COINIT_APARTMENTTHREADED = 2,
COINIT_MULTITHREADED = 0,
COINIT_DISABLE_OLE1DDE = 4,
COINIT_SPEED_OVER_MEMORY = 8
}
enum STDMSHLFLAGS {
SMEXF_SERVER = 1,
SMEXF_HANDLER
}
extern(Windows) {
alias HRESULT function(REFCLSID, REFIID, PVOID*) LPFNGETCLASSOBJECT;
alias HRESULT function() LPFNCANUNLOADNOW;
DWORD CoBuildVersion();
HRESULT CoInitialize(PVOID);
HRESULT CoInitializeEx(LPVOID, DWORD);
void CoUninitialize();
HRESULT CoGetMalloc(DWORD, LPMALLOC*);
DWORD CoGetCurrentProcess();
HRESULT CoRegisterMallocSpy(LPMALLOCSPY);
HRESULT CoRevokeMallocSpy();
HRESULT CoCreateStandardMalloc(DWORD, IMalloc**);
//#ifdef DBG
ULONG DebugCoGetRpcFault();
void DebugCoSetRpcFault(ULONG);
//#endif
HRESULT CoGetClassObject(REFCLSID, DWORD, COSERVERINFO*, REFIID, PVOID*);
HRESULT CoRegisterClassObject(REFCLSID, LPUNKNOWN, DWORD, DWORD, PDWORD);
HRESULT CoRevokeClassObject(DWORD);
HRESULT CoGetMarshalSizeMax(ULONG*, REFIID, LPUNKNOWN, DWORD, PVOID, DWORD);
HRESULT CoMarshalInterface(LPSTREAM, REFIID, LPUNKNOWN, DWORD, PVOID, DWORD);
HRESULT CoUnmarshalInterface(LPSTREAM, REFIID, PVOID*);
HRESULT CoMarshalHresult(LPSTREAM, HRESULT);
HRESULT CoUnmarshalHresult(LPSTREAM, HRESULT*);
HRESULT CoReleaseMarshalData(LPSTREAM);
HRESULT CoDisconnectObject(LPUNKNOWN, DWORD);
HRESULT CoLockObjectExternal(LPUNKNOWN, BOOL, BOOL);
HRESULT CoGetStandardMarshal(REFIID, LPUNKNOWN, DWORD, PVOID, DWORD, LPMARSHAL*);
HRESULT CoGetStdMarshalEx(LPUNKNOWN, DWORD, LPUNKNOWN*);
BOOL CoIsHandlerConnected(LPUNKNOWN);
BOOL CoHasStrongExternalConnections(LPUNKNOWN);
HRESULT CoMarshalInterThreadInterfaceInStream(REFIID, LPUNKNOWN, LPSTREAM*);
HRESULT CoGetInterfaceAndReleaseStream(LPSTREAM, REFIID, PVOID*);
HRESULT CoCreateFreeThreadedMarshaler(LPUNKNOWN, LPUNKNOWN*);
HINSTANCE CoLoadLibrary(LPOLESTR, BOOL);
void CoFreeLibrary(HINSTANCE);
void CoFreeAllLibraries();
void CoFreeUnusedLibraries();
HRESULT CoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, PVOID*);
HRESULT CoCreateInstanceEx(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
HRESULT StringFromCLSID(REFCLSID, LPOLESTR*);
HRESULT CLSIDFromString(LPOLESTR, LPCLSID);
HRESULT StringFromIID(REFIID, LPOLESTR*);
HRESULT IIDFromString(LPOLESTR, LPIID);
BOOL CoIsOle1Class(REFCLSID);
HRESULT ProgIDFromCLSID(REFCLSID, LPOLESTR*);
HRESULT CLSIDFromProgID(LPCOLESTR, LPCLSID);
int StringFromGUID2(REFGUID, LPOLESTR, int);
HRESULT CoCreateGuid(GUID*);
BOOL CoFileTimeToDosDateTime(FILETIME*, LPWORD, LPWORD);
BOOL CoDosDateTimeToFileTime(WORD, WORD, FILETIME*);
HRESULT CoFileTimeNow(FILETIME*);
HRESULT CoRegisterMessageFilter(LPMESSAGEFILTER, LPMESSAGEFILTER*);
HRESULT CoGetTreatAsClass(REFCLSID, LPCLSID);
HRESULT CoTreatAsClass(REFCLSID, REFCLSID);
HRESULT DllGetClassObject(REFCLSID, REFIID, PVOID*);
HRESULT DllCanUnloadNow();
PVOID CoTaskMemAlloc(ULONG);
PVOID CoTaskMemRealloc(PVOID, ULONG);
void CoTaskMemFree(PVOID);
HRESULT CreateDataAdviseHolder(LPDATAADVISEHOLDER*);
HRESULT CreateDataCache(LPUNKNOWN, REFCLSID, REFIID, PVOID*);
HRESULT StgCreateDocfile(OLECHAR*, DWORD, DWORD, IStorage**);
HRESULT StgCreateDocfileOnILockBytes(ILockBytes*, DWORD, DWORD, IStorage**);
HRESULT StgOpenStorage(OLECHAR*, IStorage, DWORD, SNB, DWORD, IStorage*);
HRESULT StgOpenStorageOnILockBytes(ILockBytes*, IStorage*, DWORD, SNB, DWORD, IStorage**);
HRESULT StgIsStorageFile(OLECHAR*);
HRESULT StgIsStorageILockBytes(ILockBytes*);
HRESULT StgSetTimes(OLECHAR *, FILETIME *, FILETIME *, FILETIME *);
HRESULT StgCreateStorageEx(WCHAR*, DWORD, DWORD, DWORD, STGOPTIONS*, void*, REFIID, void**);
HRESULT StgOpenStorageEx(WCHAR*, DWORD, DWORD, DWORD, STGOPTIONS*, void*, REFIID, void**);
HRESULT BindMoniker(LPMONIKER, DWORD, REFIID, PVOID*);
HRESULT CoGetObject(LPCWSTR, BIND_OPTS*, REFIID, void**);
HRESULT MkParseDisplayName(LPBC, LPCOLESTR, ULONG*, LPMONIKER*);
HRESULT MonikerRelativePathTo(LPMONIKER, LPMONIKER, LPMONIKER*, BOOL);
HRESULT MonikerCommonPrefixWith(LPMONIKER, LPMONIKER, LPMONIKER*);
HRESULT CreateBindCtx(DWORD, LPBC*);
HRESULT CreateGenericComposite(LPMONIKER, LPMONIKER, LPMONIKER*);
HRESULT GetClassFile (LPCOLESTR, CLSID*);
HRESULT CreateFileMoniker(LPCOLESTR, LPMONIKER*);
HRESULT CreateItemMoniker(LPCOLESTR, LPCOLESTR, LPMONIKER*);
HRESULT CreateAntiMoniker(LPMONIKER*);
HRESULT CreatePointerMoniker(LPUNKNOWN, LPMONIKER*);
HRESULT GetRunningObjectTable(DWORD, LPRUNNINGOBJECTTABLE*);
HRESULT CoInitializeSecurity(PSECURITY_DESCRIPTOR, LONG, SOLE_AUTHENTICATION_SERVICE*, void*, DWORD, DWORD, void*, DWORD, void*);
HRESULT CoGetCallContext(REFIID, void**);
HRESULT CoQueryProxyBlanket(IUnknown*, DWORD*, DWORD*, OLECHAR**, DWORD*, DWORD*, RPC_AUTH_IDENTITY_HANDLE*, DWORD*);
HRESULT CoSetProxyBlanket(IUnknown*, DWORD, DWORD, OLECHAR*, DWORD, DWORD, RPC_AUTH_IDENTITY_HANDLE, DWORD);
HRESULT CoCopyProxy(IUnknown*, IUnknown**);
HRESULT CoQueryClientBlanket(DWORD*, DWORD*, OLECHAR**, DWORD*, DWORD*, RPC_AUTHZ_HANDLE*, DWORD*);
HRESULT CoImpersonateClient();
HRESULT CoRevertToSelf();
HRESULT CoQueryAuthenticationServices(DWORD*, SOLE_AUTHENTICATION_SERVICE**);
HRESULT CoSwitchCallContext(IUnknown*, IUnknown**);
HRESULT CoGetInstanceFromFile(COSERVERINFO*, CLSID*, IUnknown*, DWORD, DWORD, OLECHAR*, DWORD, MULTI_QI*);
HRESULT CoGetInstanceFromIStorage(COSERVERINFO*, CLSID*, IUnknown*, DWORD, IStorage*, DWORD, MULTI_QI*);
ULONG CoAddRefServerProcess();
ULONG CoReleaseServerProcess();
HRESULT CoResumeClassObjects();
HRESULT CoSuspendClassObjects();
HRESULT CoGetPSClsid(REFIID, CLSID*);
HRESULT CoRegisterPSClsid(REFIID, REFCLSID);
}
|
D
|
version https://git-lfs.github.com/spec/v1
oid sha256:76661473aaf4f2b62a4c72970553e6d685c5f6144a5487028a25a45b0b25ef84
size 485
|
D
|
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.build/Console/Console+Options.swift.o : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/String+ANSI.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Utilities/Bool+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/Terminal+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Runnable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Style/Console+ConsoleStyle.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Style/ConsoleStyle.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Value.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Ask.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/ConsoleColor+Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Ephemeral.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/ConsoleProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/FileHandle+Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/Pipe+Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Utilities/String+Trim.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Confirm.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Option.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Group.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Bar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Loading/Console+LoadingBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Loading/LoadingBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Progress/Console+ProgressBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Progress/ProgressBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Clear/ConsoleClear.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Center.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Color/ConsoleColor.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/ConsoleError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Options.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Argument.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Command+Print.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Print.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.build/Console+Options~partial.swiftmodule : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/String+ANSI.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Utilities/Bool+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/Terminal+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Runnable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Style/Console+ConsoleStyle.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Style/ConsoleStyle.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Value.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Ask.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/ConsoleColor+Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Ephemeral.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/ConsoleProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/FileHandle+Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/Pipe+Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Utilities/String+Trim.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Confirm.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Option.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Group.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Bar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Loading/Console+LoadingBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Loading/LoadingBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Progress/Console+ProgressBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Progress/ProgressBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Clear/ConsoleClear.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Center.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Color/ConsoleColor.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/ConsoleError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Options.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Argument.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Command+Print.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Print.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
/home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Console.build/Console+Options~partial.swiftdoc : /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/String+ANSI.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Utilities/Bool+Polymorphic.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/Terminal+Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Command.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Runnable.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Style/Console+ConsoleStyle.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Style/ConsoleStyle.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Value.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Ask.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/ConsoleColor+Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Terminal/Terminal.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Ephemeral.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/ConsoleProtocol.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/FileHandle+Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/Pipe+Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Stream/Stream.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Utilities/String+Trim.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Confirm.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Option.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Run.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Group.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Bar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Loading/Console+LoadingBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Loading/LoadingBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Progress/Console+ProgressBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Bar/Progress/ProgressBar.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Clear/ConsoleClear.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Center.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Color/ConsoleColor.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/ConsoleError.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Options.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Argument.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Command/Command+Print.swift /home/albertfega/Desktop/LaSalleChat/.build/checkouts/console.git-5126077550814951831/Sources/Console/Console/Console+Print.swift /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/libc.swiftmodule /usr/lib/swift/linux/x86_64/Glibc.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Core.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Debugging.swiftmodule /usr/lib/swift/linux/x86_64/Dispatch.swiftmodule /usr/lib/swift/linux/x86_64/Foundation.swiftmodule /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/Bits.swiftmodule /usr/lib/swift/linux/x86_64/Swift.swiftmodule /usr/lib/swift/linux/x86_64/SwiftOnoneSupport.swiftmodule /usr/lib/swift/linux/x86_64/glibc.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CHTTP.build/module.modulemap /home/albertfega/Desktop/LaSalleChat/.build/x86_64-unknown-linux/debug/CSQLite.build/module.modulemap
|
D
|
// Written in the D programming language.
/**
JavaScript Object Notation
Synopsis:
----
//parse a file or string of json into a usable structure
string s = "{ \"language\": \"D\", \"rating\": 3.14, \"code\": \"42\" }";
JSONValue j = parseJSON(s);
writeln("Language: ", j["language"].str(),
" Rating: ", j["rating"].floating()
);
// j and j["language"] return JSONValue,
// j["language"].str returns a string
//check a type
long x;
if (const(JSONValue)* code = "code" in j)
{
if (code.type() == JSON_TYPE.INTEGER)
x = code.integer;
else
x = to!int(code.str);
}
// create a json struct
JSONValue jj = [ "language": "D" ];
// rating doesnt exist yet, so use .object to assign
jj.object["rating"] = JSONValue(3.14);
// create an array to assign to list
jj.object["list"] = JSONValue( ["a", "b", "c"] );
// list already exists, so .object optional
jj["list"].array ~= JSONValue("D");
s = j.toString();
writeln(s);
----
Copyright: Copyright Jeremie Pelletier 2008 - 2009.
License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Jeremie Pelletier, David Herberth
References: $(LINK http://json.org/)
Source: $(PHOBOSSRC std/_json.d)
*/
/*
Copyright Jeremie Pelletier 2008 - 2009.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
module std.json;
import std.conv;
import std.range.primitives;
import std.array;
import std.traits;
/**
String literals used to represent special float values within JSON strings.
*/
enum JSONFloatLiteral : string
{
nan = "NaN", /// string representation of floating-point NaN
inf = "Infinite", /// string representation of floating-point Infinity
negativeInf = "-Infinite", /// string representation of floating-point negative Infinity
}
/**
Flags that control how json is encoded and parsed.
*/
enum JSONOptions
{
none, /// standard parsing
specialFloatLiterals = 0x1, /// encode NaN and Inf float values as strings
escapeNonAsciiChars = 0x2 /// encode non ascii characters with an unicode escape sequence
}
/**
JSON type enumeration
*/
enum JSON_TYPE : byte
{
/// Indicates the type of a $(D JSONValue).
NULL,
STRING, /// ditto
INTEGER, /// ditto
UINTEGER,/// ditto
FLOAT, /// ditto
OBJECT, /// ditto
ARRAY, /// ditto
TRUE, /// ditto
FALSE /// ditto
}
/**
JSON value node
*/
struct JSONValue
{
import std.exception : enforceEx, enforce;
union Store
{
string str;
long integer;
ulong uinteger;
double floating;
JSONValue[string] object;
JSONValue[] array;
}
private Store store;
private JSON_TYPE type_tag;
/**
Returns the JSON_TYPE of the value stored in this structure.
*/
@property JSON_TYPE type() const pure nothrow @safe @nogc
{
return type_tag;
}
///
unittest
{
string s = "{ \"language\": \"D\" }";
JSONValue j = parseJSON(s);
assert(j.type == JSON_TYPE.OBJECT);
assert(j["language"].type == JSON_TYPE.STRING);
}
// Explicitly undocumented. It will be removed in June 2016. @@@DEPRECATED_2016-06@@@
deprecated("Please assign the value with the adequate type to JSONValue directly.")
@property JSON_TYPE type(JSON_TYPE newType) @safe
{
if (type_tag != newType
&& ((type_tag != JSON_TYPE.INTEGER && type_tag != JSON_TYPE.UINTEGER)
|| (newType != JSON_TYPE.INTEGER && newType != JSON_TYPE.UINTEGER)))
{
final switch (newType)
{
case JSON_TYPE.STRING:
str = null;
break;
case JSON_TYPE.INTEGER:
integer = long.init;
break;
case JSON_TYPE.UINTEGER:
uinteger = ulong.init;
break;
case JSON_TYPE.FLOAT:
floating = double.init;
break;
case JSON_TYPE.OBJECT:
object = null;
break;
case JSON_TYPE.ARRAY:
array = null;
break;
case JSON_TYPE.TRUE:
case JSON_TYPE.FALSE:
case JSON_TYPE.NULL:
break;
}
}
return type_tag = newType;
}
/// Value getter/setter for $(D JSON_TYPE.STRING).
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.STRING).
@property string str() const pure @trusted
{
enforce!JSONException(type == JSON_TYPE.STRING,
"JSONValue is not a string");
return store.str;
}
/// ditto
@property string str(string v) pure nothrow @nogc @safe
{
assign(v);
return v;
}
///
unittest
{
JSONValue j = [ "language": "D" ];
// get value
assert(j["language"].str == "D");
// change existing key to new string
j["language"].str = "Perl";
assert(j["language"].str == "Perl");
}
/// Value getter/setter for $(D JSON_TYPE.INTEGER).
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.INTEGER).
@property inout(long) integer() inout pure @safe
{
enforce!JSONException(type == JSON_TYPE.INTEGER,
"JSONValue is not an integer");
return store.integer;
}
/// ditto
@property long integer(long v) pure nothrow @safe @nogc
{
assign(v);
return store.integer;
}
/// Value getter/setter for $(D JSON_TYPE.UINTEGER).
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.UINTEGER).
@property inout(ulong) uinteger() inout pure @safe
{
enforce!JSONException(type == JSON_TYPE.UINTEGER,
"JSONValue is not an unsigned integer");
return store.uinteger;
}
/// ditto
@property ulong uinteger(ulong v) pure nothrow @safe @nogc
{
assign(v);
return store.uinteger;
}
/// Value getter/setter for $(D JSON_TYPE.FLOAT).
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.FLOAT).
@property inout(double) floating() inout pure @safe
{
enforce!JSONException(type == JSON_TYPE.FLOAT,
"JSONValue is not a floating type");
return store.floating;
}
/// ditto
@property double floating(double v) pure nothrow @safe @nogc
{
assign(v);
return store.floating;
}
/// Value getter/setter for $(D JSON_TYPE.OBJECT).
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.OBJECT).
/* Note: this is @system because of the following pattern:
---
auto a = &(json.object());
json.uinteger = 0; // overwrite AA pointer
(*a)["hello"] = "world"; // segmentation fault
---
*/
@property ref inout(JSONValue[string]) object() inout pure @system
{
enforce!JSONException(type == JSON_TYPE.OBJECT,
"JSONValue is not an object");
return store.object;
}
/// ditto
@property JSONValue[string] object(JSONValue[string] v) pure nothrow @nogc @safe
{
assign(v);
return v;
}
/// Value getter for $(D JSON_TYPE.OBJECT).
/// Unlike $(D object), this retrieves the object by value and can be used in @safe code.
///
/// A caveat is that, if the returned value is null, modifications will not be visible:
/// ---
/// JSONValue json;
/// json.object = null;
/// json.objectNoRef["hello"] = JSONValue("world");
/// assert("hello" !in json.object);
/// ---
///
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.OBJECT).
@property inout(JSONValue[string]) objectNoRef() inout pure @trusted
{
enforce!JSONException(type == JSON_TYPE.OBJECT,
"JSONValue is not an object");
return store.object;
}
/// Value getter/setter for $(D JSON_TYPE.ARRAY).
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.ARRAY).
/* Note: this is @system because of the following pattern:
---
auto a = &(json.array());
json.uinteger = 0; // overwrite array pointer
(*a)[0] = "world"; // segmentation fault
---
*/
@property ref inout(JSONValue[]) array() inout pure @system
{
enforce!JSONException(type == JSON_TYPE.ARRAY,
"JSONValue is not an array");
return store.array;
}
/// ditto
@property JSONValue[] array(JSONValue[] v) pure nothrow @nogc @safe
{
assign(v);
return v;
}
/// Value getter for $(D JSON_TYPE.ARRAY).
/// Unlike $(D array), this retrieves the array by value and can be used in @safe code.
///
/// A caveat is that, if you append to the returned array, the new values aren't visible in the
/// JSONValue:
/// ---
/// JSONValue json;
/// json.array = [JSONValue("hello")];
/// json.arrayNoRef ~= JSONValue("world");
/// assert(json.array.length == 1);
/// ---
///
/// Throws: $(D JSONException) for read access if $(D type) is not
/// $(D JSON_TYPE.ARRAY).
@property inout(JSONValue[]) arrayNoRef() inout pure @trusted
{
enforce!JSONException(type == JSON_TYPE.ARRAY,
"JSONValue is not an object");
return store.array;
}
/// Test whether the type is $(D JSON_TYPE.NULL)
@property bool isNull() const pure nothrow @safe @nogc
{
return type == JSON_TYPE.NULL;
}
private void assign(T)(T arg) @safe
{
static if(is(T : typeof(null)))
{
type_tag = JSON_TYPE.NULL;
}
else static if(is(T : string))
{
type_tag = JSON_TYPE.STRING;
store.str = arg;
}
else static if(is(T : char[]))
{
type_tag = JSON_TYPE.STRING;
store.str = arg.idup;
}
else static if(is(T : bool))
{
type_tag = arg ? JSON_TYPE.TRUE : JSON_TYPE.FALSE;
}
else static if(is(T : ulong) && isUnsigned!T)
{
type_tag = JSON_TYPE.UINTEGER;
store.uinteger = arg;
}
else static if(is(T : long))
{
type_tag = JSON_TYPE.INTEGER;
store.integer = arg;
}
else static if(isFloatingPoint!T)
{
type_tag = JSON_TYPE.FLOAT;
store.floating = arg;
}
else static if(is(T : Value[Key], Key, Value))
{
static assert(is(Key : string), "AA key must be string");
type_tag = JSON_TYPE.OBJECT;
static if(is(Value : JSONValue)) {
store.object = arg;
}
else
{
JSONValue[string] aa;
foreach(key, value; arg)
aa[key] = JSONValue(value);
store.object = aa;
}
}
else static if(isArray!T)
{
type_tag = JSON_TYPE.ARRAY;
static if(is(ElementEncodingType!T : JSONValue))
{
store.array = arg;
}
else
{
JSONValue[] new_arg = new JSONValue[arg.length];
foreach(i, e; arg)
new_arg[i] = JSONValue(e);
store.array = new_arg;
}
}
else static if(is(T : JSONValue))
{
type_tag = arg.type;
store = arg.store;
}
else
{
static assert(false, text(`unable to convert type "`, T.stringof, `" to json`));
}
}
private void assignRef(T)(ref T arg) if(isStaticArray!T)
{
type_tag = JSON_TYPE.ARRAY;
static if(is(ElementEncodingType!T : JSONValue))
{
store.array = arg;
}
else
{
JSONValue[] new_arg = new JSONValue[arg.length];
foreach(i, e; arg)
new_arg[i] = JSONValue(e);
store.array = new_arg;
}
}
/**
* Constructor for $(D JSONValue). If $(D arg) is a $(D JSONValue)
* its value and type will be copied to the new $(D JSONValue).
* Note that this is a shallow copy: if type is $(D JSON_TYPE.OBJECT)
* or $(D JSON_TYPE.ARRAY) then only the reference to the data will
* be copied.
* Otherwise, $(D arg) must be implicitly convertible to one of the
* following types: $(D typeof(null)), $(D string), $(D ulong),
* $(D long), $(D double), an associative array $(D V[K]) for any $(D V)
* and $(D K) i.e. a JSON object, any array or $(D bool). The type will
* be set accordingly.
*/
this(T)(T arg) if(!isStaticArray!T)
{
assign(arg);
}
/// Ditto
this(T)(ref T arg) if(isStaticArray!T)
{
assignRef(arg);
}
/// Ditto
this(T : JSONValue)(inout T arg) inout
{
store = arg.store;
type_tag = arg.type;
}
///
unittest
{
JSONValue j = JSONValue( "a string" );
j = JSONValue(42);
j = JSONValue( [1, 2, 3] );
assert(j.type == JSON_TYPE.ARRAY);
j = JSONValue( ["language": "D"] );
assert(j.type == JSON_TYPE.OBJECT);
}
void opAssign(T)(T arg) if(!isStaticArray!T && !is(T : JSONValue))
{
assign(arg);
}
void opAssign(T)(ref T arg) if(isStaticArray!T)
{
assignRef(arg);
}
/// Array syntax for json arrays.
/// Throws: $(D JSONException) if $(D type) is not $(D JSON_TYPE.ARRAY).
ref inout(JSONValue) opIndex(size_t i) inout pure @safe
{
auto a = this.arrayNoRef;
enforceEx!JSONException(i < a.length,
"JSONValue array index is out of range");
return a[i];
}
///
unittest
{
JSONValue j = JSONValue( [42, 43, 44] );
assert( j[0].integer == 42 );
assert( j[1].integer == 43 );
}
/// Hash syntax for json objects.
/// Throws: $(D JSONException) if $(D type) is not $(D JSON_TYPE.OBJECT).
ref inout(JSONValue) opIndex(string k) inout pure @safe
{
auto o = this.objectNoRef;
return *enforce!JSONException(k in o,
"Key not found: " ~ k);
}
///
unittest
{
JSONValue j = JSONValue( ["language": "D"] );
assert( j["language"].str == "D" );
}
/// Operator sets $(D value) for element of JSON object by $(D key).
///
/// If JSON value is null, then operator initializes it with object and then
/// sets $(D value) for it.
///
/// Throws: $(D JSONException) if $(D type) is not $(D JSON_TYPE.OBJECT)
/// or $(D JSON_TYPE.NULL).
void opIndexAssign(T)(auto ref T value, string key) pure
{
enforceEx!JSONException(type == JSON_TYPE.OBJECT || type == JSON_TYPE.NULL,
"JSONValue must be object or null");
JSONValue[string] aa = null;
if (type == JSON_TYPE.OBJECT)
{
aa = this.objectNoRef;
}
aa[key] = value;
this.object = aa;
}
///
unittest
{
JSONValue j = JSONValue( ["language": "D"] );
j["language"].str = "Perl";
assert( j["language"].str == "Perl" );
}
void opIndexAssign(T)(T arg, size_t i) pure
{
auto a = this.arrayNoRef;
enforceEx!JSONException(i < a.length,
"JSONValue array index is out of range");
a[i] = arg;
this.array = a;
}
///
unittest
{
JSONValue j = JSONValue( ["Perl", "C"] );
j[1].str = "D";
assert( j[1].str == "D" );
}
JSONValue opBinary(string op : "~", T)(T arg) @safe
{
auto a = this.arrayNoRef;
static if(isArray!T)
{
return JSONValue(a ~ JSONValue(arg).arrayNoRef);
}
else static if(is(T : JSONValue))
{
return JSONValue(a ~ arg.arrayNoRef);
}
else
{
static assert(false, "argument is not an array or a JSONValue array");
}
}
void opOpAssign(string op : "~", T)(T arg) @safe
{
auto a = this.arrayNoRef;
static if(isArray!T)
{
a ~= JSONValue(arg).arrayNoRef;
}
else static if(is(T : JSONValue))
{
a ~= arg.arrayNoRef;
}
else
{
static assert(false, "argument is not an array or a JSONValue array");
}
this.array = a;
}
/**
* Support for the $(D in) operator.
*
* Tests wether a key can be found in an object.
*
* Returns:
* when found, the $(D const(JSONValue)*) that matches to the key,
* otherwise $(D null).
*
* Throws: $(D JSONException) if the right hand side argument $(D JSON_TYPE)
* is not $(D OBJECT).
*/
auto opBinaryRight(string op : "in")(string k) const @safe
{
return k in this.objectNoRef;
}
///
unittest
{
JSONValue j = [ "language": "D", "author": "walter" ];
string a = ("author" in j).str;
}
bool opEquals(const JSONValue rhs) const @nogc nothrow pure @safe
{
return opEquals(rhs);
}
bool opEquals(ref const JSONValue rhs) const @nogc nothrow pure @trusted
{
// Default doesn't work well since store is a union. Compare only
// what should be in store.
// This is @trusted to remain nogc, nothrow, fast, and usable from @safe code.
if (type_tag != rhs.type_tag) return false;
final switch (type_tag)
{
case JSON_TYPE.STRING:
return store.str == rhs.store.str;
case JSON_TYPE.INTEGER:
return store.integer == rhs.store.integer;
case JSON_TYPE.UINTEGER:
return store.uinteger == rhs.store.uinteger;
case JSON_TYPE.FLOAT:
return store.floating == rhs.store.floating;
case JSON_TYPE.OBJECT:
return store.object == rhs.store.object;
case JSON_TYPE.ARRAY:
return store.array == rhs.store.array;
case JSON_TYPE.TRUE:
case JSON_TYPE.FALSE:
case JSON_TYPE.NULL:
return true;
}
}
/// Implements the foreach $(D opApply) interface for json arrays.
int opApply(int delegate(size_t index, ref JSONValue) dg) @system
{
int result;
foreach(size_t index, ref value; array)
{
result = dg(index, value);
if(result)
break;
}
return result;
}
/// Implements the foreach $(D opApply) interface for json objects.
int opApply(int delegate(string key, ref JSONValue) dg) @system
{
enforce!JSONException(type == JSON_TYPE.OBJECT,
"JSONValue is not an object");
int result;
foreach(string key, ref value; object)
{
result = dg(key, value);
if(result)
break;
}
return result;
}
/// Implicitly calls $(D toJSON) on this JSONValue.
///
/// $(I options) can be used to tweak the conversion behavior.
string toString(in JSONOptions options = JSONOptions.none) const @safe
{
return toJSON(this, false, options);
}
/// Implicitly calls $(D toJSON) on this JSONValue, like $(D toString), but
/// also passes $(I true) as $(I pretty) argument.
///
/// $(I options) can be used to tweak the conversion behavior
string toPrettyString(in JSONOptions options = JSONOptions.none) const @safe
{
return toJSON(this, true, options);
}
}
/**
Parses a serialized string and returns a tree of JSON values.
Throws: $(XREF json,JSONException) if the depth exceeds the max depth.
Params:
json = json-formatted string to parse
maxDepth = maximum depth of nesting allowed, -1 disables depth checking
options = enable decoding string representations of NaN/Inf as float values
*/
JSONValue parseJSON(T)(T json, int maxDepth = -1, JSONOptions options = JSONOptions.none)
if(isInputRange!T)
{
import std.ascii : isWhite, isDigit, isHexDigit, toUpper, toLower;
import std.utf : toUTF8;
JSONValue root;
root.type_tag = JSON_TYPE.NULL;
if(json.empty) return root;
int depth = -1;
dchar next = 0;
int line = 1, pos = 0;
void error(string msg)
{
throw new JSONException(msg, line, pos);
}
dchar popChar()
{
if (json.empty) error("Unexpected end of data.");
dchar c = json.front;
json.popFront();
if(c == '\n')
{
line++;
pos = 0;
}
else
{
pos++;
}
return c;
}
dchar peekChar()
{
if(!next)
{
if(json.empty) return '\0';
next = popChar();
}
return next;
}
void skipWhitespace()
{
while(isWhite(peekChar())) next = 0;
}
dchar getChar(bool SkipWhitespace = false)()
{
static if(SkipWhitespace) skipWhitespace();
dchar c;
if(next)
{
c = next;
next = 0;
}
else
c = popChar();
return c;
}
void checkChar(bool SkipWhitespace = true, bool CaseSensitive = true)(char c)
{
static if(SkipWhitespace) skipWhitespace();
auto c2 = getChar();
static if(!CaseSensitive) c2 = toLower(c2);
if(c2 != c) error(text("Found '", c2, "' when expecting '", c, "'."));
}
bool testChar(bool SkipWhitespace = true, bool CaseSensitive = true)(char c)
{
static if(SkipWhitespace) skipWhitespace();
auto c2 = peekChar();
static if (!CaseSensitive) c2 = toLower(c2);
if(c2 != c) return false;
getChar();
return true;
}
string parseString()
{
auto str = appender!string();
Next:
switch(peekChar())
{
case '"':
getChar();
break;
case '\\':
getChar();
auto c = getChar();
switch(c)
{
case '"': str.put('"'); break;
case '\\': str.put('\\'); break;
case '/': str.put('/'); break;
case 'b': str.put('\b'); break;
case 'f': str.put('\f'); break;
case 'n': str.put('\n'); break;
case 'r': str.put('\r'); break;
case 't': str.put('\t'); break;
case 'u':
dchar val = 0;
foreach_reverse(i; 0 .. 4)
{
auto hex = toUpper(getChar());
if(!isHexDigit(hex)) error("Expecting hex character");
val += (isDigit(hex) ? hex - '0' : hex - ('A' - 10)) << (4 * i);
}
char[4] buf;
str.put(toUTF8(buf, val));
break;
default:
error(text("Invalid escape sequence '\\", c, "'."));
}
goto Next;
default:
auto c = getChar();
appendJSONChar(str, c, options, &error);
goto Next;
}
return str.data.length ? str.data : "";
}
bool tryGetSpecialFloat(string str, out double val) {
switch(str) {
case JSONFloatLiteral.nan:
val = double.nan;
return true;
case JSONFloatLiteral.inf:
val = double.infinity;
return true;
case JSONFloatLiteral.negativeInf:
val = -double.infinity;
return true;
default:
return false;
}
}
void parseValue(ref JSONValue value)
{
depth++;
if(maxDepth != -1 && depth > maxDepth) error("Nesting too deep.");
auto c = getChar!true();
switch(c)
{
case '{':
if(testChar('}'))
{
value.object = null;
break;
}
JSONValue[string] obj;
do
{
checkChar('"');
string name = parseString();
checkChar(':');
JSONValue member;
parseValue(member);
obj[name] = member;
}
while(testChar(','));
value.object = obj;
checkChar('}');
break;
case '[':
if(testChar(']'))
{
value.type_tag = JSON_TYPE.ARRAY;
break;
}
JSONValue[] arr;
do
{
JSONValue element;
parseValue(element);
arr ~= element;
}
while(testChar(','));
checkChar(']');
value.array = arr;
break;
case '"':
auto str = parseString();
// if special float parsing is enabled, check if string represents NaN/Inf
if ((options & JSONOptions.specialFloatLiterals) &&
tryGetSpecialFloat(str, value.store.floating))
{
// found a special float, its value was placed in value.store.floating
value.type_tag = JSON_TYPE.FLOAT;
break;
}
value.type_tag = JSON_TYPE.STRING;
value.store.str = str;
break;
case '0': .. case '9':
case '-':
auto number = appender!string();
bool isFloat, isNegative;
void readInteger()
{
if(!isDigit(c)) error("Digit expected");
Next: number.put(c);
if(isDigit(peekChar()))
{
c = getChar();
goto Next;
}
}
if(c == '-')
{
number.put('-');
c = getChar();
isNegative = true;
}
readInteger();
if(testChar('.'))
{
isFloat = true;
number.put('.');
c = getChar();
readInteger();
}
if(testChar!(false, false)('e'))
{
isFloat = true;
number.put('e');
if(testChar('+')) number.put('+');
else if(testChar('-')) number.put('-');
c = getChar();
readInteger();
}
string data = number.data;
if(isFloat)
{
value.type_tag = JSON_TYPE.FLOAT;
value.store.floating = parse!double(data);
}
else
{
if (isNegative)
value.store.integer = parse!long(data);
else
value.store.uinteger = parse!ulong(data);
value.type_tag = !isNegative && value.store.uinteger & (1UL << 63) ? JSON_TYPE.UINTEGER : JSON_TYPE.INTEGER;
}
break;
case 't':
case 'T':
value.type_tag = JSON_TYPE.TRUE;
checkChar!(false, false)('r');
checkChar!(false, false)('u');
checkChar!(false, false)('e');
break;
case 'f':
case 'F':
value.type_tag = JSON_TYPE.FALSE;
checkChar!(false, false)('a');
checkChar!(false, false)('l');
checkChar!(false, false)('s');
checkChar!(false, false)('e');
break;
case 'n':
case 'N':
value.type_tag = JSON_TYPE.NULL;
checkChar!(false, false)('u');
checkChar!(false, false)('l');
checkChar!(false, false)('l');
break;
default:
error(text("Unexpected character '", c, "'."));
}
depth--;
}
parseValue(root);
return root;
}
unittest
{
enum issue15742objectOfObject = `{ "key1": { "key2": 1 }}`;
static assert(parseJSON(issue15742objectOfObject).type == JSON_TYPE.OBJECT);
enum issue15742arrayOfArray = `[[1]]`;
static assert(parseJSON(issue15742arrayOfArray).type == JSON_TYPE.ARRAY);
}
@safe unittest
{
// Ensure we can parse and use JSON from @safe code
auto a = `{ "key1": { "key2": 1 }}`.parseJSON;
assert(a["key1"]["key2"].integer == 1);
assert(a.toString == `{"key1":{"key2":1}}`);
}
unittest
{
// Ensure we can parse JSON from a @system range.
struct Range
{
string s;
size_t index;
@system
{
bool empty() { return index >= s.length; }
void popFront() { index++; }
char front() { return s[index]; }
}
}
auto s = Range(`{ "key1": { "key2": 1 }}`);
auto json = parseJSON(s);
assert(json["key1"]["key2"].integer == 1);
}
/**
Parses a serialized string and returns a tree of JSON values.
Throws: $(XREF json,JSONException) if the depth exceeds the max depth.
Params:
json = json-formatted string to parse
options = enable decoding string representations of NaN/Inf as float values
*/
JSONValue parseJSON(T)(T json, JSONOptions options)
if(isInputRange!T)
{
return parseJSON!T(json, -1, options);
}
deprecated(
"Please use the overload that takes a ref JSONValue rather than a pointer. This overload will "
~ "be removed in November 2017.")
string toJSON(in JSONValue* root, in bool pretty = false, in JSONOptions options = JSONOptions.none) @safe
{
return toJSON(*root, pretty, options);
}
/**
Takes a tree of JSON values and returns the serialized string.
Any Object types will be serialized in a key-sorted order.
If $(D pretty) is false no whitespaces are generated.
If $(D pretty) is true serialized string is formatted to be human-readable.
Set the $(specialFloatLiterals) flag is set in $(D options) to encode NaN/Infinity as strings.
*/
string toJSON(const ref JSONValue root, in bool pretty = false, in JSONOptions options = JSONOptions.none) @safe
{
auto json = appender!string();
void toString(string str) @safe
{
json.put('"');
foreach (dchar c; str)
{
switch(c)
{
case '"': json.put("\\\""); break;
case '\\': json.put("\\\\"); break;
case '/': json.put("\\/"); break;
case '\b': json.put("\\b"); break;
case '\f': json.put("\\f"); break;
case '\n': json.put("\\n"); break;
case '\r': json.put("\\r"); break;
case '\t': json.put("\\t"); break;
default:
appendJSONChar(json, c, options,
(msg) { throw new JSONException(msg); });
}
}
json.put('"');
}
void toValue(ref in JSONValue value, ulong indentLevel) @safe
{
void putTabs(ulong additionalIndent = 0)
{
if(pretty)
foreach(i; 0 .. indentLevel + additionalIndent)
json.put(" ");
}
void putEOL()
{
if(pretty)
json.put('\n');
}
void putCharAndEOL(char ch)
{
json.put(ch);
putEOL();
}
final switch(value.type)
{
case JSON_TYPE.OBJECT:
auto obj = value.objectNoRef;
if(!obj.length)
{
json.put("{}");
}
else
{
putCharAndEOL('{');
bool first = true;
void emit(R)(R names)
{
foreach (name; names)
{
auto member = obj[name];
if(!first)
putCharAndEOL(',');
first = false;
putTabs(1);
toString(name);
json.put(':');
if(pretty)
json.put(' ');
toValue(member, indentLevel + 1);
}
}
import std.algorithm : sort;
import std.array;
// @@@BUG@@@ 14439
// auto names = obj.keys; // aa.keys can't be called in @safe code
auto names = new string[obj.length];
size_t i = 0;
foreach (k, v; obj)
{
names[i] = k;
i++;
}
sort(names);
emit(names);
putEOL();
putTabs();
json.put('}');
}
break;
case JSON_TYPE.ARRAY:
auto arr = value.arrayNoRef;
if(arr.empty)
{
json.put("[]");
}
else
{
putCharAndEOL('[');
foreach (i, el; arr)
{
if(i)
putCharAndEOL(',');
putTabs(1);
toValue(el, indentLevel + 1);
}
putEOL();
putTabs();
json.put(']');
}
break;
case JSON_TYPE.STRING:
toString(value.str);
break;
case JSON_TYPE.INTEGER:
json.put(to!string(value.store.integer));
break;
case JSON_TYPE.UINTEGER:
json.put(to!string(value.store.uinteger));
break;
case JSON_TYPE.FLOAT:
import std.math : isNaN, isInfinity;
auto val = value.store.floating;
if (val.isNaN) {
if (options & JSONOptions.specialFloatLiterals) {
toString(JSONFloatLiteral.nan);
}
else {
throw new JSONException(
"Cannot encode NaN. Consider passing the specialFloatLiterals flag.");
}
}
else if (val.isInfinity) {
if (options & JSONOptions.specialFloatLiterals) {
toString((val > 0) ? JSONFloatLiteral.inf : JSONFloatLiteral.negativeInf);
}
else {
throw new JSONException(
"Cannot encode Infinity. Consider passing the specialFloatLiterals flag.");
}
}
else {
json.put(to!string(val));
}
break;
case JSON_TYPE.TRUE:
json.put("true");
break;
case JSON_TYPE.FALSE:
json.put("false");
break;
case JSON_TYPE.NULL:
json.put("null");
break;
}
}
toValue(root, 0);
return json.data;
}
private void appendJSONChar(ref Appender!string dst, dchar c, JSONOptions opts,
scope void delegate(string) error) @safe
{
import std.uni : isControl;
with (JSONOptions) if (isControl(c) ||
((opts & escapeNonAsciiChars) >= escapeNonAsciiChars && c >= 0x80))
{
dst.put("\\u");
foreach_reverse (i; 0 .. 4)
{
char ch = (c >>> (4 * i)) & 0x0f;
ch += ch < 10 ? '0' : 'A' - 10;
dst.put(ch);
}
}
else
{
dst.put(c);
}
}
@safe unittest // bugzilla 12897
{
JSONValue jv0 = JSONValue("test测试");
assert(toJSON(jv0, false, JSONOptions.escapeNonAsciiChars) == `"test\u6D4B\u8BD5"`);
JSONValue jv00 = JSONValue("test\u6D4B\u8BD5");
assert(toJSON(jv00, false, JSONOptions.none) == `"test测试"`);
assert(toJSON(jv0, false, JSONOptions.none) == `"test测试"`);
JSONValue jv1 = JSONValue("été");
assert(toJSON(jv1, false, JSONOptions.escapeNonAsciiChars) == `"\u00E9t\u00E9"`);
JSONValue jv11 = JSONValue("\u00E9t\u00E9");
assert(toJSON(jv11, false, JSONOptions.none) == `"été"`);
assert(toJSON(jv1, false, JSONOptions.none) == `"été"`);
}
/**
Exception thrown on JSON errors
*/
class JSONException : Exception
{
this(string msg, int line = 0, int pos = 0) pure nothrow @safe
{
if(line)
super(text(msg, " (Line ", line, ":", pos, ")"));
else
super(msg);
}
this(string msg, string file, size_t line) pure nothrow @safe
{
super(msg, file, line);
}
}
unittest
{
import std.exception;
JSONValue jv = "123";
assert(jv.type == JSON_TYPE.STRING);
assertNotThrown(jv.str);
assertThrown!JSONException(jv.integer);
assertThrown!JSONException(jv.uinteger);
assertThrown!JSONException(jv.floating);
assertThrown!JSONException(jv.object);
assertThrown!JSONException(jv.array);
assertThrown!JSONException(jv["aa"]);
assertThrown!JSONException(jv[2]);
jv = -3;
assert(jv.type == JSON_TYPE.INTEGER);
assertNotThrown(jv.integer);
jv = cast(uint)3;
assert(jv.type == JSON_TYPE.UINTEGER);
assertNotThrown(jv.uinteger);
jv = 3.0f;
assert(jv.type == JSON_TYPE.FLOAT);
assertNotThrown(jv.floating);
jv = ["key" : "value"];
assert(jv.type == JSON_TYPE.OBJECT);
assertNotThrown(jv.object);
assertNotThrown(jv["key"]);
assert("key" in jv);
assert("notAnElement" !in jv);
assertThrown!JSONException(jv["notAnElement"]);
const cjv = jv;
assert("key" in cjv);
assertThrown!JSONException(cjv["notAnElement"]);
foreach(string key, value; jv)
{
static assert(is(typeof(value) == JSONValue));
assert(key == "key");
assert(value.type == JSON_TYPE.STRING);
assertNotThrown(value.str);
assert(value.str == "value");
}
jv = [3, 4, 5];
assert(jv.type == JSON_TYPE.ARRAY);
assertNotThrown(jv.array);
assertNotThrown(jv[2]);
foreach(size_t index, value; jv)
{
static assert(is(typeof(value) == JSONValue));
assert(value.type == JSON_TYPE.INTEGER);
assertNotThrown(value.integer);
assert(index == (value.integer-3));
}
jv = null;
assert(jv.type == JSON_TYPE.NULL);
assert(jv.isNull);
jv = "foo";
assert(!jv.isNull);
jv = JSONValue("value");
assert(jv.type == JSON_TYPE.STRING);
assert(jv.str == "value");
JSONValue jv2 = JSONValue("value");
assert(jv2.type == JSON_TYPE.STRING);
assert(jv2.str == "value");
JSONValue jv3 = JSONValue("\u001c");
assert(jv3.type == JSON_TYPE.STRING);
assert(jv3.str == "\u001C");
}
unittest
{
// Bugzilla 11504
JSONValue jv = 1;
assert(jv.type == JSON_TYPE.INTEGER);
jv.str = "123";
assert(jv.type == JSON_TYPE.STRING);
assert(jv.str == "123");
jv.integer = 1;
assert(jv.type == JSON_TYPE.INTEGER);
assert(jv.integer == 1);
jv.uinteger = 2u;
assert(jv.type == JSON_TYPE.UINTEGER);
assert(jv.uinteger == 2u);
jv.floating = 1.5f;
assert(jv.type == JSON_TYPE.FLOAT);
assert(jv.floating == 1.5f);
jv.object = ["key" : JSONValue("value")];
assert(jv.type == JSON_TYPE.OBJECT);
assert(jv.object == ["key" : JSONValue("value")]);
jv.array = [JSONValue(1), JSONValue(2), JSONValue(3)];
assert(jv.type == JSON_TYPE.ARRAY);
assert(jv.array == [JSONValue(1), JSONValue(2), JSONValue(3)]);
jv = true;
assert(jv.type == JSON_TYPE.TRUE);
jv = false;
assert(jv.type == JSON_TYPE.FALSE);
enum E{True = true}
jv = E.True;
assert(jv.type == JSON_TYPE.TRUE);
}
pure unittest
{
// Adding new json element via array() / object() directly
JSONValue jarr = JSONValue([10]);
foreach (i; 0..9)
jarr.array ~= JSONValue(i);
assert(jarr.array.length == 10);
JSONValue jobj = JSONValue(["key" : JSONValue("value")]);
foreach (i; 0..9)
jobj.object[text("key", i)] = JSONValue(text("value", i));
assert(jobj.object.length == 10);
}
pure unittest
{
// Adding new json element without array() / object() access
JSONValue jarr = JSONValue([10]);
foreach (i; 0..9)
jarr ~= [JSONValue(i)];
assert(jarr.array.length == 10);
JSONValue jobj = JSONValue(["key" : JSONValue("value")]);
foreach (i; 0..9)
jobj[text("key", i)] = JSONValue(text("value", i));
assert(jobj.object.length == 10);
// No array alias
auto jarr2 = jarr ~ [1,2,3];
jarr2[0] = 999;
assert(jarr[0] == JSONValue(10));
}
unittest
{
import std.exception;
// An overly simple test suite, if it can parse a serializated string and
// then use the resulting values tree to generate an identical
// serialization, both the decoder and encoder works.
auto jsons = [
`null`,
`true`,
`false`,
`0`,
`123`,
`-4321`,
`0.23`,
`-0.23`,
`""`,
`"hello\nworld"`,
`"\"\\\/\b\f\n\r\t"`,
`[]`,
`[12,"foo",true,false]`,
`{}`,
`{"a":1,"b":null}`,
`{"goodbye":[true,"or",false,["test",42,{"nested":{"a":23.54,"b":0.0012}}]],"hello":{"array":[12,null,{}],"json":"is great"}}`,
];
version (MinGW)
jsons ~= `1.223e+024`;
else
jsons ~= `1.223e+24`;
JSONValue val;
string result;
foreach (json; jsons)
{
try
{
val = parseJSON(json);
enum pretty = false;
result = toJSON(val, pretty);
assert(result == json, text(result, " should be ", json));
}
catch (JSONException e)
{
import std.stdio : writefln;
writefln(text(json, "\n", e.toString()));
}
}
// Should be able to correctly interpret unicode entities
val = parseJSON(`"\u003C\u003E"`);
assert(toJSON(val) == "\"\<\>\"");
assert(val.to!string() == "\"\<\>\"");
val = parseJSON(`"\u0391\u0392\u0393"`);
assert(toJSON(val) == "\"\Α\Β\Γ\"");
assert(val.to!string() == "\"\Α\Β\Γ\"");
val = parseJSON(`"\u2660\u2666"`);
assert(toJSON(val) == "\"\♠\♦\"");
assert(val.to!string() == "\"\♠\♦\"");
//0x7F is a control character (see Unicode spec)
val = parseJSON(`"\u007F"`);
assert(toJSON(val) == "\"\\u007F\"");
assert(val.to!string() == "\"\\u007F\"");
with(parseJSON(`""`))
assert(str == "" && str !is null);
with(parseJSON(`[]`))
assert(!array.length);
// Formatting
val = parseJSON(`{"a":[null,{"x":1},{},[]]}`);
assert(toJSON(val, true) == `{
"a": [
null,
{
"x": 1
},
{},
[]
]
}`);
}
unittest {
auto json = `"hello\nworld"`;
const jv = parseJSON(json);
assert(jv.toString == json);
assert(jv.toPrettyString == json);
}
deprecated unittest
{
// Bugzilla 12332
import std.exception;
JSONValue jv;
jv.type = JSON_TYPE.INTEGER;
jv = 1;
assert(jv.type == JSON_TYPE.INTEGER);
assert(jv.integer == 1);
jv.type = JSON_TYPE.UINTEGER;
assert(jv.uinteger == 1);
jv.type = JSON_TYPE.STRING;
assertThrown!JSONException(jv.integer == 1);
assert(jv.str is null);
jv.str = "123";
assert(jv.str == "123");
jv.type = JSON_TYPE.STRING;
assert(jv.str == "123");
jv.type = JSON_TYPE.TRUE;
assert(jv.type == JSON_TYPE.TRUE);
}
pure unittest
{
// Bugzilla 12969
JSONValue jv;
jv["int"] = 123;
assert(jv.type == JSON_TYPE.OBJECT);
assert("int" in jv);
assert(jv["int"].integer == 123);
jv["array"] = [1, 2, 3, 4, 5];
assert(jv["array"].type == JSON_TYPE.ARRAY);
assert(jv["array"][2].integer == 3);
jv["str"] = "D language";
assert(jv["str"].type == JSON_TYPE.STRING);
assert(jv["str"].str == "D language");
jv["bool"] = false;
assert(jv["bool"].type == JSON_TYPE.FALSE);
assert(jv.object.length == 4);
jv = [5, 4, 3, 2, 1];
assert( jv.type == JSON_TYPE.ARRAY );
assert( jv[3].integer == 2 );
}
unittest
{
auto s = q"EOF
[
1,
2,
3,
potato
]
EOF";
import std.exception;
auto e = collectException!JSONException(parseJSON(s));
assert(e.msg == "Unexpected character 'p'. (Line 5:3)", e.msg);
}
// handling of special float values (NaN, Inf, -Inf)
unittest
{
import std.math : isNaN, isInfinity;
import std.exception : assertThrown;
// expected representations of NaN and Inf
enum {
nanString = '"' ~ JSONFloatLiteral.nan ~ '"',
infString = '"' ~ JSONFloatLiteral.inf ~ '"',
negativeInfString = '"' ~ JSONFloatLiteral.negativeInf ~ '"',
}
// with the specialFloatLiterals option, encode NaN/Inf as strings
assert(JSONValue(float.nan).toString(JSONOptions.specialFloatLiterals) == nanString);
assert(JSONValue(double.infinity).toString(JSONOptions.specialFloatLiterals) == infString);
assert(JSONValue(-real.infinity).toString(JSONOptions.specialFloatLiterals) == negativeInfString);
// without the specialFloatLiterals option, throw on encoding NaN/Inf
assertThrown!JSONException(JSONValue(float.nan).toString);
assertThrown!JSONException(JSONValue(double.infinity).toString);
assertThrown!JSONException(JSONValue(-real.infinity).toString);
// when parsing json with specialFloatLiterals option, decode special strings as floats
JSONValue jvNan = parseJSON(nanString, JSONOptions.specialFloatLiterals);
JSONValue jvInf = parseJSON(infString, JSONOptions.specialFloatLiterals);
JSONValue jvNegInf = parseJSON(negativeInfString, JSONOptions.specialFloatLiterals);
assert(jvNan.floating.isNaN);
assert(jvInf.floating.isInfinity && jvInf.floating > 0);
assert(jvNegInf.floating.isInfinity && jvNegInf.floating < 0);
// when parsing json without the specialFloatLiterals option, decode special strings as strings
jvNan = parseJSON(nanString);
jvInf = parseJSON(infString);
jvNegInf = parseJSON(negativeInfString);
assert(jvNan.str == JSONFloatLiteral.nan);
assert(jvInf.str == JSONFloatLiteral.inf);
assert(jvNegInf.str == JSONFloatLiteral.negativeInf);
}
pure nothrow @safe @nogc unittest
{
JSONValue testVal;
testVal = "test";
testVal = 10;
testVal = 10u;
testVal = 1.0;
testVal = (JSONValue[string]).init;
testVal = JSONValue[].init;
testVal = null;
assert(testVal.isNull);
}
pure nothrow @safe unittest // issue 15884
{
char[] str = "a".dup;
JSONValue testVal = str;
assert(testVal.type == JSON_TYPE.STRING);
}
|
D
|
leave (a job, post, or position) voluntarily
leave behind empty
cancel officially
|
D
|
// Written in the D programming language.
/**
* This module provides algorithms for grammar flow analysis.
*
* Copyright: (C) 2019 by Kai Nacke
*
* License: See LICENSE file
*
* Authors: Kai Nacke
*/
module algo;
import grammar;
import std.algorithm : among, filter, min;
import std.bitmanip;
import std.container.array;
import std.range;
version(unittest) import lexer, parser;
version(unittest) import std.conv : to;
/**
* Marks all symbols reachable from the start symbol.
*
* Params:
* grammar = grammar for which the reachability of the symbols is
* computed
*/
void calculateReachable(Grammar grammar)
{
static void mark(Node node)
{
final switch (node.type)
{
case NodeType.Terminal:
node.isReachable = true;
break;
case NodeType.Nonterminal:
node.isReachable = true;
mark(node.link);
break;
case NodeType.Group:
case NodeType.Alternative:
node.isReachable = true;
foreach (n; NodeLinkRange(node.link))
mark(n);
break;
case NodeType.Sequence:
node.isReachable = true;
for (auto n = node.succInner; n !is null; n = n.succ)
mark(n);
break;
case NodeType.Symbol:
node.isReachable = true;
if (!node.inner.isReachable)
mark(node.inner);
break;
case NodeType.Code:
assert(false, "Statement not reachable");
}
}
mark(grammar.syntheticStartSymbol);
}
unittest
{
// Wilhelm, Maurer; p. 298
// Nonterminals U, V are not reachable.
immutable content = `
%token a, b, c, d
%%
S : Y ;
Y : Y Z | Y a | b ;
U : V ;
X : c ;
V : V d | d ;
Z : Z X ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateReachable(grammar);
foreach (nt; grammar.nonterminals)
assert(nt.isReachable == (nt.name != "U" && nt.name != "V"),
"Nonterminal: `" ~ nt.name ~ "`" ~
" Exp: " ~ to!string(nt.name != "U" && nt.name != "V") ~
" Act: " ~ to!string(nt.isReachable));
}
/**
* Performs a fixed point computation on boolean values.
*
* Params:
* prop = name of property
* terminalVal = value for terminals
* groupval = function / delegate which returns additional value for group
* symbols
*/
private void fixedPointComputation(string prop, bool terminalVal, alias groupval)(Grammar grammar)
{
bool changes;
auto ref member(string prop)(inout Node a)
{
return __traits(getMember, a, prop);
}
void mark(Node node, bool val)
{
if (!member!prop(node) && val)
{
member!prop(node) = changes = true;
}
}
void traverse(Node node)
{
for (; node !is null; node = node.succ)
{
final switch (node.type)
{
case NodeType.Terminal:
mark(node, terminalVal);
break;
case NodeType.Nonterminal:
traverse(node.link);
mark(node, member!prop(node.link));
break;
case NodeType.Group:
traverse(node.link);
mark(node, groupval(node) || member!prop(node.link));
break;
case NodeType.Alternative:
bool val = false;
foreach (n; NodeLinkRange(node.link))
{
traverse(n);
val |= member!prop(n);
}
mark(node, val);
break;
case NodeType.Sequence:
bool val = true;
traverse(node.succInner);
for (auto n = node.succInner; n !is null && val; n = n.succ)
{
val &= member!prop(n);
}
mark(node, val);
break;
case NodeType.Symbol:
if (node.inner.type == NodeType.Terminal)
traverse(node.inner);
mark(node, member!prop(node.inner));
break;
case NodeType.Code:
assert(false, "Statement not reachable");
}
}
}
do
{
changes = false;
foreach (nt; grammar.nonterminals)
{
traverse(nt);
}
} while (changes);
}
/**
* Calculates the epsilon productivity for each element of the grammar.
*
* Params:
* grammar = grammar for which the epsilon productivity of the symbols is
* computed
*/
void calculateDerivesEpsilon(Grammar grammar)
{
fixedPointComputation!("derivesEpsilon", false,
(Node n) => n.cardinality.among!(Cardinality.ZeroOrMore, Cardinality.ZeroOrOne))(grammar);
}
unittest
{
// Wilhelm, Maurer; p. 311
// Nonterminals Eq, Tq derives epsilon.
immutable content = `
%token id
%%
S : E ;
E : T Eq ;
Eq : ( "+" E )? ;
T : F Tq ;
Tq : ( "*" T )? ;
F : id | "(" E ")" ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateDerivesEpsilon(grammar);
foreach (nt; grammar.nonterminals)
assert(nt.derivesEpsilon == !(nt.name != "Eq" && nt.name != "Tq"),
"Nonterminal: `" ~ nt.name ~ "`" ~
" Exp: " ~ to!string(!(nt.name != "Eq" && nt.name != "Tq")) ~
" Act: " ~ to!string(nt.derivesEpsilon));
}
unittest
{
// See https://www.codewars.com/kata/compute-nullable-non-terminals
immutable content = `
A : "a" B | "c" C ;
B : ( A B )? ;
C : "b" "c" ;
D : ( "a" "b" )? ;
E : B D ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateDerivesEpsilon(grammar);
foreach (nt; grammar.nonterminals)
assert(nt.derivesEpsilon == (nt.name == "B" || nt.name == "D" || nt.name == "E"),
"Nonterminal: `" ~ nt.name ~ "`" ~
" Exp: " ~ to!string(nt.name == "B" || nt.name == "D" || nt.name == "E") ~
" Act: " ~ to!string(nt.derivesEpsilon));
}
unittest
{
// See https://mkaul.wordpress.com/2009/12/11/computing-nullable-first-and-follow-sets/
immutable content = `
Z : "d" | X Y Z ;
Y : ( "c" )? ;
X : Y | "a" ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateDerivesEpsilon(grammar);
foreach (nt; grammar.nonterminals)
assert(nt.derivesEpsilon == (nt.name == "X" || nt.name == "Y"),
"Nonterminal: `" ~ nt.name ~ "`" ~
" Exp: " ~ to!string(nt.name == "X" || nt.name == "Y") ~
" Act: " ~ to!string(nt.derivesEpsilon));
}
/**
* Calculates the productivity of each symbol of the grammar.
*
* Params:
* grammar = grammar for which the productivity of the symbols is
* computed
*/
void calculateProductive(Grammar grammar)
{
fixedPointComputation!("isProductive", true,
(Node n) => false)(grammar);
}
unittest
{
// Wilhelm, Maurer; p. 297
// Nonterminal Z is not productive.
immutable content = `
%token a, b
%%
S : a X ;
X : b S | a Y b Y ;
Y : b a | a Z ;
Z : a Z X ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateProductive(grammar);
foreach (nt; grammar.nonterminals)
assert(nt.isProductive == (nt.name != "Z"),
"Nonterminal: `" ~ nt.name ~ "`" ~
" Exp: " ~ to!string(nt.name != "Z") ~
" Act: " ~ to!string(nt.isProductive));
}
/// Grammar Flow Analysis algorithm.
///
/// See Wilhelm, Maurer. p. 309
/// This is Tarjan's strongly connected components algorithm
public void computeSetValuedFunc(alias startValue, alias relation, string prop, R)(R range) if (isInputRange!R)
{
immutable int INFINITY = int.max;
alias NodeType = ElementType!R;
Array!NodeType stack;
size_t[NodeType] numbers;
void dfs(NodeType a)
{
stack.insertBack(a);
const d = stack.length;
numbers[a] = d;
__traits(getMember, a, prop) = startValue(a);
foreach (b; relation(a)) {
assert(b !is null);
if (b !in numbers) { dfs(b); }
numbers[a] = min(numbers[a], numbers[b]);
assert(__traits(getMember, b, prop) !is null);
__traits(getMember, a, prop).insert(__traits(getMember, b, prop)[]);
}
if (numbers[a] == d) {
while (true) {
auto t = stack.back;
numbers[t] = INFINITY;
__traits(getMember, t, prop) = __traits(getMember, a, prop);
stack.removeBack;
if (t == a)
break;
}
}
}
foreach (v; range) {
if (v !in numbers) {
dfs(v);
}
}
}
unittest
{
import std.algorithm.comparison : equal;
import std.container.rbtree;
alias StringSet = RedBlackTree!(string, "a < b", false);
struct SimpleNode
{
string n;
StringSet result;
SimpleNode*[] next;
}
auto start(SimpleNode *a)
{
return new StringSet(a.n);
}
auto relation(SimpleNode *b)
{
return b.next;
}
auto a = new SimpleNode("A");
auto b = new SimpleNode("B");
auto c = new SimpleNode("C");
/*
* A ----> B
* ^ |
* +---C---+
*/
a.next ~= b;
b.next ~= c;
c.next ~= a;
auto all = [ a, b, c ];
computeSetValuedFunc!(start, relation, "result")(all);
assert(equal(a.result[], [ "A", "B", "C" ]));
assert(equal(b.result[], [ "A", "B", "C" ]));
assert(equal(c.result[], [ "A", "B", "C" ]));
/*
* A ----> B ----> C
*/
c.next.length = 0;
computeSetValuedFunc!(start, relation, "result")(all);
assert(equal(a.result[], [ "A", "B", "C" ]));
assert(equal(b.result[], [ "B", "C" ]));
assert(equal(c.result[], [ "C" ]));
a.next.length = 0;
b.next.length = 0;
computeSetValuedFunc!(start, relation, "result")(all);
assert(equal(a.result[], [ "A" ]));
assert(equal(b.result[], [ "B" ]));
assert(equal(c.result[], [ "C" ]));
auto d = new SimpleNode("D");
auto e = new SimpleNode("E");
/*
* D ----> A ----> B ----> E
* ^ |
* +---C---+
*/
a.next ~= b;
b.next ~= c;
c.next ~= a;
d.next ~= a;
b.next ~= e;
all = [ e, d, c, b, a ];
computeSetValuedFunc!(start, relation, "result")(all);
assert(equal(a.result[], [ "A", "B", "C", "E" ]));
assert(equal(b.result[], [ "A", "B", "C", "E" ]));
assert(equal(c.result[], [ "A", "B", "C", "E" ]));
assert(equal(d.result[], [ "A", "B", "C", "D", "E" ]));
assert(equal(e.result[], [ "E" ]));
all = [ e, a, c, b, d ];
computeSetValuedFunc!(start, relation, "result")(all);
assert(equal(a.result[], [ "A", "B", "C", "E" ]));
assert(equal(b.result[], [ "A", "B", "C", "E" ]));
assert(equal(c.result[], [ "A", "B", "C", "E" ]));
assert(equal(d.result[], [ "A", "B", "C", "D", "E" ]));
assert(equal(e.result[], [ "E" ]));
}
/**
* Computes the epsilon-free first sets of the grammar.
*
* Params:
* grammar = grammar for which the epsilon-free first sets is computed
*/
void calculateFirstSets(Grammar grammar)
{
// Start value is nonempty only for a terminal
static TerminalSet startValue(Node a)
in (a !is null)
out (r; r !is null && r.length <= 1)
{
auto set = new TerminalSet;
if (a.type == NodeType.Terminal)
{
set.insert(a.name);
}
return set;
}
// Definition of the relation:
// a R b <=> 1. a is a nonterminal and b its right hand side or
// 2. b is a direct subexpression of a and contributes to
// the first set of a
static auto relation(Node a)
in (a !is null)
{
Node[] rel;
void add(Node n)
{
for (; n !is null; n = n.succ)
{
rel ~= n;
if (!n.derivesEpsilon)
break;
}
}
final switch (a.type)
{
case NodeType.Nonterminal:
assert(a.link !is null);
rel ~= a.link;
break;
case NodeType.Group:
case NodeType.Alternative:
assert(a.link !is null);
foreach (n; NodeLinkRange(a.link))
{
rel ~= n;
}
break;
case NodeType.Sequence:
add(a.succInner);
break;
case NodeType.Symbol:
assert(a.inner !is null);
rel ~= a.inner;
break;
case NodeType.Terminal:
// A terminal has no relation
break;
case NodeType.Code:
assert(false, "Statement not reachable");
}
return rel;
}
auto noderange = filter!(n => n.type != NodeType.Code)(grammar.nodes);
computeSetValuedFunc!(startValue, relation, "firstSet")(noderange);
version(unittest) checkFirstSets(grammar);
debug checkFirstSets(grammar);
}
private void checkFirstSets(Grammar grammar)
{
void checkExpr(Node n)
{
import std.algorithm.comparison : equal;
import std.conv : to;
assert(n !is null, "Node is null");
assert(n.type == NodeType.Code || n.firstSet !is null, "FIRST set is null " ~ n.toString);
if (n.type == NodeType.Sequence)
{
TerminalSet exp = new TerminalSet;
for (auto v = n.succInner; v !is null; v = v.succ)
{
exp.insert(v.firstSet[]);
if (!v.derivesEpsilon)
break;
}
assert(equal(n.firstSet[], exp[]), "FIRST sets not equal (sequence)");
}
else if (n.type == NodeType.Group)
{
assert(n.link !is null);
assert(n.link.firstSet !is null);
if (n.cardinality == Cardinality.One || n.cardinality == Cardinality.OneOrMore)
assert(equal(n.firstSet[], n.link.firstSet[]), "FIRST sets not equal");
else
assert(equal(n.firstSet[], n.link.firstSet[]), "FIRST sets not equal");
}
else if (n.type == NodeType.Alternative)
{
TerminalSet exp = new TerminalSet;
for (auto v = n.link; v !is null; v = v.link)
{
exp.insert(v.firstSet[]);
}
assert(equal(n.firstSet[], exp[]), "FIRST sets not equal (alternative)");
}
else if (n.type == NodeType.Nonterminal)
{
assert(n.link !is null);
assert(n.link.firstSet !is null);
assert(equal(n.firstSet[], n.link.firstSet[]), "FIRST sets not equal (nonterminal)");
}
else if (n.type == NodeType.Symbol)
{
assert(n.inner !is null);
assert(n.inner.firstSet !is null);
assert(equal(n.firstSet[], n.inner.firstSet[]), "FIRST sets not equal (symbol " ~ n.name ~ ")");
}
else if (n.type == NodeType.Terminal)
{
assert(n.firstSet.length == 1, "FIRST set of terminal has size different from 1");
assert(equal(n.firstSet[], [n.name]), "FIRST set of terminal does not contain terminal name");
}
}
foreach (v; grammar.nodes)
checkExpr(v);
}
version(unittest)
private void checkFirstSet(Node n, string[] values ...)
{
assert(n !is null);
foreach (v; values)
assert(v in n.firstSet,
"Terminal `" ~ v ~ "` not in first set of `" ~n.name ~ "`");
assert(n.firstSet.length == values.length,
"Nonterminal `" ~ n.name ~ "`" ~
" Exp: " ~ to!string(values.length) ~
" Act: " ~ to!string(n.firstSet.length));
}
unittest
{
// Wilhelm, Maurer; p. 311
// Nonterminals Eq, Tq derives epsilon.
immutable content = `
%token id
%%
S : E ;
E : T Eq ;
Eq : ( "+" E )? ;
T : F Tq ;
Tq : ( "*" T )? ;
F : id | "(" E ")" ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateReachable(grammar);
calculateDerivesEpsilon(grammar);
calculateFirstSets(grammar);
Node[string] map;
foreach (nt; grammar.nonterminals)
{
map[nt.name] = nt;
assert(nt.isReachable);
}
checkFirstSet(map["S"], "id", "\"(\"");
assert(!map["S"].derivesEpsilon);
checkFirstSet(map["E"], "id", "\"(\"");
assert(!map["E"].derivesEpsilon);
checkFirstSet(map["Eq"], "\"+\"");
assert(map["Eq"].derivesEpsilon);
checkFirstSet(map["T"], "id", "\"(\"");
assert(!map["T"].derivesEpsilon);
checkFirstSet(map["Tq"], "\"*\"");
assert(map["Tq"].derivesEpsilon);
checkFirstSet(map["F"], "id", "\"(\"");
assert(!map["F"].derivesEpsilon);
}
/**
* Computes the follow sets of the grammar.
*
* Params:
* grammar = grammar for which the follow sets is computed
*/
void calculateFollowSets(Grammar grammar)
{
// Start values are the epsilon-free first sets
TerminalSet startValue(Node a)
in (a !is null)
{
auto set = new TerminalSet;
// Equation 5
if (a.type == NodeType.Sequence && a.back.type == NodeType.Group &&
a.back.cardinality.among!(Cardinality.ZeroOrMore, Cardinality.OneOrMore))
{
set.insert(a.firstSet[]);
}
// Equation 1
else if (a.type == NodeType.Sequence && a.back.type == NodeType.Nonterminal &&
a.back.back is null)
{
set.insert(grammar.eoiTerminal.name);
}
// Equation 3
else
{
auto v = a.succ;
if (v !is null)
set.insert(v.firstSet[]);
}
return set;
}
// Definition of the relation:
// a R b <=> 1. a and b are extended context-free items
// 2. b contributes to the follow set of a
//
// Let Y -> a b c be a production. If b is a regular subexpression
// then the extended context-free item is written as
// [ Y -> a .b c ]
static auto relation(Node a)
in (a !is null)
{
Node[] rel;
void add(Node n)
{
if (n.type == NodeType.Nonterminal)
{
foreach (v; NodeLinkRange(n.back))
{
assert(v.type == NodeType.Symbol);
rel ~= v;
}
}
else
{
rel ~= n;
}
}
final switch (a.type)
{
case NodeType.Symbol:
case NodeType.Group:
case NodeType.Alternative:
auto n = a.succ;
if (n is null)
{
// Equation (4)
// Leaking abstraction: succ is null but there may be
// traling code nodes
for (n = a; n.next !is null; n = n.next)
{}
if (n.back !is null)
add(n.back);
}
else
{
// Equation (3)
if (n.derivesEpsilon)
{
rel ~= n;
}
}
break;
case NodeType.Sequence:
// Equation: (2), (5), (6)
assert(a.back !is null);
assert(a.next is null);
add(a.back);
break;
case NodeType.Terminal:
assert(false, "Statement not reachable");
case NodeType.Nonterminal:
assert(false, "Statement not reachable");
case NodeType.Code:
assert(false, "Statement not reachable");
}
return rel;
}
auto noderange = filter!(n => n.type.among!(NodeType.Alternative, NodeType.Group, NodeType.Sequence, NodeType.Symbol))(grammar.nodes);
computeSetValuedFunc!(startValue, relation, "followSet")(noderange);
version(unittest) checkFollowSets(grammar);
debug checkFollowSets(grammar);
}
private void checkFollowSets(Grammar grammar)
{
void checkExpr(Node n)
{
import std.algorithm.comparison : equal;
import std.conv : to;
assert(n !is null, "Node is null");
assert(!n.type.among!(NodeType.Alternative, NodeType.Group, NodeType.Sequence, NodeType.Symbol) || n.followSet !is null, "FOLLOW set is null " ~ n.toString);
if (n.type == NodeType.Alternative)
{
for (auto v = n.link; v !is null; v = v.link)
{
assert(equal(n.followSet[], v.followSet[]), "FOLLOW sets not equal (alternative)");
}
}
else if (n.type == NodeType.Group)
{
}
else if (n.type == NodeType.Sequence)
{
}
}
foreach (v; grammar.nodes)
checkExpr(v);
}
version(unittest)
private void checkFollowSet(Node nt, string[] values ...)
{
assert(nt !is null);
assert(nt.type == NodeType.Nonterminal);
assert(nt.link !is null);
auto n = nt.link;
assert(n.followSet !is null);
foreach (v; values)
assert(v in n.followSet,
"Terminal `" ~ v ~ "` not in follow set of `" ~nt.name ~ "`");
assert(n.followSet.length == values.length,
"Nonterminal `" ~ nt.name ~ "`" ~
" Exp: " ~ to!string(values.length) ~
" Act: " ~ to!string(n.followSet.length));
}
unittest
{
// Holub; p. 214
// This is basically the same example as from Wilhelm, Maurer.
// Please note the ";" at the end of production stmt.
immutable content = `
%token number
%%
stmt : expr ";" ;
expr : ( term exprq )? ;
exprq : ( "+" term exprq )? ;
term : factor termq ;
termq : ( "*" factor termq )? ;
factor : "(" expr ")" | number ;
`;
auto grammar = Parser!Lexer(Lexer(content)).parse;
calculateReachable(grammar);
calculateDerivesEpsilon(grammar);
calculateFirstSets(grammar);
calculateFollowSets(grammar);
Node[string] map;
foreach (nt; grammar.nonterminals)
{
map[nt.name] = nt;
assert(nt.isReachable);
}
checkFirstSet(map["stmt"], "number", "\"(\"", "\";\"");
checkFollowSet(map["stmt"], "_eoi");
assert(!map["stmt"].derivesEpsilon);
checkFirstSet(map["expr"], "number", "\"(\"");
checkFollowSet(map["expr"], "\";\"", "\")\"");
assert(map["expr"].derivesEpsilon);
checkFirstSet(map["exprq"], "\"+\"");
checkFollowSet(map["exprq"], "\";\"", "\")\"");
assert(map["exprq"].derivesEpsilon);
checkFirstSet(map["term"], "number", "\"(\"");
checkFollowSet(map["term"], "\"+\"", "\";\"", "\")\"");
assert(!map["term"].derivesEpsilon);
checkFirstSet(map["termq"], "\"*\"");
checkFollowSet(map["termq"], "\"+\"", "\";\"", "\")\"");
assert(map["termq"].derivesEpsilon);
checkFirstSet(map["factor"], "number", "\"(\"");
checkFollowSet(map["factor"], "\"*\"", "\"+\"", "\";\"", "\")\"");
assert(!map["factor"].derivesEpsilon);
}
|
D
|
extern (C) void __assert_rtn(const char* x, const char* y, const char* z, const char* w)
{
version(AArch64) {
//TODO ARM assert
} else {
asm {
mov RAX, 0x2000004;
mov RDI, 1;
mov RSI, x;
mov RDX, 10;
syscall;
}
}
}
extern (C) void __assert(const char* file, const char* x, uint line)
{
assert(false, "not implemented");
}
|
D
|
/Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/Build/Intermediates/iTunesClient2.build/Debug-iphonesimulator/iTunesClient2.build/Objects-normal/x86_64/ItunesEntity.o : /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesMedia.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Stub.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/AlbumDetailDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/SearchResultsDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/AlbumListDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Genre.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/AppDelegate.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesAttribute.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Song.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/SongViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/AlbumDetailViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/AlbumCellViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Views/SongCell.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Views/AlbumCell.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Album.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/JSONDownloader.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ArtworkDownloader.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/QueryItemProvider.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/AlbumDetailController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/SearchResultsController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/AlbumListController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/ViewController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ItunesError.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/PendingOperations.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ItunesAPIClient.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/Endpoint.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Artist.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesEntity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/Build/Intermediates/iTunesClient2.build/Debug-iphonesimulator/iTunesClient2.build/Objects-normal/x86_64/ItunesEntity~partial.swiftmodule : /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesMedia.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Stub.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/AlbumDetailDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/SearchResultsDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/AlbumListDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Genre.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/AppDelegate.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesAttribute.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Song.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/SongViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/AlbumDetailViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/AlbumCellViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Views/SongCell.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Views/AlbumCell.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Album.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/JSONDownloader.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ArtworkDownloader.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/QueryItemProvider.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/AlbumDetailController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/SearchResultsController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/AlbumListController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/ViewController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ItunesError.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/PendingOperations.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ItunesAPIClient.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/Endpoint.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Artist.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesEntity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
/Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/Build/Intermediates/iTunesClient2.build/Debug-iphonesimulator/iTunesClient2.build/Objects-normal/x86_64/ItunesEntity~partial.swiftdoc : /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesMedia.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Stub.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/AlbumDetailDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/SearchResultsDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Data\ Sources/AlbumListDataSource.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Genre.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/AppDelegate.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesAttribute.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Song.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/SongViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/AlbumDetailViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/View\ Models/AlbumCellViewModel.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Views/SongCell.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Views/AlbumCell.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Album.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/JSONDownloader.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ArtworkDownloader.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/QueryItemProvider.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/AlbumDetailController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/SearchResultsController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/AlbumListController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Controllers/ViewController.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ItunesError.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/PendingOperations.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Networking/ItunesAPIClient.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/Endpoint.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Artist.swift /Users/davalcato/Library/Mobile\ Documents/com~apple~CloudDocs/Desktop/iOS/iTunesClient2/iTunesClient2/Models/Endpoint/ItunesEntity.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /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 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
|
D
|
/*
* Copyright (c) 2004-2008 Derelict Developers
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the names 'Derelict', 'DerelictAL', nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module derelict.openal.altypes;
alias byte ALboolean;
alias byte ALbyte;
alias ubyte ALubyte;
alias short ALshort;
alias ushort ALushort;
alias uint ALuint;
alias int ALint;
alias float ALfloat;
alias double ALdouble;
version(linux)
{
alias int ALsizei;
}
else
{
alias uint ALsizei;
}
alias void ALvoid;
alias int ALenum;
alias uint ALbitfield;
alias ALfloat ALclampf;
alias ALdouble ALclampd;
enum : ALboolean
{
AL_FALSE = 0,
AL_TRUE = 1,
}
enum : ALenum
{
AL_INVALD = -1,
AL_NONE = 0,
AL_SOURCE_TYPE = 0x200,
AL_SOURCE_ABSOLUTE = 0x201,
AL_SOURCE_RELATIVE = 0x202,
AL_CONE_INNER_ANGLE = 0x1001,
AL_CONE_OUTER_ANGLE = 0x1002,
AL_PITCH = 0x1003,
AL_POSITION = 0x1004,
AL_DIRECTION = 0x1005,
AL_VELOCITY = 0x1006,
AL_LOOPING = 0x1007,
AL_BUFFER = 0x1009,
AL_GAIN = 0x100A,
AL_MIN_GAIN = 0x100D,
AL_MAX_GAIN = 0x100E,
AL_ORIENTATION = 0x100F,
AL_CHANNEL_MASK = 0x3000,
AL_SOURCE_STATE = 0x1010,
AL_INITIAL = 0x1011,
AL_PLAYING = 0x1012,
AL_PAUSED = 0x1013,
AL_STOPPED = 0x1014,
AL_BUFFERS_QUEUED = 0x1015,
AL_BUFFERS_PROCESSED = 0x1016,
AL_FORMAT_MONO8 = 0x1100,
AL_FORMAT_MONO16 = 0x1101,
AL_FORMAT_STEREO8 = 0x1102,
AL_FORMAT_STEREO16 = 0x1103,
AL_REFERENCE_DISTANCE = 0x1020,
AL_ROLLOFF_FACTOR = 0x1021,
AL_CONE_OUTER_GAIN = 0x1022,
AL_MAX_DISTANCE = 0x1023,
AL_FREQUENCEY = 0x2001,
AL_BITS = 0x2002,
AL_CHANNELS = 0x2003,
AL_SIZE = 0x2004,
AL_DATA = 0x2005,
AL_UNUSED = 0x2010,
AL_PENDING = 0x2011,
AL_PROCESSID = 0x2012,
AL_NO_ERROR = AL_FALSE,
AL_INVALID_NAME = 0xA001,
AL_ILLEGAL_ENUM = 0xA002,
AL_INVALID_ENUM = 0xA002,
AL_INVALID_VALUE = 0xA003,
AL_ILLEGAL_COMMAND = 0xA004,
AL_INVALID_OPERATION = 0xA004,
AL_OUT_OF_MEMORY = 0xA005,
AL_VENDOR = 0xB001,
AL_VERSION = 0xB002,
AL_RENDERER = 0xB003,
AL_EXTENSIONS = 0xB004,
AL_DOPPLER_FACTOR = 0xC001,
AL_DISTANCE_MODEL = 0xD000,
AL_INVERSE_DISTANCE = 0xD001,
AL_INVERSE_DISTANCE_CLAMPED = 0xD002,
}
version(linux)
{
enum : ALenum
{
AL_DISTANCE_SCALE = 0xC002,
AL_STREAMING = 0x1008,
AL_BYTE_LOKI = 0x100C,
}
}
|
D
|
module upromised.tokenizer;
import std.exception : enforce;
import upromised.promise : DelegatePromiseIterator, Promise, PromiseIterator;
import upromised.stream : Stream;
import upromised : fatal;
private ptrdiff_t countUntilPartial(const(ubyte)[] input, const(ubyte)[] search) nothrow {
import std.algorithm : startsWith, min;
foreach(pos; 0..input.length) {
if (search.startsWith(input[pos..$.min(pos + search.length)])) return pos;
}
return -1;
}
class Tokenizer(T) {
private:
alias Underlying = PromiseIterator!(T[]);
Underlying underlying;
Underlying read_;
bool underlyingEof;
T[] separator_;
T[] buffer;
size_t limit_;
bool partialReceive_;
public:
this(Underlying underlying) nothrow {
this.underlying = underlying;
}
void separator(immutable(void)[] separator = null) nothrow {
separator_ = cast(immutable(T)[])separator;
}
void limit(size_t limit = 0) nothrow {
limit_ = limit;
}
void partialReceive(bool partialReceive = false) nothrow {
partialReceive_ = partialReceive;
}
PromiseIterator!(T[]) read() nothrow {
if (read_ is null) {
read_ = new class PromiseIterator!(T[]) {
override Promise!ItValue next(Promise!bool) {
return readOne()
.then((chunk) => chunk ? ItValue(false, chunk) : ItValue(true));
}
};
}
return read_;
}
Promise!(T[]) readOne() nothrow {
ptrdiff_t posClosed = -1;
if (separator_.length > 0) {
posClosed = buffer.countUntilPartial(separator_);
}
if (posClosed >= 0) {
auto posOpen = posClosed + separator_.length;
// Found separator
if (posOpen <= buffer.length) {
auto output = buffer[0..posOpen];
buffer = buffer[posOpen..$];
return Promise!(T[]).resolved(output);
}
// Found part of the separator on end of buffer
if (posOpen > buffer.length && partialReceive_ && posClosed > 0) {
auto output = buffer[0..posClosed];
buffer = buffer[posClosed..$];
return Promise!(T[]).resolved(output);
}
} else if (limit_ > 0 && buffer.length >= limit_) {
auto output = buffer[0..limit_];
buffer = buffer[limit_..$];
return Promise!(T[]).resolved(output);
} else if (partialReceive_ && buffer.length > 0) {
auto output = buffer;
buffer = null;
return Promise!(T[]).resolved(output);
}
if (underlyingEof) {
return Promise!void.resolved()
.then(() {
enforce((!limit_ && !separator_) || partialReceive_, "EOF unexpected");
auto output = buffer;
buffer = null;
return Promise!(T[]).resolved(output);
});
}
return underlying.each((data) {
buffer ~= data;
return false;
}).then((eof) {
underlyingEof = eof;
}).then(() => readOne());
}
}
unittest {
auto a = new DelegatePromiseIterator!(const(ubyte)[]);
auto b = new Tokenizer!(const(ubyte))(a);
bool called = false;
bool eof = false;
b.read().each((data) {
assert(!called);
assert(data == "Hello world");
called = true;
}).then((_) {
assert(called);
assert(!eof);
eof = true;
}).nothrow_();
a.resolve(cast(const(ubyte)[])"Hello world").nothrow_();
a.resolve();
assert(eof);
}
unittest {
auto a = new DelegatePromiseIterator!(const(ubyte)[]);
auto b = new Tokenizer!(const(ubyte))(a);
b.separator("\r\n");
b.limit();
int call = 0;
b.read().each((data) {
switch(call++) {
case 0:
assert(data == "\r\n");
break;
case 1:
assert(data == "Hello\r\n");
break;
default: assert(false);
}
}).except((Exception e) {
assert(call++ == 2);
assert(e.msg == "EOF unexpected");
}).then(() {
assert(call++ == 3);
}).nothrow_();
a.resolve(cast(const(ubyte)[])"\r\nHello\r\nWorld").nothrow_();
assert(call == 2);
a.resolve();
assert(call == 4);
}
unittest {
auto a = new DelegatePromiseIterator!(const(ubyte)[]);
auto b = new Tokenizer!(const(ubyte))(a);
b.separator();
b.limit(3);
int call = 0;
b.read().each((data) {
switch(call++) {
case 0:
assert(data == "abc");
break;
case 1:
assert(data == "def");
break;
default: assert(false);
}
}).except((Exception e) {
assert(call++ == 2);
assert(e.msg == "EOF unexpected");
}).then(() {
assert(call++ == 3);
}).nothrow_();
a.resolve(cast(const(ubyte)[])"ab").nothrow_();
assert(call == 0);
a.resolve(cast(const(ubyte)[])"cdef").nothrow_();
assert(call == 2);
a.resolve(cast(const(ubyte)[])"gh").nothrow_();
assert(call == 2);
a.resolve();
assert(call == 4);
}
unittest {
auto a = new DelegatePromiseIterator!(const(ubyte)[]);
auto b = new Tokenizer!(const(ubyte))(a);
b.separator();
b.limit(3);
auto err = new Exception("yada");
int call = 0;
b.read().each((data) {
switch(call++) {
case 0:
assert(data == "abc");
break;
case 1:
assert(data == "def");
break;
default: assert(false);
}
}).then((_) {
assert(false);
}).except((Exception e) {
assert(e is err);
call++;
}).nothrow_();
a.resolve(cast(const(ubyte)[])"abcdefgh").nothrow_();
assert(call == 2);
a.reject(err).nothrow_();
assert(call == 3);
}
unittest {
auto a = new DelegatePromiseIterator!(const(ubyte)[]);
auto b = new Tokenizer!(const(ubyte))(a);
b.separator("ABCD");
b.limit();
b.partialReceive(true);
int call = 0;
b.read().each((data) {
switch(call++) {
case 0:
assert(data == "abc");
break;
case 1:
assert(data == "abcABCD");
break;
case 2:
assert(data == "abc");
break;
case 3:
assert(data == "abc");
break;
case 4:
assert(data == "def");
break;
case 5:
assert(data == "ab");
break;
case 6:
assert(data == "ABab");
break;
case 7:
assert(data == "ABCD");
break;
case 8:
assert(data == "ab");
break;
case 9:
assert(data == "AB");
break;
default: assert(false);
}
}).then((eof) {
assert(eof);
assert(call++ == 10);
}).nothrow_();
a.resolve(cast(const(ubyte)[])"abc").nothrow_();
assert(call == 1);
a.resolve(cast(const(ubyte)[])"abcABCDabc").nothrow_();
assert(call == 3);
b.separator();
b.limit(3);
a.resolve(cast(const(ubyte)[])"abcdef").nothrow_();
assert(call == 5);
b.separator("ABCD");
b.limit();
a.resolve(cast(const(ubyte)[])"abAB").nothrow_();
assert(call == 6);
a.resolve(cast(const(ubyte)[])"abAB").nothrow_();
assert(call == 7);
a.resolve(cast(const(ubyte)[])"CDabAB").nothrow_();
assert(call == 9);
a.resolve();
assert(call == 11);
}
|
D
|
module android.java.java.sql.Connection;
public import android.java.java.sql.Connection_d_interface;
import arsd.jni : ImportExportImpl;
mixin ImportExportImpl!Connection;
import import9 = android.java.java.sql.NClob;
import import3 = android.java.java.sql.DatabaseMetaData;
import import6 = android.java.java.sql.Savepoint;
import import1 = android.java.java.sql.PreparedStatement;
import import0 = android.java.java.sql.Statement;
import import2 = android.java.java.sql.CallableStatement;
import import13 = android.java.java.sql.Struct;
import import14 = android.java.java.lang.Class;
import import8 = android.java.java.sql.Blob;
import import10 = android.java.java.sql.SQLXML;
import import12 = android.java.java.sql.Array;
import import5 = android.java.java.util.Map;
import import7 = android.java.java.sql.Clob;
import import4 = android.java.java.sql.SQLWarning;
|
D
|
// Written in the D programming language
/++
Module containing some basic benchmarking and timing functionality.
For convenience, this module publicly imports $(MREF core,time).
$(SCRIPT inhibitQuickIndex = 1;)
$(BOOKTABLE,
$(TR $(TH Category) $(TH Functions))
$(TR $(TD Main functionality) $(TD
$(LREF StopWatch)
$(LREF benchmark)
))
$(TR $(TD Flags) $(TD
$(LREF AutoStart)
))
)
$(RED Unlike the other modules in std.datetime, this module is not currently
publicly imported in std.datetime.package, because the old
versions of this functionality which use
$(REF TickDuration,core,time) are in std.datetime.package and would
conflict with the symbols in this module. After the old symbols have
gone through the deprecation cycle and have been fully removed, then
this module will be publicly imported in std.datetime.package. The
old, deprecated symbols are currently scheduled to be removed from the
documentation in October 2018 and fully removed from Phobos in October
2019.)
So, for now, when using std.datetime.stopwatch, if other modules from
std.datetime are needed, then either import them individually rather than
importing std.datetime, or use selective or static imports to import
std.datetime.stopwatch. e.g.
----------------------------------------------------------------------------
import std.datetime;
import std.datetime.stopwatch : benchmark, StopWatch;
----------------------------------------------------------------------------
The compiler will then know to use the symbols from std.datetime.stopwatch
rather than the deprecated ones from std.datetime.package.
License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Jonathan M Davis and Kato Shoichi
Source: $(PHOBOSSRC std/datetime/_stopwatch.d)
+/
module std.datetime.stopwatch;
public import core.time;
import std.typecons : Flag;
/++
Used by StopWatch to indicate whether it should start immediately upon
construction.
If set to $(D AutoStart.no), then the StopWatch is not started when it is
constructed.
Otherwise, if set to $(D AutoStart.yes), then the StopWatch is started when
it is constructed.
+/
alias AutoStart = Flag!"autoStart";
/++
StopWatch is used to measure time just like one would do with a physical
stopwatch, including stopping, restarting, and/or resetting it.
$(REF MonoTime,core,time) is used to hold the time, and it uses the system's
monotonic clock, which is high precision and never counts backwards (unlike
the wall clock time, which $(I can) count backwards, which is why
$(REF SysTime,std,datetime,systime) should not be used for timing).
Note that the precision of StopWatch differs from system to system. It is
impossible for it to be the same for all systems, since the precision of the
system clock and other system-dependent and situation-dependent factors
(such as the overhead of a context switch between threads) varies from
system to system and can affect StopWatch's accuracy.
+/
struct StopWatch
{
public:
/++
Constructs a StopWatch. Whether it starts immediately depends on the
$(LREF AutoStart) argument.
If $(D StopWatch.init) is used, then the constructed StopWatch isn't
running (and can't be, since no constructor ran).
+/
this(AutoStart autostart) @safe nothrow @nogc
{
if (autostart)
start();
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
{
auto sw = StopWatch(AutoStart.yes);
assert(sw.running);
Thread.sleep(usecs(1));
assert(sw.peek() > Duration.zero);
}
{
auto sw = StopWatch(AutoStart.no);
assert(!sw.running);
Thread.sleep(usecs(1));
assert(sw.peek() == Duration.zero);
}
{
StopWatch sw;
assert(!sw.running);
Thread.sleep(usecs(1));
assert(sw.peek() == Duration.zero);
}
assert(StopWatch.init == StopWatch(AutoStart.no));
assert(StopWatch.init != StopWatch(AutoStart.yes));
}
/++
Resets the StopWatch.
The StopWatch can be reset while it's running, and resetting it while
it's running will not cause it to stop.
+/
void reset() @safe nothrow @nogc
{
if (_running)
_timeStarted = MonoTime.currTime;
_ticksElapsed = 0;
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
auto sw = StopWatch(AutoStart.yes);
Thread.sleep(usecs(1));
sw.stop();
assert(sw.peek() > Duration.zero);
sw.reset();
assert(sw.peek() == Duration.zero);
}
@system nothrow @nogc unittest
{
import core.thread : Thread;
auto sw = StopWatch(AutoStart.yes);
Thread.sleep(msecs(1));
assert(sw.peek() > msecs(1));
immutable before = MonoTime.currTime;
// Just in case the system clock is slow enough or the system is fast
// enough for the call to MonoTime.currTime inside of reset to get
// the same that we just got by calling MonoTime.currTime.
Thread.sleep(usecs(1));
sw.reset();
assert(sw.peek() < msecs(1));
assert(sw._timeStarted > before);
assert(sw._timeStarted <= MonoTime.currTime);
}
/++
Starts the StopWatch.
start should not be called if the StopWatch is already running.
+/
void start() @safe nothrow @nogc
in { assert(!_running, "start was called when the StopWatch was already running."); }
do
{
_running = true;
_timeStarted = MonoTime.currTime;
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
StopWatch sw;
assert(!sw.running);
assert(sw.peek() == Duration.zero);
sw.start();
assert(sw.running);
Thread.sleep(usecs(1));
assert(sw.peek() > Duration.zero);
}
/++
Stops the StopWatch.
stop should not be called if the StopWatch is not running.
+/
void stop() @safe nothrow @nogc
in { assert(_running, "stop was called when the StopWatch was not running."); }
do
{
_running = false;
_ticksElapsed += MonoTime.currTime.ticks - _timeStarted.ticks;
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
auto sw = StopWatch(AutoStart.yes);
assert(sw.running);
Thread.sleep(usecs(1));
immutable t1 = sw.peek();
assert(t1 > Duration.zero);
sw.stop();
assert(!sw.running);
immutable t2 = sw.peek();
assert(t2 >= t1);
immutable t3 = sw.peek();
assert(t2 == t3);
}
/++
Peek at the amount of time that the the StopWatch has been running.
This does not include any time during which the StopWatch was stopped but
does include $(I all) of the time that it was running and not just the
time since it was started last.
Calling $(LREF reset) will reset this to $(D Duration.zero).
+/
Duration peek() @safe const nothrow @nogc
{
enum hnsecsPerSecond = convert!("seconds", "hnsecs")(1);
immutable hnsecsMeasured = convClockFreq(_ticksElapsed, MonoTime.ticksPerSecond, hnsecsPerSecond);
return _running ? MonoTime.currTime - _timeStarted + hnsecs(hnsecsMeasured)
: hnsecs(hnsecsMeasured);
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
auto sw = StopWatch(AutoStart.no);
assert(sw.peek() == Duration.zero);
sw.start();
Thread.sleep(usecs(1));
assert(sw.peek() >= usecs(1));
Thread.sleep(usecs(1));
assert(sw.peek() >= usecs(2));
sw.stop();
immutable stopped = sw.peek();
Thread.sleep(usecs(1));
assert(sw.peek() == stopped);
sw.start();
Thread.sleep(usecs(1));
assert(sw.peek() > stopped);
}
@safe nothrow @nogc unittest
{
assert(StopWatch.init.peek() == Duration.zero);
}
/++
Sets the total time which the StopWatch has been running (i.e. what peek
returns).
The StopWatch does not have to be stopped for setTimeElapsed to be
called, nor will calling it cause the StopWatch to stop.
+/
void setTimeElapsed(Duration timeElapsed) @safe nothrow @nogc
{
enum hnsecsPerSecond = convert!("seconds", "hnsecs")(1);
_ticksElapsed = convClockFreq(timeElapsed.total!"hnsecs", hnsecsPerSecond, MonoTime.ticksPerSecond);
_timeStarted = MonoTime.currTime;
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
StopWatch sw;
sw.setTimeElapsed(hours(1));
// As discussed in MonoTime's documentation, converting between
// Duration and ticks is not exact, though it will be close.
// How exact it is depends on the frequency/resolution of the
// system's monotonic clock.
assert(abs(sw.peek() - hours(1)) < usecs(1));
sw.start();
Thread.sleep(usecs(1));
assert(sw.peek() > hours(1) + usecs(1));
}
/++
Returns whether this StopWatch is currently running.
+/
@property bool running() @safe const pure nothrow @nogc
{
return _running;
}
///
@safe nothrow @nogc unittest
{
StopWatch sw;
assert(!sw.running);
sw.start();
assert(sw.running);
sw.stop();
assert(!sw.running);
}
private:
// We track the ticks for the elapsed time rather than a Duration so that we
// don't lose any precision.
bool _running = false; // Whether the StopWatch is currently running
MonoTime _timeStarted; // The time the StopWatch started measuring (i.e. when it was started or reset).
long _ticksElapsed; // Total time that the StopWatch ran before it was stopped last.
}
/// Measure a time in milliseconds, microseconds, or nanoseconds
@safe nothrow @nogc unittest
{
auto sw = StopWatch(AutoStart.no);
sw.start();
// ... Insert operations to be timed here ...
sw.stop();
long msecs = sw.peek.total!"msecs";
long usecs = sw.peek.total!"usecs";
long nsecs = sw.peek.total!"nsecs";
assert(usecs >= msecs * 1000);
assert(nsecs >= usecs * 1000);
}
///
@system nothrow @nogc unittest
{
import core.thread : Thread;
auto sw = StopWatch(AutoStart.yes);
Duration t1 = sw.peek();
Thread.sleep(usecs(1));
Duration t2 = sw.peek();
assert(t2 > t1);
Thread.sleep(usecs(1));
sw.stop();
Duration t3 = sw.peek();
assert(t3 > t2);
Duration t4 = sw.peek();
assert(t3 == t4);
sw.start();
Thread.sleep(usecs(1));
Duration t5 = sw.peek();
assert(t5 > t4);
// If stopping or resetting the StopWatch is not required, then
// MonoTime can easily be used by itself without StopWatch.
auto before = MonoTime.currTime;
// do stuff...
auto timeElapsed = MonoTime.currTime - before;
}
/++
Benchmarks code for speed assessment and comparison.
Params:
fun = aliases of callable objects (e.g. function names). Each callable
object should take no arguments.
n = The number of times each function is to be executed.
Returns:
The amount of time (as a $(REF Duration,core,time)) that it took to call
each function $(D n) times. The first value is the length of time that
it took to call $(D fun[0]) $(D n) times. The second value is the length
of time it took to call $(D fun[1]) $(D n) times. Etc.
+/
Duration[fun.length] benchmark(fun...)(uint n)
{
Duration[fun.length] result;
auto sw = StopWatch(AutoStart.yes);
foreach (i, unused; fun)
{
sw.reset();
foreach (_; 0 .. n)
fun[i]();
result[i] = sw.peek();
}
return result;
}
///
@safe unittest
{
import std.conv : to;
int a;
void f0() {}
void f1() { auto b = a; }
void f2() { auto b = to!string(a); }
auto r = benchmark!(f0, f1, f2)(10_000);
Duration f0Result = r[0]; // time f0 took to run 10,000 times
Duration f1Result = r[1]; // time f1 took to run 10,000 times
Duration f2Result = r[2]; // time f2 took to run 10,000 times
}
@safe nothrow unittest
{
import std.conv : to;
int a;
void f0() nothrow {}
void f1() nothrow { auto b = to!string(a); }
auto r = benchmark!(f0, f1)(1000);
assert(r[0] > Duration.zero);
assert(r[1] > Duration.zero);
assert(r[1] > r[0]);
assert(r[0] < seconds(1));
assert(r[1] < seconds(1));
}
@safe nothrow @nogc unittest
{
int f0Count;
int f1Count;
int f2Count;
void f0() nothrow @nogc { ++f0Count; }
void f1() nothrow @nogc { ++f1Count; }
void f2() nothrow @nogc { ++f2Count; }
auto r = benchmark!(f0, f1, f2)(552);
assert(f0Count == 552);
assert(f1Count == 552);
assert(f2Count == 552);
}
|
D
|
module mach.text.escape;
public:
import mach.text.escape.escaper;
import mach.text.escape.exceptions;
import mach.text.escape.unescape;
version(unittest){
private:
import mach.test;
import mach.range : consume, equals, any;
void CommonTests(in Escaper esc){
tests("Common", {
tests("Escape", {
test!equals(esc.escape(""), ``);
test!equals(esc.escape(" "), ` `);
test!equals(esc.escape("x"), `x`);
test!equals(esc.escape("test"), `test`);
test!equals(esc.escape("\\"), `\\`);
test!equals(esc.escape("\\\\"), `\\\\`);
test!equals(esc.utf8escape(""), ``);
test!equals(esc.utf8escape(" "), ` `);
test!equals(esc.utf8escape("x"), `x`);
test!equals(esc.utf8escape("test"), `test`);
test!equals(esc.utf8escape("\\"), `\\`);
test!equals(esc.utf8escape("\\\\"), `\\\\`);
});
tests("Unescape", {
test!equals(esc.unescape(``), "");
test!equals(esc.unescape(` `), " ");
test!equals(esc.unescape(`x`), "x");
test!equals(esc.unescape(`test`), "test");
test!equals(esc.unescape(`\\`), "\\");
test!equals(esc.unescape(`\\\\`), "\\\\");
testfail({esc.unescape(`\`).consume;});
testfail({esc.unescape(`\\\`).consume;});
});
});
tests("Pairs", {
if(esc.pairs.any!(e => e.original == '"')){
test!equals(esc.escape("\""), `\"`);
test!equals(esc.escape("\"quotes\""), `\"quotes\"`);
test!equals(esc.utf8escape("\""), `\"`);
test!equals(esc.utf8escape("\"quotes\""), `\"quotes\"`);
test!equals(esc.unescape(`\"`), "\"");
test!equals(esc.unescape(`\"quotes\"`), "\"quotes\"");
}
if(esc.pairs.any!(e => e.original == '\t')){
test!equals(esc.escape("\t"), `\t`);
test!equals(esc.escape("\t-tab"), `\t-tab`);
test!equals(esc.utf8escape("\t"), `\t`);
test!equals(esc.utf8escape("\t-tab"), `\t-tab`);
test!equals(esc.unescape(`\t`), "\t");
test!equals(esc.unescape(`\t-tab`), "\t-tab");
}
});
tests("\\x", {
if(esc.xesc){
tests("Escape", {
test!equals(esc.escape("\x05"), `\x05`);
test!equals(esc.escape("\x05\x06"), `\x05\x06`);
test!equals(esc.escape("\x01\x02\x03"), `\x01\x02\x03`);
test!equals(esc.utf8escape("\x05"), `\x05`);
test!equals(esc.utf8escape("\x05\x06"), `\x05\x06`);
test!equals(esc.utf8escape("\xE3\x83\x84"), `\xE3\x83\x84`);
test!equals(esc.utf8escape("\x01\x02\x03"), `\x01\x02\x03`);
});
tests("Unescape", {
test!equals(esc.unescape(`\x05`), "\x05");
test!equals(esc.unescape(`\x05\x06`), "\x05\x06");
test!equals(esc.unescape(`\xE3\x83\x84`), "\xE3\x83\x84");
test!equals(esc.unescape(`\x01\x02\x03`), "\x01\x02\x03");
});
}else{
testfail({esc.unescape(`\x05`);});
testfail({esc.unescape(`\x05\x06`);});
}
});
tests("\\u", {
if(esc.u16esc){
if(!esc.xesc) tests("Escape", {
test!equals(esc.escape("\u1E02"d), `\u1E02`);
test!equals(esc.escape("\u1E02\u1E03"d), `\u1E02\u1E03`);
test!equals(esc.escape("\u03D5\u03D6"d), `\u03D5\u03D6`);
test!equals(esc.escape("hi\u03D5\u03D6hi"d), `hi\u03D5\u03D6hi`);
static assert(!is(typeof({esc.utf8escape("\u1E02"d);})));
});
tests("Unescape", {
test!equals(esc.unescape(`\u1E02`), "\u1E02");
test!equals(esc.unescape(`\u1E02\u1E03`), "\u1E02\u1E03");
test!equals(esc.unescape(`\u03D5\u03D6`), "\u03D5\u03D6");
test!equals(esc.unescape(`hi\u03D5\u03D6hi`), "hi\u03D5\u03D6hi");
});
}else{
testfail({esc.unescape(`\u1E02`);});
testfail({esc.unescape(`\u1E02\u1E03`);});
}
});
tests("\\U", {
if(esc.u32esc){
if(!esc.xesc) tests("Escape", {
test!equals(esc.escape("\U0001F603"d), `\U0001F603`);
test!equals(esc.escape("\U0001F603\U0001F604"d), `\U0001F603\U0001F604`);
test!equals(esc.escape("hi\U0001F603hi"d), `hi\U0001F603hi`);
});
tests("Unescape", {
test!equals(esc.unescape(`\U0001F603`), "\U0001F603");
test!equals(esc.unescape(`\U0001F603\U0001F604`), "\U0001F603\U0001F604");
test!equals(esc.unescape(`hi\U0001F603hi`), "hi\U0001F603hi");
});
}else{
testfail({esc.unescape(`\U0001F603`);});
testfail({esc.unescape(`\U0001F603\U0001F604`);});
}
});
tests("Octal", {
if(esc.octesc){
if(!esc.xesc) tests("Escape", {
test!equals(esc.escape("\0"), `\0`);
test!equals(esc.escape("\1\2\3"), `\1\2\3`);
test!equals(esc.escape("hi\1\2\3hi"), `hi\1\2\3hi`);
});
tests("Unescape", {
test!equals(esc.unescape(`\0`), "\0");
test!equals(esc.unescape(`\1\2\3`), "\1\2\3");
test!equals(esc.unescape(`hi\1\2\3hi`), "hi\1\2\3hi");
if(esc.octesclength >= 2) test!equals(esc.unescape(`\41\41\41`), "!!!");
if(esc.octesclength >= 3) test!equals(esc.unescape(`\101\102\103`), "ABC");
if(esc.octesclength == 1) test!equals(esc.unescape(`\50`), "\x050");
if(esc.octesclength == 2) test!equals(esc.unescape(`\410`), "!0");
if(esc.octesclength == 3) test!equals(esc.unescape(`\1010`), "A0");
});
}else{
testfail({esc.unescape(`\1`);});
testfail({esc.unescape(`\1\2\3`);});
testfail({esc.unescape(`\101\102\103`);});
}
});
tests("Named", {
if(esc.nameesc){
if(!esc.xesc && !esc.u16esc && !esc.u32esc) tests("Escape", {
test!equals(esc.escape("\α"d), `\α`);
test!equals(esc.escape("\α\β\γ"d), `\α\β\γ`);
test!equals(esc.escape("hi\α\β\γhi"d), `hi\α\β\γhi`);
});
tests("Unescape", {
test!equals(esc.unescape(`\&`), "\&");
test!equals(esc.unescape(`\α\β\γ`), "\α\β\γ");
test!equals(esc.unescape(`hi\α\β\γhi`), "hi\α\β\γhi");
});
tests("Multi-code-point sequences", {
if(esc.nameescmulti){
test!equals(esc.unescape(`\⪭︀`), "\u2AAD\uFE00");
}else{
testfail({esc.unescape(`\⪭︀`);});
}
});
}else{
testfail({esc.unescape(`\&`);});
testfail({esc.unescape(`\α\β\γ`);});
}
});
}
}
unittest{
tests("Escaper", {
tests("Only \\x", {
immutable Escaper xesc = {xesc: true};
CommonTests(xesc);
});
tests("Only \\u", {
immutable Escaper u16 = {u16esc: true};
CommonTests(u16);
});
tests("Only \\U", {
immutable Escaper u32 = {u32esc: true};
CommonTests(u32);
});
tests("Only octal", {
immutable Escaper oct1 = {octesc: true, octesclength: 1};
CommonTests(oct1);
immutable Escaper oct2 = {octesc: true, octesclength: 2};
CommonTests(oct2);
immutable Escaper oct3 = {octesc: true, octesclength: 3};
CommonTests(oct3);
});
tests("Only named", {
immutable Escaper name1 = {nameesc: true, nameescmulti: false};
CommonTests(name1);
immutable Escaper namen = {nameesc: true, nameescmulti: true};
CommonTests(namen);
});
tests("D", {
CommonTests(Escaper.D);
});
tests("Unprintable", {
immutable Escaper cool = {unprintable: true};
CommonTests(cool);
test!equals(cool.escape("\x00"), "\x00");
immutable Escaper dumb = {unprintable: false};
CommonTests(dumb);
testfail({dumb.escape("\x00");});
});
});
}
|
D
|
module calc.ast.differentiator;
import calc.ast.node;
import calc.ast.visitor;
struct Differentiator
{
mixin Visitor;
Expression differentiate(Expression node, string x)
in
{
assert(node);
}
body
{
return this.dispatch!"this.visit"(node, x);
}
private Expression visit(Number node, string x)
{
return new Number(0);
}
private Expression visit(Variable node, string x)
{
return (node.name == x) ? new Number(1) : new Number(0);
}
private Expression visit(Addition node, string x)
{
return new Addition(this.differentiate(node.left, x), this.differentiate(node.right, x));
}
private Expression visit(Subtraction node, string x)
{
return new Subtraction(this.differentiate(node.left, x), this.differentiate(node.right, x));
}
private Expression visit(Multiplication node, string x)
{
auto left = new Multiplication(this.differentiate(node.left, x), node.right);
auto right = new Multiplication(node.left, this.differentiate(node.right, x));
return new Addition(left, right);
}
private Expression visit(Division node, string x)
{
auto left = new Multiplication(this.differentiate(node.left, x), node.right);
auto right = new Multiplication(node.left, this.differentiate(node.right, x));
auto denom = new Power(node.right, new Number(2));
return new Division(new Subtraction(left, right), denom);
}
private Expression visit(Power node, string x)
{
auto left = new Multiplication(this.differentiate(node.right, x), new Logarithm(node.left));
auto right = new Multiplication(node.right, new Division(this.differentiate(node.left, x), node.left));
return new Multiplication(node, new Addition(left, right));
}
private Expression visit(Positive node, string x)
{
return new Positive(this.differentiate(node.operand, x));
}
private Expression visit(Negative node, string x)
{
return new Negative(this.differentiate(node.operand, x));
}
private Expression visit(Logarithm node, string x)
{
return new Division(this.differentiate(node.operand, x), node.operand);
}
private Expression visit(Sine node, string x)
{
return new Multiplication(this.differentiate(node.operand, x), new Cosine(node.operand));
}
private Expression visit(Cosine node, string x)
{
return new Negative(new Multiplication(this.differentiate(node.operand, x), new Sine(node.operand)));
}
private Expression visit(Tangent node, string x)
{
return new Division(this.differentiate(node.operand, x), new Power(new Cosine(node.operand), new Number(2)));
}
}
|
D
|
module google.protobuf.any;
import std.json : JSONValue;
import std.typecons : Flag, No, Yes;
import google.protobuf;
enum defaultUrlPrefix = "type.googleapis.com";
struct Any
{
private struct _Message
{
@Proto(1) string typeUrl = protoDefaultValue!string;
@Proto(2) bytes value = protoDefaultValue!bytes;
}
string typeUrl;
private bool valueIsJSON;
private union {
bytes protoValue;
JSONValue jsonValue;
}
T to(T)(string urlPrefix = defaultUrlPrefix)
{
import std.exception : enforce;
import std.format : format;
enforce!ProtobufException(isMessageType!T(urlPrefix),
"Incompatible target type `%s` for Any message of type '%s'".format(messageTypeUrl!T(urlPrefix), typeUrl));
if (valueIsJSON)
{
return jsonValue.fromJSONValue!T;
}
else
{
return protoValue.fromProtobuf!T;
}
}
Any from(T)(T value, string urlPrefix = defaultUrlPrefix)
{
import std.array : array;
typeUrl = messageTypeUrl!T(urlPrefix);
protoValue = value.toProtobuf.array;
valueIsJSON = false;
return this;
}
bool isMessageType(T)(string urlPrefix = defaultUrlPrefix)
{
return typeUrl == messageTypeUrl!T(urlPrefix);
}
auto toProtobuf()
{
import std.array : array;
import std.exception : enforce;
import std.format : format;
import std.json : JSON_TYPE;
if (valueIsJSON) {
enforce!ProtobufException(typeUrl in messageTypes,
"Cannot handle 'Any' message: type '%s' is not registered".format(typeUrl));
enforce!ProtobufException(jsonValue.type == JSON_TYPE.OBJECT,
"'Any' message JSON encoding must be an object");
JSONValue jsonMapping;
if (messageTypes[typeUrl].hasSpecialJSONMapping)
{
enforce!ProtobufException("value" in jsonValue.object,
"'Any' message with special JSON mapping must have a 'value' entry");
jsonMapping = jsonValue.object["value"];
}
else
{
jsonMapping = jsonValue;
}
return _Message(typeUrl, messageTypes[typeUrl].JSONValueToProtobuf(jsonMapping).array).toProtobuf;
}
return _Message(typeUrl, protoValue).toProtobuf;
}
Any fromProtobuf(R)(ref R inputRange)
{
auto message = inputRange.fromProtobuf!_Message;
typeUrl = message.typeUrl;
protoValue = message.value;
valueIsJSON = false;
return this;
}
JSONValue toJSONValue()()
{
import std.format : format;
import std.exception : enforce;
import std.json : JSON_TYPE;
if (!valueIsJSON) {
enforce!ProtobufException(typeUrl in messageTypes,
"Cannot handle 'Any' message: type '%s' is not registered".format(typeUrl));
auto result = messageTypes[typeUrl].protobufToJSONValue(protoValue);
if (messageTypes[typeUrl].hasSpecialJSONMapping)
{
return JSONValue([
"@type": JSONValue(typeUrl),
"value": result,
]);
}
enforce!ProtobufException(result.type == JSON_TYPE.OBJECT,
"'Any' message of type '%s' with no special JSON mapping is not an JSON object".format(typeUrl));
result.object["@type"] = typeUrl;
return result;
}
enforce!ProtobufException(jsonValue.type == JSON_TYPE.OBJECT, "'Any' message JSON encoding must be an object");
jsonValue.object["@type"] = typeUrl;
return jsonValue;
}
Any fromJSONValue()(JSONValue value)
{
import std.exception : enforce;
import std.json : JSON_TYPE;
if (value.type == JSON_TYPE.NULL)
{
typeUrl = "";
protoValue = [];
valueIsJSON = false;
return this;
}
enforce!ProtobufException(value.type == JSON_TYPE.OBJECT, "Invalid 'Any' JSON encoding");
enforce!ProtobufException("@type" in value.object, "No type specified for 'Any' JSON encoding");
enforce!ProtobufException(value.object["@type"].type == JSON_TYPE.STRING, "Any typeUrl should be a string");
typeUrl = value.object["@type"].str;
jsonValue = value;
valueIsJSON = true;
return this;
}
static EncodingInfo[string] messageTypes;
static registerMessageType(T, Flag!"hasSpecialJSONMapping" hasSpecialJSONMapping = No.hasSpecialJSONMapping)
(string urlPrefix = defaultUrlPrefix)
{
import std.array : array;
import std.exception : enforce;
import std.format : format;
string url = messageTypeUrl!T(urlPrefix);
enforce!ProtobufException(url !in messageTypes, "Message type '%s' already registered".format(url));
messageTypes[url] = EncodingInfo(function(bytes input) => input.fromProtobuf!T.toJSONValue,
function(JSONValue input) => input.fromJSONValue!T.toProtobuf.array, hasSpecialJSONMapping);
}
struct EncodingInfo
{
JSONValue function(bytes) protobufToJSONValue;
bytes function(JSONValue) JSONValueToProtobuf;
bool hasSpecialJSONMapping;
}
}
// move following imports to static this() when dmd issue 18188 is solved
import google.protobuf.duration : Duration;
import google.protobuf.empty : Empty;
import google.protobuf.field_mask : FieldMask;
import google.protobuf.struct_ : ListValue, NullValue, Struct, Value;
import google.protobuf.timestamp : Timestamp;
import google.protobuf.wrappers : BoolValue, BytesValue, DoubleValue, FloatValue, Int32Value, Int64Value, StringValue,
UInt32Value, UInt64Value;
static this()
{
Any.registerMessageType!(Any, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(BoolValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(BytesValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(DoubleValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Duration, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Empty, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(FieldMask, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(FloatValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Int32Value, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Int64Value, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(ListValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(NullValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(StringValue, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Struct, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Timestamp, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(UInt32Value, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(UInt64Value, Yes.hasSpecialJSONMapping);
Any.registerMessageType!(Value, Yes.hasSpecialJSONMapping);
}
unittest
{
struct Foo
{
enum messageTypeFullName = "Foo";
@Proto(1) int intField = protoDefaultValue!int;
@Proto(2) string stringField = protoDefaultValue!string;
}
auto foo1 = Foo(42, "abc");
Any anyFoo;
assert(!anyFoo.isMessageType!Foo("my.prefix"));
anyFoo.from(foo1, "my.prefix");
auto foo2 = anyFoo.to!Foo("my.prefix");
assert(anyFoo.isMessageType!Foo("my.prefix"));
assert(anyFoo.typeUrl == "my.prefix/Foo");
assert(foo1 == foo2);
}
enum messageTypeFullName(T) = {
import std.algorithm : splitter;
import std.array : join, split;
import std.traits : fullyQualifiedName, hasMember;
static if (hasMember!(T, "messageTypeFullName"))
{
return T.messageTypeFullName;
}
else
{
enum splitName = fullyQualifiedName!T.split(".");
return (splitName[0 .. $ - 2] ~ splitName[$ - 1]).join(".");
}
}();
unittest
{
import google.protobuf.duration : Duration;
import google.protobuf.empty : Empty;
import google.protobuf.field_mask : FieldMask;
import google.protobuf.struct_ : ListValue, NullValue, Struct, Value;
import google.protobuf.timestamp : Timestamp;
import google.protobuf.wrappers : BoolValue, BytesValue, DoubleValue, FloatValue, Int32Value, Int64Value,
StringValue, UInt32Value, UInt64Value;
static assert(messageTypeFullName!Any == "google.protobuf.Any");
static assert(messageTypeFullName!BoolValue == "google.protobuf.BoolValue");
static assert(messageTypeFullName!BytesValue == "google.protobuf.BytesValue");
static assert(messageTypeFullName!DoubleValue == "google.protobuf.DoubleValue");
static assert(messageTypeFullName!Duration == "google.protobuf.Duration");
static assert(messageTypeFullName!Empty == "google.protobuf.Empty");
static assert(messageTypeFullName!FieldMask == "google.protobuf.FieldMask");
static assert(messageTypeFullName!FloatValue == "google.protobuf.FloatValue");
static assert(messageTypeFullName!Int32Value == "google.protobuf.Int32Value");
static assert(messageTypeFullName!Int64Value == "google.protobuf.Int64Value");
static assert(messageTypeFullName!ListValue == "google.protobuf.ListValue");
static assert(messageTypeFullName!NullValue == "google.protobuf.NullValue");
static assert(messageTypeFullName!StringValue == "google.protobuf.StringValue");
static assert(messageTypeFullName!Struct == "google.protobuf.Struct");
static assert(messageTypeFullName!Timestamp == "google.protobuf.Timestamp");
static assert(messageTypeFullName!UInt32Value == "google.protobuf.UInt32Value");
static assert(messageTypeFullName!UInt64Value == "google.protobuf.UInt64Value");
static assert(messageTypeFullName!Value == "google.protobuf.Value");
}
string messageTypeUrl(T)(string urlPrefix = defaultUrlPrefix)
{
return urlPrefix ~ "/" ~ messageTypeFullName!T;
}
|
D
|
/Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/DerivedData/Lister/Build/Intermediates/Lister.build/Debug-iphonesimulator/Lister.build/Objects-normal/x86_64/AppDelegate.o : /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListDocumentsViewController.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/AppLaunchContext.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/NewListDocumentController.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListItemCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListColorCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/AppDelegate.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/UnicodeShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RuntimeStubs.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RuntimeShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RefCount.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/HeapObject.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/GlobalObjects.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/FoundationShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/SwiftStddef.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/DarwinShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/SwiftStdint.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/CoreFoundationShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/module.map /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Security.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/WatchConnectivity.swiftmodule /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/DerivedData/Lister/Build/Products/Debug-iphonesimulator/ListerKit.framework/Modules/ListerKit.swiftmodule/x86_64.swiftmodule
/Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/DerivedData/Lister/Build/Intermediates/Lister.build/Debug-iphonesimulator/Lister.build/Objects-normal/x86_64/AppDelegate~partial.swiftmodule : /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListDocumentsViewController.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/AppLaunchContext.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/NewListDocumentController.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListItemCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListColorCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/AppDelegate.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/UnicodeShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RuntimeStubs.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RuntimeShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RefCount.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/HeapObject.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/GlobalObjects.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/FoundationShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/SwiftStddef.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/DarwinShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/SwiftStdint.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/CoreFoundationShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/module.map /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Security.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/WatchConnectivity.swiftmodule /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/DerivedData/Lister/Build/Products/Debug-iphonesimulator/ListerKit.framework/Modules/ListerKit.swiftmodule/x86_64.swiftmodule
/Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/DerivedData/Lister/Build/Intermediates/Lister.build/Debug-iphonesimulator/Lister.build/Objects-normal/x86_64/AppDelegate~partial.swiftdoc : /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListDocumentsViewController.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/AppLaunchContext.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/NewListDocumentController.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListItemCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListColorCell.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/AppDelegate.swift /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/Lister/ListViewController.swift /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/UnicodeShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RuntimeStubs.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RuntimeShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/RefCount.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/HeapObject.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/GlobalObjects.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/FoundationShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/SwiftStddef.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/DarwinShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/SwiftStdint.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/CoreFoundationShims.h /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/shims/module.map /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Security.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/WatchConnectivity.swiftmodule /Users/keithelliott/Downloads/ListerforwatchOSiOSandOSX/Swift/DerivedData/Lister/Build/Products/Debug-iphonesimulator/ListerKit.framework/Modules/ListerKit.swiftmodule/x86_64.swiftmodule
|
D
|
// Written in the D programming language.
/**
This module implements a
$(HTTP erdani.org/publications/cuj-04-2002.html,discriminated union)
type (a.k.a.
$(HTTP en.wikipedia.org/wiki/Tagged_union,tagged union),
$(HTTP en.wikipedia.org/wiki/Algebraic_data_type,algebraic type)).
Such types are useful
for type-uniform binary interfaces, interfacing with scripting
languages, and comfortable exploratory programming.
A $(LREF Variant) object can hold a value of any type, with very few
restrictions (such as `shared` types and noncopyable types). Setting the value
is as immediate as assigning to the `Variant` object. To read back the value of
the appropriate type `T`, use the $(LREF get!T) call. To query whether a
`Variant` currently holds a value of type `T`, use $(LREF peek!T). To fetch the
exact type currently held, call $(LREF type), which returns the `TypeInfo` of
the current value.
In addition to $(LREF Variant), this module also defines the $(LREF Algebraic)
type constructor. Unlike `Variant`, `Algebraic` only allows a finite set of
types, which are specified in the instantiation (e.g. $(D Algebraic!(int,
string)) may only hold an `int` or a `string`).
Credits: Reviewed by Brad Roberts. Daniel Keep provided a detailed code review
prompting the following improvements: (1) better support for arrays; (2) support
for associative arrays; (3) friendlier behavior towards the garbage collector.
Copyright: Copyright Andrei Alexandrescu 2007 - 2015.
License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(HTTP erdani.org, Andrei Alexandrescu)
Source: $(PHOBOSSRC std/_variant.d)
*/
module std.variant;
import std.meta, std.traits, std.typecons;
///
@system unittest
{
Variant a; // Must assign before use, otherwise exception ensues
// Initialize with an integer; make the type int
Variant b = 42;
assert(b.type == typeid(int));
// Peek at the value
assert(b.peek!(int) !is null && *b.peek!(int) == 42);
// Automatically convert per language rules
auto x = b.get!(real);
// Assign any other type, including other variants
a = b;
a = 3.14;
assert(a.type == typeid(double));
// Implicit conversions work just as with built-in types
assert(a < b);
// Check for convertibility
assert(!a.convertsTo!(int)); // double not convertible to int
// Strings and all other arrays are supported
a = "now I'm a string";
assert(a == "now I'm a string");
// can also assign arrays
a = new int[42];
assert(a.length == 42);
a[5] = 7;
assert(a[5] == 7);
// Can also assign class values
class Foo {}
auto foo = new Foo;
a = foo;
assert(*a.peek!(Foo) == foo); // and full type information is preserved
}
/++
Gives the $(D sizeof) the largest type given.
+/
template maxSize(T...)
{
static if (T.length == 1)
{
enum size_t maxSize = T[0].sizeof;
}
else
{
import std.algorithm.comparison : max;
enum size_t maxSize = max(T[0].sizeof, maxSize!(T[1 .. $]));
}
}
///
@safe unittest
{
static assert(maxSize!(int, long) == 8);
static assert(maxSize!(bool, byte) == 1);
struct Cat { int a, b, c; }
static assert(maxSize!(bool, Cat) == 12);
}
struct This;
private alias This2Variant(V, T...) = AliasSeq!(ReplaceType!(This, V, T));
/**
* Back-end type seldom used directly by user
* code. Two commonly-used types using $(D VariantN) are:
*
* $(OL $(LI $(LREF Algebraic): A closed discriminated union with a
* limited type universe (e.g., $(D Algebraic!(int, double,
* string)) only accepts these three types and rejects anything
* else).) $(LI $(LREF Variant): An open discriminated union allowing an
* unbounded set of types. If any of the types in the $(D Variant)
* are larger than the largest built-in type, they will automatically
* be boxed. This means that even large types will only be the size
* of a pointer within the $(D Variant), but this also implies some
* overhead. $(D Variant) can accommodate all primitive types and
* all user-defined types.))
*
* Both $(D Algebraic) and $(D Variant) share $(D
* VariantN)'s interface. (See their respective documentations below.)
*
* $(D VariantN) is a discriminated union type parameterized
* with the largest size of the types stored ($(D maxDataSize))
* and with the list of allowed types ($(D AllowedTypes)). If
* the list is empty, then any type up of size up to $(D
* maxDataSize) (rounded up for alignment) can be stored in a
* $(D VariantN) object without being boxed (types larger
* than this will be boxed).
*
*/
struct VariantN(size_t maxDataSize, AllowedTypesParam...)
{
/**
The list of allowed types. If empty, any type is allowed.
*/
alias AllowedTypes = This2Variant!(VariantN, AllowedTypesParam);
private:
// Compute the largest practical size from maxDataSize
struct SizeChecker
{
int function() fptr;
ubyte[maxDataSize] data;
}
enum size = SizeChecker.sizeof - (int function()).sizeof;
/** Tells whether a type $(D T) is statically _allowed for
* storage inside a $(D VariantN) object by looking
* $(D T) up in $(D AllowedTypes).
*/
public template allowed(T)
{
enum bool allowed
= is(T == VariantN)
||
//T.sizeof <= size &&
(AllowedTypes.length == 0 || staticIndexOf!(T, AllowedTypes) >= 0);
}
// Each internal operation is encoded with an identifier. See
// the "handler" function below.
enum OpID { getTypeInfo, get, compare, equals, testConversion, toString,
index, indexAssign, catAssign, copyOut, length,
apply, postblit, destruct }
// state
ptrdiff_t function(OpID selector, ubyte[size]* store, void* data) fptr
= &handler!(void);
union
{
ubyte[size] store;
// conservatively mark the region as pointers
static if (size >= (void*).sizeof)
void*[size / (void*).sizeof] p;
}
// internals
// Handler for an uninitialized value
static ptrdiff_t handler(A : void)(OpID selector, ubyte[size]*, void* parm)
{
switch (selector)
{
case OpID.getTypeInfo:
*cast(TypeInfo *) parm = typeid(A);
break;
case OpID.copyOut:
auto target = cast(VariantN *) parm;
target.fptr = &handler!(A);
// no need to copy the data (it's garbage)
break;
case OpID.compare:
case OpID.equals:
auto rhs = cast(const VariantN *) parm;
return rhs.peek!(A)
? 0 // all uninitialized are equal
: ptrdiff_t.min; // uninitialized variant is not comparable otherwise
case OpID.toString:
string * target = cast(string*) parm;
*target = "<Uninitialized VariantN>";
break;
case OpID.postblit:
case OpID.destruct:
break;
case OpID.get:
case OpID.testConversion:
case OpID.index:
case OpID.indexAssign:
case OpID.catAssign:
case OpID.length:
throw new VariantException(
"Attempt to use an uninitialized VariantN");
default: assert(false, "Invalid OpID");
}
return 0;
}
// Handler for all of a type's operations
static ptrdiff_t handler(A)(OpID selector, ubyte[size]* pStore, void* parm)
{
import std.conv : to;
static A* getPtr(void* untyped)
{
if (untyped)
{
static if (A.sizeof <= size)
return cast(A*) untyped;
else
return *cast(A**) untyped;
}
return null;
}
static ptrdiff_t compare(A* rhsPA, A* zis, OpID selector)
{
static if (is(typeof(*rhsPA == *zis)))
{
if (*rhsPA == *zis)
{
return 0;
}
static if (is(typeof(*zis < *rhsPA)))
{
// Many types (such as any using the default Object opCmp)
// will throw on an invalid opCmp, so do it only
// if the caller requests it.
if (selector == OpID.compare)
return *zis < *rhsPA ? -1 : 1;
else
return ptrdiff_t.min;
}
else
{
// Not equal, and type does not support ordering
// comparisons.
return ptrdiff_t.min;
}
}
else
{
// Type does not support comparisons at all.
return ptrdiff_t.min;
}
}
auto zis = getPtr(pStore);
// Input: TypeInfo object
// Output: target points to a copy of *me, if me was not null
// Returns: true iff the A can be converted to the type represented
// by the incoming TypeInfo
static bool tryPutting(A* src, TypeInfo targetType, void* target)
{
alias UA = Unqual!A;
alias MutaTypes = AliasSeq!(UA, ImplicitConversionTargets!UA);
alias ConstTypes = staticMap!(ConstOf, MutaTypes);
alias SharedTypes = staticMap!(SharedOf, MutaTypes);
alias SharedConstTypes = staticMap!(SharedConstOf, MutaTypes);
alias ImmuTypes = staticMap!(ImmutableOf, MutaTypes);
static if (is(A == immutable))
alias AllTypes = AliasSeq!(ImmuTypes, ConstTypes, SharedConstTypes);
else static if (is(A == shared))
{
static if (is(A == const))
alias AllTypes = SharedConstTypes;
else
alias AllTypes = AliasSeq!(SharedTypes, SharedConstTypes);
}
else
{
static if (is(A == const))
alias AllTypes = ConstTypes;
else
alias AllTypes = AliasSeq!(MutaTypes, ConstTypes);
}
foreach (T ; AllTypes)
{
if (targetType != typeid(T))
continue;
static if (is(typeof(*cast(T*) target = *src)) ||
is(T == const(U), U) ||
is(T == shared(U), U) ||
is(T == shared const(U), U) ||
is(T == immutable(U), U))
{
import std.conv : emplaceRef;
auto zat = cast(T*) target;
if (src)
{
static if (T.sizeof > 0)
assert(target, "target must be non-null");
emplaceRef(*cast(Unqual!T*) zat, *cast(UA*) src);
}
}
else
{
// type T is not constructible from A
if (src)
assert(false, A.stringof);
}
return true;
}
return false;
}
switch (selector)
{
case OpID.getTypeInfo:
*cast(TypeInfo *) parm = typeid(A);
break;
case OpID.copyOut:
auto target = cast(VariantN *) parm;
assert(target);
static if (target.size < A.sizeof)
{
if (target.type.tsize < A.sizeof)
*cast(A**)&target.store = new A;
}
tryPutting(zis, typeid(A), cast(void*) getPtr(&target.store))
|| assert(false);
target.fptr = &handler!(A);
break;
case OpID.get:
auto t = * cast(Tuple!(TypeInfo, void*)*) parm;
return !tryPutting(zis, t[0], t[1]);
case OpID.testConversion:
return !tryPutting(null, *cast(TypeInfo*) parm, null);
case OpID.compare:
case OpID.equals:
auto rhsP = cast(VariantN *) parm;
auto rhsType = rhsP.type;
// Are we the same?
if (rhsType == typeid(A))
{
// cool! Same type!
auto rhsPA = getPtr(&rhsP.store);
return compare(rhsPA, zis, selector);
}
else if (rhsType == typeid(void))
{
// No support for ordering comparisons with
// uninitialized vars
return ptrdiff_t.min;
}
VariantN temp;
// Do I convert to rhs?
if (tryPutting(zis, rhsType, &temp.store))
{
// cool, I do; temp's store contains my data in rhs's type!
// also fix up its fptr
temp.fptr = rhsP.fptr;
// now lhsWithRhsType is a full-blown VariantN of rhs's type
if (selector == OpID.compare)
return temp.opCmp(*rhsP);
else
return temp.opEquals(*rhsP) ? 0 : 1;
}
// Does rhs convert to zis?
auto t = tuple(typeid(A), &temp.store);
if (rhsP.fptr(OpID.get, &rhsP.store, &t) == 0)
{
// cool! Now temp has rhs in my type!
auto rhsPA = getPtr(&temp.store);
return compare(rhsPA, zis, selector);
}
return ptrdiff_t.min; // dunno
case OpID.toString:
auto target = cast(string*) parm;
static if (is(typeof(to!(string)(*zis))))
{
*target = to!(string)(*zis);
break;
}
// TODO: The following test evaluates to true for shared objects.
// Use __traits for now until this is sorted out.
// else static if (is(typeof((*zis).toString)))
else static if (__traits(compiles, {(*zis).toString();}))
{
*target = (*zis).toString();
break;
}
else
{
throw new VariantException(typeid(A), typeid(string));
}
case OpID.index:
auto result = cast(Variant*) parm;
static if (isArray!(A) && !is(Unqual!(typeof(A.init[0])) == void))
{
// array type; input and output are the same VariantN
size_t index = result.convertsTo!(int)
? result.get!(int) : result.get!(size_t);
*result = (*zis)[index];
break;
}
else static if (isAssociativeArray!(A))
{
*result = (*zis)[result.get!(typeof(A.init.keys[0]))];
break;
}
else
{
throw new VariantException(typeid(A), result[0].type);
}
case OpID.indexAssign:
// array type; result comes first, index comes second
auto args = cast(Variant*) parm;
static if (isArray!(A) && is(typeof((*zis)[0] = (*zis)[0])))
{
size_t index = args[1].convertsTo!(int)
? args[1].get!(int) : args[1].get!(size_t);
(*zis)[index] = args[0].get!(typeof((*zis)[0]));
break;
}
else static if (isAssociativeArray!(A))
{
(*zis)[args[1].get!(typeof(A.init.keys[0]))]
= args[0].get!(typeof(A.init.values[0]));
break;
}
else
{
throw new VariantException(typeid(A), args[0].type);
}
case OpID.catAssign:
static if (!is(Unqual!(typeof((*zis)[0])) == void) && is(typeof((*zis)[0])) && is(typeof((*zis) ~= *zis)))
{
// array type; parm is the element to append
auto arg = cast(Variant*) parm;
alias E = typeof((*zis)[0]);
if (arg[0].convertsTo!(E))
{
// append one element to the array
(*zis) ~= [ arg[0].get!(E) ];
}
else
{
// append a whole array to the array
(*zis) ~= arg[0].get!(A);
}
break;
}
else
{
throw new VariantException(typeid(A), typeid(void[]));
}
case OpID.length:
static if (isArray!(A) || isAssociativeArray!(A))
{
return zis.length;
}
else
{
throw new VariantException(typeid(A), typeid(void[]));
}
case OpID.apply:
static if (!isFunctionPointer!A && !isDelegate!A)
{
import std.conv : text;
import std.exception : enforce;
enforce(0, text("Cannot apply `()' to a value of type `",
A.stringof, "'."));
}
else
{
import std.conv : text;
import std.exception : enforce;
alias ParamTypes = Parameters!A;
auto p = cast(Variant*) parm;
auto argCount = p.get!size_t;
// To assign the tuple we need to use the unqualified version,
// otherwise we run into issues such as with const values.
// We still get the actual type from the Variant though
// to ensure that we retain const correctness.
Tuple!(staticMap!(Unqual, ParamTypes)) t;
enforce(t.length == argCount,
text("Argument count mismatch: ",
A.stringof, " expects ", t.length,
" argument(s), not ", argCount, "."));
auto variantArgs = p[1 .. argCount + 1];
foreach (i, T; ParamTypes)
{
t[i] = cast() variantArgs[i].get!T;
}
auto args = cast(Tuple!(ParamTypes))t;
static if (is(ReturnType!A == void))
{
(*zis)(args.expand);
*p = Variant.init; // void returns uninitialized Variant.
}
else
{
*p = (*zis)(args.expand);
}
}
break;
case OpID.postblit:
static if (hasElaborateCopyConstructor!A)
{
zis.__xpostblit();
}
break;
case OpID.destruct:
static if (hasElaborateDestructor!A)
{
zis.__xdtor();
}
break;
default: assert(false);
}
return 0;
}
public:
/** Constructs a $(D VariantN) value given an argument of a
* generic type. Statically rejects disallowed types.
*/
this(T)(T value)
{
static assert(allowed!(T), "Cannot store a " ~ T.stringof
~ " in a " ~ VariantN.stringof);
opAssign(value);
}
/// Allows assignment from a subset algebraic type
this(T : VariantN!(tsize, Types), size_t tsize, Types...)(T value)
if (!is(T : VariantN) && Types.length > 0 && allSatisfy!(allowed, Types))
{
opAssign(value);
}
static if (!AllowedTypes.length || anySatisfy!(hasElaborateCopyConstructor, AllowedTypes))
{
this(this)
{
fptr(OpID.postblit, &store, null);
}
}
static if (!AllowedTypes.length || anySatisfy!(hasElaborateDestructor, AllowedTypes))
{
~this()
{
fptr(OpID.destruct, &store, null);
}
}
/** Assigns a $(D VariantN) from a generic
* argument. Statically rejects disallowed types. */
VariantN opAssign(T)(T rhs)
{
//writeln(typeid(rhs));
static assert(allowed!(T), "Cannot store a " ~ T.stringof
~ " in a " ~ VariantN.stringof ~ ". Valid types are "
~ AllowedTypes.stringof);
static if (is(T : VariantN))
{
rhs.fptr(OpID.copyOut, &rhs.store, &this);
}
else static if (is(T : const(VariantN)))
{
static assert(false,
"Assigning Variant objects from const Variant"~
" objects is currently not supported.");
}
else
{
static if (!AllowedTypes.length || anySatisfy!(hasElaborateDestructor, AllowedTypes))
{
// Assignment should destruct previous value
fptr(OpID.destruct, &store, null);
}
static if (T.sizeof <= size)
{
import core.stdc.string : memcpy;
// rhs has already been copied onto the stack, so even if T is
// shared, it's not really shared. Therefore, we can safely
// remove the shared qualifier when copying, as we are only
// copying from the unshared stack.
//
// In addition, the storage location is not accessible outside
// the Variant, so even if shared data is stored there, it's
// not really shared, as it's copied out as well.
memcpy(&store, cast(const(void*)) &rhs, rhs.sizeof);
static if (hasElaborateCopyConstructor!T)
{
// Safer than using typeid's postblit function because it
// type-checks the postblit function against the qualifiers
// of the type.
(cast(T*)&store).__xpostblit();
}
}
else
{
import core.stdc.string : memcpy;
static if (__traits(compiles, {new T(T.init);}))
{
auto p = new T(rhs);
}
else
{
auto p = new T;
*p = rhs;
}
memcpy(&store, &p, p.sizeof);
}
fptr = &handler!(T);
}
return this;
}
// Allow assignment from another variant which is a subset of this one
VariantN opAssign(T : VariantN!(tsize, Types), size_t tsize, Types...)(T rhs)
if (!is(T : VariantN) && Types.length > 0 && allSatisfy!(allowed, Types))
{
// discover which type rhs is actually storing
foreach (V; T.AllowedTypes)
if (rhs.type == typeid(V))
return this = rhs.get!V;
assert(0, T.AllowedTypes.stringof);
}
Variant opCall(P...)(auto ref P params)
{
Variant[P.length + 1] pack;
pack[0] = P.length;
foreach (i, _; params)
{
pack[i + 1] = params[i];
}
fptr(OpID.apply, &store, &pack);
return pack[0];
}
/** Returns true if and only if the $(D VariantN) object
* holds a valid value (has been initialized with, or assigned
* from, a valid value).
*/
@property bool hasValue() const pure nothrow
{
// @@@BUG@@@ in compiler, the cast shouldn't be needed
return cast(typeof(&handler!(void))) fptr != &handler!(void);
}
///
version(StdUnittest)
@system unittest
{
Variant a;
assert(!a.hasValue);
Variant b;
a = b;
assert(!a.hasValue); // still no value
a = 5;
assert(a.hasValue);
}
/**
* If the $(D VariantN) object holds a value of the
* $(I exact) type $(D T), returns a pointer to that
* value. Otherwise, returns $(D null). In cases
* where $(D T) is statically disallowed, $(D
* peek) will not compile.
*/
@property inout(T)* peek(T)() inout
{
static if (!is(T == void))
static assert(allowed!(T), "Cannot store a " ~ T.stringof
~ " in a " ~ VariantN.stringof);
if (type != typeid(T))
return null;
static if (T.sizeof <= size)
return cast(inout T*)&store;
else
return *cast(inout T**)&store;
}
///
version(StdUnittest)
@system unittest
{
Variant a = 5;
auto b = a.peek!(int);
assert(b !is null);
*b = 6;
assert(a == 6);
}
/**
* Returns the $(D typeid) of the currently held value.
*/
@property TypeInfo type() const nothrow @trusted
{
scope(failure) assert(0);
TypeInfo result;
fptr(OpID.getTypeInfo, null, &result);
return result;
}
/**
* Returns $(D true) if and only if the $(D VariantN)
* object holds an object implicitly convertible to type `T`.
* Implicit convertibility is defined as per
* $(REF_ALTTEXT ImplicitConversionTargets, ImplicitConversionTargets, std,traits).
*/
@property bool convertsTo(T)() const
{
TypeInfo info = typeid(T);
return fptr(OpID.testConversion, null, &info) == 0;
}
/**
Returns the value stored in the `VariantN` object, either by specifying the
needed type or the index in the list of allowed types. The latter overload
only applies to bounded variants (e.g. $(LREF Algebraic)).
Params:
T = The requested type. The currently stored value must implicitly convert
to the requested type, in fact `DecayStaticToDynamicArray!T`. If an
implicit conversion is not possible, throws a `VariantException`.
index = The index of the type among `AllowedTypesParam`, zero-based.
*/
@property inout(T) get(T)() inout
{
inout(T) result = void;
static if (is(T == shared))
alias R = shared Unqual!T;
else
alias R = Unqual!T;
auto buf = tuple(typeid(T), cast(R*)&result);
if (fptr(OpID.get, cast(ubyte[size]*) &store, &buf))
{
throw new VariantException(type, typeid(T));
}
return result;
}
/// Ditto
@property auto get(uint index)() inout
if (index < AllowedTypes.length)
{
foreach (i, T; AllowedTypes)
{
static if (index == i) return get!T;
}
assert(0);
}
/**
* Returns the value stored in the $(D VariantN) object,
* explicitly converted (coerced) to the requested type $(D
* T). If $(D T) is a string type, the value is formatted as
* a string. If the $(D VariantN) object is a string, a
* parse of the string to type $(D T) is attempted. If a
* conversion is not possible, throws a $(D
* VariantException).
*/
@property T coerce(T)()
{
import std.conv : to, text;
static if (isNumeric!T || isBoolean!T)
{
if (convertsTo!real)
{
// maybe optimize this fella; handle ints separately
return to!T(get!real);
}
else if (convertsTo!(const(char)[]))
{
return to!T(get!(const(char)[]));
}
// I'm not sure why this doesn't convert to const(char),
// but apparently it doesn't (probably a deeper bug).
//
// Until that is fixed, this quick addition keeps a common
// function working. "10".coerce!int ought to work.
else if (convertsTo!(immutable(char)[]))
{
return to!T(get!(immutable(char)[]));
}
else
{
import std.exception : enforce;
enforce(false, text("Type ", type, " does not convert to ",
typeid(T)));
assert(0);
}
}
else static if (is(T : Object))
{
return to!(T)(get!(Object));
}
else static if (isSomeString!(T))
{
return to!(T)(toString());
}
else
{
// Fix for bug 1649
static assert(false, "unsupported type for coercion");
}
}
/**
* Formats the stored value as a string.
*/
string toString()
{
string result;
fptr(OpID.toString, &store, &result) == 0 || assert(false);
return result;
}
/**
* Comparison for equality used by the "==" and "!=" operators.
*/
// returns 1 if the two are equal
bool opEquals(T)(auto ref T rhs) const
if (allowed!T || is(Unqual!T == VariantN))
{
static if (is(Unqual!T == VariantN))
alias temp = rhs;
else
auto temp = VariantN(rhs);
return !fptr(OpID.equals, cast(ubyte[size]*) &store,
cast(void*) &temp);
}
// workaround for bug 10567 fix
int opCmp(ref const VariantN rhs) const
{
return (cast() this).opCmp!(VariantN)(cast() rhs);
}
/**
* Ordering comparison used by the "<", "<=", ">", and ">="
* operators. In case comparison is not sensible between the held
* value and $(D rhs), an exception is thrown.
*/
int opCmp(T)(T rhs)
if (allowed!T) // includes T == VariantN
{
static if (is(T == VariantN))
alias temp = rhs;
else
auto temp = VariantN(rhs);
auto result = fptr(OpID.compare, &store, &temp);
if (result == ptrdiff_t.min)
{
throw new VariantException(type, temp.type);
}
assert(result >= -1 && result <= 1); // Should be true for opCmp.
return cast(int) result;
}
/**
* Computes the hash of the held value.
*/
size_t toHash() const nothrow @safe
{
return type.getHash(&store);
}
private VariantN opArithmetic(T, string op)(T other)
{
static if (isInstanceOf!(.VariantN, T))
{
string tryUseType(string tp)
{
import std.format : format;
return q{
static if (allowed!%1$s && T.allowed!%1$s)
if (convertsTo!%1$s && other.convertsTo!%1$s)
return VariantN(get!%1$s %2$s other.get!%1$s);
}.format(tp, op);
}
mixin(tryUseType("uint"));
mixin(tryUseType("int"));
mixin(tryUseType("ulong"));
mixin(tryUseType("long"));
mixin(tryUseType("float"));
mixin(tryUseType("double"));
mixin(tryUseType("real"));
}
else
{
static if (allowed!T)
if (auto pv = peek!T) return VariantN(mixin("*pv " ~ op ~ " other"));
static if (allowed!uint && is(typeof(T.max) : uint) && isUnsigned!T)
if (convertsTo!uint) return VariantN(mixin("get!(uint) " ~ op ~ " other"));
static if (allowed!int && is(typeof(T.max) : int) && !isUnsigned!T)
if (convertsTo!int) return VariantN(mixin("get!(int) " ~ op ~ " other"));
static if (allowed!ulong && is(typeof(T.max) : ulong) && isUnsigned!T)
if (convertsTo!ulong) return VariantN(mixin("get!(ulong) " ~ op ~ " other"));
static if (allowed!long && is(typeof(T.max) : long) && !isUnsigned!T)
if (convertsTo!long) return VariantN(mixin("get!(long) " ~ op ~ " other"));
static if (allowed!float && is(T : float))
if (convertsTo!float) return VariantN(mixin("get!(float) " ~ op ~ " other"));
static if (allowed!double && is(T : double))
if (convertsTo!double) return VariantN(mixin("get!(double) " ~ op ~ " other"));
static if (allowed!real && is (T : real))
if (convertsTo!real) return VariantN(mixin("get!(real) " ~ op ~ " other"));
}
throw new VariantException("No possible match found for VariantN "~op~" "~T.stringof);
}
private VariantN opLogic(T, string op)(T other)
{
VariantN result;
static if (is(T == VariantN))
{
if (convertsTo!(uint) && other.convertsTo!(uint))
result = mixin("get!(uint) " ~ op ~ " other.get!(uint)");
else if (convertsTo!(int) && other.convertsTo!(int))
result = mixin("get!(int) " ~ op ~ " other.get!(int)");
else if (convertsTo!(ulong) && other.convertsTo!(ulong))
result = mixin("get!(ulong) " ~ op ~ " other.get!(ulong)");
else
result = mixin("get!(long) " ~ op ~ " other.get!(long)");
}
else
{
if (is(typeof(T.max) : uint) && T.min == 0 && convertsTo!(uint))
result = mixin("get!(uint) " ~ op ~ " other");
else if (is(typeof(T.max) : int) && T.min < 0 && convertsTo!(int))
result = mixin("get!(int) " ~ op ~ " other");
else if (is(typeof(T.max) : ulong) && T.min == 0
&& convertsTo!(ulong))
result = mixin("get!(ulong) " ~ op ~ " other");
else
result = mixin("get!(long) " ~ op ~ " other");
}
return result;
}
/**
* Arithmetic between $(D VariantN) objects and numeric
* values. All arithmetic operations return a $(D VariantN)
* object typed depending on the types of both values
* involved. The conversion rules mimic D's built-in rules for
* arithmetic conversions.
*/
// Adapted from http://www.prowiki.org/wiki4d/wiki.cgi?DanielKeep/Variant
// arithmetic
VariantN opAdd(T)(T rhs) { return opArithmetic!(T, "+")(rhs); }
///ditto
VariantN opSub(T)(T rhs) { return opArithmetic!(T, "-")(rhs); }
// Commenteed all _r versions for now because of ambiguities
// arising when two Variants are used
// ///ditto
// VariantN opSub_r(T)(T lhs)
// {
// return VariantN(lhs).opArithmetic!(VariantN, "-")(this);
// }
///ditto
VariantN opMul(T)(T rhs) { return opArithmetic!(T, "*")(rhs); }
///ditto
VariantN opDiv(T)(T rhs) { return opArithmetic!(T, "/")(rhs); }
// ///ditto
// VariantN opDiv_r(T)(T lhs)
// {
// return VariantN(lhs).opArithmetic!(VariantN, "/")(this);
// }
///ditto
VariantN opMod(T)(T rhs) { return opArithmetic!(T, "%")(rhs); }
// ///ditto
// VariantN opMod_r(T)(T lhs)
// {
// return VariantN(lhs).opArithmetic!(VariantN, "%")(this);
// }
///ditto
VariantN opAnd(T)(T rhs) { return opLogic!(T, "&")(rhs); }
///ditto
VariantN opOr(T)(T rhs) { return opLogic!(T, "|")(rhs); }
///ditto
VariantN opXor(T)(T rhs) { return opLogic!(T, "^")(rhs); }
///ditto
VariantN opShl(T)(T rhs) { return opLogic!(T, "<<")(rhs); }
// ///ditto
// VariantN opShl_r(T)(T lhs)
// {
// return VariantN(lhs).opLogic!(VariantN, "<<")(this);
// }
///ditto
VariantN opShr(T)(T rhs) { return opLogic!(T, ">>")(rhs); }
// ///ditto
// VariantN opShr_r(T)(T lhs)
// {
// return VariantN(lhs).opLogic!(VariantN, ">>")(this);
// }
///ditto
VariantN opUShr(T)(T rhs) { return opLogic!(T, ">>>")(rhs); }
// ///ditto
// VariantN opUShr_r(T)(T lhs)
// {
// return VariantN(lhs).opLogic!(VariantN, ">>>")(this);
// }
///ditto
VariantN opCat(T)(T rhs)
{
auto temp = this;
temp ~= rhs;
return temp;
}
// ///ditto
// VariantN opCat_r(T)(T rhs)
// {
// VariantN temp = rhs;
// temp ~= this;
// return temp;
// }
///ditto
VariantN opAddAssign(T)(T rhs) { return this = this + rhs; }
///ditto
VariantN opSubAssign(T)(T rhs) { return this = this - rhs; }
///ditto
VariantN opMulAssign(T)(T rhs) { return this = this * rhs; }
///ditto
VariantN opDivAssign(T)(T rhs) { return this = this / rhs; }
///ditto
VariantN opModAssign(T)(T rhs) { return this = this % rhs; }
///ditto
VariantN opAndAssign(T)(T rhs) { return this = this & rhs; }
///ditto
VariantN opOrAssign(T)(T rhs) { return this = this | rhs; }
///ditto
VariantN opXorAssign(T)(T rhs) { return this = this ^ rhs; }
///ditto
VariantN opShlAssign(T)(T rhs) { return this = this << rhs; }
///ditto
VariantN opShrAssign(T)(T rhs) { return this = this >> rhs; }
///ditto
VariantN opUShrAssign(T)(T rhs) { return this = this >>> rhs; }
///ditto
VariantN opCatAssign(T)(T rhs)
{
auto toAppend = Variant(rhs);
fptr(OpID.catAssign, &store, &toAppend) == 0 || assert(false);
return this;
}
/**
* Array and associative array operations. If a $(D
* VariantN) contains an (associative) array, it can be indexed
* into. Otherwise, an exception is thrown.
*/
inout(Variant) opIndex(K)(K i) inout
{
auto result = Variant(i);
fptr(OpID.index, cast(ubyte[size]*) &store, &result) == 0 || assert(false);
return result;
}
///
version(StdUnittest)
@system unittest
{
Variant a = new int[10];
a[5] = 42;
assert(a[5] == 42);
a[5] += 8;
assert(a[5] == 50);
int[int] hash = [ 42:24 ];
a = hash;
assert(a[42] == 24);
a[42] /= 2;
assert(a[42] == 12);
}
/// ditto
Variant opIndexAssign(T, N)(T value, N i)
{
static if (AllowedTypes.length && !isInstanceOf!(.VariantN, T))
{
enum canAssign(U) = __traits(compiles, (U u){ u[i] = value; });
static assert(anySatisfy!(canAssign, AllowedTypes),
"Cannot assign " ~ T.stringof ~ " to " ~ VariantN.stringof ~
" indexed with " ~ N.stringof);
}
Variant[2] args = [ Variant(value), Variant(i) ];
fptr(OpID.indexAssign, &store, &args) == 0 || assert(false);
return args[0];
}
/// ditto
Variant opIndexOpAssign(string op, T, N)(T value, N i)
{
return opIndexAssign(mixin(`opIndex(i)` ~ op ~ `value`), i);
}
/** If the $(D VariantN) contains an (associative) array,
* returns the _length of that array. Otherwise, throws an
* exception.
*/
@property size_t length()
{
return cast(size_t) fptr(OpID.length, &store, null);
}
/**
If the $(D VariantN) contains an array, applies $(D dg) to each
element of the array in turn. Otherwise, throws an exception.
*/
int opApply(Delegate)(scope Delegate dg) if (is(Delegate == delegate))
{
alias A = Parameters!(Delegate)[0];
if (type == typeid(A[]))
{
auto arr = get!(A[]);
foreach (ref e; arr)
{
if (dg(e)) return 1;
}
}
else static if (is(A == VariantN))
{
foreach (i; 0 .. length)
{
// @@@TODO@@@: find a better way to not confuse
// clients who think they change values stored in the
// Variant when in fact they are only changing tmp.
auto tmp = this[i];
debug scope(exit) assert(tmp == this[i]);
if (dg(tmp)) return 1;
}
}
else
{
import std.conv : text;
import std.exception : enforce;
enforce(false, text("Variant type ", type,
" not iterable with values of type ",
A.stringof));
}
return 0;
}
}
@system unittest
{
import std.conv : to;
Variant v;
int foo() { return 42; }
v = &foo;
assert(v() == 42);
static int bar(string s) { return to!int(s); }
v = &bar;
assert(v("43") == 43);
}
@system unittest
{
int[int] hash = [ 42:24 ];
Variant v = hash;
assert(v[42] == 24);
v[42] = 5;
assert(v[42] == 5);
}
// opIndex with static arrays, issue 12771
@system unittest
{
int[4] elements = [0, 1, 2, 3];
Variant v = elements;
assert(v == elements);
assert(v[2] == 2);
assert(v[3] == 3);
v[2] = 6;
assert(v[2] == 6);
assert(v != elements);
}
@system unittest
{
import std.exception : assertThrown;
Algebraic!(int[]) v = [2, 2];
assert(v == [2, 2]);
v[0] = 1;
assert(v[0] == 1);
assert(v != [2, 2]);
// opIndexAssign from Variant
v[1] = v[0];
assert(v[1] == 1);
static assert(!__traits(compiles, (v[1] = null)));
assertThrown!VariantException(v[1] = Variant(null));
}
//Issue# 8195
@system unittest
{
struct S
{
int a;
long b;
string c;
real d = 0.0;
bool e;
}
static assert(S.sizeof >= Variant.sizeof);
alias Types = AliasSeq!(string, int, S);
alias MyVariant = VariantN!(maxSize!Types, Types);
auto v = MyVariant(S.init);
assert(v == S.init);
}
// Issue #10961
@system unittest
{
// Primarily test that we can assign a void[] to a Variant.
void[] elements = cast(void[])[1, 2, 3];
Variant v = elements;
void[] returned = v.get!(void[]);
assert(returned == elements);
}
// Issue #13352
@system unittest
{
alias TP = Algebraic!(long);
auto a = TP(1L);
auto b = TP(2L);
assert(!TP.allowed!ulong);
assert(a + b == 3L);
assert(a + 2 == 3L);
assert(1 + b == 3L);
alias TP2 = Algebraic!(long, string);
auto c = TP2(3L);
assert(a + c == 4L);
}
// Issue #13354
@system unittest
{
alias A = Algebraic!(string[]);
A a = ["a", "b"];
assert(a[0] == "a");
assert(a[1] == "b");
a[1] = "c";
assert(a[1] == "c");
alias AA = Algebraic!(int[string]);
AA aa = ["a": 1, "b": 2];
assert(aa["a"] == 1);
assert(aa["b"] == 2);
aa["b"] = 3;
assert(aa["b"] == 3);
}
// Issue #14198
@system unittest
{
Variant a = true;
assert(a.type == typeid(bool));
}
// Issue #14233
@system unittest
{
alias Atom = Algebraic!(string, This[]);
Atom[] values = [];
auto a = Atom(values);
}
pure nothrow @nogc
@system unittest
{
Algebraic!(int, double) a;
a = 100;
a = 1.0;
}
// Issue 14457
@system unittest
{
alias A = Algebraic!(int, float, double);
alias B = Algebraic!(int, float);
A a = 1;
B b = 6f;
a = b;
assert(a.type == typeid(float));
assert(a.get!float == 6f);
}
// Issue 14585
@system unittest
{
static struct S
{
int x = 42;
~this() {assert(x == 42);}
}
Variant(S()).get!S;
}
// Issue 14586
@system unittest
{
const Variant v = new immutable Object;
v.get!(immutable Object);
}
@system unittest
{
static struct S
{
T opCast(T)() {assert(false);}
}
Variant v = S();
v.get!S;
}
// issue 13262
@system unittest
{
static void fun(T)(Variant v){
T x;
v = x;
auto r = v.get!(T);
}
Variant v;
fun!(shared(int))(v);
fun!(shared(int)[])(v);
static struct S1
{
int c;
string a;
}
static struct S2
{
string a;
shared int[] b;
}
static struct S3
{
string a;
shared int[] b;
int c;
}
fun!(S1)(v);
fun!(shared(S1))(v);
fun!(S2)(v);
fun!(shared(S2))(v);
fun!(S3)(v);
fun!(shared(S3))(v);
// ensure structs that are shared, but don't have shared postblits
// can't be used.
static struct S4
{
int x;
this(this) {x = 0;}
}
fun!(S4)(v);
static assert(!is(typeof(fun!(shared(S4))(v))));
}
/**
_Algebraic data type restricted to a closed set of possible
types. It's an alias for $(LREF VariantN) with an
appropriately-constructed maximum size. `Algebraic` is
useful when it is desirable to restrict what a discriminated type
could hold to the end of defining simpler and more efficient
manipulation.
*/
template Algebraic(T...)
{
alias Algebraic = VariantN!(maxSize!T, T);
}
///
@system unittest
{
auto v = Algebraic!(int, double, string)(5);
assert(v.peek!(int));
v = 3.14;
assert(v.peek!(double));
// auto x = v.peek!(long); // won't compile, type long not allowed
// v = '1'; // won't compile, type char not allowed
}
/**
$(H4 Self-Referential Types)
A useful and popular use of algebraic data structures is for defining $(LUCKY
self-referential data structures), i.e. structures that embed references to
values of their own type within.
This is achieved with `Algebraic` by using `This` as a placeholder whenever a
reference to the type being defined is needed. The `Algebraic` instantiation
will perform $(LINK2 https://en.wikipedia.org/wiki/Name_resolution_(programming_languages)#Alpha_renaming_to_make_name_resolution_trivial,
alpha renaming) on its constituent types, replacing `This`
with the self-referenced type. The structure of the type involving `This` may
be arbitrarily complex.
*/
@system unittest
{
import std.typecons : Tuple, tuple;
// A tree is either a leaf or a branch of two other trees
alias Tree(Leaf) = Algebraic!(Leaf, Tuple!(This*, This*));
Tree!int tree = tuple(new Tree!int(42), new Tree!int(43));
Tree!int* right = tree.get!1[1];
assert(*right == 43);
// An object is a double, a string, or a hash of objects
alias Obj = Algebraic!(double, string, This[string]);
Obj obj = "hello";
assert(obj.get!1 == "hello");
obj = 42.0;
assert(obj.get!0 == 42);
obj = ["customer": Obj("John"), "paid": Obj(23.95)];
assert(obj.get!2["customer"] == "John");
}
/**
Alias for $(LREF VariantN) instantiated with the largest size of `creal`,
`char[]`, and `void delegate()`. This ensures that `Variant` is large enough
to hold all of D's predefined types unboxed, including all numeric types,
pointers, delegates, and class references. You may want to use
$(D VariantN) directly with a different maximum size either for
storing larger types unboxed, or for saving memory.
*/
alias Variant = VariantN!(maxSize!(creal, char[], void delegate()));
/**
* Returns an array of variants constructed from $(D args).
*
* This is by design. During construction the $(D Variant) needs
* static type information about the type being held, so as to store a
* pointer to function for fast retrieval.
*/
Variant[] variantArray(T...)(T args)
{
Variant[] result;
foreach (arg; args)
{
result ~= Variant(arg);
}
return result;
}
///
@system unittest
{
auto a = variantArray(1, 3.14, "Hi!");
assert(a[1] == 3.14);
auto b = Variant(a); // variant array as variant
assert(b[1] == 3.14);
}
/**
* Thrown in three cases:
*
* $(OL $(LI An uninitialized `Variant` is used in any way except
* assignment and $(D hasValue);) $(LI A $(D get) or
* $(D coerce) is attempted with an incompatible target type;)
* $(LI A comparison between $(D Variant) objects of
* incompatible types is attempted.))
*
*/
// @@@ BUG IN COMPILER. THE 'STATIC' BELOW SHOULD NOT COMPILE
static class VariantException : Exception
{
/// The source type in the conversion or comparison
TypeInfo source;
/// The target type in the conversion or comparison
TypeInfo target;
this(string s)
{
super(s);
}
this(TypeInfo source, TypeInfo target)
{
super("Variant: attempting to use incompatible types "
~ source.toString()
~ " and " ~ target.toString());
this.source = source;
this.target = target;
}
}
@system unittest
{
alias W1 = This2Variant!(char, int, This[int]);
alias W2 = AliasSeq!(int, char[int]);
static assert(is(W1 == W2));
alias var_t = Algebraic!(void, string);
var_t foo = "quux";
}
@system unittest
{
alias A = Algebraic!(real, This[], This[int], This[This]);
A v1, v2, v3;
v2 = 5.0L;
v3 = 42.0L;
//v1 = [ v2 ][];
auto v = v1.peek!(A[]);
//writeln(v[0]);
v1 = [ 9 : v3 ];
//writeln(v1);
v1 = [ v3 : v3 ];
//writeln(v1);
}
@system unittest
{
import std.conv : ConvException;
import std.exception : assertThrown, collectException;
// try it with an oddly small size
VariantN!(1) test;
assert(test.size > 1);
// variantArray tests
auto heterogeneous = variantArray(1, 4.5, "hi");
assert(heterogeneous.length == 3);
auto variantArrayAsVariant = Variant(heterogeneous);
assert(variantArrayAsVariant[0] == 1);
assert(variantArrayAsVariant.length == 3);
// array tests
auto arr = Variant([1.2].dup);
auto e = arr[0];
assert(e == 1.2);
arr[0] = 2.0;
assert(arr[0] == 2);
arr ~= 4.5;
assert(arr[1] == 4.5);
// general tests
Variant a;
auto b = Variant(5);
assert(!b.peek!(real) && b.peek!(int));
// assign
a = *b.peek!(int);
// comparison
assert(a == b, a.type.toString() ~ " " ~ b.type.toString());
auto c = Variant("this is a string");
assert(a != c);
// comparison via implicit conversions
a = 42; b = 42.0; assert(a == b);
// try failing conversions
bool failed = false;
try
{
auto d = c.get!(int);
}
catch (Exception e)
{
//writeln(stderr, e.toString);
failed = true;
}
assert(failed); // :o)
// toString tests
a = Variant(42); assert(a.toString() == "42");
a = Variant(42.22); assert(a.toString() == "42.22");
// coerce tests
a = Variant(42.22); assert(a.coerce!(int) == 42);
a = cast(short) 5; assert(a.coerce!(double) == 5);
a = Variant("10"); assert(a.coerce!int == 10);
a = Variant(1);
assert(a.coerce!bool);
a = Variant(0);
assert(!a.coerce!bool);
a = Variant(1.0);
assert(a.coerce!bool);
a = Variant(0.0);
assert(!a.coerce!bool);
a = Variant(float.init);
assertThrown!ConvException(a.coerce!bool);
a = Variant("true");
assert(a.coerce!bool);
a = Variant("false");
assert(!a.coerce!bool);
a = Variant("");
assertThrown!ConvException(a.coerce!bool);
// Object tests
class B1 {}
class B2 : B1 {}
a = new B2;
assert(a.coerce!(B1) !is null);
a = new B1;
assert(collectException(a.coerce!(B2) is null));
a = cast(Object) new B2; // lose static type info; should still work
assert(a.coerce!(B2) !is null);
// struct Big { int a[45]; }
// a = Big.init;
// hash
assert(a.toHash() != 0);
}
// tests adapted from
// http://www.dsource.org/projects/tango/browser/trunk/tango/core/Variant.d?rev=2601
@system unittest
{
Variant v;
assert(!v.hasValue);
v = 42;
assert( v.peek!(int) );
assert( v.convertsTo!(long) );
assert( v.get!(int) == 42 );
assert( v.get!(long) == 42L );
assert( v.get!(ulong) == 42uL );
v = "Hello, World!";
assert( v.peek!(string) );
assert( v.get!(string) == "Hello, World!" );
assert(!is(char[] : wchar[]));
assert( !v.convertsTo!(wchar[]) );
assert( v.get!(string) == "Hello, World!" );
// Literal arrays are dynamically-typed
v = cast(int[4]) [1,2,3,4];
assert( v.peek!(int[4]) );
assert( v.get!(int[4]) == [1,2,3,4] );
{
v = [1,2,3,4,5];
assert( v.peek!(int[]) );
assert( v.get!(int[]) == [1,2,3,4,5] );
}
v = 3.1413;
assert( v.peek!(double) );
assert( v.convertsTo!(real) );
//@@@ BUG IN COMPILER: DOUBLE SHOULD NOT IMPLICITLY CONVERT TO FLOAT
assert( !v.convertsTo!(float) );
assert( *v.peek!(double) == 3.1413 );
auto u = Variant(v);
assert( u.peek!(double) );
assert( *u.peek!(double) == 3.1413 );
// operators
v = 38;
assert( v + 4 == 42 );
assert( 4 + v == 42 );
assert( v - 4 == 34 );
assert( Variant(4) - v == -34 );
assert( v * 2 == 76 );
assert( 2 * v == 76 );
assert( v / 2 == 19 );
assert( Variant(2) / v == 0 );
assert( v % 2 == 0 );
assert( Variant(2) % v == 2 );
assert( (v & 6) == 6 );
assert( (6 & v) == 6 );
assert( (v | 9) == 47 );
assert( (9 | v) == 47 );
assert( (v ^ 5) == 35 );
assert( (5 ^ v) == 35 );
assert( v << 1 == 76 );
assert( Variant(1) << Variant(2) == 4 );
assert( v >> 1 == 19 );
assert( Variant(4) >> Variant(2) == 1 );
assert( Variant("abc") ~ "def" == "abcdef" );
assert( Variant("abc") ~ Variant("def") == "abcdef" );
v = 38;
v += 4;
assert( v == 42 );
v = 38; v -= 4; assert( v == 34 );
v = 38; v *= 2; assert( v == 76 );
v = 38; v /= 2; assert( v == 19 );
v = 38; v %= 2; assert( v == 0 );
v = 38; v &= 6; assert( v == 6 );
v = 38; v |= 9; assert( v == 47 );
v = 38; v ^= 5; assert( v == 35 );
v = 38; v <<= 1; assert( v == 76 );
v = 38; v >>= 1; assert( v == 19 );
v = 38; v += 1; assert( v < 40 );
v = "abc";
v ~= "def";
assert( v == "abcdef", *v.peek!(char[]) );
assert( Variant(0) < Variant(42) );
assert( Variant(42) > Variant(0) );
assert( Variant(42) > Variant(0.1) );
assert( Variant(42.1) > Variant(1) );
assert( Variant(21) == Variant(21) );
assert( Variant(0) != Variant(42) );
assert( Variant("bar") == Variant("bar") );
assert( Variant("foo") != Variant("bar") );
{
auto v1 = Variant(42);
auto v2 = Variant("foo");
auto v3 = Variant(1+2.0i);
int[Variant] hash;
hash[v1] = 0;
hash[v2] = 1;
hash[v3] = 2;
assert( hash[v1] == 0 );
assert( hash[v2] == 1 );
assert( hash[v3] == 2 );
}
{
int[char[]] hash;
hash["a"] = 1;
hash["b"] = 2;
hash["c"] = 3;
Variant vhash = hash;
assert( vhash.get!(int[char[]])["a"] == 1 );
assert( vhash.get!(int[char[]])["b"] == 2 );
assert( vhash.get!(int[char[]])["c"] == 3 );
}
}
@system unittest
{
// check comparisons incompatible with AllowedTypes
Algebraic!int v = 2;
assert(v == 2);
assert(v < 3);
static assert(!__traits(compiles, {v == long.max;}));
static assert(!__traits(compiles, {v == null;}));
static assert(!__traits(compiles, {v < long.max;}));
static assert(!__traits(compiles, {v > null;}));
}
@system unittest
{
// bug 1558
Variant va=1;
Variant vb=-2;
assert((va+vb).get!(int) == -1);
assert((va-vb).get!(int) == 3);
}
@system unittest
{
Variant a;
a=5;
Variant b;
b=a;
Variant[] c;
c = variantArray(1, 2, 3.0, "hello", 4);
assert(c[3] == "hello");
}
@system unittest
{
Variant v = 5;
assert(!__traits(compiles, v.coerce!(bool delegate())));
}
@system unittest
{
struct Huge {
real a, b, c, d, e, f, g;
}
Huge huge;
huge.e = 42;
Variant v;
v = huge; // Compile time error.
assert(v.get!(Huge).e == 42);
}
@system unittest
{
const x = Variant(42);
auto y1 = x.get!(const int);
// @@@BUG@@@
//auto y2 = x.get!(immutable int)();
}
// test iteration
@system unittest
{
auto v = Variant([ 1, 2, 3, 4 ][]);
auto j = 0;
foreach (int i; v)
{
assert(i == ++j);
}
assert(j == 4);
}
// test convertibility
@system unittest
{
auto v = Variant("abc".dup);
assert(v.convertsTo!(char[]));
}
// http://d.puremagic.com/issues/show_bug.cgi?id=5424
@system unittest
{
interface A {
void func1();
}
static class AC: A {
void func1() {
}
}
A a = new AC();
a.func1();
Variant b = Variant(a);
}
@system unittest
{
// bug 7070
Variant v;
v = null;
}
// Class and interface opEquals, issue 12157
@system unittest
{
class Foo { }
class DerivedFoo : Foo { }
Foo f1 = new Foo();
Foo f2 = new DerivedFoo();
Variant v1 = f1, v2 = f2;
assert(v1 == f1);
assert(v1 != new Foo());
assert(v1 != f2);
assert(v2 != v1);
assert(v2 == f2);
}
// Const parameters with opCall, issue 11361.
@system unittest
{
static string t1(string c) {
return c ~ "a";
}
static const(char)[] t2(const(char)[] p) {
return p ~ "b";
}
static char[] t3(int p) {
import std.conv : text;
return p.text.dup;
}
Variant v1 = &t1;
Variant v2 = &t2;
Variant v3 = &t3;
assert(v1("abc") == "abca");
assert(v1("abc").type == typeid(string));
assert(v2("abc") == "abcb");
assert(v2(cast(char[])("abc".dup)) == "abcb");
assert(v2("abc").type == typeid(const(char)[]));
assert(v3(4) == ['4']);
assert(v3(4).type == typeid(char[]));
}
// issue 12071
@system unittest
{
static struct Structure { int data; }
alias VariantTest = Algebraic!(Structure delegate() pure nothrow @nogc @safe);
bool called = false;
Structure example() pure nothrow @nogc @safe
{
called = true;
return Structure.init;
}
auto m = VariantTest(&example);
m();
assert(called);
}
// Ordering comparisons of incompatible types, e.g. issue 7990.
@system unittest
{
import std.exception : assertThrown;
assertThrown!VariantException(Variant(3) < "a");
assertThrown!VariantException("a" < Variant(3));
assertThrown!VariantException(Variant(3) < Variant("a"));
assertThrown!VariantException(Variant.init < Variant(3));
assertThrown!VariantException(Variant(3) < Variant.init);
}
// Handling of unordered types, e.g. issue 9043.
@system unittest
{
import std.exception : assertThrown;
static struct A { int a; }
assert(Variant(A(3)) != A(4));
assertThrown!VariantException(Variant(A(3)) < A(4));
assertThrown!VariantException(A(3) < Variant(A(4)));
assertThrown!VariantException(Variant(A(3)) < Variant(A(4)));
}
// Handling of empty types and arrays, e.g. issue 10958
@system unittest
{
class EmptyClass { }
struct EmptyStruct { }
alias EmptyArray = void[0];
alias Alg = Algebraic!(EmptyClass, EmptyStruct, EmptyArray);
Variant testEmpty(T)()
{
T inst;
Variant v = inst;
assert(v.get!T == inst);
assert(v.peek!T !is null);
assert(*v.peek!T == inst);
Alg alg = inst;
assert(alg.get!T == inst);
return v;
}
testEmpty!EmptyClass();
testEmpty!EmptyStruct();
testEmpty!EmptyArray();
// EmptyClass/EmptyStruct sizeof is 1, so we have this to test just size 0.
EmptyArray arr = EmptyArray.init;
Algebraic!(EmptyArray) a = arr;
assert(a.length == 0);
assert(a.get!EmptyArray == arr);
}
// Handling of void function pointers / delegates, e.g. issue 11360
@system unittest
{
static void t1() { }
Variant v = &t1;
assert(v() == Variant.init);
static int t2() { return 3; }
Variant v2 = &t2;
assert(v2() == 3);
}
// Using peek for large structs, issue 8580
@system unittest
{
struct TestStruct(bool pad)
{
int val1;
static if (pad)
ubyte[Variant.size] padding;
int val2;
}
void testPeekWith(T)()
{
T inst;
inst.val1 = 3;
inst.val2 = 4;
Variant v = inst;
T* original = v.peek!T;
assert(original.val1 == 3);
assert(original.val2 == 4);
original.val1 = 6;
original.val2 = 8;
T modified = v.get!T;
assert(modified.val1 == 6);
assert(modified.val2 == 8);
}
testPeekWith!(TestStruct!false)();
testPeekWith!(TestStruct!true)();
}
/**
* Applies a delegate or function to the given $(LREF Algebraic) depending on the held type,
* ensuring that all types are handled by the visiting functions.
*
* The delegate or function having the currently held value as parameter is called
* with $(D variant)'s current value. Visiting handlers are passed
* in the template parameter list.
* It is statically ensured that all held types of
* $(D variant) are handled across all handlers.
* $(D visit) allows delegates and static functions to be passed
* as parameters.
*
* If a function with an untyped parameter is specified, this function is called
* when the variant contains a type that does not match any other function.
* This can be used to apply the same function across multiple possible types.
* Exactly one generic function is allowed.
*
* If a function without parameters is specified, this function is called
* when `variant` doesn't hold a value. Exactly one parameter-less function
* is allowed.
*
* Duplicate overloads matching the same type in one of the visitors are disallowed.
*
* Returns: The return type of visit is deduced from the visiting functions and must be
* the same across all overloads.
* Throws: $(LREF VariantException) if `variant` doesn't hold a value and no
* parameter-less fallback function is specified.
*/
template visit(Handlers...)
if (Handlers.length > 0)
{
///
auto visit(VariantType)(VariantType variant)
if (isAlgebraic!VariantType)
{
return visitImpl!(true, VariantType, Handlers)(variant);
}
}
///
@system unittest
{
Algebraic!(int, string) variant;
variant = 10;
assert(variant.visit!((string s) => cast(int) s.length,
(int i) => i)()
== 10);
variant = "string";
assert(variant.visit!((int i) => i,
(string s) => cast(int) s.length)()
== 6);
// Error function usage
Algebraic!(int, string) emptyVar;
auto rslt = emptyVar.visit!((string s) => cast(int) s.length,
(int i) => i,
() => -1)();
assert(rslt == -1);
// Generic function usage
Algebraic!(int, float, real) number = 2;
assert(number.visit!(x => x += 1) == 3);
// Generic function for int/float with separate behavior for string
Algebraic!(int, float, string) something = 2;
assert(something.visit!((string s) => s.length, x => x) == 2); // generic
something = "asdf";
assert(something.visit!((string s) => s.length, x => x) == 4); // string
// Generic handler and empty handler
Algebraic!(int, float, real) empty2;
assert(empty2.visit!(x => x + 1, () => -1) == -1);
}
@system unittest
{
Algebraic!(size_t, string) variant;
// not all handled check
static assert(!__traits(compiles, variant.visit!((size_t i){ })() ));
variant = cast(size_t) 10;
auto which = 0;
variant.visit!( (string s) => which = 1,
(size_t i) => which = 0
)();
// integer overload was called
assert(which == 0);
// mustn't compile as generic Variant not supported
Variant v;
static assert(!__traits(compiles, v.visit!((string s) => which = 1,
(size_t i) => which = 0
)()
));
static size_t func(string s) {
return s.length;
}
variant = "test";
assert( 4 == variant.visit!(func,
(size_t i) => i
)());
Algebraic!(int, float, string) variant2 = 5.0f;
// Shouldn' t compile as float not handled by visitor.
static assert(!__traits(compiles, variant2.visit!(
(int _) {},
(string _) {})()));
Algebraic!(size_t, string, float) variant3;
variant3 = 10.0f;
auto floatVisited = false;
assert(variant3.visit!(
(float f) { floatVisited = true; return cast(size_t) f; },
func,
(size_t i) { return i; }
)() == 10);
assert(floatVisited == true);
Algebraic!(float, string) variant4;
assert(variant4.visit!(func, (float f) => cast(size_t) f, () => size_t.max)() == size_t.max);
// double error func check
static assert(!__traits(compiles,
visit!(() => size_t.max, func, (float f) => cast(size_t) f, () => size_t.max)(variant4))
);
}
// disallow providing multiple generic handlers to visit
// disallow a generic handler that does not apply to all types
@system unittest
{
Algebraic!(int, float) number = 2;
// ok, x + 1 valid for int and float
static assert( __traits(compiles, number.visit!(x => x + 1)));
// bad, two generic handlers
static assert(!__traits(compiles, number.visit!(x => x + 1, x => x + 2)));
// bad, x ~ "a" does not apply to int or float
static assert(!__traits(compiles, number.visit!(x => x ~ "a")));
// bad, x ~ "a" does not apply to int or float
static assert(!__traits(compiles, number.visit!(x => x + 1, x => x ~ "a")));
Algebraic!(int, string) maybenumber = 2;
// ok, x ~ "a" valid for string, x + 1 valid for int, only 1 generic
static assert( __traits(compiles, number.visit!((string x) => x ~ "a", x => x + 1)));
// bad, x ~ "a" valid for string but not int
static assert(!__traits(compiles, number.visit!(x => x ~ "a")));
// bad, two generics, each only applies in one case
static assert(!__traits(compiles, number.visit!(x => x + 1, x => x ~ "a")));
}
/**
* Behaves as $(LREF visit) but doesn't enforce that all types are handled
* by the visiting functions.
*
* If a parameter-less function is specified it is called when
* either $(D variant) doesn't hold a value or holds a type
* which isn't handled by the visiting functions.
*
* Returns: The return type of tryVisit is deduced from the visiting functions and must be
* the same across all overloads.
* Throws: $(LREF VariantException) if `variant` doesn't hold a value or
* `variant` holds a value which isn't handled by the visiting functions,
* when no parameter-less fallback function is specified.
*/
template tryVisit(Handlers...)
if (Handlers.length > 0)
{
///
auto tryVisit(VariantType)(VariantType variant)
if (isAlgebraic!VariantType)
{
return visitImpl!(false, VariantType, Handlers)(variant);
}
}
///
@system unittest
{
Algebraic!(int, string) variant;
variant = 10;
auto which = -1;
variant.tryVisit!((int i) { which = 0; })();
assert(which == 0);
// Error function usage
variant = "test";
variant.tryVisit!((int i) { which = 0; },
() { which = -100; })();
assert(which == -100);
}
@system unittest
{
import std.exception : assertThrown;
Algebraic!(int, string) variant;
variant = 10;
auto which = -1;
variant.tryVisit!((int i){ which = 0; })();
assert(which == 0);
variant = "test";
assertThrown!VariantException(variant.tryVisit!((int i) { which = 0; })());
void errorfunc()
{
which = -1;
}
variant.tryVisit!((int i) { which = 0; }, errorfunc)();
assert(which == -1);
}
private template isAlgebraic(Type)
{
static if (is(Type _ == VariantN!T, T...))
enum isAlgebraic = T.length >= 2; // T[0] == maxDataSize, T[1..$] == AllowedTypesParam
else
enum isAlgebraic = false;
}
@system unittest
{
static assert(!isAlgebraic!(Variant));
static assert( isAlgebraic!(Algebraic!(string)));
static assert( isAlgebraic!(Algebraic!(int, int[])));
}
private auto visitImpl(bool Strict, VariantType, Handler...)(VariantType variant)
if (isAlgebraic!VariantType && Handler.length > 0)
{
alias AllowedTypes = VariantType.AllowedTypes;
/**
* Returns: Struct where $(D indices) is an array which
* contains at the n-th position the index in Handler which takes the
* n-th type of AllowedTypes. If an Handler doesn't match an
* AllowedType, -1 is set. If a function in the delegates doesn't
* have parameters, the field $(D exceptionFuncIdx) is set;
* otherwise it's -1.
*/
auto visitGetOverloadMap()
{
struct Result {
int[AllowedTypes.length] indices;
int exceptionFuncIdx = -1;
int generalFuncIdx = -1;
}
Result result;
foreach (tidx, T; AllowedTypes)
{
bool added = false;
foreach (dgidx, dg; Handler)
{
// Handle normal function objects
static if (isSomeFunction!dg)
{
alias Params = Parameters!dg;
static if (Params.length == 0)
{
// Just check exception functions in the first
// inner iteration (over delegates)
if (tidx > 0)
continue;
else
{
if (result.exceptionFuncIdx != -1)
assert(false, "duplicate parameter-less (error-)function specified");
result.exceptionFuncIdx = dgidx;
}
}
else static if (is(Params[0] == T) || is(Unqual!(Params[0]) == T))
{
if (added)
assert(false, "duplicate overload specified for type '" ~ T.stringof ~ "'");
added = true;
result.indices[tidx] = dgidx;
}
}
else static if (isSomeFunction!(dg!T))
{
assert(result.generalFuncIdx == -1 ||
result.generalFuncIdx == dgidx,
"Only one generic visitor function is allowed");
result.generalFuncIdx = dgidx;
}
// Handle composite visitors with opCall overloads
else
{
static assert(false, dg.stringof ~ " is not a function or delegate");
}
}
if (!added)
result.indices[tidx] = -1;
}
return result;
}
enum HandlerOverloadMap = visitGetOverloadMap();
if (!variant.hasValue)
{
// Call the exception function. The HandlerOverloadMap
// will have its exceptionFuncIdx field set to value != -1 if an
// exception function has been specified; otherwise we just through an exception.
static if (HandlerOverloadMap.exceptionFuncIdx != -1)
return Handler[ HandlerOverloadMap.exceptionFuncIdx ]();
else
throw new VariantException("variant must hold a value before being visited.");
}
foreach (idx, T; AllowedTypes)
{
if (auto ptr = variant.peek!T)
{
enum dgIdx = HandlerOverloadMap.indices[idx];
static if (dgIdx == -1)
{
static if (HandlerOverloadMap.generalFuncIdx >= 0)
return Handler[HandlerOverloadMap.generalFuncIdx](*ptr);
else static if (Strict)
static assert(false, "overload for type '" ~ T.stringof ~ "' hasn't been specified");
else static if (HandlerOverloadMap.exceptionFuncIdx != -1)
return Handler[HandlerOverloadMap.exceptionFuncIdx]();
else
throw new VariantException(
"variant holds value of type '"
~ T.stringof ~
"' but no visitor has been provided"
);
}
else
{
return Handler[ dgIdx ](*ptr);
}
}
}
assert(false);
}
@system unittest
{
// validate that visit can be called with a const type
struct Foo { int depth; }
struct Bar { int depth; }
alias FooBar = Algebraic!(Foo, Bar);
int depth(in FooBar fb) {
return fb.visit!((Foo foo) => foo.depth,
(Bar bar) => bar.depth);
}
FooBar fb = Foo(3);
assert(depth(fb) == 3);
}
@system unittest
{
// https://issues.dlang.org/show_bug.cgi?id=16383
class Foo {this() immutable {}}
alias V = Algebraic!(immutable Foo);
auto x = V(new immutable Foo).visit!(
(immutable(Foo) _) => 3
);
assert(x == 3);
}
@system unittest
{
// http://d.puremagic.com/issues/show_bug.cgi?id=5310
const Variant a;
assert(a == a);
Variant b;
assert(a == b);
assert(b == a);
}
@system unittest
{
const Variant a = [2];
assert(a[0] == 2);
}
@system unittest
{
// http://d.puremagic.com/issues/show_bug.cgi?id=10017
static struct S
{
ubyte[Variant.size + 1] s;
}
Variant v1, v2;
v1 = S(); // the payload is allocated on the heap
v2 = v1; // AssertError: target must be non-null
assert(v1 == v2);
}
@system unittest
{
import std.exception : assertThrown;
// http://d.puremagic.com/issues/show_bug.cgi?id=7069
Variant v;
int i = 10;
v = i;
static foreach (qual; AliasSeq!(MutableOf, ConstOf))
{
assert(v.get!(qual!int) == 10);
assert(v.get!(qual!float) == 10.0f);
}
static foreach (qual; AliasSeq!(ImmutableOf, SharedOf, SharedConstOf))
{
assertThrown!VariantException(v.get!(qual!int));
}
const(int) ci = 20;
v = ci;
static foreach (qual; AliasSeq!(ConstOf))
{
assert(v.get!(qual!int) == 20);
assert(v.get!(qual!float) == 20.0f);
}
static foreach (qual; AliasSeq!(MutableOf, ImmutableOf, SharedOf, SharedConstOf))
{
assertThrown!VariantException(v.get!(qual!int));
assertThrown!VariantException(v.get!(qual!float));
}
immutable(int) ii = ci;
v = ii;
static foreach (qual; AliasSeq!(ImmutableOf, ConstOf, SharedConstOf))
{
assert(v.get!(qual!int) == 20);
assert(v.get!(qual!float) == 20.0f);
}
static foreach (qual; AliasSeq!(MutableOf, SharedOf))
{
assertThrown!VariantException(v.get!(qual!int));
assertThrown!VariantException(v.get!(qual!float));
}
int[] ai = [1,2,3];
v = ai;
static foreach (qual; AliasSeq!(MutableOf, ConstOf))
{
assert(v.get!(qual!(int[])) == [1,2,3]);
assert(v.get!(qual!(int)[]) == [1,2,3]);
}
static foreach (qual; AliasSeq!(ImmutableOf, SharedOf, SharedConstOf))
{
assertThrown!VariantException(v.get!(qual!(int[])));
assertThrown!VariantException(v.get!(qual!(int)[]));
}
const(int[]) cai = [4,5,6];
v = cai;
static foreach (qual; AliasSeq!(ConstOf))
{
assert(v.get!(qual!(int[])) == [4,5,6]);
assert(v.get!(qual!(int)[]) == [4,5,6]);
}
static foreach (qual; AliasSeq!(MutableOf, ImmutableOf, SharedOf, SharedConstOf))
{
assertThrown!VariantException(v.get!(qual!(int[])));
assertThrown!VariantException(v.get!(qual!(int)[]));
}
immutable(int[]) iai = [7,8,9];
v = iai;
//assert(v.get!(immutable(int[])) == [7,8,9]); // Bug ??? runtime error
assert(v.get!(immutable(int)[]) == [7,8,9]);
assert(v.get!(const(int[])) == [7,8,9]);
assert(v.get!(const(int)[]) == [7,8,9]);
//assert(v.get!(shared(const(int[]))) == cast(shared const)[7,8,9]); // Bug ??? runtime error
//assert(v.get!(shared(const(int))[]) == cast(shared const)[7,8,9]); // Bug ??? runtime error
static foreach (qual; AliasSeq!(MutableOf))
{
assertThrown!VariantException(v.get!(qual!(int[])));
assertThrown!VariantException(v.get!(qual!(int)[]));
}
class A {}
class B : A {}
B b = new B();
v = b;
static foreach (qual; AliasSeq!(MutableOf, ConstOf))
{
assert(v.get!(qual!B) is b);
assert(v.get!(qual!A) is b);
assert(v.get!(qual!Object) is b);
}
static foreach (qual; AliasSeq!(ImmutableOf, SharedOf, SharedConstOf))
{
assertThrown!VariantException(v.get!(qual!B));
assertThrown!VariantException(v.get!(qual!A));
assertThrown!VariantException(v.get!(qual!Object));
}
const(B) cb = new B();
v = cb;
static foreach (qual; AliasSeq!(ConstOf))
{
assert(v.get!(qual!B) is cb);
assert(v.get!(qual!A) is cb);
assert(v.get!(qual!Object) is cb);
}
static foreach (qual; AliasSeq!(MutableOf, ImmutableOf, SharedOf, SharedConstOf))
{
assertThrown!VariantException(v.get!(qual!B));
assertThrown!VariantException(v.get!(qual!A));
assertThrown!VariantException(v.get!(qual!Object));
}
immutable(B) ib = new immutable(B)();
v = ib;
static foreach (qual; AliasSeq!(ImmutableOf, ConstOf, SharedConstOf))
{
assert(v.get!(qual!B) is ib);
assert(v.get!(qual!A) is ib);
assert(v.get!(qual!Object) is ib);
}
static foreach (qual; AliasSeq!(MutableOf, SharedOf))
{
assertThrown!VariantException(v.get!(qual!B));
assertThrown!VariantException(v.get!(qual!A));
assertThrown!VariantException(v.get!(qual!Object));
}
shared(B) sb = new shared B();
v = sb;
static foreach (qual; AliasSeq!(SharedOf, SharedConstOf))
{
assert(v.get!(qual!B) is sb);
assert(v.get!(qual!A) is sb);
assert(v.get!(qual!Object) is sb);
}
static foreach (qual; AliasSeq!(MutableOf, ImmutableOf, ConstOf))
{
assertThrown!VariantException(v.get!(qual!B));
assertThrown!VariantException(v.get!(qual!A));
assertThrown!VariantException(v.get!(qual!Object));
}
shared(const(B)) scb = new shared const B();
v = scb;
static foreach (qual; AliasSeq!(SharedConstOf))
{
assert(v.get!(qual!B) is scb);
assert(v.get!(qual!A) is scb);
assert(v.get!(qual!Object) is scb);
}
static foreach (qual; AliasSeq!(MutableOf, ConstOf, ImmutableOf, SharedOf))
{
assertThrown!VariantException(v.get!(qual!B));
assertThrown!VariantException(v.get!(qual!A));
assertThrown!VariantException(v.get!(qual!Object));
}
}
@system unittest
{
static struct DummyScope
{
// https://d.puremagic.com/issues/show_bug.cgi?id=12540
alias Alias12540 = Algebraic!Class12540;
static class Class12540
{
Alias12540 entity;
}
}
}
@system unittest
{
// https://issues.dlang.org/show_bug.cgi?id=10194
// Also test for elaborate copying
static struct S
{
@disable this();
this(int dummy)
{
++cnt;
}
this(this)
{
++cnt;
}
@disable S opAssign();
~this()
{
--cnt;
assert(cnt >= 0);
}
static int cnt = 0;
}
{
Variant v;
{
v = S(0);
assert(S.cnt == 1);
}
assert(S.cnt == 1);
// assigning a new value should destroy the existing one
v = 0;
assert(S.cnt == 0);
// destroying the variant should destroy it's current value
v = S(0);
assert(S.cnt == 1);
}
assert(S.cnt == 0);
}
@system unittest
{
// Bugzilla 13300
static struct S
{
this(this) {}
~this() {}
}
static assert( hasElaborateCopyConstructor!(Variant));
static assert(!hasElaborateCopyConstructor!(Algebraic!bool));
static assert( hasElaborateCopyConstructor!(Algebraic!S));
static assert( hasElaborateCopyConstructor!(Algebraic!(bool, S)));
static assert( hasElaborateDestructor!(Variant));
static assert(!hasElaborateDestructor!(Algebraic!bool));
static assert( hasElaborateDestructor!(Algebraic!S));
static assert( hasElaborateDestructor!(Algebraic!(bool, S)));
import std.array;
alias Value = Algebraic!bool;
static struct T
{
Value value;
@disable this();
}
auto a = appender!(T[]);
}
@system unittest
{
// Bugzilla 13871
alias A = Algebraic!(int, typeof(null));
static struct B { A value; }
alias C = std.variant.Algebraic!B;
C var;
var = C(B());
}
@system unittest
{
import std.exception : assertThrown, assertNotThrown;
// Make sure Variant can handle types with opDispatch but no length field.
struct SWithNoLength
{
void opDispatch(string s)() { }
}
struct SWithLength
{
@property int opDispatch(string s)()
{
// Assume that s == "length"
return 5; // Any value is OK for test.
}
}
SWithNoLength sWithNoLength;
Variant v = sWithNoLength;
assertThrown!VariantException(v.length);
SWithLength sWithLength;
v = sWithLength;
assertNotThrown!VariantException(v.get!SWithLength.length);
assertThrown!VariantException(v.length);
}
@system unittest
{
// Bugzilla 13534
static assert(!__traits(compiles, () @safe {
auto foo() @system { return 3; }
auto v = Variant(&foo);
v(); // foo is called in safe code!?
}));
}
@system unittest
{
// Bugzilla 15039
import std.typecons;
import std.variant;
alias IntTypedef = Typedef!int;
alias Obj = Algebraic!(int, IntTypedef, This[]);
Obj obj = 1;
obj.visit!(
(int x) {},
(IntTypedef x) {},
(Obj[] x) {},
);
}
@system unittest
{
// Bugzilla 15791
int n = 3;
struct NS1 { int foo() { return n + 10; } }
struct NS2 { int foo() { return n * 10; } }
Variant v;
v = NS1();
assert(v.get!NS1.foo() == 13);
v = NS2();
assert(v.get!NS2.foo() == 30);
}
@system unittest
{
// Bugzilla 15827
static struct Foo15827 { Variant v; this(Foo15827 v) {} }
Variant v = Foo15827.init;
}
|
D
|
version https://git-lfs.github.com/spec/v1
oid sha256:169a02dc19d9a77a6b64a6484ec610270cadcb9d88424ef0bc1f74fba59f5d4b
size 99
|
D
|
module hunt.web.client.SimpleResponse;
import hunt.http.codec.http.model;
import hunt.logging;
// import java.io.ByteArrayInputStream;
import hunt.util.Common;
import hunt.Exceptions;
import hunt.Functions;
import hunt.io;
import hunt.text;
import hunt.Functions;
import hunt.collection;
// import java.util.Iterator;
// import java.util.Spliterator;
// import java.util.function.Consumer;
// import hunt.Functions;
// import java.util.stream.Collectors;
// import java.util.zip.GZIPInputStream;
import std.range;
// alias HttpResponse = MetaData.HttpResponse;
/**
*/
class SimpleResponse {
HttpResponse response;
List!(ByteBuffer) responseBody; // = new ArrayList!ByteBuffer();
List!Cookie cookies;
string stringBody;
this(HttpResponse response) {
responseBody = new ArrayList!ByteBuffer();
this.response = response;
}
HttpVersion getHttpVersion() {
return response.getHttpVersion();
}
HttpFields getFields() {
return response.getFields();
}
long getContentLength() {
return response.getContentLength();
}
InputRange!HttpField iterator() {
return response.iterator();
}
int getStatus() {
return response.getStatus();
}
string getReason() {
return response.getReason();
}
Supplier!HttpFields getTrailerSupplier() {
return response.getTrailerSupplier();
}
// void forEach(Consumer<? super HttpField> action) {
// response.forEach(action);
// }
// Spliterator!HttpField spliterator() {
// return response.spliterator();
// }
HttpResponse getResponse() {
return response;
}
List!(ByteBuffer) getResponseBody() {
return responseBody;
}
string getStringBody() {
return getStringBody("UTF-8");
}
string getStringBody(string charset) {
if (stringBody == null) {
string contentEncoding = getFields().get(HttpHeader.CONTENT_ENCODING);
if ("gzip".equalsIgnoreCase(contentEncoding)) {
byte[] bytes = BufferUtils.toArray(responseBody);
if (bytes != null) {
try {
// GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(bytes));
// return IO.toString(gzipInputStream, charset);
implementationMissing();
return "";
} catch (IOException e) {
errorf("unzip exception", e);
return null;
}
} else {
return null;
}
} else {
stringBody = BufferUtils.toString(responseBody);
return stringBody;
}
} else {
return stringBody;
}
}
// T getJsonBody(T)(GenericTypeReference!T typeReference) {
// return Json.toObject(getStringBody(), typeReference);
// }
// T getJsonBody(T)(Class!T clazz) {
// return Json.toObject(getStringBody(), clazz);
// }
// JsonObject getJsonObjectBody() {
// return Json.toJsonObject(getStringBody());
// }
// JsonArray getJsonArrayBody() {
// return Json.toJsonArray(getStringBody());
// }
List!Cookie getCookies() {
// if (cookies == null) {
// cookies = response.getFields().getValuesList(HttpHeader.SET_COOKIE.asString()).stream()
// .map(CookieParser::parseSetCookie).collect(Collectors.toList());
// return cookies;
// } else {
// return cookies;
// }
implementationMissing();
return cookies;
}
}
|
D
|
module d.parser.expression;
import d.ast.expression;
import d.ast.identifier;
import d.ir.expression;
import d.parser.ambiguous;
import d.parser.base;
import d.parser.identifier;
import d.parser.statement;
import d.parser.type;
import d.parser.util;
/**
* Parse Expression
*/
AstExpression parseExpression(ParseMode mode = ParseMode.Greedy)(ref TokenRange trange) {
auto lhs = trange.parsePrefixExpression!mode();
return trange.parseAstBinaryExpression!(
TokenType.Comma,
AstBinaryOp.Comma,
function AstExpression(ref TokenRange trange, AstExpression e) {
return trange.parseAssignExpression(e);
}
)(lhs);
}
/**
* Template used to parse basic AstBinaryExpressions.
*/
private AstExpression parseAstBinaryExpression(
TokenType tokenType,
AstBinaryOp op,
alias parseNext,
R,
)(ref R trange, AstExpression lhs) {
lhs = parseNext(trange, lhs);
Location location = lhs.location;
while (trange.front.type == tokenType) {
trange.popFront();
auto rhs = trange.parsePrefixExpression();
rhs = parseNext(trange, rhs);
location.spanTo(rhs.location);
lhs = new AstBinaryExpression(location, op, lhs, rhs);
}
return lhs;
}
/**
* Parse assignement expressions.
*/
AstExpression parseAssignExpression(ref TokenRange trange) {
return trange.parseAssignExpression(trange.parsePrefixExpression());
}
AstExpression parseAssignExpression(ref TokenRange trange, AstExpression lhs) {
lhs = trange.parseTernaryExpression(lhs);
Location location = lhs.location;
void processToken(AstBinaryOp op) {
trange.popFront();
auto rhs = trange.parsePrefixExpression();
rhs = trange.parseAssignExpression(rhs);
location.spanTo(rhs.location);
lhs = new AstBinaryExpression(location, op, lhs, rhs);
}
switch(trange.front.type) with(AstBinaryOp) with(TokenType) {
case Equal :
processToken(Assign);
break;
case PlusEqual :
processToken(AddAssign);
break;
case MinusEqual :
processToken(SubAssign);
break;
case StarEqual :
processToken(MulAssign);
break;
case SlashEqual :
processToken(DivAssign);
break;
case PercentEqual :
processToken(ModAssign);
break;
case AmpersandEqual :
processToken(BitwiseAndAssign);
break;
case PipeEqual :
processToken(BitwiseOrAssign);
break;
case CaretEqual :
processToken(BitwiseXorAssign);
break;
case TildeEqual :
processToken(ConcatAssign);
break;
case LessLessEqual :
processToken(LeftShiftAssign);
break;
case MoreMoreEqual :
processToken(SignedRightShiftAssign);
break;
case MoreMoreMoreEqual :
processToken(UnsignedRightShiftAssign);
break;
case CaretCaretEqual :
processToken(PowAssign);
break;
default :
// No assignement.
break;
}
return lhs;
}
/**
* Parse ?:
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseTernaryExpression(ref TokenRange trange) {
return trange.parseTernaryExpression(trange.parsePrefixExpression());
}
AstExpression parseTernaryExpression(ref TokenRange trange, AstExpression condition) {
condition = trange.parseLogicalOrExpression(condition);
if (trange.front.type == TokenType.QuestionMark) {
Location location = condition.location;
trange.popFront();
auto ifTrue = trange.parseExpression();
trange.match(TokenType.Colon);
auto ifFalse = trange.parseTernaryExpression();
location.spanTo(ifFalse.location);
return new AstTernaryExpression(location, condition, ifTrue, ifFalse);
}
return condition;
}
/**
* Parse ||
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseLogicalOrExpression(ref TokenRange trange) {
return trange.parseLogicalOrExpression(trange.parsePrefixExpression());
}
auto parseLogicalOrExpression(ref TokenRange trange, AstExpression lhs) {
return trange.parseAstBinaryExpression!(
TokenType.PipePipe,
AstBinaryOp.LogicalOr,
function AstExpression(ref TokenRange trange, AstExpression e) {
return trange.parseLogicalAndExpression(e);
}
)(lhs);
}
/**
* Parse &&
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseLogicalAndExpression(ref TokenRange trange) {
return trange.parseLogicalAndExpression(trange.parsePrefixExpression());
}
auto parseLogicalAndExpression(ref TokenRange trange, AstExpression lhs) {
return trange.parseAstBinaryExpression!(
TokenType.AmpersandAmpersand,
AstBinaryOp.LogicalAnd,
function AstExpression(ref TokenRange trange, AstExpression e) {
return trange.parseBitwiseOrExpression(e);
}
)(lhs);
}
/**
* Parse |
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseBitwiseOrExpression(ref TokenRange trange) {
return trange.parseBitwiseOrExpression(trange.parsePrefixExpression());
}
auto parseBitwiseOrExpression(ref TokenRange trange, AstExpression lhs) {
return trange.parseAstBinaryExpression!(
TokenType.Pipe,
AstBinaryOp.BitwiseOr,
function AstExpression(ref TokenRange trange, AstExpression e) {
return trange.parseBitwiseXorExpression(e);
}
)(lhs);
}
/**
* Parse ^
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseBitwiseXorExpression(ref TokenRange trange) {
return trange.parseBitwiseXorExpression(trange.parsePrefixExpression());
}
auto parseBitwiseXorExpression(ref TokenRange trange, AstExpression lhs) {
return trange.parseAstBinaryExpression!(
TokenType.Caret,
AstBinaryOp.BitwiseXor,
function AstExpression(ref TokenRange trange, AstExpression e) {
return trange.parseBitwiseAndExpression(e);
}
)(lhs);
}
/**
* Parse &
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseBitwiseAndExpression(ref TokenRange trange) {
return trange.parseBitwiseAndExpression(trange.parsePrefixExpression());
}
auto parseBitwiseAndExpression(ref TokenRange trange, AstExpression lhs) {
return trange.parseAstBinaryExpression!(
TokenType.Ampersand,
AstBinaryOp.BitwiseAnd,
function AstExpression(ref TokenRange trange, AstExpression e) {
return trange.parseComparaisonExpression(e);
}
)(lhs);
}
/**
* Parse ==, != and comparaisons
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseComparaisonExpression(ref TokenRange trange) {
return trange.parseComparaisonExpression(trange.parsePrefixExpression());
}
AstExpression parseComparaisonExpression(ref TokenRange trange, AstExpression lhs) {
lhs = trange.parseShiftExpression(lhs);
Location location = lhs.location;
void processToken(AstBinaryOp op) {
trange.popFront();
auto rhs = trange.parseShiftExpression();
location.spanTo(rhs.location);
lhs = new AstBinaryExpression(location, op, lhs, rhs);
}
switch(trange.front.type) with(TokenType) {
case EqualEqual :
processToken(AstBinaryOp.Equal);
break;
case BangEqual :
processToken(AstBinaryOp.NotEqual);
break;
case More:
processToken(AstBinaryOp.Greater);
break;
case MoreEqual:
processToken(AstBinaryOp.GreaterEqual);
break;
case Less :
processToken(AstBinaryOp.Less);
break;
case LessEqual :
processToken(AstBinaryOp.LessEqual);
break;
case BangLessMoreEqual:
processToken(AstBinaryOp.Unordered);
break;
case BangLessMore:
processToken(AstBinaryOp.UnorderedEqual);
break;
case LessMore:
processToken(AstBinaryOp.LessGreater);
break;
case LessMoreEqual:
processToken(AstBinaryOp.LessEqualGreater);
break;
case BangMore:
processToken(AstBinaryOp.UnorderedLessEqual);
break;
case BangMoreEqual:
processToken(AstBinaryOp.UnorderedLess);
break;
case BangLess:
processToken(AstBinaryOp.UnorderedGreaterEqual);
break;
case BangLessEqual:
processToken(AstBinaryOp.UnorderedGreater);
break;
case Is :
processToken(AstBinaryOp.Identical);
break;
case In :
processToken(AstBinaryOp.In);
break;
case Bang :
trange.popFront();
switch(trange.front.type) {
case Is :
processToken(AstBinaryOp.NotIdentical);
break;
case In :
processToken(AstBinaryOp.NotIn);
break;
default :
trange.match(TokenType.Begin);
break;
}
break;
default :
// We have no comparaison, so we just return.
break;
}
return lhs;
}
/**
* Parse <<, >> and >>>
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseShiftExpression(ref TokenRange trange) {
return trange.parseShiftExpression(trange.parsePrefixExpression());
}
AstExpression parseShiftExpression(ref TokenRange trange, AstExpression lhs) {
lhs = trange.parseAddExpression(lhs);
Location location = lhs.location;
while(1) {
void processToken(AstBinaryOp op) {
trange.popFront();
auto rhs = trange.parseAddExpression();
location.spanTo(rhs.location);
lhs = new AstBinaryExpression(location, op, lhs, rhs);
}
switch(trange.front.type) with(AstBinaryOp) with(TokenType) {
case LessLess :
processToken(LeftShift);
break;
case MoreMore :
processToken(SignedRightShift);
break;
case MoreMoreMore :
processToken(UnsignedRightShift);
break;
default :
return lhs;
}
}
}
/**
* Parse +, - and ~
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseAddExpression(ref TokenRange trange) {
return trange.parseAddExpression(trange.parsePrefixExpression());
}
AstExpression parseAddExpression(ref TokenRange trange, AstExpression lhs) {
lhs = trange.parseMulExpression(lhs);
Location location = lhs.location;
while(1) {
void processToken(AstBinaryOp op) {
trange.popFront();
auto rhs = trange.parseMulExpression();
location.spanTo(rhs.location);
lhs = new AstBinaryExpression(location, op, lhs, rhs);
}
switch(trange.front.type) with(AstBinaryOp) with(TokenType) {
case Plus :
processToken(Add);
break;
case Minus :
processToken(Sub);
break;
case Tilde :
processToken(Concat);
break;
default :
return lhs;
}
}
}
/**
* Parse *, / and %
*/
// FIXME: Should be private, but dmd don't like that.
AstExpression parseMulExpression(ref TokenRange trange) {
return trange.parseMulExpression(trange.parsePrefixExpression());
}
AstExpression parseMulExpression(ref TokenRange trange, AstExpression lhs) {
Location location = lhs.location;
while(1) {
void processToken(AstBinaryOp op) {
trange.popFront();
auto rhs = trange.parsePrefixExpression();
location.spanTo(rhs.location);
lhs = new AstBinaryExpression(location, op, lhs, rhs);
}
switch(trange.front.type) with(AstBinaryOp) with(TokenType) {
case Star :
processToken(Mul);
break;
case Slash :
processToken(Div);
break;
case Percent :
processToken(Mod);
break;
default :
return lhs;
}
}
}
/**
* Unary prefixes
*/
private AstExpression parsePrefixExpression(
ParseMode mode = ParseMode.Greedy,
)(ref TokenRange trange) {
AstExpression result;
void processToken(UnaryOp op) {
Location location = trange.front.location;
trange.popFront();
// Drop mode on purpose.
result = trange.parsePrefixExpression();
location.spanTo(result.location);
result = new AstUnaryExpression(location, op, result);
}
switch(trange.front.type) with(TokenType) {
case Ampersand :
processToken(UnaryOp.AddressOf);
break;
case PlusPlus :
processToken(UnaryOp.PreInc);
break;
case MinusMinus :
processToken(UnaryOp.PreDec);
break;
case Star :
processToken(UnaryOp.Dereference);
break;
case Plus :
processToken(UnaryOp.Plus);
break;
case Minus :
processToken(UnaryOp.Minus);
break;
case Bang :
processToken(UnaryOp.Not);
break;
case Tilde :
processToken(UnaryOp.Complement);
break;
// TODO: parse qualifier casts.
case Cast :
Location location = trange.front.location;
trange.popFront();
trange.match(OpenParen);
switch(trange.front.type) {
case CloseParen :
assert(0, "cast() isn't supported.");
default :
auto type = trange.parseType();
trange.match(CloseParen);
result = trange.parsePrefixExpression();
location.spanTo(result.location);
result = new AstCastExpression(location, type, result);
}
break;
default :
result = trange.parsePrimaryExpression();
result = trange.parsePostfixExpression!mode(result);
}
// Ensure we do not screwed up.
assert(result);
return trange.parsePowExpression(result);
}
AstExpression parsePrimaryExpression(ref TokenRange trange) {
Location location = trange.front.location;
switch(trange.front.type) with(TokenType) {
// Identified expressions
case Identifier :
return trange.parseIdentifierExpression(trange.parseIdentifier());
case New :
trange.popFront();
auto type = trange.parseType();
auto args = trange.parseArguments!OpenParen();
location.spanTo(trange.front.location);
return new AstNewExpression(location, type, args);
case Dot :
return trange.parseIdentifierExpression(trange.parseDotIdentifier());
case This :
trange.popFront();
return new ThisExpression(location);
case Super :
trange.popFront();
return new SuperExpression(location);
case True :
trange.popFront();
return new BooleanLiteral(location, true);
case False :
trange.popFront();
return new BooleanLiteral(location, false);
case Null :
trange.popFront();
return new NullLiteral(location);
case IntegerLiteral :
return trange.parseIntegerLiteral();
case StringLiteral :
auto name = trange.front.name;
trange.popFront();
// XXX: Use name for string once CTFE do not return node ?
return new d.ir.expression.StringLiteral(location, name.toString(trange.context));
case CharacterLiteral :
auto str = trange.front.name.toString(trange.context);
assert(str.length == 1);
trange.popFront();
import d.common.builtintype : BuiltinType;
return new d.ir.expression.CharacterLiteral(location, str[0], BuiltinType.Char);
case OpenBracket :
AstExpression[] keys, values;
do {
trange.popFront();
auto value = trange.parseAssignExpression();
if(trange.front.type == Colon) {
keys ~= value;
trange.popFront();
values ~= trange.parseAssignExpression();
} else {
values ~= value;
}
} while(trange.front.type == Comma);
location.spanTo(trange.front.location);
trange.match(CloseBracket);
return new AstArrayLiteral(location, values);
case OpenBrace :
return new DelegateLiteral(trange.parseBlock());
case Function :
case Delegate :
assert(0, "Functions or Delegates not implemented ");
case __File__ :
trange.popFront();
return new __File__Literal(location);
case __Line__ :
trange.popFront();
return new __Line__Literal(location);
case Dollar :
trange.popFront();
return new DollarExpression(location);
case Typeid :
trange.popFront();
trange.match(OpenParen);
return trange.parseAmbiguous!(delegate AstExpression(parsed) {
location.spanTo(trange.front.location);
trange.match(CloseParen);
import d.ast.type;
alias T = typeof(parsed);
static if(is(T : AstType)) {
return new AstStaticTypeidExpression(location, parsed);
} else static if(is(T : AstExpression)) {
return new AstTypeidExpression(location, parsed);
} else {
return new IdentifierTypeidExpression(location, parsed);
}
})();
case Is :
return trange.parseIsExpression();
case OpenParen :
auto matchingParen = trange.save;
matchingParen.popMatchingDelimiter!OpenParen();
switch(matchingParen.front.type) {
case Dot:
trange.popFront();
return trange.parseAmbiguous!((parsed) {
trange.match(CloseParen);
trange.match(Dot);
auto qi = trange.parseQualifiedIdentifier(
location,
parsed,
);
return trange.parseIdentifierExpression(qi);
})();
case OpenBrace:
import d.parser.declaration;
bool isVariadic;
auto params = trange.parseParameters(isVariadic);
auto block = trange.parseBlock();
location.spanTo(block.location);
return new DelegateLiteral(location, params, isVariadic, block);
case EqualMore:
import d.parser.declaration;
bool isVariadic;
auto params = trange.parseParameters(isVariadic);
assert(!isVariadic, "Variadic lambda not supported");
trange.match(EqualMore);
auto value = trange.parseExpression();
location.spanTo(value.location);
return new Lambda(location, params, value);
default:
trange.popFront();
auto expression = trange.parseExpression();
location.spanTo(trange.front.location);
trange.match(CloseParen);
return new ParenExpression(location, expression);
}
default:
// Our last resort are type.identifier expressions.
auto type = trange.parseType!(ParseMode.Reluctant)();
trange.match(Dot);
// FIXME: Or type() {} expressions.
return trange.parseIdentifierExpression(
trange.parseQualifiedIdentifier(location, type),
);
}
}
/**
* Parse postfix ++, --, (...), [...], .identifier
*/
AstExpression parsePostfixExpression(ParseMode mode)(ref TokenRange trange, AstExpression e) {
Location location = e.location;
while(1) {
switch(trange.front.type) with(TokenType) {
case PlusPlus :
location.spanTo(trange.front.location);
trange.popFront();
e = new AstUnaryExpression(location, UnaryOp.PostInc, e);
break;
case MinusMinus :
location.spanTo(trange.front.location);
trange.popFront();
e = new AstUnaryExpression(location, UnaryOp.PostDec, e);
break;
case OpenParen :
auto args = trange.parseArguments!OpenParen();
location.spanTo(trange.front.location);
e = new AstCallExpression(location, e, args);
break;
// TODO: Indices, Slices.
case OpenBracket :
trange.popFront();
if (trange.front.type == CloseBracket) {
// We have a slicing operation here.
assert(0, "Slice expressions can not be parsed yet");
} else {
auto args = trange.parseArguments();
switch(trange.front.type) {
case CloseBracket :
location.spanTo(trange.front.location);
e = new AstIndexExpression(location, e, args);
break;
case DotDot :
trange.popFront();
auto second = trange.parseArguments();
location.spanTo(trange.front.location);
e = new AstSliceExpression(location, e, args, second);
break;
default :
// TODO: error message that make sense.
trange.match(Begin);
break;
}
}
trange.match(CloseBracket);
break;
static if(mode == ParseMode.Greedy) {
case Dot :
trange.popFront();
e = trange.parseIdentifierExpression(
trange.parseQualifiedIdentifier(location, e),
);
break;
}
default :
return e;
}
}
}
/**
* Parse ^^
*/
private
AstExpression parsePowExpression(ref TokenRange trange, AstExpression expr) {
Location location = expr.location;
while (trange.front.type == TokenType.CaretCaret) {
trange.popFront();
AstExpression power = trange.parsePrefixExpression();
location.spanTo(power.location);
expr = new AstBinaryExpression(location, AstBinaryOp.Pow, expr, power);
}
return expr;
}
/**
* Parse unary is expression.
*/
private auto parseIsExpression(ref TokenRange trange) {
Location location = trange.front.location;
trange.match(TokenType.Is);
trange.match(TokenType.OpenParen);
auto type = trange.parseType();
// Handle alias throw is expression.
if (trange.front.type == TokenType.Identifier) {
trange.popFront();
}
switch(trange.front.type) with(TokenType) {
case Colon :
trange.popFront();
trange.parseType();
break;
case EqualEqual :
trange.popFront();
switch(trange.front.type) {
case Struct, Union, Class, Interface, Enum, Function, Delegate :
case Super, Const, Immutable, Inout, Shared, Return :
assert(0, "Not implemented.");
default :
trange.parseType();
}
break;
default :
break;
}
location.spanTo(trange.front.location);
trange.match(TokenType.CloseParen);
return new IsExpression(location, type);
}
/**
* Parse identifier expression
*/
AstExpression parseIdentifierExpression(ref TokenRange trange, Identifier i) {
if (trange.front.type != TokenType.OpenParen) {
return new IdentifierExpression(i);
}
auto args = trange.parseArguments!(TokenType.OpenParen)();
auto location = i.location;
location.spanTo(trange.front.location);
return new IdentifierCallExpression(location, i, args);
}
/**
* Parse function arguments
*/
AstExpression[] parseArguments(TokenType openTokenType)(ref TokenRange trange) {
alias closeTokenType = MatchingDelimiter!openTokenType;
trange.match(openTokenType);
if (trange.front.type == closeTokenType) {
trange.match(closeTokenType);
return [];
}
AstExpression[] args;
while(true) {
args ~= trange.parseAssignExpression();
if (trange.front.type != TokenType.Comma) {
break;
}
trange.popFront();
if (trange.front.type == closeTokenType) {
break;
}
}
trange.match(closeTokenType);
return args;
}
AstExpression[] parseArguments(ref TokenRange trange) {
AstExpression[] args = [trange.parseAssignExpression()];
while(trange.front.type == TokenType.Comma) {
trange.popFront();
args ~= trange.parseAssignExpression();
}
return args;
}
/**
* Parse integer literals
*/
private IntegerLiteral parseIntegerLiteral(ref TokenRange trange) {
Location location = trange.front.location;
// Consider computing the value in the lexer and make it a fack string.
// This would avoid the duplication with code here and probably
// would be faster as well.
auto strVal = trange.front.name.toString(trange.context);
assert(strVal.length > 0);
trange.match(TokenType.IntegerLiteral);
bool isUnsigned, isLong;
if (strVal.length > 1) {
switch (strVal[$ - 1]) {
case 'u', 'U' :
isUnsigned = true;
auto penultimo = strVal[$ - 2];
if (penultimo == 'l' || penultimo == 'L') {
isLong = true;
strVal = strVal[0 .. $ - 2];
} else {
strVal = strVal[0 .. $ - 1];
}
break;
case 'l', 'L' :
isLong = true;
auto penultimo = strVal[$ - 2];
if (penultimo == 'u' || penultimo == 'U') {
isUnsigned = true;
strVal = strVal[0 .. $ - 2];
} else {
strVal = strVal[0 .. $ - 1];
}
break;
default :
break;
}
}
ulong value;
assert(strVal.length > 0);
if (strVal[0] != '0' || strVal.length < 3) {
goto ParseDec;
}
switch(strVal[1]) {
case 'x', 'X':
value = strToHexInt(strVal[2 .. $]);
goto CreateLiteral;
case 'b', 'B' :
value = strToBinInt(strVal[2 .. $]);
goto CreateLiteral;
default :
// Break to parse as decimal.
break;
}
ParseDec: value = strToDecInt(strVal);
CreateLiteral :
import d.common.builtintype;
auto type = isUnsigned
? ((isLong || value > uint.max) ? BuiltinType.Ulong : BuiltinType.Uint)
: ((isLong || value > int.max) ? BuiltinType.Long : BuiltinType.Int);
return new IntegerLiteral(location, value, type);
}
ulong strToDecInt(string s) in {
assert(s.length > 0, "s must not be empty");
} body {
ulong ret = 0;
for (uint i = 0; i < s.length; i++) {
if (s[i] == '_') continue;
ret *= 10;
auto d = s[i] - '0';
assert(d < 10, "Only digits are expected here");
ret += d;
}
return ret;
}
unittest {
assert(strToDecInt("0") == 0);
assert(strToDecInt("42") == 42);
assert(strToDecInt("1234567890") == 1234567890);
assert(strToDecInt("18446744073709551615") == 18446744073709551615UL);
assert(strToDecInt("34_56") == 3456);
}
ulong strToBinInt(string s) in {
assert(s.length > 0, "s must not be empty");
} body {
ulong ret = 0;
for (uint i = 0; i < s.length; i++) {
if (s[i] == '_') continue;
ret <<= 1;
auto d = s[i] - '0';
assert(d < 2, "Only 0 and 1 are expected here");
ret |= d;
}
return ret;
}
unittest {
assert(strToBinInt("0") == 0);
assert(strToBinInt("1010") == 10);
assert(strToBinInt("0101010") == 42);
assert(strToBinInt(
"1111111111111111111111111111111111111111111111111111111111111111",
) == 18446744073709551615UL);
assert(strToBinInt("11_101_00") == 116);
}
ulong strToHexInt(string s) in {
assert(s.length > 0, "s must not be empty");
} body {
ulong ret = 0;
for (uint i = 0; i < s.length; i++) {
// TODO: Filter these out at lexing.
if (s[i] == '_') continue;
// XXX: This would allow to reduce data dependacy here by using
// the string length and shifting the whole amount at once.
ret *= 16;
auto d = s[i] - '0';
if (d < 10) {
ret += d;
continue;
}
auto h = (s[i] | 0x20) - 'a' + 10;
assert(h - 10 < 6, "Only hex digits are expected here");
ret += h;
}
return ret;
}
unittest {
assert(strToHexInt("0") == 0);
assert(strToHexInt("A") == 10);
assert(strToHexInt("a") == 10);
assert(strToHexInt("F") == 15);
assert(strToHexInt("f") == 15);
assert(strToHexInt("42") == 66);
assert(strToHexInt("AbCdEf0") == 180150000);
assert(strToHexInt("12345aBcDeF") == 1251004370415);
assert(strToHexInt("FFFFFFFFFFFFFFFF") == 18446744073709551615UL);
assert(strToHexInt("a_B_c") == 2748);
}
|
D
|
instance DMT_12140_TEGON_EXIT(C_Info)
{
npc = dmt_12140_tegon;
nr = 999;
condition = dmt_12140_tegon_exit_condition;
information = dmt_12140_tegon_exit_info;
important = FALSE;
permanent = TRUE;
description = Dialog_Ende;
};
func int dmt_12140_tegon_exit_condition()
{
return TRUE;
};
func void dmt_12140_tegon_exit_info()
{
AI_StopProcessInfos(self);
};
instance DMT_12140_TEGON_HELLO(C_Info)
{
npc = dmt_12140_tegon;
condition = dmt_12140_tegon_hello_condition;
information = dmt_12140_tegon_hello_info;
important = TRUE;
permanent = TRUE;
};
func int dmt_12140_tegon_hello_condition()
{
if(Npc_IsInState(self,ZS_Talk) && (CHOOSENATUREISDONE == TRUE))
{
return TRUE;
};
};
func void dmt_12140_tegon_hello_info()
{
if(TELLWHATDONE == FALSE)
{
TELLWHATDONE = TRUE;
if(CHOOSEDARK == TRUE)
{
AI_Output(self,other,"DMT_12140_Tegon_Hello_01"); //Jdi za Strážcem Dagothem!
AI_Output(self,other,"DMT_12140_Tegon_Hello_02"); //Nyní bude tvým instruktorem.
AI_Output(self,other,"DMT_12140_Tegon_Hello_03"); //Já ti více nepomohu.
AI_Output(self,other,"DMT_12140_Tegon_Hello_04"); //Jdi!
AI_StopProcessInfos(self);
}
else if(CHOOSESTONE == TRUE)
{
AI_Output(self,other,"DMT_12140_Tegon_Hello_05"); //Jdi za Strážcem Stonnosem!
AI_Output(self,other,"DMT_12140_Tegon_Hello_02"); //Nyní bude tvým instruktorem.
AI_Output(self,other,"DMT_12140_Tegon_Hello_03"); //Já ti více nepomohu.
AI_Output(self,other,"DMT_12140_Tegon_Hello_04"); //Jdi!
AI_StopProcessInfos(self);
}
else if(CHOOSEWATER == TRUE)
{
AI_Output(self,other,"DMT_12140_Tegon_Hello_09"); //Jdi za Strážcem Wakonem!
AI_Output(self,other,"DMT_12140_Tegon_Hello_02"); //Nyní bude tvým instruktorem.
AI_Output(self,other,"DMT_12140_Tegon_Hello_03"); //Já ti více nepomohu.
AI_Output(self,other,"DMT_12140_Tegon_Hello_04"); //Jdi!
AI_StopProcessInfos(self);
}
else if(CHOOSEFIRE == TRUE)
{
AI_Output(self,other,"DMT_12140_Tegon_Hello_13"); //Jdi za Strážcem Keliosem!
AI_Output(self,other,"DMT_12140_Tegon_Hello_02"); //Nyní bude tvým instruktorem.
AI_Output(self,other,"DMT_12140_Tegon_Hello_03"); //Já ti více nepomohu.
AI_Output(self,other,"DMT_12140_Tegon_Hello_04"); //Jdi!
AI_StopProcessInfos(self);
};
}
else
{
AI_Output(self,other,"DMT_12140_Tegon_Hello_17"); //Víš co máš dělat.
AI_Output(self,other,"DMT_12140_Tegon_Hello_18"); //Jdi!
AI_StopProcessInfos(self);
};
};
|
D
|
/Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/IBDesignables/Intermediates/Pods.build/Debug-iphonesimulator/FontAwesome.swift.build/Objects-normal/x86_64/Enum.o : /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/Enum.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/Target\ Support\ Files/FontAwesome.swift/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/IBDesignables/Intermediates/Pods.build/Debug-iphonesimulator/FontAwesome.swift.build/unextended-module.modulemap /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/SwiftOnoneSupport.swiftmodule
/Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/IBDesignables/Intermediates/Pods.build/Debug-iphonesimulator/FontAwesome.swift.build/Objects-normal/x86_64/Enum~partial.swiftmodule : /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/Enum.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/Target\ Support\ Files/FontAwesome.swift/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/IBDesignables/Intermediates/Pods.build/Debug-iphonesimulator/FontAwesome.swift.build/unextended-module.modulemap /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/SwiftOnoneSupport.swiftmodule
/Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/IBDesignables/Intermediates/Pods.build/Debug-iphonesimulator/FontAwesome.swift.build/Objects-normal/x86_64/Enum~partial.swiftdoc : /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/Enum.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/FontAwesome.swift /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/FontAwesome.swift/FontAwesome/FontAwesomeView.swift /Users/yuga/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Pods/Target\ Support\ Files/FontAwesome.swift/FontAwesome.swift-umbrella.h /Users/yuga/Documents/ios20161219/CafeDiary/cafeDiary04/Build/Intermediates/IBDesignables/Intermediates/Pods.build/Debug-iphonesimulator/FontAwesome.swift.build/unextended-module.modulemap /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/SwiftOnoneSupport.swiftmodule
|
D
|
//***************************
// Swampdragon Prototype
//***************************
PROTOTYPE Mst_Default_Dragon_Swamp(C_Npc)
{
//----- Monster ----
name = "Sumpfdrache";
guild = GIL_DRAGON;
aivar[AIV_MM_REAL_ID] = ID_DRAGON_SWAMP;
level = 300;
bodyStateInterruptableOverride = TRUE;
//----- Attribute ----
attribute [ATR_STRENGTH] = 250;
attribute [ATR_DEXTERITY] = 200;
attribute [ATR_HITPOINTS_MAX] = 1500;
attribute [ATR_HITPOINTS] = 1500;
attribute [ATR_MANA_MAX] = 1000;
attribute [ATR_MANA] = 1000;
//------ Protections ----
protection [PROT_BLUNT] = 220;
protection [PROT_EDGE] = 250;
protection [PROT_POINT] = 200;
protection [PROT_FIRE] = IMMUNE;
protection [PROT_FLY] = 170;
protection [PROT_MAGIC] = 250;
//----- Damage Types ----
damagetype = DAM_FIRE|DAM_FLY;
// damage [DAM_INDEX_BLUNT] = 0;
// damage [DAM_INDEX_EDGE] = 0;
// damage [DAM_INDEX_POINT] = 0;
damage [DAM_INDEX_FIRE] = 129;
damage [DAM_INDEX_FLY] = 1; //Opfer fliegt für Fire+Fly
// damage [DAM_INDEX_MAGIC] = 0;
//----- Kampf-Taktik ----
//----- Senses & Ranges ----
senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL;
senses_range = PERC_DIST_DRAGON_ACTIVE_MAX;
aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM;
aivar[AIV_MM_FollowInWater] = FALSE;
aivar[AIV_MaxDistToWp] = 1000;
aivar[AIV_OriginalFightTactic] = FAI_DRAGON;
//----- Daily Routine ----
start_aistate = ZS_MM_Rtn_DragonRest;
aivar[AIV_MM_RestStart] = OnlyRoutine;
};
//*************
// Visuals
//*************
func void B_SetVisuals_Dragon_Swamp()
{
Mdl_SetVisual (self, "Dragon.mds");
// Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR
Mdl_SetVisualBody (self, "Dragon_Swamp_Body", DEFAULT, DEFAULT, "", DEFAULT, DEFAULT, -1);
};
//*****************
// Swampdragon
//*****************
INSTANCE Dragon_Swamp (Mst_Default_Dragon_Swamp)
{
name = "Pandrodor";
flags = NPC_FLAG_IMMORTAL;
fight_tactic = FAI_DRAGON;
B_SetVisuals_Dragon_Swamp();
Npc_SetToFistMode(self);
bodyStateInterruptableOverride = TRUE;
};
|
D
|
module dcrypt.pqc.sphincs.sphincs256;
import dcrypt.bitmanip;
import dcrypt.crypto.engines.chacha;
import dcrypt.crypto.digests.blake: Blake512, hash;
import dcrypt.pqc.sphincs.common;
import dcrypt.pqc.sphincs.sphincs;
public alias Sphincs!(n, m, 12, 5, hash_n_n, hash_2n_n, prg) Sphincs256;
alias ubyte[32] hash256;
enum n = 256; /// Bitlength of the hashes used in HORST and WOTS
enum hash_bytes = n/8; /// Bytelength of the hashes used in HORST and WOTS
enum seed_bytes = 32;
enum m = 512; /// Bitlength of the message hash.
enum msg_hash_bytes = m/8;
private immutable ubyte[32] hash_const = cast(immutable (ubyte[32])) "expand 32-byte to 64-byte state!";
static assert(is_prg!(prg, 32));
/// Generate a pseudo random sequence from a given seed.
///
/// Params:
/// outBuf = Output buffer of desired length.
/// seed = Secret key.
@safe @nogc pure nothrow
package void prg(ubyte[] outBuf, in ubyte[32] seed) {
outBuf[] = 0;
immutable ubyte[12] zero_nonce = 0;
/// Note: The reference implementation uses a slightly different version of chacha.
/// Here Chacha following RFC7539 is used. This differs by the size of counter and nonce and
/// by the counters initial value. When setting the initial counter value to 0 and using
/// all 0 nonce then the output of the two variants is the same for the first 2^32 blocks.
ChaCha12 chacha;
chacha.start(true, seed, zero_nonce, 0);
chacha.processBytes(outBuf, outBuf);
}
/// Test prg().
private unittest {
ubyte[32] seed = 0;
ubyte[96] expanded;
prg(expanded, seed);
assert(expanded == x"
9bf49a6a0755f953811fce125f2683d50429c3bb49e074147e0089a52eae155f
0564f879d27ae3c02ce82834acfa8c793a629f2ca0de6919610be82f411326be
0bd58841203e74fe86fc71338ce0173dc628ebb719bdcbcc151585214cc089b4",
"prg() failed");
}
@safe @nogc pure nothrow
private ubyte[64] chacha_permute(in ref ubyte[64] input) {
import dcrypt.crypto.engines.chacha;
uint[16] ibuf;
fromLittleEndian!uint(input, ibuf);
ChaCha12.permute(ibuf);
ubyte[64] output;
toLittleEndian!uint(ibuf, output);
return output;
}
static assert(is_hash_n_n!(hash_n_n, ubyte[32]));
/// Note: This is called 'Hash F' in the paper.
@safe @nogc pure nothrow
package hash256 hash_n_n(in ref hash256 input) {
ubyte[64] buf;
// expand to 64 state
buf[0..32] = input;
buf[32..64] = hash_const;
buf = chacha_permute(buf);
return buf[0..hash_bytes];
}
// Test hash_n_n.
private unittest {
hash256 input = 0;
hash256 hash = hash_n_n(input);
assert(hash == x"34e1f845772d5306c1628ba05f7027bbae56e59f0d96bb26822f02456d222251");
}
static assert(is_hash_2n_n!(hash_2n_n, ubyte[32]));
/// Note: This is called 'Hash H' in the paper.
@safe @nogc pure nothrow
package hash256 hash_2n_n(in ref hash256 m1, in ref hash256 m2) {
ubyte[2*hash_bytes] buf;
buf[0..hash_bytes] = m1;
buf[hash_bytes..$] = hash_const;
buf = chacha_permute(buf);
buf[0..hash_bytes] ^= m2[0..hash_bytes];
buf = chacha_permute(buf);
return buf[0..hash_bytes];
}
// Test hash_2n_n.
private unittest {
hash256 input0 = 1;
hash256 input1 = 2;
hash256 hash = hash_2n_n(input0, input1);
assert(hash == x"892e3fc62101ad191fd1d725ac4ea2bba00414c05b8b245784bd03cf710270a4");
}
/// Sanity test for crypto_sign.
unittest {
ubyte[Sphincs256.secretkey_bytes] sk;
ubyte[Sphincs256.publickey_bytes] pk = Sphincs256.pubkey(sk);
/// To generate a real keypair one could use: `Sphincs256.keypair(sk, pk)`
const ubyte[] message = cast (const ubyte[]) "signed message";
auto signature = Sphincs256.sign_detached(message, sk);
assert(Sphincs256.verify(message, signature, pk), "Signature verification failed!");
ubyte[message.length] evil_msg = message;
evil_msg[$-1] ^= 1;
assert(!Sphincs256.verify(evil_msg, signature, pk), "Signature verification failed!");
}
/// Test sign_detached against a signature generated by the reference implementation.
unittest {
ubyte[Sphincs256.secretkey_bytes] sk;
ubyte[] masks = sk[seed_bytes..$-Sphincs256.sk_rand_seed_bytes];
for(int i = 0; i < Sphincs256.n_masks*hash_bytes; ++i) { masks[i] = cast(ubyte) (1+i/(2*hash_bytes)); }
assert(sk[seed_bytes..$-Sphincs256.sk_rand_seed_bytes] == masks);
immutable ubyte[8] msg = 0;
auto sig = Sphincs256.sign_detached(msg, sk);
string expected_sig = x"
73c1e0a8afea59487f9ac628b26428f10186753fa326a90538500488e18e2eb2
9051d35c11c95e0cdfe67673177c6a49c8ff9e941ebefcca91975eb73dfe86f0
2ff5d75959aed314ddc33cf74025e41575490669bf1c146cbbd0b5248c9585fd
e932c5f0313df601072f47aa57e4853be5319fe36d6a737b708484d82881435f
50ab8ca19884917bc2afae587e36a45dfc8410f14f45be349b353a8ff0865b35
964a47c2ea193722b4cc45f62a4825ecac038f946da79268cab5fad559d7f36a
201a024e264d8efbde380dea3922d0582f734c43ef8ed5bdbf16f7bd490394f0
78e5374511d2f2b78daba89714eefb8957055c2d6b00c428647e4cf824239662
97edf6fe7cc4b91af7fa854d06d614c53c06ab1db74d7d16bd995334c02e49dc
ea24244ca750807aa73055b93dd0225047acfa48b97c3b9ba1f0db2177bd076b
5776b49a69bd5f07202c32a8ba49459fa58f793b40b036c8f6fbd534a1526a7a
3bc6449b5b1e2dfc2761b9662a44ab5decf5bb5dbd0a658681fbeefb143e8a7f
075dfc2bcfe2f1bba658589c83da03be7e03cb2651ba0037830ef3a1b715c564
282aa1fca3fea8aa822232c0d3573d311160914ce68104cdebe097d2113353f4
ec79f182b4d3e6287d525e3f20e8423ca769511ab1535967d4a55b3f621ee8e6
5de878f205fe4095039444e4e079a71d6982f6dbf85706f99231dc6569aede8b
6b1aaa909dad1fc35f05164f514e90adba52f7f044ec89d48a7340fd0c5d6363
37e4928e82990f8e675b83729f92d86a167705449036c6414c16440cb7fbb2ed
7ebf2b8a0798f47ced1d477bd1ebaee3361cdcaaa1e51e502cf0bf2fbe4ae409
acc7b2e1a5a2fe0b02b7bf39aa8212841e77452a1accdc5fbae3ea500777046c
6d5d35a477095bdc16e52f86251e4efa72082573b88283d149b0efaef4a91af5
253160266c25d55ee8d48b4e45f9f3c0fcffdb0f5c2b39cc80220b86fa321050
4644137fd0a19a0fac23708fbca02ff0642ab40ffd56e2ffb9050c02087289cb
76a8a36233ff843a860b11f3dd11126564b07874cb59b64960adefab4f80c3a0
3ac77ec30f7a8e0915fe8a517318bbdefb1130db1d5e07f6b4afb57350bc2e97
d8e8d784eb7922e21b66c698bb3930273a3fbe1709c8df2e093831ac3c1671c1
abb8cbf00bdbf63f5202a3439f3af0ee1d519834c7cc5f4de7e6be2fff64f185
feec11f62479f3fa0daa93cac27869a205f1a7105b94b1a23ae3247723786216
b51150bb5038648ac847ceba75a3269021aa5917cc4ce28ab9376a8e60380fef
1ab173e3fa9e694343a5aff6e6754705a699a6520dfcc5dfe85fbb63a200bdf9
23e4c824f445c1f1e4cf8265084ef86848fde71ccba2e641d1ed6868aa57899b
493d56179bfed4638f78ec0a7d3236620754eb5e877ed3a407c8ca389600afe5
1ee50dc01316329d7ef7d0a772ca9188bbce2a94f89c489ec9405b7cf6213733
6c436f732a1565b4380f5b708f6e549f3708535c6e1710b64f43a2a6359d7812
de21f5ca1605696888c205a053c92c70c0a45b02aed6454545a52a0559a3eea8
27eb2f7fb31482fba7d5d9027469ed0c3888ed2b1a18ff937b1bf0a83808ea5d
65ea77ec01e248a6ae6985a0c0e4e0fd101143915433b2666479454ffbbe928e
c780abb582b53de49aa87f49eedb5161d48be48a099cf74bf9d5d17a42c42ea4
3279f55457531c7aa17574b2f1d6ac39aa29c0732364de896f818362ce5b2497
440bc1ecf5c52f430cd3a2e45180dcf71953045193701deefb3906fdfc32f5fb
fbc1b8b79d66ded7d38d4d675542452da6c681b5871493af61b2c18aa7a59236
be30cc3a496abc23b06aec01079727b6fb3323bb28d5b20fbb1e6a1af5ebb31b
d3eb84b7ba19bcb394f239b3254d3c62998661671a7e86702d0739f295b7f371
e5c8ba0c6af80fa1ed49494b1877325091a478eabbfd0f9ab0ad9289f93fcd8d
8ff31c2560411d94156ae104638e7b9e122f3914e6278dc196ff4d7246da3efc
72af722d8dccb409514f7383c6eda8d30ae2cf75f592e7f3e3ab405258658c85
3f1d8e24f456b9abda90d5d442a050b91ada84581c357126b2435a39167aa3c1
ecf1bd03f1808eb545f2e8e34c0da329c7f853d2e59b6c42ce098fb9ce2d6bbc
65c052a24bcdbc479f22ab91f80c54f9d4592c379259ae25d8f13295b89fc8dc
58d482ece11c4670a609e33cadc74946a7db8bf88b1a193fac9b6321ba1bf087
4775fb176fe0e5e4aebab20d0a224202f58392dec05779f445fefe65e53f336d
a3d1af533d4524246b1bf0f52873129003e92e87f46878236518286294c15caf
042ca56b71df67bd5c68e6f51c8b4806f9f5d7d94a8938e80c7d3b3b71c4a05b
f02b6221397668f62f555a5d889b5c1f72c691b5d9e6824bdff1c0c8c224154d
4509f64771cdf5613cb4b132f57c431c4ed3277e59c9bfb79909fab23266813e
365a31eb22c9723310cbd665b73714436d358a6bfe7a4ec2bee76ec5dcd487b4
7792fa7adddd1dc9903ae75e96fab2bb815a9e6b9826e314636ac4cdfbc341ff
04da239c297eae0a28a96fb45d4f455f1e93e2c6a2474684c1ed0352ac6b2107
6dbc50f3ddf7534ef403c307f854a6b6b3ccd58d4b77bf34253aeeb1fc05c978
0ce69b52822e15b6038760ccdaa379d44227ec6b9b98ac4432ef6063533dd67b
ab0e0af9d619b83145b458cfbb33864c4a95ed62ea25fcfd735f918905c356a3
6c21b636698e31ad66f1c24d3bff3fe2c0be41bd3ec839148e396c399f4c8b3a
3fad981c251de39954b932a3f6809883875b7196664c12e1f71544f1983a624e
1150f2a04602bd8529332df3f33f363bc95fa2d66470b2f4f9a270ee394dad56
f84c601ccbf00e7952358d00b5d3b864e98e18259d860cc8cad4321bcb3c6833
5aca44a2ccbc9b765f07af7c1de5a427114dcae47a2e35ba5963db721dfa892b
50bd616c84ded191065ba96d4f610b414ceef9a2ddd5e1bac837f3d6d640968d
0fb2fd46e35688897ebecf8e1ca763afdbb0374122be00d0fba3e7f6eb1fa274
e5ef789c696bb12aa0e53baaf321ce5191790d080e81b8fa4073768845fd5e65
3eb5755b1ea1b7c41d32c0f76cf806848989145254f9553554e1d54d84aa145d
ddce32ad2b764b1dad87ec995bf4acf2136c3e014c2d5a75204977b79150b926
6ad5b4bffd43c7dcf29fee35ea5abf21a7a010578cc245b1ca4a1b8c7584b859
c8695ef0f7320b46a79d270c21c2869f76bbeb6006dd2b38331ceb8091509533
a93091845288926c2260eb8de70b091ae664d7d054fcb649c6e3f8aea35c2337
38858bb0fc472e74e69d2656c720eb91eb33a62e414b204d55c04c62ce569f91
2fd9ac3ceafac66bb6d89635224d83ff477069b398c15d095965842e9d63bc72
5d227de20121b150cb8afe4a9828e94bd20805a6a74fe979ea8ff11eb0b5ceb2
05587fa150a6933545ebf078fabd50566e66603250812c66c8bb37fb576a712e
29811cc1477b9e2f72bbb8fe1402f3b2664a3c44e251b8a48abc1fdeefa606f9
9f4eed4302cb30ad9d99ef23f26f44872b50f9d916d32355ce994fcffc451e43
a24c528a9068122123d81548e144fde00d9424bfdfda9bcbc22652bf0d8c4af3
71db88e2386bdda60b6680ae45d1aa98ad44b6c2b43e1338db918f93807b991c
0efc59412c2deebf02b54b8794e70dc4087e9f77a78bebf18699047f5027f58a
2171afa1389a9b7dade6ec4b1921d9043da52fee611ad657f9b8f2680e56fa92
05405db2027bc17ab9e7cdacb5b36420d8a5a15af18e1bb57523191b8115a888
29a43dfe7e9db2483b30803f14fa977f3edf3f25a69c0818e7e0c589a968f664
0aaa872455f10c61b7502899272e744e1f8623213290ecd2afe68abd4b935e52
c9200403dbc983abf478808522eaff68203759625ad88cc2f45878a53966aa86
67755a13cc654cc9eb5868f999f3c22fd65173dba83094aed7bc71668a4ccfe5
ca242728225e1072e9e4ae686163b452a396769ae9b20be6d5ee01aab182a334
b8a6744d9ac454015117391136b2a3bc735b824a70c2e9446c0103450103b179
717f89a44e80bc0b6cf0b8bf4dfae7201fdf4b35c909e664afb129a3ce566f86
d9b119b22a09a118072bdffa44c7acb83d2b6182df9e1493bdb96967019f49b2
7fd62ee6fa3e8408ae00ddc4f2f6337bd47336f68bb06d0c852d1e9f15e0b3cf
12ad164503bc19735ebe6d52393d69f39364f91988da80955421dd0a71b3bf1c
1e2f3142af2bc7a285f93c27da037246424652b60e1d23c20addf98d4a787136
861204720ca452f424800f0508d291b7f5d4b0fb5e0ede27459737b03a433253
b861f8760143b66dec96bfc69976ce2a044162e609680c00d626db5e066d0395
9367f0cc25e5d31078c47cf00818ae74b7e3bdc6d1feaf6df94879531df6a7f5
7bfa2c965f11a3359d2254f4d07e91b4975cd5259f6b71938d7688b91f5255b4
31d3af04fb59bf21c6104a12cd1e94d3a05d16651089c5da8249efb23036d146
366c6bda5620350aced280a5d480830fa959991f1b1b8aca552279976a3a0d03
6218f3b7964a826bb670397263adb8999f2ebe751f4290ca3be020399a4d80a0
1dc9668244f13a5d875ea5c4f7732b654dd0d9f56aebd8800baffedea2329df7
9fc1a3432171ec997c68e9329a8af919a18efb85367547fff6d9569fc57b732e
0c5faab165244f85e9ac6f17651e8c557497e9940afca6f723f9378b9d0c39dc
efd416179fce483defe3dba790cd0f2d11dd7686bc0aba8dc76c930f1604dc72
921cdfce8c65ef6e8b1a1bae20b9ef3198fdd0e6417cdb023af49a1ab08f71a3
074bf6c1618a22bf01b8bd5f34844724002fb5695c791f74815a0b0cc4bd00e7
f38fd915395ce50c8cea0926c61ad953b8da9c680193922e5c240e6167089bd0
146631bab05bb57f2ac8eac580f29123d18b657a5e193c6e5227d2a0948ea0ee
40db5dc1ebe6e7e0fd6f2b8cb376eb3980a41b2ab4c05481173c347c5e5e208a
24553ba1764fff51170c3166347dbc60378b53b4a8036509efdc01f703537e0f
16a950cf86e312ea9dff54dd080ea96e7796523aa0852db0bf8262f3fdfe94e9
2b29b1a2e2adae967342940c595b2dde9210e7ba0d1b7b7ab0dc4688e781b3c1
ffccbff08c0b400d6c72217b279faa04914ade1f5ef586e3f3d18b34f9472f87
cacfa8ba8a54ccd2a7c7629a7cbef27aba51ca0818fd2bd804120f4f5a273ff7
c4e9561ac55dabd7d33734b3609c29d70a39e6c666f2a1ffa6f17eb14ba3c837
e7cb07e7c4e5bec964bc70493a89cbbd96d03ba08a2e12ecfdd562e64bc4afed
552ff3112cf1c7eac44e16c7c7cf18c9e411247b6240f8d46b54f20870c22256
dd419e33aba9314f79643dd3a0f2d6f09069dc78910c40356c8901e75c8638fa
140b309c0a71786a35204a0cf9518bf563c63b30a2dd97e0011f3bb67fd26743
1980665574c218876fa7dba3624f04ba76968af2d39ae257855b46fcb4a1f66c
2aa80c47835763628b650b6e3393f7033c172a0162b6472c287cd4688b604ab8
8a63d06e588dc0cc08c2a41d7a4635aeecb52fdedf0a166d80fefdcd99b2ef1f
cc505de2a6ce1f2bd51607ee699825a2ba1c476501bf95379aaba124d98476bf
e856eeebc60f2f5080b33e2559e4ab43e14219af206b018246ed40418f7c3755
a0e4aca7e850a79cade81533befc027dab46b9548cac250b9d3034a9a22f2dc0
26400309e5a87a0ac04b72827a56129d93251f6ef6687c46af06ecb9f519a6f6
a60a7db4337e85e4a39b828fc76090e06805713598feb837300a74db5a3e184e
0ce0168f67a12d2aaa85ff11d033de09bc8688e4c68d7bdc4750b00f7f53e673
ce0113f3da0ed98b7da09b33d14a7c6a10b16e4fcf3a8b396e79cf2c6a4a5c37
bd64d152ce1af372c3392bd482fa95f2828cc065e11c227c0f7726ea74e9b81f
e168519ea86e488133ef631dc9ee13e16a8341b3389b77c9ac96a077eb025c39
7b8553ae67e5a601f8ec0768cfe6ca2b9631215db704b5c0cc5d54e76f9d8374
212e8abae7f6882f96e695fad1fa3b09079db5757b0cfe7f373e0432f82f9918
c942b7e38c14e0f4cd1dfddb010b21962e9bf60a724b0bc305cffa7c1e5aa0df
1328cd7df4f8237ebf18003e70400851b672646131c18ffadd5b5094e849f7ef
603351b94560af86e4f14f29d25a90253ed8d97222afe09720ab29c110fb08a0
26b82e1f4e68988b0ca3fdca85595405cfb25b24acc56c8a4ac9b4b51c6a24cb
ea9b4786ff062bd106d9bc4b6402042672cf9b21fa3085bc387388232c3722ec
35bd3053d9e7dea6b345cb8b50144380e7dcfcd4079fd78029c0d61faa0e97c6
2d9caf19dc296371f31812afe2ab7828267b1c46054f35e61270014237c02803
17773110b73c15bb304742c2525fe7b587eb744e47718d59a8c887fbc2ebedb2
d4a6a182a618bc130be68a837739bc62dff50fe8b25d61d0d737bae7ac3990a4
6a245ce5165ced7747fba5559bd38d80a2c6cebfb0d2a64f22ab7ffa72c17e71
ed71576e00d4ae7f5cdfc77e4268c3a371739113c9be29d87ed47f193be51fea
9b7a251dbbf5197c5642505660b2513be2a026aff3a6b2b84dc4c18e185b8d08
8bd925822d04dcb5478a60a17976b65461e5c761ad477218f0ddba3d7f671779
601243a38aa47d7626e04c7c0f878f525799bfa6f763f7e0464c9aedfff33548
0eebb32e9866b605dbf17144baca7c668386ead7075b35a86595d12e07483be3
47df69507e20469faeb7fdf67be09ec0263597fdfa639d83bc972c29b9dc8086
937171064cb0bc7da77690673453d91c1d1500ad188960e237db96644948870d
a5212bef41001625b02526d172ca51b2e8a80b525c05efeaf0bb702b470a6405
ce5b1556f39c8f92ef34b132db16f28430c115c17b4ab441bbd957083eec1d3a
ecbd3f59392948f3e966f1ef169aabb8347498837108acbdaf0cc23af7ed6955
cbd9acf0eafbea2b88507518937ed4ea09a737f50083789ab2af98c3e5b795c1
920886123cd282b64f994986ef32cd4384bd647c47447a24a327e2eafbf848a8
8700aa6d6c624c49787c5f77966a6959e433eef018fe431e811301a9cd0de10c
dfbaf8007cb3944470c47832b2bbf432b7b0e98e4271d938b20bc61b2af5e9b5
aadf3d0adae35d879e9efc96f06725ece45d4db38233c7d12c073eb6d72bd686
24f237813d0080bb343eede66550f0fc30a819794931e2d5ec200895a2147b48
99d116531d4ab6d8dcf5dda42308a69b2c4675d3557bf7438e5d0692b9672fa7
a884b2b9d5a6bee7e2222d4fb0664d1ef153dbcf9e20d0183a3dc4b52f8dd62e
a0d9bf124f3eb760ec6641aa8633bf3ee484176bc5313690f591efa4cc737589
396e42fb13d0a5ca2e5dcfe85e9f569719bad9c9fd3524a0821be3dda1341c24
8aaab7e6b61b973addc1c0beebb798c07327874e72244009b285f2d23d6e20e8
08ccc8601de3657dcbe5d2f70596bf59bdb800881469ad367ac317ec97a8c8b2
488ab7ca6583a31d08bc849f0d7a1be7259f960586ee8bc04efa74886edb29a8
521fe4c15ad33ef2915b41f79da11445157da7d6fc0104c9cbc12244ac6ef310
d8153753aeaf2d25fa2b1dd71784f746de3fccb3342f50ff4e7215178285eda1
9dae8a98ac48d8bf2fc8e2de5453466e900d3f9a9d5d382997462b819436e566
ec5a120913a639960a88901cd21fd1068a2815778c9d801aaef4b6e22727ae07
d0e5449f15db1f3c7ac0661478c23018ea7244621a725c7340d603a01ba257af
69cfc9e1310e417130d70cedda35e85f753ab2df08daad8ac6e7d9567fef8748
4492a5adcf58918d0948b9198c6eaa39344770a3e87d3b8d4d7087aea19b84f1
f6b6b14d27f599ccd9033021eee60b75c1342f39af99f9ebb909801d6fc57840
3ee3b2cb177f24c14f5be35be976cca4edfb45aa97626314c5f49846b1b3c091
5629ecbcd9d5441e30e7d013a03215d7401a83c9f6da77a54c04adebd94bb9a4
355de48cfc215051c247f94ecb4f7116c70a3c078605a050acc869f2f705769f
6c6047b907f56de8aaa744a4f328cc7d5a39eb2344c17d7cd29fd5392a81c280
d51a066e36ffb95d4b2b8ff4dd702794e676bf115317b6100ca4a70ef07ea0f8
f3517c24cbaa170d6fca42197b2c192762f8ed00db8f56a072858d44e6ee4eab
1d0ea98475838dbd86d5325f84c56a6d29f8f5290f8652fa6f31daf7b237e54f
c8be22113c19831fe7d6e98f6a77879452d8b294449c13ce471fe4fa19e1d620
5f4a9643c2b8d4e48b34a1bc499af46b25db9fe9c878e933eaca9546a3584da1
a9c2e7ffc67f965149d44822689e85e475e52a8ba8bb1fdbae157ec7447a54d9
db76ba7f84f517e0aa06227892733188d219771317924fc0ea5ebb710c5b7d32
27da879bfcf8ecc3aa96ea9de117a5ece2216aeee4ba6b38cad175243a1a9264
b5d4122ab3f7f87059481ae98b00bec2132b86705afdffa87581777efe56f505
3f4a8aa925a28244b670397263adb8999f2ebe751f4290ca3be020399a4d80a0
1dc9668244f13a5d875ea5c4f7732b654dd0d9f56aebd8800baffedea2329df7
9fc1a3432171ec997c68e9329a8af919a18efb85367547fff6d9569fc57b732e
0c5faab165244f85e9ac6f17651e8c557497e9940afca6f723f9378b9d0c39dc
efd416179fce483defe3dba790cd0f2d11dd7686bc0aba8dc76c930f1604dc72
921cdfce8c65ef6e8b1a1bae20b9ef3198fdd0e6417cdb023af49a1ab08f71a3
074bf6c1618a22bf01b8bd5f34844724002fb5695c791f74815a0b0cc4bd00e7
f38fd915395ce50c37df224d115312ecff16ac2381a42393170300e36163c9c9
e888882193a7c900c9560dcfb5ccdee20af3fb858a01bb4d6093b805b48a2ed0
c2dc3bda4410d8f9b267992687669d8101eb1f4c07144b42e3c9838add8151e5
a338dcd59756d4aed810adac53886516bb4a2a5f14891fe15c8d59df14b77f31
15668d80e5594a3dd10faa48f0d8ec7627f2cb80710b2c20653d7cb77aa05d74
ab20048b126c2e41e5ad75eb66eb44cad19a0089e4cfc55ad4123f18de58f853
4e725ccdc64c74447f1af45b5c5502a3f75982a8ff582653225f851a6dbcbe0b
a000aecabe1e84dbea5e234abffeb6ae6f4bdd7aa522127a3c319629a5d9cc81
2b3a46630b7dd9841a89e727b8fdf524e2e288f98b6a8bdece9557af565555d4
7122f480149d7a7ce09500424d0797d2da4e93f6a4b4a6ec7b54a42de28525c9
aea6b63b55499ee405c76a31c79e1b30acc84ae6ea226d539e1da89085ef3103
c6e8a103ed5fca4249d9af4d864f6214d0f55ae34e23b9440c61f6c1e3a48dd3
6396348dd4c0c0678b4f57fc0afa637c8de7f8852dc6a9e90187698e36bb4455
501a7a1eda5204c3f99a9716374fa28edc7375e59e378b7f4c9fcf2a35f5649d
d4cc0ebc9860478aecac15d30fa756da7625f3bd9a17b0273fb5bc57f56257d9
b83dd4e5cc816e39256df85b87579dd96fa1bd2616d182403d18313559377033
b3cc28e50e96daf21b71dbfb881aac076ea08bafd4c8500ed0635d5cd2a06cc6
cd76ca552d8df72e5d211dc0beb1ed5704b0f77a6411f9a49a17d47bdda8ef3f
ad77ffc8a56c52dbac203a5567a8ef5917466bf25c1f10f8cbae023369dd26b5
5848cd9854c2ce7fa9e2fa7c85c107368eb46e1507169442820a7d633b692d89
9150fb924b4423dc8541abd160651b9fc64b100cf6ee33675db52ff47e0de26f
b93dd1c7d955eaeae09a4fc8aa4db7f383d6db61794e30bde77f8b76a3344595
821f087947c3f47df2816f56d2132f632be6b1d29dcd61ed1cc0c2b7e914f4e4
168a3926e2a55a1bbd31b91bd9b4af7ad9c2ac98f6ddb6fdcc6429353c5a98cb
bb96e95528596b2332f8820c16dd2c68dc174a50ad7359829cb93110741b9082
bcacb321a5b6b9a471360363d5d30c748ae78dadf038c0b69957c66854cce0db
06a6e297ca190298488801462eff717330faa805053961c8efaaf67d7918167f
8e15645dc917afe104b0e3dff6456ab88c1abb9b29d1b03b072a75312a8b4d7d
1cb8a754c42c1a90eb5ff50a0ce77467678d0d44a67ce3fa34af2c5b18b5fa38
e74f79207167ef621725f94d3e6b448282af4b6c938601649354275c8aa99028
f8ae28fad7c753de9d946ed1621eaac87205e48371a400d2e9d5cf115df454b8
5c3284810a96d0a94c04089982bd24c3f571c10c4115618fc3b5269c52e701ce
3236ac60959fc15839ed2586b819e12fab16e9c66492acf6f400b4a83f4d4fe8
c295f98e8be7f0ff09941e8af43313d755b33e9532ea23fe71f816e0ed247aa0
d9933f3886fbaf41011850c5c1ef1e31b4b0232852401c3727da024a42d4617f
c3338207ba08c2386430a80df87d24518c34f3918cb91880fd86fcdc387b2678
b015a8305ab42e519e7d9005a99f4b308a4d7022a49f895451ab272a42699836
e79d8e25034cf23f668f2e160cb83862cf5c04054ee05490c1782b393cce526f
d1a9a644e42ce7626bb3bc9c8a6b3abe7c131ba4b642bcc821580792cfdc223a
0506f2f3ef9e8403020bb6a082830f6c95e8b0f46d144b75daf08ba7554b43ea
edc64ee83db8b8db6716c76864a522f2aa9574b0c56708c48bf011b1d7e459e4
ba1c176898922b44018c4e797c6ebcaeb762ee0cb467a5bfcaabf034b16ce81b
44f480f51dd190736560ddb8e5f033a8bc0e5c5ce4b4c8d8db3eb03e0d95f45e
66fd8cfcf2c0cd214428f085422fdfe696dfdcbf3cde2e8c6a623127d0c54570
fc4a8ea9b5b34257ab657fa9355099c6360b66aa0231cf7a601558757a468d10
9ab162a47423c53e45b1db877786c79be6790fdd32db61661b5715a3b203ba1d
e888d7925b0bbfd5af0d3a9f9f897b8dcd4e8b86ee9d6f66f07e68b5c3f7e68a
db6092b15e7be81f96ff0565bd553d06655630ed7b32a43fcc5c36bbd907e803
8edd452e029b12b308e0b6e91e69460a848e180b50f8d780a9c8f42ae356cecd
aaf067a07691b6f07507dab48eaf193f2aa36c93163748e88de4bc9035295b55
8804ccaa3d4aa58664806180bd4c2f3c0f63996647d1538b8eea005fac7b4644
1730f8f6fcb6e4a3353fd1d518c5e4ad47f0fa18c4326a55ff3e13f0f9d86b8a
49aa1f005a4f541e06e750f27b016ec19c3631b6c183b804e3b20d62dee8d79f
4aa1abbab2520c48bef8374b5bfa10bb6608c39e018c060152fd96a0af6cccc8
b925d2a77fadf5f24b31771a3d55456be84d8362b19da116be70c0683dc2c4a4
879b0de7bc9b6cbda746d2220afca3b6a9551bfd5454276382fdabc5dc0f552e
de88122f5fe259e865e8cbc018f72badda5097bbe19b7f2325c450c39af003f4
ca14c9801e49f957f3ca67f85aa83199c5e301f49fba46b331c3ac43ae88d449
44ecbc4ba6eae3ea851bf5d90d6e7d706c4dc71fb17f022cfcbce9cb05f456b2
0fbc21a3b771fe0966eed59ce3647171eae59a9e131d56b562a7179f2a1e1546
2e73c93be9e29f1d24aaf4cf9c640c68d02738d365954d7c3193f95ac36394b6
d71213c1ad73d0a92f54a0d6f8dca05c7e5a53437d2bea6d66063d6b2a237d7a
56482b897a398813101db3aea01e845e6cc44de97ee50754da625a4fd2288649
7f00803985893d19644a31f2b268cd2c0c5df4968f41c86ede117acd13ec3ef2
42f1e2d165cc139b8948431a3cf157f2dc29ab954647baebd9006baf6a6b8574
b00e389fb0079fcc87dfadd16e4db014c8ea209325fb3e7712cd7c0f2dc4786a
c54f6533762739aadd9b42d690617bc03f2992a48f78935aa2c56184556e0154
a8ef63b67eb6bdbc2d7e1e4dd8238b1a5e2b3dfbb2408ce907b75497758fa1e7
74f9a9faf84e0664f39826d08bdfbf7c3bf230ad10423ff685884e3708a84014
9489e48bc9008179f88666fa3b52e56a7e683124218d5a9041b9cc046882d385
7fdc5a60c2d5d9fc8c00069106a5c035583dcbb0a90c22349e1fb2d5535f8513
7aa9489738f1881704cfe6410e3ae2c9441c72bd5b32e1426f8d9a932ee7639a
d917642ff652f631eb65f6588ac828804add48f69a77e8dd84d74339b77a568a
47bbddda6d7ff4c5c446ed2ace59998a75f512b8b6f3f9da6652cae631b2a8d5
c00d258dd957efb1274dedeaecae1966a733812ed09bb54ca77150f29df09964
3d7e190d477e7fabf4abb163022000847a9231d54ea3cae2c583a2162cecffda
c6fb741e0cba71aa279bd564894dc7665b98b6046fe7f815beca5fc91975ee51
7e7c24e3b222f433aa85a0a46c9c977b137bd6b4b279c9dc011dbc923d365d59
b08aa32367b708e7fa4d41f0a730ea78c9e8746bb0040f8a43a23f6507f28635
51e237de7ff7422f032235f224118623d457aabb6ffc78a3401d20260e7efc97
a79614d556a255c0f4d311b1a6787d49e7e3501f258eda001d8df0163ba94521
1ab0e5b9730e329aae2638906fb6ea273839a0ee7b1032dea8356d206d93f27a
277046df3f1a11f99a97ba16046767297bc8975c0c3b1589c5f801d225a592f9
adadde68470fa4c3711ab6ed6c8ec2165a1d050500aa244b2f1f3a5077e3b589
5408e2b3f84917c73f4f5b42b196b482972ddb1fd0e5548451c9bdbf0516dde5
6ef445ed17a586dd6555b878d88a2eec68e1f501e2dfc152c655e90ac20fe926
7e0c5900c3b7e1fc44f91407d419f46b7f988ffabbbf033d1f73186c3152ebbd
99f8aaf98be3b6960563ecd1072777b437e68378928821d4717ef7c9a9b9b935
ab9a908d5e82ea0c9a8b306fa55a813ed3bfaa71deb793018be40c5d01278286
87ee846f2e14593a08c39cebc309efe4e95a4dfabe376594ffc973f11641516a
c431781b09a90af2b9c45a4b524af92340f12657ac3715de35f002d74f87bb6c
b34ba1c48e5ac69e888604f53c1f231d29a45f8117bc27d22f0fb34f6028ecd2
21ba2af787efc5921dc0abf550f65d2993aa7de018ee54a4d6b92a7794963bf4
d7faade794aa269ccbc8c340251d716ef1713b2934bce59455747c22445a7901
e8570c2cbd3b21099ec8b13f366c35f68c5cea855a06a524aa1f217a3850e5cb
f1029a048243d2727d2f749b7996ad212c06ce27f9da7aaca64c613bf7c79355
7ff1cd5ac77156a1aec365f9671abd15ff31d4ea00ca06a35e4a8418a8d77f7b
b61bb064123ed2628541abd160651b9fc64b100cf6ee33675db52ff47e0de26f
b93dd1c7d955eaeae09a4fc8aa4db7f383d6db61794e30bde77f8b76a3344595
821f087947c3f47dbb3916b251ef2a66641a8150ec0262619fc63e27327f82de
904a969609060c8e282593572f2cc56b5ec6cd740f45325892258d75257aa6fe
08fda0a055258e6fbe30cc258cce6007c2d666e2d5214164891c3944c478d192
89e23e7e05ff1505f1788fc46a65352f5ac1f286e69ed0219ac78832b5f826c9
cc9f21f489f5d04796e695fad1fa3b09079db5757b0cfe7f373e0432f82f9918
c942b7e38c14e0f4cd1dfddb010b21962e9bf60a724b0bc305cffa7c1e5aa0df
1328cd7df4f8237ebf18003e70400851b672646131c18ffadd5b5094e849f7ef
603351b94560af86e4f14f29d25a90253ed8d97222afe09720ab29c110fb08a0
26b82e1f4e68988b0ca3fdca85595405cfb25b24acc56c8a4ac9b4b51c6a24cb
ea9b4786ff062bd106d9bc4b6402042672cf9b21fa3085bc387388232c3722ec
35bd3053d9e7dea6b345cb8b50144380e7dcfcd4079fd78029c0d61faa0e97c6
2d9caf19dc296371f61fafba7586c7a8e62fee0368d254eded452e050c1eac7c
a689548984bffff173aa1c45ee864490c1c5dd3f34149199afd0ab5c57dc1e80
9e9465a9806d630f40099f4ba6502b574ee6df0edb45eaa3edbde18c6e0406ae
c1641d6da7460ed89da87b58d6cbc247f2470b22c6ff2075075fe1ca245ac37b
893b700a7f4397aa15761b09580408fc2b06c473b5e401158b0d65c29b189912
ef381230f7e8379e075c998b827b71bcf6bf63ed9b8a27825074bdebb7b96b0c
a7860bfbe6b8b0439eb6334d414a87d461572731b6e1a7673ddfc0fee3b5efed
043eac6ccfb925509691f16d9e598e891a75f4f7d23a46d71716ba188d6a46aa
4873b5e6efd086d10dea28fef2b1635c2409dc3a1a357240b67daabc139f64d2
57d4db02a53192978c27ee8e304e15e4c3df9e52c42792d5dcb7716a198b03e6
cb6802d9c0f60b2d43ff7df5605fde04f783b301ef4ef2ccf45a4adb99093d33
a9b552ba2d326f6fa3ffec16c3c99d13aab85a94ece00502f51324639e6605e4
fc10b7d24e804501da20880695cbaf0d60c29a8ee2edb4e31bd2276f7fdc93fd
c0a44100bb18d71caa64b47eea96aafb1338eca27739c2d9658db1e5d7f513a9
8607c15ffad5e3d2ee0ca1013ad27917e0c0bcf424485e9e4374fe23e2a340c2
2c966488250c00744e7be40845d23ea88b7cc266330bfded2a5a8313973b4305
0b4b1c618fe70c5f83281199716bcfa7a5cde30b8df22d0bb1daa443df660df8
efbce56c1fb902e877398755b5f97f88479923b78d490779f0246f22b9c71cf3
cea0e2032b64f341ea387df1ae4b48984dd9ee676788ee55874883a11b4e22c8
45c7884812865d7219d46936d2f4b9d207b5ccf27dd20aed14d871c74bd2f70d
cffba7e7a6d2be1dd4cb0241a5350fdaca5a886dc6ef357efa48c901cd88c077
375703a36e15b19faa07325cb4bcf7679cc1f63892605fc89a3c21a967341783
a650646824093505ad29d1a09dd649aa3d4fd1a13cdf697565bbb4628b97c792
10e9bdae0db6a490646c8ec5b787e39694e82ff6a2c9f4b9f93579b53ddab3ee
ca772d56990594cb6b22a709fa31a04893c360f7f199d2ab0790eeb0f7acc673
a01b9fba38a3448c70c3cc71127ffcfaaf8869e6926424bba74270f8c9d807c6
539e66322953916ab0cd21c569ffc5e78a8b20c7c97e80f4dded31e898b2dc29
37d3d36825d373f7136fc93b665d0fa41b8e9af3f45826d3065678929e259181
aa2a1fafe4ec2386675fbd7fd90390eec2c34acdf5e8a0986fcf4816f6a297e0
742ee635689bb4b8877b081c73e961c94b6dd98701023424aaf9c4d999466e52
4d244361691df535e9ee78eaf2027cd1421cbc7071d6de0abfa150a3d4ac2a0b
21dca61f11d7199538f9c648e044b02d12263d67a6930732833af46b42f7e8e2
0d6a3ee3271a7b85c867e4bfc0d0b97d0ce2216b91fa2cdff2b12dd29f35dd6d
514a8e8f66873451217a860f780649da1ccb8b8e256d342f242545c74924e4cd
bb210c0b92a60f9e97fd6931ab0866855612316a2ec933df0c13f6b4470a3571
c1532edebf3ca23e9afd86b968386306ef98faf091f308560ea282d4f085881e
bf347770c9b26f01e69b2f72e36f6d8e91b3baf408068db268c98a92801c8e44
f9e25575b4d00cc10ff51d46b074db962132a1b29d610b1f6c2fbe0ad75e1586
ed1a8aa1e958bae6978827d644d4ba866e17f09b1ee03d7ebdfcb9e821685435
675fd429c63ca993cc97c066094972bf7ecc26a88a7c4c4b611cd6a17b98dae5
958f9461bbd429a7a11cadfd66eabd80ca390ca6aa2a5412318e0cb9e3ad4012
3900938b77b4a64e712699cd25a240a8e8f8b02efcee86b3bec3ef1d43049b5f
b44072396b75208b28c109075e80a3dcca6eea3a8eadb5216522f3118b1ac556
665643408f1c64a13f4574d8364334214a42011a49399d396a24636d7f49def9
be1641bd56f9f48928c0cb5f3096dd830ed1ede5aa27c4f8e631100f7359fbcf
999c05db47d829647eecb5477d1309d0daf02ba6fad2eacce7d637226e438d7e
8cd69ba0eec1715ff485f2e83fc5c6eba046349d6a43c449dfdc1bf7461b98b7
b7a2982adceae1531d0847c1e5ee89dc1b5c88652c79247b3c8dadc23ae0530f
4a92ab3292b668192931c96107fc8afbbb93d796d6837eca27d7797fe9458022
87ffbd96a9d048b2765c9bd346d29b04bb038cd3d6203cf6f8e8682f06c7cfe0
a21817d4bfc2f1f413fc96fdde7c30d1f6d524710d82db17d1e43287e3f5c7fa
c781d20d0985d2b1ac8c58ae078265151f5f44c0adc10e4f19f0a4230fea07d6
94607e4be850286a0a88901cd21fd1068a2815778c9d801aaef4b6e22727ae07
d0e5449f15db1f3c7ac0661478c23018ea7244621a725c7340d603a01ba257af
69cfc9e1310e417130d70cedda35e85f753ab2df08daad8ac6e7d9567fef8748
4492a5adcf58918d255ae3c9e1a8e3a52312bc1c50918a809f02176a2709e4c9
f08347512a1ecb18527db41d74556c30853e3528d1afa73aeaee70c382a82405
0634ce154a9e53b3dbd850c7ab225adee604bedda2bb92b7716dae0b4bdf376a
26dbe367de7897619846facd40cddd195cf0da397837ec034cc3389e35087ee3
a04224b539ea84703c5b4b7ec8ed92e371af95082591ccc39924eadf827cb901
f9a0a77c24d20df3f7ac968779cadf47750dd162561f14ea9a6eb0ceda92ee80
0cc66b66a42db94d0baa7a47587e11e6481c62c014ec495be5d484005e32138a
1614ae2732a206e69691f16d9e598e891a75f4f7d23a46d71716ba188d6a46aa
4873b5e6efd086d10dea28fef2b1635c2409dc3a1a357240b67daabc139f64d2
57d4db02a53192978c27ee8e304e15e4c3df9e52c42792d5dcb7716a198b03e6
cb6802d9c0f60b2d43ff7df5605fde04f783b301ef4ef2ccf45a4adb99093d33
a9b552ba2d326f6fb0f80c3b602eea71a01970684d4c281d3592c6faf2622b29
838c0c1853b8a16bc622f80755993af1e809b47e9b10eea6f45a2cb024eb4177
011d2978f050924796283af67955c1647dcb34323b3e92255cf07a6e295df1b0
64850c1c7f9cc4a5eb5fc40ab46f94a0cfb7833c7fe710bc79923512dc29d77b
a6955a0ac5ee303bec7946476fddaf3cb2e6429d806094cafa6baee1dab6afa0
c70dbfca2d0eafe48c63b8784cd09a68defdc5aa3b9451b585384cbb2bd77b92
43c238adcdcec4ac94e5bfd53d89a90c8267a88fb3f668caac92a391eab301c8
2cb0a7463e75b5c00882acb5a9abd54dd16592080a61e4a1bb269daf046a3bed
0c2ee81cf3a6ba5b03fc9f609592914aa9a1c0709737fdb02be505a084857628
4e1f7356049f5f1173baf878429c35a6e77252963af1f67f77c535ddd65b2f26
2a405f1b86ecd0bb8059668f902a183b8c047c3b6ecf1c5ecf0dc856872d4c6d
e862460ee7207bfa5fec005d96fb7247383e39919b961f312fa9181b917dd8b2
908df6fa25d415bf82dd9bb441dda31b7bcdd37d0cd10ab7b11ae78db0881a4b
d9896e681cd4aca1fe631b398508c77e5f3cbcc83b17e6c287822985d418888f
9de8be50643611fa23d57c463d2d6b44e2369618fe03a6b12fe9d1a343976133
853df91abec505018c00009de7b504084362dfe34c41fe04c34e7a46ba6a50e2
04ba000319f6ce3afe40a9a3570b441caace107d4c16584cb54ffdb40a2d47b6
55749c820bc47940f1eaa893d08a863de323f433b27235649a4dedcb52d842e7
0493169a0a7c413b62ccf45293e28afea04b7d2248b777dd47d2a15a6548ea81
b831418902cf7d202f4d3cc94eb04c407b2761ffaf25e7af7fe91b2e1938ce4b
6e3cc386d3dd8c26223d42b102e2c4e84970aab3a792f72a897cdeae385e2c40
26c3c04d922df7f6d36e96d90cc50c414b1108b9a9c9987711e9c0fe08dcf8ba
572fc94d60c06c9c1472964582bbb7be1cd233dd907da6a7630319606bf886fd
d2be76b07d1f5e72e022431874358e0c2950666fd5a01167537c6d437a96af81
f0e5715ae7c66b4e114172e58bd30b6de803060719b07c112f2f6fd3c5ca2021
8901789a26daa12648008dd14397fb6986f436072992c66c43cee485be76273b
9a1fa11d8ea5b3d3d8abda41080db55fa6099321181c7964b027276af5a1ecc1
93a3d58b1218e46dc72ed2535e8c4112774c8ba2f1736c22c142f1760fede537
3753b8d6aabe70a72dfe888a54cad937e0d6769d539754aefc42214c5589a66b
b2b8f40874c377e9ab352e59601ce0c3944bc96138d69d70f3b0fbfcaa371b8e
c484adc8e3c38b91e5359fa436a32167c12c2d18820eded1804119d71bdd1ffb
60ed7a2dd3e8aee6b0ce7bf6d5e91ba685dc66a959c94b67cddc396b75ef9318
fe58bae5c5f3b4802e8ec7a669098d237e18390c1db9371f8c98508d0f713a12
52147a149a982c2e9df3d5d613420485d187a116aea86c3578fa466dbbef1374
f5ba26a053ddda8f0e77e6ba98f41c8a9852d9c93dc303eb4588286855db8908
97ba49c720a3fdb433e284110dd0b62093554ede883e8ca8c1be572e96d99f18
19caff2408b3d91cdaba1543d899b5f51667176dfdd03fa79e2013f9522bd7d0
a48051ad467a4beb58e9357a34882956ff5d3a62eba8290f4210a2387bc0c3ff
14d544ddf0844c70fa76092b19c08e6234b94231f1c1e831ad4d9c2680747e14
06812434191e6b1a0740816fe0b46ad7b7175fb80f1358bcafcd368d4b69f377
79d212b9b5b19974c2789cea781451815fb404642aee289cf52bed0b50ebfa2c
2fe81cc5e516a5ab2dd2e07884e0ccb502d75c403145b6990c2c1394c79fc30d
97c3209e917919fba6f3d46af8fa03d49676d11331305e8edbc5e76d6ae5dbbe
acb157b7d9289933b1b243c598d750de4f8fb1be1c55625780201b6faecb3d71
bcc5da9ae790207fc747eb39ae1eaa65e6e33b76568f41858d458fb667f7fdba
107154f00132d2587c5c25a03d56c4bf0ad846ba6e41972aeafab857aeae8460
b323d95dab213efb5b9e4d401b62fe32469e5efa5978a6052f5a5f84762707f7
42bd06defde0414883859ea85dcf1bd88aedcf525e57b430487e7f98d313996a
c683ffe6b2ace3d5e492c755b47e3476a000f62ddb187c5892d830a4a16e039c
ad32a82e21139827a7a63fd8bef764246b12bef36986cc0984502d7b2c5d6a3a
1ff7adb951b3b65429f58a8f17e0bd3103a5175c62a376e86ec2745769440ade
01d407e458538fbb9acae1e33606bb22c81f0fab477c97a5ba691842ce0e53ff
f82c5cd3746282395179cf62299aa17869615987cf7d5882f1af03c9e1247323
fe66e548a481d9cce894fa59b652fa543c9c90c04b559284d40b239a4cee7c37
991eee151868f9fc70903eecceea0481e2423242bdf41752454f98d29124c6dd
f0ada6789b1c3a69f99d3480560157dbc204aabc7ab5fda892612440abe87ab7
9d1b00062539b0dc187273673ec3686ae8d97e5698523445f546dd632d9498a5
493efcb0d4e477819b8101a9ed18bf99577ca96099f4ff38a15b1b999aef81ab
4b632223e275db5f8fe674bfbaaf4d208a0087fb61e99e27e4b1104817860dd7
6110e31c8a62cb209f903542601e557c992f17fbcba1032a26011b25ff52fb20
d36b73aa660df10cf2a2c76b2d3fd4c4a795b6c2152f6243ef926cabec907801
8a031d673e4b81e2713d80636bb1bfc81a4e5c3c03200f55940e664a074999de
173dba3d843a7007dbadae02d2344ee641fcf8f09ffe887a542c50f5fc160d61
5526e8acc272e866eafd6e2262bc101abe4d19107cfa8ad9075cb1a8390e1220
a89c6cfde3cf28de30a6727b7df2292719c96234d72bd901fe9878c22320198c
cbda52050c7fbe5d24bec2b6606df9fdaf3b838ef214d097ebb28f2f45b188a4
df6e56c7b6617d612e10400f8cd6477780d0e67176402b0c3837354887957d07
f4d431a5cd545b90ed621ff47c54328d183582fe2261d6b0c79706617a404769
7a2accb3ddbc6c0a740ea0ffd1e8264cfae63aa88e9c9e1953a9dc45c11d0714
3806c95e8988e008665598ebceca01d62806969aa04071ad13e5e717d565ce91
0bcb65ff7aff44a98cdf6e24644760fa5a8495e5bd823bf1f66bb06937d5459b
b866b381e7321f45d1479995552702041f62d96c3a3b1241515321f591635540
a02ca8f37e48cd3ec2de59fd978c4da603e4aece774a5799ba583db5bb739a06
3ac80590e0a0d92ac441f81aea510c052acee345dbb3a6f1628b132d266d7692
59a0d6cd6f3728e1e6cb76bcdbfcccde70dfdb1532cbcee0b285882098d0ac0f
8edfc780d134468a0479a07fab7bbb55480dbee15d96464b9931f7356df022cb
96904629365fbd4d3a3ccb5e50b9cee4f11c53271ef9029768fc371855a9d91c
032b669d1ab3067330ce6b475d5adbda6cf0a1cedd9ac31c1728f8a187b72f11
0efbcb3bf8a748db5fe67b4face5e43d8e2be73bb33f2ec0a0c4bcae6ad7b12a
ba54908f43bdc293f7358c0d3dcdbcd7f9f2dfea3af6370834e4a13148f3bf1e
e9ec870e48f38821ac87b43ea77d9c5e9654912d74606f6a600783e91abab5fd
b9abc5520924d1638f8a2dbc60ed036d4d04654940ba311704927fe8a069bc2a
fa12ce8d56c93e7f36bfddc448535bb08bd4df81f5b9f89720bb048aca1c2452
c90fcd60bcfc970a4f620874ed1ba04cf81da9ee669602ed485281c7a75539cb
dc199b0e1060e766842cdae9b2c3e12be5510e826f73466b4226d8fa63611302
62b25c8831b1731527656f61c74bdd01539868fdef7099642ece7fcc2ec07b00
112b17a5022228bc0d675419e906dd75908de098de154c331029b93316186825
b6612c750e29a9a4e31f33d849ea93266b852e47c1ce1fd8721c3b8e4064b9c6
f8a940ea09faef0b9d05d4e73c3818f2fea24e6360e7cf11cb8a4695d01e7747
1c1c249bf2d76a9f0212e55dfde5fa443fe9912b9688b2b36682433e36454d20
14c74d29e737c85c0891068cbad2f7ce578c95b788322328b8c22ba68ee16b5d
3bd8d24982d19bf6bdb61be693edeb0bb9d2d286346871e34aa6920f09e7e3e2
60c06326de6453e2b33f961bba449f3dc0a192234d25a7f4a4d7f889b1a29460
49e2c0897669d5e28f532e0c1d5f6ea55759a98a2228572f6831f0f0dc736f94
80fd982a2bb2574825ffadb44cb81ee9812386f566e7bf2eaf542d861acc3988
eb9102dc85639ceefa91016461444bd7d8d10fec7d7d8d1e5ff36c31b41bc538
f64044ed041092899c7d3e5a0189f57e380c3f9b0b230462b7f88ec7a9fdb22b
d2f029a82e18b2138ac0a92f580af05017a0e23abd317e2b33c2077c655d0a97
5634045b74b5d97206b833b72d1295c4575a0b20e85abbeca271ce81ad336815
3892806a9408b17c854d482a5965fadd2c162513a88b6e760146d3f33aa78537
b09e7b7f2bcb64689a8477a4c3786ae518a2591fe5027b7d55e0cfee3bc7e3ce
39123a044e08fa9aab94447786d8bb1d6ed83248f10bcac0e2b421e54db9ab43
b4438b978d82f385de6096dc247e2fe042b6654b27738f023cd953dc3f0c760f
b7acba9b52f4ae3763ab501b88bf174b582616951221ced23960dcbf6a01b5eb
65f354f39bade746b20ae0fd18197fb6522dbe71385d0cc0a202dfd5064ff6ab
a24cc53e5f4579579d28636264b68c9111d08f214063a0a704e4fa31ca2d88dc
e75c2ef6cc57671a05536cef0de03d3fc0bde5c4c25facd68dd39ecfb893949f
510efc217d56889ae31994aba869ef88f677d75b956334fcc82f9ac8294a37dc
cfe5ab58a57160f9c6829c56d96b1cc72d2c5245a12387c89b72230d3c19a95a
248269b36b5797593a7f0997545ef052683d6ae23f8d712968f1c4adc28b4d9e
3bb8ff9141d51a9bc6fbfb2980a06e72cdc2ad2041350648717194b8e240f859
8e1e275864cb46788e6ff82d2da5e5d1612cc42a31eb9dd75fed7cfab3a09026
f81c5feab4ad525631d70d43161e46d9fabd058c011e954d482efb66e82a2f11
23d5accaea25f61460a69aa0d7ca14ec1633b173f9f6cfe50be13aaacdc23829
ab4a06aa51e451ec9e3e01a09153a4a35bd3e213bd97aa38b57351075b9b125b
2be443063767d844a272c054e6e3d05b63c23adc1b9493cff2c8b199ad3e36b3
1d4c7082857b8fae2d7c29ed377bac3eb7ca22e085bbc0d2f28e795fe7729dee
9ff40d728dec9f6483cc98f8b9392beec224781ed724a3d43dc7b227f0eff0a2
42f1fcfcd9ff5acd80cd74ca252b786f38fd1bcdff34d7c4f4a2423673c934d6
c6205e8e9346506cf39852c2e620aa91265a51ce66226fcb6e4d40b25600cb13
7745a0b883e015c302c7b8c699c2d5d832aaca961963ec184101bf99c4beebd4
1e3edbaf76c1e339ef0b37afc93f3d55866e89a65cf4b65791a24a23e983487f
d4792fb49d89c5881564ae47c52a49f85a053ea955f106d48ca19870f474d220
ae53023d79530a6f8d3c8d8392dc0a6ea7f3213ca565626e361a5d1eff420ac5
36017f95e4ae8d6d6325706c7dea2d31c2d6a0aa367058913c987f35daa527e6
1a0165d85bb02b70b2f74ab90ad842f02a92d98e7564b580c44374d7cefc2a47
c149cacecc815a5c5df6c448dc1e2a5892d804cc6931327a9cd38a02dbfa083e
8ab6891e5e2049ec28897f52be0c084eb062b037b6261f415bcf174fe9714039
26acadb08cd2f9f5719249b3406436d7c757ac39f53fd3c163aa708830e6e1c6
5ce1af871a3b0da13cd56bebffa566b484496b377f0e32293ed8ef36ea5c62a2
8b286f179074df3f28b9c1156cbe07ff466195c68c747a49abaab668d7fe48f7
0c643d703f1a6dd6f008649e4917f95c6ad88d6a8f1dc5e9f19e4c21fb3668ba
6d45ba771b001933802aa4329bbd45c56e226a3f764ac677acc0ee29314fe452
138dd55a1ac13820ea7aaf8942caf480f905fd9cbbb9818b230ae84952384a05
6ee418c5185f4ba74b072bc3b067207fb05c3d8308d565e23620ab0396814c42
b3f49b7c5ad032dfb0a8a232f11cb80e42b005372b163f6a9d15b4de905eaa54
e7b83ff8b3c88308cbcab936aea82107773e4a750258d7ec830649c9b3c8cf87
a4dcfa88235141f83036fc7e0f30ee0e549377d81035310cd0881c11a41714e6
594a76135711dd7ecea2681bb20b616e5c54efe56a7eda7f5c1cc3cf201c4bd3
6d46995749a1719c2084f68bc277b45251fe50d2386ac78309f0644412cb36e0
84fe2556270b3a32bb28575ffcda8182b6003e6b7b48cacfad1731d6148dbbae
617b96a645372b7168aa8436ac9ba58c978e9bba2c2a254ba5dd5a0a8ec798d5
f7747df121702ffce982562f4908cea8fc9d98fa017270ae217f3962301fc2d8
c3937d0ea361addfa9c6d7ed5f162b4aa0360bb27b5d8d79f19c84c8176bccb9
5abf03af655ef716f5bed7b4e4262dd9d6f1566d453aa9707084a866da645932
a8d8e9c09cc294c089a9e6ddef063547b700a4d084a747e801999f7ba3deab84
3425b464427733d1d4595054d5e1b4cb2f4b65e59094b0559f0a66fbe6e9da8e
495fee0f49102ced7078876c79b9b28ba55bf118d199119d73f1c4e22d691099
198d07a3c5e7f13213fa3530880da583e9be924708b9c199a392142b81eb1b5e
be730e2d6a9460e12835e717c2d313faa84a035a3b21e1e244b8d22273b9e9a2
663e8ef3839bebe8e18d2283bceaafde02c2d24ff2ac1095cc978f0dafd1247a
5edec5b2c7bd28830e9b40ae1fcab0ba3676c7452c06e9b9bf3f98640ecde149
9c27ebba1ff8e24e249ec70cb601376372a368530d6fef288263d7571a026c41
5a51feeeed1f727062e6199440369494bb9f09da69f3c2e2cf30cabccbfbb0f2
1c4e7b7de580972bbd2f2537baee4bc1c5a0fe36e6bdd18ab7526b9608d2fc64
84ca3b5b61b3550c4f7a7679b863a4ad11876b76092387f21d4510e20727b7cd
aa91c1b50a2c1b018b7f2feb2e7f1bab515562af74c321aaf52594c627bc9dfc
619c5578a3b37f7b0789890aef31d5140b9bece55928ce9e0477236f471af6bc
9807348d0d607e3ae675f883f882645e52c2dd502ad1ee9413dcb44c60683e52
a81d7fb974ecdfc0226dfd315aeb91da6467636a1417a1cf456094a1dfdf7c42
c4c46ff61e4fd294db04437abcb3d5a61af883e38511b4bac0eacfef1e966f19
a096da4b1f301fbddf034d5fcc479b989ab6d179a991d9fd272879c4c7d6e41e
ecc3bc28522e5bcfaf839e17185bf86e7f2fbdf7e5ded0e7bcfd9bc238f685b9
414eb9daa86aecc344d68a8f234e2e6aef83b06a18ee3f0a5fcbe2eadba891be
94791ec31c09f498f68bf4efa38cefaba29377c47e7727d4c670d110053857d2
7da580868afec020d100fe5ba9bf1e459de9c73cefb55d106c45c508ae90aecb
049e127da859e158f054f395ea366a4e6bb171fe866caf2b08bd7c63c8c75cd5
91eaa942d80402b3bc81873627b5533b64c52aaf68b10e2507da0c4760a0288e
a1af2299f403664bd51fa27b824ca0c4c58b32642872c24d0ac00e5054fd2706
30fdbea074545f21c03b2f3013b6bd258df33f7e0ce70f4d1f89e367acf79606
3dae9060c3c2650c472cfcf91a6b845dddf9e8f69755b9ce7f37e6de1e944328
bccbeb7f58e415fafc3985fc40eebf6a5274a79d887eb9c67449aaef5c8359e1
9b2a114f5c0ecad959eb2cc93d98d4aa0bb19967f70fee7e7a4521171eaeed02
4f3e04c75fc31cf016cc80fa006580b1d083972ca4e6fec65bdfb305f2ed9343
6981e4013ea4e891aecf6fc3485cc69f7ec80e4e7eec9c1ca9f715dab6e3526c
5ca25b15dcbb743ee2e23580c09a29bf26a9339e6f53dda6f61b59d24635671b
3e2b540619096e34a2cd9bbef91938b7fb0d0bf5b0afb82b1bf53352a0e75981
c9c6f5961053cf6abc742ecbdc91b6fefaa2e52f51b45f0a0f60ac98d6003df0
85ab936b707bda92586bed5a7538c619dd5fb2cdac1fd360b73379409b43f16d
84afd354955af10d9e4971bab57eb98f9455d5023b8c64349e183f5bc7f6ecfd
667c88a0f11214db027b7682a902169428f671511860f1733fdfb60a13971ea6
aa014705ff4bf25888e06cac9d47541de49bca49215d6f2e51a82782433bf19c
9ec8693c9354b93134c26482c776de218dc01cb48627bb26c1f9423e30e21f16
1b17444a27bda8896312a4337d87c3b46c6e376c74bda558b115e225a0afa8a3
fed8b6fa72e61c37042a89b6aaeef5771ff28cefd4f99521b07f0848c6a3d4d7
5aef2a6190a6d245083c653ba3eef859bdc076f1b3b9c94fb24fbb0d2075a34a
6fea619504f482a744cf8ffdef0a07ade1396a30c8efa999ef6e891fdde2cbce
6d66df9d90d4f493a243f0bda77bd20e30023c908c1c446a23f2831b1c2cd243
0aba6db2ebb7930c110cc55f644ad2840e22f264fb042c2391e23b0787abc47a
fa278ab694a947a7b72391c0fbf83271152bf0c8f2df6a37383bf661c80f104f
b43c576afb9c3faaa075c88b6a6b5e6f0a6d1f4120c85ec170eea750cfe8ab59
c4bb714491fd0f9b574b4cffc27facdcfb6824d907179f3bc6f55a216bcad493
8ffa8058d5bba48349e43b74ac875f40a350f717995ae544d5f2bb862258ee09
b8c843c26f62bd80118c0828a67325abe4696d3d5e84da9c46e8e79a121338d5
791fd987fdbd85d758041420d2c56a6d1a3bb49baefb26fd758a7c54e019cc88
3ed64aebb9f6a3b7c2d86320b6223f7f9547c13b1545f42cbb29a63468aa0b7e
bcca52f42b4e55b69818b3109a41a9c1775f17098d59c770d77f5be50baaab49
abb45a0b85483af6dcd76b309395fd52c2c29d6540c9fc9529e24899a39a8d42
89af5aa2852fa3e640809964548f1a61c03026f03c97c13513bae63abc01b690
c038e4e907497f86d247bd75c2ba36935f17d98ec309ce7e3f014bbca6e99800
6fde07a3910017e66a77675812f75028fafcd3ff4a20d46c14630039f7bcc301
0c6a750bfa321e8ab9f26cfb50647c3de0d794b0478a6c596a76e4fcfab4351c
36631f539f7db7952380f63f588cba802eb58e2e3d793148c1e0b0695fbae850
8799f885168e363629fc2dd599e2aae984b585bfc5a64ab4abd381231e49b50d
4b999e609fbfda09639779f7c8938ff7ed02a0cf91061880c511778d14d2f73a
6b20252bbf1f9cd04aa77fde2b99f1a7fa300b707bef8b57576de95adc15106e
56aa6d090c330d154ea25db7324664ce5d37217cfa1b9e20de9873dd53a3d32e
6011f24c094882af615f428ff7c16bb0e9dad6905053c4d366e413363294bcb1
a938e4ad076226441fadab1dd83627bed651679eb5cec19a5f00fea6cb3949ad
91c15f379482357278a3c6a5e3ba348ea478f2705eea883e624ed2e8062d6e6b
feecfc3f3590eac7b1a6e2c2e6ab5b8614fb65ff525b546cfa3a2f7aabcfd4bd
c836d769e6bd30855f82001032fbdb861b46cbc4498c5049a71de9bd8cc7be39
f25d5df0c9045a69a4e2ea7979b0c6e6a5dad97dea90ecbfb7880696424e9c03
fd80948ea33a2ceb9ab988ce2c4f08f3ba72efa1aa286939802d6148ef709aba
12d4ff68b4f520446850d742e833d8c47641420a63cb27f684ec93d5e81fefb8
b78c750227ccd63615ecbb2e01ae16661a70c682cf4243ca27aace0b384848ae
b0ae994e935c63e471ba1de1e646c2d1e3f3b8e0faa4bdb01940726bb58c2732
c83cc371699e8c2d2aaafb6da08a17653e7c187a8a44f367930ea63ccb7e7e64
3d45393d115ed445aa65cff1dcab40916b651730ba4e1eb7c25da59502ec9ee8
2b3339e27ae9c81b416a3afcb9b8b91e6debffc4408b61e227857da9f90df3ee
e4c1e6589cb63d4308d70c826d80f06d8764bca34ce716e3fea0586168774ee3
0aaff9e085f4bfc81078fd2789e1f65424bd90cad1682782552842bbce8c05ae
05e00f30168adb6cdf2a0717e24eda0d1a641a69f44f6f11a2bd6ec3ebafee33
99290ee8d147c772d07cd1d5cb8ab40a664fb66f57c11fab2aaa996dc9466039
7987c00c9b1ffd246109661944133c3232ee5d574948c1b9f95dba65e63de9b7
5fa662aefac6e1d4b17a786706f9acea6f1d7bdce0897149a1f8a80b54d44687
f6b568159441478508ebc4c45665715d6c13ca9752b45271cfaeea004099b53b
defcd302fd616f72e22f01508f8b3b0db2fcd3f5bf9cb1b6ff0e954d834c6b02
c6402947512e0cfa0a8fc912515b1e491fe9553fe058771dbf994e2cb38b57c2
6e005871861e0dc4d665dc0565081b253cfd75c442f59fbf9b84d7e5189258de
607159cbcb30b9495369ebc4f76c736f0923295507527b2c123db0c948410afc
00c4a1d1ffe15a18b3426db320b32b06fadd36b8ec81af3b49f851a20efb94c7
c1c24d941f0312028fa09d467e0b524750f1fbe8427d218d37ff00d00de93744
822ae9d629743a258a7bfe5d56cc119124896a814ca91688ff68248e829db4dc
1482b6987008f657c8a8ab98917f9fb561d85ba0f6af6073b1b77403514c4136
36c6608acfe4e03b0da4a2dfb401c719a81e5d19143a097ad1531df13dde0bba
8605678bb2be38e979fbbb3c74d6a6f62764638810e9bcb228c2e4f8be0387f6
f7571762253f234618071075f6a7ec95ed2ec209fa5e811d4316b9994011c01b
83c8c1638ac22f08e773a5079dcbc33d806271a2b432a4e36b3c5801e8c36366
e725afe3a7dd20d7b3f44b2e5080a914decea138db1fda1bc37942449700c0a6
cff3782348e0b60e5d2a77eefdaa39224f625e580acc2e9a4000a52abc677814
9d6c3d20d3746f9b3a06a8d778a6a49ff718904c0be182429be5ffc6232b3a9f
dc2297a520f8667f85269696b7d007ea4e6123c37bb6b43c2acb676eba046934
84cf49ebfa21764cfa82e172b717ce8c1060d6e02643311c9ea1f865746f2a67
e7cd3136797bfc6b6c8ee12d1837d2f0b402327f7dd60df26f336240efce4065
cf6d5bfaa9060e681b1f983d2d40527876041a15cc8b6938b9c288766c533259
b4ddf8885a836a51c79ff99697ccb94e56729ce8e1ad7c1a15e7b1fbc7da8a0c
ecf89cdd8701256484c90e67fd2e5d09148b44a9b5b0d1648a5356d83f359d44
9ef32403dcc610c0d2830263f43fb8bbbf497653956ca4592d30e90b82c6cb50
e6829d591cdcc6bb4cabe0db4c82e7f1b5bf3510f6224b6af06290021ac9baec
a53304378e9fb5b0888d17fbdd591986523595b18c1ceab4e3c6fad91b2f323b
ad2d8b0b577d76a81b88e4aae77994146c1d3ebce0e4e1a64bef3564118043b4
82d2d18518fd6331b9d38f1e4d24cead766ef7e811915d533dee7dc245e7a6f7
c20c3f2d4e11f5967140b355e46d7d03e01b0cf6231c6eccbb1bfa645e9e6793
42e6f30cc539fd5199b3ae2f6b6bc5ad3c8a63293b444ee678dad5ef63d25158
d3f2f2697ec9682f2ae21e29c9cf2e94b6aa88cd765ab6e03950285014a7c856
21f5f87df3417296a2cc618754a5bc4356b1ba8adf5832115cbbbebe721470c0
274a26d0b408771f7b4d4e0b65648ded9ac604822134aab87882197ec181bfaf
dcd4321cb35f129ecd12cf0682b1c8cdd3075523af86875a6fe2377461f22581
918a7c55201a374b9fa78df8b5e0a9772496fb924b2caf0da1a0dee268cd02bb
51591e383821e154790180e6ca76c9cf1eb382d681ec007cc2b86635c6656875
f0c48bad907f82af3cd2f55466252692b0ce29e1b787892e957f0a19f208b70b
550679afe8c5b0a8f4cc76d716e51837dd3d69dd604545dca54f24c38b3a5ee3
cb71b63e35b70a4284630529250c6973fa4d345991c2f62101bb8a9ab1624c30
108b49cc4581099c0107bdfa1f5334f1102b7ee634b3467380ab4176422fd0a2
8f79a21631d8047626ed812a1fed9f97466c5b5bd02856d98b09c3d08b992db6
f7785e30e7d1b8aa8be30367ca96ad5345ba3b9e2a3fd91dc4e5c59d3fbcd628
9e4139c302b9cb84ee0036780982005fcb38714fa7b8eb4e8fc51118ae78f669
9dd394a251cfb76b94f8e98f17fc39a44b1151a1b2a785f232e0d9fd8c24c829
91c88fc35875bc80f3c666ccfe8780b3489d0d402008fdb8b81e821bc5fb69f8
6f36dfe84182d24de44c37f7fc1727413b039c5555875cf59e4bb7dd480795a4
433103d8acede3a31d7a7e851f670d86bedce3b666db123742d9280730bc4d27
a52850a6ff69cae1b463a79e7807d2b0df6e60ff4090046f5be8ae632359a7f9
b1be73c90eb4716fbaac003b5e867e9caa2a892a11722db0da2b3ae13ca87fd6
987a6f24afb9c23158637dc28c71b002939bbdcf8a69a38110b7d4424ea17cfb
34605fcad6714b11243893d4e45e1ae077013bdcf9ec3e4d8bd7e819b5097a56
1c441e831082b1459c9f15afc74b88cfed0d762007f52426ea1aab8ee00463d8
f55589d7174855d53db8c495bbd7abbc0ed65056261ae708726df8133a88f1cc
cd0a89ba3898cff1f7edb3d85c1076279db6afadc63d441a8ccf393aee754add
de2e6c5d0baf8358b7aeac473f4c0418b95b0fb2087e32073e104e387688e5ca
aac175b302b493d87b4030a182490456a419a788f944efd30f935e65fd1a649d
64515065312371eb1f95ba0e70a9901f7a1e358de1b4661900ffdff9522d4fb1
47a6e0c9d72889da364b69e37fbc84f2d127f1264dc7e7a97755c5beb9271791
7deae38303ca97ed8725c1f04c960969cc1921e223443b39a62866cd54e966cc
2ba7e39f8ef5434b314fe1936a1f7b0a43108cf0ede682481e65daf9805513b7
799a02eb2a632114aa2ca6b73dd93862db6e98faa788e698d3d1cb467edea687
0a811b9074bac58fd5d8a3b9227eac229460e5b577aa6cf8bde775c0e5d89088
9ca96b487be623b9e00508f597d4b27d4bf07b577477626ffd298db23db4d9d2
1c62e2a3f83df1411dbed5f27a28239de68b3b92563587ab7e9b36aee6be684b
5ab2ccddd512db93a7283ea6399c6c5b220e6b0e9fa768c09f6ab6c70ee0ef2d
e9741b601ffd1f71065f8e24643dc7d723ee18f568def5099580a1a9d8f40310
730a581c7288f7a4cb4dd47fae9f53222d5a69b9c385fbeee998a84e0c830d02
5ee51591145b690415b06b5f2fc1bd4a43e95b01232776d7b6138b7c7f5ced2f
252a6b7059b29e064089c9ec101fa765cd66f5d291e80fb8e22b65c4ca8665ca
1c5849b207370032ccff0a84f56823aacaeb73bac6e5df66038d906a4390c092
8997330d04cf50659541cf2e78ad99623bfedad9d2b5980dd89a86c9da7681b4
2794f5040eba80e48ddaa49dd8bab643f561db6670b414fbb6e3ab96c76fde2f
51b839438d4077a7e03dcdab26e500b98b96e7ac0c3e54f5675ac4244b292ab1
72c014d4f855d3de9529c92ea292a319e21cd018ea63426e6386a67d0d21c644
8d034c7904ecd099253534e0769dfbeb6185b2d8212a6f591563fa4bf6eeb5fb
1af0f3b57274e1fdaeed6df7947768b8c78ba9b9090cb23a9ce6b451cd4c8662
ade7ecda92237bba1687254c7a4b5571ff75c570c323dcb92424c6f8301d69f1
45432e340ad6658be58df337bf2fb44c82b2dd3111327fa9b2018adab1ecc943
1fa50adc7570b92d4d6839d9200de1d20a6cc48fdbf68aa5d4ad38ea40ad2d12
470efacd40351f56a9ec23faf86e2ba1ea6bfbb95a7e0b353e3687c307d4f48a
7b4b8f58f14987a94ab6cdcacbb7198f9dc9f9c800cae3c05fa24e27506be7c8
adf8fce55ab9804dc3d44552b4c385a3fc64b14163637b5d60e2acc00040b838
ac7697ccedf353307073f4d6b7f78fde46d5bd0d8e990b4892ea06ae3fa54601
3db46f5038fb0dc91d476ead9cba742563a43af9598e962a645616b3657592a3
477a29c5b0cfd4c11b2561f4de96a465810d388c0a0131a148377d742b9e4496
41724c9846522a33cb35f1d9a85ae4f0fef921d69c6dfbe5984878eb895ff77b
61ba208d6240edc7cf32e7b446cdf0b8ee65b4973bd1c8620ab4610f97fbdfa8
952e0b427e641783bd5f0d68ab546026f748434a983535d12a43871c7d162ce5
f5d5ede80d1945cd04c1f39a5a9801cc834836ffd0f2c4c1ee378f1b4d0ed60b
b3faab47cdf6442739783974752ff5e49d8a0db2d890c78fbd3cae8eca125291
8b53fba25ecf63c4e3e423d5681938b16c85525b275a8ebea0eff641272628c8
dd30db6ef4777de2acc8a3ef69f237b033b3de83cf05c73d47a7ada0add3acce
37f238b1d2583ac194963c1422dddb7143bb6e4ec325a399e1ccfa8e1f228ece
c1885072dd81cd30091ae9c73a06b8143dee6e93e52374b015d6c809536bc14d
290a8df96c860551ae819718480c935a6a200f20a1095412bc43c50ad2007ce7
b4a24fa5ecd3b77a3a56fc2db6a0b7681270ad7408659bec097a87f7a0df27cf
52835a1161d7f03e85402a3e09d62613d4057505334e3dd0b3291a3822dafc7b
c395485844c57e2ee1a193e22c74ac91ec49c27e45ca571748b930cb696790d1
d7d5eb0e5a829e3394c61eedfa239907b9eca2ce63410c6f9a4a927aa7c7be20
4d747a8f0e0b0cfa39021fad7bb047bce10185ffe07421abdb779aebaafcd994
7850ed995f2f6b07897d451c2e575afe836c9814fa50b8289c954f0181263b5e
65ec874fd2d90608dd069c9843dd4eb88b5b3049306e82520ae9a5aa8c694eb0
3a9e7db34bbddda872bbf099d5b949158f94677440163fbc4c75d59e76b7c182
93118213b6ed5933b3e387b37a38a4706826f84b08dc741bfb6e3cc2dfbc96a0
ec822befb2f88a368fa20e56d91d6fc43f675a5b9eb83231b13cb9ae228d5793
e07dfd2f21e3f0b747a54862b708f68132d04b2df55d65057f6e5539acc44695
44d5eac1394ec9bbed94ee43f190a07e7e9aa7aa6ecac75defd17603384e68cc
51474f633a040a9e741dd124e7ba5c298617f6267b713016a4abd68a5ed10cdd
92571aa95850d83313589f66005ef991c8f9e47f5222d58291c71300747ab844
9a055a8f3dbd4213629a8a9613de17054fc6cc8248e00c1233a76f978e0e151e
7ba58c8f7d36b8566d05b4ba4ddceaab5d99f393703f675921d54410a32eccb7
073717ec769ec15b8d16b64b602b2b337198411187174e9c3caffe559ef1b277
ce8b2d4e2dd9d8c6de199ae439135ec1174600c1ee8a7a343f3cc5de1a239532
e4afecee55bc805df564e1c404366da7ce0db01a5bc878fc274ae92cad88800a
d06d4be61db4000de9f409dfc5516debfe03af863c0f764daaae8895c0b0deba
648b15cd6b62eddf6ca52906f16fbd681dc7d039edb5bf2f71f3da9d1586e1f7
e48efb13774fab1f58467ba6d4bc389630983191b37d3e4e3ba765d016dbb59e
d98a104e949c24bec2cbf3076e6e2e22a8b5d73947bb3966bfd6b8b623756036
2901b4b3e6c528e2938cbd3f5e417e38851c1ff9b7037e26168d92546ca1afdd
fa8534d891cac61f5f7658da11964777c1f7d581be32208ec07fe74b2851bea3
1361444501ae2dcbb963066a2b6392d4f183157c09cef32b55fb65b047a6924c
d18485f0c431ac263c5a8e7aae662ff627ab11cfed6e21a91b193dc95f1031f6
2eb37cf427128c58a92356fdd47e2ab70c30ffc65d72d255176f4dbdd99885e4
ca6c66ee6911d2c01d89a8d9c8ad0bdacbf860aa3dfa72c368a4a9afb67f5ae2
c3ec6e0ac49e802245f7c68b6d2718d1b40d586d31e56293a8d370f4d10b17dd
b0f1513413f8abf318e4e5775c259e789f10097c5af5dd68d77199fae250b0a7
1b65e5e2de4fc49ee8a543e0a3f3f80396d146a24278c8cf87ba58b3309b4fb9
02c0facc8fc022b53bfb75c2d0d913b664badec026260a295a2785163250d7da
81a73c0816bd696f2491e6046d9572545765853e091dd48bfedbf661eb24590a
b9a81a8fde9ec3f64b3334b6be279cf522228e7ed7e7877393379c2d01e26417
dbb6ecc83b84e599ff852e57202de4a9181db17ea0f6a9aa2db157d969bd40d3
6a654c12f06d67e4db2ccd87a396a44bab6144992df79f6b42687a679efc4759
5326ae181f6af993d64572df283dd996b762335fcf976962805a5d6e071a8ded
f6f81ce575444de3b37e163d18522963a2ccad23c2e343eee24b4dd6e6723571
4f7bdfa72ce6bef3de8f4e169f972272809e7f14403a8c7006a9cb45105ddcbe
8ad3713545dfbf21b72e7cf511b13437b1fe3f327e4f646f83bc49d7359a376e
faefbf202113a68d9fe6415836f807de1c1571d6e65856cd75a94fdc79dec7a5
d2957b4e74b5c01ac9a88a9703f7ced9b62e5d00a247b3362bf614a6966ffd07
2ae41e60a64ef91be176652efbd3dca9bc1479e206e59b92aa133d9c784dbfd2
2cbb37b24d028eb1687393d6039c64a4786c91795f9c86808f3ffabc57527be7
2f452c2eb0d19bed0378dfefdc713a1a1cfd8c79cfcb3e83d54edda35653e97f
3527fddb3c13fe706bc901d098fb0307a150ff1fad6cb0473ee60c7761bd68f5
a7078b8d5a46fe937b4fe21bd4053e7d302ae1b2174cd239db6c9cbe163b339c
6df4caef5617f360e145d5f40b07ee4317a0eb2cb0b34454d4e9f798e8921712
d3e27669d44ab54e37150fb8772cd0070278532de34c97c64b2fc8df23b6cd31
8949663d95b8d86baab72613c2b5008235944e76c940342fc8c5ba39b72311ec
d9c310fedade914d170445d9230456a533dd54fd9afdb763c6a18eaf9e30932a
4ed0e3f44eed103595e90ce5e5474877350234423a4b1464ceb2ba3e6bd2cc18
3e3e2b6a8a43bf628619b9f1a222ab8f088226839ee1c778bb9d0fc8a8b3b683
e13524c60896b29b2009ccce93f86b861c07a3ffe45158131d6b67d83bf80328
9b307e71332979468a2a9eacb12411f5e72702f299c0690b198e03dfa9955d4c
7a6a845e8aacd07687373a42836e5614c79766417573fefc221d42ad74861e7a
55943ee0f78dc73713eefef9f2ca8c2412f7ef4d88f4e8b3bf23fb07d03c46f8
0610a5fed91881ea0e5bc5403633e737358383482c35e9dbbc32b298f5a2b061
152b88569d68bfb80477cf08cbc7b4d1255e6aa76056287b6591f30a9a32bbc2
473fd65bdc3ed1fbdc4484769f79837df29d146bcbdee36d73f2a6cbad9bb983
d2cf82c1cf16eeb07b93d8a9dde08fbd891e4bf1fcc70b4b0fa873b98a8d52fe
64779c26358df78cfa5a9beb725f7f55b418bfcbc713d9b6a1e9d15b4501e803
42f31e685367c49f2ae1af5c3bb7a54d2c484d6e0857e0de30180a013c247340
68438c2d7bd7100bba5d20862338bad6e9c3f2157d66486b9546265789f1fef9
62e843f80828f5811c59534e190e86ed46e3b2a3b0b41c66857e5c57b434069c
ffc3184a7a150996162fdbe31758b248e41986418e659045f00fcd95e022b071
a0e75cad65b69da3d291849ce93f161f3de4aad22a95e4256b91d22d548d2b6f
cb73167ec281d8bae09427758d00be22864f4389bbb593e8472609e662c31aad
dad114f657c267dada2c28a72192e2b59e572867c1b282a9d14f55ffd31d4e87
c6efbfc70b5848c6b3f2a8344a4aea644afe7f775005222c519a738ed49c780f
595881138fd43d49cfb9cf68f06d8155f41230b2e532214280ca1d84f52db4d7
c62746ca4f640fef2638494abac5b2390d611bbd02cf9b568dfab5158d3aa018
c63d5b3d2affc56fd5b1a3437b29f54f867f1c17939a00fc052f4cbf62aca863
bc13a06ac35925f0c089e4961cd6fc5b23a2fe265ea440c2b96bfa7896dbf5b2
16ed8cb13346d19ec309b1ad0c1f3c9ba6166c9ec3d7462bc4a2aab1ea8d2131
1d83b7f008cc65cb575d8457f74ab71b591e01b19caf5b844bc137e8c3462ed8
44e62c1038a95bf725ef8b0b4886e49671d35f096331f813a1dca3afea0db06b
31959c90dbe9644f0f5ab875d671784123db6440fb64bf4936982ddbe1dee404
5b832a3918284424c264a57b373a22704705ae633e09f5ff8e08031e542a56e7
f4929d16084b0e22803f47acc584612b79f4481488b0ccd5723fd9de59c7300d
1e24ea23739ed704ed2ab1857a93a896866b76168984df37873a67b6248c485b
875b3642809a9f88e0ba5f74835e303892a95ad37642bd858c2a2037d61e3f6b
4251ff6c7d8f1e856b8b531110ef580d2b6031335e691de39f9eae5d962fc32b
8aa12c75449d93735d107cfd4bd74a097fd335e305e348c1f95cdfb5bf50639b
449f7cb0cec88e7be604670de1ddada3d4ec5bdb530f260b0c36b13a979264b8
ac1069ebf3b2d63b35e63ebc10f58759d65ee35e68d40f0c846951f51bc02332
6bfa56bb1e525467e5f18f8dabec3cf429f6503295aad62265eb0638bd689822
d91a9cc519318707fcf17e7113c6ad8bb562362bcbef5a8a74735c8e02f12c11
8d0e2da41f69f6c3b32e149a33d710287652f45f3093a87b5ccb860ceb7d8fdd
3121c5377f0c8bab840331ad9974f8af57f1e59e77d0fc71ae6dff298d1f9e5b
ebfdbb3bf1ba54bae50db7749b8d503e6616b6257f64d161c1522ed9046e67df
ad2c5b7bbf3bfa23749308ec651b0cba5524d96e7d7b740c1e577b1b69b25149
9ecb6738a25210582eb02e92e6efbab2ed5d6e3a6f48f495ae385525986b6d73
6ccd382bc382a50e675c066d0e990673900cc2513b99116da95919973a079570
1c7d70791521a63a02e905e4b1d28c13494e7a736f40720b3e0c8eeb7559119d
fb2e1b646248dcabc6db8c0ad64581525b4b4f3b16ba4d6bf6851e733ad4a24e
a9cef70700827925310f53a71de865f7fa9097f4ae86c90ece5a925bec85ebc1
377097ea8a17155fc6ef7b599aaa43d5d43909560348ccb32ed7feebc5c4e970
237e72afe57dc32177e2bb426153294aa6d84c8d7ecd08e3d46d0825c2e8ea54
a20cba94b7d25d7c339aab52e5116de5d8fa317ac916fc2a6bc07560b06823ed
ba0c1d52b4ec31b8c3283e7cfb83ab7e57ff2192353849ea284839578e7c7449
05003a8ea1470f35e24f422eda3974ff9ee391ed3a52b0de91287b5e50853b1f
49524687e7ec3ae4f49705b9df4bf69366fcf5d3edefb5cc0a784486379d0083
e1c689e2c88657871b73a7c0976d1d48e3f120ebec7aad5a55bae35d1ff686c4
e3bf887586eef821355d279b7a9e9ad2927ec3cdfd2f702a42213a0a850233a4
f788b8118d1ea0575cbcd6ead296c64024fa609b2b30cc2ff96e9884561c11fd
13291d285ff2e46cd312acd7491e8a2dc992e99f527fe000a4c63aab7c5e2dac
2d5526025d747a61fed7761d0741daef9f94c65f1d92441ccba66140b19413aa
7adced4a692aa7dbb8e36fb251950733c7a2f286d45cca242d9fd1ac19512cdf
9d1e8d1f509458f6544532ec067bb897d75363409834a28aad23a179709aeb5d
9ccabdbd7a994e2d7fba4476f1f559db3b805c16945c78da760b73673da54a83
ffac2c548efa964414be2df82847561cb772b84efa63ba471f43675092e8c969
895da6fd9bfc8c3130b3c368d173ba24c2784b0c9d5d18500938c37eac77bce9
22f969e31548bd950edb6c26f5cb7b3e3145f4c2e8579afe53a41eb882a077f2
7c5ac6b2f0069a88c869a49d3fc8e709b505ca8c1c5121ee5d3ac421a52728c3
facdf2310a9a931f6d29e36e2e63dff84a4a4c70027bb271326db5961abc02e7
63f27157576f758f25550ad7a0ae1ec519ec50ccd5d617cd7241cbd474a8a8fb
a506b206efd22c4eaed5c3239ce428e32b4ae4baaadead46bb28f846bbcf60f6
babe2425d1467e8ed267df5c7dad3550a43e98807f371a9944b966b387894023
0f6e3438401664d64e33121628fe4412ffcf099cd4d7f4dd4658b1f8ab7ca99d
82189c6f864c3fcfdd4212c6b58f62ed8f57368369f38d21f051d873233ee716
5033a143783fcc0106c9212d93b4a9ba5a988cdd0f4c8230e1d7ac4d04d2daf3
7757f70255c2f82113ab23f3786cd2e4b1bf570f3708475fee5303ed82b51b09
489eb9cc703ed5a75f9483b5cbbf0fc28f3d99aaffa3e9286430b31a011a871d
2273e2b6d23c7ae5742fbb6d24301b6fd90cf2a84ed028dfe164b0abd4360123
655ee9fc9d6040a5adcc67f0ab2a35b471498e4d1966a3011c6b48a36cb15c2a
ac81025f66348c03d60fa8f831745364f32a9896922d6c59764a965f6ce1c75b
92b1ecdebf6e0fa79504ebaf48ec94c7bc8971e15c7a470f0585f5729f0b113e
e909588f432eb1939c93a6b79ad668f95c0dc3b57f728ec1d2def5bbe09358f0
d2d8301d7c123cab478563e3fd701c2c66563dfd7b3cfe62f52b8aa83055ed05
d31ef8802bb56a701d3a2d8e05f0eb4f3f6551aefcbeb8839f89abfb9f94fabd
c0fd5edf2f8c7d224355f93aa05c9bfbdd4a3b3899d7856ef1613ac91adea9aa
73eb5207765e1a8c58a71e90192cf0338976a7c7074f5b0d8ee601294d3c083c
88e2713dabdbff33a3b29d7bbd642729da93b06e85c24b253a1b6127c8468799
68266f1a70a5a929bbbc13d5f9ce344962b7f37c284b1a37a4c2bb6dea762804
c0e56e13dc7789713abcd8f2d0752a18d0a5da4b65dda63eeacc55b7bff6ac70
9f1a18890e7763862717c9eeb670f6ddf950044cfafb26a8fd3f352169e4d056
ddbc8f46680b225343d7336988bd485620c273a27f508add1c00241194ed8323
7666287becbd4da86dae0667b2069d5afaaea7f13db9368fcc129b5a04c09b05
39599cbda235f8bd5a430dba5bcc2a170a65f790098b20889138d0ee1a60612f
8dc6c0f5ef8bd258970df92de14051a0ab98fdedadaaf19a0ea1c259f4704cbc
786865888898975d4506486f0d351a248804737050403c9bc9e3a28fd3b7d387
afc68a0943f90f01c1bdc975c27d47984ac3ffd69605cf5dba5afbc670e80664
19b3e16b3a6acc477a0618233aabc9ddecc478b234672bf474b26765ff458a11
8ce56bc5326bb202c4f9e9cceb7a095d0e7b375bd49b2c139a26c1e6e2335e21
9358ae15af768f2165d4dc6b6c767e5bb2888a31de53c492f32f51ea615a1974
668d179075a91487bf56e4e137f24f79f1f2ab62746a46fb15cfffb7054acaa5
b5cb13d7d9fb258a66971eeec5129c89251421894110db7af9b44e7b730d8db8
a552bce68a8b091b4b74a04cb23688aaf8ca12735429cc9e31e4fc006cea4fec
e930a1a37251e4f663d541f949fa383d0f23ecf3e62a27b284aa6c3b78e72f37
336ba9015818499296ee5f81ae8af49db7c36e7db8817b72d185b632ed65eb0c
28f0a453323c52b1775aaa031de0cfc4afdf421339b494a53b01e8d92756ce79
305a9600fbaf87d0bfbce2e08cfa951f8a4aabc2267f68d390d9d81848f4c489
0b68face3701fc2bf7bdef0e11e49c5f88600a38c15e17aface393bca772f165
37704d75f3698ec4319a769643b7f5ef18bd486237a886e78c0d40d0cb20fb94
4b50565b3ddc49c9ef9435271764a826257dd39b04ba61ee69f4818a37e06b99
434d764fb24f75e6d474e0f72af7e35842e4add8c4d917ee018f82bdcba700bf
3bdd6d77722b5f36061322a4b769e17aeadef623f4353d6ee247f5eaffcc0a67
913f0c698f0ec59ee75085e66aaddb8f58b12c1f5a10b928c9bd645e4afb9eb6
25ae1f78e18c4cb4b805aacd5940bec518c0c215e6e36b7c4b8403fbb0fe853b
0a72f9bec81553185ae7a62f1189ac50d13a91dd30d866ce2477b1704b4db36b
b007ba319d7aa8e9ffaf5235de7e693fb78e93d4eefce6e65d08250a95fb042b
3c08131651e8af55e835d44b0f1d7419ecd2426d3efd6abd0407548ac3a5a434
00335c26ff4c57b0a968454c12ad21e1d7c7e926a236bc697b8948be74d52810
97b222f700ab5b4948fb981839b8908840ad34be0ad21b8bf4d7aa80fb10659e
6bc5bc55d677a0fa27ea462e6e16459d008e67e6099766f86d3549ecd339a159
d020ef95a37ac6c319601695229b7f0a7791f3f51d7533371b7b89d47f41bb2e
eb492a82a9a37650a3d1938183e4ddc0e383c7c75dd698925d9c21eae2555ce5
c931b74e29ed537ae8490fffd54e0ae9a9111f1324840c7cec3460e81f1c79f1
2820aaf79abfadac8097e606461b8c0753dabbfd052a03a20c3bfb99c3cd2f95
2137fdd7cfdbc601f717d0d80e365a0ef6a62fcace7efadb9dfa0dd97dd0c097
74b0a61dc1a1970c399cabcd27dd95fe65d694a60f6903955ad66296b26e21ba
ec8616e2a8b6d0d841a4dfc697e02af0123e7b074e01a12d45139fd7895baddd
c8cdbf44cac7985b70fbedfe0ad2ac2f313ad4f4eb24e6415e920cf8f1bd5355
d259ab4730498abe5307e915471a15b0b27e23b40fa92bdb01de3a36fab10ef7
8f4565753c1dca3c65584098f0008706e344cd115f6b1da801e39dc9f1a889f5
622fc2c0e1547626ddf8c6681438f9b6656495ff5ea5d50b2a504a5523af01d9
78d291239deeef9ba8f104645edb4bc8cb63d2f949b78eee6ae573802dadba09
5604ce732c426c352f9ead11e8d5ede9031fe8142992d8b93f09826682e46435
cb08153f5a058306826fac801859d2288389b22739934d21477d6987c566e508
a516a641257ada6935d84e9d560bb6ec4ed9d84807b4eb6728a17b2b227114c7
bd23002bc290d6fd22da7515abb22d5b13a8c0da691699dc908e1f013abbb684
00af15dc48d1bc8daecaaf7efe5b15d514a4271211a2f1fb38e41a041662255e
0111629ae4f1bfdbb4eb6815d9c782f88b2d53f59be628325e7f9b8c7f925199
86f81c80c32a128e0f97e1b683ae05ebffef7e6683d5555250ed6f82c6cde10f
b40f8ddf5afa57613d15e6a69896a7977e82f4277e36fa6c1aa1be28ee1c7f44
5752f2e780dd6e8eade5714d3cef265814019dcd7d63a654f04dbcbf6782f285
89f9b2026e44806fa0a17d42d8141aa9a017d47956d58d2ec6cd8039fec0591f
8b2eed9560f28fc920939f44bea9354c853d817c212859c35ac890d3731c4bc6
5daa86476544ce3e3790cec2f9a3721053ebf68fb12f270392c46e89b6c94653
5dd758292f4d556bb578ecb124c99621c5c75f098e999c43e3ede0adf223b82d
7694fd43bc88f750685dbc3d94cf179e1b18af2a04580039aab5716ae34abc3e
18e096530bd59056e436a2ec1480d3ce4c8eaa4aa92683b9db317dbf9e4de189
abfa2d68f16208d05f7a30dc4aedd33a38a688e5fdd1e90cb7964d0002a39282
34c553c96b5d75b3962cc7ba07503a4993b117bb970c5ed84212afe1da03b9e6
f7f36680f31d59637b4f55be6ce344f4f51e0da7c12cd788d3b18d5ad051b197
a32116d2aaea5e4d4e6f3783286fcaf12b9ec869c1341e5648a259df2e6a3137
b716f7ef77ddc6ff381d4c2f887b7088fd1cdd61e63f18d0a07c06c7d5ad1b62
6849b4fce056d687754d40404732fb1e2ae7da5789f39818a36559af5c00f59b
18504883c3fef80a7d72cf0fb63a368166da46d023cfcdcaf8c7fa4e8d3e0635
7e92821645143992c00dc7c322fb81ad69d23d738855f089f7ff4b22389e179e
29fec4cc168cfafba179749aef82da10510b8e71728bcf07d5733a29a2a2011d
2620071610e567c8b7b0dffd7a57e517fda76b8c63d161c3bf4e7706e1d03ece
12b535b7fb09bdfad7bc6ad052f9eb90f9e27c1ac2452942e5bb9889841c8515
c23f6bc4973e6087e1a1bf2e54dc40cc623a66fc485e1f053b1c0d4aedbde9c6
5e2a80dea0c21c7b7acb80204c032d190b951c5e9548be4f3ee1c8db26a3b732
d1082a450926ff848223f0a01d7bb0a67c4ab4af7b0a35ecdcd095a439df83a9
3ef16721e62d10047277b5012dff6a6b9a941765fac600ad443f0b4953d688c8
f941333553f4f46ff2093376c86fa2b15d39b583a4a8bba602a7cf4b8edf2cd8
01a85281c7ff6c00b1727cc3c0929992cc3feb5546c68e3ff2b7d19f7373ab0e
bfe5eef514b6eb2e4f5da8b037a10f26a5b3ac6b08fde6abcd413705e52a3dbc
c5f7d680d0fbe06e101d37cd5386eff1264b36029c42bf98db4e6328e3b8ea25
1c7dc53a603e7d55b1d0cc083a56b56baa430564971edb13bb6689041194c92f
335e984191b0d6c1adb63e2705b0bd571317c4f0660e305040c17098184d78ff
c264d8efee9a73648b4f16106a5d10998fd2321bce1c05344e8e7f049eb7991c
9b8e3f996bf90850d7a1004493807fc97c7b53a3861a3432a644b7df0c3e23f7
5dc5a84cea04d660d0075ff5d7c9c075fa1bfa1baa1fe651bbfdee0dfa6d6cc8
65be39e695436c9b0fdf38b35e0b8d01732a91014251c60b43241999031d63c7
e9bedfc00c39602a7ee97b4bfe99f88ed728283726049aae97d23878ec215335
d1164f9d6e74e6053acb36dc4073915fd46968d69be1f2ca66d84592382b83b3
0b773e9555b09f777df1a4e6a876c766e590af792256cd0ce126711074320691
60c8e88eaebdc8a9e78b94650a8d7c7ab732ae61a102470471896f3fb33c8132
227e8b4f58787390643d3f7b1242b6e8a2dd90040aeab910918fb5f7524c2e4a
f2af8d1375d0b8fa2cd17e27305a52ed927250ca9d27ba980585c4bbb5988d0e
c9b6dd4ad445100aeead47f37e913dc2ad9350e3554ee0faf529e68c18cdb904
351659cc47240d9f42269c7c304fc8d0b27e55147cad9d3041791cfba5e43a2d
042021e84de3442771600470180990fb19a343852b3e111a227e9056f498103f
4ccc10c113b2d15f28dcf50ed816d15b3042c9af8bea81b7f874f600d437cca9
4cb9d5d36caa7bd0bfa8a1cafda7ba1e542c840518b0406e525b85fa47afaefb
a0e1782abf5360af550aaf1d2c08aa6a64348d337de32785d76c491dbc473ca4
ae1e1c6bb8d477cfd6d5f673c86bbac62167e74ad7b0c4696baf026b43f37292
91d4f56dfea6ed7c63c2162185af04894639d663c7eada0ac29ca514d5ae0803
117fb95c12f8c83acbcd4bfd8072445f038651d95af75f08c97797e11fc5dbfc
ca5867945fb9f9a6fd24da05f3ff7cf8638201837eba04a6eca185041b86cb54
d86232b8b609d1049b148970ee249d98a141f0b387acf2a8d5451e4f983501ac
9253e012ccec63f38cfc3d5aeb7e80b8a46ed1c9ccf13a94f3dc18a44c0bfb56
63fcae9f000cfc879849423ba7477712b1cd7271cfe7e604eaaf07a47a3c90f4
d61240b05604641ae9842cfaa700801f56a43b88c3c4d239d6c84a338c265db6
79ffeb3b2e414c540a59e0a18a65600f7aef70023156db9d312e2b5e863aa6fd
49dff14efba46b7b19af6e8529b7c35c7a8f26904a47a9976e01f96111cc450b
d35f436e004b241b11fe2323a729477a0e75f814a2d115303546d7e6d3c0a781
ba532160f257d385b73cf25960cd28a736593acde5e4ea16a6da3115d62e7fd9
ce2841f6b7ff80256e0f9f71b0490d78b57d47d9ead58d5208d7ffcf9d325b55
65dad966ba2a546b1d9eab1bcbe308718ad7b0146197e9ba44efd64fa22579ab
ac6e554977b7e57a44502df8fee3c0ce14b255db99f08f3e9ffa5df21b9a3953
99e8f8600165e744eb00f132e261c3515e9c06672d0a1ee0f5aed79de9e79491
92a9da63cd102ac7d82e9f266c4aee4f977cf5290807c9084b77f7c8ee1a290e
0159ec24a8c6d851d8ce3229b24b38f54c658c900e3071e06a63e4926f39afa6
2b944110b0297e2d4c13f35275983b7f9db096995c1eec222564ad2f44cd9e78
7dd01ddcd6e02aca904ff302561f20eb66ac0c7c2feb363a2f77291463e37207
28f52f788599ae7857c40d04108e69e345209bad120a78678caee5c69750eab4
c2f156de2d3e1b79dd03c30037dd795ff0cb0328d66d8f70c9cd951744545e4f
259f349e2ed8d6b49106980f53b298860c48a9fc9ff43bec2d437d47e7d05baf
a18ef10c1335a7a97644e03fc1086d3c65664b3eefacf919cc85bcec671e4139
e93f7a9d331fc5452fe8100f458ce61cece99579c16e65864c6ca788b5ad61c3
3cb5c9c1c3dbb276b8b3c19ce6c62ca6b96dea5dfb9d5bb33c00dc1f840644ad
e2ec506f83b63df9e2a45710116b90eaeeaf55c0f275da8d1cff7174c7baf16a
7f43e65d7b9d9ed9248f12a09507cfb0e19cd75bb585ecca1373a93b1c17edda
96b079eac3d02184cf22c6e1a9a8bbad875fce6844b7372f99304f6875a23436
0fae212dd4a27816806b8a9c93b233679cbc90f25b3b7496553e2cb4ac0df7ff
c5bd2b026d80f36a5cd7fc05e0bc4d43a3a2bad45bc14d136456970d21359490
041a1613522179fa6d8153de805648cf64b5698ea9435921258c0449c4297061
88d1951dde18741b2f8374c00e8baf0359f1cd5f88b7a0e9558ab41aa7d6b570
ba54e028c9665f4af3037018808b528f87ae6f456efc5150cc87c029d70bb556
0c143cdd6e6e253637f98a3caa4bedbad202fb3abde63b71f7cb4212ddacafa0
8d156befde9d68a23afc25176789b57c83a8eeaf099dcb617a6ab41fff7fe3ae
0f120103651fd6667896de45ee5e336c7a857fa9d1eea18fd8ceab73639a273b
d67f61610520e095a879f61a61101298177b65285e88dea638407a679036ccec
b5f38632ecf21966cea564759dbe226f1cb03136b18798cbc1b3fb09a2f25e2b
1c720a3d2bb7246be0f4a654d22e9cbe6319203db50b8f9839a46c05598c2bdc
4ccab4a85890739f09d630bcba64583d428d3380fb9b1f7fa25ca06f0add9aa2
83e2040ebb00536f5d23c166886614b28baeeac36fbada9b762927e99e5fcd79
0edddc76c49abf3d6c11709f1a9e63c7cb33eeff60076f4a57f37ada26bc39c7
d2d3e4ed843284481990e4642cd06dc4db95d976384caf967d0916883223aab2
7e17bf7a0f8e75e0b755c85d54dc239a67dea8086ca7b632aff3c092f59177ef
40a037cb4abc7e1f83c8a75244fcd7f73ca0f4f05027f52cea9e6dba5e977774
2815c0726c21773547d0b0a8a2c03b742a0683787440156caaf75a91e9f0cf78
4dff7b47707e0a8cf17bb5b4e65888ab0e1cc3b1391e04d528fc986c2f7ece9e
26103d5ca495f06ede1b6404a49ab88ee283525a0357759fea34f9eb7f115715
638ffe38529c56feb12e30fd4182d46f7ccc3f5ce6a94405eae434608ffe8665
98755dee3bb08ca1abd4b7f8f5f7216e0b08de2a9d69505657fa0fda4e734e2a
0fcf9e9641ac7c59c0da09e336375465c752e6c2428684861ca044a5f76a1dd1
9948cdec2c89bd7dc2545e9c470a554acb969388afa8b99e918c97f58f38a4f5
69f630d7c4c9dfc2b0f883f20398287a063cff66a6452874af6078f371676883
fde77f8cfc8cf09589529cc66f54fd390d4dd72d5ae5225e5a5466e8683b64bf
34f9115dfbac35a9e930c2912b33c3120b5f6bee0fbc6d1a33fc7d19f65e4d85
105560e55665fc260d1ff32ef4df8d2336cf1d4f550f052ab14077c0efa4c991
1037f62f7289b911737571fb4ca17f9053e5641de8521dce3287e3f6ab228cf8
f0f9762b6f1e2fef28991c08e1777159706963e4f6685af94926e836e77d6403
1abdf4e1ceaef4bb43dc30c15cbd723128b2ef7d6d87c8c022992b3178d6dffc
91dd24a072e03c1ce9a51c8582e6d3da776ea4e4c9e5e2f0ef8e25d15e4ce17f
264b2974baafe86333a5936d867c62e3c1104bf6b9180d7f11396f9b6cdb5033
4947792ae4be9b83745c131d8ad13b3c0bb5dbda6f977c49e6fa9e3aabba8044
903128736c3312f90e6d8de9cd72d852e7910ccc3641fe9409832047a509e057
e712184b6f0a2f301460f9532021aeada5a1c5d599e6eb3a036a4a7407777dc0
c0fa53197ddc2bfc0e9faa820ceea905ead6fdbbd5e10f077e523faea427191e
9295480afcf339ca9b231eae770b0fa78591b365fec12bf14558767d229ffe25
a02abf2a482bb89a89bcc5da340d2064cade11696d22aac181064d184e5a0cda
1844638a5e5816b3ca5446cf4149900e1633d771e5bf5ea2e64761a9b46a92bc
17ffe1d0f921c5d8de8b82e69d93c467ee56bb9994c19927e9db9e62d7aff367
7735757d995e54168377b9916267407079112a41b47589abe80fe28fa7977044
19734e2dd4ebeb6362b5f2839d8758b415743ae3779a7ff2913d38355bd7b660
538da9c213f1e4d58dd8fcb15249282e507fb3457e41021488a73525f9b5f3d2
da26f7dc0ab6120c053276088274a0e6a09323f5d8fe5cc23a866eb628f74bb0
6c7d6bc8cc87901350244c9c21c7c5c10e1e1cddcfbb833db02cdd15c9ee4874
8a7b44c5d173425dc6571f60d35213c57b4c6fe64ea887f57e6b4545f170a5f4
5befbb4926d6c4c234fcb331a0f4d60c25a3de2d461b9c1cc8235db7033d543d
b4487c1b73a76f66d87b87e3dcdd6feb9fefb288760a3314530982b0670d6a3a
48266f09dddbbb2e304c10cdd75468196108fa25481422cae40b1e05b7f2be5d
12276bc33c49ade3eacada7b6fe84f0ceda32980baf70bc69d2512b504898e76
43ff367cc0873cf24a719a52e25f6c91766cda8f11b05213b6e1f8a3033adec0
3ffbdb47d7c668dd9044817d77a9161995983070d8ff14b74ef55dc168a2a82e
673b4107e6b17a344baac1f1147411c0e114e023096009ebe0a05d5cb6ef1343
ae18b48a3849cfbe7534f1bc6ccd68e54caff658d899006a3f86695b91c09f1b
93f4b26c54c0cb11851ddc2b1bc156b10b37fde4bb3ae4d12c14170b7b6530b0
7cab07fdbda212a0bd4447e87a4e0a2be663812092c79e430a3d848339afb4c8
ce3672c3cc0ecc4ac9464db70f44411ee8063d7a35aea66937e11f0412019c01
15d94855ba3aa11514e53460842fa95b83e53bca485262bd433c352435170e7e
032319c3420d11982242ff456d824a824f28c4544a25b35f389df69d71e558d5
cd44f71edc81684b58e29e468469c297ca76c53894b476087411eba4c0538cc2
47d2b8ccfd18501941442b9db67251e36c7fa77dd59819f280e0dffb75ad87ca
66d43c48c6ba5329154385312b4be8feaefd65958cd2941ce8a2fb26fa4f7a19
e196c1ae6a81d5c3713c53ea31275aef75a62cbff72f856b52e4417bd8ab6026
5c3e373282b7f1d8b819a48be37b676dfabf884d866ee6e5bc418307c86a83fb
f482ad0ffb5863bd58b59abe97b91818ca9144d4befe9ec74319f0771b8a12c9
3b14ac939b9c6d0282e6f6024e1224468827433e6df256710dcd4d32068c00a9
72ffbe81b34470f2e2c113b27cb91404dcafdf125dd89729a28262d0e9ab8555
b5fb3d1180f451f5e937f4eaf6aabb618e40369116fcdfd89abf5280921b2162
d80b98b50c019c6cc2607c931f5094c71dd32c614f9b40d8b0b21110e2e8a823
0f777df2410d29a3250cf38c33196b9195743303f2bd29e4b35a6e17080c6f90
9a8213a570785483fccf777aeec307b5feb47c0d2c6e926cb19949d07938627f
1cbe30cdc42f3f4b3ad984ef59cd2dd03274458321e4b8d11bf8dcd6e02f970c
6791be0e56b1e896e95c83bd9fadfbbb9640a057ec2a4e410d09cac056b01935
969306a68e8f39f7072585d0ced10a30fbd0ee8e575fcce86f818d30ef1b0185
1b806e6a7df39f94ab13ab8c5403217e715d24cc38c45eb62049abb0d0b3e6ec
69a3617a9effa911eacbcf7cc9b4f55889c81847a6c6482c46a2dc7a9373aaa6
ed483202a80509847b9fa7b0c8ad0623e4456202be5ab5841f67e5a643563110
8ed2c4c4cccff0c1537f787ccb3d8ac3d518226be878f5f6be4058bccc7837db
330c525bff0a37bbbabfe5ab8f7102355ca498fb0c7be52362a05ad2ac3225a4
539290dfcda4d9b95c4220ad34986425573b6f91d04625367af466a2c15f2276
bcb7d65cd45347dbe9e235d94d183de494781e9937ea15b35f1a8a4001ef5f54
fdf9435676381cf37d6fcb3e2e954167037e4dadf2e936943e4a9f83a9fdc2ae
23fa490d3c9d3bf039997d6c92bd206a5a36b5a0bb800b8c9e2bf343fff2a91b
669d70e127a7bb74b9f4f692e476c90c3e005cfc95088d49780b18716b4eac6f
c58f5559015517a8ca9a9e0a1c4f6acc19e1b18fd3d425a1a3638aee7220d9da
6dafd6f2c72e4c0b7f4d30cce456ef888d945dbd09fb205c4df13d8f9b3035a3
953b77aa58defa582092e642b1115ab469656c9280c018241260c06b8f8f99b7
d18c855f0747b82500e891ae9c653283fe607e25a8d75e301d35eef39bab75e6
533654a77daa6a7b9a9de319cf0490bb0f8b2f7dbd54d5b1a2f2351eaba61f9e
cea2f8f9a30dc149024f02dc1cb15b78fa5a7b8b8f7fba69115bf07eba432e7d
cd59a427eb1234f6409c5bd7e11353120ff33c5b6c52bec1f4af0b75218f18ae
e58551e2cba8dee946863d9b0c431f60ed193892a039def7c72fffd74b0324b4
d40496e0585756e4751d59d4651f19ed60295fd9000a890dcaabfe8f78e27815
cbc1e8d1cf71e29cdd62da5188f11269a7b124d90c0d154960ca71be9d410bd3
479e9134dac0670425a2d83bcea6f7eeaca052fba9fdb581b1843bbc9fadd77f
b137e67b820c811a9cc0231d9b2790000b6a66002eb3210a7c10268c8c86e59b
97bc023591a9c986491adf832129ca454d91922deda9c2482b9bcfca657e19dc
6544341e8e686f63607d34ce3bdc7eff2d70eac3676f7bab54ad13093c5fc586
3df06fff691b8dd2668f80c5b769d29624bb3145d4710a2fd45c42254a25aebd
45091efe0cda06dd8f8d036cc21696de9c64fc1f334ac2d8b6ef7152a98e79c2
59206881a83f176b5a1c748d317722d873da6a183b6fd186ff8aebf42b87c96c
08372ce50b64615a75bcb61ee77383f1ef39b824fbdd155ce090b20aba94547a
c49e23e50a63e4ba7b5d1e7496abbce82a0e0fa0b140a57516f85b8755c83ee0
1c94f0040828addb63bacf6de37e5bb5db6e7ff2746f3c3dd2b27101192367d5
330ca17e4bd48410f012df93c05d1dddd71e614e1110723fbe663a865bef749a
dd0f5bc25b9c27116bdba0ce1eff46b68dde0892e4d7f3ff52e57a050729c280
51b8d341c2acf067bc15523a73586bdddaa1e6b8393b20c6e0ce2688bd2c87c2
8f9641e6e215d681242e83fcfd6ffaf1fc73290a3a4134239059a5b51576b920
b5042400a0af66af57886e5f7987267e3f0883fb5f96f5add6d529abcf4bb53b
a291d97acc541e09535c924ba1251ee2533246edca5ec02cafff593c4dc297d2
0d44fdc9e820acf4baf66335fad2ec20b438b38659073265801cc9769f26421e
74102f8b6bb1958f51d1558269ca90bf22f1b98672b4c89019155930f18a32de
ed279c63fa31042d6986ff08c0917b449d16f0b13b7b3981a73a0fb25aa1f3cc
b1c42bc45b480a812e8536159b47d1565c36de7a548fe68a73b82211ebc539a4
34f85d3585d438929d7223de66157679b3ec8253a3c2a1422ea21a4eec288d7e
0c277cacdbd0ba3eb354c0ad4334d786e99ccc8061d7b94b4c650bb37b89f7d7
e86c2145a252cd89dc94c7fd8454efa73418e1518eb98f9ff2443eeeff9a91fc
fbde1f6e2dc86a4366c796c2532c39c4f51ad4aff7aa18e947e3a94362043316
daa7c43ab0e7b61e765cbe5c84d55d8ce37f6aaef3a7b7e2f089f80f58858026
d3c8fc80403710dfd02ee23652f13d3df066c14b7ed4dbbd5146c86756e5b698
7570d46b5926e987e9b2825bc987db903e31c049348fe6249552b2d28732fea3
14ee9b03061cbea66338ccd319b9af1d18978b06ca4280be718b30e5920a1540
397eae7699eced1997dbd4d3fb090f0ad76009cda5488233da4a8e07b746e2cf
43aa609a61f93728b6fb3485b36d9e2d6d27c4dd70e3ec75a0e3dac31896ec06
ca079a27002ebaec96b70a0fa947e53ba006e48e584d157e52a132750ab28de0
765d0f67a5f94817d9bf93a7972dcdc825c56bd81ef707709e805cdb0d710984
c823e0ece01177ddb6710205ff49769c6058eddb3025c0e193faae8bb34a409f
58103f783ce05d41aef58b84c4e149e964969005f65b01b7bfd14d233c65097a
497584e76f38654c959ccaad0f9d603a2502ac644078796fc9cb848b6c0e0224
cb2f9bf7077ccb6ccd8815d4911b7e4275243180f65929097888c2efc0aa956e
e2f19a6510ee17a29565c80abe4d0c365438601e5ce2fc5e70d52c0b68fbb007
5d8044a649e159df54255b17e99ed9a81bab0bd1a64b89d00a4485cf5ff8c47a
364a3bd33c64b7fff3ee2ba5edd3c6944e46c0569b51782cabac471e1cff07bf
068dea3513eade7e3ced9cf3f44ab4246e13154c638b63e1bad665fa5872c975
f831a9f7ef258e317e88b66d9aaf5b81ee12240cde5e34adff770bfef49dbae5
67a44670b62ae7418ba7a9be063771a91bcd6ae5f0c5945ab26fa91e4841ca29
bf344757f6f041e74c4b8e756b81d0f7efe2d8641014dbfd6d3ce62835b2c0db
aba3d9460ace8b660870908fe6f546bdd56ca219bb45792821754e7dc24165a4
95262806cf94e3536bbf708f945ed7936e0c6f0b30b1159d72d33c2845eb0f91
86996281ab6463b282d5742b349081a1e6ee150c9a82586f34d86ab533879ce7
ae41e126f4d658bab0fde2e8c1939009bfca66405bc3c4ddecae646d3ab1049d
51654b3be4581a2d2e54b9429c0c496172e2576667541838614fa0e114f7115b
a703b708605877df45db6f72d08cf41bb43bf9722f451dc1623ec39676c7af82
0c1b048aec3ea7dd2f9c2986e815035ef18651f502fcce23b8c6935518fbbc10
033c64ebb6480881b4bcc71f829167025fd514387817d5c16a7707c43f220a80
5d1cc2c255348e9b2a0ca41cbd0fda7c2ceb12ac1c7a978aff31f32bde3c2831
4b3cf3825386106f455651509f4a0103c301815f78e00ca3c9760a510e12533d
1890790292af3f1075c1a4f182f4e29fff2ad7f375ab1bbc04787a6c0bcdcf6b
82bddc046a9c843d71e338896b1bfec28766c59b9705b99f89d68c843bd2e276
e3d1de5a440ced44747e9ac783cd70604a78107736b7d46dabe251097c6d5236
1e2df9986861d1481e25b6cecd53d8cfa38920fccb33e304b5cbfff29795e410
7d913c9d9899f7bd6d8ff936b0fd380495855e164ddb57c6add22ed1b9f89c30
2bbe9ffacc6bd84a698435d584ab2bff5082acebd094a6222fb36d9649f9676f
a5981604a2fe2f50733a59d4822a15ec9c6a8e618a8d416493eca80a31d30875
3acd2d34485dae465baaa4ae7693bf9e3996a87ad421833a1b4089b94088271c
5b87d3cbf5472f4d85de51516a865dba4dd2a4ee04839a9fc108b3bd5598790e
c219a3752a8ff46c7eb6d0a45054a16a88a24f2a77138c8b5398a7b5ae98cc13
e109134bb57dd7d51935ac71eaacfea2263555fa86f126bce5169312e733f75d
3034cbf651b86a52c9eb2e1ef4327f3bafa0c85d916775396163282340f737d5
c41df0cb0d24b7bcf36df943ea3cf70147ab45920cd403b3ea368219ab2b44ee
fe26ec7ac13c48afea166d3774a7f9377460403e49b0685db837bd578c3a52cf
ca5095788ca41048e26e0c1c37feda5ac98b221fbd88bcea5653456865c5f215
2add186b48e7b3c511d222f13c2ec78bb111eeae736bfd7301341be3751a5a0c
8df5a0fb88caeda43d9d7ea57aa1e8cc934cd8fed85ce4e9397b722a846bd5d5
c8d5637364a3ce8ed828ae038e6d54201726036ac6d6a2bb35d0909d8bcd12bc
a942b1c727685ac8bf49daf2f36eefaf1790fbfba55a1d49098e7b8ad2ab15dd
d337252bdac193efed68b51028d6eefd07fe1e15fcc316306031de32d5e5de46
be3a0e798f78a124d63f1aff61775778f7d44fefdcc0e9f1aed82f14d70c8766
b0c557cc96955bc71c5fa8d99bf8d452f29f18030eaeefadf121c39c09b523f2
82ce3b029cc29b12c23af5973b032f5c2c9e39680df9067fc51254e4e2981eb6
6f7a7e482d20017c3ad95a567ccc7283f0c12a1503f930273e5eb420fd2f661b
a72ad27f9ac6522c849257e6fa272e86eb2adf73b8bee1df7fdfa9a4e9292d00
9e2066b453fe9e3a6b60809e1ac616e376193bbc3508d874b91c3403c8175497
3c8cc9a453dd536bee395129a7f9ffc931a1ed26fba49408aa0fc3fe4a2c72fa
e4071356b264b5ba6b35b3eda9ef2101fbd0e0c85ef0bca7ab6526620e4780ca
1f8c7f0f9a512ce498916170adae19770d7aaf82d8846288104bf9a7abed222a
01cbca96320783caffd86cca3df5f62d49d8494b0e92dd34b4b161415345b058
981b1cd32d63036e91e453854352ec1f941d0a2d01ccf13426081d8f3341ca5f
417678062274c957c1a5c94c2767e4da0593f92d7c485fa158849c119ad510e8
e04446467928cf7f1448f095ffda48762baa5ffb144c72cfd4ae3756f2326fb6
ca81fa2b18c230a3021f9b9d3e4c1defa60e6d019099c070b416b7b7d0d1ef9f
e4de07ed2f4799ccaec974232ceabdc6f772b71a057615e29c0686807ef403fc
e83864abd21873d4fd3c87f68b4e10ea047624a4985206473f5c6951d4b119f3
d70e5e76b097645ff7349429a7196223d6e12c99606df1e08aa2ff7aa252322e
116e3fb768c17c64dc68341e2a439e0abeb5cc5dc1bb6d52d7efe62e59e9bb81
e3002563a9ca996699a1e68d64f5e5719127ceac377e71e67ee5e31e80c24312
e420c72b66458afff52640e265a0935a845bf437b55729a13d58ec045510b9b7
589418ab8c12ad9d693e5d24c16e1803aa38c1a880fdf79890d575619c13c46d
70341432aa8619ed4f21aab9fe4e1c8b1b227fbe064d0eb1150415c068206a4e
8a9157c20b8eeb5274eb6895f385b5010abf2df5d0c6763451f044f4d3f715ed
c290f7245e47bb77f5b27db6a22a4732392d816052c823e77a281c3e0689c8f6
cd236bff58c12c613ff59d0a99d220b941a2465020b1817383dfe810f62a4ed0
2dadb2ab12e4a2427a715988971435882652a0e8b3371563ecd79750aa7a6231
b327c362e21a307958481b9dc8c20f274e14bc9e44f58cbe7da2b051c170046d
9ab212c82a67859df5227ebe458e4c71c9b73a957e540fa44ff66b82350c505c
efefdf8b12d2d66cf0502ba0f9d352279c22d331043611709342ceb52102621d
d34786cf24da4c29b54559f0adbc9a3b247dae6605a75aa1e76382ac8ff1a351
996c4e06666d4137dc3b0381df22907aca80d70b32d66faf061c8a7cb35a24ab
d867cd4fb79e64390d88a8b02addbe6a70ef0a6e93134b05d2bf5e7b8c690876
a33bba96465f476fa1817feae44cc78f5725a73701d3c1872ac34390fe62f014
41ed59759c13cab5d536ebf8f265fda544720339eace99324855e3986dba73fe
b7b4b6f6b5316d27ede73edf3ae7bd8b9434f5254948c5f484b92adae6c7936c
d0290ff58048edb125886616eeb63997c54886701597fb9a55f4b84fa9e45312
b8b1293e7c942eda5466b321e6c9ebaadd187e24a8b75eb83cbf3a1d10b4d4f2
09a1841efd79bc7aa515bbece11cc7204050daffdd378c829fd92612277f6736
66f9263024c14f8ae72e27112e5390782771f185f51d4b82d21997bdac677163
844fd75aa68e64bebbb74b937a5373843456564e32b2ef4d1e55312f3cf09e94
a06c1a4931bd91cba1191b6a22aaedde26c29ef38917f04d0c168349f1107749
90dc5b595dfbe915e29be9f5e6184e793d6093ef8329b9748d4a7c87c0b04b36
bbb672697010e873ba9a6137341d36afc405c80582dfa2c8345038c0500f51b0
7838d40f5194a8759ad4d1943c9fa37c2d052016586aace59992e90eb23c7a00
aed674db87701eca772648f9667493d36cd0aa8cef6cf55b746d2045157b923e
6329b4882a2c89d3c601b4e821a433740acba1b96eb27c7e0ce4a313086db897
1b047345c5dbe36cf3c8bed6dd78f91a109b35ca6bc63b1d7179a7c1a13316d7
f89b518f876a96e7922aa7e39bd4612e55e1979d5c44607576c8b3379e7a0ab5
f4c244ea6305efd9feb3798523aa80c120670908783540b6f887e571cf34e6e7
7525a798318d715fc32aba032f994b966094df922eaf1019038f9976b7f4f052
2a664ad55b94968513f88450fdf75c85bac2ea5db5eac80b400f22d006c76e2e
4886ad81b3e20ca4180f2d43f5448e50f720b6451a9ffc28628d31826d63c0f5
e55d9d69b3db62fa1ce482b519a822364bdfdf8c2c2d2a66ad590e82bcd6c8cd
da57c7d2fd84f089046d11dbf3a34a18b92fc1d03300a82657c3f1c7c16e7083
1370bdaacd27a19d661c88a842431a4c8315dc5ecca393718bd7aff35737ecc8
a83c97c77fc8bc92b18c855c1b8dc07d77ef9fb31e9821100f19a7673b9effe5
8d348ab2ac336e62936092badffad1f5b1d9b8715aa51ac659dacb5a8893aaf0
a063ae1a381ee986ab83679f51986ae99eb31873153beef16d62b44e58deb805
86826e5740df5313bb540a1557e8b94ec950a4d267f6a2f419c3c03a3003d949
b09a74b196ef2454a7f0404860cedf6f8be9b893a65123a107b6be40ae1f28ab
cc9eb1c1e4542aecd27a190220a3dc8c1c5a61095ea22515171b4703774a9247
56388974f2acae62cdcf9b27acda295b69035ba99a8907d8b1002337b97fd0dc
011abdb6a0992e33d003db6af02cb004558e8cfa57552f4e49fcf277c9fe52df
24459ef3186cd39f0de9e316d3f8de7e808e8d5aa6bfb682b718ad859c7a7212
e09985e5b99e13406c1d37578a13f85cb5d0666e135f646e6c4904587a8d2700
70bd71860a7fde46e98c0b61e96845b9485927b0b67fd8c99a9567052d8e86d0
06ec6f873dced652c7bd41d6881203a70783076fe8505cb8c7fa205f618b49cc
be6ea4cd3027aba02198ea9970713844b83820ccea43c3febfec772635530eff
98cf3ff41d94f0231906dc5dddd64be7d890c2d44ee72518cd127ead88e5fd9c
78b09d66d7bb9921ade38e35c887a34676b52f2aee0e8002b828b0c37d16bf49
5aa36ebd32142e72e2a05fb732b8e2c58835ac4c53ff9410bea0cde9ff3a1bda
d4583eac0979e47c8cefd8a62330f44651c005bd42263b3aaf7b3eae7527096d
2e8705c9415c5012c0d446b9e2945019d3c7255de8ddab5c05b453cb3ba1c357
b165ccf58bde28bdeb9c2adf7647d8d156276bf978ad08bbd5d14901c084f847
85fa75bcd788366f54a128e56f93b26353892d2703202476b2febf3f7d348268
813afef2654ac385c8513e9a286abd8c631216d707e944c1b5667ba7ec7d1e00
dc304fcd4cf03acd7798c24b88990a643411cca735b003123582bd5dc12656ae
89ef293ee0705344e010572b3294c386bc4a1503ced968a0da8ab547e1bbbbfe
dd2fef666282d1edc6d5899356881141bff75940ec83998f89407efe9ce44220
21a3631ae45ded368771c713e8addc3f7e2a99396a1956e9b02a64527d73f0a7
3bc324d8e954992f9cbeb2afa23a3c029a0c607ef7866b871ad4d85f3412ab8a
da1e1f9abc9437ffc9ce9d97a7c7feaaae8b5562626019bba37528dfbc63d777
9b14c892f24afd80caaf55336fff0de10ed1ab9ffac50776cd7c473721fd323a
eaf1603c2bb3c9936398c56494defd588ab8a050cb013204a86d028b97f17278
672751db58f83f3ce4da5210f97dd182a7018a32789df08f704ed9bfbd910482
f3e6597a43e4aeeaad249c637899788081abc1b2447bb8f7ddbab9f077981025
af831f35e04c0b1f7a6f8f6a1dac18cb79f096eb684d4e55247d2f159189a40c
48bd7fbfba982f154e9cdb85a6aaa279f57a58ef06550df96d19484b35ee17e2
9928d5bb9a4b88f6630baf15a3a4201587ec435993eed1d2781a47c7e451ac1e
06687ae93daf8536e693c03a36c0ed807d0b704702fecd4ba0c0c86f48ed7603
6e3ac757e13c1d5113d702212380c39de49c336091f14e26e8dac4a51e903bc3
c5c94305fb888e22654fe85ef497325665c4a69a22359d891c3d5a7d7f3b63a9
695d7583a8765d04939268dcd29a8b9adfcf2234183d6801112df02b26d03dee
d251836b898a3f049ed8b23649ca7abb51b338fa5e309371732fcff1b58770f3
b76484c06fa17c36e755945ac40185a12eeac1bf97a4647720a4b09a1ac65ffa
29a8737061f4c96fc1f36ef263ee44920fb29a0ce1979e5d9cacb8d158a5f379
c2135f16d5782d51ae46d2a2df3e851109afe8c0d4fe44aeb22c108e42e4d920
ace87e693e7f29c0c42424f35d7a28efecceae6b151d6f9b87313348aadcd1e7
4765e9aec59f5cdc29b415ae4f8ea91a1909b8472fa2aa40582fbd8bb88f6c21
230d7d1c65e374052a6f99154e2df3428ff9728f1fbc75a82459dd94325d906f
e95a6bba2760604df04e0882bc16c17031bab358681568a00cae1b500e9f04e0
1156bd451214e6d99d583f64e5b0f0ccd8c5b61bace97b814b7bd69f7fe858c0
704b6213850ee98cfde99889a8e2cbefb1daa7b0257138bff40efe8d0b779e7b
7deb4fea63caea0de2357ab5f7430d839fe340a1a8614b4e74ea9a2f44bb77c3
eafa1e216b919214f55063dabd0f5fc6c5768a2686045a96875079a658b14f7e
d0217035148d2b74b178caea79a4de261155ba45fcc11248037f38015a3b7b4f
7a6db8520a486b4a0ca5bf566467828aefd7fd3e90fa48dacb60d708d1063f39
009bac83ec72b467ba963dbc462768fe96d7648a67097cf7a8c0e11b29c196e0
46766583994d3544a0f8ddfe9ac03b2c92c088f9b5b171c380075c4baf1cafec
730e42d7c49601082476efd0e8c5337243be567741c804ac2a935cf3a5ab8653
9a784df29324792c17798254de572294f14350cf041ff68fe02926318adcb1f4
0fb248d5f68eee43bbb75291a0d7a4117d92a2e81a5fb74c64eb51618fd61e24
c66c77b51bf2602a0066caa18741b34bb963b035567bb9e5199b00e4c4602a9b
1cd7a7159119859e8c769d39d74d13085f233e2572a183fa0749c9957c7bbdef
9dbc5485521c11975cdf317c780dca9342736dc9dfbcb41fae36e0f38c6e87f9
6be6bf443d9ee88ba49b17940746e5e1cb86bfe84460580296491a020603079c
d79afa4f2ee0f138c12e060508b34de89823b11c2976641726f9811edd37c5c2
de741452e903ce067493623a4e58aac11dda8ef756fbe836bfcd6f29b01fc749
8feb34fe5f15b7e9fa038831c9b96adaab346045b3dbb191b6f1521eea270482
95e875945bb9f6d84053e593735cdb298f73648c1b84ed3b016ace959231ef10
ca46ab9f610108c165cf6331e8efb589b26f20a0bb243b3a8bb53ab85b28589d
d81ad57210913f3aaff02fa188afb714287474df0707412984e1446198c51296
479283c996b821aa46613cf0f3421692e014b408ea49d0fc2219dc55ba9b7a43
04d286aef0f25d159464077749d4a21b885def1a0d9da8b0b204d3ea385bfe3e
696ec52d5c7c86dfccfd0ae544f352cf6a429a2837eedef85b2a7a75d14fd7a0
99ecf4dd2d512b538eeea20b779807003188557571e050cae4f2354461d58df7
a1505f34f2f321f8a4786475e23ab55a5bdddd545e61ee699c91d32893bf14e0
7185b9f39e1ba39b692130d97190cf089b0ad2e266936c3b455b40eb95d56681
c030807d6a38ffe1f566ccc5b0277b6ebb9f8cd3b1c130f88f83555d78c0d876
c9f46c01c02848639d9b97ecc19dbe0683168f07faa04dabfb84a1ec85d6046f
c166ccea80a71d3639690769fd12310311672b95cfe21b1450f9c3102899cf1a
26576869b10b04a4f70472d703bfc975abe05017b5b2d6f076cd4814db204e63
852e76c73d5bbc7070bb37e7e631184d5d31d40e983b9b08c87eabc0a9727c55
aab3c41ec4426f70d43304f2c46063f93d816a12cbd94c3d878bb68d8301f4b8
7049aa330a555cffc1261f780799df2e221de799f1ca1bdb5b88397e8e424994
a5b1f5c180f783ffbd604edd37922eb9b866f5f47e911cf66a1b19acc71c7d6b
0dc710488d649e68062b1044690f0ed627e19fa80372a8438decf341cb501a01
357d907cdbc0080c870067cef086ca4a0b0dde5b135475a7c3fb298864eafede
916fcde5627fec01656ae140a500da08b52dfd5581acc4ea734c2f17a7faf048
d5aecdb17e70bc3ba5c2ffb15dbcad30275b28c4964af491c6f8f05e4e7ee73a
4ab70ccf47e87864c884631ad541a834e396f5a83dce1b52f8c02f7d6268dac5
b593a310277fe0be1aa0713d19abe8d66e3f403eb05c5713e767b7fc868b60c6
b53ddb24584ff191451b39d66b32838bc9575e9dc6b1b458ac0ba0b2d3fb39da
e379970e0f7dcb458d2fcd28cbc71fdb2a91e8017166081d991855a9dd948217
f3cba5b080add164b0331de83f445c52627b6e013477b1e439dde99f7b443eec
badd7fa6dba5d3404921352b36180a72dcb7901229f86d6490d6f8db0b050043
8ff22c989e78779898133c980e4658062d46111350737d8eb58cd4be91d3c06c
8903f0c295006d1893ae505bb5f2b32983ae94063e065faf77acc2f6d2cb8e26
287cdebf9c78cbf56d48468e367cf617c0c12c2e9978b6c3c77b41c7def72f49
862b03eec4c14dfcf94aea0e78d0260d20d896d4e07706385c016811040b869b
f0755b4f9627cd8de5c57581974e28d3b7841131bf82f62f058baa949b9abf01
b31f98154b97c8cb571e95f0f8b51f90c66787b5fce2cd65c21c23514a9581c3
672d60eec42a6deee92693672fe325704b39d6ad9480188b56c4f15f00f91ed4
abe0c1437e22c59fb50b06de576f51b556cd9bc3eb18277937b2904e286d69a2
a0215629e7ac37eee067352e5aa45da090a832ef11d821b2e344911828ff09ad
171f310456d5ce284b97cf53affdc1d8a53801b8222b296e83e487185214a67f
2866351dd5c49886fe9ff4da9b15e09d86d4a9a8a5df941895c1ba0215aa6dd4
9a6dc44647ea18666029bfe5e23cbcf843ff4b07277109e461e0b11a16e426ac
6d8c08fa5850d4eb90019ce9f3b8011444489d562813d5b6042bf1603f6284b3
90cf2ae0049947c1e68b4924adf73bc9516612d7054c6da9e51dc72b95f8847d
60c296be43917cea
";
assert(expected_sig == sig);
}
|
D
|
module sdk.port.in6addr;
import sdk.port.base;
//
// IPv6 Internet address (RFC 2553)
// This is an 'on-wire' format structure.
//
struct in6_addr
{
union _S6_union {
UCHAR Byte[16];
USHORT Word[8];
alias Byte _S6_u8;
};
alias _S6_union u;
//
// Defines to match RFC 2553.
//
alias u _S6_un;
alias u.Byte s6_addr;
//
// Defines for our implementation.
//
alias u.Byte s6_bytes;
alias u.Word s6_words;
}
alias in6_addr IN6_ADDR;
alias in6_addr* PIN6_ADDR;
alias in6_addr* /*FAR*/ *LPIN6_ADDR;
alias in6_addr in_addr6;
|
D
|
# FIXED
LaunchPad.obj: Y:/Lab\ 2007/CE2007-Students/inc/LaunchPad.c
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/msp.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/msp432p401r.h
LaunchPad.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/msp_compatibility.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_ccs.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/msp432p401r_classic.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/CMSIS/core_cm4.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_compiler.h
LaunchPad.obj: C:/ti/ccsv7/ccs_base/arm/include/system_msp432p401r.h
Y:/Lab\ 2007/CE2007-Students/inc/LaunchPad.c:
C:/ti/ccsv7/ccs_base/arm/include/msp.h:
C:/ti/ccsv7/ccs_base/arm/include/msp432p401r.h:
C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h:
C:/ti/ccsv7/ccs_base/arm/include/msp_compatibility.h:
C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_ccs.h:
C:/ti/ccsv7/ccs_base/arm/include/msp432p401r_classic.h:
C:/ti/ccsv7/ccs_base/arm/include/CMSIS/core_cm4.h:
C:/ti/ccsv7/ccs_base/arm/include/CMSIS/cmsis_compiler.h:
C:/ti/ccsv7/ccs_base/arm/include/system_msp432p401r.h:
|
D
|
// *************************************************************************
// EXIT
// *************************************************************************
INSTANCE DIA_MIL_6_EXIT(C_INFO)
{
nr = 999;
condition = DIA_MIL_6_EXIT_Condition;
information = DIA_MIL_6_EXIT_Info;
permanent = TRUE;
description = DIALOG_ENDE;
};
FUNC INT DIA_MIL_6_EXIT_Condition()
{
return TRUE;
};
FUNC VOID DIA_MIL_6_EXIT_Info()
{
AI_StopProcessInfos (self);
};
// *************************************************************************
// JOIN
// *************************************************************************
INSTANCE DIA_MIL_6_JOIN(C_INFO)
{
nr = 4;
condition = DIA_MIL_6_JOIN_Condition;
information = DIA_MIL_6_JOIN_Info;
permanent = TRUE;
description = "Was muß ich tun, um mich der Miliz anzuschließen?";
};
FUNC INT DIA_MIL_6_JOIN_Condition()
{
if (Mod_Gilde == 0)
{
return TRUE;
};
};
FUNC VOID DIA_MIL_6_JOIN_Info()
{
AI_Output (hero, self, "DIA_MIL_6_JOIN_15_00"); //Was muss ich tun, um mich der Miliz anzuschließen?
AI_Output (self, hero, "DIA_MIL_6_JOIN_06_01"); //Geh zu Lord Andre und rede mit ihm. Er kümmert sich um die Neulinge.
};
// *************************************************************************
// PEOPLE
// *************************************************************************
INSTANCE DIA_MIL_6_PEOPLE(C_INFO)
{
nr = 3;
condition = DIA_MIL_6_PEOPLE_Condition;
information = DIA_MIL_6_PEOPLE_Info;
permanent = TRUE;
description = "Erzähl mir etwas über die Paladine.";
};
FUNC INT DIA_MIL_6_PEOPLE_Condition()
{
if (Mod_Gilde != 3)
{
return TRUE;
};
};
FUNC VOID DIA_MIL_6_PEOPLE_Info()
{
AI_Output (hero, self, "DIA_MIL_6_PEOPLE_15_00"); //Erzähl mir etwas über die Paladine.
AI_Output (self, hero, "DIA_MIL_6_PEOPLE_06_01"); //Sie kontrollieren die ganze Stadt. Vor allem das obere Viertel wird streng überwacht.
AI_Output (self, hero, "DIA_MIL_6_PEOPLE_06_02"); //Sie lassen da niemanden mehr rein. Außer die Bürger der Stadt und die Miliz natürlich.
AI_Output (self, hero, "DIA_MIL_6_PEOPLE_06_03"); //Es gibt auch noch einige Paladine am Hafen, die das Schiff bewachen. Aber die sind alles andere als gesprächig.
};
// *************************************************************************
// LOCATION
// *************************************************************************
INSTANCE DIA_MIL_6_LOCATION(C_INFO)
{
nr = 2;
condition = DIA_MIL_6_LOCATION_Condition;
information = DIA_MIL_6_LOCATION_Info;
permanent = TRUE;
description = "Was gibt es über diese Stadt zu wissen?";
};
FUNC INT DIA_MIL_6_LOCATION_Condition()
{
return TRUE;
};
FUNC VOID DIA_MIL_6_LOCATION_Info()
{
AI_Output (hero, self, "DIA_MIL_6_LOCATION_15_00"); //Was gibt es über diese Stadt zu wissen?
AI_Output (self, hero, "DIA_MIL_6_LOCATION_06_01"); //Die Paladine haben die Kontrolle über die ganze Stadt. Die gesamte Miliz untersteht ihnen.
AI_Output (self, hero, "DIA_MIL_6_LOCATION_06_02"); //Der Kommandant der Miliz ist Lord Andre, er übt auch gleichzeitig das Amt des Richters aus.
AI_Output (self, hero, "DIA_MIL_6_LOCATION_06_03"); //Wenn du jemals mit dem Gesetz in Konflikt geraten solltest, wirst du dich vor ihm rechtfertigen müssen.
AI_Output (self, hero, "DIA_MIL_6_LOCATION_06_04"); //Aber er ist recht gnädig, nach allem, was man hört. Die meisten Fälle lässt er mit einer Geldstrafe davonkommen.
};
INSTANCE Info_Mod_MIL_6_Pickpocket (C_INFO)
{
nr = 6;
condition = Info_Mod_MIL_6_Pickpocket_Condition;
information = Info_Mod_MIL_6_Pickpocket_Info;
permanent = 1;
important = 0;
description = Pickpocket_60;
};
FUNC INT Info_Mod_MIL_6_Pickpocket_Condition()
{
C_Beklauen (30 + r_max(30), ItMi_Gold, 15 + r_max(5));
};
FUNC VOID Info_Mod_MIL_6_Pickpocket_Info()
{
Info_ClearChoices (Info_Mod_MIL_6_Pickpocket);
Info_AddChoice (Info_Mod_MIL_6_Pickpocket, DIALOG_BACK, Info_Mod_MIL_6_Pickpocket_BACK);
Info_AddChoice (Info_Mod_MIL_6_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_MIL_6_Pickpocket_DoIt);
};
FUNC VOID Info_Mod_MIL_6_Pickpocket_BACK()
{
Info_ClearChoices (Info_Mod_MIL_6_Pickpocket);
};
FUNC VOID Info_Mod_MIL_6_Pickpocket_DoIt()
{
if (B_Beklauen() == TRUE)
{
Info_ClearChoices (Info_Mod_MIL_6_Pickpocket);
}
else
{
Info_ClearChoices (Info_Mod_MIL_6_Pickpocket);
Info_AddChoice (Info_Mod_MIL_6_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_MIL_6_Pickpocket_Beschimpfen);
Info_AddChoice (Info_Mod_MIL_6_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_MIL_6_Pickpocket_Bestechung);
Info_AddChoice (Info_Mod_MIL_6_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_MIL_6_Pickpocket_Herausreden);
};
};
FUNC VOID Info_Mod_MIL_6_Pickpocket_Beschimpfen()
{
B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN");
B_Say (self, hero, "$DIRTYTHIEF");
Info_ClearChoices (Info_Mod_MIL_6_Pickpocket);
AI_StopProcessInfos (self);
B_Attack (self, hero, AR_Theft, 1);
};
FUNC VOID Info_Mod_MIL_6_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_MIL_6_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_MIL_6_Pickpocket);
AI_StopProcessInfos (self);
};
};
FUNC VOID Info_Mod_MIL_6_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_MIL_6_Pickpocket);
}
else
{
B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02");
};
};
// *************************************************************************
// -------------------------------------------------------------------------
FUNC VOID B_AssignAmbientInfos_MIL_6 (var c_NPC slf)
{
DIA_MIL_6_EXIT.npc = Hlp_GetInstanceID(slf);
DIA_MIL_6_JOIN.npc = Hlp_GetInstanceID(slf);
DIA_MIL_6_PEOPLE.npc = Hlp_GetInstanceID(slf);
DIA_MIL_6_LOCATION.npc = Hlp_GetInstanceID(slf);
Info_Mod_MIL_6_Pickpocket.npc = Hlp_GetInstanceID(slf);
};
|
D
|
/*
* This file is part of serpent.
*
* Copyright © 2019-2020 Lispy Snake, Ltd.
*
* 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.
*/
module serpent.ecs.entitymanager;
import serpent.ecs.archetype;
import serpent.ecs.entity;
import serpent.ecs.component;
import serpent.ecs.componentmanifest;
import serpent.ecs.greedyarray;
import serpent.ecs.signature;
import serpent.ecs.storage;
import serpent.ecs.view;
import std.exception : enforce;
import std.string : format;
import core.sync.mutex : Mutex;
/**
* The EntityManager is responsible for an entire 'world view'. It is where
* all entities are created and manipulated, along with managing the component
* and archetype storage.
*
* Components must be registered with the EntityManager to preallocate the
* storage capacity. The system is flexible allowing an unspecified number
* of components. However, it makes sense to keep component numbers lower to
* help with more explicit taxonomy of entities through the composed
* archetypes. This in turn helps with performance.
*
* To get started with the EntityManager, register some components with it
* and then manipulate it via the View APIs.
*/
final class EntityManager
{
private:
GreedyArray!ComponentManifest _components;
int minSize = 0; /* Minimum entity count */
int maxSize = 0; /* Maximum entity count */
EntityID _lastID = 0;
shared Mutex idMutex;
/* We store everything into an archetype. Potentially turn into array */
Archetype*[] archetypes;
/* When assigning new components from a view, stage values here for copy */
Archetype* stagingArchetype;
/* Stash of removals */
ComponentRemoval[] removalRequests;
shared Mutex removalMutex;
/* Stash of additions */
EntityID[] assignmentRequests;
shared Mutex assignmentMutex;
EntityID lastStaged = 0;
/* Freeing entities */
EntityID[] freeIDs;
EntityID[] killRequests;
shared Mutex killMutex;
bool _built = false;
private:
/**
* Compute archetype for the given Entity
*/
final Signature computeSignature(EntityID id) @safe nothrow
{
import std.range;
import std.algorithm;
/* Sort by highest indexes to allow implicit grouping of similar buckets */
auto components = _components.data.filter!(a => a.joined(id)).array()
.sort!((a, b) => (a.index > b.index))
.map!((a) => a.index)();
return Signature(components.array);
}
/**
* Return an array of manifest instances
*/
final ComponentManifest*[] computeManifests(in ref Signature s) @trusted nothrow
{
import std.algorithm;
import std.range;
return s.components
.filter!((a) => a != 0)
.map!((a) => &_components[a - 1])
.array();
}
/**
* Construct the staging archetype where we copy from
*/
final void constructStagingArchetype() @trusted
{
import std.algorithm;
import std.range;
auto components = _components.data.array().sort!((a, b) => (a.index > b.index))
.map!((a) => a.index)();
auto signature = Signature(components.array);
import std.stdio;
stagingArchetype = new Archetype(signature, computeManifests(signature));
}
/**
* Update the archetype for the given entity.
*/
final void updateArchetype(EntityID id, bool allowNewArchetype = true, bool killData = false) @trusted
{
auto newSignature = computeSignature(id);
Archetype* oldArchetype = null;
Archetype* newArchetype = null;
foreach (ref archetype; archetypes)
{
if (archetype.hasEntity(id))
{
oldArchetype = archetype;
}
else if (allowNewArchetype && archetype.satisfiesEntity(newSignature))
{
newArchetype = archetype;
}
}
/* Nothing to do - still compatible. */
if (oldArchetype !is null && oldArchetype.satisfiesEntity(newSignature))
{
return;
}
/* Got a new archetype to create */
if (newArchetype is null && allowNewArchetype)
{
auto manifests = computeManifests(newSignature);
auto archetype = new Archetype(newSignature, manifests);
archetypes ~= archetype;
newArchetype = archetype;
}
/* Take across from staging, never drop staging. */
if (stagingArchetype.hasEntity(id))
{
if (newArchetype !is null)
{
newArchetype.takeEntity(id, stagingArchetype);
}
stagingArchetype.dropEntity(id, killData);
return;
}
/* Take on the new entity now, copying data */
if (newArchetype !is null)
{
newArchetype.takeEntity(id, oldArchetype);
}
if (oldArchetype is null)
{
return;
}
/* Drop from old archetype, losing data */
oldArchetype.dropEntity(id, killData);
if (!oldArchetype.empty())
{
return;
}
import std.algorithm.mutation : remove;
archetypes = archetypes.remove!(a => a == oldArchetype);
oldArchetype.close();
oldArchetype.destroy();
}
/**
* Find parent archetpye of an entity
*
* May be NULL for new entities.
*/
final Archetype* findArchetype(EntityID ent) @trusted
{
foreach (ref arche; archetypes)
{
if (arche.hasEntity(ent))
{
return arche;
}
}
return null;
}
/**
* Update components in batch.
*/
final void setComponents(C...)(EntityID ent) @safe
{
foreach (c; C)
{
static assert(isValidComponent!c);
static assert(!is(C == EntityIdentifier), "Cannot manually register EntityIdentifier");
assert(isRegistered!c, "setComponents: Unknown component %s".format(c.stringof));
auto idx = getComponentID!c - 1;
_components[idx].join(ent);
assert(_components[idx].joined(ent));
}
setInternalComponent(ent);
updateArchetype(ent);
}
final void setInternalComponent(EntityID ent) @safe nothrow
{
/* Register for EntityID. The Archetype is responsible for cloning this */
auto idx = getComponentID!EntityIdentifier - 1;
_components[idx].join(ent);
assert(_components[idx].joined(ent));
}
/**
* Verify that a component has been registered
*/
final bool isRegisteredInternal(ulong index) @safe nothrow
{
auto idx = index - 1;
if (idx > _components.count || _components.count < 1)
{
return false;
}
return _components[idx].alive;
}
/**
* Perform any component removal required.
*/
final void processComponentRemovals() @safe
{
scope (exit)
{
removalMutex.unlock_nothrow();
}
removalMutex.lock_nothrow();
import std.algorithm;
if (removalRequests.length < 1)
{
return;
}
sort!((a, b) => a.entityID < b.entityID)(removalRequests);
EntityID curEntity = removalRequests[0].entityID;
EntityID lastEntity = 0;
/**
* This helper flushes the changes and assigns the archetype
* only once all component removals have been completed.
*/
void flushEntityComponentRemoval(EntityID id)
{
if (id == lastEntity)
{
return;
}
updateArchetype(id, true, true);
lastEntity = id;
}
/* Unjoin individual components */
void doEntityComponentRemoval(ComponentRemoval* removal)
{
assert(isRegisteredInternal(removal.componentID),
"removeComponent: Unknown component %d".format(removal.componentID));
auto idx = removal.componentID - 1;
assert(_components[idx].joined(removal.entityID),
"removeComponent: Entity not joined to %d".format(removal.componentID));
_components[idx].unjoin(removal.entityID);
}
/**
* Step through all removal requests, flush when entity ID changes
* This help minimize the reconstruction of archetypes as much as
* possible until fluctuations stop.
*/
foreach (i; 0 .. removalRequests.length)
{
auto item = &removalRequests[i];
if (item.entityID != curEntity)
{
flushEntityComponentRemoval(curEntity);
curEntity = item.entityID;
}
doEntityComponentRemoval(item);
}
flushEntityComponentRemoval(curEntity);
/* all done */
removalRequests = [];
}
/**
* Perform any component assignment required
*/
final void processComponentAssignments() @safe
{
scope (exit)
{
assignmentMutex.unlock_nothrow();
}
assignmentMutex.lock_nothrow();
foreach (ref id; assignmentRequests)
{
updateArchetype(id);
}
if (lastStaged != 0)
{
updateArchetype(lastStaged);
lastStaged = 0;
}
assignmentRequests = [];
}
/**
* Process any kills
*/
final void processEntityKills() @safe
{
scope (exit)
{
killMutex.unlock_nothrow();
idMutex.unlock_nothrow();
}
killMutex.lock_nothrow();
idMutex.lock_nothrow();
/* Remove from all archetypes + components */
foreach (kill; killRequests)
{
/* Unregister from all manifests */
foreach (ref manifest; _components.data)
{
manifest.unjoin(kill);
}
updateArchetype(kill, false, true);
freeIDs ~= kill;
}
/* Reset kill list */
killRequests = [];
}
public:
/**
* Construct a new EntityManager
*/
this()
{
/* Empty component array */
_components = GreedyArray!ComponentManifest(0, 0);
/* Reserve the EntityIdentifier */
registerComponent!EntityIdentifier;
/* TODO: Atomically increment the new ID? */
idMutex = new shared Mutex();
/* Mutability issues */
removalMutex = new shared Mutex();
assignmentMutex = new shared Mutex();
/* Killing */
killMutex = new shared Mutex();
}
/**
* Destroy the engine
*/
~this()
{
clear();
}
/**
* Internal factory
*/
final EntityID createInternal() @safe
{
/* Ensure we're built before giving out entity IDs */
if (!_built)
{
build();
}
/* Attempt to recycle old ID first */
if (freeIDs.length > 0)
{
import std.algorithm.mutation : remove;
auto freeID = freeIDs[0];
freeIDs = freeIDs.remove!(a => a == freeID);
return freeID;
}
return ++_lastID;
}
/**
* Create a new entity with no components
*/
final EntityID create() @safe
{
scope (exit)
{
idMutex.unlock_nothrow();
}
idMutex.lock_nothrow();
auto e = createInternal();
setInternalComponent(e);
/* We used to allocate an EntityIdentifier archetype for
* componentless entities but that massively impacted
* performance.
*/
//updateArchetype(e);
return e;
}
/**
* Create a new entity with explicit components
* It will automatically be shifted into an appropriate archetype
*/
final EntityID createWithComponents(C...)() @safe
{
scope (exit)
{
idMutex.unlock_nothrow();
}
idMutex.lock_nothrow();
auto e = createInternal();
setInternalComponent(e);
setComponents!C(e);
updateArchetype(e);
return e;
}
/**
* Kill a previously known entity
*/
final void kill(EntityID entity) @safe nothrow
{
scope (exit)
{
killMutex.unlock_nothrow();
}
killMutex.lock_nothrow();
killRequests ~= entity;
}
/**
* Must be called before the EntityManager is usable, i.e. all registrations
* have completed.
*/
final void build() @safe
{
scope (exit)
{
removalMutex.unlock_nothrow();
assignmentMutex.unlock_nothrow();
idMutex.unlock_nothrow();
}
removalMutex.lock_nothrow();
assignmentMutex.lock_nothrow();
idMutex.lock_nothrow();
if (_built)
{
return;
}
constructStagingArchetype();
_built = true;
}
/**
* Return true if this EntityManager has been built
*/
final pure @property bool built() @safe @nogc nothrow
{
return _built;
}
/**
* Perform one step of the engine
*/
final void step() @safe
{
assert(_built == true, "Cannot use EntityManager before it is built");
processComponentRemovals();
processComponentAssignments();
processEntityKills();
}
/**
* Attempt to register the component if not already registered
*/
final void tryRegisterComponent(C)() @safe
{
static assert(isValidComponent!C);
if (isRegistered!C)
{
return;
}
registerComponent!C;
}
/**
* Attempt to register the component
*
* This is important so that we have sufficient storage ahead of time
* for entities within components.
*/
final void registerComponent(C)() @safe
{
static assert(isValidComponent!C);
assert(!isRegistered!C, "Cannot re-register component %s".format(C.stringof));
assert(!built, "Cannot register component with built EntityManager");
auto idx = getComponentID!C - 1;
/* Sort out the component */
_components[idx] = ComponentManifest(idx + 1, C.stringof, minSize, maxSize);
auto alloc = new PoolAllocator!C(minSize, maxSize);
_components[idx].pool!C = alloc;
_components[idx].allocateChunk = &_components[idx].pool!C.allocateChunk;
/**
* Internal helper for inserting a row
*/
void* insertHelper(void* blob, out ulong idx) @trusted nothrow
{
auto realBlob = cast(StorageChunk!C*) blob;
return realBlob.insertRow(idx);
}
/* Clone from one archetype to another */
void cloneHelper(void* source, ulong sourceIndex, void* target, ulong targetIndex) @trusted nothrow
{
StorageChunk!C* sourceBlob = cast(StorageChunk!C*) source;
StorageChunk!C* targetBlob = cast(StorageChunk!C*) target;
targetBlob.buffer[targetIndex] = sourceBlob.buffer[sourceIndex];
}
/* Remove from an archetype */
void removeHelper(void* source, ulong index, bool killData) @trusted
{
StorageChunk!C* blob = cast(StorageChunk!C*) source;
serpentComponent tag = getComponentUDA!C;
if (killData && tag.deallocate !is null)
{
tag.deallocate(&blob.buffer[index]);
}
blob.removeRow(index);
}
/* Deallocate underlying data */
void deallocateHelper(void* chunk, bool killData) @trusted
{
StorageChunk!C* blob = cast(StorageChunk!C*) chunk;
serpentComponent tag = getComponentUDA!C;
if (killData && tag.deallocate !is null)
{
foreach (idx; 0 .. blob.numElements)
{
tag.deallocate(&blob.buffer[idx]);
}
}
_components[idx].pool!C.deallocateChunk(blob);
}
_components[idx].deallocateChunk = &deallocateHelper;
_components[idx].cloneRow = &cloneHelper;
_components[idx].insertRow = &insertHelper;
_components[idx].removeRow = &removeHelper;
_components[idx].maxElements = StorageChunk!C.maxElements;
_components[idx].alive = true;
}
/**
* Add a component to the entity with default data
* Return a pointer to the component
*/
final C* addComponent(C)(EntityID ent) @safe
{
return addComponent!C(ent, C.init);
}
/**
* Add a component to entity with data by value
* Return a pointer to the component
*/
final C* addComponent(C)(EntityID ent, C data) @safe
{
return addComponent!C(ent, data);
}
/**
* Add a component to entity with data by reference
* Return a pointer to the component
*/
final C* addComponent(C)(EntityID ent, ref C data) @safe
{
static assert(isValidComponent!C);
assert(isRegistered!C, "addComponent: Unknown component %s".format(C.stringof));
auto idx = getComponentID!C - 1;
_components[idx].join(ent);
assert(_components[idx].joined(ent));
updateArchetype(ent);
C* datum = dataRW!C(ent);
*datum = data;
return datum;
}
/**
* Remove a component from the given entity
*/
final void removeComponent(C)(EntityID ent) @safe
{
static assert(isValidComponent!C);
static assert(!(is(C == EntityIdentifier)), "Cannot remove EntityIdentifier component");
assert(isRegistered!C, "removeComponent: Unknown component %s".format(C.stringof));
assert(built, "Can only remove component from built EntityManager");
auto idx = getComponentID!C - 1;
_components[idx].unjoin(ent);
updateArchetype(ent, true, true);
}
/**
* Return true if the entity has the component
*/
final bool hasComponent(C)(EntityID ent) @safe nothrow
{
static assert(isValidComponent!C);
auto idx = getComponentID!C - 1;
return _components[idx].joined(ent);
}
/**
* Verify that a component has been registered
*/
pragma(inline, true) final bool isRegistered(C)() @safe nothrow
{
static assert(isValidComponent!C);
return isRegisteredInternal(getComponentID!C);
}
/**
* Return all matching entities as a tuple of (ent, C...) whose
* components contain at least all of those in C.
*
* This is a read-write query.
*/
final auto withComponentsRW(C...)() @safe
{
static assert(C.length <= 5,
"withComponentsRW: Maximum of 5 components supported in signature");
static assert(C.length > 0,
"withComponentsRW: Minimum of 1 component required in signature");
assert(_built == true, "Cannot use EntityManager before it is built");
ulong[C.length] indices = 0;
static foreach (i, c; C)
{
static assert(isValidComponent!c);
assert(isRegistered!c, "withComponentsRW: Unknown component %s".format(c.stringof));
indices[i] = getComponentID!c;
}
auto sig = Signature(indices);
import std.algorithm;
import std.range : chain;
return archetypes.filter!((a) => a.satisfies(sig))
.map!((b) => b.rangedRW!C())
.joiner();
}
/**
* Return all matching entities as a tuple of (ent, C...) whose
* components contain at least all of those in C.
*
* This is a read-only query.
*/
final auto withComponentsRO(C...)() @safe
{
static assert(C.length <= 5,
"withComponentsRO: Maximum of 5 components supported in signature");
static assert(C.length > 0,
"withComponentsRO: Minimum of 1 component required in signature");
assert(_built == true, "Cannot use EntityManager before it is built");
ulong[C.length] indices = 0;
static foreach (i, c; C)
{
static assert(isValidComponent!c);
assert(isRegistered!c, "withComponentsRO: Unknown component %s".format(c.stringof));
indices[i] = getComponentID!c;
}
auto sig = Signature(indices);
import std.algorithm;
import std.range : chain;
return archetypes.filter!((a) => a.satisfies(sig))
.map!((b) => b.rangedRO!C())
.joiner();
}
/**
* Return a set of ranges across all matching chunks and archetypes
* which internally are composed of tuples containing (ent, C...)
*
* This allows for parallel processing in chunks to match the internal
* system layout.
*
* This is a read-write query.
*/
final auto withComponentsChunkedRW(C...)() @safe
{
static assert(C.length <= 5,
"withComponentsRW: Maximum of 5 components supported in signature");
static assert(C.length > 0,
"withComponentsRW: Minimum of 1 component required in signature");
assert(_built == true, "Cannot use EntityManager before it is built");
ulong[C.length] indices = 0;
static foreach (i, c; C)
{
static assert(isValidComponent!c);
assert(isRegistered!c, "withComponentsRW: Unknown component %s".format(c.stringof));
indices[i] = getComponentID!c;
}
auto sig = Signature(indices);
import std.algorithm;
import std.range : chain;
return archetypes.filter!((a) => a.satisfies(sig))
.map!((b) => b.chunkRangedRW!C())
.joiner();
}
/**
* Return a set of ranges across all matching chunks and archetypes
* which internally are composed of tuples containing (ent, C...)
*
* This allows for parallel processing in chunks to match the internal
* system layout.
*
* This is a read-only query.
*/
final auto withComponentsChunkedRO(C...)() @safe
{
static assert(C.length <= 5,
"withComponentsRO: Maximum of 5 components supported in signature");
static assert(C.length > 0,
"withComponentsRO: Minimum of 1 component required in signature");
assert(_built == true, "Cannot use EntityManager before it is built");
ulong[C.length] indices = 0;
static foreach (i, c; C)
{
static assert(isValidComponent!c);
assert(isRegistered!c, "withComponentsRO: Unknown component %s".format(c.stringof));
indices[i] = getComponentID!c;
}
auto sig = Signature(indices);
import std.algorithm;
import std.range : chain;
return archetypes.filter!((a) => a.satisfies(sig))
.map!((b) => b.chunkRangedRO!C())
.joiner();
}
/**
* Get read-write version of the data.
*/
final C* dataRW(C)(EntityID id) @safe
{
assert(isRegistered!C, "Unknown component %s".format(C.stringof));
assert(_built == true, "Cannot use EntityManager before it is built");
auto idx = getComponentID!C - 1;
auto comp = _components[idx];
assert(hasComponent!C(id),
"getComponentData: Entity %d not registered with %s".format(id, C.stringof));
auto archetype = findArchetype(id);
return archetype.getChunkedComponentData!C(comp, id);
}
/**
* Return read-only copy of the data
*/
final const(C*) dataRO(C)(EntityID id) @safe
{
return cast(const C*) dataRW!C(id);
}
/**
* Completely reset the world, deallocating all archetypes and
* entities.
*/
final void clear() @safe
{
scope (exit)
{
removalMutex.unlock_nothrow();
assignmentMutex.unlock_nothrow();
idMutex.unlock_nothrow();
}
removalMutex.lock_nothrow();
assignmentMutex.lock_nothrow();
idMutex.lock_nothrow();
foreach (ref archetype; archetypes)
{
archetype.close(true);
archetype.destroy();
}
archetypes = [];
removalRequests = [];
assignmentRequests = [];
killRequests = [];
lastStaged = 0;
_lastID = 0;
freeIDs = [];
stagingArchetype.close(true);
stagingArchetype.destroy();
constructStagingArchetype();
foreach (ref manifest; _components.data)
{
manifest.clear();
}
_built = false;
}
package:
/**
* Helpers for the View API
*/
final void pushComponentRemoval(ComponentRemoval removal) @safe
{
scope (exit)
{
removalMutex.unlock_nothrow();
}
removalMutex.lock_nothrow();
removalRequests ~= removal;
}
/**
* Stage a copy of the entity into staging archetype, and assign new
* component data to it.
*
* On the next execution frame, the archetype of the entity will be
* updated.
*
* Due to this nature, we must lock to ensure we get the right copy.
*/
final void stageComponentAssignment(C)(EntityID id, ref C datum) @safe
{
static assert(isValidComponent!C);
assert(isRegistered!C, "addComponent: Unknown component %s".format(C.stringof));
scope (exit)
{
assignmentMutex.unlock_nothrow();
}
assignmentMutex.lock_nothrow();
import std.stdio;
auto idx = getComponentID!C - 1;
auto comp = _components[idx];
assert(!_components[idx].joined(id),
"Already registered to component %s".format(C.stringof));
_components[idx].join(id);
/* Flush last staged component assignments */
if (id != lastStaged && lastStaged != 0)
{
assignmentRequests ~= lastStaged;
}
lastStaged = id;
/* Put it into staging. Should probably cache archetype too */
if (!stagingArchetype.hasEntity(id))
{
stagingArchetype.takeEntity(id, findArchetype(id));
}
stagingArchetype.setChunkedComponentData!C(comp, id, datum);
}
}
|
D
|
a sudden occurrence (or recurrence) of a disease
|
D
|
/**
* Windows API header module
*
* Translated from MinGW Windows headers
*
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(DRUNTIMESRC src/core/sys/windows/_wincon.d)
*/
module core.sys.windows.wincon;
version (Windows):
version (ANSI) {} else version = Unicode;
pragma(lib, "kernel32");
private import core.sys.windows.w32api, core.sys.windows.windef;
// FIXME: clean up Windows version support
enum {
FOREGROUND_BLUE = 1,
FOREGROUND_GREEN = 2,
FOREGROUND_RED = 4,
FOREGROUND_INTENSITY = 8,
BACKGROUND_BLUE = 16,
BACKGROUND_GREEN = 32,
BACKGROUND_RED = 64,
BACKGROUND_INTENSITY = 128
}
static if (_WIN32_WINNT >= 0x501) {
enum {
CONSOLE_FULLSCREEN_MODE = 1,
CONSOLE_WINDOWED_MODE = 0
}
}
enum {
CTRL_C_EVENT = 0,
CTRL_BREAK_EVENT = 1,
CTRL_CLOSE_EVENT = 2,
CTRL_LOGOFF_EVENT = 5,
CTRL_SHUTDOWN_EVENT = 6
}
enum {
ENABLE_PROCESSED_INPUT = 1,
ENABLE_LINE_INPUT = 2,
ENABLE_ECHO_INPUT = 4,
ENABLE_WINDOW_INPUT = 8,
ENABLE_MOUSE_INPUT = 16
}
enum {
ENABLE_PROCESSED_OUTPUT = 1,
ENABLE_WRAP_AT_EOL_OUTPUT = 2
}
enum {
KEY_EVENT = 1,
MOUSE_EVENT = 2,
WINDOW_BUFFER_SIZE_EVENT = 4,
MENU_EVENT = 8,
FOCUS_EVENT = 16
}
enum {
RIGHT_ALT_PRESSED = 1,
LEFT_ALT_PRESSED = 2,
RIGHT_CTRL_PRESSED = 4,
LEFT_CTRL_PRESSED = 8,
SHIFT_PRESSED = 16,
NUMLOCK_ON = 32,
SCROLLLOCK_ON = 64,
CAPSLOCK_ON = 128,
ENHANCED_KEY = 256
}
enum {
FROM_LEFT_1ST_BUTTON_PRESSED = 1,
RIGHTMOST_BUTTON_PRESSED = 2,
FROM_LEFT_2ND_BUTTON_PRESSED = 4,
FROM_LEFT_3RD_BUTTON_PRESSED = 8,
FROM_LEFT_4TH_BUTTON_PRESSED = 16
}
enum {
MOUSE_MOVED = 1,
DOUBLE_CLICK = 2,
MOUSE_WHEELED = 4
}
struct CHAR_INFO {
union _Char {
WCHAR UnicodeChar;
CHAR AsciiChar;
}
union {
_Char Char;
WCHAR UnicodeChar;
CHAR AsciiChar;
}
WORD Attributes;
}
alias CHAR_INFO* PCHAR_INFO;
struct SMALL_RECT {
SHORT Left;
SHORT Top;
SHORT Right;
SHORT Bottom;
}
alias SMALL_RECT* PSMALL_RECT;
struct CONSOLE_CURSOR_INFO {
DWORD dwSize;
BOOL bVisible;
}
alias CONSOLE_CURSOR_INFO* PCONSOLE_CURSOR_INFO;
struct COORD {
SHORT X;
SHORT Y;
}
alias COORD* PCOORD;
struct CONSOLE_FONT_INFO {
DWORD nFont;
COORD dwFontSize;
}
alias CONSOLE_FONT_INFO* PCONSOLE_FONT_INFO;
struct CONSOLE_SCREEN_BUFFER_INFO {
COORD dwSize;
COORD dwCursorPosition;
WORD wAttributes;
SMALL_RECT srWindow;
COORD dwMaximumWindowSize;
}
alias CONSOLE_SCREEN_BUFFER_INFO* PCONSOLE_SCREEN_BUFFER_INFO;
alias extern(Windows) BOOL function(DWORD) nothrow PHANDLER_ROUTINE;
struct KEY_EVENT_RECORD {
BOOL bKeyDown;
WORD wRepeatCount;
WORD wVirtualKeyCode;
WORD wVirtualScanCode;
union _uChar {
WCHAR UnicodeChar;
CHAR AsciiChar;
}
union {
WCHAR UnicodeChar;
CHAR AsciiChar;
_uChar uChar;
}
DWORD dwControlKeyState;
}
alias KEY_EVENT_RECORD* PKEY_EVENT_RECORD;
struct MOUSE_EVENT_RECORD {
COORD dwMousePosition;
DWORD dwButtonState;
DWORD dwControlKeyState;
DWORD dwEventFlags;
}
alias MOUSE_EVENT_RECORD* PMOUSE_EVENT_RECORD;
struct WINDOW_BUFFER_SIZE_RECORD {
COORD dwSize;
}
alias WINDOW_BUFFER_SIZE_RECORD* PWINDOW_BUFFER_SIZE_RECORD;
struct MENU_EVENT_RECORD {
UINT dwCommandId;
}
alias MENU_EVENT_RECORD* PMENU_EVENT_RECORD;
struct FOCUS_EVENT_RECORD {
BOOL bSetFocus;
}
alias FOCUS_EVENT_RECORD* PFOCUS_EVENT_RECORD;
struct INPUT_RECORD {
WORD EventType;
union _Event {
KEY_EVENT_RECORD KeyEvent;
MOUSE_EVENT_RECORD MouseEvent;
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
MENU_EVENT_RECORD MenuEvent;
FOCUS_EVENT_RECORD FocusEvent;
}
union {
KEY_EVENT_RECORD KeyEvent;
MOUSE_EVENT_RECORD MouseEvent;
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
MENU_EVENT_RECORD MenuEvent;
FOCUS_EVENT_RECORD FocusEvent;
_Event Event;
}
}
alias INPUT_RECORD* PINPUT_RECORD;
extern (Windows) nothrow @nogc:
BOOL AllocConsole();
HANDLE CreateConsoleScreenBuffer(DWORD, DWORD, const(SECURITY_ATTRIBUTES)*, DWORD, LPVOID);
BOOL FillConsoleOutputAttribute(HANDLE, WORD, DWORD, COORD, PDWORD);
BOOL FillConsoleOutputCharacterA(HANDLE, CHAR, DWORD, COORD, PDWORD);
BOOL FillConsoleOutputCharacterW(HANDLE, WCHAR, DWORD, COORD, PDWORD);
BOOL FlushConsoleInputBuffer(HANDLE);
BOOL FreeConsole();
BOOL GenerateConsoleCtrlEvent(DWORD, DWORD);
UINT GetConsoleCP();
BOOL GetConsoleCursorInfo(HANDLE, PCONSOLE_CURSOR_INFO);
BOOL GetConsoleMode(HANDLE,PDWORD);
UINT GetConsoleOutputCP();
BOOL GetConsoleScreenBufferInfo(HANDLE, PCONSOLE_SCREEN_BUFFER_INFO);
DWORD GetConsoleTitleA(LPSTR, DWORD);
DWORD GetConsoleTitleW(LPWSTR, DWORD);
COORD GetLargestConsoleWindowSize(HANDLE);
BOOL GetNumberOfConsoleInputEvents(HANDLE, PDWORD);
BOOL GetNumberOfConsoleMouseButtons(PDWORD);
BOOL PeekConsoleInputA(HANDLE, PINPUT_RECORD, DWORD, PDWORD);
BOOL PeekConsoleInputW(HANDLE, PINPUT_RECORD, DWORD, PDWORD);
BOOL ReadConsoleA(HANDLE, PVOID, DWORD, PDWORD, PVOID);
BOOL ReadConsoleW(HANDLE, PVOID, DWORD, PDWORD, PVOID);
BOOL ReadConsoleInputA(HANDLE, PINPUT_RECORD, DWORD, PDWORD);
BOOL ReadConsoleInputW(HANDLE, PINPUT_RECORD, DWORD, PDWORD);
BOOL ReadConsoleOutputAttribute(HANDLE, LPWORD, DWORD, COORD, LPDWORD);
BOOL ReadConsoleOutputCharacterA(HANDLE, LPSTR, DWORD, COORD, PDWORD);
BOOL ReadConsoleOutputCharacterW(HANDLE, LPWSTR, DWORD, COORD, PDWORD);
BOOL ReadConsoleOutputA(HANDLE, PCHAR_INFO, COORD, COORD, PSMALL_RECT);
BOOL ReadConsoleOutputW(HANDLE, PCHAR_INFO, COORD, COORD, PSMALL_RECT);
BOOL ScrollConsoleScreenBufferA(HANDLE, const(SMALL_RECT)*, const(SMALL_RECT)*, COORD, const(CHAR_INFO)*);
BOOL ScrollConsoleScreenBufferW(HANDLE, const(SMALL_RECT)*, const(SMALL_RECT)*, COORD, const(CHAR_INFO)*);
BOOL SetConsoleActiveScreenBuffer(HANDLE);
BOOL SetConsoleCP(UINT);
BOOL SetConsoleCtrlHandler(PHANDLER_ROUTINE, BOOL);
BOOL SetConsoleCursorInfo(HANDLE, const(CONSOLE_CURSOR_INFO)*);
BOOL SetConsoleCursorPosition(HANDLE, COORD);
static if (_WIN32_WINNT >= 0x500) {
BOOL GetConsoleDisplayMode(LPDWORD);
HWND GetConsoleWindow();
}
static if (_WIN32_WINNT >= 0x501) {
BOOL AttachConsole(DWORD);
BOOL SetConsoleDisplayMode(HANDLE, DWORD, PCOORD);
enum DWORD ATTACH_PARENT_PROCESS = cast(DWORD)-1;
}
BOOL SetConsoleMode(HANDLE, DWORD);
BOOL SetConsoleOutputCP(UINT);
BOOL SetConsoleScreenBufferSize(HANDLE, COORD);
BOOL SetConsoleTextAttribute(HANDLE, WORD);
BOOL SetConsoleTitleA(LPCSTR);
BOOL SetConsoleTitleW(LPCWSTR);
BOOL SetConsoleWindowInfo(HANDLE, BOOL, const(SMALL_RECT)*);
BOOL WriteConsoleA(HANDLE, PCVOID, DWORD, PDWORD, PVOID);
BOOL WriteConsoleW(HANDLE, PCVOID, DWORD, PDWORD, PVOID);
BOOL WriteConsoleInputA(HANDLE, const(INPUT_RECORD)*, DWORD, PDWORD);
BOOL WriteConsoleInputW(HANDLE, const(INPUT_RECORD)*, DWORD, PDWORD);
BOOL WriteConsoleOutputA(HANDLE, const(CHAR_INFO)*, COORD, COORD, PSMALL_RECT);
BOOL WriteConsoleOutputW(HANDLE, const(CHAR_INFO)*, COORD, COORD, PSMALL_RECT);
BOOL WriteConsoleOutputAttribute(HANDLE, const(WORD)*, DWORD, COORD, PDWORD);
BOOL WriteConsoleOutputCharacterA(HANDLE, LPCSTR, DWORD, COORD, PDWORD);
BOOL WriteConsoleOutputCharacterW(HANDLE, LPCWSTR, DWORD, COORD, PDWORD);
version (Unicode) {
alias FillConsoleOutputCharacterW FillConsoleOutputCharacter;
alias GetConsoleTitleW GetConsoleTitle;
alias PeekConsoleInputW PeekConsoleInput;
alias ReadConsoleW ReadConsole;
alias ReadConsoleInputW ReadConsoleInput;
alias ReadConsoleOutputW ReadConsoleOutput;
alias ReadConsoleOutputCharacterW ReadConsoleOutputCharacter;
alias ScrollConsoleScreenBufferW ScrollConsoleScreenBuffer;
alias SetConsoleTitleW SetConsoleTitle;
alias WriteConsoleW WriteConsole;
alias WriteConsoleInputW WriteConsoleInput;
alias WriteConsoleOutputW WriteConsoleOutput;
alias WriteConsoleOutputCharacterW WriteConsoleOutputCharacter;
} else {
alias FillConsoleOutputCharacterA FillConsoleOutputCharacter;
alias GetConsoleTitleA GetConsoleTitle;
alias PeekConsoleInputA PeekConsoleInput;
alias ReadConsoleA ReadConsole;
alias ReadConsoleInputA ReadConsoleInput;
alias ReadConsoleOutputA ReadConsoleOutput;
alias ReadConsoleOutputCharacterA ReadConsoleOutputCharacter;
alias ScrollConsoleScreenBufferA ScrollConsoleScreenBuffer;
alias SetConsoleTitleA SetConsoleTitle;
alias WriteConsoleA WriteConsole;
alias WriteConsoleInputA WriteConsoleInput;
alias WriteConsoleOutputA WriteConsoleOutput;
alias WriteConsoleOutputCharacterA WriteConsoleOutputCharacter;
}
|
D
|
// Written in the D programming language
import std.stdio;
import std.string;
import std.array;
import std.variant;
import std.conv;
import std.getopt;
import std.ascii;
import env;
import buildData;
class symbol
{
string name;
this(string s){ name = s;}
override string toString(){
return name;
}
}
string str(bool b){
return b ? "#t" : "#f";
}
string str(long l){
return to!string(l);
}
string str(float f){
string s = to!string(f);
return (s.indexOf(".") != -1) ? s : s ~ ".0";
}
string str(string s){
return '"' ~ s ~ '"';
//return s;
}
string str(symbol s){
return s.name;
}
string strForm(Variant v){
if(v.type == typeid(bool)) return str(v.get!(bool));
if(v.type == typeid(long)) return str(v.get!(long));
if(v.type == typeid(float)) return str(v.get!(float));
if(v.type == typeid(string)) return str(v.get!(string));
if(v.type == typeid(symbol)) return str(v.get!(symbol));
if(v.type == typeid(expr[])) return (new expr(v)).toString();
return "bug in strForm()";
}
class listexpr : expr
{
this(expr[] e){
super(e);
}
override bool atomic(){
return true;
}
}
class nullexpr : expr
{
this(expr[] e){
super(e);
}
override bool atomic(){
return true;
}
override string toString(){
return "nil";
}
override string toStringNoTypes(){
return "nil";
}
}
class expr
{
Variant val;
this(Variant v){
val = v;
}
this(bool b){ val = b; }
this(string s){ val = s; }
this(long l){ val = l; }
this(float f){ val = f; }
this(expr[] e){ val = e; }
this(symbol s){ val = s; }
bool atomic(){
return val.type == typeid(bool) ||
val.type == typeid(long) ||
val.type == typeid(float) ||
val.type == typeid(string) ||
val.type == typeid(symbol);
}
override string toString()
{
if(atomic && val.type != typeid(expr[])){
if(types)
return strForm(val) ~ " (" ~ to!string(val.type)~")";
else
return strForm(val);
}
string s = "";
foreach(expr e; val.get!(expr[])){
if(e !is null)
s ~= e.toString() ~ " ";
else
s ~= "null ";
}
if(s.length != 0)
return "(" ~ s[0..$-1] ~ ")";
return "()";
}
string toStringNoTypes(){
if(atomic){
return strForm(val);
}
string s = "";
foreach(expr e; val.get!(expr[])){
s ~= e.toStringNoTypes() ~ " ";
}
if(s.length != 0)
return "(" ~ s[0..$-1] ~ ")";
return "()";
}
}
expr parseValue(string token){
if(token[0] == '"' && token[$-1] == '"'){
Variant e = token[1..$-1];
return new expr(e);
}
try{
Variant e = to!long(token);
return new expr(e);
}catch(ConvException e){}
try{
Variant e = to!float(token);
return new expr(e);
}catch(ConvException e){}
try{
Variant e = to!bool(token);
return new expr(e);
}catch(ConvException e){}
if(token == "nil") return new nullexpr(null);
Variant e = new symbol(token);
return new expr(e);
}
bool inStringLeft = false;
int countLeftParens(string s){
return countParens(s, '(', inStringLeft);
}
bool inStringRight = false;
int countRightParens(string s){
return countParens(s, ')', inStringRight);
}
int countParens(string s, char key, ref bool inString){
int n = 0;
foreach (char c; s){
if(c == '"'){
inString = !inString;
}
if(!inString && c == key) n++;
if(c == ';' && !inString) return n;
}
return n;
}
string tokenFormat(string s){
string ret = "";
bool inString = false;
for (int i = 0; i < s.length; i++){
if(s[i] == '"'){
inString = !inString;
ret ~= '"';
}
else if(!inString && s[i] == '(') ret ~= " ( ";
else if(!inString && s[i] == ')') ret ~= " ) ";
else if(!inString && i<s.length-1 && s[i]=='#' && s[i+1]=='t'){
ret~="true";
i++;
}
else if(!inString && i<s.length-1 && s[i]=='#' && s[i+1]=='f'){
ret~="false";
i++;
} else {
ret ~= s[i];
}
}
return ret;
}
string[] tokenSplit(string s){
s = tokenFormat(chomp(s));
if(s.length > 0 && s[0].isWhite()) s = s[1..$];
string[] list;
for(int i = 0; i < s.length; i++){
if(s[i] == '"'){
int start = i;
i += 1;
while(i < s.length && s[i] != '"'){ i++; }
if(i == s.length){
throw new Exception("Unterminated string");
}
list ~= s[start..i+1];
s = s[i+2..$];
i = -1;
continue;
}
if(s[i] == ';' || s[i] == '#'){
while(i < s.length && s[i] != '\n'){
i++;
}
if(i == s.length) s = [];
else s = s[i+1..$];
i = -1;
continue;
}
if(s[i].isWhite()){
while(s[i].isWhite() && i < s.length-1 && s[i+1].isWhite())
s = s[0..i] ~ s[i+1..$];
if(s[0..i] != "")
list ~= s[0..i];
s = s[i+1..$];
i = -1;
}
}
if(s != "") list ~= s;
return list;
}
string[] tokenize(File file){
string total;
int left = 0, right = 0;
string[] tokens;
while(!(file.eof() || (file == stdin && left == right && right != 0))){
string s = file.readln();
if(s.length>3 && (s[0..3]=="set" || s[0..3]=="run") && left==right){
tokens ~= s.split();
if(file == stdin) return tokens;
continue;
}
if(s == "\n" && file == stdin) return tokens;
left += countLeftParens(s);
right += countRightParens(s);
total ~= s;
}
tokens ~= tokenSplit(total);
foreach (int i, string s; tokens){
tokens[i] = s.replace("\\n", "\n").replace("\\t", "\t");
}
//writeln(tokens);
return tokens;
}
expr[] bubble(ref string[] tokens){
if(tokens.length == 0) throw new Exception("bubble() received an empty token array");
// eat the open paren
string token = tokens[0];
tokens.popFront();
expr[] tree;
while(tokens[0] != ")"){
expr e;
if(tokens[0] == "("){
expr[] l = bubble(tokens);
tree ~= new expr(l);
} else {
string t = tokens[0];
tokens.popFront();
tree ~= parseValue(t);
}
}
// eat the close paren
tokens.popFront();
return tree;
}
expr eval(expr tree, Env env){
if(tree is null) return new nullexpr(null);
if(tree.atomic){
if(tree.val.type == typeid(expr[])){
auto li = tree.val.get!(expr[]);
if(li.length > 0 && li[0].val.type != typeid(symbol))
return tree;
}
if(tree.val.type == typeid(symbol) && env.findFunction(tree.val.get!symbol) == null){
return eval(env.find(tree.val.get!symbol), env);
}
return tree;
} else {
expr[] e = tree.val.get!(expr[]);
if(e.length == 0) return new expr(cast(expr[]) []);
if(e[0].toStringNoTypes() == "if"){
expr exp = e[1];
expr res = e[2];
expr alt = e[3];
if(eval(exp, env).val != false)
return eval(res, env);
return eval(alt, env);
} else if(e[0].toStringNoTypes() == "cond"){
for(int i = 1; i < e.length; i++){
expr[] clause = e[i].val.get!(expr[]);
if(eval(clause[0], env).val != false){
return eval(clause[1], env);
}
}
throw new Exception("cond had no true clauses");
return null;
} else if(e[0].toStringNoTypes() == "define"){
env.addSymbol(e[1].val.get!symbol, eval(e[2],env));
//return env.find(e[1].val.get!symbol);
return null;
} else if(e[0].toStringNoTypes() == "suppress"){
eval(e[1], env);
return null;
} else if(e[0].toStringNoTypes() == "define-ref"){
env.addSymbol(e[1].val.get!symbol, e[2]);
return null;
} else if(e[0].toStringNoTypes() == "set!"){
return null;
} else if(e[0].toStringNoTypes() == "defun"){
return null;
} else if(e[0].toStringNoTypes() == "lambda"){
expr[] largnames = e[1].val.get!(expr[]);
expr lbody = e[2];
string lambdaname = "__lambda"~to!string(lambdaSerial++);
env.addDelegate(lambdaname, delegate expr(expr[] args, Env env){
Env newenv = new Env(env);
if(largnames.length != args.length)
throw new Exception("Arity mismatch: lambda function accepts " ~ to!string(largnames.length) ~ " arguments, but was given " ~ to!string(args.length) ~ "\nParameter list:" ~ to!string(largnames) ~ "\nGiven parameters:" ~ to!string(args));
foreach(int i, expr e; largnames){
newenv.addSymbol(e.val.get!symbol, args[i]);
}
return eval(lbody, newenv);
});
return new expr(new symbol(lambdaname));
} else if(e[0].toStringNoTypes() == "group"){
Env newenv = new Env(env);
for(int i = 1; i < e.length-1; i++){
eval(e[i], newenv);
}
return eval(e[$-1], newenv);
} else if(e.length == 3 && e[0].toStringNoTypes() == "set"){
if(e[1].toStringNoTypes() == "types"){
if(e[2].toStringNoTypes() == "on") types = true;
if(e[2].toStringNoTypes() == "off") types = false;
} else if(e[1].toStringNoTypes() == "pretty"){
if(e[2].toStringNoTypes() == "on") pretty = true;
if(e[2].toStringNoTypes() == "off") pretty = false;
} else if(e[1].toStringNoTypes() == "trace"){
if(e[2].toStringNoTypes() == "on") trace = true;
if(e[2].toStringNoTypes() == "off") trace = false;
} else {
writeln("REPL option not found: ", e[1].toStringNoTypes());
}
return null;
} else {
expr op = eval(e[0], env);
expr delegate(expr[], Env) f;
try {
f = env.findFunction(op.val.get!symbol);
} catch(Exception e){
throw new Exception(op.toString() ~ " is not a valid function");
}
if(f == null){
throw new Exception("No such function: " ~ to!string(op.val));
}
expr[] args = e[1..$].dup;
for(int i = 0; i < args.length; i++){
if(!args[i].atomic || args[i].val.type == typeid(symbol)){
args[i] = eval(args[i], env);
}
}
try {
return f(args, env);
} catch (Error err){
handleError(e[0], err);
throw err;
}
}
}
}
void writeTree(expr tree, int level = 0){
if(tree.atomic){
writeln(" ".replicate(level), tree.toString());
} else {
foreach(e; tree.val.get!(expr[])){
if(e.atomic){
writeln(" ".replicate(level), e.toString);
} else {
writeTree(e, level + 1);
}
}
}
}
void handleError(expr e, Error err){
if(trace){
writeln(e,": ", err);
} else {
writeln(e,": ",err.msg);
}
}
void handleException(Exception e){
if(trace){
writeln(e);
} else {
writeln(e.msg);
}
}
string[] preprocess(File f){
string[] tokens = tokenize(f);
for (int i = 0; i < tokens.length; i++){
if(tokens[i] == "run"){
try {
tokens =tokens[0..i] ~ preprocess(File(rootDir ~ tokens[i+1])) ~ tokens[i+2..$];
} catch(Exception e){
handleException(e);
return null;
}
}
}
return tokens;
}
void evalTokens(ref string[] tokens, Env env){
while(tokens.length != 0){
expr tree = new expr(bubble(tokens));
if(pretty){
writeTree(tree);
writeln("~".replicate(40));
}
try{
expr e = eval(tree, env);
//incredibly messy to avoid printing the results of
//functions that return null (eg print)
if(e !is null && (typeid(e) != typeid(listexpr) || ((e.val.get!(expr[]).length == 0) || (e.val.get!(expr[]).length > 0 && e.val.get!(expr[])[0] !is null)))){
writeln(e);
}
} catch(Exception ex){
handleException(ex);
} catch(Error err){
handleError(null, err);
}
}
}
void printInfo(){
writeln("DLisp beta, build ", buildData.buildID);
writeln("DMD version ", buildData.version_major, ".", buildData.version_minor);
}
bool types;
bool pretty;
bool trace;
long lambdaSerial;
string rootDir;
void main(string[] args)
{
string fname = "";
types = false;
pretty = false;
trace = false;
bool runstd = false;
rootDir = std.string.join(args[0].split("/")[0..$-2], "/") ~ "/";
bool printVersion = false;
getopt(args,
"f", &fname,
"types", &types,
"pretty", &pretty,
"trace", &trace,
"std", &runstd,
"version", &printVersion);
if(printVersion){
printInfo();
return;
}
if(fname == ""){
printInfo();
writeln("Root directory: ", rootDir);
}
Env env = new Env();
env.addBuiltins();
lambdaSerial = 0;
string[] tokens;
if(runstd){
tokens = preprocess(File(rootDir ~ "libs/libstd.lisp"));
while(tokens.length != 0){
evalTokens(tokens, env);
}
}
do {
if(fname != ""){
try {
File file = File(fname, "r");
tokens = preprocess(file);
file.close();
}
catch(Exception ex){
writeln("No such file: ", fname);
return;
}
} else {
write(": ");
tokens = preprocess(stdin);
if(stdin.eof()){
writeln();
return;
}
}
if(tokens.length == 0) continue;
evalTokens(tokens, env);
} while (fname == "");
}
|
D
|
func void ZS_ChallengeFans ()
{
if (GetTeam(self) != 0)
{
Npc_ExchangeRoutine(self,"challenge");
};
var string nearwp;
nearwp = Npc_GetNearestWP (self);
self.senses_range = 400;
//////////////////////////////////////////////////////////////////////////////////////////
// //PrintDebugNpc (PD_ZS_FRAME,"ZS_ChallengeFans");
// C_ZSInit ();
Npc_PercEnable (self, PERC_ASSESSDAMAGE , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSMAGIC , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSSURPRISE , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSENEMY , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSMURDER , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSDEFEAT , B_NoReact );
Npc_PercEnable (self, PERC_CATCHTHIEF , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSTALK , B_NoReact );
Npc_PercEnable (self, PERC_ASSESSFIGHTSOUND, B_NoReact);
// AI_RemoveWeapon (self);
AI_PlayAni (self, "T_STAND_2_WATCHFIGHT");
if(!Npc_IsOnFP(self,"FP_FAN"))
{
if (Wld_IsFPAvailable(self,"FP_FAN"))
{
AI_GotoFP (self, "FP_FAN");
};
};
};
func int ZS_ChallengeFans_Loop ()
{
if(Npc_GetDistToWP(self,self.wp)> 250)
{
AI_GotoWP (self, self.wp);
};
// var int addguardrnd;
// addguardrnd = Hlp_Random (100);
// var int spawntime;
// spawntime = Hlp_Random (10);
// //PrintDebugNpc (PD_ZS_LOOP, "ZS_WatchFight_Loop");
// if (Npc_GetStateTime (self) > spawntime*4)
// {
// if (guardsadded < maxguards - addguardrnd)
// {
// if (addguardrnd > 92)
// {
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// guardsadded = guardsadded + 6;
// }
// else if (addguardrnd > 78)
// {
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// guardsadded = guardsadded + 5;
// }
// else if (addguardrnd > 60)
// {
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// guardsadded = guardsadded + 4;
// }
// else if (addguardrnd > 45)
// {
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// guardsadded = guardsadded + 3;
// }
// else if (addguardrnd > 25)
// {
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// guardsadded = guardsadded + 2;
// }
// else
// {
// Wld_InsertNpc (GRD_2700_Gardist, "OW_OM_ENTRANCE05");
// guardsadded = guardsadded + 1;
// };
// AI_GotoWP (self,"OW_PATH_200");
// AI_StartState (self, ZS_ChallengeButch, 1, "");
// return 1;
// }
// else
// {
// return 1;
// };
// return 1;
// }
// else
// {
AI_Wait (self,5);
// };
/* if ((!Npc_IsDead(butch)||!Npc_IsDead(butch))&& Npc_IsDead(victim))
{
//PrintDebugNpc (PD_ZS_LOOP,"...Workaraound für nicht ankommende PERC_ASSESSMURDER!");
return LOOP_END;
B_Say (self, NULL, "$YeahWellDone");
};
if (Npc_IsInState(other, ZS_Unconscious) || Npc_IsInState(victim, ZS_Unconscious))
{
//PrintDebugNpc (PD_ZS_LOOP,"...Workaround für nicht ankommende PERC_ASSESSDEFEAT!");
return LOOP_END;
};
*/
if (Npc_IsInState(other,ZS_Attack) || Npc_IsInState (victim,ZS_Attack)) // ...wird noch gekämpft?
{
//PrintDebugNpc (PD_ZS_CHECK, "...es wird noch gekämpft!");
if ( (Npc_GetDistToNpc(self,other)<PERC_DIST_INTERMEDIAT) || (Npc_GetDistToNpc(self,victim)<PERC_DIST_INTERMEDIAT) )
{
//PrintDebugNpc (PD_ZS_CHECK, "...Kombatanten sind noch nah genug!");
//-------- Random Jubel --------
var int jubel;
jubel = Hlp_Random (100);
if ( jubel < 5) && (Npc_GetStateTime (self) < 3)
{
//PrintDebugNpc (PD_ZS_LOOP, "ZS_WatchFight_Loop // Fight in 10m range // cheer");
AI_TurnToNpc (self, victim);
B_Say (self, NULL, "$HEYHEYHEY");
return LOOP_CONTINUE;
};
//-------- Random Anim --------
var int anim;
anim = Hlp_Random (100);
if (anim < 5) { AI_TurnToNpc(self, victim); AI_PlayAni (self, "T_WATCHFIGHTRANDOM1"); }
else if (anim < 10) { AI_TurnToNpc(self, victim); AI_PlayAni (self, "T_WATCHFIGHTRANDOM2"); }
else if (anim < 15) { AI_TurnToNpc(self, victim); AI_PlayAni (self, "T_WATCHFIGHTRANDOM3"); }
else if (anim < 20) { AI_TurnToNpc(self, victim); AI_PlayAni (self, "T_WATCHFIGHTRANDOM4"); };
//-------- auf Distanz gehen/bleiben --------
if (Npc_GetDistToNpc(self, other) < PERC_DIST_WATCHFIGHT)
{
//PrintDebugNpc (PD_ZS_LOOP,"... zu nahe an 'other'!");
AI_TurnToNpc (self, other);
AI_Dodge (self);
return LOOP_CONTINUE;
}
else if (Npc_GetDistToNpc(self, victim) < PERC_DIST_WATCHFIGHT)
{
//PrintDebugNpc (PD_ZS_LOOP,"... zu nahe an 'other'!");
AI_TurnToNpc (self, victim);
AI_Dodge (self);
return LOOP_CONTINUE;
};
}
else
{
//PrintDebugNpc (PD_ZS_CHECK, "...Kombatanten sind zu weit weg!");
AI_TurnToNpc (self, victim);
AI_StartState (self, ZS_GotoFight, 0, "");
return LOOP_CONTINUE;
};
}
else
{
//PrintDebugNpc (PD_ZS_CHECK, "...es wird nicht mehr gekämpft!");
return LOOP_END;
};
AI_TurnToNpc (self, other);
return LOOP_CONTINUE;
};
func void ZS_ChallengeFans_End ()
{
//PrintDebugNpc (PD_ZS_FRAME, "ZS_WatchFight_End" );
Npc_ClearAIQueue (self); //MH: ggf. "Aufschaukler" killen (s. B_CheerFight)
AI_PlayAni (self, "T_WATCHFIGHT_2_STAND");
self.senses_range = hero.senses_range;
AI_ContinueRoutine (self);
};
|
D
|
/Users/admin/Documents/Being\ developed/CubManager/DerivedData/CubManager/Build/Intermediates.noindex/CubManager.build/Debug-iphonesimulator/CubManager.build/Objects-normal/x86_64/ViewController.o : /Users/admin/Documents/Being\ developed/CubManager/CubManager/SceneDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/AppDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/admin/Documents/Being\ developed/CubManager/DerivedData/CubManager/Build/Intermediates.noindex/CubManager.build/Debug-iphonesimulator/CubManager.build/Objects-normal/x86_64/ViewController~partial.swiftmodule : /Users/admin/Documents/Being\ developed/CubManager/CubManager/SceneDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/AppDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/admin/Documents/Being\ developed/CubManager/DerivedData/CubManager/Build/Intermediates.noindex/CubManager.build/Debug-iphonesimulator/CubManager.build/Objects-normal/x86_64/ViewController~partial.swiftdoc : /Users/admin/Documents/Being\ developed/CubManager/CubManager/SceneDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/AppDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
/Users/admin/Documents/Being\ developed/CubManager/DerivedData/CubManager/Build/Intermediates.noindex/CubManager.build/Debug-iphonesimulator/CubManager.build/Objects-normal/x86_64/ViewController~partial.swiftsourceinfo : /Users/admin/Documents/Being\ developed/CubManager/CubManager/SceneDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/AppDelegate.swift /Users/admin/Documents/Being\ developed/CubManager/CubManager/ViewController.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreLocation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/MapKit.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Combine.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/apinotes/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/MapKit.framework/Headers/MapKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
|
D
|
import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
import std.random;
import std.math;
import std.container;
import std.numeric;
import core.bitop;
void main() {
auto s = readln.split.map!(to!int);
auto N = s[0];
auto V = s[1];
auto Sc = s[2]-1;
auto Sr = s[3]-1;
auto Gc = s[4]-1;
auto Gr = s[5]-1;
auto B = iota(N).map!(_ => readln.split.map!(to!int).array).array;
auto dp = new int[][][](6000, N, N);
int[] dr = [0, 0, -1, 1];
int[] dc = [-1, 1, 0, 0];
int INF = 10^^9;
foreach (k; 0..6000)
foreach (i; 0..N)
foreach (j; 0..N)
dp[k][i][j] = (i == Sr && j == Sc) ? 0 : INF;
foreach (k; 1..6000)
foreach (i; 0..N)
foreach (j; 0..N) {
if (abs(Sr-i) + abs(Sc-j) > k) continue;
foreach (d; 0..4) {
auto nr = i + dr[d];
auto nc = j + dc[d];
if (nr >= 0 && nr < N && nc >= 0 && nc < N)
dp[k][i][j] = min(dp[k][i][j], dp[k-1][nr][nc]+B[i][j]);
}
}
foreach (k; 0..6000)
if (dp[k][Gr][Gc] < V) {
k.writeln;
return;
}
writeln(-1);
}
|
D
|
/*
Copyright (c) 2011-2020 Timur Gafarov
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/**
* Copyright: Timur Gafarov 2011-2020.
* License: $(LINK2 boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Timur Gafarov
*/
module dlib.geometry.intersection;
import std.math;
import dlib.math.vector;
import dlib.math.utils;
import dlib.math.transformation;
import dlib.geometry.sphere;
import dlib.geometry.plane;
import dlib.geometry.triangle;
import dlib.geometry.obb;
/// Stores intersection data
struct Intersection
{
bool fact = false;
Vector3f point;
Vector3f normal;
float penetrationDepth;
}
/// Checks two spheres for intersection
Intersection intrSphereVsSphere(ref Sphere sphere1, ref Sphere sphere2)
{
Intersection res;
res.fact = false;
float d = distance(sphere1.center, sphere2.center);
float sumradius = sphere1.radius + sphere2.radius;
if (d < sumradius)
{
res.penetrationDepth = sumradius - d;
res.normal = (sphere1.center - sphere2.center).normalized;
res.point = sphere2.center + res.normal * sphere2.radius;
res.fact = true;
}
return res;
}
/// Checks sphere and plane for intersection
Intersection intrSphereVsPlane(ref Sphere sphere, ref Plane plane)
{
Intersection res;
res.fact = false;
float q = plane.normal.dot(sphere.center - plane.d).abs;
if (q <= sphere.radius)
{
res.penetrationDepth = sphere.radius - q;
res.normal = plane.normal;
res.point = sphere.center - res.normal * sphere.radius;
res.fact = true;
}
return res;
}
private void measureSphereAndTriVert(
Vector3f center,
float radius,
ref Intersection result,
Triangle tri,
int whichVert)
{
Vector3f diff = center - tri.v[whichVert];
float len = diff.length;
float penetrate = radius - len;
if (penetrate > 0.0f)
{
result.fact = true;
result.penetrationDepth = penetrate;
result.normal = diff * (1.0f / len);
result.point = center - result.normal * radius;
}
}
void measureSphereAndTriEdge(
Vector3f center,
float radius,
ref Intersection result,
Triangle tri,
int whichEdge)
{
static int[] nextDim1 = [1, 2, 0];
static int[] nextDim2 = [2, 0, 1];
int whichVert0, whichVert1;
whichVert0 = whichEdge;
whichVert1 = nextDim1[whichEdge];
float penetrate;
Vector3f dir = tri.edges[whichEdge];
float edgeLen = dir.length;
if (isConsiderZero(edgeLen))
dir = Vector3f(0.0f, 0.0f, 0.0f);
else
dir *= (1.0f / edgeLen);
Vector3f vert2Point = center - tri.v[whichVert0];
float dot = dir.dot(vert2Point);
Vector3f project = tri.v[whichVert0] + dir * dot;
if (dot > 0.0f && dot < edgeLen)
{
Vector3f diff = center - project;
float len = diff.length;
penetrate = radius - len;
if (penetrate > 0.0f && penetrate < result.penetrationDepth && penetrate < radius)
{
result.fact = true;
result.penetrationDepth = penetrate;
result.normal = diff * (1.0f / len);
result.point = center - result.normal * radius;
}
}
}
/// Checks sphere and triangle for intersection
Intersection intrSphereVsTriangle(ref Sphere sphere, ref Triangle tri)
{
Intersection result;
result.point = Vector3f(0.0f, 0.0f, 0.0f);
result.normal = Vector3f(0.0f, 0.0f, 0.0f);
result.penetrationDepth = 1.0e5f;
result.fact = false;
float distFromPlane = tri.normal.dot(sphere.center) - tri.d;
float factor = 1.0f;
if (distFromPlane < 0.0f)
factor = -1.0f;
float penetrated = sphere.radius - distFromPlane * factor;
if (penetrated <= 0.0f)
return result;
Vector3f contactB = sphere.center - tri.normal * distFromPlane;
int pointInside = tri.isPointInside(contactB);
if (pointInside == -1) // inside the triangle
{
result.penetrationDepth = penetrated;
result.point = sphere.center - tri.normal * factor * sphere.radius; //on the sphere
result.fact = true;
result.normal = tri.normal * factor;
return result;
}
switch (pointInside)
{
case 0:
measureSphereAndTriVert(sphere.center, sphere.radius, result, tri, 0);
break;
case 1:
measureSphereAndTriEdge(sphere.center, sphere.radius, result, tri, 0);
break;
case 2:
measureSphereAndTriVert(sphere.center, sphere.radius, result, tri, 1);
break;
case 3:
measureSphereAndTriEdge(sphere.center, sphere.radius, result, tri, 1);
break;
case 4:
measureSphereAndTriVert(sphere.center, sphere.radius, result, tri, 2);
break;
case 5:
measureSphereAndTriEdge(sphere.center, sphere.radius, result, tri, 2);
break;
default:
break;
}
return result;
}
/// Checks sphere and OBB for intersection
Intersection intrSphereVsOBB(ref Sphere s, ref OBB b)
{
Intersection intr;
intr.fact = false;
intr.penetrationDepth = 0.0;
intr.normal = Vector3f(0.0f, 0.0f, 0.0f);
intr.point = Vector3f(0.0f, 0.0f, 0.0f);
Vector3f relativeCenter = s.center - b.transform.translation;
relativeCenter = b.transform.invRotate(relativeCenter);
if (abs(relativeCenter.x) - s.radius > b.extent.x ||
abs(relativeCenter.y) - s.radius > b.extent.y ||
abs(relativeCenter.z) - s.radius > b.extent.z)
return intr;
Vector3f closestPt = Vector3f(0.0f, 0.0f, 0.0f);
float distance;
distance = relativeCenter.x;
if (distance > b.extent.x) distance = b.extent.x;
if (distance < -b.extent.x) distance = -b.extent.x;
closestPt.x = distance;
distance = relativeCenter.y;
if (distance > b.extent.y) distance = b.extent.y;
if (distance < -b.extent.y) distance = -b.extent.y;
closestPt.y = distance;
distance = relativeCenter.z;
if (distance > b.extent.z) distance = b.extent.z;
if (distance < -b.extent.z) distance = -b.extent.z;
closestPt.z = distance;
float distanceSqr = (closestPt - relativeCenter).lengthsqr;
if (distanceSqr > s.radius * s.radius)
return intr;
Vector3f closestPointWorld = closestPt * b.transform;
intr.fact = true;
intr.normal = -(closestPointWorld - s.center).normalized;
intr.point = closestPointWorld;
intr.penetrationDepth = s.radius - sqrt(distanceSqr);
return intr;
}
|
D
|
// Written in the D programming language.
module windows.windowsinformationprotection;
public import windows.core;
public import windows.appxpackaging : PACKAGE_ID;
public import windows.com : HRESULT, IUnknown;
public import windows.systemservices : BOOL, HANDLE, NTSTATUS, PWSTR;
public import windows.winrt : HSTRING, IInspectable;
public import windows.windowsandmessaging : HWND;
extern(Windows) @nogc nothrow:
// Enums
///<p class="CCE_Message">[Some information relates to pre-released product which may be substantially modified before
///it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information
///provided here.] <div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows
///10, version 1607.</div> <div> </div>Indicates whether the app is enlightened for Windows Information Protection (WIP)
///and whether the app is managed by policy.
alias ENTERPRISE_DATA_POLICIES = int;
enum : int
{
///The app is not managed by enterprise policy.
ENTERPRISE_POLICY_NONE = 0x00000000,
///The app is allowed to access enterprise resources according to the enterprise policy.
ENTERPRISE_POLICY_ALLOWED = 0x00000001,
///The app is enlightened (self-declared in the app's resource file).
ENTERPRISE_POLICY_ENLIGHTENED = 0x00000002,
ENTERPRISE_POLICY_EXEMPT = 0x00000004,
}
// Structs
struct HTHREAD_NETWORK_CONTEXT
{
uint ThreadId;
HANDLE ThreadContext;
}
struct FILE_UNPROTECT_OPTIONS
{
bool audit;
}
// Functions
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Sets the enterprise ID as the data context of the current thread. This is allowed only if the
///process already has the same enterprise ID present in its process context. It optionally returns the existing thread
///token.
///Params:
/// enterpriseId = The enterprise ID to set in the current thread's token.
/// threadNetworkContext = On success, holds the existing thread token.
@DllImport("srpapi")
HRESULT SrpCreateThreadNetworkContext(const(PWSTR) enterpriseId, HTHREAD_NETWORK_CONTEXT* threadNetworkContext);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Restores a thread back to the original context, which may have been optionally returned from
///SrpCreateThreadNetworkContext.
///Params:
/// threadNetworkContext = A handle to the original context’s token.
@DllImport("srpapi")
HRESULT SrpCloseThreadNetworkContext(HTHREAD_NETWORK_CONTEXT* threadNetworkContext);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Sets a data intent on a token. The caller process should be enterprise allowed for the
///provided enterprise ID. If the caller intends to set a personal intent on the token, then NULL should be passed as
///enterprise ID.
///Params:
/// tokenHandle = The token handle on which the intent is to be set.
/// enterpriseId = The enterprise ID to set as intent.
@DllImport("srpapi")
HRESULT SrpSetTokenEnterpriseId(HANDLE tokenHandle, const(PWSTR) enterpriseId);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy cannot be applied on Windows 10, version
///1511 (build 10586) or earlier.</div> <div> </div>Gets the list of enterprise identifiers for the given token. The
///enterprise IDs are returned only for those applications explicitly allowed by management.
///Params:
/// tokenHandle = Token Handle to be checked.
/// numberOfBytes = If <i>enterpriseIds</i> is provided, then this supplies the size of the <i>enterpriseIds</i> buffer. If you
/// provide a buffer size, and it's too small, the output will contain the required size of the <i>enterpriseIds</i>
/// buffer.
/// enterpriseIds = An array of enterprise ID string pointers.
/// enterpriseIdCount = The enterprise ID count on the token. Zero if the token is not explicitly enterprise allowed.
@DllImport("srpapi")
HRESULT SrpGetEnterpriseIds(HANDLE tokenHandle, uint* numberOfBytes, PWSTR* enterpriseIds, uint* enterpriseIdCount);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Enables permissive mode for file encryption on the current thread and all threads this thread
///will create or post work to. Use SrpDisablePermissiveModeFileEncryption to disable the mode. This API does not
///attempt to handle nested calls by reference counting or such. Subsequent calls to
///<b>SrpEnablePermissiveModeFileEncryption</b> after the first successful call to this API will not have any effect.
///Params:
/// enterpriseId = Contains enterprise ID string. In TH2 this is not used.
@DllImport("srpapi")
HRESULT SrpEnablePermissiveModeFileEncryption(const(PWSTR) enterpriseId);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Disables permissive mode for file encryption on the current thread. Use
///SrpEnablePermissiveModeFileEncryption to enable the mode. This API does not attempt to handle nested calls by
///reference counting or such. The first call to <b>SrpDisablePermissiveModeFileEncryption</b> will disable the
///permissive mode.
@DllImport("srpapi")
HRESULT SrpDisablePermissiveModeFileEncryption();
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Gets information about the enterprise policy of an app.
///Params:
/// tokenHandle = Token Handle to be checked.
/// policyFlags = A collection of flags that indicate among other things whether the host app is allowed by the managing enterprise
/// policy, and has been enlightened for Windows Information Protection.
@DllImport("srpapi")
HRESULT SrpGetEnterprisePolicy(HANDLE tokenHandle, ENTERPRISE_DATA_POLICIES* policyFlags);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy cannot be applied on Windows 10, version
///1511 (build 10586) or earlier.</div> <div> </div>Identifies whether a service is a token service.
///Params:
/// TokenHandle = Token Handle to be checked.
/// IsTokenService = A boolean value that indicates whether the service is a token service.
@DllImport("srpapi")
NTSTATUS SrpIsTokenService(HANDLE TokenHandle, ubyte* IsTokenService);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Evaluates whether a packaged app will be allowed to execute based on software restriction
///policies.
///Params:
/// packageId = Provides package name, publisher name, and version of the packaged app.
/// isAllowed = A boolean value that indicates whether the app is allowed to execute.
@DllImport("srpapi")
HRESULT SrpDoesPolicyAllowAppExecution(const(PACKAGE_ID)* packageId, BOOL* isAllowed);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Protects the data in a file to an enterprise identity, so that only users who are associated
///with that enterprise identity can access the data. The application can then use standard APIs to read or write from
///the file.
///Params:
/// fileOrFolderPath = The path for the file or folder that you want to protect.
/// identity = The enterprise identity for which the data is protected. This identity is an email address or domain that is
/// managed.
@DllImport("efswrt")
HRESULT ProtectFileToEnterpriseIdentity(const(PWSTR) fileOrFolderPath, const(PWSTR) identity);
@DllImport("efswrt")
HRESULT UnprotectFile(const(PWSTR) fileOrFolderPath, const(FILE_UNPROTECT_OPTIONS)* options);
// Interfaces
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Manages enterprise protection policy on protected content.
@GUID("4652651D-C1FE-4BA1-9F0A-C0F56596F721")
interface IProtectionPolicyManagerInterop : IInspectable
{
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Request access to enterprise protected content for an identity.
///Params:
/// appWindow = A handle to the current window.
/// sourceIdentity = The enterprise identity to which the content is protected. This is an email address or domain that is
/// managed.
/// targetIdentity = The enterprise identity to which the content is being disclosed. This is an email address or domain.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>asyncOperation</i>.
/// asyncOperation = An IAsyncOperation<ProtectionPolicyEvaluationResult> with a value of the ProtectionPolicyEvaluationResult
/// enumeration that is the result of the request.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT RequestAccessForWindowAsync(HWND appWindow, HSTRING sourceIdentity, HSTRING targetIdentity,
const(GUID)* riid, void** asyncOperation);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Returns the protection policy manager object associated with the current app window.
///Params:
/// appWindow = A handle to the current window.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>result</i>.
/// result = The protection policy manager object for the current window.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT GetForWindow(HWND appWindow, const(GUID)* riid, void** result);
}
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Manages enterprise protection policy on protected content.
@GUID("157CFBE4-A78D-4156-B384-61FDAC41E686")
interface IProtectionPolicyManagerInterop2 : IInspectable
{
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Request access to enterprise-protected content for a specific target app.
///Params:
/// appWindow = A handle to the current window.
/// sourceIdentity = The enterprise identity to which the content is protected. This is an email address or domain that is
/// managed.
/// appPackageFamilyName = The enterprise identity to which the content is being disclosed. This is an email address or domain.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>asyncOperation</i>.
/// asyncOperation = An IAsyncOperation<ProtectionPolicyEvaluationResult> with a value of the ProtectionPolicyEvaluationResult
/// enumeration that is the result of the request.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT RequestAccessForAppWithWindowAsync(HWND appWindow, HSTRING sourceIdentity,
HSTRING appPackageFamilyName, const(GUID)* riid,
void** asyncOperation);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Request access to enterprise protected content for an identity.
///Params:
/// appWindow = A handle to the current window.
/// sourceIdentity = The enterprise identity to which the content is protected. This is an email address or domain that is
/// managed.
/// targetIdentity = The enterprise identity to which the content is being disclosed. This is an email address or domain.
/// auditInfoUnk = An audit info object; an instance of ProtectionPolicyAuditInfo.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>asyncOperation</i>.
/// asyncOperation = An IAsyncOperation<ProtectionPolicyEvaluationResult> with a value of the ProtectionPolicyEvaluationResult
/// enumeration that is the result of the request.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT RequestAccessWithAuditingInfoForWindowAsync(HWND appWindow, HSTRING sourceIdentity,
HSTRING targetIdentity, IUnknown auditInfoUnk,
const(GUID)* riid, void** asyncOperation);
///Request access to enterprise protected content for an identity.
///Params:
/// appWindow = A handle to the current window.
/// sourceIdentity = The enterprise identity to which the content is protected. This is an email address or domain that is
/// managed.
/// targetIdentity = The enterprise identity to which the content is being disclosed. This is an email address or domain.
/// auditInfoUnk = An audit info object; an instance of ProtectionPolicyAuditInfo.
/// messageFromApp = A message that will be displayed in the consent dialog so that the user can make a consent decision.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>asyncOperation</i>.
/// asyncOperation = An IAsyncOperation<ProtectionPolicyEvaluationResult> with a value of the ProtectionPolicyEvaluationResult
/// enumeration that is the result of the request.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT RequestAccessWithMessageForWindowAsync(HWND appWindow, HSTRING sourceIdentity, HSTRING targetIdentity,
IUnknown auditInfoUnk, HSTRING messageFromApp, const(GUID)* riid,
void** asyncOperation);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Request access to enterprise-protected content for a specific target app.
///Params:
/// appWindow = A handle to the current window.
/// sourceIdentity = The enterprise identity to which the content is protected. This is an email address or domain that is
/// managed.
/// appPackageFamilyName = The enterprise identity to which the content is being disclosed. This is an email address or domain.
/// auditInfoUnk = An audit info object; an instance of ProtectionPolicyAuditInfo.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>asyncOperation</i>.
/// asyncOperation = An IAsyncOperation<ProtectionPolicyEvaluationResult> with a value of the ProtectionPolicyEvaluationResult
/// enumeration that is the result of the request.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT RequestAccessForAppWithAuditingInfoForWindowAsync(HWND appWindow, HSTRING sourceIdentity,
HSTRING appPackageFamilyName, IUnknown auditInfoUnk,
const(GUID)* riid, void** asyncOperation);
///<div class="alert"><b>Note</b> Windows Information Protection (WIP) policy can be applied on Windows 10, version
///1607.</div> <div> </div>Request access to enterprise-protected content for a specific target app.
///Params:
/// appWindow = A handle to the current window.
/// sourceIdentity = The enterprise identity to which the content is protected. This is an email address or domain that is
/// managed.
/// appPackageFamilyName = The enterprise identity to which the content is being disclosed. This is an email address or domain.
/// auditInfoUnk = An audit info object; an instance of ProtectionPolicyAuditInfo.
/// messageFromApp = A message that will be displayed in the consent dialog so that the user can make a consent decision.
/// riid = Reference to the identifier of the interface describing the type of interface pointer to return in
/// <i>asyncOperation</i>.
/// asyncOperation = An IAsyncOperation<ProtectionPolicyEvaluationResult> with a value of the ProtectionPolicyEvaluationResult
/// enumeration that is the result of the request.
///Returns:
/// If this method succeeds, it returns <b xmlns:loc="http://microsoft.com/wdcml/l10n">S_OK</b>. Otherwise, it
/// returns an <b xmlns:loc="http://microsoft.com/wdcml/l10n">HRESULT</b> error code.
///
HRESULT RequestAccessForAppWithMessageForWindowAsync(HWND appWindow, HSTRING sourceIdentity,
HSTRING appPackageFamilyName, IUnknown auditInfoUnk,
HSTRING messageFromApp, const(GUID)* riid,
void** asyncOperation);
}
@GUID("C1C03933-B398-4D93-B0FD-2972ADF802C2")
interface IProtectionPolicyManagerInterop3 : IInspectable
{
HRESULT RequestAccessWithBehaviorForWindowAsync(HWND appWindow, HSTRING sourceIdentity, HSTRING targetIdentity,
IUnknown auditInfoUnk, HSTRING messageFromApp, uint behavior,
const(GUID)* riid, void** asyncOperation);
HRESULT RequestAccessForAppWithBehaviorForWindowAsync(HWND appWindow, HSTRING sourceIdentity,
HSTRING appPackageFamilyName, IUnknown auditInfoUnk,
HSTRING messageFromApp, uint behavior, const(GUID)* riid,
void** asyncOperation);
HRESULT RequestAccessToFilesForAppForWindowAsync(HWND appWindow, IUnknown sourceItemListUnk,
HSTRING appPackageFamilyName, IUnknown auditInfoUnk,
const(GUID)* riid, void** asyncOperation);
HRESULT RequestAccessToFilesForAppWithMessageAndBehaviorForWindowAsync(HWND appWindow,
IUnknown sourceItemListUnk,
HSTRING appPackageFamilyName,
IUnknown auditInfoUnk,
HSTRING messageFromApp, uint behavior,
const(GUID)* riid, void** asyncOperation);
HRESULT RequestAccessToFilesForProcessForWindowAsync(HWND appWindow, IUnknown sourceItemListUnk,
uint processId, IUnknown auditInfoUnk, const(GUID)* riid,
void** asyncOperation);
HRESULT RequestAccessToFilesForProcessWithMessageAndBehaviorForWindowAsync(HWND appWindow,
IUnknown sourceItemListUnk,
uint processId, IUnknown auditInfoUnk,
HSTRING messageFromApp, uint behavior,
const(GUID)* riid,
void** asyncOperation);
}
// GUIDs
const GUID IID_IProtectionPolicyManagerInterop = GUIDOF!IProtectionPolicyManagerInterop;
const GUID IID_IProtectionPolicyManagerInterop2 = GUIDOF!IProtectionPolicyManagerInterop2;
const GUID IID_IProtectionPolicyManagerInterop3 = GUIDOF!IProtectionPolicyManagerInterop3;
|
D
|
/**
The main entry point for the reggae tool. Its tasks are:
$(UL
$(LI Verify that a $(D reggafile.d) exists in the selected directory)
$(LI Generate a $(D reggaefile.d) for dub projects)
$(LI Write out the reggae library files and $(D config.d))
$(LI Compile the build description with the reggae library files to produce $(D buildgen))
$(LI Produce $(D dcompile), a binary to call the D compiler to obtain dependencies during compilation)
$(LI Call the produced $(D buildgen) binary)
)
*/
module reggae.reggae;
import std.stdio;
import std.process: execute, environment;
import std.array: array, join, empty, split;
import std.path: absolutePath, buildPath, relativePath;
import std.typetuple;
import std.file;
import std.conv: text;
import std.exception: enforce;
import std.conv: to;
import std.algorithm;
import reggae.options;
import reggae.ctaa;
import reggae.types;
version(minimal) {
//empty stubs for minimal version of reggae
void maybeCreateReggaefile(T...)(T) {}
void writeDubConfig(T...)(T) {}
} else {
import reggae.dub.interop;
}
mixin template reggaeGen(targets...) {
mixin buildImpl!targets;
mixin ReggaeMain;
}
mixin template ReggaeMain() {
import reggae.options: getOptions;
import std.stdio: stderr;
int main(string[] args) {
try {
run(getOptions(args));
} catch(Exception ex) {
stderr.writeln(ex.msg);
return 1;
}
return 0;
}
}
void run(in Options options) {
if(options.help) return;
enforce(options.projectPath != "", "A project path must be specified");
if(options.reggaeFileLanguage != BuildLanguage.D) {
immutable haveToReturn = jsonBuild(options, options.reggaeFileLanguage);
if(haveToReturn) return;
}
maybeCreateReggaefile(options);
createBuild(options);
}
//get JSON description of the build from a scripting language
//return true if no D files are present
bool jsonBuild(in Options options, in BuildLanguage language) {
enforce(options.backend != Backend.binary, "Binary backend not supported via JSON");
immutable jsonOutput = getJsonOutput(options, language);
import reggae.json_build;
import reggae.buildgen;
import reggae.rules.common: Language;
const build = jsonToBuild(options.projectPath, jsonOutput);
generateBuild(build, options);
//true -> exit early
return !build.targets.canFind!(a => a.getLanguage == Language.D);
}
private string getJsonOutput(in Options options, in BuildLanguage language) @safe {
const args = getJsonOutputArgs(options, language);
const nodePaths = environment.get("NODE_PATH", "").split(":");
const luaPaths = environment.get("LUA_PATH", "").split(";");
auto env = ["NODE_PATH": (nodePaths ~ options.projectPath).join(":"),
"LUA_PATH": (luaPaths ~ buildPath(options.projectPath, "?.lua")).join(";")];
immutable res = execute(args, env);
enforce(res.status == 0, text("Could not execute ", args.join(" "), ":\n", res.output));
return res.output;
}
private string[] getJsonOutputArgs(in Options options, in BuildLanguage language) @safe pure nothrow {
final switch(language) {
case BuildLanguage.D:
assert(0, "Cannot obtain JSON build for builds written in D");
case BuildLanguage.Python:
return ["python", "-m", "reggae.json_build", options.projectPath];
case BuildLanguage.Ruby:
return ["ruby", "-S", "-I" ~ options.projectPath, "reggae_json_build.rb"];
case BuildLanguage.Lua:
return ["reggae_json_build.lua"];
case BuildLanguage.JavaScript:
return ["reggae_json_build.js"];
}
}
enum coreFiles = [
"options.d",
"buildgen_main.d", "buildgen.d",
"build.d",
"backend/package.d", "backend/binary.d",
"package.d", "range.d", "reflect.d",
"dependencies.d", "types.d", "dcompile.d",
"ctaa.d", "sorting.d",
"rules/package.d",
"rules/common.d",
"rules/d.d",
"rules/c_and_cpp.d",
"core/package.d", "core/rules/package.d",
];
enum otherFiles = [
"backend/ninja.d", "backend/make.d", "backend/tup.d",
"dub/info.d", "rules/dub.d",
];
//all files that need to be written out and compiled
private string[] fileNames() @safe pure nothrow {
version(minimal) return coreFiles;
else return coreFiles ~ otherFiles;
}
private void createBuild(in Options options) {
enforce(options.reggaeFilePath.exists, text("Could not find ", options.reggaeFilePath));
//write out the library source files to be compiled with the user's
//build description
writeSrcFiles(options);
//compile the binaries (the build generator and dcompile)
immutable buildGenName = compileBinaries(options);
//binary backend has no build generator, it _is_ the build
if(options.backend == Backend.binary) return;
//only got here to build .dcompile
if(options.isScriptBuild) return;
//actually run the build generator
writeln("[Reggae] Running the created binary to generate the build");
immutable retRunBuildgen = execute([buildPath(".", buildGenName)]);
enforce(retRunBuildgen.status == 0,
text("Couldn't execute the produced ", buildGenName, " binary:\n", retRunBuildgen.output));
writeln(retRunBuildgen.output);
}
private immutable hiddenDir = ".reggae";
private auto compileBinaries(in Options options) {
immutable buildGenName = getBuildGenName(options);
const compileBuildGenCmd = getCompileBuildGenCmd(options);
immutable dcompileName = buildPath(hiddenDir, "dcompile");
immutable dcompileCmd = ["dmd",
"-I.reggae/src",
"-of" ~ dcompileName,
reggaeSrcFileName("dcompile.d"),
reggaeSrcFileName("dependencies.d")];
static struct Binary { string name; const(string)[] cmd; }
auto binaries = options.isScriptBuild
? [Binary(dcompileName, dcompileCmd)]
: [Binary(buildGenName, compileBuildGenCmd), Binary(dcompileName, dcompileCmd)];
foreach(bin; binaries) writeln("[Reggae] Compiling metabuild binary ", bin.name);
import std.parallelism;
foreach(bin; binaries.parallel) {
immutable res = execute(bin.cmd);
enforce(res.status == 0, text("Couldn't execute ", bin.cmd.join(" "), ":\n", res.output,
"\n", "bin.name: ", bin.name, ", bin.cmd: ", bin.cmd.join(" ")));
}
return buildGenName;
}
const (string[]) getCompileBuildGenCmd(in Options options) @safe {
const reggaeSrcs = ("config.d" ~ fileNames).
filter!(a => a != "dcompile.d").
map!(a => a.reggaeSrcFileName).array;
immutable buildBinFlags = options.backend == Backend.binary
? ["-O"]
: [];
immutable commonBefore = ["dmd",
"-I" ~ options.projectPath,
"-I" ~ buildPath(hiddenDir, "src"),
"-g", "-debug",
"-of" ~ getBuildGenName(options)];
const commonAfter = buildBinFlags ~
options.reggaeFilePath ~ reggaeSrcs;
version(minimal) return commonBefore ~ "-version=minimal" ~ commonAfter;
else return commonBefore ~ commonAfter;
}
string getBuildGenName(in Options options) @safe pure nothrow {
return options.backend == Backend.binary ? "build" : buildPath(hiddenDir, "buildgen");
}
immutable reggaeSrcDirName = buildPath(hiddenDir, "src", "reggae");
private string filesTupleString() @safe pure nothrow {
return "TypeTuple!(" ~ fileNames.map!(a => `"` ~ a ~ `"`).join(",") ~ ")";
}
template FileNames() {
mixin("alias FileNames = " ~ filesTupleString ~ ";");
}
private void writeSrcFiles(in Options options) {
writeln("[Reggae] Writing reggae source files");
import std.file: mkdirRecurse;
if(!reggaeSrcDirName.exists) {
mkdirRecurse(reggaeSrcDirName);
mkdirRecurse(buildPath(reggaeSrcDirName, "dub"));
mkdirRecurse(buildPath(reggaeSrcDirName, "rules"));
mkdirRecurse(buildPath(reggaeSrcDirName, "backend"));
mkdirRecurse(buildPath(reggaeSrcDirName, "core", "rules"));
}
//this foreach has to happen at compile time due
//to the string import below.
foreach(fileName; FileNames!()) {
auto file = File(reggaeSrcFileName(fileName), "w");
file.write(import(fileName));
}
writeConfig(options);
}
private void writeConfig(in Options options) {
auto file = File(reggaeSrcFileName("config.d"), "w");
file.writeln(q{
module reggae.config;
import reggae.ctaa;
import reggae.types;
import reggae.options;
});
file.writeln("immutable options = ", options, ";");
file.writeln("enum userVars = AssocList!(string, string)([");
foreach(key, value; options.userVars) {
file.writeln("assocEntry(`", key, "`, `", value, "`), ");
}
file.writeln("]);");
writeDubConfig(options, file);
}
private string reggaeSrcFileName(in string fileName) @safe pure nothrow {
return buildPath(reggaeSrcDirName, fileName);
}
|
D
|
INSTANCE Mod_7374_OUT_Gerichtswache_01 (Npc_Default)
{
// ------ NSC ------
name = "Gerichtswache";
guild = GIL_OUT;
id = 7374;
voice = 6;
flags = 0;
npctype = NPCTYPE_MAIN;
//-----------AIVARS----------------
aivar[AIV_ToughGuy] = TRUE;
// ------ Attribute ------
B_SetAttributesToChapter (self, 2);
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG;
// ------ Equippte Waffen ------
EquipItem (self, ItMw_ShortSword3);
// ------ Inventory ------
// ------ visuals ------
B_SetNpcVisual (self, MALE, "Hum_Head_Thief", Face_L_Ian, BodyTex_L, KhorataWache_01);
Mdl_SetModelFatness (self,0);
Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds");
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------
B_SetFightSkills (self, 10);
// ------ TA anmelden ------
daily_routine = Rtn_Start_7374;
};
FUNC VOID Rtn_Start_7374()
{
TA_Stand_Guarding (08,00,22,00,"REL_CITY_345");
TA_Stand_Guarding (22,00,08,00,"REL_CITY_345");
};
FUNC VOID Rtn_StadtTor_7374()
{
TA_RunToWP (08,00,22,00,"REL_CITY_002");
TA_RunToWP (22,00,08,00,"REL_CITY_002");
};
|
D
|
/// Problem 22: 名前のスコア
///
/// 5000 個以上の名前が書かれているテキストファイル names.txt を用いる。まずアルファベット順にソートせよ。
/// のち、各名前についてアルファベットに値を割り振り、リスト中の出現順の数と掛け合わせることで、名前のスコアを計算する。
/// たとえば、リストがアルファベット順にソートされているとすると、COLIN はリストの938番目にある。
/// また COLIN は 3 + 15 + 12 + 9 + 14 = 53 という値を持つ。
/// よって COLIN は 938 x 53 = 49714 というスコアを持つ。
/// ファイル中の全名前のスコアの合計を求めよ。
module project_euler.problem022;
import std.file : readText;
import std.string : split;
import system.linq : asRvalueElements, block, orderBy, sum, toArray, Yield;
import project_euler.foundation : unpackChars;
@property uint scoreof(in string source)
{
uint score = 0;
foreach (c; source)
{
final switch (c)
{
foreach (i, cc; unpackChars!"ABCDEFGHIJKLMNOPQRSTUVWXYZ")
{
case cc:
score += i + 1;
break;
}
}
}
return score;
}
ulong problem022(in string path)
{
auto names = readText(path).split(',').asRvalueElements.orderBy.toArray;
void yieldScores(Yield!ulong yield)
{
foreach (i, name; names)
{
yield = (i + 1) * name[1 .. $ - 1].scoreof;
}
}
return block!yieldScores.sum;
}
unittest
{
assert(problem022("./project-euler/resources/022-names.txt") == 871198282);
}
|
D
|
/Users/CHINTU/Desktop/ShuffleIt/build/ShuffleIt.build/Release-iphonesimulator/ShuffleIt.build/Objects-normal/i386/AppDelegate.o : /Users/CHINTU/Desktop/ShuffleIt/War/ViewController.swift /Users/CHINTU/Desktop/ShuffleIt/War/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
/Users/CHINTU/Desktop/ShuffleIt/build/ShuffleIt.build/Release-iphonesimulator/ShuffleIt.build/Objects-normal/i386/AppDelegate~partial.swiftmodule : /Users/CHINTU/Desktop/ShuffleIt/War/ViewController.swift /Users/CHINTU/Desktop/ShuffleIt/War/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
/Users/CHINTU/Desktop/ShuffleIt/build/ShuffleIt.build/Release-iphonesimulator/ShuffleIt.build/Objects-normal/i386/AppDelegate~partial.swiftdoc : /Users/CHINTU/Desktop/ShuffleIt/War/ViewController.swift /Users/CHINTU/Desktop/ShuffleIt/War/AppDelegate.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/i386/CoreImage.swiftmodule
|
D
|
/**
* Copyright: Copyright (c) 2012 Jacob Carlborg. All rights reserved.
* Authors: Jacob Carlborg
* Version: Initial created: Nov 7, 2012
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
*/
module spec.serialization.NonMutable;
import dspec.Dsl;
import mambo.core._;
import mambo.serialization.Serializer;
import mambo.serialization.archives.XmlArchive;
import spec.serialization.Util;
Serializer serializer;
XmlArchive!(char) archive;
class B
{
int a;
pure this (int a)
{
this.a = a;
}
override equals_t opEquals (Object other)
{
if (auto o = cast(B) other)
return a == o.a;
return false;
}
}
class A
{
const int a;
immutable int b;
immutable string c;
immutable B d;
immutable(int)* e;
this (int a, int b, string c, immutable B d, immutable(int)* e)
{
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.e = e;
}
override equals_t opEquals (Object other)
{
if (auto o = cast(A) other)
return a == o.a &&
b == o.b &&
c == o.c &&
d == o.d &&
*e == *o.e;
return false;
}
}
class CTFEFields
{
public immutable int FIRST;
public immutable int SECOND;
public bool someFlag;
this ()
{
FIRST = 1;
SECOND = 1;
}
}
A a;
immutable int ptr = 3;
unittest
{
archive = new XmlArchive!(char);
serializer = new Serializer(archive);
a = new A(1, 2, "str", new immutable(B)(3), &ptr);
describe! "serialize object with immutable and const fields" in {
it! "should return a serialized object" in {
serializer.reset;
serializer.serialize(a);
version (D_Version2) string stringElementType = "immutable(char)";
else string stringElementType = "char";
assert(archive.data().containsDefaultXmlContent());
assert(archive.data().contains(`<object runtimeType="spec.serialization.NonMutable.A" type="spec.serialization.NonMutable.A" key="0" id="0">`));
assert(archive.data().containsXmlTag("int", `key="a" id="1"`, "1"));
assert(archive.data().containsXmlTag("int", `key="b" id="2"`, "2"));
assert(archive.data().containsXmlTag("string", `type="` ~ stringElementType ~ `" length="3" key="c" id="3"`, "str"));
assert(archive.data().contains(`<object runtimeType="spec.serialization.NonMutable.B" type="immutable(spec.serialization.NonMutable.B)" key="d" id="4">`));
assert(archive.data().containsXmlTag("pointer", `key="e" id="6"`));
assert(archive.data().containsXmlTag("int", `key="1" id="7"`, "3"));
};
};
describe! "deserialize object" in {
it! "should return a deserialized object equal to the original object" in {
auto aDeserialized = serializer.deserialize!(A)(archive.untypedData);
assert(a == aDeserialized);
};
};
describe! "serializing object with CTFE fields" in {
it! "should compile" in {
assert(__traits(compiles, {
serializer.serialize(new CTFEFields);
}));
};
};
}
|
D
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.