code
stringlengths
3
10M
language
stringclasses
31 values
module BuildSlave.UI.Base; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.TabFolder; class UIBase : Composite { static int AllLog = 0; static int ErrorLog = 0; this(Composite parent) { super(parent, SWT.NONE); } //public struct Position2D //{ // int x, y; // // Position2D opBinary(string op)(immutable Position2D rhs) immutable // { // return mixin("Position2D(x "~op~" rhs.x, y "~op~" rhs.y)"); // } // // pure Position2D addX(immutable Position2D b) immutable // { // return Position2D(x + b.x, y); // } // // pure Position2D addY(immutable Position2D b) immutable // { // return Position2D(x, y + b.y); // } //} //static Position2D BorderMargin = Position2D(12, 12); //static Position2D CellSpacing = Position2D(8, 8); //static Position2D CellMinSize = Position2D(16, 16); abstract public bool checkDependencies(); abstract public void preInitialize(); abstract public void initialize(); abstract public void postInitialize(); }
D
module testvd; import sdk.win32.oaidl; import sdk.win32.objbase; import sdk.win32.oleauto; import sdk.port.base; import vdc.ivdserver; static GUID IVDServer_iid = uuid("002a2de9-8bb6-484d-9901-7e4ad4084715"); static GUID VDServer_iid = uuid("002a2de9-8bb6-484d-AA05-7e4ad4084715"); static GUID IID_IUnknown = uuid("00000000-0000-0000-C000-000000000046"); static GUID IID_IClassFactory = { 0x00000001,0x0000,0x0000,[ 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 ] }; // issues: // C# registration with REGASM only adds the class to the 64-bit registry, not wow6432node int main() { CoInitialize(null); IVDServer gVDServer; IUnknown pUnknown; HRESULT hr = CoGetClassObject(VDServer_iid, CLSCTX_INPROC_SERVER, null, IID_IUnknown, cast(void**)&pUnknown); if(FAILED(hr)) return -1; // hr = OleRun(pUnknown); // if(FAILED(hr)) // return -3; IClassFactory factory; hr = pUnknown.QueryInterface(&IID_IClassFactory, cast(void**)&factory); pUnknown.Release(); if(FAILED(hr)) return -5; hr = factory.CreateInstance(null, &IVDServer_iid, cast(void**)&gVDServer); if(FAILED(hr)) return -5; BSTR fname = SysAllocString("filename"); BSTR source = SysAllocString("void main() { int abc; }"); hr = gVDServer.UpdateModule(fname, source); version(none) { int iStartLine = 1; int iStartIndex = 6; int iEndLine = 1; int iEndIndex = 6; hr = gVDServer.GetTip(fname, iStartLine, iStartIndex, iEndLine, iEndIndex); BSTR btype; hr = gVDServer.GetTipResult(iStartLine, iStartIndex, iEndLine, iEndIndex, &btype); } version(all) { int iStartLine = 1; int iStartIndex = 6; BSTR tok = SysAllocString("m"); BSTR expr = SysAllocString(""); hr = gVDServer.GetSemanticExpansions(fname, tok, iStartLine, iStartIndex, expr); BSTR expansions; hr = gVDServer.GetSemanticExpansionsResult(&expansions); } BSTR msg; hr = gVDServer.GetLastMessage(&msg); if(FAILED(hr)) return -6; factory.Release(); gVDServer.Release(); return 0; }
D
module hunt.http.codec.http.decode.BodyParser; import hunt.http.codec.http.decode.HeaderParser; import hunt.http.codec.http.decode.Parser; import hunt.http.codec.http.decode.Parser; import hunt.http.codec.http.frame; import hunt.io.BufferUtils; import hunt.io.ByteBuffer; import hunt.logging; /** * <p> * The base parser for the frame body of HTTP/2 frames. * </p> * <p> * Subclasses implement {@link #parse(ByteBuffer)} to parse the frame specific * body. * </p> * * @see Parser */ abstract class BodyParser { // private HeaderParser headerParser; private Parser.Listener listener; protected this(HeaderParser headerParser, Parser.Listener listener) { this.headerParser = headerParser; this.listener = listener; } /** * <p> * Parses the body bytes in the given {@code buffer}; only the body bytes * are consumed, therefore when this method returns, the buffer may contain * unconsumed bytes. * </p> * * @param buffer the buffer to parse * @return true if the whole body bytes were parsed, false if not enough * body bytes were present in the buffer */ abstract bool parse(ByteBuffer buffer); void emptyBody(ByteBuffer buffer) { connectionFailure(buffer, cast(int)ErrorCode.PROTOCOL_ERROR, "invalid_frame"); } protected bool hasFlag(int bit) { return headerParser.hasFlag(bit); } protected bool isPadding() { return headerParser.hasFlag(Flags.PADDING); } protected bool isEndStream() { return headerParser.hasFlag(Flags.END_STREAM); } protected int getStreamId() { return headerParser.getStreamId(); } protected int getBodyLength() { return headerParser.getLength(); } protected void notifyData(DataFrame frame) { try { listener.onData(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyHeaders(HeadersFrame frame) { try { listener.onHeaders(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyPriority(PriorityFrame frame) { try { listener.onPriority(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyReset(ResetFrame frame) { try { listener.onReset(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifySettings(SettingsFrame frame) { try { listener.onSettings(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyPushPromise(PushPromiseFrame frame) { try { listener.onPushPromise(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyPing(PingFrame frame) { try { listener.onPing(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyGoAway(GoAwayFrame frame) { try { listener.onGoAway(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected void notifyWindowUpdate(WindowUpdateFrame frame) { try { listener.onWindowUpdate(frame); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } protected bool connectionFailure(ByteBuffer buffer, int error, string reason) { BufferUtils.clear(buffer); notifyConnectionFailure(error, reason); return false; } private void notifyConnectionFailure(int error, string reason) { try { listener.onConnectionFailure(error, reason); } catch (Exception x) { errorf("Failure while notifying listener %s", x, listener); } } }
D
/************************************************************************* ** Scavenger-Dämon Prototype ** *************************************************************************/ PROTOTYPE Mst_Default_ScavengerDemon(C_Npc) { name = "dämonischer Scavenger"; guild = GIL_SCAVENGER; aivar[AIV_MM_REAL_ID] = ID_SCAVENGER; level = 15; //--------------------------------------------------------- attribute [ATR_STRENGTH] = 30; attribute [ATR_DEXTERITY] = 30; attribute [ATR_HITPOINTS_MAX] = 140; attribute [ATR_HITPOINTS] = 140; attribute [ATR_MANA_MAX] = 0; attribute [ATR_MANA] = 0; //--------------------------------------------------------- protection [PROT_BLUNT] = 30; protection [PROT_EDGE] = 30; protection [PROT_POINT] = 10; protection [PROT_FIRE] = 15; protection [PROT_FLY] = 0; protection [PROT_MAGIC] = 0; //--------------------------------------------------------- damagetype = DAM_EDGE; //damage [DAM_INDEX_BLUNT] = 0; //damage [DAM_INDEX_EDGE] = 30; //STR wird genommen, wenn Summe aller dam = 0 //damage [DAM_INDEX_POINT] = 0; //damage [DAM_INDEX_FIRE] = 0; //damage [DAM_INDEX_FLY] = 0; //damage [DAM_INDEX_MAGIC] = 0; //--------------------------------------------------------- fight_tactic = FAI_SCAVENGER; //--------------------------------------------------------- senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL; senses_range = 3000; // 30m aivar[AIV_MM_Behaviour] = PASSIVE; aivar[AIV_MM_PercRange] = 1200; aivar[AIV_MM_DrohRange] = 1000; aivar[AIV_MM_AttackRange] = 700; aivar[AIV_MM_DrohTime] = 5; aivar[AIV_MM_FollowTime] = 10; aivar[AIV_MM_FollowInWater] = TRUE; //--------------------------------------------------------- start_aistate = ZS_MM_AllScheduler; aivar[AIV_MM_SleepStart] = 22; aivar[AIV_MM_SleepEnd] = 6; aivar[AIV_MM_EatGroundStart]= 6; aivar[AIV_MM_EatGroundEnd] = 22; }; //--------------------------------------------------------- func void Set_ScavengerDemon_Visuals() { Mdl_SetVisual (self, "Scavenger_Demon.mds"); // Body-Mesh Body-Tex Skin-Color Head-MMS Head-Tex Teeth-Tex ARMOR Mdl_SetVisualBody (self, "Sca_Body_Demon", DEFAULT, DEFAULT, "", DEFAULT, DEFAULT, -1); }; /************************************************************************* ** Scavenger-Demon ** *************************************************************************/ // in den Instanz-Scripten bitte NUR die Werte eintragen, die vom Prototyp abweichen sollen! INSTANCE ScavengerDemon (Mst_Default_ScavengerDemon) { Set_ScavengerDemon_Visuals(); Npc_SetToFistMode (self); CreateInvItems (self, ItAt_DemonSting, 1); };
D
/** * Compiler implementation of the * $(LINK2 http://www.dlang.org, D programming language). * * Copyright: Copyright (c) 1999-2016 by Digital Mars, All Rights Reserved * Authors: $(LINK2 http://www.digitalmars.com, Walter Bright) * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Source: $(DMDSRC _dscope.d) */ module ddmd.dscope; import core.stdc.stdio; import core.stdc.string; import ddmd.aggregate; import ddmd.attrib; import ddmd.dclass; import ddmd.declaration; import ddmd.dmodule; import ddmd.doc; import ddmd.dsymbol; import ddmd.dtemplate; import ddmd.errors; import ddmd.func; import ddmd.globals; import ddmd.id; import ddmd.identifier; import ddmd.root.outbuffer; import ddmd.root.rmem; import ddmd.root.speller; import ddmd.statement; //version=LOGSEARCH; extern (C++) bool mergeFieldInit(Loc loc, ref uint fieldInit, uint fi, bool mustInit) { if (fi != fieldInit) { // Have any branches returned? bool aRet = (fi & CSXreturn) != 0; bool bRet = (fieldInit & CSXreturn) != 0; // Have any branches halted? bool aHalt = (fi & CSXhalt) != 0; bool bHalt = (fieldInit & CSXhalt) != 0; bool ok; if (aHalt && bHalt) { ok = true; fieldInit = CSXhalt; } else if (!aHalt && aRet) { ok = !mustInit || (fi & CSXthis_ctor); fieldInit = fieldInit; } else if (!bHalt && bRet) { ok = !mustInit || (fieldInit & CSXthis_ctor); fieldInit = fi; } else if (aHalt) { ok = !mustInit || (fieldInit & CSXthis_ctor); fieldInit = fieldInit; } else if (bHalt) { ok = !mustInit || (fi & CSXthis_ctor); fieldInit = fi; } else { ok = !mustInit || !((fieldInit ^ fi) & CSXthis_ctor); fieldInit |= fi; } return ok; } return true; } enum CSXthis_ctor = 0x01; /// called this() enum CSXsuper_ctor = 0x02; /// called super() enum CSXthis = 0x04; /// referenced this enum CSXsuper = 0x08; /// referenced super enum CSXlabel = 0x10; /// seen a label enum CSXreturn = 0x20; /// seen a return statement enum CSXany_ctor = 0x40; /// either this() or super() was called enum CSXhalt = 0x80; /// assert(0) // Flags that would not be inherited beyond scope nesting enum SCOPEctor = 0x0001; /// constructor type enum SCOPEcondition = 0x0004; /// inside static if/assert condition enum SCOPEdebug = 0x0008; /// inside debug conditional // Flags that would be inherited beyond scope nesting enum SCOPEnoaccesscheck = 0x0002; /// don't do access checks enum SCOPEconstraint = 0x0010; /// inside template constraint enum SCOPEinvariant = 0x0020; /// inside invariant code enum SCOPErequire = 0x0040; /// inside in contract code enum SCOPEensure = 0x0060; /// inside out contract code enum SCOPEcontract = 0x0060; /// [mask] we're inside contract code enum SCOPEctfe = 0x0080; /// inside a ctfe-only expression enum SCOPEcompile = 0x0100; /// inside __traits(compile) enum SCOPEignoresymbolvisibility = 0x0200; /// ignore symbol visibility (Bugzilla 15907) enum SCOPEfree = 0x8000; /// is on free list enum SCOPEfullinst = 0x10000; /// fully instantiate templates struct Scope { Scope* enclosing; /// enclosing Scope Module _module; /// Root module ScopeDsymbol scopesym; /// current symbol ScopeDsymbol sds; /// if in static if, and declaring new symbols, sds gets the addMember() FuncDeclaration func; /// function we are in Dsymbol parent; /// parent to use LabelStatement slabel; /// enclosing labelled statement SwitchStatement sw; /// enclosing switch statement TryFinallyStatement tf; /// enclosing try finally statement OnScopeStatement os; /// enclosing scope(xxx) statement Statement sbreak; /// enclosing statement that supports "break" Statement scontinue; /// enclosing statement that supports "continue" ForeachStatement fes; /// if nested function for ForeachStatement, this is it Scope* callsc; /// used for __FUNCTION__, __PRETTY_FUNCTION__ and __MODULE__ int inunion; /// we're processing members of a union int nofree; /// set if shouldn't free it int noctor; /// set if constructor calls aren't allowed int intypeof; /// in typeof(exp) VarDeclaration lastVar; /// Previous symbol used to prevent goto-skips-init /* If minst && !tinst, it's in definitely non-speculative scope (eg. module member scope). * If !minst && !tinst, it's in definitely speculative scope (eg. template constraint). * If minst && tinst, it's in instantiated code scope without speculation. * If !minst && tinst, it's in instantiated code scope with speculation. */ Module minst; /// root module where the instantiated templates should belong to TemplateInstance tinst; /// enclosing template instance // primitive flow analysis for constructors uint callSuper; // primitive flow analysis for field initializations uint* fieldinit; size_t fieldinit_dim; /// alignment for struct members AlignDeclaration aligndecl; /// linkage for external functions LINK linkage = LINKd; /// mangle type CPPMANGLE cppmangle = CPPMANGLE.def; /// inlining strategy for functions PINLINE inlining = PINLINEdefault; /// protection for class members Prot protection = Prot(PROTpublic); int explicitProtection; /// set if in an explicit protection attribute StorageClass stc; /// storage class DeprecatedDeclaration depdecl; /// customized deprecation message uint flags; // user defined attributes UserAttributeDeclaration userAttribDecl; DocComment* lastdc; /// documentation comment for last symbol at this scope uint[void*] anchorCounts; /// lookup duplicate anchor name count Identifier prevAnchor; /// qualified symbol name of last doc anchor extern (C++) static __gshared Scope* freelist; extern (C++) static Scope* alloc() { if (freelist) { Scope* s = freelist; freelist = s.enclosing; //printf("freelist %p\n", s); assert(s.flags & SCOPEfree); s.flags &= ~SCOPEfree; return s; } return new Scope(); } extern (C++) static Scope* createGlobal(Module _module) { Scope* sc = Scope.alloc(); *sc = Scope.init; sc._module = _module; sc.minst = _module; sc.scopesym = new ScopeDsymbol(); sc.scopesym.symtab = new DsymbolTable(); // Add top level package as member of this global scope Dsymbol m = _module; while (m.parent) m = m.parent; m.addMember(null, sc.scopesym); m.parent = null; // got changed by addMember() // Create the module scope underneath the global scope sc = sc.push(_module); sc.parent = _module; return sc; } extern (C++) Scope* copy() { Scope* sc = Scope.alloc(); *sc = this; /* Bugzilla 11777: The copied scope should not inherit fieldinit. */ sc.fieldinit = null; return sc; } extern (C++) Scope* push() { Scope* s = copy(); //printf("Scope::push(this = %p) new = %p\n", this, s); assert(!(flags & SCOPEfree)); s.scopesym = null; s.sds = null; s.enclosing = &this; debug { if (enclosing) assert(!(enclosing.flags & SCOPEfree)); if (s == enclosing) { printf("this = %p, enclosing = %p, enclosing.enclosing = %p\n", s, &this, enclosing); } assert(s != enclosing); } s.slabel = null; s.nofree = 0; s.fieldinit = saveFieldInit(); s.flags = (flags & (SCOPEcontract | SCOPEdebug | SCOPEctfe | SCOPEcompile | SCOPEconstraint | SCOPEnoaccesscheck | SCOPEignoresymbolvisibility)); s.lastdc = null; assert(&this != s); return s; } extern (C++) Scope* push(ScopeDsymbol ss) { //printf("Scope::push(%s)\n", ss.toChars()); Scope* s = push(); s.scopesym = ss; return s; } extern (C++) Scope* pop() { //printf("Scope::pop() %p nofree = %d\n", this, nofree); Scope* enc = enclosing; if (enclosing) { enclosing.callSuper |= callSuper; if (fieldinit) { if (enclosing.fieldinit) { assert(fieldinit != enclosing.fieldinit); foreach (i; 0 .. fieldinit_dim) enclosing.fieldinit[i] |= fieldinit[i]; } freeFieldinit(); } } if (!nofree) { enclosing = freelist; freelist = &this; flags |= SCOPEfree; } return enc; } void allocFieldinit(size_t dim) { fieldinit = cast(typeof(fieldinit))mem.xcalloc(typeof(*fieldinit).sizeof, dim); fieldinit_dim = dim; } void freeFieldinit() { if (fieldinit) mem.xfree(fieldinit); fieldinit = null; fieldinit_dim = 0; } extern (C++) Scope* startCTFE() { Scope* sc = this.push(); sc.flags = this.flags | SCOPEctfe; version (none) { /* TODO: Currently this is not possible, because we need to * unspeculative some types and symbols if they are necessary for the * final executable. Consider: * * struct S(T) { * string toString() const { return "instantiated"; } * } * enum x = S!int(); * void main() { * // To call x.toString in runtime, compiler should unspeculative S!int. * assert(x.toString() == "instantiated"); * } */ // If a template is instantiated from CT evaluated expression, // compiler can elide its code generation. sc.tinst = null; sc.minst = null; } return sc; } extern (C++) Scope* endCTFE() { assert(flags & SCOPEctfe); return pop(); } extern (C++) void mergeCallSuper(Loc loc, uint cs) { // This does a primitive flow analysis to support the restrictions // regarding when and how constructors can appear. // It merges the results of two paths. // The two paths are callSuper and cs; the result is merged into callSuper. if (cs != callSuper) { // Have ALL branches called a constructor? int aAll = (cs & (CSXthis_ctor | CSXsuper_ctor)) != 0; int bAll = (callSuper & (CSXthis_ctor | CSXsuper_ctor)) != 0; // Have ANY branches called a constructor? bool aAny = (cs & CSXany_ctor) != 0; bool bAny = (callSuper & CSXany_ctor) != 0; // Have any branches returned? bool aRet = (cs & CSXreturn) != 0; bool bRet = (callSuper & CSXreturn) != 0; // Have any branches halted? bool aHalt = (cs & CSXhalt) != 0; bool bHalt = (callSuper & CSXhalt) != 0; bool ok = true; if (aHalt && bHalt) { callSuper = CSXhalt; } else if ((!aHalt && aRet && !aAny && bAny) || (!bHalt && bRet && !bAny && aAny)) { // If one has returned without a constructor call, there must be never // have been ctor calls in the other. ok = false; } else if (aHalt || aRet && aAll) { // If one branch has called a ctor and then exited, anything the // other branch has done is OK (except returning without a // ctor call, but we already checked that). callSuper |= cs & (CSXany_ctor | CSXlabel); } else if (bHalt || bRet && bAll) { callSuper = cs | (callSuper & (CSXany_ctor | CSXlabel)); } else { // Both branches must have called ctors, or both not. ok = (aAll == bAll); // If one returned without a ctor, we must remember that // (Don't bother if we've already found an error) if (ok && aRet && !aAny) callSuper |= CSXreturn; callSuper |= cs & (CSXany_ctor | CSXlabel); } if (!ok) error(loc, "one path skips constructor"); } } extern (C++) uint* saveFieldInit() { uint* fi = null; if (fieldinit) // copy { size_t dim = fieldinit_dim; fi = cast(uint*)mem.xmalloc(uint.sizeof * dim); for (size_t i = 0; i < dim; i++) fi[i] = fieldinit[i]; } return fi; } extern (C++) void mergeFieldInit(Loc loc, uint* fies) { if (fieldinit && fies) { FuncDeclaration f = func; if (fes) f = fes.func; auto ad = f.isMember2(); assert(ad); for (size_t i = 0; i < ad.fields.dim; i++) { VarDeclaration v = ad.fields[i]; bool mustInit = (v.storage_class & STCnodefaultctor || v.type.needsNested()); if (!.mergeFieldInit(loc, fieldinit[i], fies[i], mustInit)) { .error(loc, "one path skips field %s", ad.fields[i].toChars()); } } } } extern (C++) Module instantiatingModule() { // TODO: in speculative context, returning 'module' is correct? return minst ? minst : _module; } /************************************ * Perform unqualified name lookup by following the chain of scopes up * until found. * * Params: * loc = location to use for error messages * ident = name to look up * pscopesym = if supplied and name is found, set to scope that ident was found in * flags = modify search based on flags * * Returns: * symbol if found, null if not */ extern (C++) Dsymbol search(Loc loc, Identifier ident, Dsymbol* pscopesym, int flags = IgnoreNone) { version (LOGSEARCH) { printf("Scope.search(%p, '%s' flags=x%x)\n", &this, ident.toChars(), flags); // Print scope chain for (Scope* sc = &this; sc; sc = sc.enclosing) { if (!sc.scopesym) continue; printf("\tscope %s\n", sc.scopesym.toChars()); } static void printMsg(string txt, Dsymbol s) { printf("%.*s %s.%s, kind = '%s'\n", cast(int)msg.length, msg.ptr, s.parent ? s.parent.toChars() : "", s.toChars(), s.kind()); } } // This function is called only for unqualified lookup assert(!(flags & (SearchLocalsOnly | SearchImportsOnly))); /* If ident is "start at module scope", only look at module scope */ if (ident == Id.empty) { // Look for module scope for (Scope* sc = &this; sc; sc = sc.enclosing) { assert(sc != sc.enclosing); if (!sc.scopesym) continue; if (Dsymbol s = sc.scopesym.isModule()) { //printMsg("\tfound", s); if (pscopesym) *pscopesym = sc.scopesym; return s; } } return null; } Dsymbol searchScopes(int flags) { for (Scope* sc = &this; sc; sc = sc.enclosing) { assert(sc != sc.enclosing); if (!sc.scopesym) continue; //printf("\tlooking in scopesym '%s', kind = '%s', flags = x%x\n", sc.scopesym.toChars(), sc.scopesym.kind(), flags); if (sc.scopesym.isModule()) flags |= SearchUnqualifiedModule; // tell Module.search() that SearchLocalsOnly is to be obeyed if (Dsymbol s = sc.scopesym.search(loc, ident, flags)) { if (!(flags & (SearchImportsOnly | IgnoreErrors)) && ident == Id.length && sc.scopesym.isArrayScopeSymbol() && sc.enclosing && sc.enclosing.search(loc, ident, null, flags)) { warning(s.loc, "array 'length' hides other 'length' name in outer scope"); } //printMsg("\tfound local", s); if (pscopesym) *pscopesym = sc.scopesym; return s; } // Stop when we hit a module, but keep going if that is not just under the global scope if (sc.scopesym.isModule() && !(sc.enclosing && !sc.enclosing.enclosing)) break; } return null; } if (this.flags & SCOPEignoresymbolvisibility) flags |= IgnoreSymbolVisibility; Dsymbol sold = void; if (global.params.bug10378 || global.params.check10378) { sold = searchScopes(flags | IgnoreSymbolVisibility); if (!global.params.check10378) return sold; if (ident == Id.dollar) // Bugzilla 15825 return sold; // Search both ways } // First look in local scopes Dsymbol s = searchScopes(flags | SearchLocalsOnly); version (LOGSEARCH) if (s) printMsg("-Scope.search() found local", s); if (!s) { // Second look in imported modules s = searchScopes(flags | SearchImportsOnly); version (LOGSEARCH) if (s) printMsg("-Scope.search() found import", s); /** Still find private symbols, so that symbols that weren't access * checked by the compiler remain usable. Once the deprecation is over, * this should be moved to search_correct instead. */ if (!s && !(flags & IgnoreSymbolVisibility)) { s = searchScopes(flags | SearchLocalsOnly | IgnoreSymbolVisibility); if (!s) s = searchScopes(flags | SearchImportsOnly | IgnoreSymbolVisibility); if (s && !(flags & IgnoreErrors)) .deprecation(loc, "%s is not visible from module %s", s.toPrettyChars(), _module.toChars()); version (LOGSEARCH) if (s) printMsg("-Scope.search() found imported private symbol", s); } } if (global.params.check10378) { alias snew = s; if (sold !is snew) deprecation10378(loc, sold, snew); if (global.params.bug10378) s = sold; } return s; } /* A helper function to show deprecation message for new name lookup rule. */ extern (C++) static void deprecation10378(Loc loc, Dsymbol sold, Dsymbol snew) { // Bugzilla 15857 // // The overloadset found via the new lookup rules is either // equal or a subset of the overloadset found via the old // lookup rules, so it suffices to compare the dimension to // check for equality. OverloadSet osold, osnew; if (sold && (osold = sold.isOverloadSet()) !is null && snew && (osnew = snew.isOverloadSet()) !is null && osold.a.dim == osnew.a.dim) return; OutBuffer buf; buf.writestring("local import search method found "); if (osold) buf.printf("%s %s (%d overloads)", sold.kind(), sold.toPrettyChars(), cast(int) osold.a.dim); else if (sold) buf.printf("%s %s", sold.kind(), sold.toPrettyChars()); else buf.writestring("nothing"); buf.writestring(" instead of "); if (osnew) buf.printf("%s %s (%d overloads)", snew.kind(), snew.toPrettyChars(), cast(int) osnew.a.dim); else if (snew) buf.printf("%s %s", snew.kind(), snew.toPrettyChars()); else buf.writestring("nothing"); deprecation(loc, buf.peekString()); } extern (C++) Dsymbol search_correct(Identifier ident) { if (global.gag) return null; // don't do it for speculative compiles; too time consuming /************************************************ * Given the failed search attempt, try to find * one with a close spelling. */ extern (D) void* scope_search_fp(const(char)* seed, ref int cost) { //printf("scope_search_fp('%s')\n", seed); /* If not in the lexer's string table, it certainly isn't in the symbol table. * Doing this first is a lot faster. */ size_t len = strlen(seed); if (!len) return null; Identifier id = Identifier.lookup(seed, len); if (!id) return null; Scope* sc = &this; Module.clearCache(); Dsymbol scopesym = null; Dsymbol s = sc.search(Loc(), id, &scopesym, IgnoreErrors); if (s) { for (cost = 0; sc; sc = sc.enclosing, ++cost) if (sc.scopesym == scopesym) break; if (scopesym != s.parent) { ++cost; // got to the symbol through an import if (s.prot().kind == PROTprivate) return null; } } return cast(void*)s; } return cast(Dsymbol)speller(ident.toChars(), &scope_search_fp, idchars); } extern (C++) Dsymbol insert(Dsymbol s) { if (VarDeclaration vd = s.isVarDeclaration()) { if (lastVar) vd.lastVar = lastVar; lastVar = vd; } else if (WithScopeSymbol ss = s.isWithScopeSymbol()) { if (VarDeclaration vd = ss.withstate.wthis) { if (lastVar) vd.lastVar = lastVar; lastVar = vd; } return null; } for (Scope* sc = &this; sc; sc = sc.enclosing) { //printf("\tsc = %p\n", sc); if (sc.scopesym) { //printf("\t\tsc.scopesym = %p\n", sc.scopesym); if (!sc.scopesym.symtab) sc.scopesym.symtab = new DsymbolTable(); return sc.scopesym.symtabInsert(s); } } assert(0); } /******************************************** * Search enclosing scopes for ClassDeclaration. */ extern (C++) ClassDeclaration getClassScope() { for (Scope* sc = &this; sc; sc = sc.enclosing) { if (!sc.scopesym) continue; ClassDeclaration cd = sc.scopesym.isClassDeclaration(); if (cd) return cd; } return null; } /******************************************** * Search enclosing scopes for ClassDeclaration. */ extern (C++) AggregateDeclaration getStructClassScope() { for (Scope* sc = &this; sc; sc = sc.enclosing) { if (!sc.scopesym) continue; AggregateDeclaration ad = sc.scopesym.isClassDeclaration(); if (ad) return ad; ad = sc.scopesym.isStructDeclaration(); if (ad) return ad; } return null; } /******************************************* * For TemplateDeclarations, we need to remember the Scope * where it was declared. So mark the Scope as not * to be free'd. */ extern (C++) void setNoFree() { //int i = 0; //printf("Scope::setNoFree(this = %p)\n", this); for (Scope* sc = &this; sc; sc = sc.enclosing) { //printf("\tsc = %p\n", sc); sc.nofree = 1; assert(!(flags & SCOPEfree)); //assert(sc != sc.enclosing); //assert(!sc.enclosing || sc != sc.enclosing.enclosing); //if (++i == 10) // assert(0); } } extern (D) this(ref Scope sc) { this._module = sc._module; this.scopesym = sc.scopesym; this.sds = sc.sds; this.enclosing = sc.enclosing; this.parent = sc.parent; this.sw = sc.sw; this.tf = sc.tf; this.os = sc.os; this.tinst = sc.tinst; this.minst = sc.minst; this.sbreak = sc.sbreak; this.scontinue = sc.scontinue; this.fes = sc.fes; this.callsc = sc.callsc; this.aligndecl = sc.aligndecl; this.func = sc.func; this.slabel = sc.slabel; this.linkage = sc.linkage; this.cppmangle = sc.cppmangle; this.inlining = sc.inlining; this.protection = sc.protection; this.explicitProtection = sc.explicitProtection; this.stc = sc.stc; this.depdecl = sc.depdecl; this.inunion = sc.inunion; this.nofree = sc.nofree; this.noctor = sc.noctor; this.intypeof = sc.intypeof; this.lastVar = sc.lastVar; this.callSuper = sc.callSuper; this.fieldinit = sc.fieldinit; this.fieldinit_dim = sc.fieldinit_dim; this.flags = sc.flags; this.lastdc = sc.lastdc; this.anchorCounts = sc.anchorCounts; this.prevAnchor = sc.prevAnchor; this.userAttribDecl = sc.userAttribDecl; } structalign_t alignment() { if (aligndecl) return aligndecl.getAlignment(&this); else return STRUCTALIGN_DEFAULT; } }
D
instance PIR_1352_Addon_AlligatorJack(Npc_Default) { name[0] = "Аллигатор Джек"; guild = GIL_PIR; id = 1352; voice = 12; flags = 0; npcType = npctype_main; aivar[AIV_FollowDist] = 800; B_SetAttributesToChapter(self,4); level = 1; fight_tactic = FAI_HUMAN_MASTER; EquipItem(self,ItMw_Piratensaebel); CreateInvItems(self,ItPo_Health_02,4); B_SetNpcVisual(self,MALE,"Hum_Head_FatBald",Face_B_CorAngar,BodyTex_B,ITAR_PIR_M_Addon); Mdl_SetModelFatness(self,1.5); Mdl_ApplyOverlayMds(self,"Humans_Relaxed.mds"); B_GiveNpcTalents(self); B_SetFightSkills(self,90); daily_routine = Rtn_PreStart_1352; }; func void Rtn_PreStart_1352() { TA_Stand_Eating(5,0,20,0,"ADW_ENTRANCE_2_PIRATECAMP_01"); TA_Stand_Eating(20,0,5,0,"ADW_ENTRANCE_2_PIRATECAMP_01"); }; func void Rtn_Start_1352() { TA_Sleep(23,0,6,0,"ADW_PIRATECAMP_AJ_04"); TA_Cook_Pan(6,0,8,30,"AD_PIRATECAMP_AJ_03"); TA_Sit_Campfire(8,30,12,0,"AD_PIRATECAMP_AJ_03"); TA_Stand_ArmsCrossed(12,30,19,0,"ADW_PIRATECAMP_WAY_07"); TA_Cook_Pan(19,0,20,30,"AD_PIRATECAMP_AJ_03"); TA_Sit_Campfire(20,30,23,0,"AD_PIRATECAMP_AJ_03"); }; func void Rtn_Hunt1_1352() { TA_Guide_Player(1,0,13,0,"ADW_PIRATECAMP_WAY_16"); TA_Guide_Player(13,0,1,0,"ADW_PIRATECAMP_WAY_16"); }; func void Rtn_Hunt2_1352() { TA_Guide_Player(1,0,13,0,"ADW_PIRATECAMP_WATERHOLE_07"); TA_Guide_Player(13,0,1,0,"ADW_PIRATECAMP_WATERHOLE_07"); }; func void Rtn_Hunt3_1352() { TA_Guide_Player(1,0,13,0,"ADW_PIRATECAMP_WAY_16"); TA_Guide_Player(13,0,1,0,"ADW_PIRATECAMP_WAY_16"); }; func void Rtn_Hunt4_1352() { TA_Guide_Player(1,0,13,0,"ADW_CANYON_TELEPORT_PATH_06"); TA_Guide_Player(13,0,1,0,"ADW_CANYON_TELEPORT_PATH_06"); }; func void Rtn_PIRATECAMP_1352() { TA_Guide_Player(1,0,13,0,"ADW_PIRATECAMP_WAY_07"); TA_Guide_Player(13,0,1,0,"ADW_PIRATECAMP_WAY_07"); }; func void Rtn_GregIsBack_1352() { TA_Sleep(3,0,6,0,"ADW_PIRATECAMP_AJ_04"); TA_Cook_Pan(6,0,7,0,"AD_PIRATECAMP_AJ_03"); TA_Stand_ArmsCrossed(7,0,10,0,"ADW_PIRATECAMP_WAY_07"); TA_Sit_Campfire(10,0,11,0,"AD_PIRATECAMP_AJ_03"); TA_Stand_ArmsCrossed(11,30,16,0,"ADW_PIRATECAMP_WAY_07"); TA_Cook_Pan(16,0,17,0,"AD_PIRATECAMP_AJ_03"); TA_Stand_ArmsCrossed(17,0,20,0,"ADW_PIRATECAMP_WAY_07"); TA_Sit_Campfire(20,0,21,0,"AD_PIRATECAMP_AJ_03"); TA_Stand_ArmsCrossed(21,0,0,0,"ADW_PIRATECAMP_WAY_07"); TA_Sit_Campfire(0,0,1,0,"AD_PIRATECAMP_AJ_03"); TA_Stand_ArmsCrossed(1,0,3,0,"ADW_PIRATECAMP_WAY_07"); }; func void Rtn_Follow_1352() { TA_Follow_Player(5,0,20,0,"ADW_CANYON_TELEPORT_PATH_06"); TA_Follow_Player(20,0,5,0,"ADW_CANYON_TELEPORT_PATH_06"); }; func void rtn_espionage1_1352() { TA_Guide_Player(1,0,13,0,"ADW_CANYON_PATH_TO_BANDITS_61"); TA_Guide_Player(13,0,1,0,"ADW_CANYON_PATH_TO_BANDITS_61"); };
D
/* * PS3 Media Server, for streaming any medias to your PS3. * Copyright (C) 2008 A.Brochard * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ module net.pms.network.UPNPHelper; import net.pms.PMS; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.exceptions; import java.net.all; import java.text.SimpleDateFormat; import java.util.all; /** * Helper class to handle the UPnP traffic that makes PMS discoverable by other clients. * See http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.0.pdf * and http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1-AnnexA.pdf * for the specifications. */ public class UPNPHelper { private static Logger LOGGER; private const static String CRLF = "\r\n"; private const static String ALIVE = "ssdp:alive"; /** * IPv4 Multicast channel reserved for SSDP by Internet Assigned Numbers Authority (IANA). * MUST be 239.255.255.250. */ private const static String IPV4_UPNP_HOST = "239.255.255.250"; /** * IPv6 Multicast channel reserved for SSDP by Internet Assigned Numbers Authority (IANA). * MUST be [FF02::C]. */ private const static String IPV6_UPNP_HOST = "[FF02::C]"; /** * Multicast channel reserved for SSDP by Internet Assigned Numbers Authority (IANA). * MUST be 1900. */ private const static int UPNP_PORT = 1900; private const static String BYEBYE = "ssdp:byebye"; private static Thread listener; private static Thread aliveThread; private static SimpleDateFormat sdf; static this() { LOGGER = LoggerFactory.getLogger!UPNPHelper(); sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US); } /** * Send UPnP discovery search message to discover devices of interest on * the network. * * @param host The multicast channel * @param port The multicast port * @param st The search target string * @throws IOException */ private static void sendDiscover(String host, int port, String st) { String usn = PMS.get().usn(); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); if (st.opEquals(usn)) { usn = ""; } else { usn ~= "::"; } String discovery = "HTTP/1.1 200 OK" ~ CRLF ~ "CACHE-CONTROL: max-age=1200" ~ CRLF ~ "DATE: " ~ sdf.format(new Date(System.currentTimeMillis())) ~ " GMT" ~ CRLF ~ "LOCATION: http://" ~ PMS.get().getServer().getHost() ~ ":" ~ PMS.get().getServer().getPort() ~ "/description/fetch" ~ CRLF ~ "SERVER: " ~ PMS.get().getServerName() ~ CRLF ~ "ST: " ~ st ~ CRLF ~ "EXT: " ~ CRLF ~ "USN: " ~ usn ~ st ~ CRLF ~ "Content-Length: 0" ~ CRLF ~ CRLF; sendReply(host, port, discovery); } private static void sendReply(String host, int port, String msg) { try { DatagramSocket ssdpUniSock = new DatagramSocket(); logger.trace("Sending this reply [" ~ host ~ ":" ~ port ~ "]: " ~ StringUtils.replace(msg, CRLF, "<CRLF>")); InetAddress inetAddr = InetAddress.getByName(host); DatagramPacket dgmPacket = new DatagramPacket(msg.getBytes(), msg.length(), inetAddr, port); ssdpUniSock.send(dgmPacket); ssdpUniSock.close(); } catch (Exception ex) { logger.info(ex.getMessage()); } } public static void sendAlive() { logger._debug("Sending ALIVE..."); MulticastSocket ssdpSocket = getNewMulticastSocket(); sendMessage(ssdpSocket, "upnp:rootdevice", ALIVE); sendMessage(ssdpSocket, PMS.get().usn(), ALIVE); sendMessage(ssdpSocket, "urn:schemas-upnp-org:device:MediaServer:1", ALIVE); sendMessage(ssdpSocket, "urn:schemas-upnp-org:service:ContentDirectory:1", ALIVE); sendMessage(ssdpSocket, "urn:schemas-upnp-org:service:ConnectionManager:1", ALIVE); ssdpSocket.close(); ssdpSocket = null; } private static MulticastSocket getNewMulticastSocket() { MulticastSocket ssdpSocket = new MulticastSocket(); ssdpSocket.setReuseAddress(true); NetworkInterface ni = NetworkConfiguration.getInstance().getNetworkInterfaceByServerName(); if (ni !is null) { ssdpSocket.setNetworkInterface(ni); // force IPv4 address Enumeration/*<InetAddress>*/ enm = ni.getInetAddresses(); while (enm.hasMoreElements()) { InetAddress ia = enm.nextElement(); if (!(cast(Inet6Address)ia !is null)) { ssdpSocket.setInterface(ia); break; } } } else if (PMS.get().getServer().getNetworkInterface() !is null) { logger.trace("Setting multicast network interface: " ~ PMS.get().getServer().getNetworkInterface()); ssdpSocket.setNetworkInterface(PMS.get().getServer().getNetworkInterface()); } logger.trace("Sending message from multicast socket on network interface: " ~ ssdpSocket.getNetworkInterface()); logger.trace("Multicast socket is on interface: " ~ ssdpSocket.getInterface()); ssdpSocket.setTimeToLive(32); ssdpSocket.joinGroup(getUPNPAddress()); logger.trace("Socket Timeout: " ~ ssdpSocket.getSoTimeout()); logger.trace("Socket TTL: " ~ ssdpSocket.getTimeToLive()); return ssdpSocket; } public static void sendByeBye() { logger.info("Sending BYEBYE..."); MulticastSocket ssdpSocket = getNewMulticastSocket(); sendMessage(ssdpSocket, "upnp:rootdevice", BYEBYE); sendMessage(ssdpSocket, "urn:schemas-upnp-org:device:MediaServer:1", BYEBYE); sendMessage(ssdpSocket, "urn:schemas-upnp-org:service:ContentDirectory:1", BYEBYE); sendMessage(ssdpSocket, "urn:schemas-upnp-org:service:ConnectionManager:1", BYEBYE); ssdpSocket.leaveGroup(getUPNPAddress()); ssdpSocket.close(); ssdpSocket = null; } private static void sleep(int delay) { try { Thread.sleep(delay); } catch (InterruptedException e) { } } private static void sendMessage(DatagramSocket socket, String nt, String message) { String msg = buildMsg(nt, message); Random rand = new Random(); //logger.trace( "Sending this SSDP packet: " ~ CRLF ~ msg);// StringUtils.replace(msg, CRLF, "<CRLF>")); DatagramPacket ssdpPacket = new DatagramPacket(msg.getBytes(), msg.length(), getUPNPAddress(), UPNP_PORT); socket.send(ssdpPacket); sleep(rand.nextInt(1800 / 2)); socket.send(ssdpPacket); sleep(rand.nextInt(1800 / 2)); } private static int delay = 10000; public static void listen() { Runnable rAlive = dgRunnable( { while (true) { try { Thread.sleep(delay); sendAlive(); if (delay == 20000) // every 180s { delay = 180000; } if (delay == 10000) // after 10, and 30s { delay = 20000; } } catch (Exception e) { logger._debug("Error while sending periodic alive message: " ~ e.getMessage()); } } }); aliveThread = new Thread(rAlive, "UPNP-AliveMessageSender"); aliveThread.start(); Runnable r = dgRunnable( { bool bindErrorReported = false; while (true) { try { // Use configurable source port as per http://code.google.com/p/ps3mediaserver/issues/detail?id=1166 MulticastSocket socket = new MulticastSocket(PMS.getConfiguration().getUpnpPort()); if (bindErrorReported) { logger.warn("Finally, acquiring port " ~ PMS.getConfiguration().getUpnpPort() ~ " was successful!"); } NetworkInterface ni = NetworkConfiguration.getInstance().getNetworkInterfaceByServerName(); if (ni !is null) { socket.setNetworkInterface(ni); } else if (PMS.get().getServer().getNetworkInterface() !is null) { logger.trace("Setting multicast network interface: " ~ PMS.get().getServer().getNetworkInterface()); socket.setNetworkInterface(PMS.get().getServer().getNetworkInterface()); } socket.setTimeToLive(4); socket.setReuseAddress(true); socket.joinGroup(getUPNPAddress()); while (true) { byte[] buf = new byte[1024]; DatagramPacket packet_r = new DatagramPacket(buf, buf.length); socket.receive(packet_r); String s = new String(packet_r.getData()); InetAddress address = packet_r.getAddress(); if (s.startsWith("M-SEARCH")) { String remoteAddr = address.getHostAddress(); int remotePort = packet_r.getPort(); if (PMS.getConfiguration().getIpFiltering().allowed(address)) { logger.trace("Receiving a M-SEARCH from [" ~ remoteAddr ~ ":" ~ remotePort ~ "]"); if (StringUtils.indexOf(s, "urn:schemas-upnp-org:service:ContentDirectory:1") > 0) { sendDiscover(remoteAddr, remotePort, "urn:schemas-upnp-org:service:ContentDirectory:1"); } if (StringUtils.indexOf(s, "upnp:rootdevice") > 0) { sendDiscover(remoteAddr, remotePort, "upnp:rootdevice"); } if (StringUtils.indexOf(s, "urn:schemas-upnp-org:device:MediaServer:1") > 0) { sendDiscover(remoteAddr, remotePort, "urn:schemas-upnp-org:device:MediaServer:1"); } if (StringUtils.indexOf(s, PMS.get().usn()) > 0) { sendDiscover(remoteAddr, remotePort, PMS.get().usn()); } } } else if (s.startsWith("NOTIFY")) { String remoteAddr = address.getHostAddress(); int remotePort = packet_r.getPort(); logger.trace("Receiving a NOTIFY from [" ~ remoteAddr ~ ":" ~ remotePort ~ "]"); } } } catch (BindException e) { if (!bindErrorReported) { logger.error("Unable to bind to " ~ PMS.getConfiguration().getUpnpPort() ~ ", which means that PMS will not automatically appear on your renderer! " ~ "This usually means that another program occupies the port. Please " ~ "stop the other program and free up the port. " ~ "PMS will keep trying to bind to it...[" ~ e.getMessage() ~ "]"); } bindErrorReported = true; sleep(5000); } catch (IOException e) { logger.error("UPNP network exception", e); sleep(1000); } } }); listener = new Thread(r, "UPNPHelper"); listener.start(); } public static void shutDownListener() { listener.interrupt(); aliveThread.interrupt(); } private static String buildMsg(String nt, String message) { StringBuilder sb = new StringBuilder(); sb.append("NOTIFY * HTTP/1.1" ~ CRLF); sb.append("HOST: " ~ IPV4_UPNP_HOST ~ ":").append(UPNP_PORT).append(CRLF); sb.append("NT: ").append(nt).append(CRLF); sb.append("NTS: ").append(message).append(CRLF); if (message.opEquals(ALIVE)) { sb.append("LOCATION: http://").append(PMS.get().getServer().getHost()).append(":").append(PMS.get().getServer().getPort()).append("/description/fetch" ~ CRLF); } sb.append("USN: ").append(PMS.get().usn()); if (!nt.opEquals(PMS.get().usn())) { sb.append("::").append(nt); } sb.append(CRLF); if (message.opEquals(ALIVE)) { sb.append("CACHE-CONTROL: max-age=1800" ~ CRLF); } if (message.opEquals(ALIVE)) { sb.append("SERVER: ").append(PMS.get().getServerName()).append(CRLF); } sb.append(CRLF); return sb.toString(); } private static InetAddress getUPNPAddress() { return InetAddress.getByAddress(IPV4_UPNP_HOST, [cast(byte) 239, cast(byte) 255, cast(byte) 255, cast(byte) 250]); } }
D
module mar.endian; import mar.flag; version (BigEndian) { alias BigEndianOf(T) = EndianOf!(T, No.flip); alias LittleEndianOf(T) = EndianOf!(T, Yes.flip); } else // LittleEndian { alias BigEndianOf(T) = EndianOf!(T, Yes.flip); alias LittleEndianOf(T) = EndianOf!(T, No.flip); } struct EndianOf(T, Flag!"flip" flip) { union { private ubyte[T.sizeof] bytes; private T value; } this(T value) { this.value = value; } T getRawValue() const { return value; } T toHostEndian() const { pragma(inline, true); static if (flip) return cast(T)swapEndian(value); else return cast(T)value; } import mar.wrap; mixin WrapperFor!("value"); mixin WrapOpEquals!(No.includeWrappedType); // Note: do not use OpCmpIntegral because it assumes // the values are in native endian. // I could use it if I wrap the toHostEndian field // instead of "value" though. } BigEndianOf!T toBigEndian(T)(T value) pure nothrow @nogc { pragma(inline, true); version (BigEndian) return BigEndianOf!T(value); else return BigEndianOf!T(swapEndian(value)); } LittleEndianOf!T toLittleEndian(T)(T value) pure nothrow @nogc { pragma(inline, true); version (LittleEndian) return LittleEndianOf!T(value); else return LittleEndianOf!T(swapEndian(value)); } ushort swapEndian(ushort val) pure nothrow @nogc { return ((val & 0xff00U) >> 8) | ((val & 0x00ffU) << 8); } uint swapEndian(uint val) pure nothrow @nogc { return ((val >> 24U) & 0x000000ff) | ((val << 8U) & 0x00ff0000) | ((val >> 8U) & 0x0000ff00) | ((val << 24U) & 0xff000000); }
D
/** * Compiler implementation of the * $(LINK2 http://www.dlang.org, D programming language). * * Copyright: Copyright (C) 1994-1998 by Symantec * Copyright (c) 2000-2017 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/outbuf.d, backend/outbuf.d) */ module dmd.backend.outbuf; // Online documentation: https://dlang.org/phobos/dmd_backend_outbuf.html import core.stdc.string; // Output buffer // (This used to be called OutBuffer, we renamed it to avoid name conflicts with Mars.) extern (C++): struct Outbuffer { ubyte *buf; // the buffer itself ubyte *pend; // pointer past the end of the buffer ubyte *p; // current position in buffer ubyte *origbuf; // external buffer //this(); this(size_t initialSize); // : buf(null), pend(null), p(null), origbuf(null) { } this(ubyte *bufx, size_t bufxlen, uint incx) { buf = bufx; pend = bufx + bufxlen; p = bufx; origbuf = bufx; } //~this(); void reset(); // Reserve nbytes in buffer void reserve(size_t nbytes) { if (pend - p < nbytes) enlarge(nbytes); } // Reserve nbytes in buffer void enlarge(size_t nbytes); // Write n zeros; return pointer to start of zeros void *writezeros(size_t n); // Position buffer to accept the specified number of bytes at offset void position(size_t offset, size_t nbytes); // Write an array to the buffer, no reserve check void writen(const void *b, size_t len) { memcpy(p,b,len); p += len; } // Clear bytes, no reserve check void clearn(size_t len) { for (size_t i = 0; i < len; i++) *p++ = 0; } // Write an array to the buffer. void write(const(void)* b, size_t len); void write(Outbuffer *b) { write(b.buf,b.p - b.buf); } /** * Flushes the stream. This will write any buffered * output bytes. */ void flush() { } /** * Writes an 8 bit byte, no reserve check. */ void writeByten(ubyte v) { *p++ = v; } /** * Writes an 8 bit byte. */ void writeByte(int v) { if (pend == p) reserve(1); *p++ = cast(ubyte)v; } /** * Writes a 16 bit little-end short, no reserve check. */ void writeWordn(int v) { version (LittleEndian) { *cast(ushort *)p = cast(ushort)v; } else { p[0] = v; p[1] = v >> 8; } p += 2; } /** * Writes a 16 bit little-end short. */ void writeWord(int v) { reserve(2); writeWordn(v); } /** * Writes a 16 bit big-end short. */ void writeShort(int v) { if (pend - p < 2) reserve(2); ubyte *q = p; q[0] = cast(ubyte)(v >> 8); q[1] = cast(ubyte)v; p += 2; } /** * Writes a 16 bit char. */ void writeChar(int v) { writeShort(v); } /** * Writes a 32 bit int. */ void write32(int v); /** * Writes a 64 bit long. */ void write64(long v); /** * Writes a 32 bit float. */ void writeFloat(float v); /** * Writes a 64 bit double. */ void writeDouble(double v); void write(const(char)* s); void write(const(ubyte)* s); void writeString(const(char)* s); void prependBytes(const(char)* s); void prepend(const(void)* b, size_t len); void bracket(char c1,char c2); /** * Returns the number of bytes written. */ size_t size() { return p - buf; } char *toString(); void setsize(size_t size); void writesLEB128(int value); void writeuLEB128(uint value); }
D
/** <script type="text/javascript">inhibitQuickIndex = 1</script> $(BOOKTABLE , $(TR $(TH Category) $(TH Functions) ) $(TR $(TDNW Parsing UUIDs) $(TD $(MYREF parseUUID) $(MYREF UUID(string)) $(MYREF UUIDParsingException) $(MYREF uuidRegex) ) ) $(TR $(TDNW Generating UUIDs) $(TD $(MYREF sha1UUID) $(MYREF randomUUID) $(MYREF md5UUID)) ) $(TR $(TDNW Using UUIDs) $(TD $(MYREF2 UUID.uuidVersion, uuidVersion) $(MYREF2 UUID.variant, variant) $(MYREF2 UUID.toString, toString) $(MYREF2 UUID.data, data) $(MYREF2 UUID.swap, swap) $(MYREF2 UUID.opEquals, opEquals) $(MYREF2 UUID.opCmp, opCmp) $(MYREF2 UUID.toHash, toHash) ) ) $(TR $(TDNW UUID namespaces) $(TD $(MYREF dnsNamespace) $(MYREF urlNamespace) $(MYREF oidNamespace) $(MYREF x500Namespace) ) ) ) * A $(LINK2 http://en.wikipedia.org/wiki/Universally_unique_identifier, UUID), or * $(LINK2 http://en.wikipedia.org/wiki/Universally_unique_identifier, Universally unique identifier), * is intended to uniquely identify information in a distributed environment * without significant central coordination. It can be * used to tag objects with very short lifetimes, or to reliably identify very * persistent objects across a network. * * UUIDs have many applications. Some examples follow: Databases may use UUIDs to identify * rows or records in order to ensure that they are unique across different * databases, or for publication/subscription services. Network messages may be * identified with a UUID to ensure that different parts of a message are put back together * again. Distributed computing may use UUIDs to identify a remote procedure call. * Transactions and classes involved in serialization may be identified by UUIDs. * Microsoft's component object model (COM) uses UUIDs to distinguish different software * component interfaces. UUIDs are inserted into documents from Microsoft Office programs. * UUIDs identify audio or video streams in the Advanced Systems Format (ASF). UUIDs are * also a basis for OIDs (object identifiers), and URNs (uniform resource name). * * An attractive feature of UUIDs when compared to alternatives is their relative small size, * of 128 bits, or 16 bytes. Another is that the creation of UUIDs does not require * a centralized authority. * * When UUIDs are generated by one of the defined mechanisms, they are either guaranteed * to be unique, different from all other generated UUIDs (that is, it has never been * generated before and it will never be generated again), or it is extremely likely * to be unique (depending on the mechanism). * * For efficiency, UUID is implemented as a struct. UUIDs are therefore empty if not explicitly * initialized. An UUID is empty if $(MYREF3 UUID.empty, empty) is true. Empty UUIDs are equal to * $(D UUID.init), which is a UUID with all 16 bytes set to 0. * Use UUID's constructors or the UUID generator functions to get an initialized UUID. * * This is a port of $(LINK2 http://www.boost.org/doc/libs/1_42_0/libs/uuid/uuid.html, * boost._uuid) from the Boost project with some minor additions and API * changes for a more D-like API. * * Examples: * ------------------------ * UUID[] ids; * ids ~= randomUUID(); * ids ~= md5UUID("test.name.123"); * ids ~= sha1UUID("test.name.123"); * * foreach(entry; ids) * { * assert(entry.variant == UUID.Variant.rfc4122); * } * * assert(ids[0].uuidVersion == UUID.Version.randomNumberBased); * assert(ids[1].toString() == "22390768-cced-325f-8f0f-cfeaa19d0ccd"); * assert(ids[1].data == [34, 57, 7, 104, 204, 237, 50, 95, 143, 15, 207, * 234, 161, 157, 12, 205]); * * UUID id; * assert(id.empty); * * ------------------------ * Standards: * $(LINK2 http://www.ietf.org/rfc/rfc4122.txt, RFC 4122) * * See_Also: * $(LINK http://en.wikipedia.org/wiki/Universally_unique_identifier) * * Copyright: Copyright Johannes Pfau 2011 - . * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a> * Authors: Johannes Pfau * Source: $(PHOBOSSRC std/_uuid.d) * * Macros: * MYREF = <font face='Consolas, "Bitstream Vera Sans Mono", "Andale Mono", Monaco, "DejaVu Sans Mono", "Lucida Console", monospace'><a href="#$1">$1</a>&nbsp;</font> * MYREF2 = <font face='Consolas, "Bitstream Vera Sans Mono", "Andale Mono", Monaco, "DejaVu Sans Mono", "Lucida Console", monospace'><a href="#$2">$1</a>&nbsp;</font> * MYREF3 = <a href="#$2">$(D $1)</a> */ /* Copyright Johannes Pfau 2011 - 2012. * 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.uuid; import std.algorithm, std.array, std.ascii; import std.conv, std.random, std.range, std.string, std.traits, std.md5; //import std.crypto.hash.sha; //import std.crypto.hash.md5; /** * */ public struct UUID { private: @safe nothrow pure char toChar(size_t i) const { if(i <= 9) return cast(char)('0' + i); else return cast(char)('a' + (i-10)); } @safe nothrow pure char[36] _toString() const { char[36] result; size_t i=0; foreach(entry; this.data) { const size_t hi = (entry >> 4) & 0x0F; result[i++] = toChar(hi); const size_t lo = (entry) & 0x0F; result[i++] = toChar(lo); if (i == 8 || i == 13 || i == 18 || i == 23) { result[i++] = '-'; } } return result; } unittest { assert(UUID(cast(ubyte[16])[138, 179, 6, 14, 44, 186, 79, 35, 183, 76, 181, 45, 179, 189, 251, 70])._toString() == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); } public: /** * RFC 4122 defines different internal data layouts for UUIDs. These are * the UUID formats supported by this module. It's * possible to read, compare and use all these Variants, but * UUIDs generated by this module will always be in rfc4122 format. * * Note: Do not confuse this with $(XREF _variant, _Variant). This has nothing * to do with $(XREF _variant, _Variant). */ enum Variant { ncs, /// NCS backward compatibility rfc4122, /// Defined in RFC 4122 document microsoft, /// Microsoft Corporation backward compatibility future ///Reserved for future use } /** * RFC 4122 defines different UUID versions. The version shows * how a UUID was generated, e.g. a version 4 UUID was generated * from a random number, a version 3 UUID from an MD5 hash of a name. * * Note: * All of these UUID versions can be read and processed by * $(D std.uuid), but only version 3, 4 and 5 UUIDs can be generated. */ enum Version { ///Unknown version unknown = -1, ///Version 1 timeBased = 1, ///Version 2 dceSecurity = 2, ///Version 3 (Name based + MD5) nameBasedMD5 = 3, ///Version 4 (Random) randomNumberBased = 4, ///Version 5 (Name based + SHA-1) nameBasedSHA1 = 5 } /** * It is sometimes useful to get or set the 16 bytes of a UUID * directly. * * Note: * UUID uses a 16-ubyte representation for the UUID data. * RFC 4122 defines a UUID as a special structure in big-endian * format. These 16-ubytes always equal the big-endian structure * defined in RFC 4122. * * Examples: * ----------------------------------------------- * auto rawData = uuid.data; //get data * rawData[0] = 1; //modify * uuid.data = rawData; //set data * uuid.data[1] = 2; //modify directly * ----------------------------------------------- */ ubyte[16] data; /* * We could use a union here to also provide access to the * fields specified in RFC 4122, but as we never have to access * those (only necessary for version 1 (and maybe 2) UUIDs), * that is not needed right now. */ unittest { UUID tmp; tmp.data = cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11,12, 13,14,15]; assert(tmp.data == cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11, 12,13,14,15]); tmp.data[2] = 3; assert(tmp.data == cast(ubyte[16])[0,1,3,3,4,5,6,7,8,9,10,11, 12,13,14,15]); auto tmp2 = cast(immutable UUID)tmp; assert(tmp2.data == cast(ubyte[16])[0,1,3,3,4,5,6,7,8,9,10,11, 12,13,14,15]); } /** * Construct a UUID struct from the 16 byte representation * of a UUID. * * Examples: * ------------------------- * ubyte[16] data = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; * auto tmp = UUID(data); * assert(tmp.data == data); * ------------------------- */ @safe pure nothrow this()(ubyte[16] uuidData) { data = uuidData; } unittest { ubyte[16] data = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; auto tmp = UUID(data); assert(tmp.data == data); enum UUID ctfeID = UUID(cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11,12, 13,14,15]); assert(ctfeID == tmp); } /+ Not Working! DMD interprets the ubyte literals as ints, then complains the int can't be converted to ubyte! /** * Construct a UUID struct from the 16 byte representation * of a UUID. Variadic constructor to allow a simpler syntax, see examples. * You need to pass exactly 16 ubytes. * * Examples: * ------------------------- * auto tmp = UUID(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); * assert(tmp.data == cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11, * 12,13,14,15]); * ------------------------- */ @safe pure nothrow this()(ubyte[16] uuidData...) { data = uuidData; } unittest { UUID tmp = UUID(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); assert(tmp.data == cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11, 12,13,14,15]); enum UUID ctfeID = UUID(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); assert(ctfeID == tmp); //Too few arguments assert(!__traits(compiles, typeof(UUID(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14)))); //Too many arguments assert(!__traits(compiles, typeof(UUID(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1)))); } ++/ /** * <a name="UUID(string)"></a> * Parse a UUID from its canonical string form. An UUID in its * canonical form looks like this: 8ab3060e-2cba-4f23-b74c-b52db3bdfb46 * * Throws: * $(LREF UUIDParsingException) if the input is invalid * * CTFE: * This function is supported in CTFE code. Note that error messages * caused by a malformed UUID parsed at compile time can be cryptic, * but errors are detected and reported at * compile time. * * Note: * This is a strict parser. It only accepts the pattern above. * It doesn't support any leading or trailing characters. It only * accepts characters used for hex numbers and the string must have * hyphens exactly like above. * * For a less strict parser, see $(LREF parseUUID) * * Examples: * ------------------------- * id = UUID("8AB3060E-2cba-4f23-b74c-b52db3bdfb46"); * assert(id.data == [138, 179, 6, 14, 44, 186, 79, 35, 183, 76, * 181, 45, 179, 189, 251, 70]); * assert(id.toString() == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); * * //Can also be used in CTFE, for example as UUID literals: * enum ctfeID = UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); * //here parsing is done at compile time, no runtime overhead! * ------------------------- * * BUGS: Could be pure, but this depends on parse!(string, 16). */ @trusted this(T)(T[] uuid) if(isSomeChar!(Unqual!T)) { if(uuid.length < 36) { throw new UUIDParsingException(to!string(uuid), 0, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); } if(uuid.length > 36) { throw new UUIDParsingException(to!string(uuid), 35, UUIDParsingException.Reason.tooMuch, "Input is too long, need exactly 36 characters"); } ubyte[16] data2; //ctfe bug size_t element = 0, pairStart = -1; foreach(pos, dchar character; uuid) { if(pos == 8 || pos == 13 || pos == 18 || pos == 23) { if(character != '-') { throw new UUIDParsingException(to!string(uuid), pos, UUIDParsingException.Reason.invalidChar, "Expected '-'"); } } else { if(pairStart == -1) pairStart = pos; else { try { data2[element++] = parse!ubyte(uuid[pairStart .. pos+1], 16); pairStart = -1; } catch(Exception e) { throw new UUIDParsingException(to!string(uuid), pos, UUIDParsingException.Reason.invalidChar, "Couldn't parse ubyte", e); } } } } assert(element <= 16); if(element < 16) { throw new UUIDParsingException(to!string(uuid), 0, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); } this.data = data2; } unittest { import std.exception; import std.typetuple; foreach(S; TypeTuple!(char[], const(char)[], immutable(char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[], immutable(char[]), immutable(wchar[]), immutable(dchar[]))) { //Test valid, working cases assert(UUID(to!S("00000000-0000-0000-0000-000000000000")).empty); auto id = UUID(to!S("8AB3060E-2cba-4f23-b74c-b52db3bdfb46")); assert(id.data == [138, 179, 6, 14, 44, 186, 79, 35, 183, 76, 181, 45, 179, 189, 251, 70]); assert(id.toString() == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); enum UUID ctfe = UUID(to!S("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); assert(ctfe == id); assert(UUID(to!S("5668122d-9df0-49a4-ad0b-b9b0a57f886a")).data == [86, 104, 18, 45, 157, 240, 73, 164, 173, 11, 185, 176, 165, 127, 136, 106]); //Test too short UUIDS auto except = collectException!UUIDParsingException( UUID(to!S("5668122d-9df0-49a4-ad0b-b9b0a57f886"))); assert(except && except.reason == UUIDParsingException.Reason.tooLittle); //Test too long UUIDS except = collectException!UUIDParsingException( UUID(to!S("5668122d-9df0-49a4-ad0b-b9b0a57f886aa"))); assert(except && except.reason == UUIDParsingException.Reason.tooMuch); //Test dashes except = collectException!UUIDParsingException( UUID(to!S("8ab3060e2cba-4f23-b74c-b52db3bdfb-46"))); assert(except && except.reason == UUIDParsingException.Reason.invalidChar); //Test dashes 2 except = collectException!UUIDParsingException( UUID(to!S("8ab3-060e2cba-4f23-b74c-b52db3bdfb46"))); assert(except && except.reason == UUIDParsingException.Reason.invalidChar); //Test invalid characters //make sure 36 characters in total or we'll get a 'tooMuch' reason except = collectException!UUIDParsingException( UUID(to!S("{8ab3060e-2cba-4f23-b74c-b52db3bdf6}"))); assert(except && except.reason == UUIDParsingException.Reason.invalidChar); //Boost test assert(UUID(to!S("01234567-89ab-cdef-0123-456789ABCDEF")) == UUID(cast(ubyte[16])[0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef])); } } /** * Returns true if and only if the UUID is equal * to {00000000-0000-0000-0000-000000000000} * * Examples: * ------------------------- * UUID id; * assert(id.empty); * id = UUID("00000000-0000-0000-0000-000000000001"); * assert(!id.empty); * ------------------------- */ @trusted pure nothrow @property bool empty() const { if(__ctfe) return find!"a!=0"(data[]).empty; //simple auto p = cast(const(size_t*))data.ptr; static if(size_t.sizeof == 4) return p[0] == 0 && p[1] == 0 && p[2] == 0 && p[3] == 0; else static if(size_t.sizeof == 8) return p[0] == 0 && p[1] == 0; else static assert(false, "nonsense, it's not 32 or 64 bit"); } unittest { UUID id; assert(id.empty); ubyte[16] getData(size_t i) { ubyte[16] data; data[i] = 1; return data; } for(size_t i = 0; i < 16; i++) { assert(!UUID(getData(i)).empty); } enum ctfeEmpty = UUID.init.empty; assert(ctfeEmpty); bool ctfeTest() { for(size_t i = 0; i < 16; i++) { auto ctfeEmpty2 = UUID(getData(i)).empty; assert(!ctfeEmpty2); } return true; } enum res = ctfeTest(); } /** * RFC 4122 defines different internal data layouts for UUIDs. * Returns the format used by this UUID. * * Note: Do not confuse this with $(XREF _variant, _Variant). This has nothing * to do with $(XREF _variant, _Variant). The type of this property is * $(MYREF3 std.uuid.UUID.Variant, _Variant). * * See_Also: * $(MYREF3 UUID.Variant, Variant) * * Examples: * ------------------------ * assert(UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46").variant * == UUID.Variant.rfc4122); * ------------------------ */ @safe pure nothrow @property Variant variant() const { //variant is stored in octet 7 //which is index 8, since indexes count backwards auto octet7 = data[8]; //octet 7 is array index 8 if((octet7 & 0x80) == 0x00) //0b0xxxxxxx return Variant.ncs; else if((octet7 & 0xC0) == 0x80) //0b10xxxxxx return Variant.rfc4122; else if((octet7 & 0xE0) == 0xC0) //0b110xxxxx return Variant.microsoft; else { //assert((octet7 & 0xE0) == 0xE0, "Unknown UUID variant!") //0b111xxxx return Variant.future; } } //Verify Example. unittest { assert(UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46").variant == UUID.Variant.rfc4122); } unittest { Variant[ubyte] tests = cast(Variant[ubyte])[0x00 : Variant.ncs, 0x10 : Variant.ncs, 0x20 : Variant.ncs, 0x30 : Variant.ncs, 0x40 : Variant.ncs, 0x50 : Variant.ncs, 0x60 : Variant.ncs, 0x70 : Variant.ncs, 0x80 : Variant.rfc4122, 0x90 : Variant.rfc4122, 0xa0 : Variant.rfc4122, 0xb0 : Variant.rfc4122, 0xc0 : Variant.microsoft, 0xd0 : Variant.microsoft, 0xe0 : Variant.future, 0xf0 : Variant.future]; foreach(key, value; tests) { UUID u; u.data[8] = key; assert(u.variant == value); } } /** * RFC 4122 defines different UUID versions. The version shows * how a UUID was generated, e.g. a version 4 UUID was generated * from a random number, a version 3 UUID from an MD5 hash of a name. * Returns the version used by this UUID. * * See_Also: * $(MYREF3 UUID.Version, Version) * * Examples: * ---------------------------- * assert(UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46").uuidVersion * == UUID.Version.randomNumberBased); * ---------------------------- */ @safe pure nothrow @property Version uuidVersion() const { //version is stored in octet 9 //which is index 6, since indexes count backwards auto octet9 = data[6]; if ((octet9 & 0xF0) == 0x10) return Version.timeBased; else if ((octet9 & 0xF0) == 0x20) return Version.dceSecurity; else if ((octet9 & 0xF0) == 0x30) return Version.nameBasedMD5; else if ((octet9 & 0xF0) == 0x40) return Version.randomNumberBased; else if ((octet9 & 0xF0) == 0x50) return Version.nameBasedSHA1; else return Version.unknown; } //Verify Example. unittest { assert(UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46").uuidVersion == UUID.Version.randomNumberBased); } unittest { Version[ubyte] tests = cast(Version[ubyte]) [ 0x00 : UUID.Version.unknown, 0x10 : UUID.Version.timeBased, 0x20 : UUID.Version.dceSecurity, 0x30 : UUID.Version.nameBasedMD5, 0x40 : UUID.Version.randomNumberBased, 0x50 : UUID.Version.nameBasedSHA1, 0x60 : UUID.Version.unknown, 0x70 : UUID.Version.unknown, 0x80 : UUID.Version.unknown, 0x90 : UUID.Version.unknown, 0xa0 : UUID.Version.unknown, 0xb0 : UUID.Version.unknown, 0xc0 : UUID.Version.unknown, 0xd0 : UUID.Version.unknown, 0xe0 : UUID.Version.unknown, 0xf0 : UUID.Version.unknown]; foreach(key, value; tests) { UUID u; u.data[6] = key; assert(u.uuidVersion == value); } } /** * Swap the data of this UUID with the data of rhs. * * Note: linear complexity * * Examples: * ---------------------------- * UUID u1; * auto u2 = UUID(cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]); * u1.swap(u2); * * assert(u1.data == cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]); * assert(u2.data == cast(ubyte[16])[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]); * ---------------------------- */ @safe nothrow void swap(ref UUID rhs) { std.algorithm.swap(this.data, rhs.data); } unittest { UUID u1; auto u2 = UUID(cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]); u1.swap(u2); auto values1 = cast(ubyte[16])[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; auto values2 = cast(ubyte[16])[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; assert(u1.data == values2); assert(u2.data == values1); u1.swap(u2); assert(u2.data == values2); assert(u1.data == values1); } /** * All of the standard numeric operators are defined for * the UUID struct. * * Examples: * ------------------------- * //compare UUIDs * assert(UUID("00000000-0000-0000-0000-000000000000") == UUID.init); * * //UUIDs in associative arrays: * int[UUID] test = [UUID("8a94f585-d180-44f7-8929-6fca0189c7d0") : 1, * UUID("7c351fd4-b860-4ee3-bbdc-7f79f3dfb00a") : 2, * UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1") : 3]; * * assert(test[UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1")] == 3); * * //UUIDS can be sorted: * import std.algorithm; * UUID[] ids = [UUID("8a94f585-d180-44f7-8929-6fca0189c7d0"), * UUID("7c351fd4-b860-4ee3-bbdc-7f79f3dfb00a"), * UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1")]; * sort(ids); * ------------------------- */ @safe pure nothrow bool opEquals(const UUID s) const { return s.data == this.data; } /** * ditto */ @safe pure nothrow bool opEquals(ref const UUID s) const { return s.data == this.data; } /** * ditto */ @safe pure nothrow int opCmp(ref const UUID s) const { return cmp(this.data[], s.data[]); } /** * ditto */ @safe pure nothrow int opCmp(const UUID s) const { return cmp(this.data[], s.data[]); } /** * ditto */ @safe pure nothrow size_t toHash() const { size_t seed = 0; foreach(entry; this.data) seed ^= cast(size_t)entry + 0x9e3779b9 + (seed << 6) + (seed >> 2); return seed; } unittest { assert(UUID("00000000-0000-0000-0000-000000000000") == UUID.init); int[UUID] test = [UUID("8a94f585-d180-44f7-8929-6fca0189c7d0") : 1, UUID("7c351fd4-b860-4ee3-bbdc-7f79f3dfb00a") : 2, UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1") : 3]; assert(test[UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1")] == 3); import std.algorithm; UUID[] ids = [UUID("8a94f585-d180-44f7-8929-6fca0189c7d0"), UUID("7c351fd4-b860-4ee3-bbdc-7f79f3dfb00a"), UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1")]; sort(ids); auto id2 = ids.dup; ids = [UUID("7c351fd4-b860-4ee3-bbdc-7f79f3dfb00a"), UUID("8a94f585-d180-44f7-8929-6fca0189c7d0"), UUID("9ac0a4e5-10ee-493a-86fc-d29eeb82ecc1")]; sort(ids); assert(ids == id2); //test comparsion UUID u1; UUID u2 = UUID(cast(ubyte[16])[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]); UUID u3 = UUID(cast(ubyte[16])[255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255]); assert(u1 == u1); assert(u1 != u2); assert(u1 < u2); assert(u2 < u3); assert(u1 <= u1); assert(u1 <= u2); assert(u2 <= u3); assert(u2 >= u2); assert(u3 >= u2); assert(u3 >= u3); assert(u2 >= u1); assert(u3 >= u1); // test hash assert(u1.toHash() != u2.toHash()); assert(u2.toHash() != u3.toHash()); assert(u3.toHash() != u1.toHash()); } /** * Return the UUID as a string in the canonical form. * * Examples: * ---------------------------------- * auto id = UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); * assert(id.toString() == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); * ---------------------------------- */ void toString(scope void delegate(const(char)[]) sink) const { sink(_toString()); } ///ditto @safe pure nothrow string toString() const { //@@@BUG@@@ workaround for bugzilla 5700 try return _toString().idup; catch(Exception) assert(0, "It should be impossible for idup to throw."); } unittest { auto u1 = UUID(cast(ubyte[16])[138, 179, 6, 14, 44, 186, 79, 35, 183, 76, 181, 45, 179, 189, 251, 70]); assert(u1.toString() == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); u1 = UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); assert(u1.toString() == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); char[] buf; void sink(const(char)[] data) { buf ~= data; } u1.toString(&sink); assert(buf == "8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); } } unittest { assert(UUID.init.empty); } /** * This function generates a name based (Version 3) UUID from a namespace UUID and a name. * If no namespace UUID was passed, the empty UUID $(D UUID.init) is used. * * Note: * The default namespaces ($(LREF dnsNamespace), ...) defined by * this module should be used when appropriate. * * RFC 4122 recommends to use Version 5 UUIDs (SHA-1) instead of Version 3 * UUIDs (MD5) for new applications. * * CTFE: * CTFE is currently not supported as $(D std.md5) doesn't work in CTFE. * * Examples: * --------------------------------------- * //Use default UUID.init namespace * auto simpleID = md5UUID("test.uuid.any.string"); * * //use a name-based id as namespace * auto namespace = md5UUID("my.app"); * auto id = md5UUID("some-description", namespace); * --------------------------------------- * * Note: * RFC 4122 isn't very clear on how UUIDs should be generated from names. * It is possible that different implementations return different UUIDs * for the same input, so be warned. The implementation for UTF-8 strings * and byte arrays used by $(D std.uuid) is compatible with Boost's implementation. * $(D std.uuid) guarantees that the same input to this function will generate * the same output at any time, on any system (this especially means endianness * doesn't matter). * * Note: * This function does not provide overloads for wstring and dstring, as * there's no clear answer on how that should be implemented. It could be * argued, that string, wstring and dstring input should have the same output, * but that wouldn't be compatible with Boost, which generates different output * for strings and wstrings. It's always possible to pass wstrings and dstrings * by using the ubyte[] function overload (but be aware of endianness issues!). * * BUGS: Could be pure, but this depends on the MD5 hash code. */ @safe UUID md5UUID(const(char[]) name, const UUID namespace = UUID.init) { return md5UUID(cast(const(ubyte[]))name, namespace); } /** * ditto */ @trusted UUID md5UUID(const(ubyte[]) data, const UUID namespace = UUID.init) { MD5_CTX hash; hash.start(); /* * NOTE: RFC 4122 says namespace should be converted to big-endian. * We always keep the UUID data in big-endian representation, so * that's fine */ hash.update(namespace.data); hash.update(data); UUID u; hash.finish(u.data); //set variant //must be 0b10xxxxxx u.data[8] &= 0b10111111; u.data[8] |= 0b10000000; //set version //must be 0b0011xxxx u.data[6] &= 0b00111111; u.data[6] |= 0b00110000; return u; } unittest { auto simpleID = md5UUID("test.uuid.any.string"); assert(simpleID.data == cast(ubyte[16])[126, 206, 86, 72, 29, 233, 62, 213, 178, 139, 198, 136, 188, 135, 153, 123]); auto namespace = md5UUID("my.app"); auto id = md5UUID("some-description", namespace); assert(id.data == cast(ubyte[16])[166, 138, 167, 79, 48, 219, 55, 166, 170, 103, 39, 73, 216, 150, 144, 164]); auto constTest = md5UUID(cast(const(char)[])"test"); constTest = md5UUID(cast(const(char[]))"test"); char[] mutable = "test".dup; id = md5UUID(mutable, namespace); const(ubyte)[] data = cast(ubyte[])[0,1,2,244,165,222]; id = md5UUID(data); assert(id.data == cast(ubyte[16])[16, 50, 29, 247, 243, 185, 61, 178, 157, 100, 253, 236, 73, 76, 51, 47]); assert(id.variant == UUID.Variant.rfc4122); assert(id.uuidVersion == UUID.Version.nameBasedMD5); auto correct = UUID("3d813cbb-47fb-32ba-91df-831e1593ac29"); auto u = md5UUID("www.widgets.com", dnsNamespace); //enum ctfeId = md5UUID("www.widgets.com", dnsNamespace); //assert(ctfeId == u); assert(u == correct); assert(u.variant == UUID.Variant.rfc4122); assert(u.uuidVersion == UUID.Version.nameBasedMD5); } /+ FIXME: need 3 more unittests: have to check simlpeID.data and id.data (to make sure we have the same result on all systems, especially considering endianess). id.data needs to be checked for the ubyte case as well /** * This function generates a name based (Version 5) UUID from a namespace * UUID and a name. * If no namespace UUID was passed, the empty UUID $(D UUID.init) is used. * * Note: * The default namespaces ($(LREF dnsNamespace), ...) defined by * this module should be used when appropriate. * * CTFE: * As long as Phobos has no standard SHA-1 implementation, CTFE support * for this function can't be guaranteed. CTFE support will depend on * whether the SHA-1 implementation supports CTFE. * * Examples: * --------------------------------------- * //Use default UUID.init namespace * auto simpleID = sha1UUID("test.uuid.any.string"); * * //use a name-based id as namespace * auto namespace = sha1UUID("my.app"); * auto id = sha1UUID("some-description", namespace); * --------------------------------------- * * Note: * RFC 4122 isn't very clear on how UUIDs should be generated from names. * It is possible that different implementations return different UUIDs * for the same input, so be warned. The implementation for UTF-8 strings * and byte arrays used by $(D std.uuid) is compatible with Boost's implementation. * $(D std.uuid) guarantees that the same input to this function will generate * the same output at any time, on any system (this especially means endianness * doesn't matter). * * Note: * This function does not provide overloads for wstring and dstring, as * there's no clear answer on how that should be implemented. It could be * argued, that string, wstring and dstring input should have the same output, * but that wouldn't be compatible with Boost, which generates different output * for strings and wstrings. It's always possible to pass wstrings and dstrings * by using the ubyte[] function overload (but be aware of endianness issues!). * * BUGS: Could be pure, but this depends on the SHA-1 hash code. */ @trusted UUID sha1UUID(const(char[]) name, const UUID namespace = UUID.init) { return sha1UUID(cast(const(ubyte[]))name, namespace); } /** * ditto */ @trusted UUID sha1UUID(const(ubyte[]) data, const UUID namespace = UUID.init) { SHA1 sha = new SHA1(); /* * NOTE: RFC 4122 says namespace should be converted to big-endian. * We always keep the UUID data in big-endian representation, so * that's fine */ sha.put(namespace.data); sha.put(data); UUID u; sha.finish(u.data[]); //set variant //must be 0b10xxxxxx u.data[8] &= 0b10111111; u.data[8] |= 0b10000000; //set version //must be 0b0101xxxx u.data[6] &= 0b01011111; u.data[6] |= 0b01010000; return u; } unittest { auto simpleID = sha1UUID("test.uuid.any.string"); auto namespace = sha1UUID("my.app"); auto id = sha1UUID("some-description", namespace); auto constTest = sha1UUID(cast(const(char)[])"test"); constTest = sha1UUID(cast(const(char[]))"test"); char[] mutable = "test".dup; id = sha1UUID(mutable, namespace); const(ubyte)[] data = cast(ubyte[])[0,1,2,244,165,222]; id = sha1UUID(data); auto correct = UUID("21f7f8de-8051-5b89-8680-0195ef798b6a"); auto u = sha1UUID("www.widgets.com", dnsNamespace); assert(u == correct); assert(u.variant == UUID.Variant.rfc4122); assert(u.uuidVersion == UUID.Version.nameBasedSHA1); } +/ /** * This function generates a random number based UUID from a random * number generator. * * CTFE: * This function is not supported at compile time. * * Examples: * ------------------------------------------ * //simple call * auto uuid = randomUUID(); * * //provide a custom RNG. Must be seeded manually. * Xorshift192 gen; * * gen.seed(unpredictableSeed()); * auto uuid3 = randomUUID(gen); * ------------------------------------------ */ @trusted UUID randomUUID()() { return randomUUID(rndGen); } /* * Original boost.uuid used Mt19937, we don't want * to use anything worse than that. If Random is changed * to something else, this assert and the randomUUID function * have to be updated. */ static assert(is(typeof(rndGen) == Mt19937)); /** * ditto */ UUID randomUUID(RNG)(ref RNG randomGen) if(isUniformRNG!(RNG) && isIntegral!(typeof(RNG.front))) { enum size_t elemSize = typeof(RNG.front).sizeof; static assert(elemSize <= 16); UUID u; foreach(size_t i; iota(cast(size_t)0, cast(size_t)16, elemSize)) { randomGen.popFront(); immutable randomValue = randomGen.front; u.data[i .. i + elemSize] = *cast(ubyte[elemSize]*)&randomValue; } //set variant //must be 0b10xxxxxx u.data[8] &= 0b10111111; u.data[8] |= 0b10000000; //set version //must be 0b0100xxxx u.data[6] &= 0b01001111; u.data[6] |= 0b01000000; return u; } unittest { import std.random; //simple call auto uuid = randomUUID(); //provide a custom RNG. Must be seeded manually. Xorshift192 gen; gen.seed(unpredictableSeed()); auto uuid3 = randomUUID(gen); auto u1 = randomUUID(); auto u2 = randomUUID(); assert(u1 != u2); assert(u1.variant == UUID.Variant.rfc4122); assert(u1.uuidVersion == UUID.Version.randomNumberBased); } /** * This is a less strict parser compared to the parser used in the * UUID constructor. It enforces the following rules: * * $(UL * $(LI hex numbers are always two hexdigits([0-9a-fA-F])) * $(LI there must be exactly 16 such pairs in the input, not less, not more) * $(LI there can be exactly one dash between two hex-pairs, but not more) * $(LI there can be multiple characters enclosing the 16 hex pairs, * as long as these characters do not contain [0-9a-fA-F]) * ) * * Throws: * $(LREF UUIDParsingException) if the input is invalid * * CTFE: * This function is supported in CTFE code. Note that error messages * caused by a malformed UUID parsed at compile time can be cryptic, * but errors are detected and reported at compile time. * * Examples: * ------------------------- * auto id = parseUUID("8AB3060E-2CBA-4F23-b74c-B52Db3BDFB46"); * //no dashes * id = parseUUID("8ab3060e2cba4f23b74cb52db3bdfb46"); * //dashes at different positions * id = parseUUID("8a-b3-06-0e2cba4f23b74c-b52db3bdfb-46"); * //leading / trailing characters * id = parseUUID("{8ab3060e-2cba-4f23-b74c-b52db3bdfb46}"); * //unicode * id = parseUUID("ü8ab3060e2cba4f23b74cb52db3bdfb46ü"); * //multiple trailing/leading characters * id = parseUUID("///8ab3060e2cba4f23b74cb52db3bdfb46||"); * * //Can also be used in CTFE, for example as UUID literals: * enum ctfeID = parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); * //here parsing is done at compile time, no runtime overhead! * ------------------------- * * BUGS: Could be pure, but this depends on parse!(string, 16). */ @trusted UUID parseUUID(T)(T uuidString) if(isSomeString!T) { return parseUUID(uuidString); } ///ditto UUID parseUUID(Range)(ref Range uuidRange) if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar)) { static if(isForwardRange!Range) auto errorCopy = uuidRange.save; void parserError(size_t pos, UUIDParsingException.Reason reason, string message, Throwable next = null, string file = __FILE__, size_t line = __LINE__) { static if(isForwardRange!Range) { static if(isInfinite!Range) { throw new UUIDParsingException(to!string(take(errorCopy, pos)), pos, reason, message, next, file, line); } else { throw new UUIDParsingException(to!string(errorCopy), pos, reason, message, next, file, line); } } else { throw new UUIDParsingException("", pos, reason, message, next, file, line); } } static if(hasLength!Range) { if(uuidRange.length < 32) { throw new UUIDParsingException(to!string(uuidRange), 0, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); } } UUID result; size_t consumed; size_t element = 0; //skip garbage size_t skip() { size_t skipped; while(!uuidRange.empty && !isHexDigit(uuidRange.front)) { skipped++; uuidRange.popFront(); } return skipped; } consumed += skip(); if(uuidRange.empty) parserError(consumed, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); bool dashAllowed = false; parseLoop: while(!uuidRange.empty) { dchar character = uuidRange.front; if(character == '-') { if(!dashAllowed) parserError(consumed, UUIDParsingException.Reason.invalidChar, "Unexpected '-'"); else dashAllowed = false; consumed++; } else if(!isHexDigit(character)) { parserError(consumed, UUIDParsingException.Reason.invalidChar, "Unexpected character (wanted a hexDigit)"); } else { try { consumed += 2; static if(isSomeString!Range) { if(uuidRange.length < 2) { parserError(consumed, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); } result.data[element++] = parse!ubyte(uuidRange[0 .. 2], 16); uuidRange.popFront(); } else { dchar[2] copyBuf; copyBuf[0] = character; uuidRange.popFront(); if(uuidRange.empty) { parserError(consumed, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); } copyBuf[1] = uuidRange.front; result.data[element++] = parse!ubyte(copyBuf[], 16); } if(element == 16) { uuidRange.popFront(); break parseLoop; } dashAllowed = true; } catch(ConvException e) { parserError(consumed, UUIDParsingException.Reason.invalidChar, "Couldn't parse ubyte", e); } } uuidRange.popFront(); } assert(element <= 16); if(element < 16) parserError(consumed, UUIDParsingException.Reason.tooLittle, "Insufficient Input"); consumed += skip(); if(!uuidRange.empty) parserError(consumed, UUIDParsingException.Reason.invalidChar, "Unexpected character"); return result; } unittest { import std.exception; import std.typetuple; struct TestRange(bool forward) { dstring input; @property dchar front() { return input.front; } void popFront() { input.popFront(); } @property bool empty() { return input.empty; } static if(forward) { @property TestRange!true save() { return this; } } } alias TestRange!false TestInputRange; alias TestRange!true TestForwardRange; assert(isInputRange!TestInputRange); assert(is(ElementType!TestInputRange == dchar)); assert(isInputRange!TestForwardRange); assert(isForwardRange!TestForwardRange); assert(is(ElementType!TestForwardRange == dchar)); //Helper function for unittests - Need to pass ranges by ref UUID parseHelper(T)(string input) { static if(is(T == TestInputRange) || is(T == TestForwardRange)) { T range = T(to!dstring(input)); return parseUUID(range); } else return parseUUID(to!T(input)); } foreach(S; TypeTuple!(char[], const(char)[], immutable(char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[], immutable(char[]), immutable(wchar[]), immutable(dchar[]), TestForwardRange, TestInputRange)) { //Verify examples. auto id = parseHelper!S("8AB3060E-2CBA-4F23-b74c-B52Db3BDFB46"); //no dashes id = parseHelper!S("8ab3060e2cba4f23b74cb52db3bdfb46"); //dashes at different positions id = parseHelper!S("8a-b3-06-0e2cba4f23b74c-b52db3bdfb-46"); //leading / trailing characters id = parseHelper!S("{8ab3060e-2cba-4f23-b74c-b52db3bdfb46}"); //unicode id = parseHelper!S("ü8ab3060e2cba4f23b74cb52db3bdfb46ü"); //multiple trailing/leading characters id = parseHelper!S("///8ab3060e2cba4f23b74cb52db3bdfb46||"); enum ctfeId = parseHelper!S("8ab3060e-2cba-4f23-b74c-b52db3bdfb46"); assert(parseHelper!S("8AB3060E-2cba-4f23-b74c-b52db3bdfb46") == ctfeId); //Test valid, working cases assert(parseHelper!S("00000000-0000-0000-0000-000000000000").empty); assert(parseHelper!S("8AB3060E-2CBA-4F23-b74c-B52Db3BDFB46").data == [138, 179, 6, 14, 44, 186, 79, 35, 183, 76, 181, 45, 179, 189, 251, 70]); assert(parseHelper!S("5668122d-9df0-49a4-ad0b-b9b0a57f886a").data == [86, 104, 18, 45, 157, 240, 73, 164, 173, 11, 185, 176, 165, 127, 136, 106]); //wstring / dstring assert(parseHelper!S("5668122d-9df0-49a4-ad0b-b9b0a57f886a").data == [86, 104, 18, 45, 157, 240, 73, 164, 173, 11, 185, 176, 165, 127, 136, 106]); assert(parseHelper!S("5668122d-9df0-49a4-ad0b-b9b0a57f886a").data == [86, 104, 18, 45, 157, 240, 73, 164, 173, 11, 185, 176, 165, 127, 136, 106]); //Test too short UUIDS auto except = collectException!UUIDParsingException( parseHelper!S("5668122d-9df0-49a4-ad0b-b9b0a57f886")); assert(except && except.reason == UUIDParsingException.Reason.tooLittle); //Test too long UUIDS except = collectException!UUIDParsingException( parseHelper!S("5668122d-9df0-49a4-ad0b-b9b0a57f886aa")); assert(except && except.reason == UUIDParsingException.Reason.invalidChar); //Test too long UUIDS 2 except = collectException!UUIDParsingException( parseHelper!S("5668122d-9df0-49a4-ad0b-b9b0a57f886a-aa")); assert(except && except.reason == UUIDParsingException.Reason.invalidChar); //Test dashes assert(parseHelper!S("8ab3060e2cba-4f23-b74c-b52db3bdfb46") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); assert(parseHelper!S("8ab3-060e2cba-4f23-b74c-b52db3bdfb46") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); assert(parseHelper!S("8ab3060e2cba4f23b74cb52db3bdfb46") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); except = collectException!UUIDParsingException( parseHelper!S("8-ab3060e2cba-4f23-b74c-b52db3bdfb46")); assert(except && except.reason == UUIDParsingException.Reason.invalidChar); //Test leading/trailing characters assert(parseHelper!S("{8ab3060e-2cba-4f23-b74c-b52db3bdfb46}") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); assert(parseHelper!S("{8ab3060e2cba4f23b74cb52db3bdfb46}") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); //Boost test auto u_increasing = UUID(cast(ubyte[16])[0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef]); assert(parseHelper!S("0123456789abcdef0123456789ABCDEF") == UUID(cast(ubyte[16])[0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef])); //unicode assert(parseHelper!S("ü8ab3060e2cba4f23b74cb52db3bdfb46ü") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); //multiple trailing/leading characters assert(parseHelper!S("///8ab3060e2cba4f23b74cb52db3bdfb46||") == parseUUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46")); } } /** * Default namespace from RFC 4122 * * Name string is a fully-qualified domain name */ enum dnsNamespace = UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); /** * Default namespace from RFC 4122 * * Name string is a URL */ enum urlNamespace = UUID("6ba7b811-9dad-11d1-80b4-00c04fd430c8"); /** * Default namespace from RFC 4122 * * Name string is an ISO OID */ enum oidNamespace = UUID("6ba7b812-9dad-11d1-80b4-00c04fd430c8"); /** * Default namespace from RFC 4122 * * Name string is an X.500 DN (in DER or a text output format) */ enum x500Namespace = UUID("6ba7b814-9dad-11d1-80b4-00c04fd430c8"); /** * Regex string to extract UUIDs from text. * * Examples: * ------------------- * import std.algorithm; * import std.regex; * * string test = "Lorem ipsum dolor sit amet, consetetur " * "6ba7b814-9dad-11d1-80b4-00c04fd430c8 sadipscing \n" * "elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore \r\n" * "magna aliquyam erat, sed diam voluptua. " * "8ab3060e-2cba-4f23-b74c-b52db3bdfb46 At vero eos et accusam et " * "justo duo dolores et ea rebum."; * * auto r = regex(uuidRegex, "g"); * * UUID[] found; * foreach(c; match(test, r)) * { * found ~= UUID(c.hit); * } * * writeln(found); * ------------------- */ enum uuidRegex = r"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}" "-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"; unittest { import std.algorithm; import std.regex; string test = "Lorem ipsum dolor sit amet, consetetur " "6ba7b814-9dad-11d1-80b4-00c04fd430c8 sadipscing \n" "elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore \r\n" "magna aliquyam erat, sed diam voluptua. " "8ab3060e-2cba-4f23-b74c-b52db3bdfb46 At vero eos et accusam et " "justo duo dolores et ea rebum."; auto r = regex(uuidRegex, "g"); UUID[] found; foreach(c; match(test, r)) { found ~= UUID(c.hit); } assert(found.length == 2); assert(canFind(found, UUID("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))); assert(canFind(found, UUID("8ab3060e-2cba-4f23-b74c-b52db3bdfb46"))); } /** * This exception is thrown if an error occurs when parsing a UUID * from a string. */ public class UUIDParsingException : Exception { public: /** * The reason why parsing the UUID string failed (if known) */ enum Reason { unknown, /// tooLittle, ///The passed in input was correct, but more input was expected. tooMuch, ///The input data is too long (There's no guarantee the first part of the data is valid) invalidChar, ///Encountered an invalid character } ///ditto Reason reason; ///The original input string which should have been parsed. string input; ///The position in the input string where the error occurred. size_t position; private this(string input, size_t pos, Reason why = Reason.unknown, string msg = "", Throwable next = null, string file = __FILE__, size_t line = __LINE__) { input = input; position = pos; reason = why; string message = format("An error occured in the UUID parser: %s\n" ~ " * Input:\t'%s'\n * Position:\t%s", msg, replace(replace(input, "\r", "\\r"), "\n", "\\n"), pos); super(message, file, line, next); } }
D
/Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/Objects-normal/x86_64/Word+CoreDataClass.o : /Users/Michael/Desktop/Key9Pi/customKeyboard/SequenceModel.swift /Users/Michael/Desktop/Key9Pi/Key9pi/ColorPicker.swift /Users/Michael/Desktop/Key9Pi/Key9pi/ViewController.swift /Users/Michael/Desktop/Key9Pi/Key9pi/AppDelegate.swift /Users/Michael/Desktop/Key9Pi/customKeyboard/KeyboardViewController.swift /Users/Michael/Desktop/Key9Pi/customKeyboard/DictionaryModel.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Word+CoreDataClass.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Word+CoreDataProperties.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Key9pi+CoreDataModel.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/ObjectiveC.apinotesc /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/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/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /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/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /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/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.apinotesc /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/Objects-normal/x86_64/Word+CoreDataClass~partial.swiftmodule : /Users/Michael/Desktop/Key9Pi/customKeyboard/SequenceModel.swift /Users/Michael/Desktop/Key9Pi/Key9pi/ColorPicker.swift /Users/Michael/Desktop/Key9Pi/Key9pi/ViewController.swift /Users/Michael/Desktop/Key9Pi/Key9pi/AppDelegate.swift /Users/Michael/Desktop/Key9Pi/customKeyboard/KeyboardViewController.swift /Users/Michael/Desktop/Key9Pi/customKeyboard/DictionaryModel.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Word+CoreDataClass.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Word+CoreDataProperties.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Key9pi+CoreDataModel.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/ObjectiveC.apinotesc /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/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/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /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/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /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/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.apinotesc /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/Objects-normal/x86_64/Word+CoreDataClass~partial.swiftdoc : /Users/Michael/Desktop/Key9Pi/customKeyboard/SequenceModel.swift /Users/Michael/Desktop/Key9Pi/Key9pi/ColorPicker.swift /Users/Michael/Desktop/Key9Pi/Key9pi/ViewController.swift /Users/Michael/Desktop/Key9Pi/Key9pi/AppDelegate.swift /Users/Michael/Desktop/Key9Pi/customKeyboard/KeyboardViewController.swift /Users/Michael/Desktop/Key9Pi/customKeyboard/DictionaryModel.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Word+CoreDataClass.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Word+CoreDataProperties.swift /Users/Michael/Desktop/Key9Pi/DerivedData/Key9pi/Build/Intermediates/Key9pi.build/Debug-iphonesimulator/Key9pi.build/DerivedSources/CoreDataGenerated/Key9pi/Key9pi+CoreDataModel.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/ObjectiveC.apinotesc /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/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/CoreGraphics.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.apinotesc /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/CoreText.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.apinotesc /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/CoreData.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.apinotesc
D
// ************************************************************************* // Kapitel 1 // ************************************************************************* // ************************************************************************* // EXIT // ************************************************************************* INSTANCE Info_PsiNov_3_EXIT(C_INFO) { // npc wird in B_AssignAmbientInfos_PsiNov_3 (s.u.) jeweils gesetzt nr = 999; condition = Info_PsiNov_3_EXIT_Condition; information = Info_PsiNov_3_EXIT_Info; permanent = 1; description = "ENDE"; }; FUNC INT Info_PsiNov_3_EXIT_Condition() { return 1; }; FUNC VOID Info_PsiNov_3_EXIT_Info() { AI_StopProcessInfos (self); }; // ************************************************************************* // Einer von Euch werden // ************************************************************************* INSTANCE Info_PsiNov_3_EinerVonEuchWerden (C_INFO) // E1 { nr = 4; condition = Info_PsiNov_3_EinerVonEuchWerden_Condition; information = Info_PsiNov_3_EinerVonEuchWerden_Info; permanent = 1; description = "Wie kann ich mich diesem Lager anschliessen?"; }; FUNC INT Info_PsiNov_3_EinerVonEuchWerden_Condition() { if (SumpfNovize_Dabei == FALSE) && (Templer_Dabei == FALSE) && (HoherTempler_Dabei == FALSE) && (Guru_Dabei == FALSE) && (HoherGuru_Dabei == FALSE) { return TRUE; }; }; FUNC VOID Info_PsiNov_3_EinerVonEuchWerden_Info() { AI_Output(hero,self,"Info_PsiNov_3_EinerVonEuchWerden_15_00"); //Wie kann ich mich diesem Lager anschließen? AI_Output(self,hero,"Info_PsiNov_3_EinerVonEuchWerden_03_01"); //Das ist ganz einfach. Du musst einfach loslassen, Mann. AI_Output(self,hero,"Info_PsiNov_3_EinerVonEuchWerden_03_02"); //Sprich mit den Gurus, sie werden dich leiten! }; INSTANCE Info_PsiNov_3_Sumpfkrautruestung (C_INFO) // E1 { nr = 4; condition = Info_PsiNov_3_Sumpfkrautruestung_Condition; information = Info_PsiNov_3_Sumpfkrautruestung_Info; permanent = 0; important = 1; }; FUNC INT Info_PsiNov_3_Sumpfkrautruestung_Condition() { var C_Item RuessiCheck; RuessiCheck = Npc_GetEquippedArmor(hero); if (Hlp_IsItem(RuessiCheck, ItAr_Sumpfkraut) == TRUE) { return TRUE; }; }; FUNC VOID Info_PsiNov_3_Sumpfkrautruestung_Info() { AI_Output(self,hero,"Info_PsiNov_3_Sumpfkrautruestung_03_00"); //Man, das riecht ja wie ein ganzes Feld voll Sumpfkraut. }; // ************************************************************************* // Wichtige Personen // ************************************************************************* INSTANCE Info_PsiNov_3_WichtigePersonen(C_INFO) { nr = 3; condition = Info_PsiNov_3_WichtigePersonen_Condition; information = Info_PsiNov_3_WichtigePersonen_Info; permanent = 1; description = "Wer ist hier der Boss?"; }; FUNC INT Info_PsiNov_3_WichtigePersonen_Condition() { return 1; }; FUNC VOID Info_PsiNov_3_WichtigePersonen_Info() { AI_Output(hero,self,"Info_PsiNov_3_WichtigePersonen_15_00"); //Wer ist hier der Boss? AI_Output(self,hero,"Info_PsiNov_3_WichtigePersonen_03_01"); //Cor Cadar und Cor Angar! }; // ************************************************************************* // Das Lager (Orts-Infos) // ************************************************************************* INSTANCE Info_PsiNov_3_DasLager(C_INFO) { nr = 2; condition = Info_PsiNov_3_DasLager_Condition; information = Info_PsiNov_3_DasLager_Info; permanent = 1; description = "Was gibt es hier für wichtige Orte?"; }; FUNC INT Info_PsiNov_3_DasLager_Condition() { return 1; }; FUNC VOID Info_PsiNov_3_DasLager_Info() { AI_Output(hero,self,"Info_PsiNov_3_DasLager_15_00"); //Was gibt es hier für wichtige Orte? AI_Output(self,hero,"Info_PsiNov_3_DasLager_03_01"); //Es gibt Fortuno, er verteilt freies Sumpfkraut für alle Anhänger der Sekte. AI_Output(self,hero,"Info_PsiNov_3_DasLager_03_02"); //Du findest ihn unter Cor Kaloms altem Alchemielabor. }; // ************************************************************************* // Die Lage // ************************************************************************* INSTANCE Info_PsiNov_3_DieLage(C_INFO) // E1 { nr = 1; condition = Info_PsiNov_3_DieLage_Condition; information = Info_PsiNov_3_DieLage_Info; permanent = 1; description = "Wie steht's?"; }; FUNC INT Info_PsiNov_3_DieLage_Condition() { return 1; }; FUNC VOID Info_PsiNov_3_DieLage_Info() { AI_Output(hero,self,"Info_PsiNov_3_DieLage_15_00"); //Wie steht's? AI_Output(self,hero,"Info_PsiNov_3_DieLage_03_01"); //Ich bin total high, Mann! }; INSTANCE Info_Mod_PsiNov_3_Pickpocket (C_INFO) { nr = 6; condition = Info_Mod_PsiNov_3_Pickpocket_Condition; information = Info_Mod_PsiNov_3_Pickpocket_Info; permanent = 1; important = 0; description = Pickpocket_90; }; FUNC INT Info_Mod_PsiNov_3_Pickpocket_Condition() { C_Beklauen (60 + r_max(30), ItMi_Gold, 20 + r_max(10)); }; FUNC VOID Info_Mod_PsiNov_3_Pickpocket_Info() { Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); Info_AddChoice (Info_Mod_PsiNov_3_Pickpocket, DIALOG_BACK, Info_Mod_PsiNov_3_Pickpocket_BACK); Info_AddChoice (Info_Mod_PsiNov_3_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_PsiNov_3_Pickpocket_DoIt); }; FUNC VOID Info_Mod_PsiNov_3_Pickpocket_BACK() { Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); }; FUNC VOID Info_Mod_PsiNov_3_Pickpocket_DoIt() { if (B_Beklauen() == TRUE) { Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); } else { Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); Info_AddChoice (Info_Mod_PsiNov_3_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_PsiNov_3_Pickpocket_Beschimpfen); Info_AddChoice (Info_Mod_PsiNov_3_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_PsiNov_3_Pickpocket_Bestechung); Info_AddChoice (Info_Mod_PsiNov_3_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_PsiNov_3_Pickpocket_Herausreden); }; }; FUNC VOID Info_Mod_PsiNov_3_Pickpocket_Beschimpfen() { B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN"); B_Say (self, hero, "$DIRTYTHIEF"); Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); AI_StopProcessInfos (self); B_Attack (self, hero, AR_Theft, 1); }; FUNC VOID Info_Mod_PsiNov_3_Pickpocket_Bestechung() { B_Say (hero, self, "$PICKPOCKET_BESTECHUNG"); var int rnd; rnd = r_max(99); if (rnd < 25) || ((rnd >= 25) && (rnd < 50) && (Npc_HasItems(hero, ItMi_Gold) < 50)) || ((rnd >= 50) && (rnd < 75) && (Npc_HasItems(hero, ItMi_Gold) < 100)) || ((rnd >= 75) && (rnd < 100) && (Npc_HasItems(hero, ItMi_Gold) < 200)) { B_Say (self, hero, "$DIRTYTHIEF"); Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); AI_StopProcessInfos (self); B_Attack (self, hero, AR_Theft, 1); } else { if (rnd >= 75) { B_GiveInvItems (hero, self, ItMi_Gold, 200); } else if (rnd >= 50) { B_GiveInvItems (hero, self, ItMi_Gold, 100); } else if (rnd >= 25) { B_GiveInvItems (hero, self, ItMi_Gold, 50); }; B_Say (self, hero, "$PICKPOCKET_BESTECHUNG_01"); Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); AI_StopProcessInfos (self); }; }; FUNC VOID Info_Mod_PsiNov_3_Pickpocket_Herausreden() { B_Say (hero, self, "$PICKPOCKET_HERAUSREDEN"); if (r_max(99) < Mod_Verhandlungsgeschick) { B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_01"); Info_ClearChoices (Info_Mod_PsiNov_3_Pickpocket); } else { B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02"); }; }; // ************************************************************************* // ------------------------------------------------------------------------- FUNC VOID B_AssignAmbientInfos_PsiNov_3(var c_NPC slf) { Info_PsiNov_3_EXIT.npc = Hlp_GetInstanceID(slf); Info_PsiNov_3_EinerVonEuchWerden.npc = Hlp_GetInstanceID(slf); Info_PsiNov_3_Sumpfkrautruestung.npc = Hlp_GetInstanceID(slf); Info_PsiNov_3_WichtigePersonen.npc = Hlp_GetInstanceID(slf); Info_PsiNov_3_DasLager.npc = Hlp_GetInstanceID(slf); Info_PsiNov_3_DieLage.npc = Hlp_GetInstanceID(slf); Info_Mod_PsiNov_3_Pickpocket.npc = Hlp_GetInstanceID(slf); };
D
module db.model; import mysql; import vibe.d; import std.stdio; import std.conv : to; import std.string; import std.variant; import std.regex : match; class Model(T, U) { private { string _modelName; string _primaryKey; string _attributes; bool _autoInc = true; uint _limit = 0; Connection _dbCon; /*SList!string _foreignKey;*/ } this(Connection con, string primKey = "id") { auto tmp = to!string(typeid(T)).split("."); _modelName = tmp[tmp.length - 1]; _primaryKey = "id"; _dbCon = con; generateAttributes(); } void generateAttributes() { auto members = [ __traits(allMembers, T) ]; bool i = false; _attributes = "("; foreach (string attr ; members) { if (attr.startsWith("m_")) { auto ret = match(attr, r"^m_([A-Za-z_]+)"); if (ret.captures[1] != _primaryKey && _autoInc) { if (i) _attributes ~= ","; _attributes ~= ret.captures[1]; i = true; } } } _attributes ~= ")"; writeln("Attributes generated: ", _attributes); } @property ref string primaryKey() { return (_primaryKey); } @property string modelName() { return (_modelName); } @property ref uint limit() { return (_limit); } T[] all() { ResultSet result; Command c; DBValue[string] aa; string query; query = "SELECT * FROM " ~ _modelName.toLower(); if (_limit > 0) { query = query ~ " LIMIT " ~ to!string(_limit); } c = Command(_dbCon, query); writeln("[QUERY] Query raw: ", query); try result = c.execSQLResult(); catch (Exception e) { writeln("Exception caught", e.toString()); } writeln("Bool: ", result.empty()); if (result.empty()) throw new HTTPStatusException(204); T[] arr = new T[to!uint(result.length())]; for (auto i = 0 ; !result.empty() ; ++i) { arr[i] = new T(result.asAA()); result.popFront(); } if (arr.length <= 0) throw new HTTPStatusException(204); return (arr); } T find(U value) { ResultSequence result; Command c; DBValue[string] aa; string query; query = "SELECT * FROM " ~ _modelName.toLower() ~ " WHERE " ~ _primaryKey ~ "=" ~ to!string(value); if (_limit > 0) { query = query ~ " LIMIT " ~ to!string(_limit); } c = Command(_dbCon, query); writeln("[QUERY] Query raw: ", query); try result = c.execSQLSequence(); catch (Exception e) { writeln("Exception caught:", e.toString()); } if (result.empty()) return (new T()); aa = result.asAA(); result.close(); if (aa.length <= 0 ) throw new HTTPStatusException(204); return (new T(aa)); } T[] findCustomKey(V)(string key, V value) { ResultSet result; Command c; DBValue[string] aa; string query; query = "SELECT * FROM " ~ _modelName.toLower() ~ " WHERE " ~ key ~ "=" ~ to!string(value); if (_limit > 0) { query = query ~ " LIMIT " ~ to!string(_limit); } c = Command(_dbCon, query); writeln("[QUERY] Query raw: ", query); try result = c.execSQLResult(); catch (Exception e) { writeln("Exception caught", e.toString()); } if (result.empty()) return (null); T[] arr = new T[to!uint(result.length())]; for (auto i = 0 ; !result.empty() ; ++i) { arr[i] = new T(result.asAA()); result.popFront(); } if (arr.length <= 0) throw new HTTPStatusException(204); return (arr); } bool update(T toUpdate) { string query; ResultSequence result; Command c; query = "UPDATE " ~ _modelName.toLower() ~ " SET " ~ toUpdate.asDefinition ~ " WHERE " ~ _primaryKey ~ "=" ~ toUpdate.m_id; try c = Command(_dbCon, query); catch (Exception e) { writeln("Exception caught: ", e.toString()); } writeln("[QUERY] Query raw: ", c.sql); try result = c.execSQLSequence(); catch (Exception e) { result.close(); throw new HTTPStatusException(204); } result.close(); return (true); } bool add(T toAdd) { string query; ResultSequence result; Command c; query = "INSERT INTO " ~ _modelName.toLower() ~ " " ~ _attributes ~ " VALUES " ~ toAdd.asValues; try c = Command(_dbCon, query); catch (Exception e) { writeln("Exception caught: ", e.toString()); } writeln("[QUERY] Query raw: ", c.sql); try result = c.execSQLSequence(); catch (Exception e) { result.close(); throw new HTTPStatusException(204); } result.close(); return (true); } bool del(U val) { string query; ResultSequence result; Command c; query = "DELETE FROM " ~ _modelName.toLower() ~ " WHERE " ~ _primaryKey ~ "=" ~ to!string(val); try c = Command(_dbCon, query); catch (Exception e) { writeln("Exception caught: ", e.toString()); } writeln("[QUERY] Query raw: ", c.sql); try c.execSQLSequence(); catch (Exception e) { result.close(); throw new HTTPStatusException(204); } result.close(); return (true); } }
D
1 1 1 500 / # steps, # steps between data, thermostat, xmol writes 0.6955 0.500 300.0 /Random # seed, neighbor list , temperature(K) 1 / =1 REBO (C,H,Si,Ge), =2 tight-binding for C 6 12.0 51.2 2.28 / carbon Lennard-Jones parameters 1 1.0 8.6 2.81 / hydrogen -14 28.0 51.2 2.28 / silicon = carbon -10 20.0 47.0 2.72 / Neon -18 40.0 119.8 3.41 / Argon -36 131.0 164.0 3.83 / Krypton
D
/** International Phonetic Alphabet. */ module ipa; // enum Phoneme : string // { // `æ`, // `ə`, // `ʌ`, // `ɜ`, // `eə`, // `ɜr`, // `ɑː`, // `aɪ`, // `ɑr`, // `aʊ`, // `b`, // `d`, // `ð`, // `dʒ`, // `ɛ`, // `eɪ`, // `f`, // `ɡ`, // `h`, // `hw`, // `iː`, // `ɪ`, // `j`, // `k`, // `l`, // `m`, // `n`, // `ŋ`, // `ɔː`, // `ɔɪ`, // `oʊ`, // `p`, // `r`, // `s`, // `ʃ`, // `t`, // `θ`, // `tʃ`, // `uː`, // `ʊ`, // `v`, // `w`, // `z`, // `ʒ`, // } // size_t countSyllables(Phoneme s) @safe pure nothrow @nogc // { // return 0; // } import std.traits : isSomeString; bool isIPAVowelPhoneme(S)(S s) if (isSomeString!S) { import std.algorithm.comparison : among; return cast(bool)s.among!(`æ`, `ə`, `ʌ`, `ɜ`, `eə`, `ɜr`, `ɑː`, `aɪ`, `ɑr`, `aʊ`, `ɛ`, `eɪ`, `iː`, `ɪ`, `ɔː`, `ɔɪ`, `oʊ`, `uː`, `ʊ`); } @safe pure nothrow @nogc unittest { assert(`æ`.isIPAVowelPhoneme); assert(!`b`.isIPAVowelPhoneme); } bool isIPAConsonantPhoneme(S)(S s) if (isSomeString!S) { import std.algorithm.comparison : among; return cast(bool)s.among!(`b`, `d`, `ð`, `dʒ`, `f`, `ɡ`, `h`, `hw`, `j`, `k`, `l`, `m`, `n`, `ŋ`, `p`, `r`, `s`, `ʃ`, `t`, `θ`, `tʃ`, `w`, `z`, `ʒ`); } @safe pure nothrow @nogc unittest { assert(!`a`.isIPAConsonantPhoneme); assert(`b`.isIPAConsonantPhoneme); }
D
/** * The vararg module is intended в_ facilitate vararg manИПulation in D. * It should be interface compatible with the C module "stdarg," and the * two modules may совместно a common implementation if possible (as is готово * here). * * Copyright: Public Domain * License: Public Domain * Authors: Hauke Duden, Walter Bright */ module core.Vararg; version( GNU ) { public import std.stdarg; } else version( LDC ) { public import ldc.vararg; } else { /** * The основа vararg список тип. */ alias ук спис_ва; /** * This function initializes the supplied аргумент pointer for subsequent * use by ва_арг and кон_ва. * * Параметры: * ap = The аргумент pointer в_ инициализуй. * paramn = The определитель of the rightmost parameter in the function * parameter список. */ проц старт_ва(T) ( out спис_ва ap, ref T parmn ) { ap = cast(спис_ва) ( cast(проц*) &parmn + ( ( T.sizeof + цел.sizeof - 1 ) & ~( цел.sizeof - 1 ) ) ); } /** * This function returns the следщ аргумент in the sequence referenced by * the supplied аргумент pointer. The аргумент pointer will be adjusted * в_ точка в_ the следщ arggument in the sequence. * * Параметры: * ap = The аргумент pointer. * * Возвращает: * The следщ аргумент in the sequence. The результат is undefined if ap * does not точка в_ a valid аргумент. */ T ва_арг(T) ( ref спис_ва ap ) { T арг = *cast(T*) ap; ap = cast(спис_ва) ( cast(проц*) ap + ( ( T.sizeof + цел.sizeof - 1 ) & ~( цел.sizeof - 1 ) ) ); return арг; } /** * This function cleans up any resources allocated by старт_ва. It is * currently a no-op and есть_ли mostly for syntax compatibility with * the variadric аргумент functions for C. * * Параметры: * ap = The аргумент pointer. */ проц кон_ва( спис_ва ap ) { } /** * This function copied the аргумент pointer ист в_ приёмн. * * Параметры: * ист = The источник pointer. * приёмн = The destination pointer. */ проц копируй_ва( out спис_ва приёмн, спис_ва ист ) { приёмн = ист; } }
D
/Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager.o : /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartFormData.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartUpload.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AlamofireExtended.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Protected.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPMethod.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Combine.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Result+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Response.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/SessionDelegate.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Session.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Validation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestTaskMap.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RedirectHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AFError.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/EventMonitor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Notifications.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPHeaders.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Request.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftmodule : /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartFormData.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartUpload.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AlamofireExtended.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Protected.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPMethod.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Combine.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Result+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Response.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/SessionDelegate.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Session.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Validation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestTaskMap.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RedirectHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AFError.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/EventMonitor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Notifications.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPHeaders.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Request.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftdoc : /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartFormData.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartUpload.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AlamofireExtended.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Protected.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPMethod.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Combine.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Result+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Response.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/SessionDelegate.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Session.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Validation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestTaskMap.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RedirectHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AFError.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/EventMonitor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Notifications.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPHeaders.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Request.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/NetworkReachabilityManager~partial.swiftsourceinfo : /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartFormData.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/MultipartUpload.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AlamofireExtended.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Protected.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPMethod.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Combine.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/OperationQueue+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/StringEncoding+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Result+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLRequest+Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Alamofire.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Response.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/SessionDelegate.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoding.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Session.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Validation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ServerTrustEvaluation.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ResponseSerialization.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestTaskMap.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/URLEncodedFormEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/ParameterEncoder.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/CachedResponseHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RedirectHandler.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AFError.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/EventMonitor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/AuthenticationInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RequestInterceptor.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Notifications.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/HTTPHeaders.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/Request.swift /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Alamofire/Source/RetryPolicy.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/ObjectiveC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreImage.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 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/QuartzCore.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Dispatch.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Metal.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Foundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreFoundation.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/CoreGraphics.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/Swift.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/UIKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/prebuilt-modules/SwiftOnoneSupport.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/lincolnnguyen/Downloads/yelpy_starter_1/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/dyld.modulemap /Users/lincolnnguyen/Downloads/yelpy_starter_1/DerivedData/Yelpy/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/mach-o/compact_unwind_encoding.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.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/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
// Copyright 2015 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import examples.d.hello_lib.greeter; unittest { auto greeter = new Greeter("Hello"); assert(greeter.makeGreeting("world") == "Hello world!"); } void main() {}
D
// REQUIRED_ARGS: -c -o- /* TEST_OUTPUT: --- fail_compilation/gag4269a.d(12): Error: undefined identifier 'B' --- */ static if(is(typeof(A4269.sizeof))) {} class A4269 { void foo(B b); }
D
module src.gui.ConnectionManager_UI; public { import qt.gui.QDialog; import qt.gui.QDialogButtonBox; import qt.gui.QHBoxLayout; import qt.gui.QListView; } mixin QT_BEGIN_NAMESPACE; template ConnectionManager_UI() { private: QListView connectionsView; void setupUi(QDialog parent) { connectionsView = new QListView(); auto buttonBox = new QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close, Qt.Vertical); buttonBox.accepted.connect(&ConnectionManager.slotConnect); buttonBox.rejected.connect(&ConnectionManager.close); auto layout = new QHBoxLayout(parent); layout.addWidget(connectionsView); layout.addWidget(buttonBox); } } struct ConnectionManager { mixin ConnectionManager_UI; void slotConnect() {} void close() {} } mixin QT_END_NAMESPACE;
D
/** ### Steinhart-Hart model The most accurate math model of thermistor called Steinhart-Hart equation. It is the third-order approximation which looks like that: $(MATH \frac{1}{T} = a + b\,\ln(R) + c\,\ln(R)^3) (1) where $(I R) [$(I Ω)] — thermistor resistance on temperature $(I T) [$(I K)] (Here and below the temperature measured in Kelvins. For °C you can use formula $(MATH T = T_{^{o}C} + 273.15). For °F you can use formula $(MATH T = \left( T_{^{o}F} - 32 \right) \times \frac{5}{9} + 273.15)), $(I a), $(I b), $(I c) — Steinhart-Hart parameters. Find temperature $(I T) from (1): $(MATH T = \frac{1}{a + b\,\ln(R) + c\,\ln(R)^3}) (2) Typically this model allows achieve accuracy up to 0.02° in range over 200°C. Parameters can be found using Gauss method with set of experimental $(I T)-values and corresponding $(I R)-values. Select some three points $(MATH [R_i, T_i]) from experimental set and apply it to (1): $(MATH \frac{1}{T_0} = a + b\,\ln(R_0) + c\,\ln(R_0)^3) (3.1) $(MATH \frac{1}{T_1} = a + b\,\ln(R_1) + c\,\ln(R_1)^3) (3.2) $(MATH \frac{1}{T_2} = a + b\,\ln(R_2) + c\,\ln(R_2)^3) (3.3) We have a system of linear algebraic equations with three equations and variables $(I a), $(I b) and $(I c). Now we may use Gauss method and eliminate variables step-by-step. Subtract (3.2) from (3.1), and (3.3) from (3.1) in order to we eliminate variable $(I a). $(MATH \frac{1}{T_0} - \frac{1}{T_1} = b\,\left( \ln(R_0) - \ln(R_1) \right) + c\,\left( \ln(R_0)^3 - \ln(R_1)^3 \right)) (3.12) $(MATH \frac{1}{T_0} - \frac{1}{T_2} = b\,\left( \ln(R_0) - \ln(R_2) \right) + c\,\left( \ln(R_0)^3 - \ln(R_2)^3 \right)) (3.13) Now divide (3.12) by $(MATH \ln(R_0) - \ln(R_1)) and (3.13) by $(MATH \ln(R_0) - \ln(R_1)): $(MATH \frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_1)} = b + c\,\frac{\ln(R_0)^3 - \ln(R_1)^3}{\ln(R_0) - \ln(R_1)}) (3.12') $(MATH \frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_2)} = b + c\,\frac{\ln(R_0)^3 - \ln(R_2)^3}{\ln(R_0) - \ln(R_2)}) (3.13') Subtract (3.13') from (3.12') in order to eliminate variable $(I b): $(MATH \frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_1)} - \frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_2)} = c\,\left( \frac{\ln(R_0)^3 - \ln(R_1)^3}{\ln(R_0) - \ln(R_1)} - \frac{\ln(R_0)^3 - \ln(R_2)^3}{\ln(R_0) - \ln(R_2)} \right)) (3.123) Now we can find formula for direct computation of parameter $(I c): $(MATH c = \frac{\frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_1)} - \frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_2)}}{\frac{\ln(R_0)^3 - \ln(R_1)^3}{\ln(R_0) - \ln(R_1)} - \frac{\ln(R_0)^3 - \ln(R_2)^3}{\ln(R_0) - \ln(R_2)}}) (3.c) Find parameter $(I b) from (3.12') bearing in mind, that parameter $(I c) we can found using (3.c): $(MATH b = \frac{\frac{1}{T_0} - \frac{1}{T_1}}{\ln(R_0) - \ln(R_1)} - c\,\frac{\ln(R_0)^3 - \ln(R_1)^3}{\ln(R_0) - \ln(R_1)}) (3.b) Now, when we know parameters $(I c) and $(I b), we can find parameter $(I a) from (3.1): $(MATH a = \frac{1}{T_0} - b\,\ln(R_0) + c\,\ln(R_0)^3) (3.a) ### Simplified β-model Typically values of parameters of Steinhart-Hart model is too small, so practical using that model presents some difficulties. In order to simplify this model, we can represent this parameters by the following way: $(MATH a = \frac{1}{T_0} - \frac{1}{\beta} \ln(R_0) \vert b = \frac{1}{\beta} \vert c = 0) (4.1) After substituting (4.1) into (1) we have: $(MATH \frac{1}{T} = \frac{1}{T_0} + \frac{1}{\beta} \ln \left( \frac{R}{R_0} \right)) (4.2) Find $(I T) from (4.2): $(MATH T = \frac{1}{\frac{1}{T_0} + \frac{1}{\beta} \ln \left( \frac{R}{R_0} \right)}) (5.1) Or: $(MATH T = \frac{T_0 \beta}{T_0\,ln \left( \frac{R}{R_0} \right) + \beta}) (5.2) Parameter $(MATH \beta) can be found as following: $(MATH \beta = \frac{\ln \left( \frac{R}{R_0} \right)}{(\frac{1}{T}) - (\frac{1}{T_0})}) (6.1) Or: $(MATH \beta = \frac{T_0\,T\,ln\left( \frac{R}{R_0} \right)}{T_0-T}) (6.2) As you can see, this parameter can be found, when we have at least two experimental values of resistance $(I R) and corresponding temperature $(I T). But for some reasons model will be less-precise in this case. ![Comparison of thermistor models](thr_fit.svg) */ module uctl.simul.thr; import std.traits: isInstanceOf; import std.math: E; import uctl.num: isNumer, asnum; import uctl.unit: hasUnits, as, to, Resistance, Ohm, Temperature, degK, rawTypeOf; import uctl.math.log: log; version(unittest) { import uctl.test: assert_eq, unittests; import uctl.num: asfix, fix; import uctl.unit: degC, KOhm; mixin unittests; } /// Thermistor model struct Model(string name_, bool calcT_ = false, bool calcR_ = false) { /// Model name enum string name = name_; /// Can calculate temperature from resistance enum bool calcT = calcT_; /// Can calculate resistance from temperature enum bool calcR = calcR_; } /// Check that type is thermistor model template isModel(X...) if (X.length == 1 || X.length == 2) { static if (X.length == 1) { static if (is(X[0])) { enum bool isModel = isInstanceOf!(Model, X[0]); } else { enum bool isModel = isModel!(typeof(X[0])); } } else static if (X.length == 2 && isModel!(X[0]) && isModel!(X[1])) { enum bool isModel = X[0].name == X[1].name; } else { enum bool isModel = false; } } /// Enable temperature from resistance calculation template calcT(alias M) if (isModel!M) { alias calcT = Model!(M.name, true, M.calcR); } /// Enable resistance from temperature calculation template calcR(alias M) if (isModel!M) { alias calcR = Model!(M.name, M.calcT, true); } /// Steinhart-Hart thermistor model alias SteinhartHart = Model!("Steinhart-Hart model"); /// Simplified β-model of thermistor alias Beta = Model!("Simplified beta model"); /// Thermistor parameters for Steinhart-Hart model struct Param(alias M, A, B, C) if (isModel!(M, SteinhartHart) && isNumer!(A, B, C)) { static assert(!M.calcR, "Calculation of resistance from temperature using Steinhart-Hart model is " ~ "too computationally expensive and not supported. You can use simplified beta model."); static if (M.calcT) { /// The first coefficient of model A a; /// The second coefficient of model B b; /// The third coefficient of model C c; } /// Initialize thermistor parameters const pure nothrow @nogc @safe this(const A a_, const B b_, const C c_) { static if (M.calcT) { a = a_; b = b_; c = c_; } } static if (M.calcT) { /// Calculate temperature from resistance pure nothrow @nogc @safe auto opCall(R)(const R r) const if (hasUnits!(R, Resistance) && isNumer!(rawTypeOf!R, A)) { const rr = r.to!Ohm.raw; const lnR = log(rr); const tr = asnum!(1, rawTypeOf!R) / (a + b * lnR + c * lnR * lnR * lnR); return tr.as!degK; } } } /// Create parameters for Steinhart-Hart model of thermistor pure nothrow @nogc @safe Param!(M, A, B, C) mk(alias M, A, B, C)(const A a, const B b, const C c) if (isModel!(M, SteinhartHart) && isNumer!(A, B, C)) { return Param!(M, A, B, C)(a, b, c); } /// Test NTC 100K thermistor (floating-point) nothrow @nogc unittest { // a = -0.00400110693, b = 0.00077306258, c = -0.00000099773 static immutable ntc100k = mk!(calcT!SteinhartHart)(-0.00400110693, 0.00077306258, -0.00000099773); assert_eq(ntc100k(100.0.as!KOhm), 23.0094033.as!degC.to!degK, 1e-5); assert_eq(ntc100k(24.0.as!KOhm), 87.5718161.as!degC.to!degK, 1e-6); assert_eq(ntc100k(82.0.as!KOhm), 29.8317295.as!degC.to!degK, 1e-6); } /// Test NTC 100K thermistor (fixed-point) nothrow @nogc unittest { // a = -0.00400110693, b = 0.00077306258, c = -0.00000099773 static immutable ntc100k = mk!(calcT!SteinhartHart)(asfix!(-0.00400110693), asfix!(0.00077306258), asfix!(-0.00000099773)); alias R = fix!(15, 150); alias T = fix!(230, 580); assert_eq(ntc100k(R(100).as!KOhm).to!degC, T(23.0094033).as!degC); assert_eq(ntc100k(R(24).as!KOhm).to!degC, T(87.5718161).as!degC); assert_eq(ntc100k(R(82).as!KOhm).to!degC, T(29.8317295).as!degC); } /// Thermistor parameters for simplified β-model struct Param(alias M, R, T, B) if (isModel!(M, Beta) && hasUnits!(R, Resistance) && hasUnits!(T, Temperature) && isNumer!(rawTypeOf!R, rawTypeOf!T, B)) { alias Rraw = typeof(R().to!Ohm.raw); alias Traw = typeof(T().to!degK.raw); static if (M.calcT) { alias InvR = typeof(asnum!(1, Rraw) / Rraw()); alias InvT = typeof(asnum!(1, Traw) / Traw()); alias InvB = typeof(asnum!(1, B) / B()); /// $(MATH \frac{1}{R_0}) value InvR inv_r0; /// $(MATH \frac{1}{T_0}) value InvT inv_t0; /// $(MATH \frac{1}{\beta}) value InvB inv_beta; } static if (M.calcR) { alias BInvT = typeof(B() / Traw()); /// $(MATH R_0) value Rraw r0; /// $(MATH \frac{\beta}{T_0}) value BInvT beta_inv_t0; /// $(MATH \frac{1}{\beta}) value B beta; } /// Initialize thermistor parameters const pure nothrow @nogc @safe this(const R r0_, const T t0_, const B beta_) { const _r0 = r0_.to!Ohm.raw; const _t0 = t0_.to!degK.raw; static if (M.calcT) { inv_r0 = asnum!(1, Rraw) / _r0; inv_t0 = asnum!(1, Traw) / _t0; inv_beta = asnum!(1, B) / beta_; } static if (M.calcR) { r0 = _r0; beta_inv_t0 = beta_ / _t0; beta = beta_; } } static if (M.calcT) { /// Calculate temperature from resistance pure nothrow @nogc @safe auto opCall(R_)(const R_ r) const if (hasUnits!(R_, Resistance) && isNumer!(rawTypeOf!R_, Rraw)) { const rr = r.to!Ohm.raw; const tr = asnum!(1, Traw) / (inv_t0 + inv_beta * log(rr * inv_r0)); return tr.as!degK.to!(T.units); } } static if (M.calcR) { /// Calculate resistance from temperature pure nothrow @nogc @safe auto opCall(T_)(const T_ t) const if (hasUnits!(T_, Temperature) && isNumer!(rawTypeOf!T_, Traw)) { const tr = t.to!degK.raw; const rr = r0 * exp(beta / tr - beta_inv_t0); return rr.as!Ohm.to!(R.units); } } } /// Create parameters for simplified β-model of thermistor pure nothrow @nogc @safe Param!(M, R, T, B) mk(alias M, R, T, B)(const R r0, const T t0, const B beta) if (isModel!(M, Beta) && hasUnits!(R, Resistance) && hasUnits!(T, Temperature) && isNumer!(rawTypeOf!R, rawTypeOf!T, B)) { return Param!(M, R, T, B)(r0, t0, beta); } /// Test NTC 100K thermistor (floating-point) nothrow @nogc unittest { // R0 = 100KΩ, T0 = 25°C, β = 3950 static immutable ntc100k = mk!(calcT!Beta)(100.0.as!KOhm, 25.0.as!degC, 3950.0); assert_eq(ntc100k.inv_r0, 1.00000000000000008e-05); assert_eq(ntc100k.inv_t0, 0.00335401643468052988); assert_eq(ntc100k.inv_beta, 0.000253164556962025332); assert_eq(ntc100k(100.0.as!KOhm), 25.0.as!degC); assert_eq(ntc100k(24.0.as!KOhm), 60.9940609679212571.as!degC); assert_eq(ntc100k(82.0.as!KOhm), 29.5339875403824408.as!degC); } /// Test NTC 100K thermistor (floating-point) nothrow @nogc unittest { // R0 = 100KΩ, T0 = 25°C, β = 3950 static immutable ntc100k = mk!(calcT!Beta)(100f.as!KOhm, 25f.as!degC, 3950f); assert_eq(ntc100k.inv_r0, 9.999999996e-6f); assert_eq(ntc100k.inv_t0, 0.003354016433f); assert_eq(ntc100k.inv_beta, 0.0002531645569f); assert_eq(ntc100k(100f.as!KOhm), 25.0f.as!degC); assert_eq(ntc100k(24f.as!KOhm), 60.994049072f.as!degC); assert_eq(ntc100k(82f.as!KOhm), 29.533996582f.as!degC); } /// Test NTC 100K thermistor (fixed-point) nothrow @nogc unittest { // R0 = 100KΩ, T0 = 25°C, β = 3950 static immutable ntc100k = mk!(calcT!Beta)(asfix!100.as!KOhm, asfix!25.as!degC, asfix!3950); assert_eq(ntc100k.inv_r0, asfix!9.999999996e-6); assert_eq(ntc100k.inv_t0, asfix!0.003354016433); assert_eq(ntc100k.inv_beta, asfix!0.0002531645569); alias R = fix!(15, 150); alias T = fix!(10, 100); assert_eq(ntc100k(100.0.as!KOhm.to!R), 25.0.as!degC.to!T); assert_eq(ntc100k(24.0.as!KOhm.to!R), 60.99406123.as!degC.to!T); assert_eq(ntc100k(82.0.as!KOhm.to!R), 29.53398752.as!degC.to!T); } /// Create parameters for simplified β-model of thermistor using two points $(MATH [R_x, T_x]) template mk(alias M, R0, T0, R1, T1) if (isModel!(M, Beta) && hasUnits!(R0, Resistance) && hasUnits!(R1, Resistance) && hasUnits!(T0, Temperature) && hasUnits!(T1, Temperature) && isNumer!(rawTypeOf!R0, rawTypeOf!T0, rawTypeOf!R1, rawTypeOf!T1)) { alias T0raw = typeof(T0().to!degK.raw); alias T1raw = typeof(T1().to!degK.raw); alias R0raw = typeof(R0().to!Ohm.raw); alias R1raw = typeof(R1().to!Ohm.raw); alias B = typeof(T0raw() * T1raw() * log(R1raw() / R0raw()) / (T0raw() - T1raw())); Param!(M, R0, T0, B) mk(const R0 r0, const T0 t0, const R1 r1, const T1 t1) { const t0_ = t0.to!degK.raw; const t1_ = t1.to!degK.raw; const r0_ = r0.to!Ohm.raw; const r1_ = r1.to!Ohm.raw; const beta = t0_ * t1_ * log(r1_ / r0_) / (t0_ - t1_); return Param!(M, R0, T0, B)(r0, t0, beta); } } /// Test NTC 100K thermistor (floating-point) nothrow @nogc unittest { // Points: [100KΩ, 25°C], [24KΩ, 61°C] static immutable ntc100k = mk!(calcT!Beta)(100f.as!KOhm, 25f.as!degC, 24f.as!KOhm, 61f.as!degC); assert_eq(ntc100k.inv_r0, 1e-5f); assert_eq(ntc100k.inv_t0, 0.003354016, 1e-9); assert_eq(ntc100k.inv_beta, 0.000253202, 1e-9); assert_eq(ntc100k(100f.as!KOhm), 25f.as!degC); assert_eq(ntc100k(24f.as!KOhm), 61f.as!degC); assert_eq(ntc100k(82f.as!KOhm), 29.534667969f.as!degC); } /// Test NTC 100K thermistor (fixed-point) nothrow @nogc unittest { // Points: [100KΩ, 24°C], [24KΩ, 80°C] static immutable ntc100k = mk!(calcT!Beta)(asfix!100.as!KOhm, asfix!25.as!degC, asfix!24.as!KOhm, asfix!61.as!degC); assert_eq(ntc100k.inv_r0, asfix!9.999999996e-6); assert_eq(ntc100k.inv_t0, asfix!0.003354016433); assert_eq(ntc100k.inv_beta, asfix!0.0002532018273); alias R = fix!(15, 150); alias T = fix!(10, 100); assert_eq(ntc100k(100.0.as!KOhm.to!R), 25.0.as!degC.to!T); assert_eq(ntc100k(24.0.as!KOhm.to!R), 61.as!degC.to!T); assert_eq(ntc100k(82.0.as!KOhm.to!R), 29.53466511.as!degC.to!T); }
D
/* * #25 Saturas sells High Robe twice */ func int G1CP_025_SaturasSellsRobe() { if (MEM_GetSymbolIndex("KDW_600_Saturas_HEAVYARMOR_Condition") != -1) && (MEM_GetSymbolIndex("KDW_ARMOR_H") != -1) { HookDaedalusFuncS("KDW_600_Saturas_HEAVYARMOR_Condition", "G1CP_025_SaturasSellsRobe_Hook"); return TRUE; } else { return FALSE; }; }; /* * This function intercepts the dialog condition to introduce more conditions */ func int G1CP_025_SaturasSellsRobe_Hook() { G1CP_ReportFuncToSpy(); // Obtain symbol var int symbId; symbId = MEM_GetSymbolIndex("KDW_ARMOR_H"); if (symbId != -1) { if (Npc_HasItems(hero, symbId)) { return FALSE; }; }; // Continue with the original function ContinueCall(); };
D
instance Mod_7213_NONE_Schlaeger_NW (Npc_Default) { // ------ NSC ------ name = "Schläger"; guild = GIL_OUT; id = 7213; voice = 0; flags = 0; npctype = NPCTYPE_MAIN; //aivars aivar[AIV_IgnoresArmor] = TRUE; aivar[AIV_ToughGuy] = TRUE; // ------ Attribute ------ B_SetAttributesToChapter (self, 4); // ------ Kampf-Taktik ------ fight_tactic = FAI_HUMAN_STRONG; // ------ Equippte Waffen ------ // ------ Inventory ------ B_CreateAmbientInv (self); // ------ visuals ------ B_SetNpcVisual (self, MALE, "Hum_Head_Fighter", Face_N_NormalBart04, BodyTex_N, ITAR_Sld_L); Mdl_SetModelFatness (self, 1); Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds"); // ------ NSC-relevante Talente vergeben ------ B_GiveNpcTalents (self); // ------ Kampf-Talente ------ B_SetFightSkills (self, 60); // ------ TA anmelden ------ daily_routine = Rtn_Start_7213; }; FUNC VOID Rtn_Start_7213 () { TA_Stand_WP (18,00,06,00,"NW_CITY_KANAL_14"); TA_Stand_WP (06,00,18,00,"TOT"); }; FUNC VOID Rtn_Weg_7213 () { TA_Stand_WP (18,00,06,00,"NW_CITY_KANAL_13"); TA_Stand_WP (06,00,18,00,"TOT"); }; FUNC VOID Rtn_Nah_7213 () { TA_Stand_WP (18,00,06,00,"NW_CITY_KANAL_09"); TA_Stand_WP (06,00,18,00,"TOT"); }; FUNC VOID Rtn_Tot_7213() { TA_Smoke_Joint (08,00,20,00,"NW_CANTHARINSEL_20"); TA_Smoke_Joint (20,00,08,00,"NW_CANTHARINSEL_20"); };
D
/Users/Polina/XcodeApp/diplom_prj/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Deprecated.o : /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Deprecated.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Cancelable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObserverType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Reactive.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/RecursiveLock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Errors.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Event.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/First.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/Platform.Linux.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.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/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/Polina/XcodeApp/diplom_prj/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Users/Polina/XcodeApp/diplom_prj/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Deprecated~partial.swiftmodule : /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Deprecated.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Cancelable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObserverType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Reactive.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/RecursiveLock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Errors.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Event.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/First.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/Platform.Linux.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.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/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/Polina/XcodeApp/diplom_prj/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap /Users/Polina/XcodeApp/diplom_prj/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/Objects-normal/x86_64/Deprecated~partial.swiftdoc : /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Amb.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Deferred.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Deprecated.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Enumerated.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Maybe.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/ObservableType+PrimitiveSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debounce.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Reduce.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Range.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Merge.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Take.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Cancelable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/GroupedObservable.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Single.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AsSingle.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sample.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Throttle.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ConnectableObservableType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/SchedulerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObserverType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Create.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Generate.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/Queue.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Reactive.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Materialize.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/AddRef.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DataStructures/Bag.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Using.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Debug.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Catch.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Switch.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/StartWith.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/Lock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/RecursiveLock.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Sink.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Optional.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Scan.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/Platform.Darwin.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Do.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Map.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Skip.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Producer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Buffer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timer.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DeprecationWarner.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Filter.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Never.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/AnyObserver.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Error.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Disposables/Disposables.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Errors.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ElementAt.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Concat.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Repeat.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Event.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/TakeLast.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Multicast.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/First.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Just.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Timeout.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Window.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Rx.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/RxMutableBox.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/Platform/Platform.Linux.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/GroupBy.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Delay.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/ToArray.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/Empty.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift /Users/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.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/Polina/XcodeApp/diplom_prj/CoreML_test/Pods/Target\ Support\ Files/RxSwift/RxSwift-umbrella.h /Users/Polina/XcodeApp/diplom_prj/CoreML_test/build/Pods.build/Debug-iphonesimulator/RxSwift.build/unextended-module.modulemap
D
// PERMUTE_ARGS: // REQUIRED_ARGS: -Jrunnable/extra-files import std.stdio; void main() { writefln(import("foo37.txt")); // also want to ensure that we can access // imports in a subdirectory of the -J path writefln(import("std14198/uni.d")); }
D
// play nered07.wav when Shoal kisses REPLACE_TRANS_ACTION ~shoal~ BEGIN 1 2 3 END BEGIN END ~Kill(LastTalkedToBy)~ ~PlaySound("NERED07") Wait(1) Kill(LastTalkedToBy)~
D
var int DailyHello_HeroAttackersCnt; //say var int DELAYSAYTIMERACTIVED;//bool // So simply, delay value will be decremented till it hit 0 // then it will magically be set to -1, when after actual svm was ran, it will be back to normal => 0 CONST int DailyHero_TimeToSayResponse = -1; var int DailyHello_sayDelay1; var int DailyHello_othID1; var string DailyHello_sayMsg1; //var int IS_1_ON;//bool <-this is tottaly worthless use, sayDelay and simply decrement it var int DailyHello_sayDelay2; var int DailyHello_othID2; var string DailyHello_sayMsg2; var int DailyHello_sayDelay3; var int DailyHello_othID3; var string DailyHello_sayMsg3; CONST int ZIVILANQUATSCHDIST=300; FUNC VOID B_DailyHello__SayResponse(var int npcID,var string msg) { // Some mechanics fine-tunning: now when you can't // see that other NPC, you probably pass them, and don't care much // so then, hero simply will tell nothing, and yeah -> EXCTACT METHOD var C_NPC oth; if(npcID > 0) { oth = Hlp_GetNpc(npcID); }; print_s_i_s_i("Hero resp Say...see: ",Npc_CanSeeNpc(hero,oth),", dawn: ",C_NpcIsDown(hero)); if(!C_NpcIsDown(hero)) { // Fix: #85 (Przywitanie przerywa dialog) if(!Hlp_IsValidNpc(oth) || Npc_GetDistToNpc(hero,oth) > 500 || !InfoManager_HasFinished()) { return; }; Npc_ClearAiQueue(hero); // what if hero is in ZS_Talk? wont it ruin sth? (Ask) if(Hlp_IsValidNpc(oth)){ AI_LookAtNpc(hero,oth); }; printdebug_ss("DailyHello: hero SVM to say: ",msg); AI_OutputSVM(hero,NULL,msg); }; }; // Ork: 'Queue' - huehuehhue XD FUNC VOID B_DailyHello_AddResponseToQueue(var int msgListener/*not using*/,var string WHAT,var int DELAY)//UseTimeTrigger { // Ork: te magiczne IS_n_ON to poprostu wolne sloty // na jednoczesne opóźnienia gadek hmppf... // ehh screw it // if(!Hlp_IsValidNpc(msgListener)) // { msgListener = Npc_GetTarget(hero); }; if(DailyHello_sayDelay1 == 0) { Print("Hero resp at:1"); DailyHello_othID1 = msgListener; DailyHello_sayMsg1 = WHAT; DailyHello_sayDelay1= DELAY; } else if(DailyHello_sayDelay2 == 0) { Print("Hero resp at:2"); DailyHello_othID2 = msgListener; DailyHello_sayMsg2 = WHAT; DailyHello_sayDelay2= DELAY; } else if(DailyHello_sayDelay3 == 0) { Print("Hero resp at:3"); DailyHello_othID3 = msgListener; DailyHello_sayMsg3 = WHAT; DailyHello_sayDelay3= DELAY; }; }; Func void B_DailyHello__ResponseUpdate() { if(DailyHello_sayDelay1 > 0) { DailyHello_sayDelay1-=1; if(DailyHello_sayDelay1==0) { B_DailyHello__SayResponse(DailyHello_othID1,DailyHello_sayMsg1);}; } else if(DailyHello_sayDelay2 > 0) { DailyHello_sayDelay2-=1; if(DailyHello_sayDelay2==0) { B_DailyHello__SayResponse(DailyHello_othID2,DailyHello_sayMsg2);}; } else if(DailyHello_sayDelay3 > 0) { DailyHello_sayDelay3-=1; if(DailyHello_sayDelay3==0) { B_DailyHello__SayResponse(DailyHello_othID3,DailyHello_sayMsg3);}; }; }; /////////////////////////////////////////////////////////////////////////////// /// check hello // ====================== // npc target saying "hello" everday to hero // using with trigger script and event ////////////////////////////////////////////////////////////////////////////// // Ork: Komentarz orginalny :D pewnie z ~2006-7 func void B_DailyHello_Update()//(var c_npc trgtnpc)// <-poprostu getTarget { if(wld_getday()<3) { //Ork: Tymczasowo wylaczam [TESTY] //return; }; // Update'uj odpowiedzi bohatera: B_DailyHello__ResponseUpdate(); var int helloSayizer;//i'm a king in random name'ing :p var int sayVariant;//like up :d helloSayizer=hlp_random(7); sayVariant=hlp_random(3); var int otherSayVariant; // To jest nie uzywane ?! otherSayVariant=hlp_random(50); Npc_GetTarget(hero); if(!Hlp_IsValidNpc(other)) { return; }; // nothing to do on here // var int othtrgt; // othtrgt=npc_gettarget(other); // var c_npc othtrgtnpc; // othtrgtnpc=hlp_getnpc(othtrgt); var int tempAtt2Player; // Ork: A moze raczej temp attitude? tempAtt2Player=Npc_GetTempAttitude(other,hero); //if(DailyHello_HeroAttackersCnt==false) //{ if((c_npcishuman(other))&& (!c_npcisdown(other)&&(!npc_isinstate(other,zs_talk))))//not unconcious and dead { if((npc_canseenpc(other,hero))&&(npc_getdisttonpc(other,hero)< 380)) { // Poprawka #102 (witanie dopiero po pierwszym spotkaniu) if(Npc_GetAivar(other,AIV_HELLOSAYED) == 0) // Jeszcze nie widział bohatera 'na oczy' { Npc_SetAivar(other,AIV_HELLOSAYED,day+1); }; if(npc_getaivar(other,AIV_HELLOSAYED) < day) { npc_setaivar(other,AIV_HELLOSAYED,day); // Some randomness plus less of getting angry of player // by constantly saying stuff, another thing, NPCs with all attitudes // can say hello to hero, but most likely they say it when they're friends (4/7) and only 1/7 if they hostile. var int dontCareBoutHero; dontCareBoutHero = helloSayizer + (tempAtt2Player+1)/2; // rnd + (0;1;1;2) if(dontCareBoutHero < 5) { return; } if(C_BodyStateContains(other,bs_sit)) { AI_LookAtNpc(other,hero); } else { Npc_ClearAiQueue(other); B_SmartTurnToNpc(other,hero); //printscreen ("start saying",50,40,"font_old_10_white.tga",2); if(C_BodyStateContains(other,bs_iteminteract)||C_BodyStateContains(other,bs_mobinteract)||C_BodyStateContains(other,bs_mobinteract_interrupt)) { Npc_ClearAiQueue(other); B_StandUp(other); Npc_ClearAiQueue(other); }; if(tempAtt2Player==att_neutral) { AI_OutputSVM(other,null,"$whatdoyouwant"); if(npc_getaivar(other,aiv_wasdefeatedbysc)==true) { if(sayVariant==1) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$youwannafoolme",3); } else if(sayVariant==2) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$youstillnothaveenough",3); } else if(sayVariant==3) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$lookingfortroubleagain",3); }; } else if(npc_getaivar(other,aiv_hasdefeatedsc)==true) { if(sayVariant==1) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$youdefeatedmewell",3); } else if(sayVariant==2) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$letsforgetourlittlefight",3); } else if(sayVariant==3) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$yesyes",3); }; }; } else if(tempAtt2Player==att_angry) { AI_OutputSVM(other,null,"$getoutofhere"); if(npc_getaivar(other,aiv_wasdefeatedbysc)==true) { if(sayVariant==1) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$youwannafoolme",3); } else if(sayVariant==2) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$youstillnothaveenough",3); } else if(sayVariant==3) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$lookingfortroubleagain",3); }; } else if(npc_getaivar(other,aiv_hasdefeatedsc)==true) { if(sayVariant==1) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$youdefeatedmewell",3); } else if(sayVariant==2) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$letsforgetourlittlefight",3); } else if(sayVariant==3) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$yesyes",3); }; }; } else if(tempAtt2Player==att_friendly) { B_StandUp(other); Npc_ClearAiQueue(other); AI_OutputSVM(other,null,"$friendlygreetings"); if(Hlp_Random(2)!=0) {return; }; B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$friendlygreetings",2); } else if(tempAtt2Player==att_hostile) { AI_OutputSVM(other,null,"$diemortalenemy"); AI_OutputSVM(other,null,"$nowwait"); if(npc_hasreadiedmeleeweapon(other)) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$weapondown",3); } else if(npc_hasreadiedrangedweapon(other)) { if(npc_gettarget(other)==hlp_getinstanceid(hero)) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$watchyouraim",3); }; }; if(sayVariant==1) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$nowwaitintruder",2); } else if(sayVariant==2) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$nowwait",2); } else if(sayVariant==3) { B_DailyHello_AddResponseToQueue(Hlp_GetInstanceID(other),"$diemonster",2); }; // Lepiej zeby AI (nawet kulejące) samo w sobie sie zajelo takimi sprawami: // npc_settarget(other,hero); // ai_startstate(other,zs_attack,1,""); };//att_hostile };//bs };//hellosayed };//(npc_getdisttonpc(hero,other) < 250) };//c_npcishuman //}; };
D
/Users/laurin/Documents/School/fbxpollenfallen/build/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/BubbleChartDataProvider.o : /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/Legend.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/Description.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/LegendEntry.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/laurin/Documents/School/fbxpollenfallen/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/laurin/Documents/School/fbxpollenfallen/build/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Users/laurin/Documents/School/fbxpollenfallen/build/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/BubbleChartDataProvider~partial.swiftmodule : /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/Legend.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/Description.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/LegendEntry.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/laurin/Documents/School/fbxpollenfallen/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/laurin/Documents/School/fbxpollenfallen/build/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap /Users/laurin/Documents/School/fbxpollenfallen/build/Pods.build/Debug-iphonesimulator/Charts.build/Objects-normal/x86_64/BubbleChartDataProvider~partial.swiftdoc : /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedViewPortJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Jobs/AnimatedZoomViewJob.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/Legend.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/MarkerImage.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/Range.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/ChartLimitLine.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/ChartDataRendererBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/AxisBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/ComponentBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/ChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BarLineChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/PieRadarChartViewBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Animation/ChartAnimationEasing.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Fill.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Platform.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/Description.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/IMarker.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ViewPortHandler.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/Transformer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Renderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LegendRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/CombinedChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/PieChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BubbleChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/LineChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/CandleStickChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/BarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/HorizontalBarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/RadarChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/ScatterChartRenderer.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/IHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/BarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/ChartHighlighter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Animation/Animator.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Filters/DataApproximator.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ChartColorTemplates.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/XAxis.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/YAxis.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/ChartUtils.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/ChartBaseDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Highlight/Highlight.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Renderers/YAxisRendererRadarChart.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/MarkerView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/CombinedChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/PieChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BubbleChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/LineChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/BarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/HorizontalBarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/RadarChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Charts/ScatterChartView.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift /Users/laurin/Documents/School/fbxpollenfallen/Pods/Charts/Source/Charts/Components/LegendEntry.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/laurin/Documents/School/fbxpollenfallen/Pods/Target\ Support\ Files/Charts/Charts-umbrella.h /Users/laurin/Documents/School/fbxpollenfallen/build/Pods.build/Debug-iphonesimulator/Charts.build/unextended-module.modulemap
D
module dwt.internal.mozilla.nsIDOMEventGroup; import dwt.internal.mozilla.Common; import dwt.internal.mozilla.nsID; import dwt.internal.mozilla.nsISupports; alias PRUint64 DOMTimeStamp; const char[] NS_IDOMEVENTGROUP_IID_STR = "33347bee-6620-4841-8152-36091ae80c7e"; const nsIID NS_IDOMEVENTGROUP_IID= {0x33347bee, 0x6620, 0x4841, [ 0x81, 0x52, 0x36, 0x09, 0x1a, 0xe8, 0x0c, 0x7e ]}; interface nsIDOMEventGroup : nsISupports { static const char[] IID_STR = NS_IDOMEVENTGROUP_IID_STR; static const nsIID IID = NS_IDOMEVENTGROUP_IID; extern(System): nsresult IsSameEventGroup(nsIDOMEventGroup other, PRBool *_retval); }
D
module icfputil.myproblems; pragma (lib, "curl"); import std.algorithm; import std.json; import std.net.curl; import std.range; import std.stdio; import std.string; import icfputil.icfplib; import icfputil.probstat; void main () { init (); string s; try { auto f_in = File (problems_file, "rt"); s = f_in.readln ().strip (); } catch (Exception e) { s = cast (string) post (address ~ "/myproblems" ~ "?auth=" ~ auth, ""); auto f_out = File (problems_file, "wt"); f_out.writeln (s); } auto t = parseJSON (s); auto problems = new Problem [0]; foreach (c; t.array) { problems ~= Problem (c); } write_problems_sorted !("a.size < b.size") ("by_size.txt", problems); auto probstats = map !(x => ProbStat (x)) (problems).array; write_probstats_sorted !("a.op2s + a.opss < b.op2s + b.opss") ("by_opsize.txt", probstats); write_probstats_sorted !("a.opss < b.opss || (a.opss == b.opss && a.size < b.size)") ("by_op12size.txt", probstats); write_probstats_sorted !("a.opfolds < b.opfolds || (a.opfolds == b.opfolds && " ~ "a.size < b.size)") ("by_op12if.txt", probstats); write_probstats_sorted !("(a.is_fold < b.is_fold || (a.is_fold == b.is_fold && " ~ "(a.is_tfold < b.is_tfold || (a.is_tfold == b.is_tfold && " ~ "(a.is_bonus < b.is_bonus || (a.is_bonus == b.is_bonus && " ~ "(a.size < b.size)))))))") ("by_sort.txt", probstats); }
D
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module dwtx.draw2d.ArrowLocator; import dwt.dwthelper.utils; import dwtx.draw2d.geometry.PointList; import dwtx.draw2d.ConnectionLocator; import dwtx.draw2d.IFigure; import dwtx.draw2d.Connection; import dwtx.draw2d.RotatableDecoration; /** * Locator used to place a {@link RotatableDecoration} on a {@link Connection}. The * decoration can be placed at the source or target end of the connection figure. The * default connection implementation uses a {@link DelegatingLayout} which requires * locators. */ public class ArrowLocator : ConnectionLocator { /** * Constructs an ArrowLocator associated with passed connection and tip location (either * {@link ConnectionLocator#SOURCE} or {@link ConnectionLocator#TARGET}). * * @param connection The connection associated with the locator * @param location Location of the arrow decoration * @since 2.0 */ public this(Connection connection, int location) { super(connection, location); } /** * Relocates the passed in figure (which must be a {@link RotatableDecoration}) at either * the start or end of the connection. * @param target The RotatableDecoration to relocate */ public void relocate(IFigure target) { PointList points = getConnection().getPoints(); RotatableDecoration arrow = cast(RotatableDecoration)target; arrow.setLocation(getLocation(points)); if (getAlignment() is SOURCE) arrow.setReferencePoint(points.getPoint(1)); else if (getAlignment() is TARGET) arrow.setReferencePoint(points.getPoint(points.size() - 2)); } }
D
an animal or plant that lives in or on a host (another animal or plant a follower who hangs around a host (without benefit to the host) in hope of gain or advantage
D
/Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/SwiftStudy.build/Debug-iphonesimulator/SwiftStudy.build/Objects-normal/x86_64/study.o : /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/Square.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/NextViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/study.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/ExampleProtocol.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/CardViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/NamedShape.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/ViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/AppDelegate.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/HamburgerButton.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/SwiftStudy.build/Debug-iphonesimulator/SwiftStudy.build/Objects-normal/x86_64/study~partial.swiftmodule : /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/Square.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/NextViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/study.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/ExampleProtocol.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/CardViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/NamedShape.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/ViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/AppDelegate.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/HamburgerButton.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule /Users/kevin/Documents/workspace_Xcode/SwiftStudy/DerivedData/SwiftStudy/Build/Intermediates/SwiftStudy.build/Debug-iphonesimulator/SwiftStudy.build/Objects-normal/x86_64/study~partial.swiftdoc : /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/Square.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/NextViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/study.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/ExampleProtocol.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/CardViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/NamedShape.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/ViewController.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/AppDelegate.swift /Users/kevin/Documents/workspace_Xcode/SwiftStudy/SwiftStudy/HamburgerButton.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/Security.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/CoreImage.swiftmodule
D
module hunt.wechat.bean.menu.Button; import hunt.collection.List; class Button { private string type; // click|view|scancode_waitmsg|scancode_push|pic_sysphoto|pic_photo_or_album|pic_weixin|location_select|media_id|view_limited|miniprogram private string name; private string key; private string url; private string media_id; private string appid; // 小程序的appid private string pagepath;// 小程序的页面路径 private List!(Button) sub_button; public this() { } public this(string type, string name, string key, string url, string media_id, string appid, string pagepath) { this.type = type; this.name = name; this.key = key; this.url = url; this.media_id = media_id; this.appid = appid; this.pagepath = pagepath; } public string getType() { return type; } public void setType(string type) { this.type = type; } public string getName() { return name; } public void setName(string name) { this.name = name; } public string getKey() { return key; } public void setKey(string key) { this.key = key; } public string getUrl() { return url; } public void setUrl(string url) { this.url = url; } public List!(Button) getSub_button() { return sub_button; } public void setSub_button(List!(Button) subButton) { sub_button = subButton; } public string getMedia_id() { return media_id; } public void setMedia_id(string media_id) { this.media_id = media_id; } public string getAppid() { return appid; } public void setAppid(string appid) { this.appid = appid; } public string getPagepath() { return pagepath; } public void setPagepath(string pagepath) { this.pagepath = pagepath; } }
D
module android.java.android.view.Gravity_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import0 = android.java.android.graphics.Rect_d_interface; import import1 = android.java.java.lang.Class_d_interface; final class Gravity : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import this(arsd.jni.Default); @Import static void apply(int, int, int, import0.Rect, import0.Rect); @Import static void apply(int, int, int, import0.Rect, import0.Rect, int); @Import static void apply(int, int, int, import0.Rect, int, int, import0.Rect); @Import static void apply(int, int, int, import0.Rect, int, int, import0.Rect, int); @Import static void applyDisplay(int, import0.Rect, import0.Rect); @Import static void applyDisplay(int, import0.Rect, import0.Rect, int); @Import static bool isVertical(int); @Import static bool isHorizontal(int); @Import static int getAbsoluteGravity(int, int); @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/view/Gravity;"; }
D
/Users/thendral/POC/vapor/Friends/.build/debug/Console.build/Command/Value.swift.o : /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Bar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Argument.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Command+Print.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Command.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Group.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Option.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Runnable.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Value.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Ask.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Center.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Confirm.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Options.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Print.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Run.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/ConsoleError.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/FileHandle+Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/Pipe+Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/String+ANSI.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/Terminal+Command.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Utilities/String+Trim.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Loading/LoadingBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Progress/ProgressBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Clear/ConsoleClear.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Color/ConsoleColor.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Style/ConsoleStyle.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Polymorphic.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Core.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Console.build/Value~partial.swiftmodule : /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Bar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Argument.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Command+Print.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Command.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Group.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Option.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Runnable.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Value.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Ask.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Center.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Confirm.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Options.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Print.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Run.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/ConsoleError.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/FileHandle+Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/Pipe+Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/String+ANSI.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/Terminal+Command.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Utilities/String+Trim.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Loading/LoadingBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Progress/ProgressBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Clear/ConsoleClear.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Color/ConsoleColor.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Style/ConsoleStyle.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Polymorphic.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Core.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Console.build/Value~partial.swiftdoc : /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Bar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Argument.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Command+Print.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Command.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Group.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Option.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Runnable.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Command/Value.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Ask.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Center.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Confirm.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Options.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Print.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console+Run.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Console.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/ConsoleError.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/FileHandle+Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/Pipe+Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Stream/Stream.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/ConsoleColor+Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/ConsoleStyle+Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/String+ANSI.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/Terminal+Command.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Terminal/Terminal.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Utilities/Bool+Polymorphic.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Utilities/String+Trim.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Loading/Console+LoadingBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Loading/LoadingBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Progress/Console+ProgressBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Bar/Progress/ProgressBar.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Clear/ConsoleClear.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Color/ConsoleColor.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Style/Console+ConsoleStyle.swift /Users/thendral/POC/vapor/Friends/Packages/Console-1.0.2/Sources/Console/Console/Style/ConsoleStyle.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/libc.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Polymorphic.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Users/thendral/POC/vapor/Friends/.build/debug/Core.swiftmodule
D
/***********************************************************************\ * basetyps.d * * * * Windows API header module * * * * Translated from MinGW API for MS-Windows 3.10 * * * * Placed into public domain * \***********************************************************************/ module os.win32.basetyps; private import os.win32.windef, os.win32.basetsd; align(1) struct GUID { // size is 16 DWORD Data1; WORD Data2; WORD Data3; BYTE[8] Data4; } alias GUID UUID, IID, CLSID, FMTID, uuid_t; alias GUID* LPGUID, LPCLSID, LPIID; alias CPtr!(GUID) REFGUID, REFIID, REFCLSID, REFFMTID; alias uint error_status_t, PROPID;
D
# nm: -B # # match for 32 and 64 bits. (00000000)?00008000 b align_max (00000000)?00000010 b another_align (00000000)?00000000 b column0 (00000000)?00000002 b column1 (00000000)?00000004 b local3_noalign (00000000)?00000008 b local4_aligned_2 (00000000)?00000020 b nospaces (00000000)?00000040 b trailingspace #
D
module gsl.spline; /* interpolation/gsl_spline.h * * Copyright (C) 2001, 2007 Brian Gough * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * D interface file for gsl_spline.h & gsl_spline2d.h * Author: Chibisi Chima-Okereke */ import gsl.interp; extern (C){ /* general interpolation object */ struct gsl_spline{ gsl_interp* interp; double* x; double* y; size_t size; } gsl_spline* gsl_spline_alloc(const(gsl_interp_type)* T, size_t size); int gsl_spline_init(gsl_spline* spline, const(double)* xa, const(double)* ya, size_t size); const(char)* gsl_spline_name(const(gsl_spline)* spline); uint gsl_spline_min_size(const(gsl_spline)* spline); int gsl_spline_eval_e(const(gsl_spline)* spline, double x, gsl_interp_accel* a, double* y); double gsl_spline_eval(const(gsl_spline)* spline, double x, gsl_interp_accel* a); int gsl_spline_eval_deriv_e(const(gsl_spline)* spline, double x, gsl_interp_accel* a, double* y); double gsl_spline_eval_deriv(const(gsl_spline)* spline, double x, gsl_interp_accel* a); int gsl_spline_eval_deriv2_e(const(gsl_spline)* spline, double x, gsl_interp_accel* a, double* y); double gsl_spline_eval_deriv2(const(gsl_spline)* spline, double x, gsl_interp_accel* a); int gsl_spline_eval_integ_e(const(gsl_spline)* spline, double a, double b, gsl_interp_accel* acc, double* y); double gsl_spline_eval_integ(const(gsl_spline)* spline, double a, double b, gsl_interp_accel* acc); void gsl_spline_free(gsl_spline* spline); /* * A 2D interpolation object which stores the arrays defining the function. * In all other respects, this is just like a gsl_interp2d object. */ struct gsl_spline2d { gsl_interp2d interp_object; /* low-level interpolation object */ double* xarr; /* x data array */ double* yarr; /* y data array */ double* zarr; /* z data array */ } gsl_spline2d* gsl_spline2d_alloc(const(gsl_interp2d_type)* T, size_t xsize, size_t ysize); int gsl_spline2d_init(gsl_spline2d * interp, const(double)* xa, const(double)* ya, const(double)* za, size_t xsize, size_t ysize); void gsl_spline2d_free(gsl_spline2d* interp); double gsl_spline2d_eval(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya); int gsl_spline2d_eval_e(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya, double* z); double gsl_spline2d_eval_deriv_x(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya); int gsl_spline2d_eval_deriv_x_e(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya, double* z); double gsl_spline2d_eval_deriv_y(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya); int gsl_spline2d_eval_deriv_y_e(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya, double* z); double gsl_spline2d_eval_deriv_xx(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya); int gsl_spline2d_eval_deriv_xx_e(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya, double* z); double gsl_spline2d_eval_deriv_yy(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya); int gsl_spline2d_eval_deriv_yy_e(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya, double* z); double gsl_spline2d_eval_deriv_xy(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya); int gsl_spline2d_eval_deriv_xy_e(const(gsl_spline2d)* interp, const(double) x, const(double) y, gsl_interp_accel* xa, gsl_interp_accel* ya, double* z); size_t gsl_spline2d_min_size(const(gsl_spline2d)* interp); const(char)* gsl_spline2d_name(const(gsl_spline2d)* interp); int gsl_spline2d_set(const(gsl_spline2d)* interp, double* zarr, const(size_t) i, const(size_t) j, const(double) z); double gsl_spline2d_get(const(gsl_spline2d)* interp, const(double)* zarr, const size_t i, const size_t j); }
D
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE -65.400002 61.2999992 1.39999998 297 50 70 -31.6000004 145.600006 9339 2.20000005 2.20000005 0.05 sediments, saprolite 264.399994 75 15.6000004 0 2 65 -8.80000019 126.699997 1206 10.3999996 18 0.0317460317 extrusives, intrusives 346 61 9 41.2000008 35 100 -31.3999996 138.600006 1170 13 15 0.0307692308 sediments 333 45 9 16.5 35 100 -30.3999996 139.399994 1161 17 18 0.0307692308 sediments, tillite 317 57 5 200 35 100 -30.5 139.300003 1165 9 10 0.0307692308 sediments, redbeds 329 58 25 4.0999999 35 100 -30.2000008 139 1166 41.5999985 45.5999985 0.0307692308 sediments, sandstone, tillite 223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 0.0307692308 extrusives 320 63 9 15.5 34 65 -38 145.5 1854 16 16 0.064516129 extrusives 314 70 6 132 48 50 -33.2999992 151.199997 1844 9 10 0.5 intrusives, basalt 317 63 14 16 23 56 -32.5 151 1840 20 20 0.0606060606 extrusives, basalts 302.700012 66.8000031 6.80000019 35 34 65 -38 145.5 1819 10.8000002 12.1000004 0.064516129 extrusives 305 73 17 29 23 56 -42 147 1821 25 29 0.0606060606 extrusives, basalts 274 66 27.6000004 8.60000038 25 65 -41.2999992 145.899994 1873 39.7999992 46.9000015 0.05 intrusives, granite 321 64 6 27.5 25 65 -35.5999985 137.5 1874 10 11 0.05 sediments 269 40 0 0 50 300 -32.5999985 151.5 1868 0 0 0.004 extrusives, andesites 294 75 11 7 25 65 -41.0999985 146.100006 1871 16.2999992 18.8999996 0.05 sediments, sandstone 315 66 10.5 18 25 65 -41 145.5 1872 18.2000008 19.6000004 0.05 extrusives, sediments 298 58.7999992 2.4000001 0 35 65 -27 141.5 1972 3.79999995 3.79999995 0.0666666667 sediments, weathered 314 66 5.5999999 161 48 50 -33.2999992 151.199997 1969 8.5 9.80000019 0.5 intrusives, basalt 297.200012 59.2000008 6 0 50 70 -30.5 151.5 1964 9.10000038 9.89999962 0.05 sediments, weathered 310.899994 68.5 0 0 40 60 -35 150 1927 5.19999981 5.19999981 0.1 extrusives, basalts 271 63 2.9000001 352 50 80 -34 151 1595 3.5 4.5 0.0333333333 intrusives 278 66 2.0999999 333 48 50 -33.2999992 151.199997 1596 2.5999999 3.29999995 0.5 intrusives, basalt
D
module sb.mesh.mesh_data; import gl3n.linalg; import std.typecons; class SbModelData { string name; SbMeshData[] meshes; this (string name) { this.name = name; } auto getMesh (string name) { foreach (mesh; meshes) { if (mesh.name == name) return mesh; } auto mesh = new SbMeshData(name); meshes ~= mesh; return mesh; } } enum SbVertexFormat { INTERLEAVED_V3_N3_T2 } class SbMeshData { string name; //ushort[] indices; //vec3[] vertices; //vec2[] uvs; //vec3[] normals; float[] packedData; SbVertexFormat dataFormat; this (string name) { this.name = name; } } class SbSubMesh {} SbModelData sbLoadObjFile ( string path, SbModelData model = null ) { import std.stdio; import std.file; import std.exception; import std.format; import std.conv: parse; import std.string; enforce(exists(path), format("File does not exist: '%s'", path)); if (!model) model = new SbModelData( path ); auto mesh = model.getMesh("root"); try { writefln("Loading '%s'", path); string start_line; auto parsef ( ref string s, string skip = " \t" ) { s.munch(skip); auto r = s.munch("-0123456789."); return r.parse!float; } // Store data in temporaries, then write in batch to: // - fixup varying indices (wavefront allows verts to have different indices than normals; we do not) // - sanity check indices (bounds checks, etc) // - pack data into our own data structures, split large meshes into multiple parts, etc vec3[] vertices, normals; vec2[] uvs; Tuple!(uint, uint, uint)[] tris; bool hasVaryingIndices = false; void writeMesh () { mesh.dataFormat = SbVertexFormat.INTERLEAVED_V3_N3_T2; foreach (elem; tris) { enforce( elem[0] < vertices.length, format("Vertex range violation: %s (%s)", elem[0], vertices.length )); enforce( elem[1] < normals.length, format("Normal range violation: %s (%s)", elem[1], normals.length)); enforce( elem[2] < uvs.length, format("UV range violation: %s (%s)", elem[2], uvs.length)); vec3 v = vertices[elem[0]]; vec3 n = normals[elem[1]]; vec2 t = uvs[elem[2]]; mesh.packedData ~= [ v.x, v.y, v.z, n.x, n.y, n.t, t.x, t.y ]; writefln("Interleaved: %s, %s, %s", v, n, t); } } // temporaries int[4] v_indices, vn_indices, vt_indices; foreach (line; path.readText.splitLines) { if (line.length <= 2 || line[0] == '#') continue; try { start_line = line[0..$]; switch (line[0..2]) { case "v ": { vertices ~= vec3( parsef(line, " \tv"), parsef(line), parsef(line), ); //writefln("Vertex %s '%s'", mesh.vertices[$-1], start_line); } break; case "vt": { uvs ~= vec2( parsef(line, " \tvt"), parsef(line) ); //writefln("Vertex UV: %s '%s'", mesh.uvs[$-1], start_line); } break; case "vn": { normals ~= vec3( parsef(line, " \tvn"), parsef(line), parsef(line)); //writefln("Vertex Normal: %s '%s'", mesh.normals[$-1], start_line); } break; case "f ": { line.munch("f \t"); uint i = 0; while (line.length) { v_indices[i] = parse!int( line ); if (line.munch("/").length) { vn_indices[i] = parse!int( line ); if (line.munch("/").length) vt_indices[i] = parse!int( line ); else vt_indices[i] = v_indices[i]; } else { vt_indices[i] = vn_indices[i] = v_indices[i]; } line.munch(" \t"); enforce(++i <= 4, format("Invalid: > 4 indices (not tri / quad) '%s' here: '%s'", start_line, line)); } enforce( i == 3 || i == 4, format("Invalid # of index pairs: %s in '%s'", i, start_line )); enforce( i != 4, format("Quads unsupported: '%s'", start_line)); foreach (k; 0 .. 3 ) { auto v = v_indices[k], n = vn_indices[k], t = vt_indices[k]; hasVaryingIndices = hasVaryingIndices || v != n || v != t; if ( v < 0 ) v = cast(int)(vertices.length - v); if ( n < 0 ) n = cast(int)(normals.length - n); if ( t < 0 ) t = cast(int)(uvs.length - t); tris ~= tuple( cast(uint)v, cast(uint)n, cast(uint)t ); } } break; case "g ": { auto newMesh = model.getMesh( line[2..$].strip ); if (newMesh != mesh) { writeMesh(); } mesh = newMesh; } break; default: if (line.length >= 6 && line[0..6] == "usemtl") { } else if (line.length >= 6 && line[0..6] == "mtllib") { } else { writefln("Unhandled line '%s'", line); } } } catch (Exception e) { writefln("Failed to parse line '%s' '%s':\n%s", start_line, line, e); } } writeMesh(); return model; } catch (Exception e) { throw new Exception(format("While parsing '%s': %s", path, e)); } }
D
module neton.rpcservice.WatchService; import neton.protocol.neton; import neton.protocol.neton; import neton.protocol.netonrpc; import grpc; import hunt.logging; import neton.server.NetonRpcServer; import neton.util.Future; import neton.rpcservice.Command; import std.stdio; import hunt.util.Serialize; import core.sync.mutex; import std.conv; struct WatchInfo { bool created = false; long watchId = 0; ResponseHeader header; } __gshared size_t WATCH_ID = 0; __gshared Mutex _gmutex; shared static this() { _gmutex = new Mutex(); } size_t plusWatchId() { synchronized( _gmutex ) { ++WATCH_ID; } return WATCH_ID; } class WatchService : WatchBase { override Status Watch(ServerReaderWriter!(WatchRequest, WatchResponse) rw) { logDebug("--------------"); WatchRequest watchReq; while (rw.read(watchReq)) { logDebug("watch -----> : ", watchReq.requestUnionCase(), " last watchid : ",WATCH_ID); if (watchReq.requestUnionCase() == WatchRequest.RequestUnionCase.createRequest) { auto f = new Future!(ServerReaderWriter!(WatchRequest, WatchResponse), WatchInfo)( rw); WatchResponse respon = new WatchResponse(); respon.created = true; respon.watchId = plusWatchId(); auto header = new ResponseHeader(); header.clusterId = 1; header.memberId = 1; header.raftTerm = 1; header.revision = 1; respon.header = header; rw.write(respon); RpcRequest rreq; rreq.CMD = RpcReqCommand.WatchRequest; rreq.Key = cast(string)(watchReq._createRequest.key); rreq.Value = respon.watchId.to!string; rreq.Hash = this.toHash() + respon.watchId; WatchInfo info; info.created = true; info.watchId = respon.watchId; info.header = header; f.setExtraData(info); NetonRpcServer.instance().ReadIndex(rreq, f); } else if (watchReq.requestUnionCase() == WatchRequest.RequestUnionCase.cancelRequest) { logDebug("watch cancel ID : ",watchReq._cancelRequest.watchId); auto f = new Future!(ServerReaderWriter!(WatchRequest, WatchResponse), WatchInfo)( rw); auto watchID = watchReq._cancelRequest.watchId; auto header = new ResponseHeader(); header.clusterId = 1; header.memberId = 1; header.raftTerm = 1; header.revision = 1; RpcRequest rreq; rreq.CMD = RpcReqCommand.WatchCancelRequest; rreq.Value = watchID.to!string; rreq.Hash = this.toHash() + watchID; WatchInfo info; info.created = false; info.watchId = watchID; info.header = header; f.setExtraData(info); NetonRpcServer.instance().Propose(rreq, f); } } logWarning("watch service end : ", this.toHash()); return Status.OK; } }
D
/home/mailboxhead/Documents/Practice/rust/itemRestAPI/target/rls/debug/build/native-tls-a229a2a7cd607883/build_script_build-a229a2a7cd607883: /home/mailboxhead/.cargo/registry/src/github.com-1ecc6299db9ec823/native-tls-0.2.3/build.rs /home/mailboxhead/Documents/Practice/rust/itemRestAPI/target/rls/debug/build/native-tls-a229a2a7cd607883/build_script_build-a229a2a7cd607883.d: /home/mailboxhead/.cargo/registry/src/github.com-1ecc6299db9ec823/native-tls-0.2.3/build.rs /home/mailboxhead/.cargo/registry/src/github.com-1ecc6299db9ec823/native-tls-0.2.3/build.rs:
D
--- title: "Go Concurrent Merge Sort" date: 2019-07-28T12:21:59-04:00 draft: true --- One of the reasons I picked up Go is its excellent support for concurrency, and I specifically find the CSP model to be very intuitive. So whenever I find an interesting algorithm I try to make it concurrent / see how fast I can make it. I [previously](http://www.johnshiver.org/posts/merge-sort/) wrote about how to implement merge sort in Python, so that knowledge is assumed. Here I will implement a concurrent merge sort in Go. First, lets take a quick look at a serial merge sort in Go: {{< highlight go>}} func MergeSort(ints []int) []int { if len(ints) <= 1 { return ints } mid := len(ints) / 2 left := ints[:mid] right := ints[mid:] left = MergeSort(left) right = MergeSort(right) return Merge(left, right) } {{< /highlight >}} {{< highlight go>}} func SlowMerge(left, right []int) []int { var merged []int var l, r int for l < len(left) && r < len(right) { if left[l] <= right[r] { merged = append(merged, left[l]) l++ } else { merged = append(merged, right[r]) r++ } } for l < len(left) { merged = append(merged, left[l]) l++ } for r < len(right) { merged = append(merged, right[r]) r++ } return merged } {{< /highlight >}} {{< highlight go>}} func MergeSortConcurrentSizeLimit(ints []int) []int { } func mergeSortConcurrentSizeLimit(ints []int) []int { if len(ints) <= 1 { return ints } mid := len(ints) / 2 wg := sync.WaitGroup{} wg.Add(2) var l []int var r []int if len(ints) >= CONC_LIMIT { go func() { l = MergeSortConcurrentSizeLimit(ints[:mid]) wg.Done() }() } else { l = MergeSort(ints[:mid]) wg.Done() } if len(ints) >= CONC_LIMIT { go func() { r = MergeSortConcurrentSizeLimit(ints[mid:]) wg.Done() }() } else { r = MergeSort(ints[mid:]) wg.Done() } wg.Wait() return Merge(l, r) } {{< /highlight >}}
D
import std.stdio; import czmq; int main(char[][] args) { zctx_t* ctx = zctx_new(); void* socket; static if(ZMQ_VERSION_MAJOR == 2) { socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_hwm(socket, 1); assert (zsockopt_hwm(socket) == 1); zsockopt_hwm(socket); zsocket_destroy(ctx, socket); socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_swap(socket, 1); assert (zsockopt_swap(socket) == 1); zsockopt_swap(socket); zsocket_destroy(ctx, socket); socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_affinity(socket, 1); assert (zsockopt_affinity(socket) == 1); zsockopt_affinity(socket); zsocket_destroy(ctx, socket); socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_identity(socket, "test".ptr); zsocket_destroy(ctx, socket); socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_rate(socket, 1); assert (zsockopt_rate(socket) == 1); zsockopt_rate (socket); zsocket_destroy (ctx, socket); socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_recovery_ivl(socket, 1); assert (zsockopt_recovery_ivl(socket) == 1); zsockopt_recovery_ivl(socket); zsocket_destroy(ctx, socket); socket = zsocket_new(ctx, ZMQ_SUB); zsockopt_set_recovery_ivl_msec(socket, 1); assert (zsockopt_recovery_ivl_msec(socket) == 1); zsockopt_recovery_ivl_msec(socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_mcast_loop (socket, 1); assert (zsockopt_mcast_loop (socket) == 1); zsockopt_mcast_loop (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_sndbuf (socket, 1); assert (zsockopt_sndbuf (socket) == 1); zsockopt_sndbuf (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rcvbuf (socket, 1); assert (zsockopt_rcvbuf (socket) == 1); zsockopt_rcvbuf (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_linger (socket, 1); assert (zsockopt_linger (socket) == 1); zsockopt_linger (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_reconnect_ivl (socket, 1); assert (zsockopt_reconnect_ivl (socket) == 1); zsockopt_reconnect_ivl (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_reconnect_ivl_max (socket, 1); assert (zsockopt_reconnect_ivl_max (socket) == 1); zsockopt_reconnect_ivl_max (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_backlog (socket, 1); assert (zsockopt_backlog (socket) == 1); zsockopt_backlog (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_subscribe (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_unsubscribe (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_type (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_rcvmore (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_fd (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_events (socket); zsocket_destroy (ctx, socket); } static if(ZMQ_VERSION_MAJOR == 3) { socket = zsocket_new (ctx, ZMQ_PUB); zsockopt_set_sndhwm (socket, 1); assert (zsockopt_sndhwm (socket) == 1); zsockopt_sndhwm (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rcvhwm (socket, 1); assert (zsockopt_rcvhwm (socket) == 1); zsockopt_rcvhwm (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_affinity (socket, 1); assert (zsockopt_affinity (socket) == 1); zsockopt_affinity (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_identity (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rate (socket, 1); assert (zsockopt_rate (socket) == 1); zsockopt_rate (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_recovery_ivl (socket, 1); assert (zsockopt_recovery_ivl (socket) == 1); zsockopt_recovery_ivl (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_PUB); zsockopt_set_sndbuf (socket, 1); assert (zsockopt_sndbuf (socket) == 1); zsockopt_sndbuf (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rcvbuf (socket, 1); assert (zsockopt_rcvbuf (socket) == 1); zsockopt_rcvbuf (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_linger (socket, 1); assert (zsockopt_linger (socket) == 1); zsockopt_linger (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_reconnect_ivl (socket, 1); assert (zsockopt_reconnect_ivl (socket) == 1); zsockopt_reconnect_ivl (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_reconnect_ivl_max (socket, 1); assert (zsockopt_reconnect_ivl_max (socket) == 1); zsockopt_reconnect_ivl_max (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_backlog (socket, 1); assert (zsockopt_backlog (socket) == 1); zsockopt_backlog (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_maxmsgsize (socket, 1); assert (zsockopt_maxmsgsize (socket) == 1); zsockopt_maxmsgsize (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_subscribe (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_unsubscribe (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_type (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_rcvmore (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_fd (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_events (socket); zsocket_destroy (ctx, socket); zsockopt_set_hwm (socket, 1); } //Really? 3 is still beta... static if(ZMQ_VERSION_MAJOR == 4) { socket = zsocket_new (ctx, ZMQ_PUB); zsockopt_set_sndhwm (socket, 1); assert (zsockopt_sndhwm (socket) == 1); zsockopt_sndhwm (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rcvhwm (socket, 1); assert (zsockopt_rcvhwm (socket) == 1); zsockopt_rcvhwm (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_affinity (socket, 1); assert (zsockopt_affinity (socket) == 1); zsockopt_affinity (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rate (socket, 1); assert (zsockopt_rate (socket) == 1); zsockopt_rate (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_recovery_ivl (socket, 1); assert (zsockopt_recovery_ivl (socket) == 1); zsockopt_recovery_ivl (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_PUB); zsockopt_set_sndbuf (socket, 1); assert (zsockopt_sndbuf (socket) == 1); zsockopt_sndbuf (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_rcvbuf (socket, 1); assert (zsockopt_rcvbuf (socket) == 1); zsockopt_rcvbuf (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_linger (socket, 1); assert (zsockopt_linger (socket) == 1); zsockopt_linger (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_reconnect_ivl (socket, 1); assert (zsockopt_reconnect_ivl (socket) == 1); zsockopt_reconnect_ivl (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_reconnect_ivl_max (socket, 1); assert (zsockopt_reconnect_ivl_max (socket) == 1); zsockopt_reconnect_ivl_max (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_backlog (socket, 1); assert (zsockopt_backlog (socket) == 1); zsockopt_backlog (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_maxmsgsize (socket, 1); assert (zsockopt_maxmsgsize (socket) == 1); zsockopt_maxmsgsize (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_subscribe (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_set_unsubscribe (socket, "test".ptr); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_type (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_rcvmore (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_fd (socket); zsocket_destroy (ctx, socket); socket = zsocket_new (ctx, ZMQ_SUB); zsockopt_events (socket); zsocket_destroy (ctx, socket); zsockopt_set_hwm (socket, 1); } zctx_destroy (&ctx); assert (ctx == null); writeln("test_zsockopt passes"); return 0; }
D
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: chat/v1/channels.proto module protocol.chat.v1.channels; import google.protobuf; import protocol.harmonytypes.v1.types; enum protocVersion = 3012004; class CreateChannelRequest { @Proto(1) ulong guildId = protoDefaultValue!ulong; @Proto(2) string channelName = protoDefaultValue!string; @Proto(3) bool isCategory = protoDefaultValue!bool; @Proto(4) ulong nextId = protoDefaultValue!ulong; @Proto(5) ulong previousId = protoDefaultValue!ulong; @Proto(6) Metadata metadata = protoDefaultValue!Metadata; } class CreateChannelResponse { @Proto(1) ulong channelId = protoDefaultValue!ulong; } class GetGuildChannelsRequest { @Proto(1) ulong guildId = protoDefaultValue!ulong; } class GetGuildChannelsResponse { @Proto(1) Channel[] channels = protoDefaultValue!(Channel[]); static class Channel { @Proto(1) ulong channelId = protoDefaultValue!ulong; @Proto(2) string channelName = protoDefaultValue!string; @Proto(3) bool isCategory = protoDefaultValue!bool; @Proto(4) Metadata metadata = protoDefaultValue!Metadata; } } class UpdateChannelInformationRequest { @Proto(1) ulong guildId = protoDefaultValue!ulong; @Proto(2) ulong channelId = protoDefaultValue!ulong; @Proto(3) string name = protoDefaultValue!string; @Proto(4) bool updateName = protoDefaultValue!bool; @Proto(5) Metadata metadata = protoDefaultValue!Metadata; @Proto(6) bool updateMetadata = protoDefaultValue!bool; } class UpdateChannelOrderRequest { @Proto(1) ulong guildId = protoDefaultValue!ulong; @Proto(2) ulong channelId = protoDefaultValue!ulong; @Proto(3) ulong previousId = protoDefaultValue!ulong; @Proto(4) ulong nextId = protoDefaultValue!ulong; } class DeleteChannelRequest { @Proto(1) ulong guildId = protoDefaultValue!ulong; @Proto(2) ulong channelId = protoDefaultValue!ulong; } class TypingRequest { @Proto(1) ulong guildId = protoDefaultValue!ulong; @Proto(2) ulong channelId = protoDefaultValue!ulong; } import harmonytemplates.templates;
D
/* Copyright (c) 2015 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 dgl.asset.resman; import std.stdio; import std.file; import dlib.core.memory; import dlib.container.array; import dlib.container.dict; import dlib.image.io.png; import dlib.filesystem.filesystem; import dlib.filesystem.stdfs; import dlib.image.unmanaged; import dgl.core.interfaces; import dgl.vfs.vfs; import dgl.graphics.texture; import dgl.ui.font; import dgl.graphics.scene; import dgl.graphics.lightmanager; import dgl.graphics.shadow; import dgl.asset.dgl2; class ResourceManager: Freeable, Drawable { VirtualFileSystem fs; UnmanagedImageFactory imgFac; Dict!(Font, string) fonts; Dict!(Texture, string) textures; DynamicArray!Scene _scenes; Dict!(size_t, string) scenesByName; LightManager lm; ShadowMap shadow; bool enableShadows = false; this() { fs = New!VirtualFileSystem(); imgFac = New!UnmanagedImageFactory(); fonts = New!(Dict!(Font, string))(); textures = New!(Dict!(Texture, string))(); scenesByName = New!(Dict!(size_t, string))(); lm = New!LightManager(); lm.lightsVisible = true; } Font addFont(string name, Font f) { fonts[name] = f; return f; } Font getFont(string name) { return fonts[name]; } Texture addTexture(string name, Texture t) { textures[name] = t; return t; } Texture getTexture(string filename) { if (filename in textures) return textures[filename]; if (!fileExists(filename)) { writefln("Warning: cannot find image file (trying to load \'%s\')", filename); return null; } auto fstrm = fs.openForInput(filename); auto res = loadPNG(fstrm, imgFac); Delete(fstrm); if (res[0] is null) { return null; } else { auto tex = New!Texture(res[0]); res[0].free(); return addTexture(filename, tex); } } Scene loadScene(string filename, bool visible = true) { Scene scene = New!Scene(this); scene.clearArrays(); auto fstrm = fs.openForInput(filename); loadDGL2(fstrm, scene); Delete(fstrm); scene.resolveLinks(); scene.visible = visible; _scenes.append(scene); scenesByName[filename] = _scenes.length; return scene; } Scene addEmptyScene(string name, bool visible = true) { Scene scene = New!Scene(this); scene.visible = visible; _scenes.append(scene); scenesByName[name] = _scenes.length; return scene; } void freeFonts() { foreach(i, f; fonts) f.free(); Delete(fonts); } void freeTextures() { foreach(i, t; textures) t.free(); Delete(textures); } void freeScenes() { foreach(i, s; _scenes.data) s.free(); _scenes.free(); Delete(scenesByName); } ~this() { Delete(imgFac); fs.free(); freeFonts(); freeTextures(); freeScenes(); lm.free(); if (shadow !is null) shadow.free(); } void free() { Delete(this); } void draw(double dt) { if (enableShadows && shadow) shadow.draw(dt); foreach(i, s; _scenes.data) if (s.visible) s.draw(dt); lm.draw(dt); } bool fileExists(string filename) { FileStat stat; return fs.stat(filename, stat); } // Don't forget to delete the string! string readText(string filename) { auto fstrm = fs.openForInput(filename); string text = .readText(fstrm); Delete(fstrm); return text; } }
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric; void main() { auto K = readln.chomp.to!int; auto S = readln.chomp; if (S.length <= K) { writeln(S); } else { writeln(S[0..K], "..."); } }
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric; void main() { int solve(int n, int x, int p) { if (p == 0) return x == 0 ? 1 : 0; if (n == 0) return 0; int r; if (x >= n) r += solve(n-1, x-n, p-1); r += solve(n-1, x, p); return r; } for (;;) { auto nx = readln.split.to!(int[]); auto n = nx[0]; auto x = nx[1]; if (n == 0 && x == 0) return; writeln(solve(n, x, 3)); } }
D
/Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/YoutubeKit.build/Objects-normal/x86_64/YoutubeKit.o : /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ResourceID.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/YoutubeDataAPI.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoSyndicated.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Localized.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/HTTPMethod.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchSafeMode.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoEmbeddable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Common/QueryParameterable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requestable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchResourceType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchEventType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoLicense.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyPlayerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/MyRating.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Thumbnail.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDimension.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/ApiSession.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDuration.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDefinition.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoCaption.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PageInfo.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/ResultOrder.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/Filter.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyPlayer.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Error/ResponseError.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Error/RequestError.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Statistics.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ContentDetails.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/RequestableExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/BoolExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/DictionaryExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyConstants.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/CommentModerationStatus.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/CommentTextFormat.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Snippet.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/YoutubeKit.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Common/Result.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/Part.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ActivityInsertRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/SearchListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ChannelListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CaptionListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CommentThreadsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/I18nLanguagesListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/GuideCategoriesListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/PlaylistItemsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/I18nRegionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ChannelSectionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/SubscriptionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoAbuseReportReasonsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/PlaylistsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CommentListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoCategoryListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ActivityListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/SearchList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ChannelList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CaptionList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CommentThreadsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/I18nLanguagesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/GuideCategoriesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoCategoriesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PlaylistItemsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/I18nRegionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ChannelSectionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/SubscriptionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoAbuseReportReasonsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PlaylistsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CommentList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ActivityList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/VideoCategory.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/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/YoutubeKit/YoutubeKit-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/YoutubeKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/YoutubeKit.build/Objects-normal/x86_64/YoutubeKit~partial.swiftmodule : /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ResourceID.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/YoutubeDataAPI.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoSyndicated.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Localized.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/HTTPMethod.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchSafeMode.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoEmbeddable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Common/QueryParameterable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requestable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchResourceType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchEventType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoLicense.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyPlayerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/MyRating.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Thumbnail.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDimension.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/ApiSession.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDuration.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDefinition.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoCaption.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PageInfo.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/ResultOrder.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/Filter.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyPlayer.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Error/ResponseError.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Error/RequestError.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Statistics.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ContentDetails.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/RequestableExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/BoolExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/DictionaryExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyConstants.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/CommentModerationStatus.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/CommentTextFormat.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Snippet.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/YoutubeKit.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Common/Result.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/Part.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ActivityInsertRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/SearchListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ChannelListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CaptionListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CommentThreadsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/I18nLanguagesListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/GuideCategoriesListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/PlaylistItemsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/I18nRegionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ChannelSectionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/SubscriptionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoAbuseReportReasonsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/PlaylistsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CommentListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoCategoryListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ActivityListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/SearchList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ChannelList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CaptionList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CommentThreadsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/I18nLanguagesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/GuideCategoriesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoCategoriesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PlaylistItemsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/I18nRegionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ChannelSectionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/SubscriptionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoAbuseReportReasonsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PlaylistsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CommentList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ActivityList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/VideoCategory.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/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/YoutubeKit/YoutubeKit-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/YoutubeKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/YoutubeKit.build/Objects-normal/x86_64/YoutubeKit~partial.swiftdoc : /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ResourceID.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/YoutubeDataAPI.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoSyndicated.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Localized.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/HTTPMethod.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchSafeMode.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoEmbeddable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Common/QueryParameterable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requestable.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchResourceType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchEventType.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoLicense.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyPlayerDelegate.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/MyRating.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Thumbnail.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDimension.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/ApiSession.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDuration.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoDefinition.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/SearchVideoCaption.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PageInfo.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/ResultOrder.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/Filter.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyPlayer.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Error/ResponseError.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Error/RequestError.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Statistics.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ContentDetails.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/RequestableExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/BoolExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Extensions/DictionaryExtensions.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Player/YTSwiftyConstants.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/CommentModerationStatus.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/CommentTextFormat.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/Snippet.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/YoutubeKit.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/Common/Result.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/Part.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ActivityInsertRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/SearchListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ChannelListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CaptionListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CommentThreadsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/I18nLanguagesListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/GuideCategoriesListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/PlaylistItemsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/I18nRegionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ChannelSectionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/SubscriptionsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoAbuseReportReasonsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/PlaylistsListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/CommentListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/VideoCategoryListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Requests/ActivityListRequest.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/SearchList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ChannelList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CaptionList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CommentThreadsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/I18nLanguagesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/GuideCategoriesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoCategoriesList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PlaylistItemsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/I18nRegionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ChannelSectionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/SubscriptionsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/VideoAbuseReportReasonsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/PlaylistsList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/CommentList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Models/ActivityList.swift /Users/radibarq/developer/NasaInArabic/Pods/YoutubeKit/YoutubeKit/API/Constants/VideoCategory.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/radibarq/developer/NasaInArabic/Pods/Target\ Support\ Files/YoutubeKit/YoutubeKit-umbrella.h /Users/radibarq/developer/NasaInArabic/build/Pods.build/Debug-iphonesimulator/YoutubeKit.build/unextended-module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/* REQUIRED_ARGS: PERMUTE_ARGS: */ // https://issues.dlang.org/show_bug.cgi?id=16538 const(int) retConst1(); int retConst2(); auto retConst = [&retConst1, &retConst2]; const(int*) retConstPtr1(); const(int)* retConstPtr2(); auto retConstPtr = [&retConstPtr1, &retConstPtr2]; void constArray1(const(int)[1]); void constArray2(const(int[1])); auto constArray = [&constArray1, &constArray2]; const(int)[] retConstSlice1(); const(int[]) retConstSlice2(); auto retConstSlice = [&retConstSlice1, &retConstSlice2]; void constSlice1(const(int)[]); void constSlice2(const(int[])); auto constSlice = [&constSlice1, &constSlice2]; void ptrToConst1(const(int)*); void ptrToConst2(const(int*)); auto ptrToConst = [&ptrToConst1, &ptrToConst2];
D
/** MongoClient class doing connection management. Usually this is a main entry point for client code. Copyright: © 2012 RejectedSoftware e.K. License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file. Authors: Sönke Ludwig */ module vibe.db.mongo.client; public import vibe.db.mongo.collection; public import vibe.db.mongo.database; import vibe.core.connectionpool; import vibe.core.log; import vibe.db.mongo.connection; import vibe.db.mongo.settings; import core.thread; import std.conv; import std.string; import std.range; /** Represents a connection to a MongoDB server. Note that this class uses a ConnectionPool internally to create and reuse network conections to the server as necessary. It should be reused for all fibers in a thread for optimum performance in high concurrency scenarios. */ final class MongoClient { @safe: private { ConnectionPool!MongoConnection m_connections; } package this(string host, ushort port) { this("mongodb://" ~ host ~ ":" ~ to!string(port) ~ "/?safe=true"); } /** Initializes a MongoDB client using a URL. The URL must be in the form documented at $(LINK http://www.mongodb.org/display/DOCS/Connections) which is: mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] Throws: An exception if the URL cannot be parsed as a valid MongoDB URL. */ package this(string url) { MongoClientSettings settings; auto goodUrl = parseMongoDBUrl(settings, url); if(!goodUrl) throw new Exception("Unable to parse mongodb URL: " ~ url); m_connections = new ConnectionPool!MongoConnection(() @safe { auto ret = new MongoConnection(settings); ret.connect(); return ret; }, settings.maxConnections ); // force a connection to cause an exception for wrong URLs lockConnection(); } package this(MongoClientSettings settings) { m_connections = new ConnectionPool!MongoConnection({ auto ret = new MongoConnection(settings); ret.connect(); return ret; }, settings.maxConnections ); // force a connection to cause an exception for wrong URLs lockConnection(); } /** Disconnects all currently unused connections to the server. */ void cleanupConnections() { m_connections.removeUnused((conn) nothrow @safe { try conn.disconnect(); catch (Exception e) { logWarn("Error thrown during MongoDB connection close: %s", e.msg); try () @trusted { logDebug("Full error: %s", e.toString()); } (); catch (Exception e) {} } }); } /** Accesses a collection using an absolute path. The full database.collection path must be specified. To access collections using a path relative to their database, use getDatabase in conjunction with MongoDatabase.opIndex. Returns: MongoCollection for the given combined database and collectiion name(path) Examples: --- auto col = client.getCollection("test.collection"); --- */ MongoCollection getCollection(string path) { return MongoCollection(this, path); } /** Returns an object representing the specified database. The returned object allows to access the database entity (which contains a set of collections). There are two main use cases: 1. Accessing collections using a relative path 2. Performing service commands on the database itself Note that there is no performance gain in accessing collections via a relative path compared to getCollection and an absolute path. Returns: MongoDatabase instance representing requested database Examples: --- auto db = client.getDatabase("test"); auto coll = db["collection"]; --- */ MongoDatabase getDatabase(string dbName) { return MongoDatabase(this, dbName); } /** Return a handle to all databases of the server. Returns: An input range of $(D MongoDatabase) objects. Examples: --- auto names = client.getDatabaseNames(); writeln("Current databases are: ", names); --- */ auto getDatabases()() { import std.algorithm : map; return lockConnection.listDatabases() .map!(info => MongoDatabase(this, info.name)); } package auto lockConnection() { return m_connections.lockConnection(); } }
D
/** * Contains TelegramShippingQuery */ module tg.payment.types.telegram_shipping_query; import tg.core.type, tg.core.exception; import std.json, tg.type; /** * This object contains information about an incoming shipping query. */ class TelegramShippingQuery : TelegramType { /** * Creates new type object */ nothrow pure public this () @safe { _id = ""; _from = null; _invoice_payload = ""; _shipping_address = null; } /** Add constructor with data init from response */ mixin(TelegramTypeConstructor); override public void setFromJson (JSONValue data) { if ( "id" !in data ) throw new TelegramException("Could not find reqired entry : id"); _id = data["id"].str(); if ( "from" !in data ) throw new TelegramException("Could not find reqired entry : from"); _from = new TelegramUser(data["from"]); if ( "invoice_payload" !in data ) throw new TelegramException("Could not find reqired entry : invoice_payload"); _invoice_payload = data["invoice_payload"].str(); if ( "shipping_address" !in data ) throw new TelegramException("Could not find reqired entry : shipping_address"); _shipping_address = new TelegramShippingAddress(data["shipping_address"]); } override public JSONValue getAsJson () { JSONValue data = parseJSON(""); data["id"] = _id; data["from"] = _from.getAsJson(); data["invoice_payload"] = _invoice_payload; data["shipping_address"] = _shipping_address.getAsJson(); return data; } /** Unique query identifier */ private string _id; /** * Getter for '_id' * Returns: Current value of '_id' */ @property string id () { return _id; } /** * Setter for '_id' * Params: idNew = New value of '_id' * Returns: New value of '_id' */ @property string id ( string idNew ) { return _id = idNew; } /** User who sent the query */ private TelegramUser _from; /** * Getter for '_from' * Returns: Current value of '_from' */ @property TelegramUser from () { return _from; } /** * Setter for '_from' * Params: fromNew = New value of '_from' * Returns: New value of '_from' */ @property TelegramUser from ( TelegramUser fromNew ) { return _from = fromNew; } /** Bot specified invoice payload */ private string _invoice_payload; /** * Getter for '_invoice_payload' * Returns: Current value of '_invoice_payload' */ @property string invoicePayload () { return _invoice_payload; } /** * Setter for '_invoice_payload' * Params: invoicePayloadNew = New value of '_invoice_payload' * Returns: New value of '_invoice_payload' */ @property string invoicePayload ( string invoicePayloadNew ) { return _invoice_payload = invoicePayloadNew; } /** User specified shipping address */ private TelegramShippingAddress _shipping_address; /** * Getter for '_shipping_address' * Returns: Current value of '_shipping_address' */ @property TelegramShippingAddress shippingAddress () { return _shipping_address; } /** * Setter for '_shipping_address' * Params: shippingAddressNew = New value of '_shipping_address' * Returns: New value of '_shipping_address' */ @property TelegramShippingAddress shippingAddress ( TelegramShippingAddress shippingAddressNew ) { return _shipping_address = shippingAddressNew; } }
D
/*#D*/ // Copyright © 2013-2016, Bernard Helyer. All rights reserved. // Copyright © 2013-2016, Jakob Bornecrantz. All rights reserved. // See copyright notice in src/volt/license.d (BOOST ver. 1.0). module volt.errors; import watt.conv : toLower; import watt.text.format : format; import watt.text.sink : StringSink; import watt.io.std : writefln; import ir = volta.ir; import volt.ir.printer; import volt.exceptions; import volt.arg : Settings; import volta.ir.token : tokenToString, TokenType; import volta.ir.location; // Not sure of the best home for this guy. void warning(ref in Location loc, string message) { writefln(format("%s: warning: %s", loc.toString(), message)); } void hackTypeWarning(ir.Node n, ir.Type nt, ir.Type ot) { auto str = format("%s: warning: types differ (new) %s vs (old) %s", n.loc.toString(), typeString(nt), typeString(ot)); writefln(str); } void warningAssignInCondition(ref in Location loc, bool warningsEnabled) { if (warningsEnabled) { warning(/*#ref*/loc, "assign in condition."); } } void warningStringCat(ref in Location loc, bool warningsEnabled) { if (warningsEnabled) { warning(/*#ref*/loc, "concatenation involving string."); } } void warningOldStyleVariable(ref in Location loc, bool magicFlagD, Settings settings) { if (!magicFlagD && settings.warningsEnabled) { warning(/*#ref*/loc, "old style variable declaration."); } } void warningOldStyleFunction(ref in Location loc, bool magicFlagD, Settings settings) { if (!magicFlagD && settings.warningsEnabled) { warning(/*#ref*/loc, "old style function declaration."); } } void warningOldStyleFunctionPtr(ref in Location loc, bool magicFlagD, Settings settings) { if (!magicFlagD && settings.warningsEnabled) { warning(/*#ref*/loc, "old style function pointer."); } } void warningOldStyleDelegateType(ref in Location loc, bool magicFlagD, Settings settings) { if (!magicFlagD && settings.warningsEnabled) { warning(/*#ref*/loc, "old style delegate type."); } } void warningOldStyleHexTypeSuffix(ref in Location loc, bool magicFlagD, Settings settings) { if (!magicFlagD && settings.warningsEnabled) { warning(/*#ref*/loc, "old style hex literal type suffix (U/L)."); } } void warningShadowsField(ref in Location newDecl, ref in Location oldDecl, string name, bool warningsEnabled) { if (warningsEnabled) { warning(/*#ref*/newDecl, format("declaration '%s' shadows field at %s.", name, oldDecl.toString())); } } void warningEmitBitcode() { writefln("--emit-bitcode is deprecated use --emit-llvm and -c flags instead"); } /* * * Driver errors. * */ CompilerException makeEmitLLVMNoLink(string file = __FILE__, const int line = __LINE__) { return new CompilerError("must specify -c when using --emit-llvm", file, line); } /* * * Specific Errors * */ CompilerException makeFunctionNamedInit(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return makeError(/*#ref*/loc, "functions may not be named 'init', to avoid confusion with the built-in type field of the same name.", file, line); } CompilerException makeAggregateStaticVariableNamedInit(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return makeError(/*#ref*/loc, "static field 'init' collides with built-in field of the same name.", file, line); } CompilerException makeExpressionForNew(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { auto msg = `got an expression where we expected a type for a 'new'.`; msg ~= loc.locationGuide(); if (name != "") { msg ~= format("If '%s' is an array you want to copy,\nuse 'new %s[..]' to duplicate it.", name, name); } return makeError(/*#ref*/loc, msg, file, line); } CompilerException makeMisplacedContinue(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "continue statement outside of loop.", file, line); } CompilerException makeOverloadedFunctionsAccessMismatch(ir.Access importAccess, ir.Alias a, ir.Function b, string file = __FILE__, const int line = __LINE__) { auto msg = format("alias '%s' access level ('%s') does not match '%s' ('%s') @ %s.", a.name, ir.accessToString(importAccess), b.name, ir.accessToString(b.access), b.loc.toString()); return new CompilerError(a.loc, msg, file, line); } CompilerException makeOverloadedFunctionsAccessMismatch(ir.Function a, ir.Function b) { auto loc = b.loc; return new CompilerError(loc, format("function '%s' access level ('%s') differs from overloaded function @ %s's access ('%s').", a.name, ir.accessToString(b.access), a.loc.toString(), ir.accessToString(a.access))); } CompilerException makeOverriddenFunctionsAccessMismatch(ir.Function a, ir.Function b) { auto loc = b.loc; return new CompilerError(loc, format("function '%s' access level ('%s') differs from overridden function @ %s's access level ('%s').", a.name, ir.accessToString(b.access), a.loc.toString(), ir.accessToString(a.access))); } CompilerException makeBadAccess(ref in Location loc, string name, ir.Access access, string file = __FILE__, const int line = __LINE__) { string accessName; switch (access) { case ir.Access.Private: accessName = "private"; break; case ir.Access.Protected: accessName = "protected"; break; default: assert(false); } return new CompilerError(loc, format("tried to access %s symbol '%s'.", accessName, name)); } CompilerException makeBadComposableType(ref in Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__) { auto msg = format("cannot use type %s as a composable string component.", type.typeString()); return new CompilerError(loc, msg, file, line); } CompilerException makeNonConstantCompileTimeComposable(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "non constant expression in compile time composable string (precede with 'new' to make a runtime composable string).", file, line); } CompilerException makeArgumentCountMismatch(ref in Location loc, ir.Function func, string file = __FILE__, const int line = __LINE__) { auto n = func.params.length; return makeExpected(/*#ref*/loc, format("%s argument%s to function '%s'", n, n == 1 ? "" : "s", func.name)); } CompilerException makeAssigningVoid(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "tried to assign a void value.", file, line); } CompilerException makeStructValueCall(ref in Location loc, string aggName, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("expected aggregate type '%s' directly, not an instance.", aggName), file, line); } CompilerException makeStructDefaultCtor(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "structs or unions may not define default constructors.", file, line); } CompilerException makeStructDestructor(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "structs or unions may not define a destructor.", file, line); } CompilerException makeExpectedOneArgument(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "expected only one argument.", file, line); } CompilerException makeClassAsAAKey(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "classes cannot be associative array key types.", file, line); } CompilerException makeMutableStructAAKey(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "structs with mutable indirection cannot be associative array key types.", file, line); } CompilerException makeExpectedCall(ir.RunExp runexp, string file = __FILE__, const int line = __LINE__) { return new CompilerError(runexp.loc, "expression following #run must be a function call.", file, line); } CompilerException makeNonNestedAccess(ref in Location loc, ir.Variable var, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("cannot access variable '%s' from non-nested function.", var.name), file, line); } CompilerException makeRedefines(ref in Location loc, ref in Location loc2, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("redefines symbol '%s', defined @ %s", name, loc2.toString())); } CompilerException makeMultipleMatches(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("multiple imports contain a symbol '%s'.", name), file, line); } CompilerException makeNoStringImportPaths(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "no string import file paths defined (use -J).", file, line); } CompilerException makeImportFileOpenFailure(ref in Location loc, string filename, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("couldn't open '%s' for reading.", filename), file, line); } CompilerException makeStringImportWrongConstant(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "expected non empty string literal as argument to string import.", file, line); } CompilerException makeNoSuperCall(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "expected explicit super call.", file, line); } CompilerException makeInvalidIndexValue(ir.Node n, ir.Type type, string file = __FILE__, const int line = __LINE__) { auto str = format("can not index %s.", typeString(type)); return new CompilerError(n.loc, str, file, line); } CompilerException makeUnknownArch(string a, string file = __FILE__, const int line = __LINE__) { auto str = format("unknown arch \"%s\"", a); return new CompilerError(str, file, line); } CompilerException makeUnknownPlatform(string p, string file = __FILE__, const int line = __LINE__) { auto str = format("unknown platform \"%s\"", p); return new CompilerError(str, file, line); } CompilerException makeExpectedTypeMatch(ref in Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("expected type %s for slice operation.", typeString(type)), file, line); } CompilerException makeIndexVarTooSmall(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("index variable '%s' is too small to hold a size_t.", name), file, line); } CompilerException makeNestedNested(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "nested functions may not have nested functions.", file, line); } CompilerException makeNonConstantStructLiteral(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "non-constant expression in global struct literal.", file, line); } CompilerException makeWrongNumberOfArgumentsToStructLiteral(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "wrong number of arguments to struct literal.", file, line); } CompilerException makeCannotDeduceStructLiteralType(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "cannot deduce struct literal's type.", file, line); } CompilerException makeArrayNonArrayNotCat(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "binary operations involving array and non array must be use concatenation (~).", file, line); } CompilerException makeCannotPickStaticFunction(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("cannot select static function '%s'.", name), file, line); } CompilerException makeCannotPickStaticFunctionVia(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("cannot select static function '%s' through instance.", name), file, line); } CompilerException makeCannotPickMemberFunction(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("cannot select member function '%s'.", name), file, line); } CompilerException makeStaticViaInstance(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("looking up '%s' static function via instance.", name), file, line); } CompilerException makeMixingStaticMember(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "mixing static and member functions.", file, line); } CompilerException makeNoZeroProperties(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "no zero argument properties found.", file, line); } CompilerException makeMultipleZeroProperties(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "multiple zero argument properties found.", file, line); } CompilerException makeUFCSAsProperty(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "an @property function may not be used for UFCS.", file, line); } CompilerException makeUFCSAndProperty(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("functions for lookup '%s' match UFCS *and* @property functions.", name), file, line); } CompilerException makeCallingUncallable(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "calling uncallable expression.", file, line); } CompilerException makeForeachIndexRef(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "may not mark a foreach index as ref.", file, line); } CompilerException makeDoNotSpecifyForeachType(ref in Location loc, string varname, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("foreach variables like '%s' may not have explicit type declarations.", varname), file, line); } CompilerException makeNoFieldOrPropOrUFCS(ir.Postfix postfix, string file = __FILE__, const int line=__LINE__) { assert(postfix.identifier !is null); return new CompilerError(postfix.loc, format("postfix lookups like '%s' must be field, property, or UFCS function.", postfix.identifier.value), file, line); } CompilerException makeAccessThroughWrongType(ref in Location loc, string field, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("accessing field '%s' through incorrect type.", field), file, line); } CompilerException makeVoidReturnMarkedProperty(ref in Location loc, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("@property functions with no arguments like '%s' cannot have a void return type.", name), file, line); } CompilerException makeNoFieldOrPropertyOrIsUFCSWithoutCall(ref in Location loc, string value, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("postfix lookups like '%s' that are not fields, properties, or UFCS functions must be a call.", value), file, line); } CompilerException makeNoFieldOrPropertyOrUFCS(ref in Location loc, string value, ir.Type t, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("'%s' is neither field, nor property, nor a UFCS function of %s.", value, typeString(t)), file, line); } CompilerException makeUsedBindFromPrivateImport(ref in Location loc, string bind, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("may not bind from private import, as '%s' does.", bind), file, line); } CompilerException makeOverriddenNeedsProperty(ir.Function f, string file = __FILE__, const int line = __LINE__) { return new CompilerError(f.loc, format("functions like '%s' that override @property functions must be marked @property themselves.", f.name), file, line); } CompilerException makeOverridingFinal(ir.Function f, string file = __FILE__, const int line = __LINE__) { return new CompilerError(f.loc, format("function '%s' overrides function marked as final.", f.name), file, line); } CompilerException makeBadBuiltin(ref in Location loc, ir.Type t, string field, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("type '%s' doesn't have built-in field '%s'.", typeString(t), field), file, line); } CompilerException makeBadMerge(ir.Alias a, ir.Store s, string file = __FILE__, const int line = __LINE__) { return new CompilerError(a.loc, "cannot merge alias as it is not a function.", file, line); } CompilerException makeScopeOutsideFunction(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "scopes must be inside a function.", file, line); } CompilerException makeCannotDup(ref in Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("cannot duplicate type '%s'.", type.typeString()), file, line); } CompilerException makeCannotSlice(ref in Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("cannot slice type '%s'.", type.typeString()), file, line); } CompilerException makeCallClass(ref in Location loc, ir.Class _class, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("attempted to call class '%s'. Did you forget a new?", _class.name), file, line); } CompilerException makeMixedSignedness(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "expressions cannot mix signed and unsigned values.", file, line); } CompilerException makeStaticArrayLengthMismatch(ref in Location loc, size_t expectedLength, size_t gotLength, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("expected static array literal of length %s, got a length of %s.", expectedLength, gotLength), file, line); } CompilerException makeDoesNotImplement(ref in Location loc, ir.Class _class, ir._Interface iface, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("'%s' does not implement the '%s' method of interface '%s'.", _class.name, func.name, iface.name), file, line); } CompilerException makeCaseFallsThrough(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "non-empty switch cases may not fall through.", file, line); } CompilerException makeNoNextCase(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "case falls through, but there are no subsequent cases.", file, line); } CompilerException makeGotoOutsideOfSwitch(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "goto must be inside a switch statement.", file, line); } CompilerException makeStrayDocComment(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "documentation comment has nothing to document.", file, line); } CompilerException makeCallingWithoutInstance(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto wi = new CompilerError(loc, "instanced functions must be called with an instance.", file, line); return wi; } CompilerException makeForceLabel(ref in Location loc, ir.Function fun, string file = __FILE__, const int line = __LINE__) { auto fl = new CompilerError(loc, format("calls to @label functions like '%s' must label their arguments.", fun.name), file, line); return fl; } CompilerException makeNoEscapeScope(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto es = new CompilerError(loc, "types marked scope may not remove their scope through assignment.", file, line); return es; } CompilerException makeNoReturnScope(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto nrs = new CompilerError(loc, "types marked scope may not be returned.", file, line); return nrs; } CompilerException makeReturnValueExpected(ref in Location loc, ir.Type type, string file = __FILE__, const int line = __LINE__) { string emsg = format("return value of type '%s' expected.", type.typeString()); return new CompilerError(loc, emsg, file, line); } CompilerException makeNoLoadBitcodeFile(string filename, string msg, string file = __FILE__, const int line = __LINE__) { string err; if (msg !is null) { err = format("failed to read bitcode file '%s'.\n%s", filename, msg); } else { err = format("failed to read bitcode file '%s'.", filename); } return new CompilerError(err, file, line); } CompilerException makeNoWriteBitcodeFile(string filename, string msg, string file = __FILE__, const int line = __LINE__) { string err; if (msg !is null) { err = format("failed to write object bitcode '%s'.\n%s", filename, msg); } else { err = format("failed to write object bitcode '%s'.", filename); } return new CompilerError(err, file, line); } CompilerException makeNoWriteObjectFile(string filename, string msg, string file = __FILE__, const int line = __LINE__) { string err; if (msg !is null) { err = format("failed to write object file '%s'.\n%s", filename, msg); } else { err = format("failed to write object file '%s'.", filename); } return new CompilerError(err, file, line); } CompilerException makeNoLinkModule(string filename, string msg, string file = __FILE__, const int line = __LINE__) { string err; if (msg !is null) { err = format("failed to link in module '%s'.\n%s", filename, msg); } else { err = format("failed to link in module '%s'.", filename); } return new CompilerError(err, file, line); } CompilerException makeDuplicateLabel(ref in Location loc, string label, string file = __FILE__, const int line = __LINE__) { auto emsg = format("label '%s' specified multiple times.", label); return new CompilerError(loc, emsg, file, line); } CompilerException makeUnmatchedLabel(ref in Location loc, string label, string file = __FILE__, const int line = __LINE__) { auto emsg = format("no parameter matches argument label '%s'.", label); auto unl = new CompilerError(loc, emsg, file, line); return unl; } CompilerException makeDollarOutsideOfIndex(ir.Constant constant, string file = __FILE__, const int line = __LINE__) { auto doi = new CompilerError(constant.loc, "'$' may only appear in an index expression.", file, line); return doi; } CompilerException makeBreakOutOfLoop(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(loc, "break may only appear in a loop or switch.", file, line); return e; } CompilerException makeAggregateDoesNotDefineOverload(ref in Location loc, ir.Aggregate agg, string func, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(loc, format("type '%s' does not define operator function '%s'.", agg.name, func), file, line); return e; } CompilerException makeBadWithType(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(loc, "with statement cannot use given expression.", file, line); return e; } CompilerException makeForeachReverseOverAA(ir.ForeachStatement fes, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(fes.loc, "foreach_reverse cannot be used with an associative array.", file, line); return e; } CompilerException makeAnonymousAggregateRedefines(ir.Aggregate agg, string name, string file = __FILE__, const int line = __LINE__) { auto msg = format("anonymous aggregate redefines '%s'.", name); auto e = new CompilerError(agg.loc, msg, file, line); return e; } CompilerException makeAnonymousAggregateAtTopLevel(ir.Aggregate agg, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(agg.loc, "anonymous struct or union not inside aggregate.", file, line); return e; } CompilerException makeInvalidMainSignature(ir.Function func, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(func.loc, "invalid main signature.", file, line); return e; } CompilerException makeNoValidFunction(ref in Location loc, string fname, ir.Type[] args, string file = __FILE__, const int line = __LINE__) { auto msg = format("no function named '%s' matches arguments %s.", fname, typesString(args)); auto e = new CompilerError(loc, msg, file, line); return e; } CompilerException makeCVaArgsOnlyOperateOnSimpleTypes(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(loc, "C varargs only support retrieving simple types, due to an LLVM limitation.", file, line); return e; } CompilerException makeVaFooMustBeLValue(ref in Location loc, string foo, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(loc, format("argument to %s is not an lvalue.", foo), file, line); return e; } CompilerException makeNonLastVariadic(ir.Variable var, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(var.loc, "variadic parameter must be last.", file, line); return e; } CompilerException makeStaticAssert(ir.AssertStatement as, string msg, string file = __FILE__, const int line = __LINE__) { string emsg = format("static assert: %s", msg); auto e = new CompilerError(as.loc, emsg, file, line); return e; } CompilerException makeConstField(ir.Variable v, string file = __FILE__, const int line = __LINE__) { string emsg = format("const or immutable non local/global field '%s' is forbidden.", v.name); auto e = new CompilerError(v.loc, emsg, file, line); return e; } CompilerException makeAssignToNonStaticField(ir.Variable v, string file = __FILE__, const int line = __LINE__) { string emsg = format("attempted to assign to non local/global field %s.", v.name); auto e = new CompilerError(v.loc, emsg, file, line); return e; } CompilerException makeSwitchBadType(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__) { string emsg = format("bad switch type '%s'.", type.typeString()); auto e = new CompilerError(node.loc, emsg, file, line); return e; } CompilerException makeSwitchDuplicateCase(ir.Node node, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(node.loc, "duplicate case in switch statement.", file, line); return e; } CompilerException makeFinalSwitchBadCoverage(ir.Node node, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(node.loc, "final switch statement must cover all enum members.", file, line); return e; } CompilerException makeArchNotSupported(string file = __FILE__, const int line = __LINE__) { return new CompilerError("architecture not supported on current platform.", file, line); } CompilerException makeSpuriousTag(ir.Exp exp, bool taggedRef, string file = __FILE__, const int line = __LINE__) { auto msg = format("parameter is neither ref nor out, but is tagged with %s.", taggedRef ? "ref" : "out"); msg ~= exp.loc.locationGuide(); auto chunk = exp.loc.errorChunk(); return new CompilerError(exp.loc, msg, file, line); } CompilerException makeWrongTag(ir.Exp exp, bool taggedRef, string file = __FILE__, const int line = __LINE__) { auto msg = format("argument to %s parameter is tagged, but with the wrong tag.", taggedRef ? "out" : "ref"); msg ~= exp.loc.locationGuide(); auto chunk = exp.loc.errorChunk(); msg ~= format("(That means use '%s %s' instead of '%s %s'.)", taggedRef ? "out" : "ref", chunk, taggedRef ? "ref" : "out", chunk); return new CompilerError(exp.loc, msg, file, line); } CompilerException makeNotTaggedOut(ir.Exp exp, string file = __FILE__, const int line = __LINE__) { auto msg = "mark arguments to out parameters with 'out'."; msg ~= exp.loc.locationGuide(); auto chunk = exp.loc.errorChunk(); msg ~= format("(That means use 'out %s' instead of just '%s'.)", chunk, chunk); return new CompilerError(exp.loc, msg, file, line); } CompilerException makeNotTaggedRef(ir.Exp exp, string file = __FILE__, const int line = __LINE__) { auto msg = "mark arguments to ref parameters with 'ref'."; msg ~= exp.loc.locationGuide(); auto chunk = exp.loc.errorChunk(); msg ~= format("(That means use 'ref %s' instead of just '%s'.)", chunk, chunk); return new CompilerError(exp.loc, msg, file, line); } CompilerException makeFunctionNameOutsideOfFunction(ir.TokenExp fexp, string file = __FILE__, const int line = __LINE__) { return new CompilerError(fexp.loc, format("%s occurring outside of function.", fexp.type == ir.TokenExp.Type.PrettyFunction ? "__PRETTY_FUNCTION__" : "__FUNCTION__"), file, line); } CompilerException makeMultipleValidModules(ir.Node node, string[] paths, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("multiple modules are valid: %s.", paths), file, line); } CompilerException makeAlreadyLoaded(ir.Module m, string filename, string file = __FILE__, const int line = __LINE__) { return new CompilerError(m.loc, format("module %s already loaded '%s'.", m.name.toString(), filename), file, line); } CompilerException makeCannotOverloadNested(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("cannot overload nested function '%s'.", func.name), file, line); } CompilerException makeUsedBeforeDeclared(ir.Node node, ir.Variable var, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("variable '%s' used before declaration.", var.name), file, line); } CompilerException makeStructConstructorsUnsupported(ir.Node node, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "struct constructors are currently unsupported.", file, line); } CompilerException makeCallingStaticThroughInstance(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("calling local or global function '%s' through instance variable.", func.name), file, line); } CompilerException makeMarkedOverrideDoesNotOverride(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("function '%s' is marked override, but no matching function to override could be found.", func.name), file, line); } CompilerException makeAbstractHasToBeMember(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("abstract functions like '%s' must be a member of an abstract class.", func.name), file, line); } CompilerException makeAbstractBodyNotEmpty(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("abstract functions like '%s' may not have an implementation.", func.name), file, line); } CompilerException makeNewAbstract(ir.Node node, ir.Class _class, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("abstract classes like '%s' may not be instantiated.", _class.name), file, line); } CompilerException makeBadAbstract(ir.Node node, ir.Attribute attr, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "only classes and functions may be marked as abstract.", file, line); } CompilerException makeBadFinal(ir.Node node, ir.Attribute attr, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "only classes, functions, and switch statmenets may be marked as final.", file, line); } CompilerException makeSubclassFinal(ir.Class child, ir.Class parent, string file = __FILE__, const int line = __LINE__) { return new CompilerError(child.loc, format("class '%s' attempts to subclass final class '%s'.", child.name, parent.name), file, line); } CompilerException makeCannotImport(ir.Node node, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("can't find module '%s'.", name), file, line); } CompilerException makeCannotImportAnonymous(ir.Node node, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("can't import anonymous module '%s'.", name), file, line); } CompilerException makeNotAvailableInCTFE(ir.Node node, string s, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("currently unevaluatable at compile time: '%s'.", s), file, line); } CompilerException makeNotAvailableInCTFE(ir.Node node, ir.Node feature, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("%s is currently unevaluatable at compile time.", ir.nodeToString(feature)), file, line); } CompilerException makeShadowsDeclaration(ir.Node a, ir.Node b, string file = __FILE__, const int line = __LINE__) { return new CompilerError(a.loc, format("shadows declaration at %s.", b.loc.toString()), file, line); } CompilerException makeMultipleDefaults(in ref Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "switches may not have multiple default cases.", file, line); } CompilerException makeFinalSwitchWithDefault(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "final switches may not define a default case.", file, line); } CompilerException makeNoDefaultCase(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "switches must have a default case.", file, line); } CompilerException makeTryWithoutCatch(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "try statement must have a catch block and/or a finally block.", file, line); } CompilerException makeMultipleOutBlocks(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "a function may only have one in block defined.", file, line); } CompilerException makeNeedOverride(ir.Function overrider, ir.Function overridee, string file = __FILE__, const int line = __LINE__) { string emsg = format("function '%s' overrides function at %s but is not marked with 'override'.", overrider.name, overridee.loc.toString()); return new CompilerError(overrider.loc, emsg, file, line); } CompilerException makeThrowOnlyThrowable(ir.Exp exp, ir.Type type, string file = __FILE__, const int line = __LINE__) { string emsg = format("only types that inherit from object.Throwable may be thrown, not '%s'.", type.typeString()); return new CompilerError(exp.loc, emsg, file, line); } CompilerException makeThrowNoInherits(ir.Exp exp, ir.Class clazz, string file = __FILE__, const int line = __LINE__) { string emsg = format("only types that inherit from object.Throwable may be thrown, not class '%s'.", clazz.typeString()); return new CompilerError(exp.loc, emsg, file, line); } CompilerException makeInvalidAAKey(ir.AAType aa, string file = __FILE__, const int line = __LINE__) { return new CompilerError(aa.loc, format("%s is an invalid AA key. AA keys must not be mutably indirect.", aa.key.typeString()), file, line); } CompilerException makeBadAAAssign(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "may not assign associate arrays to prevent semantic inconsistencies.", file, line); } CompilerException makeBadAANullAssign(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "cannot set AA to null, use [] instead.", file, line); } /* * * General Util * */ CompilerException makeError(ir.Node n, string s, string file = __FILE__, const int line = __LINE__) { return new CompilerError(n.loc, s, file, line); } CompilerException makeError(ref in Location loc, string s, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, s, file, line); } CompilerException makeUnsupported(ref in Location loc, string feature, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("unsupported feature '%s'.", feature), file, line); } CompilerException makeExpected(ir.Node node, string s, string file = __FILE__, const int line = __LINE__) { return makeExpected(/*#ref*/node.loc, s, false, file, line); } CompilerException makeExpected(ref in Location loc, string s, bool b = false, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("expected %s.", s), b, file, line); } CompilerException makeExpected(ref in Location loc, string expected, string got, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("expected '%s', got '%s'.", expected, got), file, line); } CompilerException makeUnexpected(ref in Location loc, string s, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("unexpected %s.", s), file, line); } CompilerException makeBadOperation(ir.Node node, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "bad operation.", file, line); } CompilerException makeExpectedContext(ir.Node node, ir.Node node2, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "expected context pointer.", file, line); } CompilerException makeNotReached(ir.Node node, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "statement not reached.", file, line); } /* * * Type Conversions * */ CompilerException makeBadAggregateToPrimitive(ir.Node node, ir.Type from, ir.Type to, string file = __FILE__, const int line = __LINE__) { string emsg = format("cannot cast aggregate %s to %s.", typeString(from), typeString(to)); return new CompilerError(node.loc, emsg, file, line); } CompilerException makeBadImplicitCast(ir.Node node, ir.Type from, ir.Type to, string file = __FILE__, const int line = __LINE__) { string emsg = format("cannot implicitly convert %s to %s.", typeString(from), typeString(to)); return new CompilerError(node.loc, emsg, file, line); } CompilerException makeCannotModify(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("cannot modify '%s'.", type.typeString()), file, line); } CompilerException makeNotLValueButRefOut(ir.Node node, bool isRef, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("expected lvalue to %s parameter.", isRef ? "ref" : "out"), file, line); } CompilerException makeTypeIsNot(ir.Node node, ir.Type from, ir.Type to, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("type '%s' is not '%s' as expected.", from.typeString(), to.typeString()), file, line); } CompilerException makeInvalidType(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("bad type '%s'.", type.typeString()), file, line); } CompilerException makeInvalidUseOfStore(ir.Node node, ir.Store store, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("invalid use of store '%s'.", store.name), file, line); } /* * * Lookups * */ CompilerException makeWithCreatesAmbiguity(ref in Location loc, string file = __FILE__, const int line = __LINE__) { auto e = new CompilerError(loc, "ambiguous lookup due to with block(s).", file, line); return e; } CompilerException makeInvalidThis(ir.Node node, ir.Type was, ir.Type expected, string member, string file = __FILE__, const int line = __LINE__) { string emsg = format("'this' is of type '%s' expected '%s' to access member '%s'.", was.typeString(), expected.typeString(), member); return new CompilerError(node.loc, emsg, file, line); } CompilerException makeNotMember(ir.Node node, ir.Type aggregate, string member, string file = __FILE__, const int line = __LINE__) { auto pfix = cast(ir.Postfix) node; string emsg = format("'%s' has no member '%s'.", aggregate.typeString(), member); if (pfix !is null && pfix.child.nodeType == ir.NodeType.ExpReference) { auto eref = cast(ir.ExpReference) pfix.child; auto var = cast(ir.Variable)eref.decl; StringSink name; foreach (i, id; eref.idents) { name.sink(id); if (i < eref.idents.length - 1) { name.sink("."); } } emsg = format("instance '%s' (of type '%s') has no member '%s'.", name.toString(), aggregate.typeString(), member); } return new CompilerError(node.loc, emsg, file, line); } CompilerException makeNotMember(ref in Location loc, string aggregate, string member, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("'%s' has no member '%s'.", aggregate, member), file, line); } CompilerException makeFailedLookup(ir.Node node, string lookup, string file = __FILE__, const int line = __LINE__) { return makeFailedLookup(/*#ref*/node.loc, lookup, file, line); } CompilerException makeFailedEnumLookup(ref in Location loc, string enumName, string name, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("enum '%s' does not define '%s'.", enumName, name), file, line); } CompilerException makeFailedLookup(ref in Location loc, string lookup, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("unidentified identifier '%s'.", lookup), file, line); } CompilerException makeNonTopLevelImport(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "imports must occur in the top scope.", file, line); } /* * * Functions * */ CompilerException makeWrongNumberOfArguments(ir.Node node, ir.Function func, size_t got, size_t expected, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("wrong number of arguments to function '%s'; got %s, expected %s.", func.name, got, expected), file, line); } CompilerException makeBadCall(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("cannot call %s.", type.typeString()), file, line); } CompilerException makeBadPropertyCall(ir.Node node, ir.Type type, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, format("cannot call %s (a type returned from a property function).", type.typeString()), file, line); } CompilerException makeBadBinOp(ir.BinOp binop, ir.Type ltype, ir.Type rtype, string file = __FILE__, const int line = __LINE__) { auto msg = format("invalid '%s' expression using %s and %s.", binopToString(binop.op), ltype.typeString(), rtype.typeString()); return new CompilerError(binop.loc, msg, file, line); } CompilerException makeCannotDisambiguate(ir.Node node, ir.Function[] functions, ir.Type[] args, string file = __FILE__, const int line = __LINE__) { return makeCannotDisambiguate(/*#ref*/node.loc, functions, args, file, line); } CompilerException makeCannotDisambiguate(ref in Location loc, ir.Function[] functions, ir.Type[] args, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, format("no '%s' function (of %s possible) matches arguments '%s'.", functions[0].name, functions.length, typesString(args)), file, line); } CompilerException makeCannotInfer(ref in Location loc, string file = __FILE__, const int line = __LINE__) { return new CompilerError(loc, "not enough information to infer type.", true, file, line); } CompilerException makeCannotLoadDynamic(ir.Node node, ir.Function func, string file = __FILE__, const int line = __LINE__) { return new CompilerError(node.loc, "@loadDynamic function cannot have body.", file, line); } CompilerException makeMultipleFunctionsMatch(ref in Location loc, ir.Function[] functions, string file = __FILE__, const int line = __LINE__) { string err = format("%s overloaded functions match call. Matching locations:\n", functions.length); foreach (i, func; functions) { err ~= format("\t%s%s", func.loc.toString(), i == functions.length - 1 ? "" : "\n"); } return new CompilerError(loc, err, file, line); } /* * * Panics * */ CompilerException panicOhGod(ir.Node node, string file = __FILE__, const int line = __LINE__) { return panic(/*#ref*/node.loc, "oh god.", file, line); } CompilerException panic(ir.Node node, string msg, string file = __FILE__, const int line = __LINE__) { return panic(/*#ref*/node.loc, msg, file, line); } CompilerException panic(ref in Location loc, string msg, string file = __FILE__, const int line = __LINE__) { return new CompilerPanic(/*#ref*/loc, msg, file, line); } CompilerException panic(string msg, string file = __FILE__, const int line = __LINE__) { return new CompilerPanic(msg, file, line); } CompilerException panicRuntimeObjectNotFound(string name, string file = __FILE__, const int line = __LINE__) { return panic(format("can't find runtime object '%s'.", name), file, line); } CompilerException panicUnhandled(ir.Node node, string unhandled, string file = __FILE__, const int line = __LINE__) { return panicUnhandled(/*#ref*/node.loc, unhandled, file, line); } CompilerException panicUnhandled(ref in Location loc, string unhandled, string file = __FILE__, const int line = __LINE__) { return new CompilerPanic(/*#ref*/loc, format("unhandled case '%s'.", unhandled), file, line); } CompilerException panicNotMember(ir.Node node, string aggregate, string field, string file = __FILE__, const int line = __LINE__) { auto str = format("no field name '%s' in aggregate '%s' '%s'.", field, aggregate, ir.nodeToString(node)); return new CompilerPanic(/*#ref*/node.loc, str, file, line); } CompilerException panicExpected(ref in Location loc, string msg, string file = __FILE__, const int line = __LINE__) { return new CompilerPanic(/*#ref*/loc, format("expected %s.", msg), file, line); } void panicAssert(ir.Node node, bool condition, string file = __FILE__, const int line = __LINE__) { if (!condition) { throw panic(/*#ref*/node.loc, "assertion failure.", file, line); } } void panicAssert(ref in Location loc, bool condition, string file = __FILE__, const int line = __LINE__) { if (!condition) { throw panic(/*#ref*/loc, "assertion failure.", file, line); } } private: string typeString(ir.Type t) { string full, glossed; full = t.printType(); glossed = t.printType(true); if (full == glossed) { return format("'%s'", full); } else { return format("'%s' (aka '%s')", glossed, full); } } string typesString(ir.Type[] types) { StringSink buf; buf.sink("("); foreach (i, type; types) { buf.sink(type.printType(true)); if (i < types.length - 1) { buf.sink(", "); } } buf.sink(")"); return buf.toString(); }
D
module UnrealScript.TribesGame.TrEmitterSpawnable; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.Engine.EmitterSpawnable; extern(C++) interface TrEmitterSpawnable : EmitterSpawnable { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrEmitterSpawnable")); } private static __gshared TrEmitterSpawnable mDefaultProperties; @property final static TrEmitterSpawnable DefaultProperties() { mixin(MGDPC("TrEmitterSpawnable", "TrEmitterSpawnable TribesGame.Default__TrEmitterSpawnable")); } }
D
; Copyright (C) 2008 The Android Open Source Project ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; http://www.apache.org/licenses/LICENSE-2.0 ; ; Unless required by applicable law or agreed to in writing, software ; distributed under the License is distributed on an "AS IS" BASIS, ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ; See the License for the specific language governing permissions and ; limitations under the License. .source TTestInterface.java .interface public dot.junit.opcodes.invoke_direct_range.d.TTestInterface .method public abstract test()V .end method ; ===================================== .source TTestInterfaceImpl.java .class public dot.junit.opcodes.invoke_direct_range.d.TTestInterfaceImpl .super java/lang/Object .implements dot.junit.opcodes.invoke_direct_range.d.TTestInterface .method public <init>()V .limit regs 2 invoke-direct {v1}, java/lang/Object/<init>()V return-void .end method .method public test()V return-void .end method ; ===================================== .source T_invoke_direct_range_26.java .class public dot.junit.opcodes.invoke_direct_range.d.T_invoke_direct_range_26 .super dot/junit/opcodes/invoke_direct_range/d/TTestInterfaceImpl .method public <init>()V .limit regs 2 invoke-direct {v1}, dot/junit/opcodes/invoke_direct_range/d/TTestInterfaceImpl/<init>()V return-void .end method .method public run()V .limit regs 8 invoke-direct/range {v7}, dot/junit/opcodes/invoke_direct_range/d/TTestInterface/test()V return-void .end method
D
/** Color-correction post-effect. This is a widget intended to correct colors before display, at the Raw level. Copyright: Guillaume Piolat 2018. License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) */ module dplug.pbrwidgets.colorcorrection; import gfm.math.matrix; import dplug.core.math; import dplug.gui.element; /// FlatBackgroundGUI provides a background that is loaded from a PNG or JPEG /// image. The string for backgroundPath should be in "stringImportPaths" /// specified in dub.json class UIColorCorrection : UIElement { public: nothrow: @nogc: this(UIContext context) { super(context, flagRaw); _tableArea.reallocBuffer(256 * 3, 32); _redTransferTable = _tableArea.ptr; _greenTransferTable = _tableArea.ptr + 256; _blueTransferTable = _tableArea.ptr + 512; // Set identity tables foreach(i; 0..256) { _redTransferTable[i] = cast(ubyte)i; _greenTransferTable[i] = cast(ubyte)i; _blueTransferTable[i] = cast(ubyte)i; } } ~this() { _tableArea.reallocBuffer(0, 32); } /// Calling this setup color correction table, with the well /// known lift-gamma-gain formula. void setLiftGammaGainContrast(float lift = 0.0f, float gamma = 1.0f, float gain = 1.0f, float contrast = 0.0f) { setLiftGammaGainContrastRGB(lift, gamma, gain, contrast, lift, gamma, gain, contrast, lift, gamma, gain, contrast); } /// Calling this setup color correction table, with the well /// known lift-gamma-gain formula, per channel. void setLiftGammaGainRGB(float rLift = 0.0f, float rGamma = 1.0f, float rGain = 1.0f, float gLift = 0.0f, float gGamma = 1.0f, float gGain = 1.0f, float bLift = 0.0f, float bGamma = 1.0f, float bGain = 1.0f) { setLiftGammaGainContrastRGB(rLift, rGamma, rGain, 0.0f, gLift, gGamma, gGain, 0.0f, bLift, bGamma, bGain, 0.0f); } /// Calling this setup color correction table, with the less /// known lift-gamma-gain formula + contrast addition, per channel. void setLiftGammaGainContrastRGB( float rLift = 0.0f, float rGamma = 1.0f, float rGain = 1.0f, float rContrast = 0.0f, float gLift = 0.0f, float gGamma = 1.0f, float gGain = 1.0f, float gContrast = 0.0f, float bLift = 0.0f, float bGamma = 1.0f, float bGain = 1.0f, float bContrast = 0.0f) { static float safePow(float a, float b) nothrow @nogc { if (a < 0) a = 0; if (a > 1) a = 1; return a ^^ b; } for (int b = 0; b < 256; ++b) { float inp = b / 255.0f; float outR = rGain*(inp + rLift*(1-inp)); float outG = gGain*(inp + gLift*(1-inp)); float outB = bGain*(inp + bLift*(1-inp)); outR = safePow(outR, 1.0f / rGamma ); outG = safePow(outG, 1.0f / gGamma ); outB = safePow(outB, 1.0f / bGamma ); if (outR < 0) outR = 0; if (outG < 0) outG = 0; if (outB < 0) outB = 0; if (outR > 1) outR = 1; if (outG > 1) outG = 1; if (outB > 1) outB = 1; outR = lerp!float(outR, smoothStep!float(0, 1, outR), rContrast); outG = lerp!float(outG, smoothStep!float(0, 1, outG), gContrast); outB = lerp!float(outB, smoothStep!float(0, 1, outB), bContrast); _redTransferTable[b] = cast(ubyte)(0.5f + outR * 255.0f); _greenTransferTable[b] = cast(ubyte)(0.5f + outG * 255.0f); _blueTransferTable[b] = cast(ubyte)(0.5f + outB * 255.0f); } setDirtyWhole(); } /// ditto void setLiftGammaGainContrastRGB(mat3x4f liftGammaGainContrast) { auto m = liftGammaGainContrast; setLiftGammaGainContrastRGB(m.c[0][0], m.c[0][1], m.c[0][2], m.c[0][3], m.c[1][0], m.c[1][1], m.c[1][2], m.c[1][3], m.c[2][0], m.c[2][1], m.c[2][2], m.c[2][3]); } override void onDrawRaw(ImageRef!RGBA rawMap, box2i[] dirtyRects) { foreach(dirtyRect; dirtyRects) { rawMap.cropImageRef(dirtyRect).applyColorCorrection(_redTransferTable); } } private: ubyte[] _tableArea = null; ubyte* _redTransferTable = null; ubyte* _greenTransferTable = null; ubyte* _blueTransferTable = null; } // Apply color correction and convert RGBA8 to BGRA8 void applyColorCorrection(ImageRef!RGBA image, const(ubyte*) rgbTable) pure nothrow @nogc { int w = image.w; int h = image.h; for (int j = 0; j < h; ++j) { ubyte* scan = cast(ubyte*)image.scanline(j).ptr; for (int i = 0; i < w; ++i) { ubyte r = scan[4*i]; ubyte g = scan[4*i+1]; ubyte b = scan[4*i+2]; scan[4*i] = rgbTable[r]; scan[4*i+1] = rgbTable[g+256]; scan[4*i+2] = rgbTable[b+512]; } } }
D
/Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Intermediates/InstaPics.build/Debug-iphonesimulator/InstaPics.build/Objects-normal/x86_64/PostVC.o : /Users/sol369/Desktop/InstaPics/InstaPics/FeedVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Post.swift /Users/sol369/Desktop/InstaPics/InstaPics/FeedCell.swift /Users/sol369/Desktop/InstaPics/InstaPics/SignupVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Helper.swift /Users/sol369/Desktop/InstaPics/InstaPics/LoginVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/PostVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/AppDelegate.swift /Users/sol369/Desktop/InstaPics/InstaPics/User.swift /Users/sol369/Desktop/InstaPics/InstaPics/ProfileVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Database.swift /Users/sol369/Desktop/InstaPics/InstaPics/Banner.swift /Users/sol369/Desktop/InstaPics/InstaPics/Auth.swift /Users/sol369/Desktop/InstaPics/InstaPics/Storage.swift /Users/sol369/Desktop/InstaPics/InstaPics/ProfileCell.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 /Users/sol369/Desktop/InstaPics/Pods/Firebase/Core/Sources/module.modulemap /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/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/Firebase/Core/Sources/Firebase.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Modules/SwiftLoader.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Headers/SwiftLoader-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Headers/SwiftLoader-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Modules/module.modulemap /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/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Modules/Sharaku.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Headers/Sharaku-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Headers/Sharaku-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Modules/IQKeyboardManagerSwift.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers/IQKeyboardManagerSwift-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers/IQKeyboardManagerSwift-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Intermediates/InstaPics.build/Debug-iphonesimulator/InstaPics.build/Objects-normal/x86_64/PostVC~partial.swiftmodule : /Users/sol369/Desktop/InstaPics/InstaPics/FeedVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Post.swift /Users/sol369/Desktop/InstaPics/InstaPics/FeedCell.swift /Users/sol369/Desktop/InstaPics/InstaPics/SignupVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Helper.swift /Users/sol369/Desktop/InstaPics/InstaPics/LoginVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/PostVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/AppDelegate.swift /Users/sol369/Desktop/InstaPics/InstaPics/User.swift /Users/sol369/Desktop/InstaPics/InstaPics/ProfileVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Database.swift /Users/sol369/Desktop/InstaPics/InstaPics/Banner.swift /Users/sol369/Desktop/InstaPics/InstaPics/Auth.swift /Users/sol369/Desktop/InstaPics/InstaPics/Storage.swift /Users/sol369/Desktop/InstaPics/InstaPics/ProfileCell.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 /Users/sol369/Desktop/InstaPics/Pods/Firebase/Core/Sources/module.modulemap /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/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/Firebase/Core/Sources/Firebase.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Modules/SwiftLoader.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Headers/SwiftLoader-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Headers/SwiftLoader-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Modules/module.modulemap /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/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Modules/Sharaku.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Headers/Sharaku-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Headers/Sharaku-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Modules/IQKeyboardManagerSwift.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers/IQKeyboardManagerSwift-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers/IQKeyboardManagerSwift-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Intermediates/InstaPics.build/Debug-iphonesimulator/InstaPics.build/Objects-normal/x86_64/PostVC~partial.swiftdoc : /Users/sol369/Desktop/InstaPics/InstaPics/FeedVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Post.swift /Users/sol369/Desktop/InstaPics/InstaPics/FeedCell.swift /Users/sol369/Desktop/InstaPics/InstaPics/SignupVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Helper.swift /Users/sol369/Desktop/InstaPics/InstaPics/LoginVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/PostVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/AppDelegate.swift /Users/sol369/Desktop/InstaPics/InstaPics/User.swift /Users/sol369/Desktop/InstaPics/InstaPics/ProfileVC.swift /Users/sol369/Desktop/InstaPics/InstaPics/Database.swift /Users/sol369/Desktop/InstaPics/InstaPics/Banner.swift /Users/sol369/Desktop/InstaPics/InstaPics/Auth.swift /Users/sol369/Desktop/InstaPics/InstaPics/Storage.swift /Users/sol369/Desktop/InstaPics/InstaPics/ProfileCell.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 /Users/sol369/Desktop/InstaPics/Pods/Firebase/Core/Sources/module.modulemap /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/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRUser.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRAuth.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseAuth/Frameworks/FirebaseAuth.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseDatabase/Frameworks/FirebaseDatabase.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FIRStorage.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/sol369/Desktop/InstaPics/Pods/FirebaseStorage/Frameworks/FirebaseStorage.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/Pods/Firebase/Core/Sources/Firebase.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Modules/SwiftLoader.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Headers/SwiftLoader-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Headers/SwiftLoader-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/SwiftLoader/SwiftLoader.framework/Modules/module.modulemap /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/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Modules/Sharaku.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Headers/Sharaku-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Headers/Sharaku-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/Sharaku/Sharaku.framework/Modules/module.modulemap /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Modules/IQKeyboardManagerSwift.swiftmodule/x86_64.swiftmodule /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers/IQKeyboardManagerSwift-Swift.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Headers/IQKeyboardManagerSwift-umbrella.h /Users/sol369/Desktop/InstaPics/DerivedData/InstaPics/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework/Modules/module.modulemap
D
/Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.build/CodableReflection/Decodable+Reflectable.swift.o : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NotFound.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.build/Decodable+Reflectable~partial.swiftmodule : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NotFound.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Core.build/Decodable+Reflectable~partial.swiftdoc : /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Base64URL.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NestedData.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Thread+Async.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Deprecated.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/NotFound.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecodable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/Decodable+Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Reflectable.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/LosslessDataConvertible.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/File.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/MediaType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/OptionalType.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Process+Execute.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/HeaderValue.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DirectoryConfig.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CaseInsensitiveString.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Future+Unwrap.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/FutureEncoder.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CoreError.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Utilities.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataCoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/CodableReflection/ReflectionDecoders.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/Data+Hex.swift /Users/work/Projects/Hello/.build/checkouts/core.git-9210800844849382486/Sources/Core/BasicKey.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/work/Projects/Hello/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/work/Projects/Hello/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/work/Projects/Hello/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
/** * D header file for POSIX's <strings.h>. * * Note: Do not mistake this module for <string.h> (singular), * available at `core.sys.posix.string`. * * See_Also: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/strings.h.html * Copyright: D Language Foundation, 2019 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Authors: Mathias 'Geod24' Lang * Standards: The Open Group Base Specifications Issue 7, 2018 edition * Source: $(DRUNTIMESRC core/sys/posix/_strings.d) */ module core.sys.posix.strings; version (Posix): extern(C): @system: nothrow: @nogc: /// public import core.sys.posix.locale : locale_t; /// Find first bit set in a word int ffs(int i) @safe pure; /// Compare two strings ignoring case int strcasecmp(scope const char* s1, scope const char* s2); /// Compare two strings ignoring case, with the specified locale int strcasecmp_l(scope const char* s1, scope const char* s2, scope locale_t locale); /// Compare two strings ignoring case, up to n characters int strncasecmp(scope const char* s1, scope const char* s2, size_t n); /// Compare two strings ignoring case, with the specified locale, up to n characters int strncasecmp_l(scope const char* s1, const char* s2, size_t n, locale_t locale);
D
direct or control perform as expected when applied handle and cause to function perform a movement in military or naval tactics in order to secure an advantage in attack or defense happen keep engaged perform surgery on
D
/* * baussini.d provides a thread-safe by choice inifile wrapper. * It supports template writing/reading for values. * Please view example.d for an example. */ module baussini; // Imports ... import std.conv : to; import std.string : format; import std.array : replace, split, join; import std.algorithm : canFind, startsWith, endsWith, stripLeft, stripRight; import std.traits : isIntegral, isFloatingPoint; import std.file; // Aliasing write, read and exists from std.file to avoid name conflicts. alias fwrite = std.file.write; alias fread = std.file.readText; alias fexists = std.file.exists; /** * An inifile exception. */ public class IniException : Throwable { /** * Creates a new instance of IniException. * Params: * msg = The message of the exception. */ this(string msg) { super(msg); } } /** * std.traits doesn't have isArithmetic. */ private deprecated("isArithmetic is deprecated. write/read supports all types std.conv.to supports.") enum bool isArithmetic(T) = isIntegral!T || isFloatingPoint!T; /** * An inifile section wrapper. */ class IniSection(bool sync) { private: /** * The parent inifile. */ IniFile!(sync) m_parent; /** * The section name. */ string m_name; /** * The section entries. */ string[string] m_entries; /** * Gets the file-writable string * Returns: A string compatible with an inifile. */ string getWritable() { string[] s = [format("[%s]", m_name)]; foreach (key, value; m_entries) { s ~= format("%s=%s", key, value); } return join(s, "\r\n"); } /** * Gets a string value. * Params: * key = The key to get. * defaultValue = (lazy) The default value. * Returns: The value of the key if found, defaultValue otherwise. */ string getValue(string key, lazy string defaultValue) { static if (sync) { synchronized { auto val = m_entries.get(key, defaultValue); return val; } } else { auto val = m_entries.get(key, defaultValue); return val; } } /** * Closes the section and clears all entries. */ void close() { m_entries = null; } public: /** * Creates a new instance of IniSection. * Params: * name = The name of the section. * parent = The parent inifile. */ this(string name, IniFile!(sync) parent) { m_name = name; m_parent = parent; } /** * Reads a value from the section. * Params: * key = The key to read. * defaultValue = (lazy) The default value. * Returns: The value if found, defaultValue otherwise. */ auto read(T)(string key, lazy string defaultValue) { static if (sync) { synchronized { auto val = getValue(key, defaultValue); return to!T(val); } } else { auto val = getValue(key, defaultValue); return to!T(val); } } /** * Reads a value from the section. * Params: * key = The key to read. * defaultValue = (lazy) The default value. * value = (out) The value if found, defaultValue otherwise. * Returns: The section. */ auto read(T)(string key, lazy string defaultValue, out T value) { static if (sync) { synchronized { auto val = getValue(key, defaultValue); value = to!T(val); return this; } } else { auto val = getValue(key, defaultValue); value = to!T(val); return this; } } /** * Reads a value from the section. * Params: * key = The key to read. * Throws: IniException if the key wasn't found or if the value is empty. * Returns: The value if found. */ auto read(T)(string key) { static if (sync) { synchronized { if(!hasKey(key)) throw new IniException(format("%s does not exist in the section.", key)); return to!T(getValue(key, "")); } } else { if(!hasKey(key)) throw new IniException(format("%s does not exist in the section.", key)); return to!T(getValue(key, "")); } } /** * Reads a value from the section. * Params: * key = The key to read. * value = The value if found. * Throws: IniException if the key wasn't found or if the value is empty. * Returns: The section. */ auto read(T)(string key, out T value) { static if (sync) { synchronized { if(!hasKey(key)) throw new IniException(format("%s does not exist in the section.", key)); value = to!T(getValue(key, "")); return this; } } else { if(!hasKey(key)) throw new IniException(format("%s does not exist in the section.", key)); value = to!T(getValue(key, "")); return this; } } /** * Writes an entry to the section. * Params: * key = The key of the entry. * value = The value of the entry. * Returns: The section. */ auto write(T)(string key, T value) { static if (sync) { synchronized { m_entries[key] = to!string(value); m_parent.m_changed = true; return this; } } else { m_entries[key] = to!string(value); m_parent.m_changed = true; return this; } } /** * Checks whether the section has a key or not. * Params: * key = The key to check for. * Returns: True if the key exists, false otherwise. */ bool hasKey(string key) { static if (sync) { synchronized { return (key in m_entries) !is null; } } else { return (key in m_entries) !is null; } } @property { /** * Gets the name of the section. */ string name() { static if (sync) { synchronized { return m_name; } } else { return m_name; } } /** * Gets the keys of the section. */ string[] keys() { static if (sync) { synchronized { return m_entries.keys; } } else { return m_entries.keys; } } /** * Gets the values of the section. */ string[] values() { static if (sync) { synchronized { return m_entries.values; } } else { return m_entries.values; } } /** * Gets the parental inifile. */ IniFile!(sync) parent() { static if (sync) { synchronized { return m_parent; } } else { return m_parent; } } } } /** * An inifile wrapper. */ class IniFile(bool sync) { private: /** * The sections of the inifile. */ IniSection!(sync)[string] m_sections; /** * The file name of the inifile. */ string m_fileName; /** * A boolean determining whether the inifile has got any changes. */ bool m_changed; /** * Parses the inifile from text. * Params: * text = The text to parse. */ void parseFromText(string text) { text = replace(text, "\r", ""); scope auto lines = split(text, "\n"); IniSection!(sync) currentSection; foreach (sline; lines) { auto line = stripLeft(sline, ' '); line = stripLeft(sline, '\t'); if (startsWith(line, ";")) continue; if (line && line.length) { if (startsWith(line, "[") && endsWith(line, "]")) { currentSection = new IniSection!(sync)(line[1 .. $-1], this); m_sections[currentSection.name] = currentSection; } else if (canFind(line, "=") && currentSection) { auto data = split(line, "="); if (data.length == 2) { auto key = stripRight(data[0], ' '); key = stripLeft(key, ' '); auto value = split(data[1], ";")[0]; value = stripRight(value, ' '); value = stripLeft(value, ' '); currentSection.write(key, value); } } } } } /** * Parses the inifile to text. * Returns: A string representing the text. */ string parseToText() { string s; foreach (section; m_sections.values) { s ~= section.getWritable() ~ "\r\n\r\n"; } if (s && s.length >= 2) { s.length -= 1; // EOF has to be 1 one new line only. return s; } else return ""; } public: /** * Creates a new instance of IniFile. * Params: * fileName = The file name of the inifile. */ this(string fileName) { m_fileName = fileName; m_changed = false; } /** * Checks whether the inifile exists or not. * Returns: True if the file exists, false otherwise. */ bool exists() { static if (sync) { synchronized { return fexists(m_fileName); } } else { return fexists(m_fileName); } } /** * Opens the inifile and parses its text. */ void open() { static if (sync) { synchronized { parseFromText( fread(m_fileName) ); } } else { parseFromText( fread(m_fileName) ); } } /** * Closes the inifile and writes its text if any changes has occured. */ void close() { static if (sync) { synchronized { if (!m_changed) return; fwrite(m_fileName, parseToText()); foreach (section; m_sections.values) section.close(); m_sections = null; } } else { if (!m_changed) return; fwrite(m_fileName, parseToText()); foreach (section; m_sections.values) section.close(); m_sections = null; } } /** * Checks whether the inifile has a specific section. * Params: * section = The section to check for existence. * Returns: True if the section exists, false otherwise. */ bool hasSection(string section) { static if (sync) { synchronized { return m_sections.get(section, null) !is null; } } else { return m_sections.get(section, null) !is null; } } /** * Gets a specific section of the inifile. * Params: * section = The section to get. * Returns: The section. */ auto getSection(string section) { static if (sync) { synchronized { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); return m_sections[section]; } } else { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); return m_sections[section]; } } /** * Adds a new section to the inifile. * Params: * section = The section to add. */ void addSection(string section) { static if (sync) { synchronized { m_sections[section] = new IniSection!(sync)(section, this); } } else { m_sections[section] = new IniSection!(sync)(section, this); } } /** * Reads an entry from the inifile. * Params: * section = The section to read from. * key = The key of the entry to read. * Returns: The value read. */ auto read(T)(string section, string key) { static if (sync) { synchronized { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); return m_sections[section].read!T(key); } } else { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); return m_sections[section].read!T(key); } } /** * Writes an entry to the inifile. * Params: * section = The section to write the entry to. * key = The key of the entry. * value = The value of the entry. */ void write(T)(string section, string key, T value) { static if (sync) { synchronized { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); m_sections[section].write!T(key, value); } } else { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); m_sections[section].write!T(key, value); } } /** * Checks whether the inifile has a specific key. * Params: * section = The section to check within. * key = The key to check for existence. * Returns: True if the key exists, falses otherwise. */ bool hasKey(string section, string key) { static if (sync) { synchronized { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); return m_sections[section].hasKey(key); } } else { if(!hasSection(section)) throw new IniException(format("%s is not an existing section.", section)); return m_sections[section].hasKey(key); } } @property { /** * Gets the filename of the inifile. */ string fileName() { static if (sync) { synchronized { return m_fileName; } } else { return m_fileName; } } /** * Gets all the section names. */ string[] sectionNames() { static if (sync) { synchronized { return m_sections.keys; } } else { return m_sections.keys; } } /** * Gets all the sections. */ IniSection!(sync)[] sections() { static if (sync) { synchronized { return m_sections.values; } } else { return m_sections.values; } } } }
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_15_MobileMedia-5112181682.notation#_copSALmGEeKQQp7P9cQvNQ"/> </availablePage> </pageList> <sashModel currentSelection="//@sashModel/@windows.0/@children.0"> <windows> <children xsi:type="di:TabFolder"> <children> <emfPageIdentifier href="VAR_15_MobileMedia-5112181682.notation#_copSALmGEeKQQp7P9cQvNQ"/> </children> </children> </windows> </sashModel> </di:SashWindowsMngr>
D
instance Mod_7596_HS_Bauer_REL (Npc_Default) { // ------ NSC ------ name = "Hofstaatler"; guild = GIL_OUT; id = 7596; voice = 0; flags = 0; npctype = NPCTYPE_MAIN; //----------AIVARS-------------- aivar[AIV_DropDeadAndKill] = TRUE; aivar[AIV_EnemyOverride] = TRUE; // ------ Attribute ------ B_SetAttributesToChapter (self, 3); // ------ Kampf-Taktik ------ fight_tactic = FAI_HUMAN_NORMAL; // ------ Equippte Waffen ------ EquipItem (self, ItMw_1h_Vlk_Sword); // ------ Inventory ------ B_CreateAmbientInv (self); // ------ visuals ------ B_SetNpcVisual (self, MALE, "Hum_Head_Pony", Face_N_Normal07, BodyTex_N, ITAR_Hofstaatler); Mdl_SetModelFatness (self,0); Mdl_ApplyOverlayMds (self, "Humans_Relaxed.mds"); // ------ NSC-relevante Talente vergeben ------ B_GiveNpcTalents (self); // ------ Kampf-Talente ------ B_SetFightSkills (self, 40); // ------ TA anmelden ------ daily_routine = Rtn_Start_7596; }; FUNC VOID Rtn_Start_7596() { TA_Sit_Bench (07,00,23,00,"REL_HS_025"); TA_Sleep (23,00,07,00,"REL_HS_012"); };
D
FUNC VOID B_SpawnNextWave (var int Wave) { if (Wave == 1) { Wld_InsertNpc (YGobbo_Green_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGobbo_Green_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 2) { Wld_InsertNpc (YMolerat_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YMolerat_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 3) { Wld_InsertNpc (YWolf_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YWolf_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 4) { Wld_InsertNpc (YGiant_Bug_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (YGiant_Bug_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 5) { Wld_InsertNpc (Bloodfly_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodfly_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 6) { Wld_InsertNpc (Molerat_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Molerat_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 7) { Wld_InsertNpc (Giant_Rat_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Rat_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 8) { Wld_InsertNpc (Gobbo_Green_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Green_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 9) { Wld_InsertNpc (Scavenger_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 10) { Wld_InsertNpc (Wolf_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Wolf_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 11) { Wld_InsertNpc (Giant_Bug_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_Bug_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 12) { Wld_InsertNpc (Keiler_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Keiler_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 13) { Wld_InsertNpc (SwampDrone_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampDrone_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 14) { Wld_InsertNpc (Giant_DesertRat_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Giant_DesertRat_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 15) { Wld_InsertNpc (Lurker_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lurker_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 16) { Wld_InsertNpc (Minecrawler_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawler_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 17) { Wld_InsertNpc (Gobbo_Black_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Black_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 18) { Wld_InsertNpc (SwampRat_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SwampRat_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 19) { Wld_InsertNpc (Snapper_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Snapper_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 20) { Wld_InsertNpc (Orcbiter_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcbiter_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 21) { Wld_InsertNpc (Bloodhound_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Bloodhound_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 22) { Wld_InsertNpc (Icewolf_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icewolf_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 23) { Wld_InsertNpc (Blattcrawler_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Blattcrawler_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 24) { Wld_InsertNpc (Gobbo_Warrior_Visir_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Warrior_Visir_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 25) { Wld_InsertNpc (Waran_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Waran_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 26) { Wld_InsertNpc (Scavenger_Demon_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Scavenger_Demon_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 27) { Wld_InsertNpc (Harpie_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Harpie_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 28) { Wld_InsertNpc (Stoneguardian_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stoneguardian_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 29) { Wld_InsertNpc (Swampshark_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampshark_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 30) { Wld_InsertNpc (Gobbo_Skeleton_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Gobbo_Skeleton_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 31) { Wld_InsertNpc (Zombie01_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie01_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 32) { Wld_InsertNpc (Orcwarrior_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcwarrior_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 33) { Wld_InsertNpc (Lesser_Skeleton_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Lesser_Skeleton_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 34) { Wld_InsertNpc (Minecrawlerwarrior_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Minecrawlerwarrior_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 35) { Wld_InsertNpc (Razor_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Razor_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 36) { Wld_InsertNpc (Shadowbeast_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 37) { Wld_InsertNpc (Dragonsnapper_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragonsnapper_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 38) { Wld_InsertNpc (Skeleton_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 39) { Wld_InsertNpc (Swampgolem_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Swampgolem_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 40) { Wld_InsertNpc (Firewaran_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firewaran_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 41) { Wld_InsertNpc (Stonegolem_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Stonegolem_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 42) { Wld_InsertNpc (SkeletonMage_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (SkeletonMage_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 43) { Wld_InsertNpc (Shadowbeast_Fire_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Fire_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 44) { Wld_InsertNpc (Zombie02_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie02_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 45) { Wld_InsertNpc (Firegolem_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Firegolem_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 46) { Wld_InsertNpc (Orcshaman_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcshaman_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 47) { Wld_InsertNpc (Icegolem_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Icegolem_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 48) { Wld_InsertNpc (Draconian_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Draconian_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 49) { Wld_InsertNpc (Zombie03_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Zombie03_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 50) { Wld_InsertNpc (Orcelite_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orcelite_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 51) { Wld_InsertNpc (Shadowbeast_Skeleton_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Shadowbeast_Skeleton_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 52) { Wld_InsertNpc (Troll_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 53) { Wld_InsertNpc (Orkoberst_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Orkoberst_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 54) { Wld_InsertNpc (Skeleton_Lord_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Skeleton_Lord_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 55) { Wld_InsertNpc (Undeadorcwarrior_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Undeadorcwarrior_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 56) { Wld_InsertNpc (Demon_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Demon_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 57) { Wld_InsertNpc (Troll_Black_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Troll_Black_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 58) { Wld_InsertNpc (DemonLord_01, ConcatStrings("FP_SPAWN_01_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_06, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_07, ConcatStrings("FP_SPAWN_07_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_08, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_09, ConcatStrings("FP_SPAWN_09_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (DemonLord_10, ConcatStrings("FP_SPAWN_10_0", IntToString(Mod_Levelwahl))); }; if (Wave == 59) { Wld_InsertNpc (Dragon_Fire_01, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Swamp_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Rock_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Ice_04, ConcatStrings("FP_SPAWN_04_0", IntToString(Mod_Levelwahl))); }; if (Wave == 60) { Wld_InsertNpc (Dragon_Undead_01, ConcatStrings("FP_SPAWN_06_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Undead_02, ConcatStrings("FP_SPAWN_02_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Undead_03, ConcatStrings("FP_SPAWN_03_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Undead_04, ConcatStrings("FP_SPAWN_08_0", IntToString(Mod_Levelwahl))); Wld_InsertNpc (Dragon_Undead_05, ConcatStrings("FP_SPAWN_05_0", IntToString(Mod_Levelwahl))); }; };
D
/* bindbc/zstandard/dynload.d Dynamically binds all function Licensed under the Boost Software License 2018 - Laszlo Szeremi */ module bindbc.zstandard.dynload; version(BindZSTD_Static){ }else: import bindbc.loader; import bindbc.zstandard.zstd; import bindbc.zstandard.config; private{ SharedLib lib; ZSTDSupport loadedVersion; } /** * Unloads the zstandard library. */ void unloadZSTD(){ if(lib != invalidHandle){ lib.unload(); } } /** * Returns the currently loaded zstandard library version, or an error code. */ ZSTDSupport loadedZSTDVersion(){ return loadedVersion; } /** * Loads the library and ties the function pointers to the library. */ ZSTDSupport loadZstandard(){ version(Windows){ const(char)[][2] libNames = [ "libzstd.dll", "zstd.dll" ]; }else static assert(0, "bindbc-zstandard is not yet supported on this platform."); ZSTDSupport result; foreach(name; libNames){ result = loadZstandard(name.ptr); if(result != ZSTDSupport.noLibrary) break; } return result; } ZSTDSupport loadZstandard(const(char)* libName){ lib = load(libName); if(lib == invalidHandle) { return ZSTDSupport.noLibrary; } auto errCount = errorCount(); loadedVersion = ZSTDSupport.badLibrary; lib.bindSymbol(cast(void**)&ZSTD_versionNumber, "ZSTD_versionNumber"); lib.bindSymbol(cast(void**)&ZSTD_versionString, "ZSTD_versionString"); lib.bindSymbol(cast(void**)&ZSTD_compress, "ZSTD_compress"); lib.bindSymbol(cast(void**)&ZSTD_decompress, "ZSTD_decompress"); lib.bindSymbol(cast(void**)&ZSTD_getFrameContentSize, "ZSTD_getFrameContentSize"); lib.bindSymbol(cast(void**)&ZSTD_getDecompressedSize, "ZSTD_getDecompressedSize"); lib.bindSymbol(cast(void**)&ZSTD_compressBound, "ZSTD_compressBound"); lib.bindSymbol(cast(void**)&ZSTD_isError, "ZSTD_isError"); lib.bindSymbol(cast(void**)&ZSTD_getErrorName, "ZSTD_getErrorName"); lib.bindSymbol(cast(void**)&ZSTD_maxCLevel, "ZSTD_maxCLevel"); lib.bindSymbol(cast(void**)&ZSTD_createCCtx, "ZSTD_createCCtx"); lib.bindSymbol(cast(void**)&ZSTD_freeCCtx, "ZSTD_freeCCtx"); lib.bindSymbol(cast(void**)&ZSTD_compressCCtx, "ZSTD_compressCCtx"); lib.bindSymbol(cast(void**)&ZSTD_createDCtx, "ZSTD_createDCtx"); lib.bindSymbol(cast(void**)&ZSTD_freeDCtx, "ZSTD_freeDCtx"); lib.bindSymbol(cast(void**)&ZSTD_decompressDCtx, "ZSTD_decompressDCtx"); lib.bindSymbol(cast(void**)&ZSTD_compress_usingDict, "ZSTD_compress_usingDict"); lib.bindSymbol(cast(void**)&ZSTD_decompress_usingDict, "ZSTD_decompress_usingDict"); lib.bindSymbol(cast(void**)&ZSTD_createCDict, "ZSTD_createCDict"); lib.bindSymbol(cast(void**)&ZSTD_freeCDict, "ZSTD_freeCDict"); lib.bindSymbol(cast(void**)&ZSTD_compress_usingCDict, "ZSTD_compress_usingCDict"); lib.bindSymbol(cast(void**)&ZSTD_createDDict, "ZSTD_createDDict"); lib.bindSymbol(cast(void**)&ZSTD_freeDDict, "ZSTD_freeDDict"); lib.bindSymbol(cast(void**)&ZSTD_decompress_usingDDict, "ZSTD_decompress_usingDDict"); lib.bindSymbol(cast(void**)&ZSTD_createCStream, "ZSTD_createCStream"); lib.bindSymbol(cast(void**)&ZSTD_freeCStream, "ZSTD_freeCStream"); lib.bindSymbol(cast(void**)&ZSTD_initCStream, "ZSTD_initCStream"); lib.bindSymbol(cast(void**)&ZSTD_compressStream, "ZSTD_compressStream"); lib.bindSymbol(cast(void**)&ZSTD_flushStream, "ZSTD_flushStream"); lib.bindSymbol(cast(void**)&ZSTD_endStream, "ZSTD_endStream"); lib.bindSymbol(cast(void**)&ZSTD_CStreamInSize, "ZSTD_CStreamInSize"); lib.bindSymbol(cast(void**)&ZSTD_CStreamOutSize, "ZSTD_CStreamOutSize"); lib.bindSymbol(cast(void**)&ZSTD_createDStream, "ZSTD_createDStream"); lib.bindSymbol(cast(void**)&ZSTD_freeDStream, "ZSTD_freeDStream"); lib.bindSymbol(cast(void**)&ZSTD_initDStream, "ZSTD_initDStream"); lib.bindSymbol(cast(void**)&ZSTD_decompressStream, "ZSTD_decompressStream"); lib.bindSymbol(cast(void**)&ZSTD_DStreamInSize, "ZSTD_DStreamInSize"); lib.bindSymbol(cast(void**)&ZSTD_DStreamOutSize, "ZSTD_DStreamOutSize"); loadedVersion = ZSTDSupport.ZSTD1_3; if(errCount != errorCount) return ZSTDSupport.badLibrary; version(zstd1_04){ lib.bindSymbol(cast(void**)&ZSTD_compressStream2, "ZSTD_compressStream2"); lib.bindSymbol(cast(void**)&ZSTD_cParam_getBounds, "ZSTD_cParam_getBounds"); lib.bindSymbol(cast(void**)&ZSTD_CCtx_setParameter, "ZSTD_CCtx_setParameter"); lib.bindSymbol(cast(void**)&ZSTD_CCtx_setPledgedSrcSize, "ZSTD_CCtx_setPledgedSrcSize"); lib.bindSymbol(cast(void**)&ZSTD_CCtx_reset, "ZSTD_CCtx_reset"); lib.bindSymbol(cast(void**)&ZSTD_compress2, "ZSTD_compress2"); lib.bindSymbol(cast(void**)&ZSTD_getDictID_fromDict, "ZSTD_getDictID_fromDict"); lib.bindSymbol(cast(void**)&ZSTD_getDictID_fromDDict, "ZSTD_getDictID_fromDDict"); lib.bindSymbol(cast(void**)&ZSTD_CCtx_loadDictionary, "ZSTD_CCtx_loadDictionary"); lib.bindSymbol(cast(void**)&ZSTD_DCtx_reset, "ZSTD_DCtx_reset"); lib.bindSymbol(cast(void**)&ZSTD_CCtx_refCDict, "ZSTD_CCtx_refCDict"); lib.bindSymbol(cast(void**)&ZSTD_CCtx_refPrefix, "ZSTD_CCtx_refPrefix"); lib.bindSymbol(cast(void**)&ZSTD_DCtx_loadDictionary, "ZSTD_DCtx_loadDictionary"); lib.bindSymbol(cast(void**)&ZSTD_DCtx_refDDict, "ZSTD_DCtx_refDDict"); lib.bindSymbol(cast(void**)&ZSTD_DCtx_refPrefix, "ZSTD_DCtx_refPrefix"); lib.bindSymbol(cast(void**)&ZSTD_sizeof_CCtx, "ZSTD_sizeof_CCtx"); lib.bindSymbol(cast(void**)&ZSTD_sizeof_DCtx, "ZSTD_sizeof_DCtx"); lib.bindSymbol(cast(void**)&ZSTD_sizeof_CStream, "ZSTD_sizeof_CStream"); lib.bindSymbol(cast(void**)&ZSTD_sizeof_DStream, "ZSTD_sizeof_DStream"); lib.bindSymbol(cast(void**)&ZSTD_sizeof_CDict, "ZSTD_sizeof_CDict"); lib.bindSymbol(cast(void**)&ZSTD_sizeof_DDict, "ZSTD_sizeof_DDict"); loadedVersion = ZSTDSupport.ZSTD1_4; if(errCount != errorCount) return ZSTDSupport.ZSTD1_3; } return loadedVersion; }
D
a shelter from danger or hardship a hospital for mentally incompetent or unbalanced person
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.bigint; void main() { auto nml = readln.split.to!(int[]); auto N = nml[0]; auto M = nml[1]; auto L = nml[2]; auto pqr = readln.split.to!(int[]); sort(pqr); int r; do { auto P = pqr[0]; auto Q = pqr[1]; auto R = pqr[2]; r = max(r, (N/P) * (M/Q) * (L/R)); } while (nextPermutation(pqr)); writeln(r); }
D
/* THIS FILE GENERATED BY bcd.gen */ module bcd.fltk.Fl_Text_Buffer; public import bcd.bind; const int FL_TEXT_MAX_EXP_CHAR_LEN = 20; extern (C) void _BCD_delete_14Fl_Text_Buffer(void *); extern (C) void *_BCD_new__ZN14Fl_Text_BufferC1Ei(int); extern (C) int _BCD__ZN14Fl_Text_Buffer6lengthEv(void *This); extern (C) char * _BCD__ZN14Fl_Text_Buffer4textEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer4textEPKc(void *This, char *); extern (C) char * _BCD__ZN14Fl_Text_Buffer10text_rangeEii(void *This, int, int); extern (C) char _BCD__ZN14Fl_Text_Buffer9characterEi(void *This, int); extern (C) char * _BCD__ZN14Fl_Text_Buffer17text_in_rectangleEiiii(void *This, int, int, int, int); extern (C) void _BCD__ZN14Fl_Text_Buffer6insertEiPKc(void *This, int, char *); extern (C) void _BCD__ZN14Fl_Text_Buffer6appendEPKc(void *This, char *); extern (C) void _BCD__ZN14Fl_Text_Buffer6removeEii(void *This, int, int); extern (C) void _BCD__ZN14Fl_Text_Buffer7replaceEiiPKc(void *This, int, int, char *); extern (C) void _BCD__ZN14Fl_Text_Buffer4copyEPS_iii(void *This, void *, int, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer4undoEPi(void *This, int *); extern (C) void _BCD__ZN14Fl_Text_Buffer7canUndoEc(void *This, char); extern (C) int _BCD__ZN14Fl_Text_Buffer10insertfileEPKcii(void *This, char *, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer10appendfileEPKci(void *This, char *, int); extern (C) int _BCD__ZN14Fl_Text_Buffer8loadfileEPKci(void *This, char *, int); extern (C) int _BCD__ZN14Fl_Text_Buffer10outputfileEPKciii(void *This, char *, int, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer8savefileEPKci(void *This, char *, int); extern (C) void _BCD__ZN14Fl_Text_Buffer13insert_columnEiiPKcPiS2_(void *This, int, int, char *, int *, int *); extern (C) void _BCD__ZN14Fl_Text_Buffer19replace_rectangularEiiiiPKc(void *This, int, int, int, int, char *); extern (C) void _BCD__ZN14Fl_Text_Buffer19overlay_rectangularEiiiPKcPiS2_(void *This, int, int, int, char *, int *, int *); extern (C) void _BCD__ZN14Fl_Text_Buffer18remove_rectangularEiiii(void *This, int, int, int, int); extern (C) void _BCD__ZN14Fl_Text_Buffer17clear_rectangularEiiii(void *This, int, int, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer12tab_distanceEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer12tab_distanceEi(void *This, int); extern (C) void _BCD__ZN14Fl_Text_Buffer6selectEii(void *This, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer8selectedEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer8unselectEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer18select_rectangularEiiii(void *This, int, int, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer18selection_positionEPiS0_(void *This, int *, int *); extern (C) int _BCD__ZN14Fl_Text_Buffer18selection_positionEPiS0_S0_S0_S0_(void *This, int *, int *, int *, int *, int *); extern (C) char * _BCD__ZN14Fl_Text_Buffer14selection_textEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer16remove_selectionEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer17replace_selectionEPKc(void *This, char *); extern (C) void _BCD__ZN14Fl_Text_Buffer16secondary_selectEii(void *This, int, int); extern (C) void _BCD__ZN14Fl_Text_Buffer18secondary_unselectEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer28secondary_select_rectangularEiiii(void *This, int, int, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer28secondary_selection_positionEPiS0_S0_S0_S0_(void *This, int *, int *, int *, int *, int *); extern (C) char * _BCD__ZN14Fl_Text_Buffer24secondary_selection_textEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer26remove_secondary_selectionEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer27replace_secondary_selectionEPKc(void *This, char *); extern (C) void _BCD__ZN14Fl_Text_Buffer9highlightEii(void *This, int, int); extern (C) void _BCD__ZN14Fl_Text_Buffer11unhighlightEv(void *This); extern (C) void _BCD__ZN14Fl_Text_Buffer21highlight_rectangularEiiii(void *This, int, int, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer18highlight_positionEPiS0_S0_S0_S0_(void *This, int *, int *, int *, int *, int *); extern (C) char * _BCD__ZN14Fl_Text_Buffer14highlight_textEv(void *This); alias void function(int, int, int, int, char *, void *) _BCD_func__126; alias _BCD_func__126 Fl_Text_Modify_Cb; extern (C) void _BCD__ZN14Fl_Text_Buffer19add_modify_callbackEPFviiiiPKcPvES2_(void *This, _BCD_func__126, void *); extern (C) void _BCD__ZN14Fl_Text_Buffer22remove_modify_callbackEPFviiiiPKcPvES2_(void *This, _BCD_func__126, void *); extern (C) void _BCD__ZN14Fl_Text_Buffer21call_modify_callbacksEv(void *This); alias void function(int, int, void *) _BCD_func__125; alias _BCD_func__125 Fl_Text_Predelete_Cb; extern (C) void _BCD__ZN14Fl_Text_Buffer22add_predelete_callbackEPFviiPvES0_(void *This, _BCD_func__125, void *); extern (C) void _BCD__ZN14Fl_Text_Buffer25remove_predelete_callbackEPFviiPvES0_(void *This, _BCD_func__125, void *); extern (C) void _BCD__ZN14Fl_Text_Buffer24call_predelete_callbacksEv(void *This); extern (C) char * _BCD__ZN14Fl_Text_Buffer9line_textEi(void *This, int); extern (C) int _BCD__ZN14Fl_Text_Buffer10line_startEi(void *This, int); extern (C) int _BCD__ZN14Fl_Text_Buffer8line_endEi(void *This, int); extern (C) int _BCD__ZN14Fl_Text_Buffer10word_startEi(void *This, int); extern (C) int _BCD__ZN14Fl_Text_Buffer8word_endEi(void *This, int); extern (C) int _BCD__ZN14Fl_Text_Buffer16expand_characterEiiPc(void *This, int, int, char *); extern (C) int _BCD__ZN14Fl_Text_Buffer16expand_characterEciPcic(char, int, char *, int, char); extern (C) int _BCD__ZN14Fl_Text_Buffer15character_widthEciic(char, int, int, char); extern (C) int _BCD__ZN14Fl_Text_Buffer26count_displayed_charactersEii(void *This, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer25skip_displayed_charactersEii(void *This, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer11count_linesEii(void *This, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer10skip_linesEii(void *This, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer12rewind_linesEii(void *This, int, int); extern (C) int _BCD__ZN14Fl_Text_Buffer16findchar_forwardEicPi(void *This, int, char, int *); extern (C) int _BCD__ZN14Fl_Text_Buffer17findchar_backwardEicPi(void *This, int, char, int *); extern (C) int _BCD__ZN14Fl_Text_Buffer17findchars_forwardEiPKcPi(void *This, int, char *, int *); extern (C) int _BCD__ZN14Fl_Text_Buffer18findchars_backwardEiPKcPi(void *This, int, char *, int *); extern (C) int _BCD__ZN14Fl_Text_Buffer14search_forwardEiPKcPii(void *This, int, char *, int *, int); extern (C) int _BCD__ZN14Fl_Text_Buffer15search_backwardEiPKcPii(void *This, int, char *, int *, int); extern (C) int _BCD__ZN14Fl_Text_Buffer26substitute_null_charactersEPci(void *This, char *, int); extern (C) void _BCD__ZN14Fl_Text_Buffer28unsubstitute_null_charactersEPc(void *This, char *); extern (C) char _BCD__ZN14Fl_Text_Buffer27null_substitution_characterEv(void *This); extern (C) Fl_Text_Selection * _BCD__ZN14Fl_Text_Buffer17primary_selectionEv(void *This); extern (C) Fl_Text_Selection * _BCD__ZN14Fl_Text_Buffer19secondary_selectionEv(void *This); extern (C) Fl_Text_Selection * _BCD__ZN14Fl_Text_Buffer19highlight_selectionEv(void *This); extern (C) void _BCD_RI_14Fl_Text_Buffer(void *cd, void *dd); extern (C) void _BCD_delete_14Fl_Text_Buffer__Fl_Text_Buffer_R(void *This); extern (C) void *_BCD_new__ZN14Fl_Text_BufferC1Ei_R(int); extern (C) void _BCD_delete_17Fl_Text_Selection(void *); extern (C) void _BCD__ZN17Fl_Text_Selection3setEii(void *This, int, int); extern (C) void _BCD__ZN17Fl_Text_Selection15set_rectangularEiiii(void *This, int, int, int, int); extern (C) void _BCD__ZN17Fl_Text_Selection6updateEiii(void *This, int, int, int); extern (C) char _BCD__ZN17Fl_Text_Selection11rectangularEv(void *This); extern (C) int _BCD__ZN17Fl_Text_Selection5startEv(void *This); extern (C) int _BCD__ZN17Fl_Text_Selection3endEv(void *This); extern (C) int _BCD__ZN17Fl_Text_Selection10rect_startEv(void *This); extern (C) int _BCD__ZN17Fl_Text_Selection8rect_endEv(void *This); extern (C) char _BCD__ZN17Fl_Text_Selection8selectedEv(void *This); extern (C) void _BCD__ZN17Fl_Text_Selection8selectedEc(void *This, char); extern (C) int _BCD__ZN17Fl_Text_Selection8includesEiii(void *This, int, int, int); extern (C) int _BCD__ZN17Fl_Text_Selection8positionEPiS0_(void *This, int *, int *); extern (C) int _BCD__ZN17Fl_Text_Selection8positionEPiS0_S0_S0_S0_(void *This, int *, int *, int *, int *, int *); extern (C) void _BCD_RI_17Fl_Text_Selection(void *cd, void *dd); extern (C) void _BCD_delete_17Fl_Text_Selection__Fl_Text_Selection_R(void *This); class Fl_Text_Buffer : bcd.bind.BoundClass { this(ifloat ignore) { super(ignore); } this(ifloat ignore, void *x) { super(ignore); __C_data = x; __C_data_owned = false; } ~this() { if (__C_data && __C_data_owned) _BCD_delete_14Fl_Text_Buffer(__C_data); __C_data = null; } this(int requestedSize) { super(cast(ifloat) 0); __C_data = _BCD_new__ZN14Fl_Text_BufferC1Ei(requestedSize); __C_data_owned = true; } int length() { return _BCD__ZN14Fl_Text_Buffer6lengthEv(__C_data); } char * text() { return _BCD__ZN14Fl_Text_Buffer4textEv(__C_data); } void text(char * text) { _BCD__ZN14Fl_Text_Buffer4textEPKc(__C_data, text); } char * text_range(int start, int end) { return _BCD__ZN14Fl_Text_Buffer10text_rangeEii(__C_data, start, end); } char character(int pos) { return _BCD__ZN14Fl_Text_Buffer9characterEi(__C_data, pos); } char * text_in_rectangle(int start, int end, int rectStart, int rectEnd) { return _BCD__ZN14Fl_Text_Buffer17text_in_rectangleEiiii(__C_data, start, end, rectStart, rectEnd); } void insert(int pos, char * text) { _BCD__ZN14Fl_Text_Buffer6insertEiPKc(__C_data, pos, text); } void append(char * t) { _BCD__ZN14Fl_Text_Buffer6appendEPKc(__C_data, t); } void remove(int start, int end) { _BCD__ZN14Fl_Text_Buffer6removeEii(__C_data, start, end); } void replace(int start, int end, char * text) { _BCD__ZN14Fl_Text_Buffer7replaceEiiPKc(__C_data, start, end, text); } void copy(Fl_Text_Buffer * fromBuf, int fromStart, int fromEnd, int toPos) { _BCD__ZN14Fl_Text_Buffer4copyEPS_iii(__C_data, fromBuf.__C_data, fromStart, fromEnd, toPos); } int undo(int * cp) { return _BCD__ZN14Fl_Text_Buffer4undoEPi(__C_data, cp); } void canUndo(char flag) { _BCD__ZN14Fl_Text_Buffer7canUndoEc(__C_data, flag); } int insertfile(char * file, int pos, int buflen) { return _BCD__ZN14Fl_Text_Buffer10insertfileEPKcii(__C_data, file, pos, buflen); } int appendfile(char * file, int buflen) { return _BCD__ZN14Fl_Text_Buffer10appendfileEPKci(__C_data, file, buflen); } int loadfile(char * file, int buflen) { return _BCD__ZN14Fl_Text_Buffer8loadfileEPKci(__C_data, file, buflen); } int outputfile(char * file, int start, int end, int buflen) { return _BCD__ZN14Fl_Text_Buffer10outputfileEPKciii(__C_data, file, start, end, buflen); } int savefile(char * file, int buflen) { return _BCD__ZN14Fl_Text_Buffer8savefileEPKci(__C_data, file, buflen); } void insert_column(int column, int startPos, char * text, int * charsInserted, int * charsDeleted) { _BCD__ZN14Fl_Text_Buffer13insert_columnEiiPKcPiS2_(__C_data, column, startPos, text, charsInserted, charsDeleted); } void replace_rectangular(int start, int end, int rectStart, int rectEnd, char * text) { _BCD__ZN14Fl_Text_Buffer19replace_rectangularEiiiiPKc(__C_data, start, end, rectStart, rectEnd, text); } void overlay_rectangular(int startPos, int rectStart, int rectEnd, char * text, int * charsInserted, int * charsDeleted) { _BCD__ZN14Fl_Text_Buffer19overlay_rectangularEiiiPKcPiS2_(__C_data, startPos, rectStart, rectEnd, text, charsInserted, charsDeleted); } void remove_rectangular(int start, int end, int rectStart, int rectEnd) { _BCD__ZN14Fl_Text_Buffer18remove_rectangularEiiii(__C_data, start, end, rectStart, rectEnd); } void clear_rectangular(int start, int end, int rectStart, int rectEnd) { _BCD__ZN14Fl_Text_Buffer17clear_rectangularEiiii(__C_data, start, end, rectStart, rectEnd); } int tab_distance() { return _BCD__ZN14Fl_Text_Buffer12tab_distanceEv(__C_data); } void tab_distance(int tabDist) { _BCD__ZN14Fl_Text_Buffer12tab_distanceEi(__C_data, tabDist); } void select(int start, int end) { _BCD__ZN14Fl_Text_Buffer6selectEii(__C_data, start, end); } int selected() { return _BCD__ZN14Fl_Text_Buffer8selectedEv(__C_data); } void unselect() { _BCD__ZN14Fl_Text_Buffer8unselectEv(__C_data); } void select_rectangular(int start, int end, int rectStart, int rectEnd) { _BCD__ZN14Fl_Text_Buffer18select_rectangularEiiii(__C_data, start, end, rectStart, rectEnd); } int selection_position(int * start, int * end) { return _BCD__ZN14Fl_Text_Buffer18selection_positionEPiS0_(__C_data, start, end); } int selection_position(int * start, int * end, int * isRect, int * rectStart, int * rectEnd) { return _BCD__ZN14Fl_Text_Buffer18selection_positionEPiS0_S0_S0_S0_(__C_data, start, end, isRect, rectStart, rectEnd); } char * selection_text() { return _BCD__ZN14Fl_Text_Buffer14selection_textEv(__C_data); } void remove_selection() { _BCD__ZN14Fl_Text_Buffer16remove_selectionEv(__C_data); } void replace_selection(char * text) { _BCD__ZN14Fl_Text_Buffer17replace_selectionEPKc(__C_data, text); } void secondary_select(int start, int end) { _BCD__ZN14Fl_Text_Buffer16secondary_selectEii(__C_data, start, end); } void secondary_unselect() { _BCD__ZN14Fl_Text_Buffer18secondary_unselectEv(__C_data); } void secondary_select_rectangular(int start, int end, int rectStart, int rectEnd) { _BCD__ZN14Fl_Text_Buffer28secondary_select_rectangularEiiii(__C_data, start, end, rectStart, rectEnd); } int secondary_selection_position(int * start, int * end, int * isRect, int * rectStart, int * rectEnd) { return _BCD__ZN14Fl_Text_Buffer28secondary_selection_positionEPiS0_S0_S0_S0_(__C_data, start, end, isRect, rectStart, rectEnd); } char * secondary_selection_text() { return _BCD__ZN14Fl_Text_Buffer24secondary_selection_textEv(__C_data); } void remove_secondary_selection() { _BCD__ZN14Fl_Text_Buffer26remove_secondary_selectionEv(__C_data); } void replace_secondary_selection(char * text) { _BCD__ZN14Fl_Text_Buffer27replace_secondary_selectionEPKc(__C_data, text); } void highlight(int start, int end) { _BCD__ZN14Fl_Text_Buffer9highlightEii(__C_data, start, end); } void unhighlight() { _BCD__ZN14Fl_Text_Buffer11unhighlightEv(__C_data); } void highlight_rectangular(int start, int end, int rectStart, int rectEnd) { _BCD__ZN14Fl_Text_Buffer21highlight_rectangularEiiii(__C_data, start, end, rectStart, rectEnd); } int highlight_position(int * start, int * end, int * isRect, int * rectStart, int * rectEnd) { return _BCD__ZN14Fl_Text_Buffer18highlight_positionEPiS0_S0_S0_S0_(__C_data, start, end, isRect, rectStart, rectEnd); } char * highlight_text() { return _BCD__ZN14Fl_Text_Buffer14highlight_textEv(__C_data); } void add_modify_callback(_BCD_func__126 bufModifiedCB, void * cbArg) { _BCD__ZN14Fl_Text_Buffer19add_modify_callbackEPFviiiiPKcPvES2_(__C_data, bufModifiedCB, cbArg); } void remove_modify_callback(_BCD_func__126 bufModifiedCB, void * cbArg) { _BCD__ZN14Fl_Text_Buffer22remove_modify_callbackEPFviiiiPKcPvES2_(__C_data, bufModifiedCB, cbArg); } void call_modify_callbacks() { _BCD__ZN14Fl_Text_Buffer21call_modify_callbacksEv(__C_data); } void add_predelete_callback(_BCD_func__125 bufPredelCB, void * cbArg) { _BCD__ZN14Fl_Text_Buffer22add_predelete_callbackEPFviiPvES0_(__C_data, bufPredelCB, cbArg); } void remove_predelete_callback(_BCD_func__125 predelCB, void * cbArg) { _BCD__ZN14Fl_Text_Buffer25remove_predelete_callbackEPFviiPvES0_(__C_data, predelCB, cbArg); } void call_predelete_callbacks() { _BCD__ZN14Fl_Text_Buffer24call_predelete_callbacksEv(__C_data); } char * line_text(int pos) { return _BCD__ZN14Fl_Text_Buffer9line_textEi(__C_data, pos); } int line_start(int pos) { return _BCD__ZN14Fl_Text_Buffer10line_startEi(__C_data, pos); } int line_end(int pos) { return _BCD__ZN14Fl_Text_Buffer8line_endEi(__C_data, pos); } int word_start(int pos) { return _BCD__ZN14Fl_Text_Buffer10word_startEi(__C_data, pos); } int word_end(int pos) { return _BCD__ZN14Fl_Text_Buffer8word_endEi(__C_data, pos); } int expand_character(int pos, int indent, char * outStr) { return _BCD__ZN14Fl_Text_Buffer16expand_characterEiiPc(__C_data, pos, indent, outStr); } static int expand_character(char c, int indent, char * outStr, int tabDist, char nullSubsChar) { return _BCD__ZN14Fl_Text_Buffer16expand_characterEciPcic(c, indent, outStr, tabDist, nullSubsChar); } static int character_width(char c, int indent, int tabDist, char nullSubsChar) { return _BCD__ZN14Fl_Text_Buffer15character_widthEciic(c, indent, tabDist, nullSubsChar); } int count_displayed_characters(int lineStartPos, int targetPos) { return _BCD__ZN14Fl_Text_Buffer26count_displayed_charactersEii(__C_data, lineStartPos, targetPos); } int skip_displayed_characters(int lineStartPos, int nChars) { return _BCD__ZN14Fl_Text_Buffer25skip_displayed_charactersEii(__C_data, lineStartPos, nChars); } int count_lines(int startPos, int endPos) { return _BCD__ZN14Fl_Text_Buffer11count_linesEii(__C_data, startPos, endPos); } int skip_lines(int startPos, int nLines) { return _BCD__ZN14Fl_Text_Buffer10skip_linesEii(__C_data, startPos, nLines); } int rewind_lines(int startPos, int nLines) { return _BCD__ZN14Fl_Text_Buffer12rewind_linesEii(__C_data, startPos, nLines); } int findchar_forward(int startPos, char searchChar, int * foundPos) { return _BCD__ZN14Fl_Text_Buffer16findchar_forwardEicPi(__C_data, startPos, searchChar, foundPos); } int findchar_backward(int startPos, char searchChar, int * foundPos) { return _BCD__ZN14Fl_Text_Buffer17findchar_backwardEicPi(__C_data, startPos, searchChar, foundPos); } int findchars_forward(int startPos, char * searchChars, int * foundPos) { return _BCD__ZN14Fl_Text_Buffer17findchars_forwardEiPKcPi(__C_data, startPos, searchChars, foundPos); } int findchars_backward(int startPos, char * searchChars, int * foundPos) { return _BCD__ZN14Fl_Text_Buffer18findchars_backwardEiPKcPi(__C_data, startPos, searchChars, foundPos); } int search_forward(int startPos, char * searchString, int * foundPos, int matchCase) { return _BCD__ZN14Fl_Text_Buffer14search_forwardEiPKcPii(__C_data, startPos, searchString, foundPos, matchCase); } int search_backward(int startPos, char * searchString, int * foundPos, int matchCase) { return _BCD__ZN14Fl_Text_Buffer15search_backwardEiPKcPii(__C_data, startPos, searchString, foundPos, matchCase); } int substitute_null_characters(char * string, int length) { return _BCD__ZN14Fl_Text_Buffer26substitute_null_charactersEPci(__C_data, string, length); } void unsubstitute_null_characters(char * string) { _BCD__ZN14Fl_Text_Buffer28unsubstitute_null_charactersEPc(__C_data, string); } char null_substitution_character() { return _BCD__ZN14Fl_Text_Buffer27null_substitution_characterEv(__C_data); } Fl_Text_Selection * primary_selection() { return _BCD__ZN14Fl_Text_Buffer17primary_selectionEv(__C_data); } Fl_Text_Selection * secondary_selection() { return _BCD__ZN14Fl_Text_Buffer19secondary_selectionEv(__C_data); } Fl_Text_Selection * highlight_selection() { return _BCD__ZN14Fl_Text_Buffer19highlight_selectionEv(__C_data); } } class Fl_Text_Buffer_R : Fl_Text_Buffer { ~this() { if (__C_data && __C_data_owned) _BCD_delete_14Fl_Text_Buffer__Fl_Text_Buffer_R(__C_data); __C_data = null; } this(int requestedSize) { super(cast(ifloat) 0); __C_data = _BCD_new__ZN14Fl_Text_BufferC1Ei_R(requestedSize); __C_data_owned = true; _BCD_RI_14Fl_Text_Buffer(__C_data, cast(void *) this); } } class Fl_Text_Selection : bcd.bind.BoundClass { this(ifloat ignore) { super(ignore); } this(ifloat ignore, void *x) { super(ignore); __C_data = x; __C_data_owned = false; } ~this() { if (__C_data && __C_data_owned) _BCD_delete_17Fl_Text_Selection(__C_data); __C_data = null; } void set(int start, int end) { _BCD__ZN17Fl_Text_Selection3setEii(__C_data, start, end); } void set_rectangular(int start, int end, int rectStart, int rectEnd) { _BCD__ZN17Fl_Text_Selection15set_rectangularEiiii(__C_data, start, end, rectStart, rectEnd); } void update(int pos, int nDeleted, int nInserted) { _BCD__ZN17Fl_Text_Selection6updateEiii(__C_data, pos, nDeleted, nInserted); } char rectangular() { return _BCD__ZN17Fl_Text_Selection11rectangularEv(__C_data); } int start() { return _BCD__ZN17Fl_Text_Selection5startEv(__C_data); } int end() { return _BCD__ZN17Fl_Text_Selection3endEv(__C_data); } int rect_start() { return _BCD__ZN17Fl_Text_Selection10rect_startEv(__C_data); } int rect_end() { return _BCD__ZN17Fl_Text_Selection8rect_endEv(__C_data); } char selected() { return _BCD__ZN17Fl_Text_Selection8selectedEv(__C_data); } void selected(char b) { _BCD__ZN17Fl_Text_Selection8selectedEc(__C_data, b); } int includes(int pos, int lineStartPos, int dispIndex) { return _BCD__ZN17Fl_Text_Selection8includesEiii(__C_data, pos, lineStartPos, dispIndex); } int position(int * start, int * end) { return _BCD__ZN17Fl_Text_Selection8positionEPiS0_(__C_data, start, end); } int position(int * start, int * end, int * isRect, int * rectStart, int * rectEnd) { return _BCD__ZN17Fl_Text_Selection8positionEPiS0_S0_S0_S0_(__C_data, start, end, isRect, rectStart, rectEnd); } } class Fl_Text_Selection_R : Fl_Text_Selection { ~this() { if (__C_data && __C_data_owned) _BCD_delete_17Fl_Text_Selection__Fl_Text_Selection_R(__C_data); __C_data = null; } this() { super(cast(ireal) 0); } }
D
/** * Convert a D symbol to a symbol the linker understands (with mangled name). * * Copyright: Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved * Authors: $(LINK2 https://www.digitalmars.com, Walter Bright) * License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/tocsym.d, _tocsym.d) * Documentation: https://dlang.org/phobos/dmd_tocsym.html * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/tocsym.d */ module dmd.tocsym; import core.stdc.stdio; import core.stdc.string; import dmd.root.array; import dmd.root.complex; import dmd.root.rmem; import dmd.aggregate; import dmd.arraytypes; import dmd.astenums; import dmd.ctfeexpr; import dmd.declaration; import dmd.dclass; import dmd.denum; import dmd.dmodule; import dmd.dstruct; import dmd.dsymbol; import dmd.dtemplate; import dmd.e2ir; import dmd.errors; import dmd.expression; import dmd.func; import dmd.globals; import dmd.glue; import dmd.identifier; import dmd.id; import dmd.init; import dmd.location; import dmd.mtype; import dmd.target; import dmd.toctype; import dmd.todt; import dmd.toir; import dmd.tokens; import dmd.typinf; import dmd.visitor; import dmd.dmangle; import dmd.backend.cdef; import dmd.backend.cc; import dmd.backend.dt; import dmd.backend.type; import dmd.backend.global; import dmd.backend.oper; import dmd.backend.cgcv; import dmd.backend.symtab; import dmd.backend.ty; extern (C++): /************************************* * Helper */ Symbol *toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type *t, const(char)* suffix) { //printf("Dsymbol::toSymbolX('%s')\n", prefix); import dmd.common.string : SmallBuffer; import dmd.common.outbuffer : OutBuffer; OutBuffer buf; mangleToBuffer(ds, &buf); size_t nlen = buf.length; const(char)* n = buf.peekChars(); assert(n); import core.stdc.string : strlen; size_t prefixlen = strlen(prefix); size_t suffixlen = strlen(suffix); size_t idlen = 2 + nlen + size_t.sizeof * 3 + prefixlen + suffixlen + 1; char[64] idbuf = void; auto sb = SmallBuffer!(char)(idlen, idbuf[]); char *id = sb.ptr; int nwritten = snprintf(id, idlen, "_D%.*s%d%.*s%.*s", cast(int)nlen, n, cast(int)prefixlen, cast(int)prefixlen, prefix, cast(int)suffixlen, suffix); assert(cast(uint)nwritten < idlen); // nwritten does not include the terminating 0 char Symbol *s = symbol_name(id[0 .. nwritten], sclass, t); //printf("-Dsymbol::toSymbolX() %s\n", id); return s; } /************************************* */ Symbol *toSymbol(Dsymbol s) { extern (C++) static final class ToSymbol : Visitor { alias visit = Visitor.visit; Symbol *result; this() scope { result = null; } override void visit(Dsymbol s) { printf("Dsymbol.toSymbol() '%s', kind = '%s'\n", s.toChars(), s.kind()); assert(0); // BUG: implement } override void visit(SymbolDeclaration sd) { result = toInitializer(sd.dsym); } override void visit(VarDeclaration vd) { //printf("VarDeclaration.toSymbol(%s)\n", vd.toChars()); if (vd.needThis()) fprintf(stderr, "VarDeclaration.toSymbol(%s) needThis kind: %s\n", vd.toPrettyChars(), vd.kind()); assert(!vd.needThis()); import dmd.common.outbuffer : OutBuffer; OutBuffer buf; bool isNRVO = false; const(char)[] id = vd.ident.toString(); if (vd.isDataseg()) { mangleToBuffer(vd, &buf); id = buf[]; } else { if (FuncDeclaration fd = vd.toParent2().isFuncDeclaration()) { if (fd.isNRVO() && fd.nrvo_var == vd) { buf.writestring("__nrvo_"); buf.writestring(id); id = buf[]; isNRVO = true; } } } Symbol *s = symbol_calloc(id); s.Salignment = vd.alignment.isDefault() ? -1 : vd.alignment.get(); if (vd.storage_class & STC.temp) s.Sflags |= SFLartifical; if (isNRVO) s.Sflags |= SFLnodebug; if (vd.adFlags & Declaration.nounderscore) s.Sflags |= SFLnounderscore; TYPE *t; if (vd.storage_class & (STC.out_ | STC.ref_)) { t = type_allocn(TYnref, Type_toCtype(vd.type)); t.Tcount++; } else if (vd.storage_class & STC.lazy_) { if (target.os == Target.OS.Windows && target.is64bit && vd.isParameter()) t = type_fake(TYnptr); else t = type_fake(TYdelegate); // Tdelegate as C type t.Tcount++; } else if (vd.isParameter() && ISX64REF(vd)) { t = type_allocn(TYnref, Type_toCtype(vd.type)); t.Tcount++; } else { t = Type_toCtype(vd.type); t.Tcount++; } /* Even if a symbol is immutable, if it has a constructor then * the constructor mutates it. Remember that constructors can * be inlined into other code. * Just can't rely on it being immutable. */ if (t.Tty & (mTYimmutable | mTYconst)) { if (vd.ctorinit) { /* It was initialized in a constructor, so not really immutable * as far as the optimizer is concerned, as in this case: * immutable int x; * shared static this() { x += 3; } */ t = type_setty(&t, t.Tty & ~(mTYimmutable | mTYconst)); } else if (auto ts = vd.type.isTypeStruct()) { if (!ts.isMutable() && ts.sym.ctor) { t = type_setty(&t, t.Tty & ~(mTYimmutable | mTYconst)); } } else if (auto tc = vd.type.isTypeClass()) { if (!tc.isMutable() && tc.sym.ctor) { t = type_setty(&t, t.Tty & ~(mTYimmutable | mTYconst)); } } } if (vd.isDataseg()) { if (vd.isThreadlocal() && !(vd.storage_class & STC.temp)) { /* Thread local storage */ auto ts = t; ts.Tcount++; // make sure a different t is allocated type_setty(&t, t.Tty | mTYthread); ts.Tcount--; if (config.objfmt == OBJ_MACH && _tysize[TYnptr] == 8) s.Salignment = 2; if (global.params.vtls) { message(vd.loc, "`%s` is thread local", vd.toChars()); } } s.Sclass = SC.extern_; s.Sfl = FLextern; /* Make C static variables SCstatic */ if (vd.storage_class & STC.static_ && vd.isCsymbol()) { s.Sclass = SC.static_; s.Sfl = FLdata; } /* if it's global or static, then it needs to have a qualified but unmangled name. * This gives some explanation of the separation in treating name mangling. * It applies to PDB format, but should apply to CV as PDB derives from CV. * https://msdn.microsoft.com/en-us/library/ff553493%28VS.85%29.aspx */ s.prettyIdent = vd.toPrettyChars(true); } else { s.Sclass = SC.auto_; s.Sfl = FLauto; if (vd.nestedrefs.length) { /* Symbol is accessed by a nested function. Make sure * it is not put in a register, and that the optimizer * assumes it is modified across function calls and pointer * dereferences. */ //printf("\tnested ref, not register\n"); type_setcv(&t, t.Tty | mTYvolatile); } } if (vd.storage_class & STC.volatile_) { type_setcv(&t, t.Tty | mTYvolatile); } mangle_t m = 0; final switch (vd.resolvedLinkage()) { case LINK.windows: m = target.is64bit ? mTYman_c : mTYman_std; break; case LINK.objc: case LINK.c: m = mTYman_c; break; case LINK.d: m = mTYman_d; break; case LINK.cpp: s.Sflags |= SFLpublic; m = mTYman_cpp; break; case LINK.default_: case LINK.system: printf("linkage = %d, vd = %s %s @ [%s]\n", vd._linkage, vd.kind(), vd.toChars(), vd.loc.toChars()); assert(0); } type_setmangle(&t, m); s.Stype = t; s.lposscopestart = toSrcpos(vd.loc); s.lnoscopeend = vd.endlinnum; result = s; } override void visit(TypeInfoDeclaration tid) { //printf("TypeInfoDeclaration.toSymbol(%s), linkage = %d\n", tid.toChars(), tid.linkage); assert(tid.tinfo.ty != Terror); visit(tid.isVarDeclaration()); } override void visit(TypeInfoClassDeclaration ticd) { //printf("TypeInfoClassDeclaration.toSymbol(%s), linkage = %d\n", ticd.toChars(), ticd.linkage); ticd.tinfo.isTypeClass().sym.accept(this); } override void visit(FuncAliasDeclaration fad) { fad.funcalias.accept(this); } override void visit(FuncDeclaration fd) { const(char)* id = mangleExact(fd); //printf("FuncDeclaration.toSymbol(%s %s)\n", fd.kind(), fd.toChars()); //printf("\tid = '%s'\n", id); //printf("\ttype = %s\n", fd.type.toChars()); auto s = symbol_calloc(id[0 .. strlen(id)]); s.prettyIdent = fd.toPrettyChars(true); /* Make C static functions SCstatic */ s.Sclass = (fd.storage_class & STC.static_ && fd.isCsymbol()) ? SC.static_ : SC.global; symbol_func(s); func_t *f = s.Sfunc; if (fd.isVirtual() && fd.vtblIndex != -1) f.Fflags |= Fvirtual; else if (fd.isMember2() && fd.isStatic()) f.Fflags |= Fstatic; if (fd.isSafe()) f.Fflags3 |= F3safe; if (fd.inlining == PINLINE.default_ && global.params.useInline || fd.inlining == PINLINE.always) { // this is copied from inline.d if (!fd.fbody || fd.ident == Id.ensure || fd.skipCodegen || (fd.ident == Id.require && fd.toParent().isFuncDeclaration() && fd.toParent().isFuncDeclaration().needThis()) || (fd.isSynchronized() || fd.isImportedSymbol() || fd.hasNestedFrameRefs() || (fd.isVirtual() && !fd.isFinalFunc()))) { } else f.Fflags |= Finline; // inline this function if possible } if (fd.type.toBasetype().isTypeFunction().nextOf().isTypeNoreturn() || fd.noreturn) s.Sflags |= SFLexit; // the function never returns f.Fstartline = toSrcpos(fd.loc); f.Fendline = fd.endloc.linnum ? toSrcpos(fd.endloc) : f.Fstartline; auto t = Type_toCtype(fd.type); const msave = t.Tmangle; if (fd.isMain()) { t.Tty = TYnfunc; t.Tmangle = mTYman_c; f.Fflags3 |= Fmain; } else { final switch (fd.resolvedLinkage()) { case LINK.windows: t.Tmangle = target.is64bit ? mTYman_c : mTYman_std; break; case LINK.c: if (fd.adFlags & Declaration.nounderscore) s.Sflags |= SFLnounderscore; goto case; case LINK.objc: t.Tmangle = mTYman_c; break; case LINK.d: t.Tmangle = mTYman_d; break; case LINK.cpp: s.Sflags |= SFLpublic; /* Nested functions use the same calling convention as * member functions, because both can be used as delegates. */ if ((fd.isThis() || fd.isNested()) && !target.is64bit && target.os == Target.OS.Windows) { if ((cast(TypeFunction)fd.type).parameterList.varargs == VarArg.variadic) { t.Tty = TYnfunc; } else { t.Tty = TYmfunc; } } t.Tmangle = mTYman_cpp; break; case LINK.default_: case LINK.system: printf("linkage = %d\n", fd._linkage); assert(0); } } if (msave) assert(msave == t.Tmangle); //printf("Tty = %x, mangle = x%x\n", t.Tty, t.Tmangle); t.Tcount++; s.Stype = t; //s.Sfielddef = this; result = s; } static type* getClassInfoCType() { __gshared Symbol* scc; if (!scc) scc = fake_classsym(Id.ClassInfo); return scc.Stype; } /************************************* * Create the "ClassInfo" symbol */ override void visit(ClassDeclaration cd) { auto s = toSymbolX(cd, "__Class", SC.extern_, getClassInfoCType(), "Z"); s.Sfl = FLextern; s.Sflags |= SFLnodebug; result = s; } /************************************* * Create the "InterfaceInfo" symbol */ override void visit(InterfaceDeclaration id) { auto s = toSymbolX(id, "__Interface", SC.extern_, getClassInfoCType(), "Z"); s.Sfl = FLextern; s.Sflags |= SFLnodebug; result = s; } /************************************* * Create the "ModuleInfo" symbol */ override void visit(Module m) { auto s = toSymbolX(m, "__ModuleInfo", SC.extern_, getClassInfoCType(), "Z"); s.Sfl = FLextern; s.Sflags |= SFLnodebug; result = s; } } if (s.csym) return s.csym; scope ToSymbol v = new ToSymbol(); s.accept(v); s.csym = v.result; return v.result; } /************************************* * Create Windows import symbol from backend Symbol. * Params: * sym = backend symbol * loc = location for error message purposes * Returns: * import symbol */ private Symbol *createImport(Symbol *sym, Loc loc) { //printf("Dsymbol.createImport('%s')\n", sym.Sident.ptr); const char* n = sym.Sident.ptr; import core.stdc.stdlib : alloca; const allocLen = 6 + strlen(n) + 1 + type_paramsize(sym.Stype).sizeof*3 + 1; char *id = cast(char *) alloca(allocLen); int idlen; if (target.os & Target.OS.Posix) { error(loc, "could not generate import symbol for this platform"); fatal(); } else if (sym.Stype.Tmangle == mTYman_std && tyfunc(sym.Stype.Tty)) { if (target.os == Target.OS.Windows && target.is64bit) idlen = snprintf(id, allocLen, "__imp_%s",n); else idlen = snprintf(id, allocLen, "_imp__%s@%u",n,cast(uint)type_paramsize(sym.Stype)); } else { idlen = snprintf(id, allocLen, (target.os == Target.OS.Windows && target.is64bit) ? "__imp_%s" : (sym.Stype.Tmangle == mTYman_cpp) ? "_imp_%s" : "_imp__%s",n); } auto t = type_alloc(TYnptr | mTYconst); t.Tnext = sym.Stype; t.Tnext.Tcount++; t.Tmangle = mTYman_c; t.Tcount++; auto s = symbol_calloc(id[0 .. idlen]); s.Stype = t; s.Sclass = SC.extern_; s.Sfl = FLextern; return s; } /********************************* * Generate import symbol from symbol. */ Symbol *toImport(Declaration ds) { if (!ds.isym) { if (!ds.csym) ds.csym = toSymbol(ds); ds.isym = createImport(ds.csym, ds.loc); } return ds.isym; } /************************************* * Thunks adjust the incoming 'this' pointer by 'offset'. */ Symbol *toThunkSymbol(FuncDeclaration fd, int offset) { Symbol *s = toSymbol(fd); if (!offset) return s; if (retStyle(fd.type.isTypeFunction(), fd.needThis()) == RET.stack) s.Sfunc.Fflags3 |= F3hiddenPtr; s.Sfunc.Fflags &= ~Finline; // thunks are not real functions, don't inline them __gshared int tmpnum; const nameLen = 6 + tmpnum.sizeof * 3 + 1; char[nameLen] name = void; const len = snprintf(name.ptr,nameLen,"_THUNK%d",tmpnum++); auto sthunk = symbol_name(name[0 .. len],SC.static_,fd.csym.Stype); sthunk.Sflags |= SFLnodebug | SFLartifical; sthunk.Sflags |= SFLimplem; outthunk(sthunk, fd.csym, 0, TYnptr, -offset, -1, 0); return sthunk; } /************************************** * Fake a struct symbol. */ Classsym *fake_classsym(Identifier id) { auto t = type_struct_class(id.toChars(),8,0, null,null, false, false, true, false); t.Ttag.Sstruct.Sflags = STRglobal; t.Tflags |= TFsizeunknown | TFforward; assert(t.Tmangle == 0); t.Tmangle = mTYman_d; return t.Ttag; } /************************************* * This is accessible via the ClassData, but since it is frequently * needed directly (like for rtti comparisons), make it directly accessible. */ Symbol *toVtblSymbol(ClassDeclaration cd, bool genCsymbol = true) { if (!cd.vtblsym || !cd.vtblsym.csym) { if (!cd.csym && genCsymbol) toSymbol(cd); auto t = type_allocn(TYnptr | mTYconst, tstypes[TYvoid]); t.Tmangle = mTYman_d; auto s = toSymbolX(cd, "__vtbl", SC.extern_, t, "Z"); s.Sflags |= SFLnodebug; s.Sfl = FLextern; auto vtbl = cd.vtblSymbol(); vtbl.csym = s; } return cd.vtblsym.csym; } /********************************** * Create the static initializer for the struct/class. */ Symbol *toInitializer(AggregateDeclaration ad) { //printf("toInitializer() %s\n", ad.toChars()); if (!ad.sinit) { static structalign_t alignOf(Type t) { const explicitAlignment = t.alignment(); if (!explicitAlignment.isDefault()) // if overriding default alignment return explicitAlignment; // Use the default alignment for type t structalign_t sa; sa.set(t.alignsize()); return sa; } auto sd = ad.isStructDeclaration(); if (sd && alignOf(sd.type).get() <= 16 && sd.type.size() <= 128 && sd.zeroInit && config.objfmt != OBJ_MACH && // same reason as in toobj.d toObjFile() !(config.objfmt == OBJ_MSCOFF && !target.is64bit)) // -m32mscoff relocations are wrong { auto bzsave = bzeroSymbol; ad.sinit = getBzeroSymbol(); // Ensure emitted only once per object file if (bzsave && bzeroSymbol != bzsave) assert(0); } else { auto stag = fake_classsym(Id.ClassInfo); Symbol* s; Module m = ad.getModule(); if (m.filetype == FileType.c) { /* For ImportC structs, the module names are stripped from the mangled name. * This leads to name collisions. Add the module name back in. */ import dmd.common.outbuffer : OutBuffer; OutBuffer buf; buf.writestring("__init"); buf.writestring(m.toChars()); s = toSymbolX(ad, buf.peekChars(), SC.extern_, stag.Stype, "Z"); } else s = toSymbolX(ad, "__init", SC.extern_, stag.Stype, "Z"); s.Sfl = FLextern; s.Sflags |= SFLnodebug; if (sd) s.Salignment = sd.alignment.isDefault() ? -1 : sd.alignment.get(); ad.sinit = s; } } return cast(Symbol*)ad.sinit; } Symbol *toInitializer(EnumDeclaration ed) { if (!ed.sinit) { auto stag = fake_classsym(Id.ClassInfo); assert(ed.ident); auto s = toSymbolX(ed, "__init", SC.extern_, stag.Stype, "Z"); s.Sfl = FLextern; s.Sflags |= SFLnodebug; ed.sinit = s; } return ed.sinit; } /******************************************** * Determine the right symbol to look up * an associative array element. * Input: * flags 0 don't add value signature * 1 add value signature */ Symbol *aaGetSymbol(TypeAArray taa, const(char)* func, int flags) { assert((flags & ~1) == 0); // Dumb linear symbol table - should use associative array! __gshared Symbol*[] sarray; //printf("aaGetSymbol(func = '%s', flags = %d, key = %p)\n", func, flags, key); import core.stdc.stdlib : alloca; const allocLen = 3 + strlen(func) + 1; auto id = cast(char *)alloca(allocLen); const idlen = snprintf(id, allocLen, "_aa%s", func); // See if symbol is already in sarray foreach (s; sarray) { if (strcmp(id, s.Sident.ptr) == 0) { return s; // use existing Symbol } } // Create new Symbol auto s = symbol_calloc(id[0 .. idlen]); s.Sclass = SC.extern_; s.Ssymnum = SYMIDX.max; symbol_func(s); auto t = type_function(TYnfunc, null, false, Type_toCtype(taa.next)); t.Tmangle = mTYman_c; s.Stype = t; sarray ~= s; // remember it return s; } /*****************************************************/ /* CTFE stuff */ /*****************************************************/ Symbol* toSymbol(StructLiteralExp sle) { //printf("toSymbol() %p.sym: %p\n", sle, sle.sym); if (sle.sym) return sle.sym; auto t = type_alloc(TYint); t.Tcount++; auto s = symbol_calloc("internal"); s.Sclass = SC.static_; s.Sfl = FLextern; s.Sflags |= SFLnodebug; s.Stype = t; sle.sym = s; auto dtb = DtBuilder(0); Expression_toDt(sle, dtb); s.Sdt = dtb.finish(); outdata(s); return sle.sym; } Symbol* toSymbol(ClassReferenceExp cre) { //printf("toSymbol() %p.value.sym: %p\n", cre, cre.value.sym); if (cre.value.origin.sym) return cre.value.origin.sym; auto t = type_alloc(TYint); t.Tcount++; auto s = symbol_calloc("internal"); s.Sclass = SC.static_; s.Sfl = FLextern; s.Sflags |= SFLnodebug; s.Stype = t; cre.value.sym = s; cre.value.origin.sym = s; auto dtb = DtBuilder(0); ClassReferenceExp_toInstanceDt(cre, dtb); s.Sdt = dtb.finish(); outdata(s); return cre.value.sym; } /************************************** * For C++ class cd, generate an instance of __cpp_type_info_ptr * and populate it with a pointer to the C++ type info. * Params: * cd = C++ class * Returns: * symbol of instance of __cpp_type_info_ptr */ Symbol* toSymbolCpp(ClassDeclaration cd) { assert(cd.isCPPclass()); /* For the symbol std::exception, the type info is _ZTISt9exception */ if (!cd.cpp_type_info_ptr_sym) { __gshared Symbol *scpp; if (!scpp) scpp = fake_classsym(Id.cpp_type_info_ptr); Symbol *s = toSymbolX(cd, "_cpp_type_info_ptr", SC.comdat, scpp.Stype, ""); s.Sfl = FLdata; s.Sflags |= SFLnodebug; auto dtb = DtBuilder(0); cpp_type_info_ptr_toDt(cd, dtb); s.Sdt = dtb.finish(); outdata(s); cd.cpp_type_info_ptr_sym = s; } return cd.cpp_type_info_ptr_sym; } /********************************** * Generate Symbol of C++ type info for C++ class cd. * Params: * cd = C++ class * Returns: * Symbol of cd's rtti type info */ Symbol *toSymbolCppTypeInfo(ClassDeclaration cd) { const id = target.cpp.typeInfoMangle(cd); auto s = symbol_calloc(id[0 .. strlen(id)]); s.Sclass = SC.extern_; s.Sfl = FLextern; // C++ code will provide the definition s.Sflags |= SFLnodebug; auto t = type_fake(TYnptr); t.Tcount++; s.Stype = t; return s; } /********************************** * Converts a Loc to backend Srcpos * Params: * loc = Source code location * Returns: * Srcpos backend struct corresponding to the given location */ Srcpos toSrcpos(Loc loc) { return Srcpos.create(loc.filename, loc.linnum, loc.charnum); }
D
// Written in the D programming language /* Copyright (C) 2004-2011 Christopher E. Miller 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. socket.d 1.4 Jan 2011 Thanks to Benjamin Herr for his assistance. */ /** * Example: See $(SAMPLESRC listener.d) and $(SAMPLESRC htmlget.d) * License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. * Authors: Christopher E. Miller, $(WEB klickverbot.at, David Nadlinger), * $(WEB thecybershadow.net, Vladimir Panteleev) * Source: $(PHOBOSSRC std/_socket.d) * Macros: * WIKI=Phobos/StdSocket */ module std.socket; import core.stdc.stdint, std.string, std.c.string, std.c.stdlib, std.conv; import core.stdc.config; import core.time : dur, Duration; import std.algorithm : max; import std.exception : assumeUnique, enforce; version(Win32) { pragma (lib, "ws2_32.lib"); pragma (lib, "wsock32.lib"); private import std.c.windows.windows, std.c.windows.winsock, std.windows.syserror; private alias std.c.windows.winsock.timeval _ctimeval; private alias std.c.windows.winsock.linger _clinger; enum socket_t : SOCKET { INVALID_SOCKET }; private const int _SOCKET_ERROR = SOCKET_ERROR; private int _lasterr() { return WSAGetLastError(); } } else version(Posix) { version(linux) import std.c.linux.socket : AF_IPX, AF_APPLETALK, SOCK_RDM, IPPROTO_IGMP, IPPROTO_GGP, IPPROTO_PUP, IPPROTO_IDP, SD_RECEIVE, SD_SEND, SD_BOTH, MSG_NOSIGNAL, INADDR_NONE, TCP_KEEPIDLE, TCP_KEEPINTVL; else version(OSX) import std.c.osx.socket : AF_IPX, AF_APPLETALK, SOCK_RDM, IPPROTO_IGMP, IPPROTO_GGP, IPPROTO_PUP, IPPROTO_IDP, SD_RECEIVE, SD_SEND, SD_BOTH, INADDR_NONE; else version(FreeBSD) { import core.sys.posix.sys.socket; import core.sys.posix.sys.select; import std.c.freebsd.socket; private enum SD_RECEIVE = SHUT_RD; private enum SD_SEND = SHUT_WR; private enum SD_BOTH = SHUT_RDWR; } else static assert(false); import core.sys.posix.netdb; private import core.sys.posix.fcntl; private import core.sys.posix.unistd; private import core.sys.posix.arpa.inet; private import core.sys.posix.netinet.tcp; private import core.sys.posix.netinet.in_; private import core.sys.posix.sys.time; //private import core.sys.posix.sys.select; private import core.sys.posix.sys.socket; private alias core.sys.posix.sys.time.timeval _ctimeval; private alias core.sys.posix.sys.socket.linger _clinger; private import core.stdc.errno; enum socket_t : int32_t { init = -1 } private const int _SOCKET_ERROR = -1; private int _lasterr() { return errno; } } else { static assert(0); // No socket support yet. } version(unittest) { static assert(is(uint32_t == uint)); static assert(is(uint16_t == ushort)); private import std.stdio : writefln; // Print a message on exception instead of failing the unittest. private void softUnittest(void delegate() test, int line = __LINE__) { try test(); catch (Throwable e) { writefln(" --- std.socket(%d) test fails depending on environment ---", line); writefln(" (%s)", e); } } } /// Base exception thrown by $(D std.socket). class SocketException: Exception { /** * $(RED Scheduled for deprecation. Please use $(D SocketOSException) * instead.) * * Provided for compatibility with older code using $(D SocketException). */ @property int errorCode() const { auto osException = cast(SocketOSException)this; if (osException) return osException.errorCode; else return 0; } this(string msg) { super(msg); } } private string formatSocketError(int err) { version(Posix) { char[80] buf; const(char)* cs; version (linux) { cs = strerror_r(err, buf.ptr, buf.length); } else version (OSX) { auto errs = strerror_r(err, buf.ptr, buf.length); if (errs == 0) cs = buf.ptr; else return "Socket error " ~ to!string(err); } else version (FreeBSD) { auto errs = strerror_r(err, buf.ptr, buf.length); if (errs == 0) cs = buf.ptr; else return "Socket error " ~ to!string(err); } else static assert(0); auto len = strlen(cs); if(cs[len - 1] == '\n') len--; if(cs[len - 1] == '\r') len--; return cs[0 .. len].idup; } else version(Windows) { return sysErrorString(err); } else return "Socket error " ~ to!string(err); } /// Retrieve the error message for the most recently encountered network error. @property string lastSocketError() { return formatSocketError(_lasterr()); } /// Socket exceptions representing network errors reported by the operating /// system. class SocketOSException: SocketException { int errorCode; /// Platform-specific error code. this(string msg, int err = _lasterr(), string function(int) errorFormatter = &formatSocketError) { errorCode = err; if (msg.length) super(msg ~ ": " ~ errorFormatter(err)); else super(errorFormatter(err)); } } /// Socket exceptions representing invalid parameters specified by user code. class SocketParameterException: SocketException { this(string msg) { super(msg); } } /// Socket exceptions representing attempts to use network capabilities not /// available on the current system. class SocketFeatureException: SocketException { this(string msg) { super(msg); } } /// Return $(D true) if the last socket operation failed because the socket /// was in non-blocking mode and the operation would have blocked. bool wouldHaveBlocked() { version(Win32) return _lasterr() == WSAEWOULDBLOCK; else version(Posix) return _lasterr() == EAGAIN; else static assert(0); } private __gshared typeof(&getnameinfo) getnameinfoPointer; private __gshared typeof(&getaddrinfo) getaddrinfoPointer; private __gshared typeof(&freeaddrinfo) freeaddrinfoPointer; shared static this() { version(Win32) { WSADATA wd; // Winsock will still load if an older version is present. // The version is just a request. int val; val = WSAStartup(0x2020, &wd); if(val) // Request Winsock 2.2 for IPv6. throw new SocketOSException("Unable to initialize socket library", val); // These functions may not be present on older Windows versions. // See the comment in InternetAddress.toHostNameString() for details. auto ws2Lib = GetModuleHandleA("ws2_32.dll"); if (ws2Lib) { getnameinfoPointer = cast(typeof(getnameinfoPointer)) GetProcAddress(ws2Lib, "getnameinfo"); getaddrinfoPointer = cast(typeof(getaddrinfoPointer)) GetProcAddress(ws2Lib, "getaddrinfo"); freeaddrinfoPointer = cast(typeof(freeaddrinfoPointer)) GetProcAddress(ws2Lib, "freeaddrinfo"); } } else version(Posix) { getnameinfoPointer = &getnameinfo; getaddrinfoPointer = &getaddrinfo; freeaddrinfoPointer = &freeaddrinfo; } } shared static ~this() { version(Win32) { WSACleanup(); } } /** * The communication domain used to resolve an address. */ enum AddressFamily: int { UNSPEC = AF_UNSPEC, /// Unspecified address family UNIX = AF_UNIX, /// Local communication INET = AF_INET, /// Internet Protocol version 4 IPX = AF_IPX, /// Novell IPX APPLETALK = AF_APPLETALK, /// AppleTalk INET6 = AF_INET6, /// Internet Protocol version 6 } /** * Communication semantics */ enum SocketType: int { STREAM = SOCK_STREAM, /// Sequenced, reliable, two-way communication-based byte streams DGRAM = SOCK_DGRAM, /// Connectionless, unreliable datagrams with a fixed maximum length; data may be lost or arrive out of order RAW = SOCK_RAW, /// Raw protocol access RDM = SOCK_RDM, /// Reliably-delivered message datagrams SEQPACKET = SOCK_SEQPACKET, /// Sequenced, reliable, two-way connection-based datagrams with a fixed maximum length } /** * Protocol */ enum ProtocolType: int { IP = IPPROTO_IP, /// Internet Protocol version 4 ICMP = IPPROTO_ICMP, /// Internet Control Message Protocol IGMP = IPPROTO_IGMP, /// Internet Group Management Protocol GGP = IPPROTO_GGP, /// Gateway to Gateway Protocol TCP = IPPROTO_TCP, /// Transmission Control Protocol PUP = IPPROTO_PUP, /// PARC Universal Packet Protocol UDP = IPPROTO_UDP, /// User Datagram Protocol IDP = IPPROTO_IDP, /// Xerox NS protocol RAW = IPPROTO_RAW, /// Raw IP packets IPV6 = IPPROTO_IPV6, /// Internet Protocol version 6 } /** * $(D Protocol) is a class for retrieving protocol information. * * Example: * --- * auto proto = new Protocol; * writeln("About protocol TCP:"); * if (proto.getProtocolByType(ProtocolType.TCP)) * { * writefln(" Name: %s", proto.name); * foreach(string s; proto.aliases) * writefln(" Alias: %s", s); * } * else * writeln(" No information found"); * --- */ class Protocol { /// These members are populated when one of the following functions are called successfully: ProtocolType type; string name; /// ditto string[] aliases; /// ditto void populate(protoent* proto) { type = cast(ProtocolType)proto.p_proto; name = to!string(proto.p_name); int i; for(i = 0;; i++) { if(!proto.p_aliases[i]) break; } if(i) { aliases = new string[i]; for(i = 0; i != aliases.length; i++) { aliases[i] = to!string(proto.p_aliases[i]); } } else { aliases = null; } } /** Returns: false on failure */ bool getProtocolByName(in char[] name) { protoent* proto; proto = getprotobyname(toStringz(name)); if(!proto) return false; populate(proto); return true; } /** Returns: false on failure */ // Same as getprotobynumber(). bool getProtocolByType(ProtocolType type) { protoent* proto; proto = getprotobynumber(type); if(!proto) return false; populate(proto); return true; } } unittest { softUnittest({ Protocol proto = new Protocol; assert(proto.getProtocolByType(ProtocolType.TCP)); //writeln("About protocol TCP:"); //writefln("\tName: %s", proto.name); // foreach(string s; proto.aliases) // { // writefln("\tAlias: %s", s); // } assert(proto.name == "tcp"); assert(proto.aliases.length == 1 && proto.aliases[0] == "TCP"); }); } /** * $(D Service) is a class for retrieving service information. * * Example: * --- * auto serv = new Service; * writeln("About service epmap:"); * if (serv.getServiceByName("epmap", "tcp")) * { * writefln(" Service: %s", serv.name); * writefln(" Port: %d", serv.port); * writefln(" Protocol: %s", serv.protocolName); * foreach (string s; serv.aliases) * writefln(" Alias: %s", s); * } * else * writefln(" No service for epmap."); * --- */ class Service { /// These members are populated when one of the following functions are called successfully: string name; string[] aliases; /// ditto ushort port; /// ditto string protocolName; /// ditto void populate(servent* serv) { name = to!string(serv.s_name); port = ntohs(cast(ushort)serv.s_port); protocolName = to!string(serv.s_proto); int i; for(i = 0;; i++) { if(!serv.s_aliases[i]) break; } if(i) { aliases = new string[i]; for(i = 0; i != aliases.length; i++) { aliases[i] = to!string(serv.s_aliases[i]); } } else { aliases = null; } } /** * If a protocol name is omitted, any protocol will be matched. * Returns: false on failure. */ bool getServiceByName(in char[] name, in char[] protocolName = null) { servent* serv; serv = getservbyname(toStringz(name), protocolName !is null ? toStringz(protocolName) : null); if(!serv) return false; populate(serv); return true; } /// ditto bool getServiceByPort(ushort port, in char[] protocolName = null) { servent* serv; serv = getservbyport(port, protocolName !is null ? toStringz(protocolName) : null); if(!serv) return false; populate(serv); return true; } } unittest { softUnittest({ Service serv = new Service; if(serv.getServiceByName("epmap", "tcp")) { // writefln("About service epmap:"); // writefln("\tService: %s", serv.name); // writefln("\tPort: %d", serv.port); // writefln("\tProtocol: %s", serv.protocolName); // foreach(string s; serv.aliases) // { // writefln("\tAlias: %s", s); // } // For reasons unknown this is loc-srv on Wine and epmap on Windows assert(serv.name == "loc-srv" || serv.name == "epmap", serv.name); assert(serv.port == 135); assert(serv.protocolName == "tcp"); } else { writefln("No service for epmap."); } }); } /** * Class for exceptions thrown from an $(D InternetHost). */ class HostException: SocketOSException { this(string msg, int err = _lasterr()) { super(msg, err); } } /** * $(D InternetHost) is a class for resolving IPv4 addresses. * * Consider using $(D getAddress), $(D parseAddress) and $(D Address) methods * instead of using this class directly. * * Example: * --- * auto ih = new InternetHost; * * // Forward lookup * writeln("About www.digitalmars.com:"); * if (ih.getHostByName("www.digitalmars.com")) * { * writefln(" Name: %s", ih.name); * auto ip = InternetAddress.addrToString(ih.addrList[0]); * writefln(" IP address: %s", ip); * foreach (string s; ih.aliases) * writefln(" Alias: %s", s); * writeln("---"); * * // Reverse lookup * writefln("About IP %s:", ip); * if (ih.getHostByAddr(ih.addrList[0])) * { * writefln(" Name: %s", ih.name); * foreach (string s; ih.aliases) * writefln(" Alias: %s", s); * } * else * writeln(" Reverse lookup failed"); * } * else * writeln(" Can't resolve www.digitalmars.com"); * --- */ class InternetHost { /// These members are populated when one of the following functions are called successfully: string name; string[] aliases; /// ditto uint[] addrList; /// ditto void validHostent(hostent* he) { if(he.h_addrtype != cast(int)AddressFamily.INET || he.h_length != 4) throw new HostException("Address family mismatch"); } void populate(hostent* he) { int i; char* p; name = to!string(he.h_name); for(i = 0;; i++) { p = he.h_aliases[i]; if(!p) break; } if(i) { aliases = new string[i]; for(i = 0; i != aliases.length; i++) { aliases[i] = to!string(he.h_aliases[i]); } } else { aliases = null; } for(i = 0;; i++) { p = he.h_addr_list[i]; if(!p) break; } if(i) { addrList = new uint[i]; for(i = 0; i != addrList.length; i++) { addrList[i] = ntohl(*(cast(uint*)he.h_addr_list[i])); } } else { addrList = null; } } private bool getHostNoSync(string opMixin, T)(T param) { mixin(opMixin); if (!he) return false; validHostent(he); populate(he); return true; } version(Windows) alias getHostNoSync getHost; else { // posix systems use global state for return value, so we // must synchronize across all threads private bool getHost(string opMixin, T)(T param) { synchronized(this.classinfo) return getHostNoSync!(opMixin, T)(param); } } /** * Resolve host name. * Returns: false if unable to resolve. */ bool getHostByName(in char[] name) { static if (is(typeof(gethostbyname_r))) { return getHostNoSync!q{ hostent he_v; hostent* he; ubyte[256] buffer_v = void; auto buffer = buffer_v[]; auto param_z = std.string.toStringz(param); while (true) { he = &he_v; int errno; if (gethostbyname_r(param_z, he, buffer.ptr, buffer.length, &he, &errno) == ERANGE) buffer.length = buffer.length * 2; else break; } }(name); } else { return getHost!q{ auto he = gethostbyname(toStringz(param)); }(name); } } /** * Resolve IPv4 address number. * * Params: * addr = The IPv4 address to resolve, in host byte order. * Returns: * false if unable to resolve. */ bool getHostByAddr(uint addr) { return getHost!q{ auto x = htonl(param); auto he = gethostbyaddr(&x, 4, cast(int)AddressFamily.INET); }(addr); } /** * Same as previous, but addr is an IPv4 address string in the * dotted-decimal form $(I a.b.c.d). * Returns: false if unable to resolve. */ bool getHostByAddr(in char[] addr) { return getHost!q{ auto x = inet_addr(std.string.toStringz(param)); enforce(x != INADDR_NONE, new SocketParameterException("Invalid IPv4 address")); auto he = gethostbyaddr(&x, 4, cast(int)AddressFamily.INET); }(addr); } } unittest { InternetHost ih = new InternetHost; ih.getHostByAddr(0x7F_00_00_01); assert(ih.addrList[0] == 0x7F_00_00_01); ih.getHostByAddr("127.0.0.1"); assert(ih.addrList[0] == 0x7F_00_00_01); softUnittest({ if (!ih.getHostByName("www.digitalmars.com")) return; // don't fail if not connected to internet //writefln("addrList.length = %d", ih.addrList.length); assert(ih.addrList.length); InternetAddress ia = new InternetAddress(ih.addrList[0], InternetAddress.PORT_ANY); assert(ih.name == "www.digitalmars.com" || ih.name == "digitalmars.com", ih.name); // writefln("IP address = %s", ia.toAddrString()); // writefln("name = %s", ih.name); // foreach(int i, string s; ih.aliases) // { // writefln("aliases[%d] = %s", i, s); // } // writefln("---"); //assert(ih.getHostByAddr(ih.addrList[0])); // writefln("name = %s", ih.name); // foreach(int i, string s; ih.aliases) // { // writefln("aliases[%d] = %s", i, s); // } }); } /// Holds information about a socket _address retrieved by $(D getAddressInfo). struct AddressInfo { AddressFamily family; /// Address _family SocketType type; /// Socket _type ProtocolType protocol; /// Protocol Address address; /// Socket _address string canonicalName; /// Canonical name, when $(D AddressInfoFlags.CANONNAME) is used. } // A subset of flags supported on all platforms with getaddrinfo. /// Specifies option flags for $(D getAddressInfo). enum AddressInfoFlags: int { /// The resulting addresses will be used in a call to $(D Socket.bind). PASSIVE = AI_PASSIVE, /// The canonical name is returned in $(D canonicalName) member in the first $(D AddressInfo). CANONNAME = AI_CANONNAME, /// The $(D node) parameter passed to $(D getAddressInfo) must be a numeric string. /// This will suppress any potentially lengthy network host address lookups. NUMERICHOST = AI_NUMERICHOST, } /// On POSIX, getaddrinfo uses its own error codes, and thus has its own /// formatting function. private string formatGaiError(int err) { version(Windows) { return sysErrorString(err); } else { synchronized return to!string(gai_strerror(err)); } } /** * Provides _protocol-independent translation from host names to socket * addresses. If advanced functionality is not required, consider using * $(D getAddress) for compatibility with older systems. * * Returns: Array with one $(D AddressInfo) per socket address. * * Throws: $(D SocketOSException) on failure, or $(D SocketFeatureException) * if this functionality is not available on the current system. * * Params: * node = string containing host name or numeric address * options = optional additional parameters, identified by type: * $(UL $(LI $(D string) - service name or port number) * $(LI $(D AddressInfoFlags) - option flags) * $(LI $(D AddressFamily) - address family to filter by) * $(LI $(D SocketType) - socket type to filter by) * $(LI $(D ProtocolType) - protocol to filter by)) * * Example: * --- * // Roundtrip DNS resolution * auto results = getAddressInfo("www.digitalmars.com"); * assert(results[0].address.toHostNameString() == * "digitalmars.com"); * * // Canonical name * results = getAddressInfo("www.digitalmars.com", * AddressInfoFlags.CANONNAME); * assert(results[0].canonicalName == "digitalmars.com"); * * // IPv6 resolution * results = getAddressInfo("ipv6.google.com"); * assert(results[0].family == AddressFamily.INET6); * * // Multihomed resolution * results = getAddressInfo("google.com"); * assert(results.length > 1); * * // Parsing IPv4 * results = getAddressInfo("127.0.0.1", * AddressInfoFlags.NUMERICHOST); * assert(results.length && results[0].family == * AddressFamily.INET); * * // Parsing IPv6 * results = getAddressInfo("::1", * AddressInfoFlags.NUMERICHOST); * assert(results.length && results[0].family == * AddressFamily.INET6); * --- */ AddressInfo[] getAddressInfo(T...)(in char[] node, T options) { const(char)[] service = null; addrinfo hints; hints.ai_family = AF_UNSPEC; foreach (option; options) { static if (is(typeof(option) : const(char)[])) service = option; else static if (is(typeof(option) == AddressInfoFlags)) hints.ai_flags |= option; else static if (is(typeof(option) == AddressFamily)) hints.ai_family = option; else static if (is(typeof(option) == SocketType)) hints.ai_socktype = option; else static if (is(typeof(option) == ProtocolType)) hints.ai_protocol = option; else static assert(0, "Unknown getAddressInfo option type: " ~ typeof(option).stringof); } return getAddressInfoImpl(node, service, &hints); } private AddressInfo[] getAddressInfoImpl(in char[] node, in char[] service, addrinfo* hints) { if (getaddrinfoPointer && freeaddrinfoPointer) { addrinfo* ai_res; int ret = getaddrinfoPointer( node is null ? null : std.string.toStringz(node), service is null ? null : std.string.toStringz(service), hints, &ai_res); scope(exit) if (ai_res) freeaddrinfoPointer(ai_res); enforce(ret == 0, new SocketOSException("getaddrinfo error", ret, &formatGaiError)); AddressInfo[] result; // Use const to force UnknownAddressReference to copy the sockaddr. for (const(addrinfo)* ai = ai_res; ai; ai = ai.ai_next) result ~= AddressInfo( cast(AddressFamily) ai.ai_family, cast(SocketType ) ai.ai_socktype, cast(ProtocolType ) ai.ai_protocol, new UnknownAddressReference(ai.ai_addr, ai.ai_addrlen), ai.ai_canonname ? to!string(ai.ai_canonname) : null); assert(result.length > 0); return result; } throw new SocketFeatureException("Address info lookup is not available " ~ "on this system."); } unittest { softUnittest({ if (getaddrinfoPointer) { // Roundtrip DNS resolution auto results = getAddressInfo("www.digitalmars.com"); assert(results[0].address.toHostNameString() == "digitalmars.com"); // Canonical name results = getAddressInfo("www.digitalmars.com", AddressInfoFlags.CANONNAME); assert(results[0].canonicalName == "digitalmars.com"); // IPv6 resolution //results = getAddressInfo("ipv6.google.com"); //assert(results[0].family == AddressFamily.INET6); // Multihomed resolution //results = getAddressInfo("google.com"); //assert(results.length > 1); // Parsing IPv4 results = getAddressInfo("127.0.0.1", AddressInfoFlags.NUMERICHOST); assert(results.length && results[0].family == AddressFamily.INET); // Parsing IPv6 results = getAddressInfo("::1", AddressInfoFlags.NUMERICHOST); assert(results.length && results[0].family == AddressFamily.INET6); } }); } private ushort serviceToPort(in char[] service) { if (service == "") return InternetAddress.PORT_ANY; else if (isNumeric(service)) return to!ushort(service); else { auto s = new Service(); s.getServiceByName(service); return s.port; } } /** * Provides _protocol-independent translation from host names to socket * addresses. Uses $(D getAddressInfo) if the current system supports it, * and $(D InternetHost) otherwise. * * Returns: Array with one $(D Address) instance per socket address. * * Throws: $(D SocketOSException) on failure. * * Example: * --- * writeln("Resolving www.digitalmars.com:"); * try * { * auto addresses = getAddress("www.digitalmars.com"); * foreach (address; addresses) * writefln(" IP: %s", address.toAddrString()); * } * catch (SocketException e) * writefln(" Lookup failed: %s", e.msg); * --- */ Address[] getAddress(in char[] hostname, in char[] service = null) { if (getaddrinfoPointer && freeaddrinfoPointer) { // use getAddressInfo Address[] results; auto infos = getAddressInfo(hostname, service); foreach (ref info; infos) results ~= info.address; return results; } else return getAddress(hostname, serviceToPort(service)); } /// ditto Address[] getAddress(in char[] hostname, ushort port) { if (getaddrinfoPointer && freeaddrinfoPointer) return getAddress(hostname, to!string(port)); else { // use getHostByName auto ih = new InternetHost; if (!ih.getHostByName(hostname)) throw new AddressException( "Unable to resolve host '" ~ assumeUnique(hostname) ~ "'"); Address[] results; foreach (uint addr; ih.addrList) results ~= new InternetAddress(addr, port); return results; } } unittest { softUnittest({ auto addresses = getAddress("63.105.9.61"); assert(addresses.length && addresses[0].toAddrString() == "63.105.9.61"); if (getaddrinfoPointer) { // test via gethostbyname auto getaddrinfoPointerBackup = getaddrinfoPointer; getaddrinfoPointer = null; scope(exit) getaddrinfoPointer = getaddrinfoPointerBackup; addresses = getAddress("63.105.9.61"); assert(addresses.length && addresses[0].toAddrString() == "63.105.9.61"); } }); } /** * Provides _protocol-independent parsing of network addresses. Does not * attempt name resolution. Uses $(D getAddressInfo) with * $(D AddressInfoFlags.NUMERICHOST) if the current system supports it, and * $(D InternetAddress) otherwise. * * Returns: An $(D Address) instance representing specified address. * * Throws: $(D SocketException) on failure. * * Example: * --- * writeln("Looking up reverse of 8.8.8.8:"); * try * { * auto address = parseAddress("8.8.8.8"); * writefln(" Reverse name: %s", * address.toHostNameString()); * } * catch (SocketException e) * writefln(" Lookup failed: %s", e.msg); * --- */ Address parseAddress(in char[] hostaddr, in char[] service = null) { if (getaddrinfoPointer && freeaddrinfoPointer) return getAddressInfo(hostaddr, service, AddressInfoFlags.NUMERICHOST)[0].address; else return parseAddress(hostaddr, serviceToPort(service)); } /// ditto Address parseAddress(in char[] hostaddr, ushort port) { if (getaddrinfoPointer && freeaddrinfoPointer) return parseAddress(hostaddr, to!string(port)); else { auto in4_addr = InternetAddress.parse(hostaddr); enforce(in4_addr != InternetAddress.ADDR_NONE, new SocketParameterException("Invalid IP address")); return new InternetAddress(in4_addr, port); } } unittest { softUnittest({ auto address = parseAddress("63.105.9.61"); assert(address.toAddrString() == "63.105.9.61"); if (getaddrinfoPointer) { // test via inet_addr auto getaddrinfoPointerBackup = getaddrinfoPointer; getaddrinfoPointer = null; scope(exit) getaddrinfoPointer = getaddrinfoPointerBackup; address = parseAddress("63.105.9.61"); assert(address.toAddrString() == "63.105.9.61"); } }); } /** * Class for exceptions thrown from an $(D Address). */ class AddressException: SocketOSException { this(string msg, int err = _lasterr()) { super(msg, err); } } /** * $(D Address) is an abstract class for representing a socket addresses. * * Example: * --- * writeln("About www.google.com port 80:"); * try * { * Address[] addresses = getAddress("www.google.com", 80); * writefln(" %d addresses found.", addresses.length); * foreach (int i, Address a; addresses) * { * writefln(" Address %d:", i+1); * writefln(" IP address: %s", a.toAddrString()); * writefln(" Hostname: %s", a.toHostNameString()); * writefln(" Port: %s", a.toPortString()); * writefln(" Service name: %s", * a.toServiceNameString()); * } * } * catch (SocketException e) * writefln(" Lookup error: %s", e.msg); * --- */ abstract class Address { /// Returns pointer to underlying $(D sockaddr) structure. sockaddr* name(); const(sockaddr)* name() const; /// ditto /// Returns actual size of underlying $(D sockaddr) structure. socklen_t nameLen() const; /// Family of this address. AddressFamily addressFamily() const { return cast(AddressFamily) name().sa_family; } // Common code for toAddrString and toHostNameString private final string toHostString(bool numeric) const { // getnameinfo() is the recommended way to perform a reverse (name) // lookup on both Posix and Windows. However, it is only available // on Windows XP and above, and not included with the WinSock import // libraries shipped with DMD. Thus, we check for getnameinfo at // runtime in the shared module constructor, and use it if it's // available in the base class method. Classes for specific network // families (e.g. InternetHost) override this method and use a // deprecated, albeit commonly-available method when getnameinfo() // is not available. // http://technet.microsoft.com/en-us/library/aa450403.aspx if (getnameinfoPointer) { auto buf = new char[NI_MAXHOST]; auto ret = getnameinfoPointer( name(), nameLen(), buf.ptr, cast(uint)buf.length, null, 0, numeric ? NI_NUMERICHOST : NI_NAMEREQD); if (!numeric) { if (ret==EAI_NONAME) return null; version(Windows) if (ret==WSANO_DATA) return null; } enforce(ret == 0, new AddressException("Could not get " ~ (numeric ? "host address" : "host name"))); return assumeUnique(buf[0 .. strlen(buf.ptr)]); } throw new SocketFeatureException((numeric ? "Host address" : "Host name") ~ " lookup for this address family is not available on this system."); } // Common code for toPortString and toServiceNameString private final string toServiceString(bool numeric) const { // See toHostNameString() for details about getnameinfo(). if (getnameinfoPointer) { auto buf = new char[NI_MAXSERV]; enforce(getnameinfoPointer( name(), nameLen(), null, 0, buf.ptr, cast(uint)buf.length, numeric ? NI_NUMERICSERV : NI_NAMEREQD ) == 0, new AddressException("Could not get " ~ (numeric ? "port number" : "service name"))); return assumeUnique(buf[0 .. strlen(buf.ptr)]); } throw new SocketFeatureException((numeric ? "Port number" : "Service name") ~ " lookup for this address family is not available on this system."); } /** * Attempts to retrieve the host address as a human-readable string. * * Throws: $(D AddressException) on failure, or $(D SocketFeatureException) * if address retrieval for this address family is not available on the * current system. */ string toAddrString() const { return toHostString(true); } /** * Attempts to retrieve the host name as a fully qualified domain name. * * Returns: The FQDN corresponding to this $(D Address), or $(D null) if * the host name did not resolve. * * Throws: $(D AddressException) on error, or $(D SocketFeatureException) * if host name lookup for this address family is not available on the * current system. */ string toHostNameString() const { return toHostString(false); } /** * Attempts to retrieve the numeric port number as a string. * * Throws: $(D AddressException) on failure, or $(D SocketFeatureException) * if port number retrieval for this address family is not available on the * current system. */ string toPortString() const { return toServiceString(true); } /** * Attempts to retrieve the service name as a string. * * Throws: $(D AddressException) on failure, or $(D SocketFeatureException) * if service name lookup for this address family is not available on the * current system. */ string toServiceNameString() const { return toServiceString(false); } /// Human readable string representing this address. override string toString() const { try { string host = toAddrString(); string port = toPortString(); if (host.indexOf(':') >= 0) return "[" ~ host ~ "]:" ~ port; else return host ~ ":" ~ port; } catch (SocketException) return "Unknown"; } } /** * $(D UnknownAddress) encapsulates an unknown socket address. */ class UnknownAddress: Address { protected: sockaddr sa; public: override sockaddr* name() { return &sa; } override const(sockaddr)* name() const { return &sa; } override socklen_t nameLen() const { return cast(socklen_t) sa.sizeof; } } /** * $(D UnknownAddressReference) encapsulates a reference to an arbitrary * socket address. */ class UnknownAddressReference: Address { protected: sockaddr* sa; socklen_t len; public: /// Constructs an $(D Address) with a reference to the specified $(D sockaddr). this(sockaddr* sa, socklen_t len) { this.sa = sa; this.len = len; } /// Constructs an $(D Address) with a copy of the specified $(D sockaddr). this(const(sockaddr)* sa, socklen_t len) { this.sa = cast(sockaddr*) (cast(ubyte*)sa)[0..len].dup.ptr; this.len = len; } override sockaddr* name() { return sa; } override const(sockaddr)* name() const { return sa; } override socklen_t nameLen() const { return cast(socklen_t) len; } } /** * $(D InternetAddress) encapsulates an IPv4 (Internet Protocol version 4) * socket address. * * Consider using $(D getAddress), $(D parseAddress) and $(D Address) methods * instead of using this class directly. */ class InternetAddress: Address { protected: sockaddr_in sin; this() { } public: override sockaddr* name() { return cast(sockaddr*)&sin; } override const(sockaddr)* name() const { return cast(const(sockaddr)*)&sin; } override socklen_t nameLen() const { return cast(socklen_t) sin.sizeof; } enum uint ADDR_ANY = INADDR_ANY; /// Any IPv4 host address. enum uint ADDR_NONE = INADDR_NONE; /// An invalid IPv4 host address. enum ushort PORT_ANY = 0; /// Any IPv4 port number. /// Returns the IPv4 _port number (in host byte order). ushort port() const { return ntohs(sin.sin_port); } /// Returns the IPv4 address number (in host byte order). uint addr() const { return ntohl(sin.sin_addr.s_addr); } /** * Construct a new $(D InternetAddress). * Params: * addr = an IPv4 address string in the dotted-decimal form a.b.c.d, * or a host name which will be resolved using an $(D InternetHost) * object. * port = port number, may be $(D PORT_ANY). */ this(in char[] addr, ushort port) { uint uiaddr = parse(addr); if(ADDR_NONE == uiaddr) { InternetHost ih = new InternetHost; if(!ih.getHostByName(addr)) //throw new AddressException("Invalid internet address"); throw new AddressException( "Unable to resolve host '" ~ assumeUnique(addr) ~ "'"); uiaddr = ih.addrList[0]; } sin.sin_family = AddressFamily.INET; sin.sin_addr.s_addr = htonl(uiaddr); sin.sin_port = htons(port); } /** * Construct a new $(D InternetAddress). * Params: * addr = (optional) an IPv4 address in host byte order, may be $(D ADDR_ANY). * port = port number, may be $(D PORT_ANY). */ this(uint addr, ushort port) { sin.sin_family = AddressFamily.INET; sin.sin_addr.s_addr = htonl(addr); sin.sin_port = htons(port); } /// ditto this(ushort port) { sin.sin_family = AddressFamily.INET; sin.sin_addr.s_addr = ADDR_ANY; sin.sin_port = htons(port); } /// Human readable string representing the IPv4 address in dotted-decimal form. override string toAddrString() const { return to!string(inet_ntoa(sin.sin_addr)); } /// Human readable string representing the IPv4 port. override string toPortString() const { return std.conv.to!string(port()); } /** * Attempts to retrieve the host name as a fully qualified domain name. * * Returns: The FQDN corresponding to this $(D InternetAddress), or * $(D null) if the host name did not resolve. * * Throws: $(D AddressException) on error. */ override string toHostNameString() const { // getnameinfo() is the recommended way to perform a reverse (name) // lookup on both Posix and Windows. However, it is only available // on Windows XP and above, and not included with the WinSock import // libraries shipped with DMD. Thus, we check for getnameinfo at // runtime in the shared module constructor, and fall back to the // deprecated getHostByAddr() if it could not be found. See also: // http://technet.microsoft.com/en-us/library/aa450403.aspx if (getnameinfoPointer) return super.toHostNameString(); else { auto host = new InternetHost(); if (!host.getHostByAddr(ntohl(sin.sin_addr.s_addr))) return null; return host.name; } } /** * Parse an IPv4 address string in the dotted-decimal form $(I a.b.c.d) * and return the number. * Returns: If the string is not a legitimate IPv4 address, * $(D ADDR_NONE) is returned. */ static uint parse(in char[] addr) { return ntohl(inet_addr(std.string.toStringz(addr))); } /** * Convert an IPv4 address number in host byte order to a human readable * string representing the IPv4 address in dotted-decimal form. */ static string addrToString(uint addr) { in_addr sin_addr; sin_addr.s_addr = htonl(addr); return to!string(inet_ntoa(sin_addr)); } } unittest { softUnittest({ const InternetAddress ia = new InternetAddress("63.105.9.61", 80); assert(ia.toString() == "63.105.9.61:80"); }); softUnittest({ // test reverse lookup auto ih = new InternetHost; if (ih.getHostByName("digitalmars.com")) { const ia = new InternetAddress(ih.addrList[0], 80); assert(ia.toHostNameString() == "digitalmars.com"); if (getnameinfoPointer) { // test reverse lookup, via gethostbyaddr auto getnameinfoPointerBackup = getnameinfoPointer; getnameinfoPointer = null; scope(exit) getnameinfoPointer = getnameinfoPointerBackup; assert(ia.toHostNameString() == "digitalmars.com"); } } }); version (SlowTests) softUnittest({ // test failing reverse lookup const InternetAddress ia = new InternetAddress("127.114.111.120", 80); assert(ia.toHostNameString() is null); if (getnameinfoPointer) { // test failing reverse lookup, via gethostbyaddr auto getnameinfoPointerBackup = getnameinfoPointer; getnameinfoPointer = null; scope(exit) getnameinfoPointer = getnameinfoPointerBackup; assert(ia.toHostNameString() is null); } }); } /** * $(D Internet6Address) encapsulates an IPv6 (Internet Protocol version 6) * socket address. * * Consider using $(D getAddress), $(D parseAddress) and $(D Address) methods * instead of using this class directly. */ class Internet6Address: Address { protected: sockaddr_in6 sin6; this() { } public: override sockaddr* name() { return cast(sockaddr*)&sin6; } override const(sockaddr)* name() const { return cast(const(sockaddr)*)&sin6; } override socklen_t nameLen() const { return cast(socklen_t) sin6.sizeof; } /// Any IPv6 host address. static @property ref const(ubyte)[16] ADDR_ANY() { const(ubyte)[16]* addr; static if (is(typeof(IN6ADDR_ANY))) return addr = &IN6ADDR_ANY.s6_addr, *addr; else static if (is(typeof(in6addr_any))) return addr = &in6addr_any.s6_addr, *addr; else static assert(0); } /// Any IPv6 port number. enum ushort PORT_ANY = 0; /// Returns the IPv6 port number. ushort port() const { return ntohs(sin6.sin6_port); } /// Returns the IPv6 address. ubyte[16] addr() const { return sin6.sin6_addr.s6_addr; } /** * Construct a new $(D Internet6Address). * Params: * node = an IPv6 host address string in the form described in RFC 2373, * or a host name which will be resolved using $(D getAddressInfo). * port = (optional) service name or port number. */ this(in char[] node, in char[] service = null) { auto results = getAddressInfo(node, service, AddressFamily.INET6); assert(results.length && results[0].family == AddressFamily.INET6); sin6 = *cast(sockaddr_in6*)results[0].address.name(); } /** * Construct a new $(D Internet6Address). * Params: * addr = an IPv6 host address string in the form described in RFC 2373, * or a host name which will be resolved using $(D getAddressInfo). * port = port number, may be $(D PORT_ANY). */ this(in char[] node, ushort port) { if (port == PORT_ANY) this(node); else this(node, to!string(port)); } /** * Construct a new $(D Internet6Address). * Params: * addr = (optional) an IPv6 host address in host byte order, or $(D ADDR_ANY). * port = port number, may be $(D PORT_ANY). */ this(ubyte[16] addr, ushort port) { sin6.sin6_family = AddressFamily.INET6; sin6.sin6_addr.s6_addr = addr; sin6.sin6_port = htons(port); } /// ditto this(ushort port) { sin6.sin6_family = AddressFamily.INET6; sin6.sin6_addr.s6_addr = ADDR_ANY; sin6.sin6_port = htons(port); } /** * Parse an IPv6 host address string as described in RFC 2373, and return the * address. * Throws: $(D SocketException) on error. */ static ubyte[16] parse(in char[] addr) { // Although we could use inet_pton here, it's only available on Windows // versions starting with Vista, so use getAddressInfo with NUMERICHOST // instead. auto results = getAddressInfo(addr, AddressInfoFlags.NUMERICHOST); if (results.length && results[0].family == AddressFamily.INET6) return (cast(sockaddr_in6*)results[0].address.name()).sin6_addr.s6_addr; throw new AddressException("Not an IPv6 address", 0); } } unittest { softUnittest({ const Internet6Address ia = new Internet6Address("::1", 80); assert(ia.toString() == "[::1]:80"); }); } version(StdDdoc) { /** * $(D UnixAddress) encapsulates an address for a Unix domain socket * ($(D AF_UNIX)). Available only on supported systems. */ class UnixAddress: Address { /// Construct a new $(D UnixAddress) from the specified path. this(in char[] path); /// Get the underlying _path. @property string path() const; /// ditto override string toString() const; } } else static if (is(typeof(sockaddr_un))) { class UnixAddress: Address { protected: sockaddr_un* sun; socklen_t len; this() { } public: override sockaddr* name() { return cast(sockaddr*)sun; } override const(sockaddr)* name() const { return cast(const(sockaddr)*)sun; } override socklen_t nameLen() const { return len; } this(in char[] path) { len = sockaddr_un.sun_path.offsetof + path.length + 1; sun = cast(sockaddr_un*) (new ubyte[len]).ptr; sun.sun_family = AF_UNIX; sun.sun_path.ptr[0..path.length] = path; sun.sun_path.ptr[path.length] = 0; } @property string path() const { return to!string(sun.sun_path.ptr); } override string toString() const { return path; } } } /** * Class for exceptions thrown by $(D Socket.accept). */ class SocketAcceptException: SocketOSException { this(string msg, int err = _lasterr()) { super(msg, err); } } /// How a socket is shutdown: enum SocketShutdown: int { RECEIVE = SD_RECEIVE, /// socket receives are disallowed SEND = SD_SEND, /// socket sends are disallowed BOTH = SD_BOTH, /// both RECEIVE and SEND } /// Flags may be OR'ed together: enum SocketFlags: int { NONE = 0, /// no flags specified OOB = MSG_OOB, /// out-of-band stream data PEEK = MSG_PEEK, /// peek at incoming data without removing it from the queue, only for receiving DONTROUTE = MSG_DONTROUTE, /// data should not be subject to routing; this flag may be ignored. Only for sending } private mixin template FieldProxy(string target, string field) { mixin(` @property typeof(`~target~`) `~field~`() const { return `~target~`; } /// ditto @property typeof(`~target~`) `~field~`(typeof(`~target~`) value) { return `~target~` = value; } `); } /// Duration timeout value. struct TimeVal { _ctimeval ctimeval; alias typeof(ctimeval.tv_sec) tv_sec_t; alias typeof(ctimeval.tv_usec) tv_usec_t; version (StdDdoc) // no DDoc for string mixins, can't forward individual fields { tv_sec_t seconds; /// Number of _seconds. tv_usec_t microseconds; /// Number of additional _microseconds. } else { // D interface mixin FieldProxy!(`ctimeval.tv_sec`, `seconds`); mixin FieldProxy!(`ctimeval.tv_usec`, `microseconds`); // C interface deprecated { alias seconds tv_sec; alias microseconds tv_usec; } } } /// $(RED Scheduled for deprecation. Please use $(D TimeVal) instead.) alias TimeVal timeval; /** * A collection of sockets for use with $(D Socket.select). * * $(D SocketSet) allows specifying the capacity of the underlying * $(D fd_set), however users should be aware that the exact meaning of this * value varies depending on the current platform: * $(UL $(LI On POSIX, $(D fd_set) is a bit array of file descriptors. The * $(D SocketSet) capacity specifies the highest file descriptor which can be * stored in the set.) * $(LI on Windows, $(D fd_set) is an array of socket handles. Capacity * indicates the actual number of sockets that can be stored in the set.)) */ class SocketSet { private: version(Win32) { // the maximum number of sockets the allocated fd_set can hold uint fdsetCapacity; fd_set* set; @property uint count() const { return set.fd_count; } } else version(Posix) { int fdsetMax; fd_set setData; final @property fd_set* set() { return &setData; } final @property const(fd_set)* set() const { return &setData; } int maxfd; uint count; } public: /** * Set the capacity of this $(D SocketSet). The exact meaning of the * $(D max) parameter varies from platform to platform. * Throws: $(D SocketParameterException) if $(D max) exceeds this * platform's maximum socket set size. */ this(uint max) { version(Win32) { fdsetCapacity = max; set = FD_CREATE(max); } else version(Posix) { // TODO (needs druntime changes) enforce(max <= FD_SETSIZE, new SocketParameterException( "Maximum socket set size exceeded for this platform")); fdsetMax = max; } reset(); } /// Uses the default capacity for the system. this() { this(FD_SETSIZE); } /// Reset the $(D SocketSet) so that there are 0 $(D Socket)s in the collection. void reset() { FD_ZERO(set); version(Posix) { maxfd = -1; count = 0; } } void add(socket_t s) { // Make sure too many sockets don't get added. version(Win32) { enforce(count < fdsetCapacity, new SocketParameterException( "SocketSet capacity exceeded")); } else version(Posix) { enforce(s < fdsetMax, new SocketParameterException( "Socket descriptor index exceeds SocketSet capacity")); } FD_SET(s, set); version(Posix) { ++count; if(s > maxfd) maxfd = s; } } /// Add a $(D Socket) to the collection. /// Throws: $(D SocketParameterException) if the capacity of this /// $(D SocketSet) has been exceeded. void add(Socket s) { add(s.sock); } void remove(socket_t s) { version(Posix) { enforce(s < fdsetMax, new SocketParameterException( "Socket descriptor index exceeds SocketSet capacity")); } FD_CLR(s, set); version(Posix) { --count; // note: adjusting maxfd would require scanning the set, not worth it } } /// Remove this $(D Socket) from the collection. void remove(Socket s) { remove(s.sock); } int isSet(socket_t s) const { version(Posix) { enforce(s < fdsetMax, new SocketParameterException( "Socket descriptor index exceeds SocketSet capacity")); } return FD_ISSET(s, set); } /// Returns nonzero if this $(D Socket) is in the collection. int isSet(Socket s) const { return isSet(s.sock); } /// Return the capacity of this $(D SocketSet). The exact meaning of the /// return value varies from platform to platform. uint max() const { version(Win32) { return fdsetCapacity; } else version(Posix) { return fdsetMax; } } fd_set* toFd_set() { return set; } int selectn() const { version(Win32) { return count; } else version(Posix) { return maxfd + 1; } } } /// The level at which a socket option is defined: enum SocketOptionLevel: int { SOCKET = SOL_SOCKET, /// Socket level IP = ProtocolType.IP, /// Internet Protocol version 4 level ICMP = ProtocolType.ICMP, /// Internet Control Message Protocol level IGMP = ProtocolType.IGMP, /// Internet Group Management Protocol level GGP = ProtocolType.GGP, /// Gateway to Gateway Protocol level TCP = ProtocolType.TCP, /// Transmission Control Protocol level PUP = ProtocolType.PUP, /// PARC Universal Packet Protocol level UDP = ProtocolType.UDP, /// User Datagram Protocol level IDP = ProtocolType.IDP, /// Xerox NS protocol level RAW = ProtocolType.RAW, /// Raw IP packet level IPV6 = ProtocolType.IPV6, /// Internet Protocol version 6 level } /// _Linger information for use with SocketOption.LINGER. struct Linger { _clinger clinger; version (StdDdoc) // no DDoc for string mixins, can't forward individual fields { private alias typeof(_clinger.init.l_onoff ) l_onoff_t; private alias typeof(_clinger.init.l_linger) l_linger_t; l_onoff_t on; /// Nonzero for _on. l_linger_t time; /// Linger _time. } else { // D interface mixin FieldProxy!(`clinger.l_onoff`, `on`); mixin FieldProxy!(`clinger.l_linger`, `time`); // C interface deprecated { alias on l_onoff; alias time l_linger; } } } /// $(RED Scheduled for deprecation. Please use $(D Linger) instead.) alias Linger linger; /// Specifies a socket option: enum SocketOption: int { DEBUG = SO_DEBUG, /// Record debugging information BROADCAST = SO_BROADCAST, /// Allow transmission of broadcast messages REUSEADDR = SO_REUSEADDR, /// Allow local reuse of address LINGER = SO_LINGER, /// Linger on close if unsent data is present OOBINLINE = SO_OOBINLINE, /// Receive out-of-band data in band SNDBUF = SO_SNDBUF, /// Send buffer size RCVBUF = SO_RCVBUF, /// Receive buffer size DONTROUTE = SO_DONTROUTE, /// Do not route SNDTIMEO = SO_SNDTIMEO, /// Send timeout RCVTIMEO = SO_RCVTIMEO, /// Receive timeout ERROR = SO_ERROR, /// Retrieve and clear error status KEEPALIVE = SO_KEEPALIVE, /// Enable keep-alive packets ACCEPTCONN = SO_ACCEPTCONN, /// Listen RCVLOWAT = SO_RCVLOWAT, /// Minimum number of input bytes to process SNDLOWAT = SO_SNDLOWAT, /// Minimum number of output bytes to process TYPE = SO_TYPE, /// Socket type // SocketOptionLevel.TCP: TCP_NODELAY = .TCP_NODELAY, /// Disable the Nagle algorithm for send coalescing // SocketOptionLevel.IPV6: IPV6_UNICAST_HOPS = .IPV6_UNICAST_HOPS, /// IP unicast hop limit IPV6_MULTICAST_IF = .IPV6_MULTICAST_IF, /// IP multicast interface IPV6_MULTICAST_LOOP = .IPV6_MULTICAST_LOOP, /// IP multicast loopback IPV6_MULTICAST_HOPS = .IPV6_MULTICAST_HOPS, /// IP multicast hops IPV6_JOIN_GROUP = .IPV6_JOIN_GROUP, /// Add an IP group membership IPV6_LEAVE_GROUP = .IPV6_LEAVE_GROUP, /// Drop an IP group membership IPV6_V6ONLY = .IPV6_V6ONLY, /// Treat wildcard bind as AF_INET6-only } /** * $(D Socket) is a class that creates a network communication endpoint using * the Berkeley sockets interface. */ class Socket { private: socket_t sock; AddressFamily _family; version(Win32) bool _blocking = false; /// Property to get or set whether the socket is blocking or nonblocking. // The WinSock timeouts seem to be effectively skewed by a constant // offset of about half a second (value in milliseconds). This has // been confirmed on updated (as of Jun 2011) Windows XP, Windows 7 // and Windows Server 2008 R2 boxes. The unittest below tests this // behavior. enum WINSOCK_TIMEOUT_SKEW = 500; unittest { version(SlowTests) softUnittest({ import std.datetime; enum msecs = 1000; auto pair = socketPair(); auto sock = pair[0]; sock.setOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, dur!"msecs"(msecs)); auto sw = StopWatch(AutoStart.yes); ubyte[1] buf; sock.receive(buf); sw.stop(); Duration readBack = void; sock.getOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, readBack); assert(readBack.total!"msecs" == msecs); assert(sw.peek().msecs > msecs-100 && sw.peek().msecs < msecs+100); }); } void setSock(socket_t handle) { assert(handle != socket_t.init); sock = handle; // Set the option to disable SIGPIPE on send() if the platform // has it (e.g. on OS X). static if (is(typeof(SO_NOSIGPIPE))) { setOption(SocketOptionLevel.SOCKET, cast(SocketOption)SO_NOSIGPIPE, true); } } // For use with accepting(). protected this() { } public: /** * Create a blocking socket. If a single protocol type exists to support * this socket type within the address family, the $(D ProtocolType) may be * omitted. */ this(AddressFamily af, SocketType type, ProtocolType protocol) { _family = af; auto handle = cast(socket_t) socket(af, type, protocol); if(handle == socket_t.init) throw new SocketOSException("Unable to create socket"); setSock(handle); } // A single protocol exists to support this socket type within the // protocol family, so the ProtocolType is assumed. /// ditto this(AddressFamily af, SocketType type) { this(af, type, cast(ProtocolType)0); // Pseudo protocol number. } /// ditto this(AddressFamily af, SocketType type, in char[] protocolName) { protoent* proto; proto = getprotobyname(toStringz(protocolName)); if(!proto) throw new SocketOSException("Unable to find the protocol"); this(af, type, cast(ProtocolType)proto.p_proto); } /** * Create a blocking socket using the parameters from the specified * $(D AddressInfo) structure. */ this(in AddressInfo info) { this(info.family, info.type, info.protocol); } /// Use an existing socket handle. this(socket_t sock, AddressFamily af) { assert(sock != socket_t.init); this.sock = sock; this._family = af; } ~this() { close(); } /// Get underlying socket handle. @property socket_t handle() const { return sock; } /** * Get/set socket's blocking flag. * * When a socket is blocking, calls to receive(), accept(), and send() * will block and wait for data/action. * A non-blocking socket will immediately return instead of blocking. */ @property bool blocking() const { version(Win32) { return _blocking; } else version(Posix) { return !(fcntl(handle, F_GETFL, 0) & O_NONBLOCK); } } /// ditto @property void blocking(bool byes) { version(Win32) { uint num = !byes; if(_SOCKET_ERROR == ioctlsocket(sock, FIONBIO, &num)) goto err; _blocking = byes; } else version(Posix) { int x = fcntl(sock, F_GETFL, 0); if(-1 == x) goto err; if(byes) x &= ~O_NONBLOCK; else x |= O_NONBLOCK; if(-1 == fcntl(sock, F_SETFL, x)) goto err; } return; // Success. err: throw new SocketOSException("Unable to set socket blocking"); } /// Get the socket's address family. AddressFamily addressFamily() // getter { return _family; } /// Property that indicates if this is a valid, alive socket. bool isAlive() const // getter { int type; socklen_t typesize = cast(socklen_t) type.sizeof; return !getsockopt(sock, SOL_SOCKET, SO_TYPE, cast(char*)&type, &typesize); } /// Associate a local address with this socket. void bind(Address addr) { if(_SOCKET_ERROR == .bind(sock, addr.name(), addr.nameLen())) throw new SocketOSException("Unable to bind socket"); } /** * Establish a connection. If the socket is blocking, connect waits for * the connection to be made. If the socket is nonblocking, connect * returns immediately and the connection attempt is still in progress. */ void connect(Address to) { if(_SOCKET_ERROR == .connect(sock, to.name(), to.nameLen())) { int err; err = _lasterr(); if(!blocking) { version(Win32) { if(WSAEWOULDBLOCK == err) return; } else version(Posix) { if(EINPROGRESS == err) return; } else { static assert(0); } } throw new SocketOSException("Unable to connect socket", err); } } /** * Listen for an incoming connection. $(D bind) must be called before you * can $(D listen). The $(D backlog) is a request of how many pending * incoming connections are queued until $(D accept)ed. */ void listen(int backlog) { if(_SOCKET_ERROR == .listen(sock, backlog)) throw new SocketOSException("Unable to listen on socket"); } /** * Called by $(D accept) when a new $(D Socket) must be created for a new * connection. To use a derived class, override this method and return an * instance of your class. The returned $(D Socket)'s handle must not be * set; $(D Socket) has a protected constructor $(D this()) to use in this * situation. */ // Override to use a derived class. // The returned socket's handle must not be set. protected Socket accepting() { return new Socket; } /** * Accept an incoming connection. If the socket is blocking, $(D accept) * waits for a connection request. Throws $(D SocketAcceptException) if * unable to _accept. See $(D accepting) for use with derived classes. */ Socket accept() { auto newsock = cast(socket_t).accept(sock, null, null); if(socket_t.init == newsock) throw new SocketAcceptException("Unable to accept socket connection"); Socket newSocket; try { newSocket = accepting(); assert(newSocket.sock == socket_t.init); newSocket.setSock(newsock); version(Win32) newSocket._blocking = _blocking; //inherits blocking mode newSocket._family = _family; //same family } catch(Throwable o) { _close(newsock); throw o; } return newSocket; } /// Disables sends and/or receives. void shutdown(SocketShutdown how) { .shutdown(sock, cast(int)how); } private static void _close(socket_t sock) { version(Win32) { .closesocket(sock); } else version(Posix) { .close(sock); } } /** * Immediately drop any connections and release socket resources. * Calling $(D shutdown) before $(D close) is recommended for * connection-oriented sockets. The $(D Socket) object is no longer * usable after $(D close). */ //calling shutdown() before this is recommended //for connection-oriented sockets void close() { _close(sock); sock = socket_t.init; } /// Returns the local machine's host name. // Idea from mango. static string hostName() // getter { char[256] result; // Host names are limited to 255 chars. if(_SOCKET_ERROR == .gethostname(result.ptr, result.length)) throw new SocketOSException("Unable to obtain host name"); return to!string(result.ptr); } /// Remote endpoint $(D Address). Address remoteAddress() { Address addr = createAddress(); socklen_t nameLen = addr.nameLen(); if(_SOCKET_ERROR == .getpeername(sock, addr.name(), &nameLen)) throw new SocketOSException("Unable to obtain remote socket address"); if(nameLen > addr.nameLen()) throw new SocketParameterException("Not enough socket address storage"); assert(addr.addressFamily() == _family); return addr; } /// Local endpoint $(D Address). Address localAddress() { Address addr = createAddress(); socklen_t nameLen = addr.nameLen(); if(_SOCKET_ERROR == .getsockname(sock, addr.name(), &nameLen)) throw new SocketOSException("Unable to obtain local socket address"); if(nameLen > addr.nameLen()) throw new SocketParameterException("Not enough socket address storage"); assert(addr.addressFamily() == _family); return addr; } /** * Send or receive error code. See $(D wouldHaveBlocked), * $(D lastSocketError) and $(D Socket.getErrorText) for obtaining more * information about the error. */ enum int ERROR = _SOCKET_ERROR; /** * Send data on the connection. If the socket is blocking and there is no * buffer space left, $(D send) waits. * Returns: The number of bytes actually sent, or $(D Socket.ERROR) on * failure. */ //returns number of bytes actually sent, or -1 on error ptrdiff_t send(const(void)[] buf, SocketFlags flags) { static if (is(typeof(MSG_NOSIGNAL))) { flags = cast(SocketFlags)(flags | MSG_NOSIGNAL); } version( Windows ) auto sent = .send(sock, buf.ptr, to!int(buf.length), cast(int)flags); else auto sent = .send(sock, buf.ptr, buf.length, cast(int)flags); return sent; } /// ditto ptrdiff_t send(const(void)[] buf) { return send(buf, SocketFlags.NONE); } /** * Send data to a specific destination Address. If the destination address is * not specified, a connection must have been made and that address is used. * If the socket is blocking and there is no buffer space left, $(D sendTo) waits. * Returns: The number of bytes actually sent, or $(D Socket.ERROR) on * failure. */ ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags, Address to) { static if (is(typeof(MSG_NOSIGNAL))) { flags = cast(SocketFlags)(flags | MSG_NOSIGNAL); } version( Windows ) return .sendto( sock, buf.ptr, std.conv.to!int(buf.length), cast(int)flags, to.name(), to.nameLen() ); else return .sendto(sock, buf.ptr, buf.length, cast(int)flags, to.name(), to.nameLen()); } /// ditto ptrdiff_t sendTo(const(void)[] buf, Address to) { return sendTo(buf, SocketFlags.NONE, to); } //assumes you connect()ed /// ditto ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags) { static if (is(typeof(MSG_NOSIGNAL))) { flags = cast(SocketFlags)(flags | MSG_NOSIGNAL); } version(Windows) return .sendto(sock, buf.ptr, to!int(buf.length), cast(int)flags, null, 0); else return .sendto(sock, buf.ptr, buf.length, cast(int)flags, null, 0); } //assumes you connect()ed /// ditto ptrdiff_t sendTo(const(void)[] buf) { return sendTo(buf, SocketFlags.NONE); } /** * Receive data on the connection. If the socket is blocking, $(D receive) * waits until there is data to be received. * Returns: The number of bytes actually received, $(D 0) if the remote side * has closed the connection, or $(D Socket.ERROR) on failure. */ //returns number of bytes actually received, 0 on connection closure, or -1 on error ptrdiff_t receive(void[] buf, SocketFlags flags) { version(Win32) // Does not use size_t { return buf.length ? .recv(sock, buf.ptr, to!int(buf.length), cast(int)flags) : 0; } else { return buf.length ? .recv(sock, buf.ptr, buf.length, cast(int)flags) : 0; } } /// ditto ptrdiff_t receive(void[] buf) { return receive(buf, SocketFlags.NONE); } /** * Receive data and get the remote endpoint $(D Address). * If the socket is blocking, $(D receiveFrom) waits until there is data to * be received. * Returns: The number of bytes actually received, $(D 0) if the remote side * has closed the connection, or $(D Socket.ERROR) on failure. */ ptrdiff_t receiveFrom(void[] buf, SocketFlags flags, ref Address from) { if(!buf.length) //return 0 and don't think the connection closed return 0; if (from is null || from.addressFamily != _family) from = createAddress(); socklen_t nameLen = from.nameLen(); version(Win32) { auto read = .recvfrom(sock, buf.ptr, to!int(buf.length), cast(int)flags, from.name(), &nameLen); assert(from.addressFamily() == _family); // if(!read) //connection closed return read; } else { auto read = .recvfrom(sock, buf.ptr, buf.length, cast(int)flags, from.name(), &nameLen); assert(from.addressFamily() == _family); // if(!read) //connection closed return read; } } /// ditto ptrdiff_t receiveFrom(void[] buf, ref Address from) { return receiveFrom(buf, SocketFlags.NONE, from); } //assumes you connect()ed /// ditto ptrdiff_t receiveFrom(void[] buf, SocketFlags flags) { if(!buf.length) //return 0 and don't think the connection closed return 0; version(Win32) { auto read = .recvfrom(sock, buf.ptr, to!int(buf.length), cast(int)flags, null, null); // if(!read) //connection closed return read; } else { auto read = .recvfrom(sock, buf.ptr, buf.length, cast(int)flags, null, null); // if(!read) //connection closed return read; } } //assumes you connect()ed /// ditto ptrdiff_t receiveFrom(void[] buf) { return receiveFrom(buf, SocketFlags.NONE); } /// Get a socket option. /// Returns: The number of bytes written to $(D result). //returns the length, in bytes, of the actual result - very different from getsockopt() int getOption(SocketOptionLevel level, SocketOption option, void[] result) { socklen_t len = cast(socklen_t) result.length; if(_SOCKET_ERROR == .getsockopt(sock, cast(int)level, cast(int)option, result.ptr, &len)) throw new SocketOSException("Unable to get socket option"); return len; } /// Common case of getting integer and boolean options. int getOption(SocketOptionLevel level, SocketOption option, out int32_t result) { return getOption(level, option, (&result)[0 .. 1]); } /// Get the linger option. int getOption(SocketOptionLevel level, SocketOption option, out Linger result) { //return getOption(cast(SocketOptionLevel)SocketOptionLevel.SOCKET, SocketOption.LINGER, (&result)[0 .. 1]); return getOption(level, option, (&result.clinger)[0 .. 1]); } /// Get a timeout (duration) option. void getOption(SocketOptionLevel level, SocketOption option, out Duration result) { enforce(option == SocketOption.SNDTIMEO || option == SocketOption.RCVTIMEO, new SocketParameterException("Not a valid timeout option: " ~ to!string(option))); // WinSock returns the timeout values as a milliseconds DWORD, // while Linux and BSD return a timeval struct. version (Win32) { int msecs; getOption(level, option, (&msecs)[0 .. 1]); if (option == SocketOption.RCVTIMEO) msecs += WINSOCK_TIMEOUT_SKEW; result = dur!"msecs"(msecs); } else version (Posix) { TimeVal tv; getOption(level, option, (&tv.ctimeval)[0..1]); result = dur!"seconds"(tv.seconds) + dur!"usecs"(tv.microseconds); } else static assert(false); } // Set a socket option. void setOption(SocketOptionLevel level, SocketOption option, void[] value) { if(_SOCKET_ERROR == .setsockopt(sock, cast(int)level, cast(int)option, value.ptr, cast(uint) value.length)) throw new SocketOSException("Unable to set socket option"); } /// Common case for setting integer and boolean options. void setOption(SocketOptionLevel level, SocketOption option, int32_t value) { setOption(level, option, (&value)[0 .. 1]); } /// Set the linger option. void setOption(SocketOptionLevel level, SocketOption option, Linger value) { //setOption(cast(SocketOptionLevel)SocketOptionLevel.SOCKET, SocketOption.LINGER, (&value)[0 .. 1]); setOption(level, option, (&value.clinger)[0 .. 1]); } /** * Sets a timeout (duration) option, i.e. $(D SocketOption.SNDTIMEO) or * $(D RCVTIMEO). Zero indicates no timeout. * * In a typical application, you might also want to consider using * a non-blocking socket instead of setting a timeout on a blocking one. * * Note: While the receive timeout setting is generally quite accurate * on *nix systems even for smaller durations, there are two issues to * be aware of on Windows: First, although undocumented, the effective * timeout duration seems to be the one set on the socket plus half * a second. $(D setOption()) tries to compensate for that, but still, * timeouts under 500ms are not possible on Windows. Second, be aware * that the actual amount of time spent until a blocking call returns * randomly varies on the order of 10ms. * * Params: * value = The timeout duration to set. Must not be negative. * * Throws: $(D SocketException) if setting the options fails. * * Example: * --- * import std.datetime; * auto pair = socketPair(); * scope(exit) foreach (s; pair) s.close(); * * // Set a receive timeout, and then wait at one end of * // the socket pair, knowing that no data will arrive. * pair[0].setOption(SocketOptionLevel.SOCKET, * SocketOption.RCVTIMEO, dur!"seconds"(1)); * * auto sw = StopWatch(AutoStart.yes); * ubyte[1] buffer; * pair[0].receive(buffer); * writefln("Waited %s ms until the socket timed out.", * sw.peek.msecs); * --- */ void setOption(SocketOptionLevel level, SocketOption option, Duration value) { enforce(option == SocketOption.SNDTIMEO || option == SocketOption.RCVTIMEO, new SocketParameterException("Not a valid timeout option: " ~ to!string(option))); enforce(value >= dur!"hnsecs"(0), new SocketParameterException( "Timeout duration must not be negative.")); version (Win32) { auto msecs = to!int(value.total!"msecs"()); if (msecs != 0 && option == SocketOption.RCVTIMEO) msecs = max(1, msecs - WINSOCK_TIMEOUT_SKEW); setOption(level, option, msecs); } else version (Posix) { _ctimeval tv; tv.tv_sec = to!(typeof(tv.tv_sec ))(value.total!"seconds"()); tv.tv_usec = to!(typeof(tv.tv_usec))(value.fracSec.usecs); setOption(level, option, (&tv)[0 .. 1]); } else static assert(false); } /// Get a text description of this socket's error status, and clear the /// socket's error status. string getErrorText() { int32_t error; getOption(SocketOptionLevel.SOCKET, SocketOption.ERROR, error); return formatSocketError(error); } /** * Enables TCP keep-alive with the specified parameters. * * Params: * time = Number of seconds with no activity until the first * keep-alive packet is sent. * interval = Number of seconds between when successive keep-alive * packets are sent if no acknowledgement is received. * * Throws: $(D SocketOSException) if setting the options fails, or * $(D SocketFeatureException) if setting keep-alive parameters is * unsupported on the current platform. */ void setKeepAlive(int time, int interval) { version(Windows) { tcp_keepalive options; options.onoff = 1; options.keepalivetime = time * 1000; options.keepaliveinterval = interval * 1000; uint cbBytesReturned; enforce(WSAIoctl(sock, SIO_KEEPALIVE_VALS, &options, options.sizeof, null, 0, &cbBytesReturned, null, null) == 0, new SocketOSException("Error setting keep-alive")); } else static if (is(typeof(TCP_KEEPIDLE)) && is(typeof(TCP_KEEPINTVL))) { setOption(SocketOptionLevel.TCP, cast(SocketOption)TCP_KEEPIDLE, time); setOption(SocketOptionLevel.TCP, cast(SocketOption)TCP_KEEPINTVL, interval); setOption(SocketOptionLevel.SOCKET, SocketOption.KEEPALIVE, true); } else throw new SocketFeatureException("Setting keep-alive options " ~ "is not supported on this platform"); } /** * Wait for a socket to change status. A wait timeout $(D TimeVal), * $(D Duration) or $(D long) microseconds may be specified; if a timeout * is not specified or the $(D TimeVal) is $(D null), the maximum timeout * is used. The $(D TimeVal) timeout has an unspecified value when * $(D select) returns. * Returns: The number of sockets with status changes, $(D 0) on timeout, * or $(D -1) on interruption. If the return value is greater than $(D 0), * the $(D SocketSets) are updated to only contain the sockets having status * changes. For a connecting socket, a write status change means the * connection is established and it's able to send. For a listening socket, * a read status change means there is an incoming connection request and * it's able to accept. */ //SocketSet's updated to include only those sockets which an event occured //returns the number of events, 0 on timeout, or -1 on interruption //for a connect()ing socket, writeability means connected //for a listen()ing socket, readability means listening //Winsock: possibly internally limited to 64 sockets per set static int select(SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, TimeVal* tv) in { //make sure none of the SocketSet's are the same object if(checkRead) { assert(checkRead !is checkWrite); assert(checkRead !is checkError); } if(checkWrite) { assert(checkWrite !is checkError); } } body { fd_set* fr, fw, fe; int n = 0; version(Win32) { // Windows has a problem with empty fd_set`s that aren't null. fr = (checkRead && checkRead.count()) ? checkRead.toFd_set() : null; fw = (checkWrite && checkWrite.count()) ? checkWrite.toFd_set() : null; fe = (checkError && checkError.count()) ? checkError.toFd_set() : null; } else { if(checkRead) { fr = checkRead.toFd_set(); n = checkRead.selectn(); } else { fr = null; } if(checkWrite) { fw = checkWrite.toFd_set(); int _n; _n = checkWrite.selectn(); if(_n > n) n = _n; } else { fw = null; } if(checkError) { fe = checkError.toFd_set(); int _n; _n = checkError.selectn(); if(_n > n) n = _n; } else { fe = null; } } int result = .select(n, fr, fw, fe, &tv.ctimeval); version(Win32) { if(_SOCKET_ERROR == result && WSAGetLastError() == WSAEINTR) return -1; } else version(Posix) { if(_SOCKET_ERROR == result && errno == EINTR) return -1; } else { static assert(0); } if(_SOCKET_ERROR == result) throw new SocketOSException("Socket select error"); return result; } /// ditto static int select(SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, long microseconds) { TimeVal tv; tv.seconds = to!(tv.tv_sec_t )(microseconds / 1_000_000); tv.microseconds = to!(tv.tv_usec_t)(microseconds % 1_000_000); return select(checkRead, checkWrite, checkError, &tv); } /// ditto static int select(SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, Duration duration) { TimeVal tv; tv.seconds = to!(tv.tv_sec_t )(duration.total!"seconds"()); tv.microseconds = to!(tv.tv_usec_t)(duration.fracSec.usecs); return select(checkRead, checkWrite, checkError, &tv); } /// ditto //maximum timeout static int select(SocketSet checkRead, SocketSet checkWrite, SocketSet checkError) { return select(checkRead, checkWrite, checkError, null); } /// Returns a new Address object for the current address family. /// Can be overridden to support other addresses. protected Address createAddress() { Address result; switch(_family) { case AddressFamily.INET: result = new InternetAddress; break; case AddressFamily.INET6: result = new Internet6Address; break; default: result = new UnknownAddress; } return result; } } /// $(D TcpSocket) is a shortcut class for a TCP Socket. class TcpSocket: Socket { /// Constructs a blocking TCP Socket. this(AddressFamily family) { super(family, SocketType.STREAM, ProtocolType.TCP); } /// Constructs a blocking IPv4 TCP Socket. this() { this(AddressFamily.INET); } //shortcut /// Constructs a blocking TCP Socket and connects to an $(D Address). this(Address connectTo) { this(connectTo.addressFamily()); connect(connectTo); } } /// $(D UdpSocket) is a shortcut class for a UDP Socket. class UdpSocket: Socket { /// Constructs a blocking UDP Socket. this(AddressFamily family) { super(family, SocketType.DGRAM, ProtocolType.UDP); } /// Constructs a blocking IPv4 UDP Socket. this() { this(AddressFamily.INET); } } /** * Creates a pair of connected sockets. * * The two sockets are indistinguishable. * * Throws: $(D SocketException) if creation of the sockets fails. * * Example: * --- * immutable ubyte[] data = [1, 2, 3, 4]; * auto pair = socketPair(); * scope(exit) foreach (s; pair) s.close(); * * pair[0].send(data); * * auto buf = new ubyte[data.length]; * pair[1].receive(buf); * assert(buf == data); * --- */ Socket[2] socketPair() { version(Posix) { int[2] socks; if (socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1) throw new SocketOSException("Unable to create socket pair"); Socket toSocket(size_t id) { auto s = new Socket; s.setSock(cast(socket_t)socks[id]); s._family = AddressFamily.UNIX; return s; } return [toSocket(0), toSocket(1)]; } else version(Win32) { // We do not have socketpair() on Windows, just manually create a // pair of sockets connected over some localhost port. Socket[2] result; auto listener = new TcpSocket(); listener.setOption(SocketOptionLevel.SOCKET, SocketOption.REUSEADDR, true); listener.bind(new InternetAddress(INADDR_LOOPBACK, InternetAddress.PORT_ANY)); auto addr = listener.localAddress(); listener.listen(1); result[0] = new TcpSocket(addr); result[1] = listener.accept(); listener.close(); return result; } else static assert(false); } unittest { immutable ubyte[] data = [1, 2, 3, 4]; auto pair = socketPair(); scope(exit) foreach (s; pair) s.close(); pair[0].send(data); auto buf = new ubyte[data.length]; pair[1].receive(buf); assert(buf == data); }
D
// // TODO: // Exit when ESCAPE key is pressed import std.stdio; import std.array; import std.string; import std.datetime; import core.thread; import std.file : read; import std.uni : toLower; import std.conv : to; import std.json; import glib.Timeout; import gtk.Box; import gtk.Button; import gtk.Entry; import gtk.EntryBuffer; import gtk.Frame; import gtk.Label; import gtk.Image; import gtk.Main; import gtk.MainWindow; import gtk.Stack; import gtk.Viewport; import gtk.Widget; import gtk.Window; import gtk.DrawingArea; import gdk.Threads; import gdk.Color; import gdk.Pixbuf; import gdk.Screen; import cairo.Context; import cairo.ImageSurface; //shared Image backImage; //shared Image forwardImage; //shared Image refreshImage; //shared Label newTabLabel; __gshared Image[] images; shared Color white; shared Color lightBlue; struct PageInfo { string address; Widget tab; Widget content; } struct GtkBrowserWindow { Widget gtkGui; Box tabsGtkBox; auto tabs = appender!(Widget[])(); size_t currentTabIndex = size_t.max; //Widget currentTab; //Widget currentTabContents; Entry addressEntry; Frame contentFrame; auto tabContents = appender!(Widget[])(); void error(string message) { writeln(message); stdout.flush(); } // Callbacks void newTabClicked(Button newTabButton) { addNewTab(true); } void tabClicked(Button tabButton) { foreach(i, tab; tabs.data) { if(tab == tabButton) { showTab(i); return; } } error("got tabClicked callback from unknown tabButton"); } /+ void onWindowActivateFocus(Window window) { writeln("onWindowActivateFocus"); stdout.flush(); } void onWindowSetFocus(Window window) { writeln("onWindowSetFocus"); stdout.flush(); } +/ void addNewTab(bool showContents) { auto newTab = new Button("New Tab"); newTab.addOnClicked(&tabClicked); newTab.modifyBg(GtkStateType.NORMAL, cast(Color)lightBlue); tabs.put(newTab); tabsGtkBox.packStart(newTab, false, false, 0); newTab.show(); auto newTabContent = new Label(format("New Tab (index=%s)", tabs.data.length - 1)); newTabContent.modifyBg(GtkStateType.NORMAL, cast(Color)white); tabContents.put(newTabContent); if(showContents) { showTab(tabs.data.length - 1); } } void showTab(size_t newTabIndex) { if(newTabIndex == currentTabIndex) return; if(currentTabIndex != size_t.max) { Widget oldTab = tabs.data[currentTabIndex]; oldTab.modifyBg(GtkStateType.NORMAL, cast(Color)lightBlue); } Widget newTab = tabs.data[newTabIndex]; newTab.modifyBg(GtkStateType.NORMAL, cast(Color)white); Widget tabContents = tabContents.data[newTabIndex]; contentFrame.removeAll(); contentFrame.add(tabContents); tabContents.show(); currentTabIndex = newTabIndex; } } __gshared MainWindow window; //__gshared CairoFadeImage cairoFade; //__gshared ImageSurface image1, image2; Image load(string filename) { writefln("Loading '%s'", filename); stdout.flush(); auto imagePixBuf = new Pixbuf(filename); // Save Png if(!filename.endsWith(".png")) { imagePixBuf.savev(filename ~ ".png", "png", null, null); } writefln("Scaling..."); stdout.flush(); imagePixBuf = imagePixBuf.scaleSimple(2560, 1600, GdkInterpType.HYPER); return new Image(imagePixBuf); } void main(string[] args) { Main.init(args); // // Setup Global Data // /+ //newTabLabel = cast(shared Label)new Label("New Tab"); white = cast(shared Color)new Color(255, 255, 255); lightBlue = cast(shared Color)new Color( 0, 120, 255); +/ window = new MainWindow("GtkNet"); window.setDefaultSize(300, 300); window.setPosition(GtkWindowPosition.POS_CENTER); window.setDecorated(false); //window.fullscreen(); //auto cairoFadeImages = loadConfig("config.json"); //return; // // Setup Icon // //auto icon = new Pixbuf("img/icon32.png"); //window.setIcon(icon); // // Setup blank page // //auto windowContent = createWindowContent(); //window.add(windowContent.gtkGui); //window.setFocus(windowContent.addressEntry); //window.addOnActivateFocus(&windowContent.onWindowActivateFocus); //window.addOnSetFocus(&windowContent.onWindowSetFocus); //images ~= new Image(`C:\temp\msp\TV1-1.jpg`); //load(`C:\temp\msp\TV1-1.jpg`); //load(`C:\temp\msp\TV1-2.jpg`); //firstImage = load( //secondImage = load(`C:\temp\msp\image2.png`); //image1 = ImageSurface.createFromPng(`C:\temp\msp\image1.png`); //image2 = ImageSurface.createFromPng(`C:\temp\msp\image2.png`); //image1 = ImageSurface.createFromPng(`C:\temp\msp\TV1-1.png`); //image2 = ImageSurface.createFromPng(`C:\temp\msp\TV1-2.png`); //cairoFade = new CairoFadeImage(image1, 500); //window.add(cairoFade.drawingArea); var lambImage = ImageSurface.createFromPng(`C:\temp\msp\lamb.png`); var kittiesImage = ImageSurface.createFromPng(`C:\temp\msp\kitties.png`); /+ extern(C) int startTransitionThread(void* data) { TransitionThread transitionThread = new TransitionThread ([ WaitAction( 4000, &delegates.switchToImage2), WaitAction( 4000, &delegates.switchToImage1) ]); transitionThread.start(); return 0; } +/ //new Timeout(25, &delegates.fortyPerSecond); window.showAll(); gdk.Threads.threadsAddIdle(&startTransitionThread, null); Main.run(); //timeout.stop(); //auto defaultScreen = Screen.getDefault(); //defaultScreen.printInfo("defaultScreen"); } struct CiaroImageRoll { CairoTransitionImage transitionImage; ImageSurface[] imageRoll; size_t currentImageIndex; this(CairoTransitionImage transitionImage, ImageSurface[] imageRoll) { this.transitionImage = transitionImage; this.imageRoll = imageRoll; } void next() { currentImageIndex++; if(currentImageIndex >= imageRoll.length) { currentImageIndex = 0; } this.transitionImage.transitionTo(imageRoll[currentImageIndex]); } } interface CairoTransitionImage { void transitionTo(ImageSurface image); } class CairoFadeImage : CairoTransitionImage { DrawingArea drawingArea; ImageSurface currentImage; uint fadeMsecs; ImageSurface fadeImage; long fadeStartTime; this(ImageSurface image, uint fadeMsecs) { this.drawingArea = new DrawingArea(); this.drawingArea.addOnDraw(&onDraw); this.drawingArea.addOnDestroy(&onDestroy); this.currentImage = image; this.fadeMsecs = fadeMsecs; } void transitionTo(ImageSurface image) { this.fadeImage = image; this.fadeStartTime = Clock.currStdTime(); //writefln("--> fadeTo(&this=%s) startTime = %s", &this, this.fadeStartTime); new Timeout(1, &timeoutCallback); } bool timeoutCallback() { if(fadeImage is null) return false; drawingArea.queueDraw(); //window.queueDraw(); return true; } void onDestroy(Widget widget) { //writefln("TODO: implement onDestroy"); //stdout.flush(); } bool onDraw(Context c, Widget widget) { stdout.flush(); if(fadeImage is null) { c.setSourceSurface(currentImage, 0, 0); c.paint(); } else { auto diffMsecs = convert!("hnsecs", "msecs")(Clock.currStdTime() - fadeStartTime); if(diffMsecs >= fadeMsecs) { this.currentImage = this.fadeImage; this.fadeImage = null; c.setSourceSurface(currentImage, 0, 0); c.paint(); } else { c.setSourceSurface(currentImage, 0, 0); c.paint(); c.setSourceSurface(fadeImage, 0, 0); c.paintWithAlpha(cast(double)diffMsecs / cast(double)fadeMsecs); } } return true; } } extern(C) int uiCallback(void* data) { writefln("uiCallback: data = 0x%x", data);stdout.flush(); WaitAction* waitAction = cast(WaitAction*)data; waitAction.action(); return 0; } extern(C) int startTransitionThread(void* data) { TransitionThread transitionThread = new TransitionThread ([ WaitAction( 4000, &delegates.switchToImage2), WaitAction( 4000, &delegates.switchToImage1) ]); transitionThread.start(); return 0; } struct WaitAction { uint msecs; void delegate() action; } class TransitionThread : Thread { WaitAction[] waitActions; size_t nextWaitAction; //uint loopMsecs; this(WaitAction[] waitActions) { super(&run); this.waitActions = waitActions; } private void run() { writefln("[TransitionThread] start");stdout.flush(); while(true) { writefln("[TransitionThread] wait %s msecs", waitActions[nextWaitAction].msecs);stdout.flush(); Thread.sleep(dur!("msecs")(waitActions[nextWaitAction].msecs)); gdk.Threads.threadsAddIdle(&uiCallback, &(waitActions[nextWaitAction])); nextWaitAction++; if(nextWaitAction >= waitActions.length) { nextWaitAction = 0; } } writefln("[TransitionThread] exit");stdout.flush(); } } struct MyDelegates { void switchToImage2() { writefln("--> switchToImage2");stdout.flush(); // !!!!!!!!!!!!!!!!!!!!!!!!!! // TODO: do this using invoke cairoFade.transitionTo(image2); } void switchToImage1() { writefln("--> switchToImage1");stdout.flush(); //window.removeAll(); //window.add(firstImage); //window.showAll(); cairoFade.transitionTo(image1); } /+ bool fortyPerSecond() { foreach(fadeImage; fadingImages) { if(fadeImage.fadeIteration < fadeImage.fadeCount) { window.queueDraw(); } } return true; } +/ } MyDelegates delegates; /+ extern (C) fadeOut(void* ptr) { } +/ /+ struct IntSize { int width, height; } IntSize scale(int x, int y, int ontoX, int ontoY) { auto diffX = (x >= ontoX) ? x - ontoX : ontoX - x; auto diffY = (y >= ontoY) ? y - ontoY : ontoY - y; if(diffX > diffY) { if(x >= ontoX) { } else { } } else { } } +/ void printInfo(Screen screen, string identifier) { writefln("%s.getNumber() = %s", identifier, screen.getNumber()); writefln("%s.getWidth() = %s", identifier, screen.getWidth()); writefln("%s.getHeight() = %s", identifier, screen.getHeight()); writefln("%s.makeDisplayName() = %s", identifier, screen.makeDisplayName()); writefln("%s.getPrimaryMonitor() = %s", identifier, screen.getPrimaryMonitor()); auto monitorCount = screen.getNMonitors(); writefln("%s.getNMonitors() = %s", identifier, monitorCount); foreach(i; 0..monitorCount) { Rectangle rect; writefln("%s.getMonitorPlugName(%s) = %s", identifier, i, screen.getMonitorPlugName(i)); screen.getMonitorGeometry(i, rect); writefln("%s.getMonitorGeometry(%s) = %s", identifier, i, rect); screen.getMonitorWorkarea(i, rect); writefln("%s.getMonitorWorkarea(%s) = %s", identifier, i, rect); } //writefln("%s.() = %s", identifier, screen.()); stdout.flush(); } // // JSON Parse Logic // string namePrefix(JSON_TYPE type) { if (type == JSON_TYPE.ARRAY || type == JSON_TYPE.OBJECT || type == JSON_TYPE.INTEGER) { return "an"; } else { return "a"; } } template namePrefix(string type) { static if(type == "array" || type == "object" || type == "integer") { enum namePrefix = "an"; } else static assert(0, "no namePrefix for type "~type); } auto as(string type)(JSONValue v, lazy string context) { try { mixin("return v."~type~";"); } catch(JSONException e) { throw new JSONException(context~format(" expected %s %s but got %s %s", namePrefix!type, type, namePrefix(v.type), to!string(v.type).toLower)); } } auto getProp(string type)(JSONValue[string] object, string property, lazy string objectIdentifier) { if(property !in object) throw new JSONException(format("%s is missing property '%s'", objectIdentifier, property)); try { mixin("return object[property]."~type~";"); } catch(Exception e) { throw e; } } CairoFadeImage[] loadConfig(string filename) { auto jsonText = cast(char[])read(filename); auto jsonRoot = parseJSON(jsonText); auto cairoFadeImages = appender!(CairoFadeImage[])(); foreach(i, imageConfigArray; jsonRoot.as!"array"("While parsing start of config file")) { JSONValue[string] imageConfig = imageConfigArray.as!"object"(format("While parsing start of element at root index %s", i)); string objectId = format("Graphic config object at index %s", i); auto type = imageConfig.getProp!"str"("Type", objectId); if(type == "Slideshow") { auto top = imageConfig.getProp!"integer"("Top", objectId); auto left = imageConfig.getProp!"integer"("Left", objectId); auto images = imageConfig.getProp!"array"("Images", objectId); } else { throw new JSONException(format("Unknown graphic Type '%s'", type)); } } return null; }
D
/home/ukasha/Desktop/PIAIC-IoT-Repos/Quarter-1_3.30-6.30/week_13_20th-October,2019/part3/target/debug/part3: /home/ukasha/Desktop/PIAIC-IoT-Repos/Quarter-1_3.30-6.30/week_13_20th-October,2019/part3/src/main.rs
D
/** Copyright: Copyright (c) 2015-2018 Andrey Penechko. License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: Andrey Penechko. */ module voxelman.world.serverworld; import std.array : empty; import core.atomic : atomicStore, atomicLoad; import cbor; import netlib; import pluginlib; import voxelman.container.buffer; import voxelman.log; import voxelman.math; import voxelman.core.config; import voxelman.core.events; import voxelman.net.events; import voxelman.platform.compression; import voxelman.input.keybindingmanager; import voxelman.config.configmanager : ConfigOption, ConfigManager; import voxelman.eventdispatcher.plugin : EventDispatcherPlugin; import voxelman.net.plugin : NetServerPlugin; import voxelman.session.server; import voxelman.block.plugin; import voxelman.blockentity.plugin; import voxelman.dbg.plugin; import voxelman.net.packets; import voxelman.core.packets; import voxelman.world.blockentity.blockentityaccess; import voxelman.world.gen.generators; import voxelman.world.storage; import voxelman.world.storage.dimensionobservermanager; public import voxelman.world.worlddb : WorldDb, formWorldKey; enum START_NEW_WORLD = false; alias IdMapHandler = string[] delegate(); struct IdMapManagerServer { IdMapHandler[string] idMapHandlers; void regIdMapHandler(string name, IdMapHandler handler) { idMapHandlers[name] = handler; } } struct WorldInfo { string name = DEFAULT_WORLD_NAME; TimestampType simulationTick; ClientDimPos spawnPos; DimensionId spawnDimension; } //version = DBG_COMPR; final class ServerWorld : IPlugin { private: EventDispatcherPlugin evDispatcher; NetServerPlugin connection; ClientManager clientMan; BlockPluginServer blockPlugin; BlockEntityServer blockEntityPlugin; Debugger dbg; ConfigOption numGenWorkersOpt; ConfigOption saveUnmodifiedChunksOpt; ubyte[] buf; auto dbKey = IoKey("voxelman.world.world_info"); string worldFilename; shared bool isSaving; IoManager ioManager; WorldDb worldDb; PluginDataSaver pluginDataSaver; public: ChunkManager chunkManager; ChunkEditor chunkEditor; ChunkProvider chunkProvider; ChunkObserverManager chunkObserverManager; DimensionManager dimMan; DimensionObserverManager dimObserverMan; ActiveChunks activeChunks; IdMapManagerServer idMapManager; WorldInfo worldInfo; WorldAccess worldAccess; BlockEntityAccess entityAccess; mixin IdAndSemverFrom!"voxelman.world.plugininfo"; override void registerResourceManagers(void delegate(IResourceManager) registerHandler) { ioManager = new IoManager(&loadWorld); registerHandler(ioManager); } override void registerResources(IResourceManagerRegistry resmanRegistry) { ConfigManager config = resmanRegistry.getResourceManager!ConfigManager; numGenWorkersOpt = config.registerOption!int("num_workers", 4); saveUnmodifiedChunksOpt = config.registerOption!bool("save_unmodified_chunks", false); ioManager.registerWorldLoadSaveHandlers(&readWorldInfo, &writeWorldInfo); ioManager.registerWorldLoadSaveHandlers(&activeChunks.read, &activeChunks.write); ioManager.registerWorldLoadSaveHandlers(&dimMan.load, &dimMan.save); dimMan.generatorMan.factory.registerGenerator!GeneratorFlat; dimMan.generatorMan.factory.registerGenerator!Generator2d; dimMan.generatorMan.factory.registerGenerator!Generator2d3d; dbg = resmanRegistry.getResourceManager!Debugger; } override void preInit() { pluginDataSaver.stringMap = &ioManager.stringMap; pluginDataSaver.getKey = (uint key) => formWorldKey(key); idMapManager.regIdMapHandler("string_map", () => ioManager.stringMap.strings); buf = new ubyte[](1024*64*4); chunkManager = new ChunkManager(NUM_CHUNK_LAYERS); chunkEditor = new ChunkEditor(NUM_CHUNK_LAYERS, chunkManager); worldAccess = new WorldAccess(chunkManager, chunkEditor); entityAccess = new BlockEntityAccess(chunkManager, chunkEditor); chunkObserverManager = new ChunkObserverManager(); chunkProvider = new ChunkProvider(chunkManager); chunkManager.setLayerInfo(METADATA_LAYER, ChunkLayerInfo(BLOCK_METADATA_UNIFORM_FILL_BITS)); // Component connections chunkManager.loadChunkHandler = &chunkProvider.loadChunk; chunkManager.saveChunkHandler = &chunkProvider.saveChunk; chunkManager.cancelLoadChunkHandler = &chunkProvider.cancelLoad; chunkEditor.addServerObserverHandler = &chunkObserverManager.addServerObserver; chunkEditor.removeServerObserverHandler = &chunkObserverManager.removeServerObserver; chunkProvider.onChunkLoadedHandler = &chunkManager.onSnapshotLoaded; chunkProvider.generatorGetter = &dimMan.generatorMan.opIndex; chunkObserverManager.loadChunkHandler = &chunkManager.loadChunk; chunkObserverManager.unloadChunkHandler = &chunkManager.unloadChunk; chunkObserverManager.chunkObserverAddedHandler = &onChunkObserverAdded; dimObserverMan.dimensionObserverAdded = &onDimensionObserverAdded; activeChunks.loadChunk = &chunkObserverManager.addServerObserver; activeChunks.unloadChunk = &chunkObserverManager.removeServerObserver; chunkManager.onChunkLoadedHandler = &onChunkLoaded; } override void init(IPluginManager pluginman) { blockPlugin = pluginman.getPlugin!BlockPluginServer; clientMan = pluginman.getPlugin!ClientManager; evDispatcher = pluginman.getPlugin!EventDispatcherPlugin; evDispatcher.subscribeToEvent(&handlePreUpdateEvent); evDispatcher.subscribeToEvent(&handlePostUpdateEvent); evDispatcher.subscribeToEvent(&handleStopEvent); evDispatcher.subscribeToEvent(&handleClientDisconnected); evDispatcher.subscribeToEvent(&handleSaveEvent); evDispatcher.subscribeToEvent(&handleClientConnectedEvent); blockEntityPlugin = pluginman.getPlugin!BlockEntityServer; connection = pluginman.getPlugin!NetServerPlugin; connection.registerPacketHandler!FillBlockBoxPacket(&handleFillBlockBoxPacket); connection.registerPacketHandler!PlaceBlockEntityPacket(&handlePlaceBlockEntityPacket); connection.registerPacketHandler!RemoveBlockEntityPacket(&handleRemoveBlockEntityPacket); chunkProvider.init(worldDb, numGenWorkersOpt.get!uint, blockPlugin.getBlocks(), saveUnmodifiedChunksOpt.get!bool); worldDb = null; activeChunks.loadActiveChunks(); worldAccess.blockInfos = blockPlugin.getBlocks(); } TimestampType currentTimestamp() @property { return worldInfo.simulationTick; } void setDimensionBorders(DimensionId dim, Box borders) { DimensionInfo* dimInfo = dimMan.getOrCreate(dim); dimInfo.borders = borders; sendDimensionBorders(dim); } private void handleSaveEvent(ref WorldSaveInternalEvent event) { if (!atomicLoad(isSaving)) { atomicStore(isSaving, true); chunkProvider.save(); foreach(saveHandler; ioManager.worldSaveHandlers) { saveHandler(pluginDataSaver); } chunkProvider.pushSaveHandler(&worldSaver); } } // executed on io thread. Stores values written into pluginDataSaver. private void worldSaver(WorldDb wdb) { foreach(ubyte[16] key, ubyte[] data; pluginDataSaver) { if (data.length == 0) wdb.del(key); wdb.put(key, data); } pluginDataSaver.reset(); atomicStore(isSaving, false); } private void loadWorld(string _worldFilename) { worldFilename = _worldFilename; worldDb = new WorldDb; static if (START_NEW_WORLD) { static import std.file; if (std.file.exists(_worldFilename)) { std.file.remove(_worldFilename); } } worldDb.open(_worldFilename); worldDb.beginTxn(); scope(exit) worldDb.abortTxn(); ubyte[] dataGetter(ref IoKey key) { return worldDb.get(formWorldKey(ioManager.stringMap.get(key))); } auto dataLoader = PluginDataLoader(&ioManager.stringMap, &dataGetter); foreach(loadHandler; ioManager.worldLoadHandlers) { loadHandler(dataLoader); } } private void readWorldInfo(ref PluginDataLoader loader) { import std.path : absolutePath, buildNormalizedPath; ubyte[] data = loader.readEntryRaw(dbKey); if (!data.empty) { worldInfo = decodeCborSingleDup!WorldInfo(data); infof("Loading world %s", worldFilename.absolutePath.buildNormalizedPath); } else { infof("Creating world %s", worldFilename.absolutePath.buildNormalizedPath); createWorld(); } } void createWorld() { dimMan.generatorMan[0] = new GeneratorFlat; dimMan.generatorMan[1] = new Generator2d; dimMan.generatorMan[2] = new Generator2d3d; } private void writeWorldInfo(ref PluginDataSaver saver) { saver.writeEntryEncoded(dbKey, worldInfo); } private void handlePreUpdateEvent(ref PreUpdateEvent event) { ++worldInfo.simulationTick; chunkProvider.update(); chunkObserverManager.update(); } private void handlePostUpdateEvent(ref PostUpdateEvent event) { chunkEditor.commitSnapshots(currentTimestamp); sendChanges(worldAccess.blockChanges); worldAccess.blockChanges = null; import voxelman.world.gen.generators; import core.atomic; dbg.setVar("gen cache hits", atomicLoad(cache_hits)); dbg.setVar("gen cache misses", atomicLoad(cache_misses)); dbg.setVar("total loads", chunkProvider.totalReceived); dbg.setVar("canceled loads", chunkProvider.numSuccessfulCancelations); dbg.setVar("wasted loads", chunkProvider.numWastedLoads); } private void handleStopEvent(ref GameStopEvent event) { while(atomicLoad(isSaving)) { import core.thread : Thread; Thread.yield(); } chunkProvider.stop(); } private void onDimensionObserverAdded(DimensionId dimensionId, SessionId sessionId) { sendDimensionBorders(sessionId, dimensionId); } private void onChunkObserverAdded(ChunkWorldPos cwp, SessionId sessionId) { sendChunk(sessionId, cwp); } private void handleClientConnectedEvent(ref ClientConnectedEvent event) { foreach(key, handler; idMapManager.idMapHandlers) { connection.sendTo(event.sessionId, IdMapPacket(key, handler())); } } private void handleClientDisconnected(ref ClientDisconnectedEvent event) { chunkObserverManager.removeObserver(event.sessionId); dimObserverMan.removeObserver(event.sessionId); } private void onChunkLoaded(ChunkWorldPos cwp) { sendChunk(chunkObserverManager.getChunkObservers(cwp), cwp); } private void sendDimensionBorders(SessionId sessionId, DimensionId dim) { if (auto dimInfo = dimMan[dim]) connection.sendTo(sessionId, DimensionInfoPacket(dim, dimInfo.borders)); } private void sendDimensionBorders(DimensionId dim) { static Buffer!SessionId sessionBuffer; if (auto dimInfo = dimMan[dim]) { foreach(sessionId; dimObserverMan.getDimensionObservers(dim)) sessionBuffer.put(sessionId); connection.sendTo(sessionBuffer.data, DimensionInfoPacket(dim, dimInfo.borders)); sessionBuffer.clear(); } } private void sendChunk(S)(S sessions, ChunkWorldPos cwp) { import voxelman.core.packets : ChunkDataPacket; if (!chunkManager.isChunkLoaded(cwp)) return; ChunkLayerData[NUM_CHUNK_LAYERS] layerBuf; size_t compressedSize; ubyte numChunkLayers; foreach(ubyte layerId; 0..chunkManager.numLayers) { if (!chunkManager.hasSnapshot(cwp, layerId)) continue; auto layer = chunkManager.getChunkSnapshot(cwp, layerId); assert(!layer.isNull); version(DBG_COMPR)if (layer.type != StorageType.uniform) { ubyte[] compactBlocks = layer.getArray!ubyte; infof("Send %s %s %s\n(%(%02x%))", cwp, compactBlocks.ptr, compactBlocks.length, cast(ubyte[])compactBlocks); } ChunkLayerData bd = toBlockData(layer, layerId); if (layer.type == StorageType.fullArray) { ubyte[] compactBlocks = compressLayerData(layer.getArray!ubyte, buf[compressedSize..$]); compressedSize += compactBlocks.length; bd.blocks = compactBlocks; } layerBuf[numChunkLayers] = bd; ++numChunkLayers; } connection.sendTo(sessions, ChunkDataPacket(cwp.ivector, layerBuf[0..numChunkLayers])); } private void sendChanges(BlockChange[][ChunkWorldPos] changes) { import voxelman.core.packets : MultiblockChangePacket; foreach(pair; changes.byKeyValue) { connection.sendTo( chunkObserverManager.getChunkObservers(pair.key), MultiblockChangePacket(pair.key.ivector, pair.value)); } } private void handleFillBlockBoxPacket(ubyte[] packetData, SessionId sessionId) { import voxelman.core.packets : FillBlockBoxPacket; if (clientMan.isSpawned(sessionId)) { auto packet = unpackPacketNoDup!FillBlockBoxPacket(packetData); // TODO send to observers only. worldAccess.fillBox(packet.box, packet.blockId, packet.blockMeta); connection.sendToAll(packet); } } private void handlePlaceBlockEntityPacket(ubyte[] packetData, SessionId sessionId) { auto packet = unpackPacket!PlaceBlockEntityPacket(packetData); placeEntity( packet.box, packet.data, worldAccess, entityAccess); // TODO send to observers only. connection.sendToAll(packet); } private void handleRemoveBlockEntityPacket(ubyte[] packetData, SessionId peer) { auto packet = unpackPacket!RemoveBlockEntityPacket(packetData); WorldBox vol = removeEntity(BlockWorldPos(packet.blockPos), blockEntityPlugin.blockEntityInfos, worldAccess, entityAccess, /*AIR*/1); //infof("Remove entity at %s", vol); connection.sendToAll(packet); } }
D
module deimos.cef3.ookie; // Copyright (c) 2012 Marshall A. Greenblatt. 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 name of Google Inc. nor the name Chromium Embedded // Framework 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. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool and should not edited // by hand. See the translator.README.txt file in the tools directory for // more information. // extern(C) { import deimos.cef3.base; import deimos.cef3.callback; /// // Structure used for managing cookies. The functions of this structure may be // called on any thread unless otherwise indicated. /// struct cef_cookie_manager_t { /// // Base structure. /// cef_base_t base; /// // Set the schemes supported by this manager. By default only "http" and // "https" schemes are supported. Must be called before any cookies are // accessed. /// extern(System) void function(cef_cookie_manager_t* self, cef_string_list_t schemes) set_supported_schemes; /// // Visit all cookies. The returned cookies are ordered by longest path, then // by earliest creation date. Returns false (0) if cookies cannot be accessed. /// extern(System) int function(cef_cookie_manager_t* self, cef_cookie_visitor_t* visitor) visit_all_cookies; /// // Visit a subset of cookies. The results are filtered by the given url // scheme, host, domain and path. If |includeHttpOnly| is true (1) HTTP-only // cookies will also be included in the results. The returned cookies are // ordered by longest path, then by earliest creation date. Returns false (0) // if cookies cannot be accessed. /// extern(System) int function(cef_cookie_manager_t* self, const(cef_string_t)* url, int includeHttpOnly, cef_cookie_visitor_t* visitor) visit_url_cookies; /// // Sets a cookie given a valid URL and explicit user-provided cookie // attributes. This function expects each attribute to be well-formed. It will // check for disallowed characters (e.g. the ';' character is disallowed // within the cookie value attribute) and will return false (0) without // setting the cookie if such characters are found. This function must be // called on the IO thread. /// extern(System) int function(cef_cookie_manager_t* self, const(cef_string_t)* url, const(cef_cookie_t)* cookie) set_cookie; /// // Delete all cookies that match the specified parameters. If both |url| and // values |cookie_name| are specified all host and domain cookies matching // both will be deleted. If only |url| is specified all host cookies (but not // domain cookies) irrespective of path will be deleted. If |url| is NULL all // cookies for all hosts and domains will be deleted. Returns false (0) if a // non- NULL invalid URL is specified or if cookies cannot be accessed. This // function must be called on the IO thread. /// extern(System) int function(cef_cookie_manager_t* self, const(cef_string_t)* url, const(cef_string_t)* cookie_name) delete_cookies; /// // Sets the directory path that will be used for storing cookie data. If // |path| is NULL data will be stored in memory only. Otherwise, data will be // stored at the specified |path|. To persist session cookies (cookies without // an expiry date or validity interval) set |persist_session_cookies| to true // (1). Session cookies are generally intended to be transient and most Web // browsers do not persist them. Returns false (0) if cookies cannot be // accessed. /// extern(System) int function(cef_cookie_manager_t* self, const(cef_string_t)* path, int persist_session_cookies) set_storage_path; /// // Flush the backing store (if any) to disk and execute the specified // |callback| on the IO thread when done. Returns false (0) if cookies cannot // be accessed. /// extern(System) int function(cef_cookie_manager_t* self, cef_completion_callback_t* callback) flush_store; } /// // Returns the global cookie manager. By default data will be stored at // CefSettings.cache_path if specified or in memory otherwise. /// cef_cookie_manager_t* cef_cookie_manager_get_global_manager(); /// // Creates a new cookie manager. If |path| is NULL data will be stored in memory // only. Otherwise, data will be stored at the specified |path|. To persist // session cookies (cookies without an expiry date or validity interval) set // |persist_session_cookies| to true (1). Session cookies are generally intended // to be transient and most Web browsers do not persist them. Returns NULL if // creation fails. /// cef_cookie_manager_t* cef_cookie_manager_create_manager(const(cef_string_t)* path, int persist_session_cookies); /// // Structure to implement for visiting cookie values. The functions of this // structure will always be called on the IO thread. /// struct cef_cookie_visitor_t { /// // Base structure. /// cef_base_t base; /// // Method that will be called once for each cookie. |count| is the 0-based // index for the current cookie. |total| is the total number of cookies. Set // |deleteCookie| to true (1) to delete the cookie currently being visited. // Return false (0) to stop visiting cookies. This function may never be // called if no cookies are found. /// extern(System) int function(cef_cookie_visitor_t* self, const(cef_cookie_t)* cookie, int count, int total, int* deleteCookie) visit; } }
D
// Written in the D programming language. /** This module defines the notion of a range. Ranges generalize the concept of arrays, lists, or anything that involves sequential access. This abstraction enables the same set of algorithms (see $(MREF std, algorithm)) to be used with a vast variety of different concrete types. For example, a linear search algorithm such as $(REF find, std, algorithm, searching) works not just for arrays, but for linked-lists, input files, incoming network data, etc. Guides: There are many articles available that can bolster understanding ranges: $(UL $(LI Ali Çehreli's $(HTTP ddili.org/ders/d.en/ranges.html, tutorial on ranges) for the basics of working with and creating range-based code.) $(LI Jonathan M. Davis $(LINK2 http://dconf.org/2015/talks/davis.html, $(I Introduction to Ranges)) talk at DConf 2015 a vivid introduction from its core constructs to practical advice.) $(LI The DLang Tour's $(LINK2 http://tour.dlang.org/tour/en/basics/ranges, chapter on ranges) for an interactive introduction.) $(LI H. S. Teoh's $(LINK2 http://wiki.dlang.org/Component_programming_with_ranges, tutorial on component programming with ranges) for a real-world showcase of the influence of range-based programming on complex algorithms.) $(LI Andrei Alexandrescu's article $(LINK2 http://www.informit.com/articles/printerfriendly.aspx?p=1407357$(AMP)rll=1, $(I On Iteration)) for conceptual aspect of ranges and the motivation ) ) Submodules: This module has two submodules: The $(MREF std, range, primitives) submodule provides basic range functionality. It defines several templates for testing whether a given object is a range, what kind of range it is, and provides some common range operations. The $(MREF std, range, interfaces) submodule provides object-based interfaces for working with ranges via runtime polymorphism. The remainder of this module provides a rich set of range creation and composition templates that let you construct new ranges out of existing ranges: $(SCRIPT inhibitQuickIndex = 1;) $(BOOKTABLE , $(TR $(TD $(LREF chain)) $(TD Concatenates several ranges into a single range. )) $(TR $(TD $(LREF choose)) $(TD Chooses one of two ranges at runtime based on a boolean condition. )) $(TR $(TD $(LREF chooseAmong)) $(TD Chooses one of several ranges at runtime based on an index. )) $(TR $(TD $(LREF chunks)) $(TD Creates a range that returns fixed-size chunks of the original range. )) $(TR $(TD $(LREF cycle)) $(TD Creates an infinite range that repeats the given forward range indefinitely. Good for implementing circular buffers. )) $(TR $(TD $(LREF drop)) $(TD Creates the range that results from discarding the first $(I n) elements from the given range. )) $(TR $(TD $(LREF dropBack)) $(TD Creates the range that results from discarding the last $(I n) elements from the given range. )) $(TR $(TD $(LREF dropExactly)) $(TD Creates the range that results from discarding exactly $(I n) of the first elements from the given range. )) $(TR $(TD $(LREF dropBackExactly)) $(TD Creates the range that results from discarding exactly $(I n) of the last elements from the given range. )) $(TR $(TD $(LREF dropOne)) $(TD Creates the range that results from discarding the first element from the given range. )) $(TR $(TD $(D $(LREF dropBackOne))) $(TD Creates the range that results from discarding the last element from the given range. )) $(TR $(TD $(LREF enumerate)) $(TD Iterates a range with an attached index variable. )) $(TR $(TD $(LREF evenChunks)) $(TD Creates a range that returns a number of chunks of approximately equal length from the original range. )) $(TR $(TD $(LREF frontTransversal)) $(TD Creates a range that iterates over the first elements of the given ranges. )) $(TR $(TD $(LREF generate)) $(TD Creates a range by successive calls to a given function. This allows to create ranges as a single delegate. )) $(TR $(TD $(LREF indexed)) $(TD Creates a range that offers a view of a given range as though its elements were reordered according to a given range of indices. )) $(TR $(TD $(LREF iota)) $(TD Creates a range consisting of numbers between a starting point and ending point, spaced apart by a given interval. )) $(TR $(TD $(LREF lockstep)) $(TD Iterates $(I n) ranges in lockstep, for use in a `foreach` loop. Similar to `zip`, except that `lockstep` is designed especially for `foreach` loops. )) $(TR $(TD $(LREF nullSink)) $(TD An output range that discards the data it receives. )) $(TR $(TD $(LREF only)) $(TD Creates a range that iterates over the given arguments. )) $(TR $(TD $(LREF padLeft)) $(TD Pads a range to a specified length by adding a given element to the front of the range. Is lazy if the range has a known length. )) $(TR $(TD $(LREF padRight)) $(TD Lazily pads a range to a specified length by adding a given element to the back of the range. )) $(TR $(TD $(LREF radial)) $(TD Given a random-access range and a starting point, creates a range that alternately returns the next left and next right element to the starting point. )) $(TR $(TD $(LREF recurrence)) $(TD Creates a forward range whose values are defined by a mathematical recurrence relation. )) $(TR $(TD $(LREF refRange)) $(TD Pass a range by reference. Both the original range and the RefRange will always have the exact same elements. Any operation done on one will affect the other. )) $(TR $(TD $(LREF repeat)) $(TD Creates a range that consists of a single element repeated $(I n) times, or an infinite range repeating that element indefinitely. )) $(TR $(TD $(LREF retro)) $(TD Iterates a bidirectional range backwards. )) $(TR $(TD $(LREF roundRobin)) $(TD Given $(I n) ranges, creates a new range that return the $(I n) first elements of each range, in turn, then the second element of each range, and so on, in a round-robin fashion. )) $(TR $(TD $(LREF sequence)) $(TD Similar to `recurrence`, except that a random-access range is created. )) $(TR $(TD $(D $(LREF slide))) $(TD Creates a range that returns a fixed-size sliding window over the original range. Unlike chunks, it advances a configurable number of items at a time, not one chunk at a time. )) $(TR $(TD $(LREF stride)) $(TD Iterates a range with stride $(I n). )) $(TR $(TD $(LREF tail)) $(TD Return a range advanced to within `n` elements of the end of the given range. )) $(TR $(TD $(LREF take)) $(TD Creates a sub-range consisting of only up to the first $(I n) elements of the given range. )) $(TR $(TD $(LREF takeExactly)) $(TD Like `take`, but assumes the given range actually has $(I n) elements, and therefore also defines the `length` property. )) $(TR $(TD $(LREF takeNone)) $(TD Creates a random-access range consisting of zero elements of the given range. )) $(TR $(TD $(LREF takeOne)) $(TD Creates a random-access range consisting of exactly the first element of the given range. )) $(TR $(TD $(LREF tee)) $(TD Creates a range that wraps a given range, forwarding along its elements while also calling a provided function with each element. )) $(TR $(TD $(LREF transposed)) $(TD Transposes a range of ranges. )) $(TR $(TD $(LREF transversal)) $(TD Creates a range that iterates over the $(I n)'th elements of the given random-access ranges. )) $(TR $(TD $(LREF zip)) $(TD Given $(I n) ranges, creates a range that successively returns a tuple of all the first elements, a tuple of all the second elements, etc. )) ) Sortedness: Ranges whose elements are sorted afford better efficiency with certain operations. For this, the $(LREF assumeSorted) function can be used to construct a $(LREF SortedRange) from a pre-sorted range. The $(REF sort, std, algorithm, sorting) function also conveniently returns a $(LREF SortedRange). $(LREF SortedRange) objects provide some additional range operations that take advantage of the fact that the range is sorted. Source: $(PHOBOSSRC std/range/package.d) License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(HTTP erdani.com, Andrei Alexandrescu), David Simcha, $(HTTP jmdavisprog.com, Jonathan M Davis), and Jack Stouffer. Credit for some of the ideas in building this module goes to $(HTTP fantascienza.net/leonardo/so/, Leonardo Maffi). */ module std.range; public import std.array; public import std.range.interfaces; public import std.range.primitives; public import std.typecons : Flag, Yes, No; import std.meta; // allSatisfy, staticMap import std.traits; // CommonType, isCallable, isFloatingPoint, isIntegral, // isPointer, isSomeFunction, isStaticArray, Unqual, isInstanceOf /** Iterates a bidirectional range backwards. The original range can be accessed by using the `source` property. Applying retro twice to the same range yields the original range. Params: r = the bidirectional range to iterate backwards Returns: A bidirectional range with length if `r` also provides a length. Or, if `r` is a random access range, then the return value will be random access as well. See_Also: $(REF reverse, std,algorithm,mutation) for mutating the source range directly. */ auto retro(Range)(Range r) if (isBidirectionalRange!(Unqual!Range)) { // Check for retro(retro(r)) and just return r in that case static if (is(typeof(retro(r.source)) == Range)) { return r.source; } else { static struct Result() { private alias R = Unqual!Range; // User code can get and set source, too R source; static if (hasLength!R) { size_t retroIndex(size_t n) { return source.length - n - 1; } } public: alias Source = R; @property bool empty() { return source.empty; } @property auto save() { return Result(source.save); } @property auto ref front() { return source.back; } void popFront() { source.popBack(); } @property auto ref back() { return source.front; } void popBack() { source.popFront(); } static if (is(typeof(source.moveBack()))) { ElementType!R moveFront() { return source.moveBack(); } } static if (is(typeof(source.moveFront()))) { ElementType!R moveBack() { return source.moveFront(); } } static if (hasAssignableElements!R) { @property void front(ElementType!R val) { source.back = val; } @property void back(ElementType!R val) { source.front = val; } } static if (isRandomAccessRange!(R) && hasLength!(R)) { auto ref opIndex(size_t n) { return source[retroIndex(n)]; } static if (hasAssignableElements!R) { void opIndexAssign(ElementType!R val, size_t n) { source[retroIndex(n)] = val; } } static if (is(typeof(source.moveAt(0)))) { ElementType!R moveAt(size_t index) { return source.moveAt(retroIndex(index)); } } static if (hasSlicing!R) typeof(this) opSlice(size_t a, size_t b) { return typeof(this)(source[source.length - b .. source.length - a]); } } static if (hasLength!R) { @property auto length() { return source.length; } alias opDollar = length; } } return Result!()(r); } } /// pure @safe nothrow @nogc unittest { import std.algorithm.comparison : equal; int[5] a = [ 1, 2, 3, 4, 5 ]; int[5] b = [ 5, 4, 3, 2, 1 ]; assert(equal(retro(a[]), b[])); assert(retro(a[]).source is a[]); assert(retro(retro(a[])) is a[]); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; static assert(isBidirectionalRange!(typeof(retro("hello")))); int[] a; static assert(is(typeof(a) == typeof(retro(retro(a))))); assert(retro(retro(a)) is a); static assert(isRandomAccessRange!(typeof(retro([1, 2, 3])))); void test(int[] input, int[] witness) { auto r = retro(input); assert(r.front == witness.front); assert(r.back == witness.back); assert(equal(r, witness)); } test([ 1 ], [ 1 ]); test([ 1, 2 ], [ 2, 1 ]); test([ 1, 2, 3 ], [ 3, 2, 1 ]); test([ 1, 2, 3, 4 ], [ 4, 3, 2, 1 ]); test([ 1, 2, 3, 4, 5 ], [ 5, 4, 3, 2, 1 ]); test([ 1, 2, 3, 4, 5, 6 ], [ 6, 5, 4, 3, 2, 1 ]); immutable foo = [1,2,3].idup; auto r = retro(foo); assert(equal(r, [3, 2, 1])); } pure @safe nothrow unittest { import std.internal.test.dummyrange : AllDummyRanges, propagatesRangeType, ReturnBy; foreach (DummyType; AllDummyRanges) { static if (!isBidirectionalRange!DummyType) { static assert(!__traits(compiles, Retro!DummyType)); } else { DummyType dummyRange; dummyRange.reinit(); auto myRetro = retro(dummyRange); static assert(propagatesRangeType!(typeof(myRetro), DummyType)); assert(myRetro.front == 10); assert(myRetro.back == 1); assert(myRetro.moveFront() == 10); assert(myRetro.moveBack() == 1); static if (isRandomAccessRange!DummyType && hasLength!DummyType) { assert(myRetro[0] == myRetro.front); assert(myRetro.moveAt(2) == 8); static if (DummyType.r == ReturnBy.Reference) { { myRetro[9]++; scope(exit) myRetro[9]--; assert(dummyRange[0] == 2); myRetro.front++; scope(exit) myRetro.front--; assert(myRetro.front == 11); myRetro.back++; scope(exit) myRetro.back--; assert(myRetro.back == 3); } { myRetro.front = 0xFF; scope(exit) myRetro.front = 10; assert(dummyRange.back == 0xFF); myRetro.back = 0xBB; scope(exit) myRetro.back = 1; assert(dummyRange.front == 0xBB); myRetro[1] = 11; scope(exit) myRetro[1] = 8; assert(dummyRange[8] == 11); } } } } } } pure @safe nothrow @nogc unittest { import std.algorithm.comparison : equal; auto LL = iota(1L, 4L); auto r = retro(LL); long[3] excepted = [3, 2, 1]; assert(equal(r, excepted[])); } // Issue 12662 pure @safe nothrow @nogc unittest { int[3] src = [1,2,3]; int[] data = src[]; foreach_reverse (x; data) {} foreach (x; data.retro) {} } /** Iterates range `r` with stride `n`. If the range is a random-access range, moves by indexing into the range; otherwise, moves by successive calls to `popFront`. Applying stride twice to the same range results in a stride with a step that is the product of the two applications. It is an error for `n` to be 0. Params: r = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to stride over n = the number of elements to skip over Returns: At minimum, an input range. The resulting range will adopt the range primitives of the underlying range as long as $(REF hasLength, std,range,primitives) is `true`. */ auto stride(Range)(Range r, size_t n) if (isInputRange!(Unqual!Range)) in { assert(n != 0, "stride cannot have step zero."); } do { import std.algorithm.comparison : min; static if (is(typeof(stride(r.source, n)) == Range)) { // stride(stride(r, n1), n2) is stride(r, n1 * n2) return stride(r.source, r._n * n); } else { static struct Result { private alias R = Unqual!Range; public R source; private size_t _n; // Chop off the slack elements at the end static if (hasLength!R && (isRandomAccessRange!R && hasSlicing!R || isBidirectionalRange!R)) private void eliminateSlackElements() { auto slack = source.length % _n; if (slack) { slack--; } else if (!source.empty) { slack = min(_n, source.length) - 1; } else { slack = 0; } if (!slack) return; static if (isRandomAccessRange!R && hasLength!R && hasSlicing!R) { source = source[0 .. source.length - slack]; } else static if (isBidirectionalRange!R) { foreach (i; 0 .. slack) { source.popBack(); } } } static if (isForwardRange!R) { @property auto save() { return Result(source.save, _n); } } static if (isInfinite!R) { enum bool empty = false; } else { @property bool empty() { return source.empty; } } @property auto ref front() { return source.front; } static if (is(typeof(.moveFront(source)))) { ElementType!R moveFront() { return source.moveFront(); } } static if (hasAssignableElements!R) { @property void front(ElementType!R val) { source.front = val; } } void popFront() { source.popFrontN(_n); } static if (isBidirectionalRange!R && hasLength!R) { void popBack() { popBackN(source, _n); } @property auto ref back() { eliminateSlackElements(); return source.back; } static if (is(typeof(.moveBack(source)))) { ElementType!R moveBack() { eliminateSlackElements(); return source.moveBack(); } } static if (hasAssignableElements!R) { @property void back(ElementType!R val) { eliminateSlackElements(); source.back = val; } } } static if (isRandomAccessRange!R && hasLength!R) { auto ref opIndex(size_t n) { return source[_n * n]; } /** Forwards to $(D moveAt(source, n)). */ static if (is(typeof(source.moveAt(0)))) { ElementType!R moveAt(size_t n) { return source.moveAt(_n * n); } } static if (hasAssignableElements!R) { void opIndexAssign(ElementType!R val, size_t n) { source[_n * n] = val; } } } static if (hasSlicing!R && hasLength!R) typeof(this) opSlice(size_t lower, size_t upper) { assert(upper >= lower && upper <= length); immutable translatedUpper = (upper == 0) ? 0 : (upper * _n - (_n - 1)); immutable translatedLower = min(lower * _n, translatedUpper); assert(translatedLower <= translatedUpper); return typeof(this)(source[translatedLower .. translatedUpper], _n); } static if (hasLength!R) { @property auto length() { return (source.length + _n - 1) / _n; } alias opDollar = length; } } return Result(r, n); } } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]; assert(equal(stride(a, 3), [ 1, 4, 7, 10 ][])); assert(stride(stride(a, 2), 3) == stride(a, 6)); } pure @safe nothrow @nogc unittest { import std.algorithm.comparison : equal; int[4] testArr = [1,2,3,4]; static immutable result = [1, 3]; assert(equal(testArr[].stride(2), result)); } debug pure nothrow @system unittest {//check the contract int[4] testArr = [1,2,3,4]; bool passed = false; scope (success) assert(passed); import core.exception : AssertError; //std.exception.assertThrown won't do because it can't infer nothrow // @@@BUG@@@ 12647 try { auto unused = testArr[].stride(0); } catch (AssertError unused) { passed = true; } } pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges, propagatesRangeType, ReturnBy; static assert(isRandomAccessRange!(typeof(stride([1, 2, 3], 2)))); void test(size_t n, int[] input, int[] witness) { assert(equal(stride(input, n), witness)); } test(1, [], []); int[] arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; assert(stride(stride(arr, 2), 3) is stride(arr, 6)); test(1, arr, arr); test(2, arr, [1, 3, 5, 7, 9]); test(3, arr, [1, 4, 7, 10]); test(4, arr, [1, 5, 9]); // Test slicing. auto s1 = stride(arr, 1); assert(equal(s1[1 .. 4], [2, 3, 4])); assert(s1[1 .. 4].length == 3); assert(equal(s1[1 .. 5], [2, 3, 4, 5])); assert(s1[1 .. 5].length == 4); assert(s1[0 .. 0].empty); assert(s1[3 .. 3].empty); // assert(s1[$ .. $].empty); assert(s1[s1.opDollar .. s1.opDollar].empty); auto s2 = stride(arr, 2); assert(equal(s2[0 .. 2], [1,3])); assert(s2[0 .. 2].length == 2); assert(equal(s2[1 .. 5], [3, 5, 7, 9])); assert(s2[1 .. 5].length == 4); assert(s2[0 .. 0].empty); assert(s2[3 .. 3].empty); // assert(s2[$ .. $].empty); assert(s2[s2.opDollar .. s2.opDollar].empty); // Test fix for Bug 5035 auto m = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]; // 3 rows, 4 columns auto col = stride(m, 4); assert(equal(col, [1, 1, 1])); assert(equal(retro(col), [1, 1, 1])); immutable int[] immi = [ 1, 2, 3 ]; static assert(isRandomAccessRange!(typeof(stride(immi, 1)))); // Check for infiniteness propagation. static assert(isInfinite!(typeof(stride(repeat(1), 3)))); foreach (DummyType; AllDummyRanges) { DummyType dummyRange; dummyRange.reinit(); auto myStride = stride(dummyRange, 4); // Should fail if no length and bidirectional b/c there's no way // to know how much slack we have. static if (hasLength!DummyType || !isBidirectionalRange!DummyType) { static assert(propagatesRangeType!(typeof(myStride), DummyType)); } assert(myStride.front == 1); assert(myStride.moveFront() == 1); assert(equal(myStride, [1, 5, 9])); static if (hasLength!DummyType) { assert(myStride.length == 3); } static if (isBidirectionalRange!DummyType && hasLength!DummyType) { assert(myStride.back == 9); assert(myStride.moveBack() == 9); } static if (isRandomAccessRange!DummyType && hasLength!DummyType) { assert(myStride[0] == 1); assert(myStride[1] == 5); assert(myStride.moveAt(1) == 5); assert(myStride[2] == 9); static assert(hasSlicing!(typeof(myStride))); } static if (DummyType.r == ReturnBy.Reference) { // Make sure reference is propagated. { myStride.front++; scope(exit) myStride.front--; assert(dummyRange.front == 2); } { myStride.front = 4; scope(exit) myStride.front = 1; assert(dummyRange.front == 4); } static if (isBidirectionalRange!DummyType && hasLength!DummyType) { { myStride.back++; scope(exit) myStride.back--; assert(myStride.back == 10); } { myStride.back = 111; scope(exit) myStride.back = 9; assert(myStride.back == 111); } static if (isRandomAccessRange!DummyType) { { myStride[1]++; scope(exit) myStride[1]--; assert(dummyRange[4] == 6); } { myStride[1] = 55; scope(exit) myStride[1] = 5; assert(dummyRange[4] == 55); } } } } } } pure @safe nothrow unittest { import std.algorithm.comparison : equal; auto LL = iota(1L, 10L); auto s = stride(LL, 3); assert(equal(s, [1L, 4L, 7L])); } /** Spans multiple ranges in sequence. The function `chain` takes any number of ranges and returns a $(D Chain!(R1, R2,...)) object. The ranges may be different, but they must have the same element type. The result is a range that offers the `front`, `popFront`, and $(D empty) primitives. If all input ranges offer random access and $(D length), `Chain` offers them as well. If only one range is offered to `Chain` or `chain`, the $(D Chain) type exits the picture by aliasing itself directly to that range's type. Params: rs = the $(REF_ALTTEXT input ranges, isInputRange, std,range,primitives) to chain together Returns: An input range at minimum. If all of the ranges in `rs` provide a range primitive, the returned range will also provide that range primitive. See_Also: $(LREF only) to chain values to a range */ auto chain(Ranges...)(Ranges rs) if (Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void)) { static if (Ranges.length == 1) { return rs[0]; } else { static struct Result { private: alias R = staticMap!(Unqual, Ranges); alias RvalueElementType = CommonType!(staticMap!(.ElementType, R)); private template sameET(A) { enum sameET = is(.ElementType!A == RvalueElementType); } enum bool allSameType = allSatisfy!(sameET, R); // This doesn't work yet static if (allSameType) { alias ElementType = ref RvalueElementType; } else { alias ElementType = RvalueElementType; } static if (allSameType && allSatisfy!(hasLvalueElements, R)) { static ref RvalueElementType fixRef(ref RvalueElementType val) { return val; } } else { static RvalueElementType fixRef(RvalueElementType val) { return val; } } // This is the entire state R source; // TODO: use a vtable (or more) instead of linear iteration public: this(R input) { foreach (i, v; input) { source[i] = v; } } import std.meta : anySatisfy; static if (anySatisfy!(isInfinite, R)) { // Propagate infiniteness. enum bool empty = false; } else { @property bool empty() { foreach (i, Unused; R) { if (!source[i].empty) return false; } return true; } } static if (allSatisfy!(isForwardRange, R)) @property auto save() { auto saveSource(size_t len)() { import std.typecons : tuple; static assert(len > 0); static if (len == 1) { return tuple(source[0].save); } else { return saveSource!(len - 1)() ~ tuple(source[len - 1].save); } } return Result(saveSource!(R.length).expand); } void popFront() { foreach (i, Unused; R) { if (source[i].empty) continue; source[i].popFront(); return; } } @property auto ref front() { foreach (i, Unused; R) { if (source[i].empty) continue; return fixRef(source[i].front); } assert(false); } static if (allSameType && allSatisfy!(hasAssignableElements, R)) { // @@@BUG@@@ //@property void front(T)(T v) if (is(T : RvalueElementType)) @property void front(RvalueElementType v) { foreach (i, Unused; R) { if (source[i].empty) continue; source[i].front = v; return; } assert(false); } } static if (allSatisfy!(hasMobileElements, R)) { RvalueElementType moveFront() { foreach (i, Unused; R) { if (source[i].empty) continue; return source[i].moveFront(); } assert(false); } } static if (allSatisfy!(isBidirectionalRange, R)) { @property auto ref back() { foreach_reverse (i, Unused; R) { if (source[i].empty) continue; return fixRef(source[i].back); } assert(false); } void popBack() { foreach_reverse (i, Unused; R) { if (source[i].empty) continue; source[i].popBack(); return; } } static if (allSatisfy!(hasMobileElements, R)) { RvalueElementType moveBack() { foreach_reverse (i, Unused; R) { if (source[i].empty) continue; return source[i].moveBack(); } assert(false); } } static if (allSameType && allSatisfy!(hasAssignableElements, R)) { @property void back(RvalueElementType v) { foreach_reverse (i, Unused; R) { if (source[i].empty) continue; source[i].back = v; return; } assert(false); } } } static if (allSatisfy!(hasLength, R)) { @property size_t length() { size_t result; foreach (i, Unused; R) { result += source[i].length; } return result; } alias opDollar = length; } static if (allSatisfy!(isRandomAccessRange, R)) { auto ref opIndex(size_t index) { foreach (i, Range; R) { static if (isInfinite!(Range)) { return source[i][index]; } else { immutable length = source[i].length; if (index < length) return fixRef(source[i][index]); index -= length; } } assert(false); } static if (allSatisfy!(hasMobileElements, R)) { RvalueElementType moveAt(size_t index) { foreach (i, Range; R) { static if (isInfinite!(Range)) { return source[i].moveAt(index); } else { immutable length = source[i].length; if (index < length) return source[i].moveAt(index); index -= length; } } assert(false); } } static if (allSameType && allSatisfy!(hasAssignableElements, R)) void opIndexAssign(ElementType v, size_t index) { foreach (i, Range; R) { static if (isInfinite!(Range)) { source[i][index] = v; } else { immutable length = source[i].length; if (index < length) { source[i][index] = v; return; } index -= length; } } assert(false); } } static if (allSatisfy!(hasLength, R) && allSatisfy!(hasSlicing, R)) auto opSlice(size_t begin, size_t end) { auto result = this; foreach (i, Unused; R) { immutable len = result.source[i].length; if (len < begin) { result.source[i] = result.source[i] [len .. len]; begin -= len; } else { result.source[i] = result.source[i] [begin .. len]; break; } } auto cut = length; cut = cut <= end ? 0 : cut - end; foreach_reverse (i, Unused; R) { immutable len = result.source[i].length; if (cut > len) { result.source[i] = result.source[i] [0 .. 0]; cut -= len; } else { result.source[i] = result.source[i] [0 .. len - cut]; break; } } return result; } } return Result(rs); } } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; int[] arr1 = [ 1, 2, 3, 4 ]; int[] arr2 = [ 5, 6 ]; int[] arr3 = [ 7 ]; auto s = chain(arr1, arr2, arr3); assert(s.length == 7); assert(s[5] == 6); assert(equal(s, [1, 2, 3, 4, 5, 6, 7][])); } /** * Range primitives are carried over to the returned range if * all of the ranges provide them */ pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.algorithm.sorting : sort; int[] arr1 = [5, 2, 8]; int[] arr2 = [3, 7, 9]; int[] arr3 = [1, 4, 6]; // in-place sorting across all of the arrays auto s = arr1.chain(arr2, arr3).sort; assert(s.equal([1, 2, 3, 4, 5, 6, 7, 8, 9])); assert(arr1.equal([1, 2, 3])); assert(arr2.equal([4, 5, 6])); assert(arr3.equal([7, 8, 9])); } /** Due to safe type promotion in D, chaining together different character ranges results in a `uint` range. Use $(REF_ALTTEXT byChar, byChar,std,utf), $(REF_ALTTEXT byWchar, byWchar,std,utf), and $(REF_ALTTEXT byDchar, byDchar,std,utf) on the ranges to get the type you need. */ pure @safe nothrow unittest { import std.utf : byChar, byCodeUnit; auto s1 = "string one"; auto s2 = "string two"; // s1 and s2 front is dchar because of auto-decoding static assert(is(typeof(s1.front) == dchar) && is(typeof(s2.front) == dchar)); auto r1 = s1.chain(s2); // chains of ranges of the same character type give that same type static assert(is(typeof(r1.front) == dchar)); auto s3 = "string three".byCodeUnit; static assert(is(typeof(s3.front) == immutable char)); auto r2 = s1.chain(s3); // type is promoted static assert(is(typeof(r2.front) == uint)); // use byChar on character ranges to correctly convert them to UTF-8 auto r3 = s1.byChar.chain(s3); static assert(is(typeof(r3.front) == immutable char)); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges, dummyLength, propagatesRangeType; { int[] arr1 = [ 1, 2, 3, 4 ]; int[] arr2 = [ 5, 6 ]; int[] arr3 = [ 7 ]; int[] witness = [ 1, 2, 3, 4, 5, 6, 7 ]; auto s1 = chain(arr1); static assert(isRandomAccessRange!(typeof(s1))); auto s2 = chain(arr1, arr2); static assert(isBidirectionalRange!(typeof(s2))); static assert(isRandomAccessRange!(typeof(s2))); s2.front = 1; auto s = chain(arr1, arr2, arr3); assert(s[5] == 6); assert(equal(s, witness)); assert(s[5] == 6); } { int[] arr1 = [ 1, 2, 3, 4 ]; int[] witness = [ 1, 2, 3, 4 ]; assert(equal(chain(arr1), witness)); } { uint[] foo = [1,2,3,4,5]; uint[] bar = [1,2,3,4,5]; auto c = chain(foo, bar); c[3] = 42; assert(c[3] == 42); assert(c.moveFront() == 1); assert(c.moveBack() == 5); assert(c.moveAt(4) == 5); assert(c.moveAt(5) == 1); } // Make sure bug 3311 is fixed. ChainImpl should compile even if not all // elements are mutable. assert(equal(chain(iota(0, 3), iota(0, 3)), [0, 1, 2, 0, 1, 2])); // Test the case where infinite ranges are present. auto inf = chain([0,1,2][], cycle([4,5,6][]), [7,8,9][]); // infinite range assert(inf[0] == 0); assert(inf[3] == 4); assert(inf[6] == 4); assert(inf[7] == 5); static assert(isInfinite!(typeof(inf))); immutable int[] immi = [ 1, 2, 3 ]; immutable float[] immf = [ 1, 2, 3 ]; static assert(is(typeof(chain(immi, immf)))); // Check that chain at least instantiates and compiles with every possible // pair of DummyRange types, in either order. foreach (DummyType1; AllDummyRanges) (){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 DummyType1 dummy1; foreach (DummyType2; AllDummyRanges) { DummyType2 dummy2; auto myChain = chain(dummy1, dummy2); static assert( propagatesRangeType!(typeof(myChain), DummyType1, DummyType2) ); assert(myChain.front == 1); foreach (i; 0 .. dummyLength) { myChain.popFront(); } assert(myChain.front == 1); static if (isBidirectionalRange!DummyType1 && isBidirectionalRange!DummyType2) { assert(myChain.back == 10); } static if (isRandomAccessRange!DummyType1 && isRandomAccessRange!DummyType2) { assert(myChain[0] == 1); } static if (hasLvalueElements!DummyType1 && hasLvalueElements!DummyType2) { static assert(hasLvalueElements!(typeof(myChain))); } else { static assert(!hasLvalueElements!(typeof(myChain))); } } }(); } pure @safe nothrow @nogc unittest { class Foo{} immutable(Foo)[] a; immutable(Foo)[] b; assert(chain(a, b).empty); } pure @safe unittest // issue 18657 { import std.algorithm.comparison : equal; auto r = refRange(&["foo"][0]).chain("bar"); assert(equal(r.save, "foobar")); assert(equal(r, "foobar")); } /** Choose one of two ranges at runtime depending on a Boolean condition. The ranges may be different, but they must have compatible element types (i.e. `CommonType` must exist for the two element types). The result is a range that offers the weakest capabilities of the two (e.g. `ForwardRange` if $(D R1) is a random-access range and `R2` is a forward range). Params: condition = which range to choose: `r1` if `true`, `r2` otherwise r1 = the "true" range r2 = the "false" range Returns: A range type dependent on `R1` and `R2`. */ auto choose(R1, R2)(bool condition, return scope R1 r1, return scope R2 r2) if (isInputRange!(Unqual!R1) && isInputRange!(Unqual!R2) && !is(CommonType!(ElementType!(Unqual!R1), ElementType!(Unqual!R2)) == void)) { return ChooseResult!(R1, R2)(condition, r1, r2); } /// @safe nothrow pure @nogc unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter, map; auto data1 = only(1, 2, 3, 4).filter!(a => a != 3); auto data2 = only(5, 6, 7, 8).map!(a => a + 1); // choose() is primarily useful when you need to select one of two ranges // with different types at runtime. static assert(!is(typeof(data1) == typeof(data2))); auto chooseRange(bool pickFirst) { // The returned range is a common wrapper type that can be used for // returning or storing either range without running into a type error. return choose(pickFirst, data1, data2); // Simply returning the chosen range without using choose() does not // work, because map() and filter() return different types. //return pickFirst ? data1 : data2; // does not compile } auto result = chooseRange(true); assert(result.equal(only(1, 2, 4))); result = chooseRange(false); assert(result.equal(only(6, 7, 8, 9))); } private struct ChooseResult(R1, R2) { import std.traits : hasElaborateCopyConstructor, hasElaborateDestructor; private union { R1 r1; R2 r2; } private bool r1Chosen; private static auto ref actOnChosen(alias foo, ExtraArgs ...)(ref ChooseResult r, auto ref ExtraArgs extraArgs) { if (r.r1Chosen) { ref get1(return ref ChooseResult r) @trusted { return r.r1; } return foo(get1(r), extraArgs); } else { ref get2(return ref ChooseResult r) @trusted { return r.r2; } return foo(get2(r), extraArgs); } } this(bool r1Chosen, return scope R1 r1, return scope R2 r2) @trusted { // @trusted because of assignment of r1 and r2 which overlap each other import std.conv : emplace; // This should be the only place r1Chosen is ever assigned // independently this.r1Chosen = r1Chosen; if (r1Chosen) { this.r2 = R2.init; emplace(&this.r1, r1); } else { this.r1 = R1.init; emplace(&this.r2, r2); } } void opAssign(return scope ChooseResult r) @trusted { r1Chosen = r.r1Chosen; if (r1Chosen) r1 = r.r1; // assigning to union members is @system else r2 = r.r2; } // Carefully defined postblit to postblit the appropriate range static if (hasElaborateCopyConstructor!R1 || hasElaborateCopyConstructor!R2) this(this) { actOnChosen!((ref r) { static if (hasElaborateCopyConstructor!(typeof(r))) r.__postblit(); })(this); } static if (hasElaborateDestructor!R1 || hasElaborateDestructor!R2) ~this() { actOnChosen!((ref r) => destroy(r))(this); } static if (isInfinite!R1 && isInfinite!R2) // Propagate infiniteness. enum bool empty = false; else @property bool empty() { return actOnChosen!(r => r.empty)(this); } @property auto ref front() { static auto ref getFront(R)(ref R r) { return r.front; } return actOnChosen!getFront(this); } void popFront() { return actOnChosen!((ref r) { r.popFront; })(this); } static if (isForwardRange!R1 && isForwardRange!R2) { private auto systemSave() return scope { return r1Chosen ? ChooseResult(r1Chosen, r1.save, r2) : ChooseResult(r1Chosen, r1, r2.save); } private auto trustedSave()() @trusted return scope { /* Unsafe operations in this function: - copying r1/r2 (postblit or copy constructor), - r1.save/r2.save, - accessing the union of r1 and r2. The first two cannot be trusted, because they involve calling user code. So they're only called via @safe wrappers. The last one can be trusted. We're not returning a reference into the union. */ R safeSave(R)(ref R r) @safe { return r.save; } R safeCopy(R)(ref R r) @safe { return r; } return r1Chosen ? ChooseResult(r1Chosen, safeSave(r1), safeCopy(r2)) : ChooseResult(r1Chosen, safeCopy(r1), safeSave(r2)); } @property auto save() return scope { static if (__traits(compiles, trustedSave())) return trustedSave(); else return systemSave(); } } @property void front(T)(T v) if (is(typeof({ r1.front = v; r2.front = v; }))) { actOnChosen!((ref r, T v) { r.front = v; })(this, v); } static if (hasMobileElements!R1 && hasMobileElements!R2) auto moveFront() { return actOnChosen!((ref r) => r.moveFront)(this); } static if (isBidirectionalRange!R1 && isBidirectionalRange!R2) { @property auto ref back() { static auto ref getBack(R)(ref R r) { return r.back; } return actOnChosen!getBack(this); } void popBack() { actOnChosen!((ref r) { r.popBack; })(this); } static if (hasMobileElements!R1 && hasMobileElements!R2) auto moveBack() { return actOnChosen!((ref r) => r.moveBack)(this); } @property void back(T)(T v) if (is(typeof({ r1.back = v; r2.back = v; }))) { actOnChosen!((ref r, T v) { r.back = v; })(this, v); } } static if (hasLength!R1 && hasLength!R2) { @property size_t length() { return actOnChosen!(r => r.length)(this); } alias opDollar = length; } static if (isRandomAccessRange!R1 && isRandomAccessRange!R2) { auto ref opIndex(size_t index) { static auto ref get(R)(ref R r, size_t index) { return r[index]; } return actOnChosen!get(this, index); } static if (hasMobileElements!R1 && hasMobileElements!R2) auto moveAt(size_t index) { return actOnChosen!((ref r, size_t index) => r.moveAt(index)) (this, index); } void opIndexAssign(T)(T v, size_t index) if (is(typeof({ r1[1] = v; r2[1] = v; }))) { return actOnChosen!((ref r, size_t index, T v) { r[index] = v; }) (this, index, v); } } static if (hasSlicing!R1 && hasSlicing!R2) auto opSlice(size_t begin, size_t end) { alias Slice1 = typeof(R1.init[0 .. 1]); alias Slice2 = typeof(R2.init[0 .. 1]); return actOnChosen!((r, size_t begin, size_t end) { static if (is(typeof(r) == Slice1)) return choose(true, r[begin .. end], Slice2.init); else return choose(false, Slice1.init, r[begin .. end]); })(this, begin, end); } } pure @safe unittest // issue 18657 { import std.algorithm.comparison : equal; auto r = choose(true, refRange(&["foo"][0]), "bar"); assert(equal(r.save, "foo")); assert(equal(r, "foo")); } @safe unittest { static void* p; static struct R { void* q; int front; bool empty; void popFront() {} @property R save() { p = q; return this; } // `p = q;` is only there to prevent inference of `scope return`. } R r; choose(true, r, r).save; } // Make sure ChooseResult.save doesn't trust @system user code. @system unittest // copy is @system { static struct R { int front; bool empty; void popFront() {} this(this) @system {} @property R save() { return R(front, empty); } } choose(true, R(), R()).save; choose(true, [0], R()).save; choose(true, R(), [0]).save; } @safe unittest // copy is @system { static struct R { int front; bool empty; void popFront() {} this(this) @system {} @property R save() { return R(front, empty); } } static assert(!__traits(compiles, choose(true, R(), R()).save)); static assert(!__traits(compiles, choose(true, [0], R()).save)); static assert(!__traits(compiles, choose(true, R(), [0]).save)); } @system unittest // .save is @system { static struct R { int front; bool empty; void popFront() {} @property R save() @system { return this; } } choose(true, R(), R()).save; choose(true, [0], R()).save; choose(true, R(), [0]).save; } @safe unittest // .save is @system { static struct R { int front; bool empty; void popFront() {} @property R save() @system { return this; } } static assert(!__traits(compiles, choose(true, R(), R()).save)); static assert(!__traits(compiles, choose(true, [0], R()).save)); static assert(!__traits(compiles, choose(true, R(), [0]).save)); } /** Choose one of multiple ranges at runtime. The ranges may be different, but they must have compatible element types. The result is a range that offers the weakest capabilities of all `Ranges`. Params: index = which range to choose, must be less than the number of ranges rs = two or more ranges Returns: The indexed range. If rs consists of only one range, the return type is an alias of that range's type. */ auto chooseAmong(Ranges...)(size_t index, return scope Ranges rs) if (Ranges.length >= 2 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, Ranges)) == void)) { static if (Ranges.length == 2) return choose(index == 0, rs[0], rs[1]); else return choose(index == 0, rs[0], chooseAmong(index - 1, rs[1 .. $])); } /// @safe nothrow pure @nogc unittest { auto test() { import std.algorithm.comparison : equal; int[4] sarr1 = [1, 2, 3, 4]; int[2] sarr2 = [5, 6]; int[1] sarr3 = [7]; auto arr1 = sarr1[]; auto arr2 = sarr2[]; auto arr3 = sarr3[]; { auto s = chooseAmong(0, arr1, arr2, arr3); auto t = s.save; assert(s.length == 4); assert(s[2] == 3); s.popFront(); assert(equal(t, only(1, 2, 3, 4))); } { auto s = chooseAmong(1, arr1, arr2, arr3); assert(s.length == 2); s.front = 8; assert(equal(s, only(8, 6))); } { auto s = chooseAmong(1, arr1, arr2, arr3); assert(s.length == 2); s[1] = 9; assert(equal(s, only(8, 9))); } { auto s = chooseAmong(1, arr2, arr1, arr3)[1 .. 3]; assert(s.length == 2); assert(equal(s, only(2, 3))); } { auto s = chooseAmong(0, arr1, arr2, arr3); assert(s.length == 4); assert(s.back == 4); s.popBack(); s.back = 5; assert(equal(s, only(1, 2, 5))); s.back = 3; assert(equal(s, only(1, 2, 3))); } { uint[5] foo = [1, 2, 3, 4, 5]; uint[5] bar = [6, 7, 8, 9, 10]; auto c = chooseAmong(1, foo[], bar[]); assert(c[3] == 9); c[3] = 42; assert(c[3] == 42); assert(c.moveFront() == 6); assert(c.moveBack() == 10); assert(c.moveAt(4) == 10); } { import std.range : cycle; auto s = chooseAmong(0, cycle(arr2), cycle(arr3)); assert(isInfinite!(typeof(s))); assert(!s.empty); assert(s[100] == 8); assert(s[101] == 9); assert(s[0 .. 3].equal(only(8, 9, 8))); } return 0; } // works at runtime auto a = test(); // and at compile time static b = test(); } @safe nothrow pure @nogc unittest { int[3] a = [1, 2, 3]; long[3] b = [4, 5, 6]; auto c = chooseAmong(0, a[], b[]); c[0] = 42; assert(c[0] == 42); } @safe nothrow pure @nogc unittest { static struct RefAccessRange { int[] r; ref front() @property { return r[0]; } ref back() @property { return r[$ - 1]; } void popFront() { r = r[1 .. $]; } void popBack() { r = r[0 .. $ - 1]; } auto empty() @property { return r.empty; } ref opIndex(size_t i) { return r[i]; } auto length() @property { return r.length; } alias opDollar = length; auto save() { return this; } } static assert(isRandomAccessRange!RefAccessRange); static assert(isRandomAccessRange!RefAccessRange); int[4] a = [4, 3, 2, 1]; int[2] b = [6, 5]; auto c = chooseAmong(0, RefAccessRange(a[]), RefAccessRange(b[])); void refFunc(ref int a, int target) { assert(a == target); } refFunc(c[2], 2); refFunc(c.front, 4); refFunc(c.back, 1); } /** $(D roundRobin(r1, r2, r3)) yields `r1.front`, then `r2.front`, then `r3.front`, after which it pops off one element from each and continues again from `r1`. For example, if two ranges are involved, it alternately yields elements off the two ranges. `roundRobin` stops after it has consumed all ranges (skipping over the ones that finish early). */ auto roundRobin(Rs...)(Rs rs) if (Rs.length > 1 && allSatisfy!(isInputRange, staticMap!(Unqual, Rs))) { struct Result { import std.conv : to; public Rs source; private size_t _current = size_t.max; @property bool empty() { foreach (i, Unused; Rs) { if (!source[i].empty) return false; } return true; } @property auto ref front() { final switch (_current) { foreach (i, R; Rs) { case i: assert( !source[i].empty, "Attempting to fetch the front of an empty roundRobin" ); return source[i].front; } } assert(0); } void popFront() { final switch (_current) { foreach (i, R; Rs) { case i: source[i].popFront(); break; } } auto next = _current == (Rs.length - 1) ? 0 : (_current + 1); final switch (next) { foreach (i, R; Rs) { case i: if (!source[i].empty) { _current = i; return; } if (i == _current) { _current = _current.max; return; } goto case (i + 1) % Rs.length; } } } static if (allSatisfy!(isForwardRange, staticMap!(Unqual, Rs))) @property auto save() { auto saveSource(size_t len)() { import std.typecons : tuple; static assert(len > 0); static if (len == 1) { return tuple(source[0].save); } else { return saveSource!(len - 1)() ~ tuple(source[len - 1].save); } } return Result(saveSource!(Rs.length).expand, _current); } static if (allSatisfy!(hasLength, Rs)) { @property size_t length() { size_t result; foreach (i, R; Rs) { result += source[i].length; } return result; } alias opDollar = length; } } return Result(rs, 0); } /// @safe unittest { import std.algorithm.comparison : equal; int[] a = [ 1, 2, 3 ]; int[] b = [ 10, 20, 30, 40 ]; auto r = roundRobin(a, b); assert(equal(r, [ 1, 10, 2, 20, 3, 30, 40 ])); } /** * roundRobin can be used to create "interleave" functionality which inserts * an element between each element in a range. */ @safe unittest { import std.algorithm.comparison : equal; auto interleave(R, E)(R range, E element) if ((isInputRange!R && hasLength!R) || isForwardRange!R) { static if (hasLength!R) immutable len = range.length; else immutable len = range.save.walkLength; return roundRobin( range, element.repeat(len - 1) ); } assert(interleave([1, 2, 3], 0).equal([1, 0, 2, 0, 3])); } pure @safe unittest { import std.algorithm.comparison : equal; auto r = roundRobin(refRange(&["foo"][0]), refRange(&["bar"][0])); assert(equal(r.save, "fboaor")); assert(equal(r.save, "fboaor")); } /** Iterates a random-access range starting from a given point and progressively extending left and right from that point. If no initial point is given, iteration starts from the middle of the range. Iteration spans the entire range. When `startingIndex` is 0 the range will be fully iterated in order and in reverse order when `r.length` is given. Params: r = a random access range with length and slicing startingIndex = the index to begin iteration from Returns: A forward range with length */ auto radial(Range, I)(Range r, I startingIndex) if (isRandomAccessRange!(Unqual!Range) && hasLength!(Unqual!Range) && hasSlicing!(Unqual!Range) && isIntegral!I) { if (startingIndex != r.length) ++startingIndex; return roundRobin(retro(r[0 .. startingIndex]), r[startingIndex .. r.length]); } /// Ditto auto radial(R)(R r) if (isRandomAccessRange!(Unqual!R) && hasLength!(Unqual!R) && hasSlicing!(Unqual!R)) { return .radial(r, (r.length - !r.empty) / 2); } /// @safe unittest { import std.algorithm.comparison : equal; int[] a = [ 1, 2, 3, 4, 5 ]; assert(equal(radial(a), [ 3, 4, 2, 5, 1 ])); a = [ 1, 2, 3, 4 ]; assert(equal(radial(a), [ 2, 3, 1, 4 ])); // If the left end is reached first, the remaining elements on the right // are concatenated in order: a = [ 0, 1, 2, 3, 4, 5 ]; assert(equal(radial(a, 1), [ 1, 2, 0, 3, 4, 5 ])); // If the right end is reached first, the remaining elements on the left // are concatenated in reverse order: assert(equal(radial(a, 4), [ 4, 5, 3, 2, 1, 0 ])); } @safe unittest { import std.algorithm.comparison : equal; import std.conv : text; import std.exception : enforce; import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy; void test(int[] input, int[] witness) { enforce(equal(radial(input), witness), text(radial(input), " vs. ", witness)); } test([], []); test([ 1 ], [ 1 ]); test([ 1, 2 ], [ 1, 2 ]); test([ 1, 2, 3 ], [ 2, 3, 1 ]); test([ 1, 2, 3, 4 ], [ 2, 3, 1, 4 ]); test([ 1, 2, 3, 4, 5 ], [ 3, 4, 2, 5, 1 ]); test([ 1, 2, 3, 4, 5, 6 ], [ 3, 4, 2, 5, 1, 6 ]); int[] a = [ 1, 2, 3, 4, 5 ]; assert(equal(radial(a, 1), [ 2, 3, 1, 4, 5 ])); assert(equal(radial(a, 0), [ 1, 2, 3, 4, 5 ])); // only right subrange assert(equal(radial(a, a.length), [ 5, 4, 3, 2, 1 ])); // only left subrange static assert(isForwardRange!(typeof(radial(a, 1)))); auto r = radial([1,2,3,4,5]); for (auto rr = r.save; !rr.empty; rr.popFront()) { assert(rr.front == moveFront(rr)); } r.front = 5; assert(r.front == 5); // Test instantiation without lvalue elements. DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random) dummy; assert(equal(radial(dummy, 4), [5, 6, 4, 7, 3, 8, 2, 9, 1, 10])); // immutable int[] immi = [ 1, 2 ]; // static assert(is(typeof(radial(immi)))); } @safe unittest { import std.algorithm.comparison : equal; auto LL = iota(1L, 6L); auto r = radial(LL); assert(equal(r, [3L, 4L, 2L, 5L, 1L])); } /** Lazily takes only up to `n` elements of a range. This is particularly useful when using with infinite ranges. Unlike $(LREF takeExactly), `take` does not require that there are `n` or more elements in `input`. As a consequence, length information is not applied to the result unless `input` also has length information. Params: input = an $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to iterate over up to `n` times n = the number of elements to take Returns: At minimum, an input range. If the range offers random access and `length`, `take` offers them as well. */ Take!R take(R)(R input, size_t n) if (isInputRange!(Unqual!R)) { alias U = Unqual!R; static if (is(R T == Take!T)) { import std.algorithm.comparison : min; return R(input.source, min(n, input._maxAvailable)); } else static if (!isInfinite!U && hasSlicing!U) { import std.algorithm.comparison : min; return input[0 .. min(n, input.length)]; } else { return Take!R(input, n); } } /// ditto struct Take(Range) if (isInputRange!(Unqual!Range) && //take _cannot_ test hasSlicing on infinite ranges, because hasSlicing uses //take for slicing infinite ranges. !((!isInfinite!(Unqual!Range) && hasSlicing!(Unqual!Range)) || is(Range T == Take!T))) { private alias R = Unqual!Range; /// User accessible in read and write public R source; private size_t _maxAvailable; alias Source = R; /// Range primitives @property bool empty() { return _maxAvailable == 0 || source.empty; } /// ditto @property auto ref front() { assert(!empty, "Attempting to fetch the front of an empty " ~ Take.stringof); return source.front; } /// ditto void popFront() { assert(!empty, "Attempting to popFront() past the end of a " ~ Take.stringof); source.popFront(); --_maxAvailable; } static if (isForwardRange!R) /// ditto @property Take save() { return Take(source.save, _maxAvailable); } static if (hasAssignableElements!R) /// ditto @property void front(ElementType!R v) { assert(!empty, "Attempting to assign to the front of an empty " ~ Take.stringof); // This has to return auto instead of void because of Bug 4706. source.front = v; } static if (hasMobileElements!R) { /// ditto auto moveFront() { assert(!empty, "Attempting to move the front of an empty " ~ Take.stringof); return source.moveFront(); } } static if (isInfinite!R) { /// ditto @property size_t length() const { return _maxAvailable; } /// ditto alias opDollar = length; //Note: Due to Take/hasSlicing circular dependency, //This needs to be a restrained template. /// ditto auto opSlice()(size_t i, size_t j) if (hasSlicing!R) { assert(i <= j, "Invalid slice bounds"); assert(j <= length, "Attempting to slice past the end of a " ~ Take.stringof); return source[i .. j]; } } else static if (hasLength!R) { /// ditto @property size_t length() { import std.algorithm.comparison : min; return min(_maxAvailable, source.length); } alias opDollar = length; } static if (isRandomAccessRange!R) { /// ditto void popBack() { assert(!empty, "Attempting to popBack() past the beginning of a " ~ Take.stringof); --_maxAvailable; } /// ditto @property auto ref back() { assert(!empty, "Attempting to fetch the back of an empty " ~ Take.stringof); return source[this.length - 1]; } /// ditto auto ref opIndex(size_t index) { assert(index < length, "Attempting to index out of the bounds of a " ~ Take.stringof); return source[index]; } static if (hasAssignableElements!R) { /// ditto @property void back(ElementType!R v) { // This has to return auto instead of void because of Bug 4706. assert(!empty, "Attempting to assign to the back of an empty " ~ Take.stringof); source[this.length - 1] = v; } /// ditto void opIndexAssign(ElementType!R v, size_t index) { assert(index < length, "Attempting to index out of the bounds of a " ~ Take.stringof); source[index] = v; } } static if (hasMobileElements!R) { /// ditto auto moveBack() { assert(!empty, "Attempting to move the back of an empty " ~ Take.stringof); return source.moveAt(this.length - 1); } /// ditto auto moveAt(size_t index) { assert(index < length, "Attempting to index out of the bounds of a " ~ Take.stringof); return source.moveAt(index); } } } /** Access to maximal length of the range. Note: the actual length of the range depends on the underlying range. If it has fewer elements, it will stop before maxLength is reached. */ @property size_t maxLength() const { return _maxAvailable; } } /// ditto template Take(R) if (isInputRange!(Unqual!R) && ((!isInfinite!(Unqual!R) && hasSlicing!(Unqual!R)) || is(R T == Take!T))) { alias Take = R; } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; auto s = take(arr1, 5); assert(s.length == 5); assert(s[4] == 5); assert(equal(s, [ 1, 2, 3, 4, 5 ][])); } /** * If the range runs out before `n` elements, `take` simply returns the entire * range (unlike $(LREF takeExactly), which will cause an assertion failure if * the range ends prematurely): */ pure @safe nothrow unittest { import std.algorithm.comparison : equal; int[] arr2 = [ 1, 2, 3 ]; auto t = take(arr2, 5); assert(t.length == 3); assert(equal(t, [ 1, 2, 3 ])); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; int[] arr1 = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; auto s = take(arr1, 5); assert(s.length == 5); assert(s[4] == 5); assert(equal(s, [ 1, 2, 3, 4, 5 ][])); assert(equal(retro(s), [ 5, 4, 3, 2, 1 ][])); // Test fix for bug 4464. static assert(is(typeof(s) == Take!(int[]))); static assert(is(typeof(s) == int[])); // Test using narrow strings. import std.exception : assumeWontThrow; auto myStr = "This is a string."; auto takeMyStr = take(myStr, 7); assert(assumeWontThrow(equal(takeMyStr, "This is"))); // Test fix for bug 5052. auto takeMyStrAgain = take(takeMyStr, 4); assert(assumeWontThrow(equal(takeMyStrAgain, "This"))); static assert(is (typeof(takeMyStrAgain) == typeof(takeMyStr))); takeMyStrAgain = take(takeMyStr, 10); assert(assumeWontThrow(equal(takeMyStrAgain, "This is"))); foreach (DummyType; AllDummyRanges) { DummyType dummy; auto t = take(dummy, 5); alias T = typeof(t); static if (isRandomAccessRange!DummyType) { static assert(isRandomAccessRange!T); assert(t[4] == 5); assert(moveAt(t, 1) == t[1]); assert(t.back == moveBack(t)); } else static if (isForwardRange!DummyType) { static assert(isForwardRange!T); } for (auto tt = t; !tt.empty; tt.popFront()) { assert(tt.front == moveFront(tt)); } // Bidirectional ranges can't be propagated properly if they don't // also have random access. assert(equal(t, [1,2,3,4,5])); //Test that take doesn't wrap the result of take. assert(take(t, 4) == take(dummy, 4)); } immutable myRepeat = repeat(1); static assert(is(Take!(typeof(myRepeat)))); } pure @safe nothrow @nogc unittest { //check for correct slicing of Take on an infinite range import std.algorithm.comparison : equal; foreach (start; 0 .. 4) foreach (stop; start .. 4) assert(iota(4).cycle.take(4)[start .. stop] .equal(iota(start, stop))); } pure @safe nothrow @nogc unittest { // Check that one can declare variables of all Take types, // and that they match the return type of the corresponding // take(). (See issue 4464.) int[] r1; Take!(int[]) t1; t1 = take(r1, 1); assert(t1.empty); string r2; Take!string t2; t2 = take(r2, 1); assert(t2.empty); Take!(Take!string) t3; t3 = take(t2, 1); assert(t3.empty); } pure @safe nothrow @nogc unittest { alias R1 = typeof(repeat(1)); alias R2 = typeof(cycle([1])); alias TR1 = Take!R1; alias TR2 = Take!R2; static assert(isBidirectionalRange!TR1); static assert(isBidirectionalRange!TR2); } pure @safe nothrow @nogc unittest //12731 { auto a = repeat(1); auto s = a[1 .. 5]; s = s[1 .. 3]; assert(s.length == 2); assert(s[0] == 1); assert(s[1] == 1); } pure @safe nothrow @nogc unittest //13151 { import std.algorithm.comparison : equal; auto r = take(repeat(1, 4), 3); assert(r.take(2).equal(repeat(1, 2))); } /** Similar to $(LREF take), but assumes that `range` has at least $(D n) elements. Consequently, the result of $(D takeExactly(range, n)) always defines the `length` property (and initializes it to `n`) even when `range` itself does not define `length`. The result of `takeExactly` is identical to that of $(LREF take) in cases where the original range defines `length` or is infinite. Unlike $(LREF take), however, it is illegal to pass a range with less than `n` elements to `takeExactly`; this will cause an assertion failure. */ auto takeExactly(R)(R range, size_t n) if (isInputRange!R) { static if (is(typeof(takeExactly(range._input, n)) == R)) { assert(n <= range._n, "Attempted to take more than the length of the range with takeExactly."); // takeExactly(takeExactly(r, n1), n2) has the same type as // takeExactly(r, n1) and simply returns takeExactly(r, n2) range._n = n; return range; } //Also covers hasSlicing!R for finite ranges. else static if (hasLength!R) { assert(n <= range.length, "Attempted to take more than the length of the range with takeExactly."); return take(range, n); } else static if (isInfinite!R) return Take!R(range, n); else { static struct Result { R _input; private size_t _n; @property bool empty() const { return !_n; } @property auto ref front() { assert(_n > 0, "front() on an empty " ~ Result.stringof); return _input.front; } void popFront() { _input.popFront(); --_n; } @property size_t length() const { return _n; } alias opDollar = length; @property auto _takeExactly_Result_asTake() { return take(_input, _n); } alias _takeExactly_Result_asTake this; static if (isForwardRange!R) @property auto save() { return Result(_input.save, _n); } static if (hasMobileElements!R) { auto moveFront() { assert(!empty, "Attempting to move the front of an empty " ~ typeof(this).stringof); return _input.moveFront(); } } static if (hasAssignableElements!R) { @property auto ref front(ElementType!R v) { assert(!empty, "Attempting to assign to the front of an empty " ~ typeof(this).stringof); return _input.front = v; } } } return Result(range, n); } } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; auto a = [ 1, 2, 3, 4, 5 ]; auto b = takeExactly(a, 3); assert(equal(b, [1, 2, 3])); static assert(is(typeof(b.length) == size_t)); assert(b.length == 3); assert(b.front == 1); assert(b.back == 3); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter; auto a = [ 1, 2, 3, 4, 5 ]; auto b = takeExactly(a, 3); assert(equal(b, [1, 2, 3])); auto c = takeExactly(b, 2); assert(equal(c, [1, 2])); auto d = filter!"a > 2"(a); auto e = takeExactly(d, 3); assert(equal(e, [3, 4, 5])); static assert(is(typeof(e.length) == size_t)); assert(e.length == 3); assert(e.front == 3); assert(equal(takeExactly(e, 3), [3, 4, 5])); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; auto a = [ 1, 2, 3, 4, 5 ]; //Test that take and takeExactly are the same for ranges which define length //but aren't sliceable. struct L { @property auto front() { return _arr[0]; } @property bool empty() { return _arr.empty; } void popFront() { _arr.popFront(); } @property size_t length() { return _arr.length; } int[] _arr; } static assert(is(typeof(take(L(a), 3)) == typeof(takeExactly(L(a), 3)))); assert(take(L(a), 3) == takeExactly(L(a), 3)); //Test that take and takeExactly are the same for ranges which are sliceable. static assert(is(typeof(take(a, 3)) == typeof(takeExactly(a, 3)))); assert(take(a, 3) == takeExactly(a, 3)); //Test that take and takeExactly are the same for infinite ranges. auto inf = repeat(1); static assert(is(typeof(take(inf, 5)) == Take!(typeof(inf)))); assert(take(inf, 5) == takeExactly(inf, 5)); //Test that take and takeExactly are _not_ the same for ranges which don't //define length. static assert(!is(typeof(take(filter!"true"(a), 3)) == typeof(takeExactly(filter!"true"(a), 3)))); foreach (DummyType; AllDummyRanges) { { DummyType dummy; auto t = takeExactly(dummy, 5); //Test that takeExactly doesn't wrap the result of takeExactly. assert(takeExactly(t, 4) == takeExactly(dummy, 4)); } static if (hasMobileElements!DummyType) { { auto t = takeExactly(DummyType.init, 4); assert(t.moveFront() == 1); assert(equal(t, [1, 2, 3, 4])); } } static if (hasAssignableElements!DummyType) { { auto t = takeExactly(DummyType.init, 4); t.front = 9; assert(equal(t, [9, 2, 3, 4])); } } } } pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy; alias DummyType = DummyRange!(ReturnBy.Value, Length.No, RangeType.Forward); auto te = takeExactly(DummyType(), 5); Take!DummyType t = te; assert(equal(t, [1, 2, 3, 4, 5])); assert(equal(t, te)); } // https://issues.dlang.org/show_bug.cgi?id=18092 // can't combine take and takeExactly @safe unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; static foreach (Range; AllDummyRanges) {{ Range r; assert(r.take(6).takeExactly(2).equal([1, 2])); assert(r.takeExactly(6).takeExactly(2).equal([1, 2])); assert(r.takeExactly(6).take(2).equal([1, 2])); }} } /** Returns a range with at most one element; for example, $(D takeOne([42, 43, 44])) returns a range consisting of the integer $(D 42). Calling `popFront()` off that range renders it empty. In effect `takeOne(r)` is somewhat equivalent to $(D take(r, 1)) but in certain interfaces it is important to know statically that the range may only have at most one element. The type returned by `takeOne` is a random-access range with length regardless of `R`'s capabilities, as long as it is a forward range. (another feature that distinguishes `takeOne` from `take`). If (D R) is an input range but not a forward range, return type is an input range with all random-access capabilities except save. */ auto takeOne(R)(R source) if (isInputRange!R) { static if (hasSlicing!R) { return source[0 .. !source.empty]; } else { static struct Result { private R _source; private bool _empty = true; @property bool empty() const { return _empty; } @property auto ref front() { assert(!empty, "Attempting to fetch the front of an empty takeOne"); return _source.front; } void popFront() { assert(!empty, "Attempting to popFront an empty takeOne"); _source.popFront(); _empty = true; } void popBack() { assert(!empty, "Attempting to popBack an empty takeOne"); _source.popFront(); _empty = true; } static if (isForwardRange!(Unqual!R)) { @property auto save() { return Result(_source.save, empty); } } @property auto ref back() { assert(!empty, "Attempting to fetch the back of an empty takeOne"); return _source.front; } @property size_t length() const { return !empty; } alias opDollar = length; auto ref opIndex(size_t n) { assert(n < length, "Attempting to index a takeOne out of bounds"); return _source.front; } auto opSlice(size_t m, size_t n) { assert( m <= n, "Attempting to slice a takeOne range with a larger first argument than the second." ); assert( n <= length, "Attempting to slice using an out of bounds index on a takeOne range." ); return n > m ? this : Result(_source, true); } // Non-standard property @property R source() { return _source; } } return Result(source, source.empty); } } /// pure @safe nothrow unittest { auto s = takeOne([42, 43, 44]); static assert(isRandomAccessRange!(typeof(s))); assert(s.length == 1); assert(!s.empty); assert(s.front == 42); s.front = 43; assert(s.front == 43); assert(s.back == 43); assert(s[0] == 43); s.popFront(); assert(s.length == 0); assert(s.empty); } pure @safe nothrow @nogc unittest { struct NonForwardRange { enum empty = false; int front() { return 42; } void popFront() {} } static assert(!isForwardRange!NonForwardRange); auto s = takeOne(NonForwardRange()); assert(s.length == 1); assert(!s.empty); assert(s.front == 42); assert(s.back == 42); assert(s[0] == 42); auto t = s[0 .. 0]; assert(t.empty); assert(t.length == 0); auto u = s[1 .. 1]; assert(u.empty); assert(u.length == 0); auto v = s[0 .. 1]; s.popFront(); assert(s.length == 0); assert(s.empty); assert(!v.empty); assert(v.front == 42); v.popBack(); assert(v.empty); assert(v.length == 0); } pure @safe nothrow @nogc unittest { struct NonSlicingForwardRange { enum empty = false; int front() { return 42; } void popFront() {} @property auto save() { return this; } } static assert(isForwardRange!NonSlicingForwardRange); static assert(!hasSlicing!NonSlicingForwardRange); auto s = takeOne(NonSlicingForwardRange()); assert(s.length == 1); assert(!s.empty); assert(s.front == 42); assert(s.back == 42); assert(s[0] == 42); auto t = s.save; s.popFront(); assert(s.length == 0); assert(s.empty); assert(!t.empty); assert(t.front == 42); t.popBack(); assert(t.empty); assert(t.length == 0); } // Test that asserts trigger correctly @system unittest { import std.exception : assertThrown; import core.exception : AssertError; struct NonForwardRange { enum empty = false; int front() { return 42; } void popFront() {} } auto s = takeOne(NonForwardRange()); assertThrown!AssertError(s[1]); assertThrown!AssertError(s[0 .. 2]); size_t one = 1; // Avoid style warnings triggered by literals size_t zero = 0; assertThrown!AssertError(s[one .. zero]); s.popFront; assert(s.empty); assertThrown!AssertError(s.front); assertThrown!AssertError(s.back); assertThrown!AssertError(s.popFront); assertThrown!AssertError(s.popBack); } //guards against issue 16999 pure @safe unittest { auto myIota = new class { int front = 0; @safe void popFront(){front++;} enum empty = false; }; auto iotaPart = myIota.takeOne; int sum; foreach (var; chain(iotaPart, iotaPart, iotaPart)) { sum += var; } assert(sum == 3); assert(iotaPart.front == 3); } /++ Returns an empty range which is statically known to be empty and is guaranteed to have `length` and be random access regardless of `R`'s capabilities. +/ auto takeNone(R)() if (isInputRange!R) { return typeof(takeOne(R.init)).init; } /// pure @safe nothrow @nogc unittest { auto range = takeNone!(int[])(); assert(range.length == 0); assert(range.empty); } pure @safe nothrow @nogc unittest { enum ctfe = takeNone!(int[])(); static assert(ctfe.length == 0); static assert(ctfe.empty); } /++ Creates an empty range from the given range in $(BIGOH 1). If it can, it will return the same range type. If not, it will return $(D takeExactly(range, 0)). +/ auto takeNone(R)(R range) if (isInputRange!R) { import std.traits : isDynamicArray; //Makes it so that calls to takeNone which don't use UFCS still work with a //member version if it's defined. static if (is(typeof(R.takeNone))) auto retval = range.takeNone(); //@@@BUG@@@ 8339 else static if (isDynamicArray!R)/+ || (is(R == struct) && __traits(compiles, {auto r = R.init;}) && R.init.empty))+/ { auto retval = R.init; } //An infinite range sliced at [0 .. 0] would likely still not be empty... else static if (hasSlicing!R && !isInfinite!R) auto retval = range[0 .. 0]; else auto retval = takeExactly(range, 0); //@@@BUG@@@ 7892 prevents this from being done in an out block. assert(retval.empty); return retval; } /// pure @safe nothrow unittest { import std.algorithm.iteration : filter; assert(takeNone([42, 27, 19]).empty); assert(takeNone("dlang.org").empty); assert(takeNone(filter!"true"([42, 27, 19])).empty); } @safe unittest { import std.algorithm.iteration : filter; import std.meta : AliasSeq; struct Dummy { mixin template genInput() { @safe: @property bool empty() { return _arr.empty; } @property auto front() { return _arr.front; } void popFront() { _arr.popFront(); } static assert(isInputRange!(typeof(this))); } } alias genInput = Dummy.genInput; static struct NormalStruct { //Disabled to make sure that the takeExactly version is used. @disable this(); this(int[] arr) { _arr = arr; } mixin genInput; int[] _arr; } static struct SliceStruct { @disable this(); this(int[] arr) { _arr = arr; } mixin genInput; @property auto save() { return this; } auto opSlice(size_t i, size_t j) { return typeof(this)(_arr[i .. j]); } @property size_t length() { return _arr.length; } int[] _arr; } static struct InitStruct { mixin genInput; int[] _arr; } static struct TakeNoneStruct { this(int[] arr) { _arr = arr; } @disable this(); mixin genInput; auto takeNone() { return typeof(this)(null); } int[] _arr; } static class NormalClass { this(int[] arr) {_arr = arr;} mixin genInput; int[] _arr; } static class SliceClass { @safe: this(int[] arr) { _arr = arr; } mixin genInput; @property auto save() { return new typeof(this)(_arr); } auto opSlice(size_t i, size_t j) { return new typeof(this)(_arr[i .. j]); } @property size_t length() { return _arr.length; } int[] _arr; } static class TakeNoneClass { @safe: this(int[] arr) { _arr = arr; } mixin genInput; auto takeNone() { return new typeof(this)(null); } int[] _arr; } import std.format : format; static foreach (range; AliasSeq!([1, 2, 3, 4, 5], "hello world", "hello world"w, "hello world"d, SliceStruct([1, 2, 3]), //@@@BUG@@@ 8339 forces this to be takeExactly //`InitStruct([1, 2, 3]), TakeNoneStruct([1, 2, 3]))) { static assert(takeNone(range).empty, typeof(range).stringof); assert(takeNone(range).empty); static assert(is(typeof(range) == typeof(takeNone(range))), typeof(range).stringof); } static foreach (range; AliasSeq!(NormalStruct([1, 2, 3]), InitStruct([1, 2, 3]))) { static assert(takeNone(range).empty, typeof(range).stringof); assert(takeNone(range).empty); static assert(is(typeof(takeExactly(range, 0)) == typeof(takeNone(range))), typeof(range).stringof); } //Don't work in CTFE. auto normal = new NormalClass([1, 2, 3]); assert(takeNone(normal).empty); static assert(is(typeof(takeExactly(normal, 0)) == typeof(takeNone(normal))), typeof(normal).stringof); auto slice = new SliceClass([1, 2, 3]); assert(takeNone(slice).empty); static assert(is(SliceClass == typeof(takeNone(slice))), typeof(slice).stringof); auto taken = new TakeNoneClass([1, 2, 3]); assert(takeNone(taken).empty); static assert(is(TakeNoneClass == typeof(takeNone(taken))), typeof(taken).stringof); auto filtered = filter!"true"([1, 2, 3, 4, 5]); assert(takeNone(filtered).empty); //@@@BUG@@@ 8339 and 5941 force this to be takeExactly //static assert(is(typeof(filtered) == typeof(takeNone(filtered))), typeof(filtered).stringof); } /++ + Return a range advanced to within `_n` elements of the end of + `range`. + + Intended as the range equivalent of the Unix + $(HTTP en.wikipedia.org/wiki/Tail_%28Unix%29, _tail) utility. When the length + of `range` is less than or equal to `_n`, `range` is returned + as-is. + + Completes in $(BIGOH 1) steps for ranges that support slicing and have + length. Completes in $(BIGOH range.length) time for all other ranges. + + Params: + range = range to get _tail of + n = maximum number of elements to include in _tail + + Returns: + Returns the _tail of `range` augmented with length information +/ auto tail(Range)(Range range, size_t n) if (isInputRange!Range && !isInfinite!Range && (hasLength!Range || isForwardRange!Range)) { static if (hasLength!Range) { immutable length = range.length; if (n >= length) return range.takeExactly(length); else return range.drop(length - n).takeExactly(n); } else { Range scout = range.save; foreach (immutable i; 0 .. n) { if (scout.empty) return range.takeExactly(i); scout.popFront(); } auto tail = range.save; while (!scout.empty) { assert(!tail.empty); scout.popFront(); tail.popFront(); } return tail.takeExactly(n); } } /// pure @safe nothrow unittest { // tail -c n assert([1, 2, 3].tail(1) == [3]); assert([1, 2, 3].tail(2) == [2, 3]); assert([1, 2, 3].tail(3) == [1, 2, 3]); assert([1, 2, 3].tail(4) == [1, 2, 3]); assert([1, 2, 3].tail(0).length == 0); // tail --lines=n import std.algorithm.comparison : equal; import std.algorithm.iteration : joiner; import std.exception : assumeWontThrow; import std.string : lineSplitter; assert("one\ntwo\nthree" .lineSplitter .tail(2) .joiner("\n") .equal("two\nthree") .assumeWontThrow); } // @nogc prevented by @@@BUG@@@ 15408 pure nothrow @safe /+@nogc+/ unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges, DummyRange, Length, RangeType, ReturnBy; static immutable cheatsheet = [6, 7, 8, 9, 10]; foreach (R; AllDummyRanges) { static if (isInputRange!R && !isInfinite!R && (hasLength!R || isForwardRange!R)) { assert(R.init.tail(5).equal(cheatsheet)); static assert(R.init.tail(5).equal(cheatsheet)); assert(R.init.tail(0).length == 0); assert(R.init.tail(10).equal(R.init)); assert(R.init.tail(11).equal(R.init)); } } // Infinite ranges are not supported static assert(!__traits(compiles, repeat(0).tail(0))); // Neither are non-forward ranges without length static assert(!__traits(compiles, DummyRange!(ReturnBy.Value, Length.No, RangeType.Input).init.tail(5))); } pure @safe nothrow @nogc unittest { static immutable input = [1, 2, 3]; static immutable expectedOutput = [2, 3]; assert(input.tail(2) == expectedOutput); } /++ Convenience function which calls $(REF popFrontN, std, range, primitives)`(range, n)` and returns `range`. `drop` makes it easier to pop elements from a range and then pass it to another function within a single expression, whereas `popFrontN` would require multiple statements. `dropBack` provides the same functionality but instead calls $(REF popBackN, std, range, primitives)`(range, n)` Note: `drop` and `dropBack` will only pop $(I up to) `n` elements but will stop if the range is empty first. In other languages this is sometimes called `skip`. Params: range = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to drop from n = the number of elements to drop Returns: `range` with up to `n` elements dropped See_Also: $(REF popFront, std, range, primitives), $(REF popBackN, std, range, primitives) +/ R drop(R)(R range, size_t n) if (isInputRange!R) { range.popFrontN(n); return range; } /// ditto R dropBack(R)(R range, size_t n) if (isBidirectionalRange!R) { range.popBackN(n); return range; } /// @safe unittest { import std.algorithm.comparison : equal; assert([0, 2, 1, 5, 0, 3].drop(3) == [5, 0, 3]); assert("hello world".drop(6) == "world"); assert("hello world".drop(50).empty); assert("hello world".take(6).drop(3).equal("lo ")); } @safe unittest { import std.algorithm.comparison : equal; assert([0, 2, 1, 5, 0, 3].dropBack(3) == [0, 2, 1]); assert("hello world".dropBack(6) == "hello"); assert("hello world".dropBack(50).empty); assert("hello world".drop(4).dropBack(4).equal("o w")); } @safe unittest { import std.algorithm.comparison : equal; import std.container.dlist : DList; //Remove all but the first two elements auto a = DList!int(0, 1, 9, 9, 9, 9); a.remove(a[].drop(2)); assert(a[].equal(a[].take(2))); } @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter; assert(drop("", 5).empty); assert(equal(drop(filter!"true"([0, 2, 1, 5, 0, 3]), 3), [5, 0, 3])); } @safe unittest { import std.algorithm.comparison : equal; import std.container.dlist : DList; //insert before the last two elements auto a = DList!int(0, 1, 2, 5, 6); a.insertAfter(a[].dropBack(2), [3, 4]); assert(a[].equal(iota(0, 7))); } /++ Similar to $(LREF drop) and `dropBack` but they call $(D range.$(LREF popFrontExactly)(n)) and `range.popBackExactly(n)` instead. Note: Unlike `drop`, `dropExactly` will assume that the range holds at least `n` elements. This makes `dropExactly` faster than `drop`, but it also means that if `range` does not contain at least `n` elements, it will attempt to call `popFront` on an empty range, which is undefined behavior. So, only use `popFrontExactly` when it is guaranteed that `range` holds at least `n` elements. Params: range = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to drop from n = the number of elements to drop Returns: `range` with `n` elements dropped See_Also: $(REF popFrontExcatly, std, range, primitives), $(REF popBackExcatly, std, range, primitives) +/ R dropExactly(R)(R range, size_t n) if (isInputRange!R) { popFrontExactly(range, n); return range; } /// ditto R dropBackExactly(R)(R range, size_t n) if (isBidirectionalRange!R) { popBackExactly(range, n); return range; } /// @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filterBidirectional; auto a = [1, 2, 3]; assert(a.dropExactly(2) == [3]); assert(a.dropBackExactly(2) == [1]); string s = "日本語"; assert(s.dropExactly(2) == "語"); assert(s.dropBackExactly(2) == "日"); auto bd = filterBidirectional!"true"([1, 2, 3]); assert(bd.dropExactly(2).equal([3])); assert(bd.dropBackExactly(2).equal([1])); } /++ Convenience function which calls `range.popFront()` and returns `range`. `dropOne` makes it easier to pop an element from a range and then pass it to another function within a single expression, whereas `popFront` would require multiple statements. `dropBackOne` provides the same functionality but instead calls `range.popBack()`. +/ R dropOne(R)(R range) if (isInputRange!R) { range.popFront(); return range; } /// ditto R dropBackOne(R)(R range) if (isBidirectionalRange!R) { range.popBack(); return range; } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filterBidirectional; import std.container.dlist : DList; auto dl = DList!int(9, 1, 2, 3, 9); assert(dl[].dropOne().dropBackOne().equal([1, 2, 3])); auto a = [1, 2, 3]; assert(a.dropOne() == [2, 3]); assert(a.dropBackOne() == [1, 2]); string s = "日本語"; import std.exception : assumeWontThrow; assert(assumeWontThrow(s.dropOne() == "本語")); assert(assumeWontThrow(s.dropBackOne() == "日本")); auto bd = filterBidirectional!"true"([1, 2, 3]); assert(bd.dropOne().equal([2, 3])); assert(bd.dropBackOne().equal([1, 2])); } /** Create a range which repeats one value. Params: value = the _value to repeat n = the number of times to repeat `value` Returns: If `n` is not defined, an infinite random access range with slicing. If `n` is defined, a random access range with slicing. */ struct Repeat(T) { private: //Store a non-qualified T when possible: This is to make Repeat assignable static if ((is(T == class) || is(T == interface)) && (is(T == const) || is(T == immutable))) { import std.typecons : Rebindable; alias UT = Rebindable!T; } else static if (is(T : Unqual!T) && is(Unqual!T : T)) alias UT = Unqual!T; else alias UT = T; UT _value; public: /// Range primitives @property inout(T) front() inout { return _value; } /// ditto @property inout(T) back() inout { return _value; } /// ditto enum bool empty = false; /// ditto void popFront() {} /// ditto void popBack() {} /// ditto @property auto save() inout { return this; } /// ditto inout(T) opIndex(size_t) inout { return _value; } /// ditto auto opSlice(size_t i, size_t j) in { assert( i <= j, "Attempting to slice a Repeat with a larger first argument than the second." ); } do { return this.takeExactly(j - i); } private static struct DollarToken {} /// ditto enum opDollar = DollarToken.init; /// ditto auto opSlice(size_t, DollarToken) inout { return this; } } /// Ditto Repeat!T repeat(T)(T value) { return Repeat!T(value); } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; assert(5.repeat().take(4).equal([5, 5, 5, 5])); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; auto r = repeat(5); alias R = typeof(r); static assert(isBidirectionalRange!R); static assert(isForwardRange!R); static assert(isInfinite!R); static assert(hasSlicing!R); assert(r.back == 5); assert(r.front == 5); assert(r.take(4).equal([ 5, 5, 5, 5 ])); assert(r[0 .. 4].equal([ 5, 5, 5, 5 ])); R r2 = r[5 .. $]; assert(r2.back == 5); assert(r2.front == 5); } /// ditto Take!(Repeat!T) repeat(T)(T value, size_t n) { return take(repeat(value), n); } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; assert(5.repeat(4).equal([5, 5, 5, 5])); } pure @safe nothrow unittest //12007 { static class C{} Repeat!(immutable int) ri; ri = ri.save; Repeat!(immutable C) rc; rc = rc.save; import std.algorithm.setops : cartesianProduct; import std.algorithm.comparison : equal; import std.typecons : tuple; immutable int[] A = [1,2,3]; immutable int[] B = [4,5,6]; assert(equal(cartesianProduct(A,B), [ tuple(1, 4), tuple(1, 5), tuple(1, 6), tuple(2, 4), tuple(2, 5), tuple(2, 6), tuple(3, 4), tuple(3, 5), tuple(3, 6), ])); } /** Given callable ($(REF isCallable, std,traits)) `fun`, create as a range whose front is defined by successive calls to `fun()`. This is especially useful to call function with global side effects (random functions), or to create ranges expressed as a single delegate, rather than an entire `front`/`popFront`/`empty` structure. `fun` maybe be passed either a template alias parameter (existing function, delegate, struct type defining `static opCall`) or a run-time value argument (delegate, function object). The result range models an InputRange ($(REF isInputRange, std,range,primitives)). The resulting range will call `fun()` on construction, and every call to `popFront`, and the cached value will be returned when `front` is called. Returns: an `inputRange` where each element represents another call to fun. */ auto generate(Fun)(Fun fun) if (isCallable!fun) { auto gen = Generator!(Fun)(fun); gen.popFront(); // prime the first element return gen; } /// ditto auto generate(alias fun)() if (isCallable!fun) { auto gen = Generator!(fun)(); gen.popFront(); // prime the first element return gen; } /// @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; int i = 1; auto powersOfTwo = generate!(() => i *= 2)().take(10); assert(equal(powersOfTwo, iota(1, 11).map!"2^^a"())); } /// @safe pure nothrow unittest { import std.algorithm.comparison : equal; //Returns a run-time delegate auto infiniteIota(T)(T low, T high) { T i = high; return (){if (i == high) i = low; return i++;}; } //adapted as a range. assert(equal(generate(infiniteIota(1, 4)).take(10), [1, 2, 3, 1, 2, 3, 1, 2, 3, 1])); } /// @safe unittest { import std.format : format; import std.random : uniform; auto r = generate!(() => uniform(0, 6)).take(10); format("%(%s %)", r); } private struct Generator(Fun...) { static assert(Fun.length == 1); static assert(isInputRange!Generator); private: static if (is(Fun[0])) Fun[0] fun; else alias fun = Fun[0]; enum returnByRef_ = (functionAttributes!fun & FunctionAttribute.ref_) ? true : false; static if (returnByRef_) ReturnType!fun *elem_; else ReturnType!fun elem_; public: /// Range primitives enum empty = false; static if (returnByRef_) { /// ditto ref front() @property { return *elem_; } /// ditto void popFront() { elem_ = &fun(); } } else { /// ditto auto front() @property { return elem_; } /// ditto void popFront() { elem_ = fun(); } } } @safe nothrow unittest { import std.algorithm.comparison : equal; struct StaticOpCall { static ubyte opCall() { return 5 ; } } assert(equal(generate!StaticOpCall().take(10), repeat(5).take(10))); } @safe pure unittest { import std.algorithm.comparison : equal; struct OpCall { ubyte opCall() @safe pure { return 5 ; } } OpCall op; assert(equal(generate(op).take(10), repeat(5).take(10))); } // verify ref mechanism works @system nothrow unittest { int[10] arr; int idx; ref int fun() { auto x = idx++; idx %= arr.length; return arr[x]; } int y = 1; foreach (ref x; generate!(fun).take(20)) { x += y++; } import std.algorithm.comparison : equal; assert(equal(arr[], iota(12, 32, 2))); } // assure front isn't the mechanism to make generate go to the next element. @safe unittest { int i; auto g = generate!(() => ++i); auto f = g.front; assert(f == g.front); g = g.drop(5); // reassign because generate caches assert(g.front == f + 5); } /** Repeats the given forward range ad infinitum. If the original range is infinite (fact that would make `Cycle` the identity application), `Cycle` detects that and aliases itself to the range type itself. That works for non-forward ranges too. If the original range has random access, `Cycle` offers random access and also offers a constructor taking an initial position `index`. `Cycle` works with static arrays in addition to ranges, mostly for performance reasons. Note: The input range must not be empty. Tip: This is a great way to implement simple circular buffers. */ struct Cycle(R) if (isForwardRange!R && !isInfinite!R) { static if (isRandomAccessRange!R && hasLength!R) { private R _original; private size_t _index; /// Range primitives this(R input, size_t index = 0) { _original = input; _index = index % _original.length; } /// ditto @property auto ref front() { return _original[_index]; } static if (is(typeof((cast(const R)_original)[_index]))) { /// ditto @property auto ref front() const { return _original[_index]; } } static if (hasAssignableElements!R) { /// ditto @property void front(ElementType!R val) { _original[_index] = val; } } /// ditto enum bool empty = false; /// ditto void popFront() { ++_index; if (_index >= _original.length) _index = 0; } /// ditto auto ref opIndex(size_t n) { return _original[(n + _index) % _original.length]; } static if (is(typeof((cast(const R)_original)[_index])) && is(typeof((cast(const R)_original).length))) { /// ditto auto ref opIndex(size_t n) const { return _original[(n + _index) % _original.length]; } } static if (hasAssignableElements!R) { /// ditto void opIndexAssign(ElementType!R val, size_t n) { _original[(n + _index) % _original.length] = val; } } /// ditto @property Cycle save() { //No need to call _original.save, because Cycle never actually modifies _original return Cycle(_original, _index); } private static struct DollarToken {} /// ditto enum opDollar = DollarToken.init; static if (hasSlicing!R) { /// ditto auto opSlice(size_t i, size_t j) in { assert(i <= j); } do { return this[i .. $].takeExactly(j - i); } /// ditto auto opSlice(size_t i, DollarToken) { return typeof(this)(_original, _index + i); } } } else { private R _original; private R _current; /// ditto this(R input) { _original = input; _current = input.save; } private this(R original, R current) { _original = original; _current = current; } /// ditto @property auto ref front() { return _current.front; } static if (is(typeof((cast(const R)_current).front))) { /// ditto @property auto ref front() const { return _current.front; } } static if (hasAssignableElements!R) { /// ditto @property auto front(ElementType!R val) { return _current.front = val; } } /// ditto enum bool empty = false; /// ditto void popFront() { _current.popFront(); if (_current.empty) _current = _original.save; } /// ditto @property Cycle save() { //No need to call _original.save, because Cycle never actually modifies _original return Cycle(_original, _current.save); } } } /// ditto template Cycle(R) if (isInfinite!R) { alias Cycle = R; } /// ditto struct Cycle(R) if (isStaticArray!R) { private alias ElementType = typeof(R.init[0]); private ElementType* _ptr; private size_t _index; nothrow: /// Range primitives this(ref R input, size_t index = 0) @system { _ptr = input.ptr; _index = index % R.length; } /// ditto @property ref inout(ElementType) front() inout @safe { static ref auto trustedPtrIdx(typeof(_ptr) p, size_t idx) @trusted { return p[idx]; } return trustedPtrIdx(_ptr, _index); } /// ditto enum bool empty = false; /// ditto void popFront() @safe { ++_index; if (_index >= R.length) _index = 0; } /// ditto ref inout(ElementType) opIndex(size_t n) inout @safe { static ref auto trustedPtrIdx(typeof(_ptr) p, size_t idx) @trusted { return p[idx % R.length]; } return trustedPtrIdx(_ptr, n + _index); } /// ditto @property inout(Cycle) save() inout @safe { return this; } private static struct DollarToken {} /// ditto enum opDollar = DollarToken.init; /// ditto auto opSlice(size_t i, size_t j) @safe in { assert( i <= j, "Attempting to slice a Repeat with a larger first argument than the second." ); } do { return this[i .. $].takeExactly(j - i); } /// ditto inout(typeof(this)) opSlice(size_t i, DollarToken) inout @safe { static auto trustedCtor(typeof(_ptr) p, size_t idx) @trusted { return cast(inout) Cycle(*cast(R*)(p), idx); } return trustedCtor(_ptr, _index + i); } } /// Ditto auto cycle(R)(R input) if (isInputRange!R) { static assert(isForwardRange!R || isInfinite!R, "Cycle requires a forward range argument unless it's statically known" ~ " to be infinite"); assert(!input.empty, "Attempting to pass an empty input to cycle"); static if (isInfinite!R) return input; else return Cycle!R(input); } /// @safe unittest { import std.algorithm.comparison : equal; import std.range : cycle, take; // Here we create an infinitive cyclic sequence from [1, 2] // (i.e. get here [1, 2, 1, 2, 1, 2 and so on]) then // take 5 elements of this sequence (so we have [1, 2, 1, 2, 1]) // and compare them with the expected values for equality. assert(cycle([1, 2]).take(5).equal([ 1, 2, 1, 2, 1 ])); } /// Ditto Cycle!R cycle(R)(R input, size_t index = 0) if (isRandomAccessRange!R && !isInfinite!R) { assert(!input.empty, "Attempting to pass an empty input to cycle"); return Cycle!R(input, index); } /// Ditto Cycle!R cycle(R)(ref R input, size_t index = 0) @system if (isStaticArray!R) { return Cycle!R(input, index); } @safe nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; static assert(isForwardRange!(Cycle!(uint[]))); // Make sure ref is getting propagated properly. int[] nums = [1,2,3]; auto c2 = cycle(nums); c2[3]++; assert(nums[0] == 2); immutable int[] immarr = [1, 2, 3]; foreach (DummyType; AllDummyRanges) { static if (isForwardRange!DummyType) { DummyType dummy; auto cy = cycle(dummy); static assert(isForwardRange!(typeof(cy))); auto t = take(cy, 20); assert(equal(t, [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10])); const cRange = cy; assert(cRange.front == 1); static if (hasAssignableElements!DummyType) { { cy.front = 66; scope(exit) cy.front = 1; assert(dummy.front == 66); } static if (isRandomAccessRange!DummyType) { { cy[10] = 66; scope(exit) cy[10] = 1; assert(dummy.front == 66); } assert(cRange[10] == 1); } } static if (hasSlicing!DummyType) { auto slice = cy[5 .. 15]; assert(equal(slice, [6, 7, 8, 9, 10, 1, 2, 3, 4, 5])); static assert(is(typeof(slice) == typeof(takeExactly(cy, 5)))); auto infSlice = cy[7 .. $]; assert(equal(take(infSlice, 5), [8, 9, 10, 1, 2])); static assert(isInfinite!(typeof(infSlice))); } } } } @system nothrow unittest // For static arrays. { import std.algorithm.comparison : equal; int[3] a = [ 1, 2, 3 ]; static assert(isStaticArray!(typeof(a))); auto c = cycle(a); assert(a.ptr == c._ptr); assert(equal(take(cycle(a), 5), [ 1, 2, 3, 1, 2 ][])); static assert(isForwardRange!(typeof(c))); // Test qualifiers on slicing. alias C = typeof(c); static assert(is(typeof(c[1 .. $]) == C)); const cConst = c; static assert(is(typeof(cConst[1 .. $]) == const(C))); } @safe nothrow unittest // For infinite ranges { struct InfRange { void popFront() { } @property int front() { return 0; } enum empty = false; auto save() { return this; } } struct NonForwardInfRange { void popFront() { } @property int front() { return 0; } enum empty = false; } InfRange i; NonForwardInfRange j; auto c = cycle(i); assert(c == i); //make sure it can alias out even non-forward infinite ranges static assert(is(typeof(j.cycle) == typeof(j))); } @safe unittest { import std.algorithm.comparison : equal; int[5] arr = [0, 1, 2, 3, 4]; auto cleD = cycle(arr[]); //Dynamic assert(equal(cleD[5 .. 10], arr[])); //n is a multiple of 5 worth about 3/4 of size_t.max auto n = size_t.max/4 + size_t.max/2; n -= n % 5; //Test index overflow foreach (_ ; 0 .. 10) { cleD = cleD[n .. $]; assert(equal(cleD[5 .. 10], arr[])); } } @system @nogc nothrow unittest { import std.algorithm.comparison : equal; int[5] arr = [0, 1, 2, 3, 4]; auto cleS = cycle(arr); //Static assert(equal(cleS[5 .. 10], arr[])); //n is a multiple of 5 worth about 3/4 of size_t.max auto n = size_t.max/4 + size_t.max/2; n -= n % 5; //Test index overflow foreach (_ ; 0 .. 10) { cleS = cleS[n .. $]; assert(equal(cleS[5 .. 10], arr[])); } } @system unittest { import std.algorithm.comparison : equal; int[1] arr = [0]; auto cleS = cycle(arr); cleS = cleS[10 .. $]; assert(equal(cleS[5 .. 10], 0.repeat(5))); assert(cleS.front == 0); } @system unittest //10845 { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter; auto a = inputRangeObject(iota(3).filter!"true"); assert(equal(cycle(a).take(10), [0, 1, 2, 0, 1, 2, 0, 1, 2, 0])); } @safe unittest // 12177 { static assert(__traits(compiles, recurrence!q{a[n - 1] ~ a[n - 2]}("1", "0"))); } // Issue 13390 @system unittest { import core.exception : AssertError; import std.exception : assertThrown; assertThrown!AssertError(cycle([0, 1, 2][0 .. 0])); } pure @safe unittest // issue 18657 { import std.algorithm.comparison : equal; auto r = refRange(&["foo"][0]).cycle.take(4); assert(equal(r.save, "foof")); assert(equal(r.save, "foof")); } private alias lengthType(R) = typeof(R.init.length.init); /** Iterate several ranges in lockstep. The element type is a proxy tuple that allows accessing the current element in the `n`th range by using `e[n]`. `zip` is similar to $(LREF lockstep), but `lockstep` doesn't bundle its elements and uses the `opApply` protocol. `lockstep` allows reference access to the elements in `foreach` iterations. Params: sp = controls what `zip` will do if the ranges are different lengths ranges = the ranges to zip together Returns: At minimum, an input range. `Zip` offers the lowest range facilities of all components, e.g. it offers random access iff all ranges offer random access, and also offers mutation and swapping if all ranges offer it. Due to this, `Zip` is extremely powerful because it allows manipulating several ranges in lockstep. Throws: An `Exception` if all of the ranges are not the same length and `sp` is set to `StoppingPolicy.requireSameLength`. Limitations: The `@nogc` and `nothrow` attributes cannot be inferred for the `Zip` struct because $(LREF StoppingPolicy) can vary at runtime. This limitation is not shared by the anonymous range returned by the `zip` function when not given an explicit `StoppingPolicy` as an argument. */ struct Zip(Ranges...) if (Ranges.length && allSatisfy!(isInputRange, Ranges)) { import std.format : format; //for generic mixins import std.typecons : Tuple; alias R = Ranges; private R ranges; alias ElementType = Tuple!(staticMap!(.ElementType, R)); private StoppingPolicy stoppingPolicy = StoppingPolicy.shortest; /** Builds an object. Usually this is invoked indirectly by using the $(LREF zip) function. */ this(R rs, StoppingPolicy s = StoppingPolicy.shortest) { ranges[] = rs[]; stoppingPolicy = s; } /** Returns `true` if the range is at end. The test depends on the stopping policy. */ static if (allSatisfy!(isInfinite, R)) { // BUG: Doesn't propagate infiniteness if only some ranges are infinite // and s == StoppingPolicy.longest. This isn't fixable in the // current design since StoppingPolicy is known only at runtime. enum bool empty = false; } else { /// @property bool empty() { import std.exception : enforce; import std.meta : anySatisfy; final switch (stoppingPolicy) { case StoppingPolicy.shortest: foreach (i, Unused; R) { if (ranges[i].empty) return true; } return false; case StoppingPolicy.longest: static if (anySatisfy!(isInfinite, R)) { return false; } else { foreach (i, Unused; R) { if (!ranges[i].empty) return false; } return true; } case StoppingPolicy.requireSameLength: foreach (i, Unused; R[1 .. $]) { enforce(ranges[0].empty == ranges[i + 1].empty, "Inequal-length ranges passed to Zip"); } return ranges[0].empty; } assert(false); } } static if (allSatisfy!(isForwardRange, R)) { /// @property Zip save() { //Zip(ranges[0].save, ranges[1].save, ..., stoppingPolicy) return mixin (q{Zip(%(ranges[%s].save%|, %), stoppingPolicy)}.format(iota(0, R.length))); } } private .ElementType!(R[i]) tryGetInit(size_t i)() { alias E = .ElementType!(R[i]); static if (!is(typeof({static E i;}))) throw new Exception("Range with non-default constructable elements exhausted."); else return E.init; } /** Returns the current iterated element. */ @property ElementType front() { @property tryGetFront(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].front;} //ElementType(tryGetFront!0, tryGetFront!1, ...) return mixin(q{ElementType(%(tryGetFront!%s, %))}.format(iota(0, R.length))); } /** Sets the front of all iterated ranges. */ static if (allSatisfy!(hasAssignableElements, R)) { @property void front(ElementType v) { foreach (i, Unused; R) { if (!ranges[i].empty) { ranges[i].front = v[i]; } } } } /** Moves out the front. */ static if (allSatisfy!(hasMobileElements, R)) { ElementType moveFront() { @property tryMoveFront(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].moveFront();} //ElementType(tryMoveFront!0, tryMoveFront!1, ...) return mixin(q{ElementType(%(tryMoveFront!%s, %))}.format(iota(0, R.length))); } } /** Returns the rightmost element. */ static if (allSatisfy!(isBidirectionalRange, R)) { @property ElementType back() { //TODO: Fixme! BackElement != back of all ranges in case of jagged-ness @property tryGetBack(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].back;} //ElementType(tryGetBack!0, tryGetBack!1, ...) return mixin(q{ElementType(%(tryGetBack!%s, %))}.format(iota(0, R.length))); } /** Moves out the back. */ static if (allSatisfy!(hasMobileElements, R)) { ElementType moveBack() { //TODO: Fixme! BackElement != back of all ranges in case of jagged-ness @property tryMoveBack(size_t i)(){return ranges[i].empty ? tryGetInit!i() : ranges[i].moveBack();} //ElementType(tryMoveBack!0, tryMoveBack!1, ...) return mixin(q{ElementType(%(tryMoveBack!%s, %))}.format(iota(0, R.length))); } } /** Returns the current iterated element. */ static if (allSatisfy!(hasAssignableElements, R)) { @property void back(ElementType v) { //TODO: Fixme! BackElement != back of all ranges in case of jagged-ness. //Not sure the call is even legal for StoppingPolicy.longest foreach (i, Unused; R) { if (!ranges[i].empty) { ranges[i].back = v[i]; } } } } } /** Advances to the next element in all controlled ranges. */ void popFront() { import std.exception : enforce; final switch (stoppingPolicy) { case StoppingPolicy.shortest: foreach (i, Unused; R) { assert(!ranges[i].empty); ranges[i].popFront(); } break; case StoppingPolicy.longest: foreach (i, Unused; R) { if (!ranges[i].empty) ranges[i].popFront(); } break; case StoppingPolicy.requireSameLength: foreach (i, Unused; R) { enforce(!ranges[i].empty, "Invalid Zip object"); ranges[i].popFront(); } break; } } /** Calls `popBack` for all controlled ranges. */ static if (allSatisfy!(isBidirectionalRange, R)) { void popBack() { //TODO: Fixme! In case of jaggedness, this is wrong. import std.exception : enforce; final switch (stoppingPolicy) { case StoppingPolicy.shortest: foreach (i, Unused; R) { assert(!ranges[i].empty); ranges[i].popBack(); } break; case StoppingPolicy.longest: foreach (i, Unused; R) { if (!ranges[i].empty) ranges[i].popBack(); } break; case StoppingPolicy.requireSameLength: foreach (i, Unused; R) { enforce(!ranges[i].empty, "Invalid Zip object"); ranges[i].popBack(); } break; } } } /** Returns the length of this range. Defined only if all ranges define `length`. */ static if (allSatisfy!(hasLength, R)) { @property auto length() { static if (Ranges.length == 1) return ranges[0].length; else { if (stoppingPolicy == StoppingPolicy.requireSameLength) return ranges[0].length; //[min|max](ranges[0].length, ranges[1].length, ...) import std.algorithm.comparison : min, max; if (stoppingPolicy == StoppingPolicy.shortest) return mixin(q{min(%(ranges[%s].length%|, %))}.format(iota(0, R.length))); else return mixin(q{max(%(ranges[%s].length%|, %))}.format(iota(0, R.length))); } } alias opDollar = length; } /** Returns a slice of the range. Defined only if all range define slicing. */ static if (allSatisfy!(hasSlicing, R)) { auto opSlice(size_t from, size_t to) { //Slicing an infinite range yields the type Take!R //For finite ranges, the type Take!R aliases to R alias ZipResult = Zip!(staticMap!(Take, R)); //ZipResult(ranges[0][from .. to], ranges[1][from .. to], ..., stoppingPolicy) return mixin (q{ZipResult(%(ranges[%s][from .. to]%|, %), stoppingPolicy)}.format(iota(0, R.length))); } } /** Returns the `n`th element in the composite range. Defined if all ranges offer random access. */ static if (allSatisfy!(isRandomAccessRange, R)) { ElementType opIndex(size_t n) { //TODO: Fixme! This may create an out of bounds access //for StoppingPolicy.longest //ElementType(ranges[0][n], ranges[1][n], ...) return mixin (q{ElementType(%(ranges[%s][n]%|, %))}.format(iota(0, R.length))); } /** Assigns to the `n`th element in the composite range. Defined if all ranges offer random access. */ static if (allSatisfy!(hasAssignableElements, R)) { void opIndexAssign(ElementType v, size_t n) { //TODO: Fixme! Not sure the call is even legal for StoppingPolicy.longest foreach (i, Range; R) { ranges[i][n] = v[i]; } } } /** Destructively reads the `n`th element in the composite range. Defined if all ranges offer random access. */ static if (allSatisfy!(hasMobileElements, R)) { ElementType moveAt(size_t n) { //TODO: Fixme! This may create an out of bounds access //for StoppingPolicy.longest //ElementType(ranges[0].moveAt(n), ranges[1].moveAt(n), ..., ) return mixin (q{ElementType(%(ranges[%s].moveAt(n)%|, %))}.format(iota(0, R.length))); } } } } /// Ditto auto zip(Ranges...)(Ranges ranges) if (Ranges.length && allSatisfy!(isInputRange, Ranges)) { static if (allSatisfy!(isInfinite, Ranges) || Ranges.length == 1) { return ZipShortest!(Ranges)(ranges); } else static if (allSatisfy!(isBidirectionalRange, Ranges)) { static if (allSatisfy!(templateOr!(isInfinite, hasLength), Ranges) && allSatisfy!(templateOr!(isInfinite, hasSlicing), Ranges) && allSatisfy!(isBidirectionalRange, staticMap!(Take, Ranges))) { // If all the ranges are bidirectional, if possible slice them to // the same length to simplify the implementation. static assert(anySatisfy!(hasLength, Ranges)); static foreach (i, Range; Ranges) static if (hasLength!Range) { static if (!anySatisfy!(hasLength, Ranges[0 .. i])) size_t minLen = ranges[i].length; else {{ const x = ranges[i].length; if (x < minLen) minLen = x; }} } import std.format : format; static if (!anySatisfy!(isInfinite, Ranges)) return mixin(`ZipShortest!(Yes.allKnownSameLength, staticMap!(Take, Ranges))`~ `(%(ranges[%s][0 .. minLen]%|, %))`.format(iota(0, Ranges.length))); else return mixin(`ZipShortest!(Yes.allKnownSameLength, staticMap!(Take, Ranges))`~ `(%(take(ranges[%s], minLen)%|, %))`.format(iota(0, Ranges.length))); } else static if (allSatisfy!(isRandomAccessRange, Ranges)) { // We can't slice but we can still use random access to ensure // "back" is retrieving the same index for each range. return ZipShortest!(Ranges)(ranges); } else { // If bidirectional range operations would not be supported by // ZipShortest that might have actually been a bug since Zip // supported `back` without verifying that each range had the // same length, but for the sake of backwards compatibility // use the old Zip to continue supporting them. return Zip!Ranges(ranges); } } else { return ZipShortest!(Ranges)(ranges); } } /// @nogc nothrow pure @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; // pairwise sum auto arr = only(0, 1, 2); auto part1 = zip(arr, arr.dropOne).map!"a[0] + a[1]"; assert(part1.equal(only(1, 3))); } /// nothrow pure @safe unittest { import std.conv : to; int[] a = [ 1, 2, 3 ]; string[] b = [ "a", "b", "c" ]; string[] result; foreach (tup; zip(a, b)) { result ~= tup[0].to!string ~ tup[1]; } assert(result == [ "1a", "2b", "3c" ]); size_t idx = 0; // unpacking tuple elements with foreach foreach (e1, e2; zip(a, b)) { assert(e1 == a[idx]); assert(e2 == b[idx]); ++idx; } } /// `zip` is powerful - the following code sorts two arrays in parallel: nothrow pure @safe unittest { import std.algorithm.sorting : sort; int[] a = [ 1, 2, 3 ]; string[] b = [ "a", "c", "b" ]; zip(a, b).sort!((t1, t2) => t1[0] > t2[0]); assert(a == [ 3, 2, 1 ]); // b is sorted according to a's sorting assert(b == [ "b", "c", "a" ]); } /// Ditto auto zip(Ranges...)(StoppingPolicy sp, Ranges ranges) if (Ranges.length && allSatisfy!(isInputRange, Ranges)) { return Zip!Ranges(ranges, sp); } /** Dictates how iteration in a $(LREF zip) and $(LREF lockstep) should stop. By default stop at the end of the shortest of all ranges. */ enum StoppingPolicy { /// Stop when the shortest range is exhausted shortest, /// Stop when the longest range is exhausted longest, /// Require that all ranges are equal requireSameLength, } /// pure @safe unittest { import std.algorithm.comparison : equal; import std.exception : assertThrown; import std.range.primitives; import std.typecons : tuple; auto a = [1, 2, 3]; auto b = [4, 5, 6, 7]; auto shortest = zip(StoppingPolicy.shortest, a, b); assert(shortest.equal([ tuple(1, 4), tuple(2, 5), tuple(3, 6) ])); auto longest = zip(StoppingPolicy.longest, a, b); assert(longest.equal([ tuple(1, 4), tuple(2, 5), tuple(3, 6), tuple(0, 7) ])); auto same = zip(StoppingPolicy.requireSameLength, a, b); same.popFrontN(3); assertThrown!Exception(same.popFront); } /+ Non-public. Like $(LREF Zip) with `StoppingPolicy.shortest` except it properly implements `back` and `popBack` in the case of uneven ranges or disables those operations when it is not possible to guarantee they are correct. +/ package template ZipShortest(Ranges...) if (Ranges.length && __traits(compiles, { static assert(allSatisfy!(isInputRange, Ranges)); })) { alias ZipShortest = .ZipShortest!( Ranges.length == 1 || allSatisfy!(isInfinite, Ranges) ? Yes.allKnownSameLength : No.allKnownSameLength, Ranges); } /+ non-public, ditto +/ package struct ZipShortest(Flag!"allKnownSameLength" allKnownSameLength, Ranges...) if (Ranges.length && allSatisfy!(isInputRange, Ranges)) { import std.format : format; //for generic mixins import std.typecons : Tuple; deprecated("Use of an undocumented alias R.") alias R = Ranges; // Unused here but defined in case library users rely on it. private Ranges ranges; alias ElementType = Tuple!(staticMap!(.ElementType, Ranges)); /+ Builds an object. Usually this is invoked indirectly by using the $(LREF zip) function. +/ this(Ranges rs) { ranges[] = rs[]; } /+ Returns `true` if the range is at end. +/ static if (allKnownSameLength ? anySatisfy!(isInfinite, Ranges) : allSatisfy!(isInfinite, Ranges)) { enum bool empty = false; } else { @property bool empty() { static if (allKnownSameLength) { return ranges[0].empty; } else { static foreach (i; 0 .. Ranges.length) { if (ranges[i].empty) return true; } return false; } } } /+ Forward range primitive. Only present if each constituent range is a forward range. +/ static if (allSatisfy!(isForwardRange, Ranges)) @property typeof(this) save() { return mixin(`typeof(return)(%(ranges[%s].save%|, %))`.format(iota(0, Ranges.length))); } /+ Returns the current iterated element. +/ @property ElementType front() { return mixin(`typeof(return)(%(ranges[%s].front%|, %))`.format(iota(0, Ranges.length))); } /+ Sets the front of all iterated ranges. Only present if each constituent range has assignable elements. +/ static if (allSatisfy!(hasAssignableElements, Ranges)) @property void front()(ElementType v) { static foreach (i; 0 .. Ranges.length) ranges[i].front = v[i]; } /+ Moves out the front. Present if each constituent range has mobile elements. +/ static if (allSatisfy!(hasMobileElements, Ranges)) ElementType moveFront()() { return mixin(`typeof(return)(%(ranges[%s].moveFront()%|, %))`.format(iota(0, Ranges.length))); } private enum bool isBackWellDefined = allSatisfy!(isBidirectionalRange, Ranges) && (allKnownSameLength || allSatisfy!(isRandomAccessRange, Ranges) // Could also add the case where there is one non-infinite bidirectional // range that defines `length` and all others are infinite random access // ranges. Adding this would require appropriate branches in // back/moveBack/popBack. ); /+ Returns the rightmost element. Present if all constituent ranges are bidirectional and either there is a compile-time guarantee that all ranges have the same length (in `allKnownSameLength`) or all ranges provide random access to elements. +/ static if (isBackWellDefined) @property ElementType back() { static if (allKnownSameLength) { return mixin(`typeof(return)(%(ranges[%s].back()%|, %))`.format(iota(0, Ranges.length))); } else { const backIndex = length - 1; return mixin(`typeof(return)(%(ranges[%s][backIndex]%|, %))`.format(iota(0, Ranges.length))); } } /+ Moves out the back. Present if `back` is defined and each constituent range has mobile elements. +/ static if (isBackWellDefined && allSatisfy!(hasMobileElements, Ranges)) ElementType moveBack()() { static if (allKnownSameLength) { return mixin(`typeof(return)(%(ranges[%s].moveBack()%|, %))`.format(iota(0, Ranges.length))); } else { const backIndex = length - 1; return mixin(`typeof(return)(%(ranges[%s].moveAt(backIndex)%|, %))`.format(iota(0, Ranges.length))); } } /+ Sets the rightmost element. Only present if `back` is defined and each constituent range has assignable elements. +/ static if (isBackWellDefined && allSatisfy!(hasAssignableElements, Ranges)) @property void back()(ElementType v) { static if (allKnownSameLength) { static foreach (i; 0 .. Ranges.length) ranges[i].back = v[i]; } else { const backIndex = length - 1; static foreach (i; 0 .. Ranges.length) ranges[i][backIndex] = v[i]; } } /+ Calls `popFront` on each constituent range. +/ void popFront() { static foreach (i; 0 .. Ranges.length) ranges[i].popFront(); } /+ Pops the rightmost element. Present if `back` is defined. +/ static if (isBackWellDefined) void popBack() { static if (allKnownSameLength) { static foreach (i; 0 .. Ranges.length) ranges[i].popBack; } else { const len = length; static foreach (i; 0 .. Ranges.length) static if (!isInfinite!(Ranges[i])) if (ranges[i].length == len) ranges[i].popBack(); } } /+ Returns the length of this range. Defined if at least one constituent range defines `length` and the other ranges all also define `length` or are infinite, or if at least one constituent range defines `length` and there is a compile-time guarantee that all ranges have the same length (in `allKnownSameLength`). +/ static if (allKnownSameLength ? anySatisfy!(hasLength, Ranges) : (anySatisfy!(hasLength, Ranges) && allSatisfy!(templateOr!(isInfinite, hasLength), Ranges))) { @property size_t length() { static if (allKnownSameLength) { static foreach (i, Range; Ranges) { static if (hasLength!Range && !anySatisfy!(hasLength, Ranges[0 .. i])) return ranges[i].length; } } else { static foreach (i, Range; Ranges) static if (hasLength!Range) { static if (!anySatisfy!(hasLength, Ranges[0 .. i])) size_t minLen = ranges[i].length; else {{ const x = ranges[i].length; if (x < minLen) minLen = x; }} } return minLen; } } alias opDollar = length; } /+ Returns a slice of the range. Defined if all constituent ranges support slicing. +/ static if (allSatisfy!(hasSlicing, Ranges)) { // Note: we will know that all elements of the resultant range // will have the same length but we cannot change `allKnownSameLength` // because the `hasSlicing` predicate tests that the result returned // by `opSlice` has the same type as the receiver. auto opSlice()(size_t from, size_t to) { //(ranges[0][from .. to], ranges[1][from .. to], ...) enum sliceArgs = `(%(ranges[%s][from .. to]%|, %))`.format(iota(0, Ranges.length)); static if (__traits(compiles, mixin(`typeof(this)`~sliceArgs))) return mixin(`typeof(this)`~sliceArgs); else // The type is different anyway so we might as well // explicitly set allKnownSameLength. return mixin(`ZipShortest!(Yes.allKnownSameLength, staticMap!(Take, Ranges))` ~sliceArgs); } } /+ Returns the `n`th element in the composite range. Defined if all constituent ranges offer random access. +/ static if (allSatisfy!(isRandomAccessRange, Ranges)) ElementType opIndex()(size_t n) { return mixin(`typeof(return)(%(ranges[%s][n]%|, %))`.format(iota(0, Ranges.length))); } /+ Sets the `n`th element in the composite range. Defined if all constituent ranges offer random access and have assignable elements. +/ static if (allSatisfy!(isRandomAccessRange, Ranges) && allSatisfy!(hasAssignableElements, Ranges)) void opIndexAssign()(ElementType v, size_t n) { static foreach (i; 0 .. Ranges.length) ranges[i][n] = v[i]; } /+ Destructively reads the `n`th element in the composite range. Defined if all constituent ranges offer random access and have mobile elements. +/ static if (allSatisfy!(isRandomAccessRange, Ranges) && allSatisfy!(hasMobileElements, Ranges)) ElementType moveAt()(size_t n) { return mixin(`typeof(return)(%(ranges[%s].moveAt(n)%|, %))`.format(iota(0, Ranges.length))); } } pure @system unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter, map; import std.algorithm.mutation : swap; import std.algorithm.sorting : sort; import std.exception : assertThrown, assertNotThrown; import std.typecons : tuple; int[] a = [ 1, 2, 3 ]; float[] b = [ 1.0, 2.0, 3.0 ]; foreach (e; zip(a, b)) { assert(e[0] == e[1]); } swap(a[0], a[1]); { auto z = zip(a, b); } //swap(z.front(), z.back()); sort!("a[0] < b[0]")(zip(a, b)); assert(a == [1, 2, 3]); assert(b == [2.0, 1.0, 3.0]); auto z = zip(StoppingPolicy.requireSameLength, a, b); assertNotThrown(z.popBack()); assertNotThrown(z.popBack()); assertNotThrown(z.popBack()); assert(z.empty); assertThrown(z.popBack()); a = [ 1, 2, 3 ]; b = [ 1.0, 2.0, 3.0 ]; sort!("a[0] > b[0]")(zip(StoppingPolicy.requireSameLength, a, b)); assert(a == [3, 2, 1]); assert(b == [3.0, 2.0, 1.0]); a = []; b = []; assert(zip(StoppingPolicy.requireSameLength, a, b).empty); // Test infiniteness propagation. static assert(isInfinite!(typeof(zip(repeat(1), repeat(1))))); // Test stopping policies with both value and reference. auto a1 = [1, 2]; auto a2 = [1, 2, 3]; auto stuff = tuple(tuple(a1, a2), tuple(filter!"a"(a1), filter!"a"(a2))); alias FOO = Zip!(immutable(int)[], immutable(float)[]); foreach (t; stuff.expand) { auto arr1 = t[0]; auto arr2 = t[1]; auto zShortest = zip(arr1, arr2); assert(equal(map!"a[0]"(zShortest), [1, 2])); assert(equal(map!"a[1]"(zShortest), [1, 2])); try { auto zSame = zip(StoppingPolicy.requireSameLength, arr1, arr2); foreach (elem; zSame) {} assert(0); } catch (Throwable) { /* It's supposed to throw.*/ } auto zLongest = zip(StoppingPolicy.longest, arr1, arr2); assert(!zLongest.ranges[0].empty); assert(!zLongest.ranges[1].empty); zLongest.popFront(); zLongest.popFront(); assert(!zLongest.empty); assert(zLongest.ranges[0].empty); assert(!zLongest.ranges[1].empty); zLongest.popFront(); assert(zLongest.empty); } // BUG 8900 assert(zip([1, 2], repeat('a')).array == [tuple(1, 'a'), tuple(2, 'a')]); assert(zip(repeat('a'), [1, 2]).array == [tuple('a', 1), tuple('a', 2)]); // Issue 18524 - moveBack instead performs moveFront { auto r = zip([1,2,3]); assert(r.moveBack()[0] == 3); assert(r.moveFront()[0] == 1); } // Doesn't work yet. Issues w/ emplace. // static assert(is(Zip!(immutable int[], immutable float[]))); // These unittests pass, but make the compiler consume an absurd amount // of RAM and time. Therefore, they should only be run if explicitly // uncommented when making changes to Zip. Also, running them using // make -fwin32.mak unittest makes the compiler completely run out of RAM. // You need to test just this module. /+ foreach (DummyType1; AllDummyRanges) { DummyType1 d1; foreach (DummyType2; AllDummyRanges) { DummyType2 d2; auto r = zip(d1, d2); assert(equal(map!"a[0]"(r), [1,2,3,4,5,6,7,8,9,10])); assert(equal(map!"a[1]"(r), [1,2,3,4,5,6,7,8,9,10])); static if (isForwardRange!DummyType1 && isForwardRange!DummyType2) { static assert(isForwardRange!(typeof(r))); } static if (isBidirectionalRange!DummyType1 && isBidirectionalRange!DummyType2) { static assert(isBidirectionalRange!(typeof(r))); } static if (isRandomAccessRange!DummyType1 && isRandomAccessRange!DummyType2) { static assert(isRandomAccessRange!(typeof(r))); } } } +/ } nothrow pure @safe unittest { import std.algorithm.sorting : sort; auto a = [5,4,3,2,1]; auto b = [3,1,2,5,6]; auto z = zip(a, b); sort!"a[0] < b[0]"(z); assert(a == [1, 2, 3, 4, 5]); assert(b == [6, 5, 2, 1, 3]); } nothrow pure @safe unittest { import std.algorithm.comparison : equal; import std.typecons : tuple; auto LL = iota(1L, 1000L); auto z = zip(LL, [4]); assert(equal(z, [tuple(1L,4)])); auto LL2 = iota(0L, 500L); auto z2 = zip([7], LL2); assert(equal(z2, [tuple(7, 0L)])); } // Text for Issue 11196 @safe pure unittest { import std.exception : assertThrown; static struct S { @disable this(); } assert(zip((S[5]).init[]).length == 5); assert(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).length == 1); assertThrown(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).front); } @nogc nothrow @safe pure unittest //12007 { static struct R { enum empty = false; void popFront(){} int front(){return 1;} @property R save(){return this;} @property void opAssign(R) @disable; } R r; auto z = zip(r, r); assert(z.save == z); } nothrow pure @system unittest { import std.typecons : tuple; auto r1 = [0,1,2]; auto r2 = [1,2,3]; auto z1 = zip(refRange(&r1), refRange(&r2)); auto z2 = z1.save; z1.popFront(); assert(z1.front == tuple(1,2)); assert(z2.front == tuple(0,1)); } @nogc nothrow pure @safe unittest { // Test zip's `back` and `length` with non-equal ranges. static struct NonSliceableRandomAccess { private int[] a; @property ref front() { return a.front; } @property ref back() { return a.back; } ref opIndex(size_t i) { return a[i]; } void popFront() { a.popFront(); } void popBack() { a.popBack(); } auto moveFront() { return a.moveFront(); } auto moveBack() { return a.moveBack(); } auto moveAt(size_t i) { return a.moveAt(i); } bool empty() const { return a.empty; } size_t length() const { return a.length; } typeof(this) save() { return this; } } static assert(isRandomAccessRange!NonSliceableRandomAccess); static assert(!hasSlicing!NonSliceableRandomAccess); static foreach (iteration; 0 .. 2) {{ int[5] data = [101, 102, 103, 201, 202]; static if (iteration == 0) { auto r1 = NonSliceableRandomAccess(data[0 .. 3]); auto r2 = NonSliceableRandomAccess(data[3 .. 5]); } else { auto r1 = data[0 .. 3]; auto r2 = data[3 .. 5]; } auto z = zip(r1, r2); static assert(isRandomAccessRange!(typeof(z))); assert(z.length == 2); assert(z.back[0] == 102 && z.back[1] == 202); z.back = typeof(z.back)(-102, -202);// Assign to back. assert(z.back[0] == -102 && z.back[1] == -202); z.popBack(); assert(z.length == 1); assert(z.back[0] == 101 && z.back[1] == 201); z.front = typeof(z.front)(-101, -201); assert(z.moveBack() == typeof(z.back)(-101, -201)); z.popBack(); assert(z.empty); }} } @nogc nothrow pure @safe unittest { // Test opSlice on infinite `zip`. auto z = zip(repeat(1), repeat(2)); assert(hasSlicing!(typeof(z))); auto slice = z[10 .. 20]; assert(slice.length == 10); static assert(!is(typeof(z) == typeof(slice))); } /* Generate lockstep's opApply function as a mixin string. If withIndex is true prepend a size_t index to the delegate. */ private string lockstepMixin(Ranges...)(bool withIndex, bool reverse) { import std.format : format; string[] params; string[] emptyChecks; string[] dgArgs; string[] popFronts; string indexDef; string indexInc; if (withIndex) { params ~= "size_t"; dgArgs ~= "index"; if (reverse) { indexDef = q{ size_t index = ranges[0].length-1; enforce(_stoppingPolicy == StoppingPolicy.requireSameLength, "lockstep can only be used with foreach_reverse when stoppingPolicy == requireSameLength"); foreach (range; ranges[1..$]) enforce(range.length == ranges[0].length); }; indexInc = "--index;"; } else { indexDef = "size_t index = 0;"; indexInc = "++index;"; } } foreach (idx, Range; Ranges) { params ~= format("%sElementType!(Ranges[%s])", hasLvalueElements!Range ? "ref " : "", idx); emptyChecks ~= format("!ranges[%s].empty", idx); if (reverse) { dgArgs ~= format("ranges[%s].back", idx); popFronts ~= format("ranges[%s].popBack();", idx); } else { dgArgs ~= format("ranges[%s].front", idx); popFronts ~= format("ranges[%s].popFront();", idx); } } string name = reverse ? "opApplyReverse" : "opApply"; return format( q{ int %s(scope int delegate(%s) dg) { import std.exception : enforce; auto ranges = _ranges; int res; %s while (%s) { res = dg(%s); if (res) break; %s %s } if (_stoppingPolicy == StoppingPolicy.requireSameLength) { foreach (range; ranges) enforce(range.empty); } return res; } }, name, params.join(", "), indexDef, emptyChecks.join(" && "), dgArgs.join(", "), popFronts.join("\n "), indexInc); } /** Iterate multiple ranges in lockstep using a `foreach` loop. In contrast to $(LREF zip) it allows reference access to its elements. If only a single range is passed in, the `Lockstep` aliases itself away. If the ranges are of different lengths and `s` == `StoppingPolicy.shortest` stop after the shortest range is empty. If the ranges are of different lengths and `s` == `StoppingPolicy.requireSameLength`, throw an exception. `s` may not be `StoppingPolicy.longest`, and passing this will throw an exception. Iterating over `Lockstep` in reverse and with an index is only possible when `s` == `StoppingPolicy.requireSameLength`, in order to preserve indexes. If an attempt is made at iterating in reverse when `s` == `StoppingPolicy.shortest`, an exception will be thrown. By default `StoppingPolicy` is set to `StoppingPolicy.shortest`. Limitations: The `pure`, `@safe`, `@nogc`, or `nothrow` attributes cannot be inferred for `lockstep` iteration. $(LREF zip) can infer the first two due to a different implementation. See_Also: $(LREF zip) `lockstep` is similar to $(LREF zip), but `zip` bundles its elements and returns a range. `lockstep` also supports reference access. Use `zip` if you want to pass the result to a range function. */ struct Lockstep(Ranges...) if (Ranges.length > 1 && allSatisfy!(isInputRange, Ranges)) { /// this(R ranges, StoppingPolicy sp = StoppingPolicy.shortest) { import std.exception : enforce; _ranges = ranges; enforce(sp != StoppingPolicy.longest, "Can't use StoppingPolicy.Longest on Lockstep."); _stoppingPolicy = sp; } mixin(lockstepMixin!Ranges(false, false)); mixin(lockstepMixin!Ranges(true, false)); static if (allSatisfy!(isBidirectionalRange, Ranges)) { mixin(lockstepMixin!Ranges(false, true)); static if (allSatisfy!(hasLength, Ranges)) { mixin(lockstepMixin!Ranges(true, true)); } else { mixin(lockstepReverseFailMixin!Ranges(true)); } } else { mixin(lockstepReverseFailMixin!Ranges(false)); mixin(lockstepReverseFailMixin!Ranges(true)); } private: alias R = Ranges; R _ranges; StoppingPolicy _stoppingPolicy; } /// Ditto Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges) if (allSatisfy!(isInputRange, Ranges)) { return Lockstep!(Ranges)(ranges); } /// Ditto Lockstep!(Ranges) lockstep(Ranges...)(Ranges ranges, StoppingPolicy s) if (allSatisfy!(isInputRange, Ranges)) { static if (Ranges.length > 1) return Lockstep!Ranges(ranges, s); else return ranges[0]; } /// @system unittest { auto arr1 = [1,2,3,4,5,100]; auto arr2 = [6,7,8,9,10]; foreach (ref a, b; lockstep(arr1, arr2)) { a += b; } assert(arr1 == [7,9,11,13,15,100]); /// Lockstep also supports iterating with an index variable: foreach (index, a, b; lockstep(arr1, arr2)) { assert(arr1[index] == a); assert(arr2[index] == b); } } @system unittest // Bugzilla 15860: foreach_reverse on lockstep { auto arr1 = [0, 1, 2, 3]; auto arr2 = [4, 5, 6, 7]; size_t n = arr1.length -1; foreach_reverse (index, a, b; lockstep(arr1, arr2, StoppingPolicy.requireSameLength)) { assert(n == index); assert(index == a); assert(arr1[index] == a); assert(arr2[index] == b); n--; } auto arr3 = [4, 5]; n = 1; foreach_reverse (a, b; lockstep(arr1, arr3)) { assert(a == arr1[$-n] && b == arr3[$-n]); n++; } } @system unittest { import std.algorithm.iteration : filter; import std.conv : to; // The filters are to make these the lowest common forward denominator ranges, // i.e. w/o ref return, random access, length, etc. auto foo = filter!"a"([1,2,3,4,5]); immutable bar = [6f,7f,8f,9f,10f].idup; auto l = lockstep(foo, bar); // Should work twice. These are forward ranges with implicit save. foreach (i; 0 .. 2) { uint[] res1; float[] res2; foreach (a, ref b; l) { res1 ~= a; res2 ~= b; } assert(res1 == [1,2,3,4,5]); assert(res2 == [6,7,8,9,10]); assert(bar == [6f,7f,8f,9f,10f]); } // Doc example. auto arr1 = [1,2,3,4,5]; auto arr2 = [6,7,8,9,10]; foreach (ref a, ref b; lockstep(arr1, arr2)) { a += b; } assert(arr1 == [7,9,11,13,15]); // Make sure StoppingPolicy.requireSameLength doesn't throw. auto ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength); int k = 1; foreach (a, b; ls) { assert(a - b == k); ++k; } // Make sure StoppingPolicy.requireSameLength throws. arr2.popBack(); ls = lockstep(arr1, arr2, StoppingPolicy.requireSameLength); try { foreach (a, b; ls) {} assert(0); } catch (Exception) {} // Just make sure 1-range case instantiates. This hangs the compiler // when no explicit stopping policy is specified due to Bug 4652. auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest); foreach (i, a; stuff) { assert(stuff[i] == a); } // Test with indexing. uint[] res1; float[] res2; size_t[] indices; foreach (i, a, b; lockstep(foo, bar)) { indices ~= i; res1 ~= a; res2 ~= b; } assert(indices == to!(size_t[])([0, 1, 2, 3, 4])); assert(res1 == [1,2,3,4,5]); assert(res2 == [6f,7f,8f,9f,10f]); // Make sure we've worked around the relevant compiler bugs and this at least // compiles w/ >2 ranges. lockstep(foo, foo, foo); // Make sure it works with const. const(int[])[] foo2 = [[1, 2, 3]]; const(int[])[] bar2 = [[4, 5, 6]]; auto c = chain(foo2, bar2); foreach (f, b; lockstep(c, c)) {} // Regression 10468 foreach (x, y; lockstep(iota(0, 10), iota(0, 10))) { } } @system unittest { struct RvalueRange { int[] impl; @property bool empty() { return impl.empty; } @property int front() { return impl[0]; } // N.B. non-ref void popFront() { impl.popFront(); } } auto data1 = [ 1, 2, 3, 4 ]; auto data2 = [ 5, 6, 7, 8 ]; auto r1 = RvalueRange(data1); auto r2 = data2; foreach (a, ref b; lockstep(r1, r2)) { a++; b++; } assert(data1 == [ 1, 2, 3, 4 ]); // changes to a do not propagate to data assert(data2 == [ 6, 7, 8, 9 ]); // but changes to b do. // Since r1 is by-value only, the compiler should reject attempts to // foreach over it with ref. static assert(!__traits(compiles, { foreach (ref a, ref b; lockstep(r1, r2)) { a++; } })); } private string lockstepReverseFailMixin(Ranges...)(bool withIndex) { import std.format : format; string[] params; string message; if (withIndex) { message = "Indexed reverse iteration with lockstep is only supported" ~"if all ranges are bidirectional and have a length.\n"; } else { message = "Reverse iteration with lockstep is only supported if all ranges are bidirectional.\n"; } if (withIndex) { params ~= "size_t"; } foreach (idx, Range; Ranges) { params ~= format("%sElementType!(Ranges[%s])", hasLvalueElements!Range ? "ref " : "", idx); } return format( q{ int opApplyReverse()(scope int delegate(%s) dg) { static assert(false, "%s"); } }, params.join(", "), message); } // For generic programming, make sure Lockstep!(Range) is well defined for a // single range. template Lockstep(Range) { alias Lockstep = Range; } /** Creates a mathematical sequence given the initial values and a recurrence function that computes the next value from the existing values. The sequence comes in the form of an infinite forward range. The type `Recurrence` itself is seldom used directly; most often, recurrences are obtained by calling the function $(D recurrence). When calling `recurrence`, the function that computes the next value is specified as a template argument, and the initial values in the recurrence are passed as regular arguments. For example, in a Fibonacci sequence, there are two initial values (and therefore a state size of 2) because computing the next Fibonacci value needs the past two values. The signature of this function should be: ---- auto fun(R)(R state, size_t n) ---- where `n` will be the index of the current value, and `state` will be an opaque state vector that can be indexed with array-indexing notation `state[i]`, where valid values of `i` range from $(D (n - 1)) to $(D (n - State.length)). If the function is passed in string form, the state has name `"a"` and the zero-based index in the recurrence has name `"n"`. The given string must return the desired value for `a[n]` given $(D a[n - 1]), $(D a[n - 2]), $(D a[n - 3]),..., $(D a[n - stateSize]). The state size is dictated by the number of arguments passed to the call to `recurrence`. The `Recurrence` struct itself takes care of managing the recurrence's state and shifting it appropriately. */ struct Recurrence(alias fun, StateType, size_t stateSize) { import std.functional : binaryFun; StateType[stateSize] _state; size_t _n; this(StateType[stateSize] initial) { _state = initial; } void popFront() { static auto trustedCycle(ref typeof(_state) s) @trusted { return cycle(s); } // The cast here is reasonable because fun may cause integer // promotion, but needs to return a StateType to make its operation // closed. Therefore, we have no other choice. _state[_n % stateSize] = cast(StateType) binaryFun!(fun, "a", "n")( trustedCycle(_state), _n + stateSize); ++_n; } @property StateType front() { return _state[_n % stateSize]; } @property typeof(this) save() { return this; } enum bool empty = false; } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; // The Fibonacci numbers, using function in string form: // a[0] = 1, a[1] = 1, and compute a[n+1] = a[n-1] + a[n] auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1); assert(fib.take(10).equal([1, 1, 2, 3, 5, 8, 13, 21, 34, 55])); // The factorials, using function in lambda form: auto fac = recurrence!((a,n) => a[n-1] * n)(1); assert(take(fac, 10).equal([ 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880 ])); // The triangular numbers, using function in explicit form: static size_t genTriangular(R)(R state, size_t n) { return state[n-1] + n; } auto tri = recurrence!genTriangular(0); assert(take(tri, 10).equal([0, 1, 3, 6, 10, 15, 21, 28, 36, 45])); } /// Ditto Recurrence!(fun, CommonType!(State), State.length) recurrence(alias fun, State...)(State initial) { CommonType!(State)[State.length] state; foreach (i, Unused; State) { state[i] = initial[i]; } return typeof(return)(state); } pure @safe nothrow unittest { import std.algorithm.comparison : equal; auto fib = recurrence!("a[n-1] + a[n-2]")(1, 1); static assert(isForwardRange!(typeof(fib))); int[] witness = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ]; assert(equal(take(fib, 10), witness)); foreach (e; take(fib, 10)) {} auto fact = recurrence!("n * a[n-1]")(1); assert( equal(take(fact, 10), [1, 1, 2, 2*3, 2*3*4, 2*3*4*5, 2*3*4*5*6, 2*3*4*5*6*7, 2*3*4*5*6*7*8, 2*3*4*5*6*7*8*9][]) ); auto piapprox = recurrence!("a[n] + (n & 1 ? 4.0 : -4.0) / (2 * n + 3)")(4.0); foreach (e; take(piapprox, 20)) {} // Thanks to yebblies for this test and the associated fix auto r = recurrence!"a[n-2]"(1, 2); witness = [1, 2, 1, 2, 1]; assert(equal(take(r, 5), witness)); } /** `Sequence` is similar to `Recurrence` except that iteration is presented in the so-called $(HTTP en.wikipedia.org/wiki/Closed_form, closed form). This means that the `n`th element in the series is computable directly from the initial values and `n` itself. This implies that the interface offered by `Sequence` is a random-access range, as opposed to the regular `Recurrence`, which only offers forward iteration. The state of the sequence is stored as a `Tuple` so it can be heterogeneous. */ struct Sequence(alias fun, State) { private: import std.functional : binaryFun; alias compute = binaryFun!(fun, "a", "n"); alias ElementType = typeof(compute(State.init, cast(size_t) 1)); State _state; size_t _n; static struct DollarToken{} public: this(State initial, size_t n = 0) { _state = initial; _n = n; } @property ElementType front() { return compute(_state, _n); } void popFront() { ++_n; } enum opDollar = DollarToken(); auto opSlice(size_t lower, size_t upper) in { assert( upper >= lower, "Attempting to slice a Sequence with a larger first argument than the second." ); } do { return typeof(this)(_state, _n + lower).take(upper - lower); } auto opSlice(size_t lower, DollarToken) { return typeof(this)(_state, _n + lower); } ElementType opIndex(size_t n) { return compute(_state, n + _n); } enum bool empty = false; @property Sequence save() { return this; } } /// Ditto auto sequence(alias fun, State...)(State args) { import std.typecons : Tuple, tuple; alias Return = Sequence!(fun, Tuple!State); return Return(tuple(args)); } /// Odd numbers, using function in string form: pure @safe nothrow @nogc unittest { auto odds = sequence!("a[0] + n * a[1]")(1, 2); assert(odds.front == 1); odds.popFront(); assert(odds.front == 3); odds.popFront(); assert(odds.front == 5); } /// Triangular numbers, using function in lambda form: pure @safe nothrow @nogc unittest { auto tri = sequence!((a,n) => n*(n+1)/2)(); // Note random access assert(tri[0] == 0); assert(tri[3] == 6); assert(tri[1] == 1); assert(tri[4] == 10); assert(tri[2] == 3); } /// Fibonacci numbers, using function in explicit form: @safe nothrow @nogc unittest { import std.math : pow, round, sqrt; static ulong computeFib(S)(S state, size_t n) { // Binet's formula return cast(ulong)(round((pow(state[0], n+1) - pow(state[1], n+1)) / state[2])); } auto fib = sequence!computeFib( (1.0 + sqrt(5.0)) / 2.0, // Golden Ratio (1.0 - sqrt(5.0)) / 2.0, // Conjugate of Golden Ratio sqrt(5.0)); // Note random access with [] operator assert(fib[1] == 1); assert(fib[4] == 5); assert(fib[3] == 3); assert(fib[2] == 2); assert(fib[9] == 55); } pure @safe nothrow @nogc unittest { import std.typecons : Tuple, tuple; auto y = Sequence!("a[0] + n * a[1]", Tuple!(int, int))(tuple(0, 4)); static assert(isForwardRange!(typeof(y))); //@@BUG //auto y = sequence!("a[0] + n * a[1]")(0, 4); //foreach (e; take(y, 15)) {} //writeln(e); auto odds = Sequence!("a[0] + n * a[1]", Tuple!(int, int))( tuple(1, 2)); for (int currentOdd = 1; currentOdd <= 21; currentOdd += 2) { assert(odds.front == odds[0]); assert(odds[0] == currentOdd); odds.popFront(); } } pure @safe nothrow @nogc unittest { import std.algorithm.comparison : equal; auto odds = sequence!("a[0] + n * a[1]")(1, 2); static assert(hasSlicing!(typeof(odds))); //Note: don't use drop or take as the target of an equal, //since they'll both just forward to opSlice, making the tests irrelevant // static slicing tests assert(equal(odds[0 .. 5], only(1, 3, 5, 7, 9))); assert(equal(odds[3 .. 7], only(7, 9, 11, 13))); // relative slicing test, testing slicing is NOT agnostic of state auto odds_less5 = odds.drop(5); //this should actually call odds[5 .. $] assert(equal(odds_less5[0 .. 3], only(11, 13, 15))); assert(equal(odds_less5[0 .. 10], odds[5 .. 15])); //Infinite slicing tests odds = odds[10 .. $]; assert(equal(odds.take(3), only(21, 23, 25))); } // Issue 5036 pure @safe nothrow unittest { auto s = sequence!((a, n) => new int)(0); assert(s.front != s.front); // no caching } // iota /** Creates a range of values that span the given starting and stopping values. Params: begin = The starting value. end = The value that serves as the stopping criterion. This value is not included in the range. step = The value to add to the current value at each iteration. Returns: A range that goes through the numbers `begin`, $(D begin + step), $(D begin + 2 * step), `...`, up to and excluding `end`. The two-argument overloads have $(D step = 1). If $(D begin < end && step < 0) or $(D begin > end && step > 0) or $(D begin == end), then an empty range is returned. If $(D step == 0) then $(D begin == end) is an error. For built-in types, the range returned is a random access range. For user-defined types that support `++`, the range is an input range. An integral iota also supports `in` operator from the right. It takes the stepping into account, the integral won't be considered contained if it falls between two consecutive values of the range. `contains` does the same as in, but from lefthand side. Example: --- void main() { import std.stdio; // The following groups all produce the same output of: // 0 1 2 3 4 foreach (i; 0 .. 5) writef("%s ", i); writeln(); import std.range : iota; foreach (i; iota(0, 5)) writef("%s ", i); writeln(); writefln("%(%s %|%)", iota(0, 5)); import std.algorithm.iteration : map; import std.algorithm.mutation : copy; import std.format; iota(0, 5).map!(i => format("%s ", i)).copy(stdout.lockingTextWriter()); writeln(); } --- */ auto iota(B, E, S)(B begin, E end, S step) if ((isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) && isIntegral!S) { import std.conv : unsigned; alias Value = CommonType!(Unqual!B, Unqual!E); alias StepType = Unqual!S; assert(step != 0 || begin == end); static struct Result { private Value current, last; private StepType step; // by convention, 0 if range is empty this(Value current, Value pastLast, StepType step) { if (current < pastLast && step > 0) { // Iterating upward assert(unsigned((pastLast - current) / step) <= size_t.max); // Cast below can't fail because current < pastLast this.last = cast(Value) (pastLast - 1); this.last -= unsigned(this.last - current) % step; } else if (current > pastLast && step < 0) { // Iterating downward assert(unsigned((current - pastLast) / (0 - step)) <= size_t.max); // Cast below can't fail because current > pastLast this.last = cast(Value) (pastLast + 1); this.last += unsigned(current - this.last) % (0 - step); } else { // Initialize an empty range this.step = 0; return; } this.step = step; this.current = current; } @property bool empty() const { return step == 0; } @property inout(Value) front() inout { assert(!empty); return current; } void popFront() { assert(!empty); if (current == last) step = 0; else current += step; } @property inout(Value) back() inout { assert(!empty); return last; } void popBack() { assert(!empty); if (current == last) step = 0; else last -= step; } @property auto save() { return this; } inout(Value) opIndex(ulong n) inout { assert(n < this.length); // Just cast to Value here because doing so gives overflow behavior // consistent with calling popFront() n times. return cast(inout Value) (current + step * n); } auto opBinaryRight(string op)(Value val) const if (op == "in") { if (empty) return false; //cast to avoid becoming unsigned auto supposedIndex = cast(StepType)(val - current) / step; return supposedIndex < length && supposedIndex * step + current == val; } auto contains(Value x){return x in this;} inout(Result) opSlice() inout { return this; } inout(Result) opSlice(ulong lower, ulong upper) inout { assert(upper >= lower && upper <= this.length); return cast(inout Result) Result( cast(Value)(current + lower * step), cast(Value)(current + upper * step), step); } @property size_t length() const { if (step > 0) return 1 + cast(size_t) (unsigned(last - current) / step); if (step < 0) return 1 + cast(size_t) (unsigned(current - last) / (0 - step)); return 0; } alias opDollar = length; } return Result(begin, end, step); } /// Ditto auto iota(B, E)(B begin, E end) if (isFloatingPoint!(CommonType!(B, E))) { return iota(begin, end, CommonType!(B, E)(1)); } /// Ditto auto iota(B, E)(B begin, E end) if (isIntegral!(CommonType!(B, E)) || isPointer!(CommonType!(B, E))) { import std.conv : unsigned; alias Value = CommonType!(Unqual!B, Unqual!E); static struct Result { private Value current, pastLast; this(Value current, Value pastLast) { if (current < pastLast) { assert(unsigned(pastLast - current) <= size_t.max); this.current = current; this.pastLast = pastLast; } else { // Initialize an empty range this.current = this.pastLast = current; } } @property bool empty() const { return current == pastLast; } @property inout(Value) front() inout { assert(!empty); return current; } void popFront() { assert(!empty); ++current; } @property inout(Value) back() inout { assert(!empty); return cast(inout(Value))(pastLast - 1); } void popBack() { assert(!empty); --pastLast; } @property auto save() { return this; } inout(Value) opIndex(size_t n) inout { assert(n < this.length); // Just cast to Value here because doing so gives overflow behavior // consistent with calling popFront() n times. return cast(inout Value) (current + n); } auto opBinaryRight(string op)(Value val) const if (op == "in") { return current <= val && val < pastLast; } auto contains(Value x){return x in this;} inout(Result) opSlice() inout { return this; } inout(Result) opSlice(ulong lower, ulong upper) inout { assert(upper >= lower && upper <= this.length); return cast(inout Result) Result(cast(Value)(current + lower), cast(Value)(pastLast - (length - upper))); } @property size_t length() const { return cast(size_t)(pastLast - current); } alias opDollar = length; } return Result(begin, end); } /// Ditto auto iota(E)(E end) if (is(typeof(iota(E(0), end)))) { E begin = E(0); return iota(begin, end); } /// Ditto // Specialization for floating-point types auto iota(B, E, S)(B begin, E end, S step) if (isFloatingPoint!(CommonType!(B, E, S))) in { assert(step != 0, "iota: step must not be 0"); assert((end - begin) / step >= 0, "iota: incorrect startup parameters"); } do { alias Value = Unqual!(CommonType!(B, E, S)); static struct Result { private Value start, step; private size_t index, count; this(Value start, Value end, Value step) { import std.conv : to; this.start = start; this.step = step; immutable fcount = (end - start) / step; count = to!size_t(fcount); auto pastEnd = start + count * step; if (step > 0) { if (pastEnd < end) ++count; assert(start + count * step >= end); } else { if (pastEnd > end) ++count; assert(start + count * step <= end); } } @property bool empty() const { return index == count; } @property Value front() const { assert(!empty); return start + step * index; } void popFront() { assert(!empty); ++index; } @property Value back() const { assert(!empty); return start + step * (count - 1); } void popBack() { assert(!empty); --count; } @property auto save() { return this; } Value opIndex(size_t n) const { assert(n < count); return start + step * (n + index); } inout(Result) opSlice() inout { return this; } inout(Result) opSlice(size_t lower, size_t upper) inout { assert(upper >= lower && upper <= count); Result ret = this; ret.index += lower; ret.count = upper - lower + ret.index; return cast(inout Result) ret; } @property size_t length() const { return count - index; } alias opDollar = length; } return Result(begin, end, step); } /// pure @safe unittest { import std.algorithm.comparison : equal; import std.math : approxEqual; auto r = iota(0, 10, 1); assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])); assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])); assert(3 in r); assert(r.contains(3)); //Same as above assert(!(10 in r)); assert(!(-8 in r)); r = iota(0, 11, 3); assert(equal(r, [0, 3, 6, 9])); assert(r[2] == 6); assert(!(2 in r)); auto rf = iota(0.0, 0.5, 0.1); assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4])); } pure nothrow @nogc @safe unittest { //float overloads use std.conv.to so can't be @nogc or nothrow alias ssize_t = Signed!size_t; assert(iota(ssize_t.max, 0, -1).length == ssize_t.max); assert(iota(ssize_t.max, ssize_t.min, -1).length == size_t.max); assert(iota(ssize_t.max, ssize_t.min, -2).length == 1 + size_t.max / 2); assert(iota(ssize_t.min, ssize_t.max, 2).length == 1 + size_t.max / 2); assert(iota(ssize_t.max, ssize_t.min, -3).length == size_t.max / 3); } debug @system unittest {//check the contracts import core.exception : AssertError; import std.exception : assertThrown; assertThrown!AssertError(iota(1,2,0)); assertThrown!AssertError(iota(0f,1f,0f)); assertThrown!AssertError(iota(1f,0f,0.1f)); assertThrown!AssertError(iota(0f,1f,-0.1f)); } pure @system nothrow unittest { int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; auto r1 = iota(a.ptr, a.ptr + a.length, 1); assert(r1.front == a.ptr); assert(r1.back == a.ptr + a.length - 1); assert(&a[4] in r1); } pure @safe nothrow @nogc unittest { assert(iota(1UL, 0UL).length == 0); assert(iota(1UL, 0UL, 1).length == 0); assert(iota(0, 1, 1).length == 1); assert(iota(1, 0, -1).length == 1); assert(iota(0, 1, -1).length == 0); assert(iota(ulong.max, 0).length == 0); } pure @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.searching : count; import std.math : approxEqual, nextUp, nextDown; import std.meta : AliasSeq; static assert(is(ElementType!(typeof(iota(0f))) == float)); static assert(hasLength!(typeof(iota(0, 2)))); auto r = iota(0, 10, 1); assert(r[$ - 1] == 9); assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][])); auto rSlice = r[2 .. 8]; assert(equal(rSlice, [2, 3, 4, 5, 6, 7])); rSlice.popFront(); assert(rSlice[0] == rSlice.front); assert(rSlice.front == 3); rSlice.popBack(); assert(rSlice[rSlice.length - 1] == rSlice.back); assert(rSlice.back == 6); rSlice = r[0 .. 4]; assert(equal(rSlice, [0, 1, 2, 3])); assert(3 in rSlice); assert(!(4 in rSlice)); auto rr = iota(10); assert(equal(rr, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9][])); r = iota(0, -10, -1); assert(equal(r, [0, -1, -2, -3, -4, -5, -6, -7, -8, -9][])); rSlice = r[3 .. 9]; assert(equal(rSlice, [-3, -4, -5, -6, -7, -8])); r = iota(0, -6, -3); assert(equal(r, [0, -3][])); rSlice = r[1 .. 2]; assert(equal(rSlice, [-3])); r = iota(0, -7, -3); assert(equal(r, [0, -3, -6][])); assert(0 in r); assert(-6 in r); rSlice = r[1 .. 3]; assert(equal(rSlice, [-3, -6])); assert(!(0 in rSlice)); assert(!(-2 in rSlice)); assert(!(-5 in rSlice)); assert(!(3 in rSlice)); assert(!(-9 in rSlice)); r = iota(0, 11, 3); assert(equal(r, [0, 3, 6, 9][])); assert(r[2] == 6); rSlice = r[1 .. 3]; assert(equal(rSlice, [3, 6])); auto rf = iota(0.0, 0.5, 0.1); assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4][])); assert(rf.length == 5); rf.popFront(); assert(rf.length == 4); auto rfSlice = rf[1 .. 4]; assert(rfSlice.length == 3); assert(approxEqual(rfSlice, [0.2, 0.3, 0.4])); rfSlice.popFront(); assert(approxEqual(rfSlice[0], 0.3)); rf.popFront(); assert(rf.length == 3); rfSlice = rf[1 .. 3]; assert(rfSlice.length == 2); assert(approxEqual(rfSlice, [0.3, 0.4])); assert(approxEqual(rfSlice[0], 0.3)); // With something just above 0.5 rf = iota(0.0, nextUp(0.5), 0.1); assert(approxEqual(rf, [0.0, 0.1, 0.2, 0.3, 0.4, 0.5][])); rf.popBack(); assert(rf[rf.length - 1] == rf.back); assert(approxEqual(rf.back, 0.4)); assert(rf.length == 5); // going down rf = iota(0.0, -0.5, -0.1); assert(approxEqual(rf, [0.0, -0.1, -0.2, -0.3, -0.4][])); rfSlice = rf[2 .. 5]; assert(approxEqual(rfSlice, [-0.2, -0.3, -0.4])); rf = iota(0.0, nextDown(-0.5), -0.1); assert(approxEqual(rf, [0.0, -0.1, -0.2, -0.3, -0.4, -0.5][])); // iota of longs auto rl = iota(5_000_000L); assert(rl.length == 5_000_000L); assert(0 in rl); assert(4_000_000L in rl); assert(!(-4_000_000L in rl)); assert(!(5_000_000L in rl)); // iota of longs with steps auto iota_of_longs_with_steps = iota(50L, 101L, 10); assert(iota_of_longs_with_steps.length == 6); assert(equal(iota_of_longs_with_steps, [50L, 60L, 70L, 80L, 90L, 100L])); // iota of unsigned zero length (issue 6222, actually trying to consume it // is the only way to find something is wrong because the public // properties are all correct) auto iota_zero_unsigned = iota(0, 0u, 3); assert(count(iota_zero_unsigned) == 0); // unsigned reverse iota can be buggy if .length doesn't take them into // account (issue 7982). assert(iota(10u, 0u, -1).length == 10); assert(iota(10u, 0u, -2).length == 5); assert(iota(uint.max, uint.max-10, -1).length == 10); assert(iota(uint.max, uint.max-10, -2).length == 5); assert(iota(uint.max, 0u, -1).length == uint.max); assert(20 in iota(20u, 10u, -2)); assert(16 in iota(20u, 10u, -2)); assert(!(15 in iota(20u, 10u, -2))); assert(!(10 in iota(20u, 10u, -2))); assert(!(uint.max in iota(20u, 10u, -1))); assert(!(int.min in iota(20u, 10u, -1))); assert(!(int.max in iota(20u, 10u, -1))); // Issue 8920 static foreach (Type; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong)) {{ Type val; foreach (i; iota(cast(Type) 0, cast(Type) 10)) { val++; } assert(val == 10); }} } pure @safe nothrow unittest { import std.algorithm.mutation : copy; auto idx = new size_t[100]; copy(iota(0, idx.length), idx); } @safe unittest { import std.meta : AliasSeq; static foreach (range; AliasSeq!(iota(2, 27, 4), iota(3, 9), iota(2.7, 12.3, .1), iota(3.2, 9.7))) {{ const cRange = range; const e = cRange.empty; const f = cRange.front; const b = cRange.back; const i = cRange[2]; const s1 = cRange[]; const s2 = cRange[0 .. 3]; const l = cRange.length; }} } @system unittest { //The ptr stuff can't be done at compile time, so we unfortunately end //up with some code duplication here. auto arr = [0, 5, 3, 5, 5, 7, 9, 2, 0, 42, 7, 6]; { const cRange = iota(arr.ptr, arr.ptr + arr.length, 3); const e = cRange.empty; const f = cRange.front; const b = cRange.back; const i = cRange[2]; const s1 = cRange[]; const s2 = cRange[0 .. 3]; const l = cRange.length; } { const cRange = iota(arr.ptr, arr.ptr + arr.length); const e = cRange.empty; const f = cRange.front; const b = cRange.back; const i = cRange[2]; const s1 = cRange[]; const s2 = cRange[0 .. 3]; const l = cRange.length; } } @nogc nothrow pure @safe unittest { { ushort start = 0, end = 10, step = 2; foreach (i; iota(start, end, step)) static assert(is(typeof(i) == ushort)); } { ubyte start = 0, end = 255, step = 128; uint x; foreach (i; iota(start, end, step)) { static assert(is(typeof(i) == ubyte)); ++x; } assert(x == 2); } } /* Generic overload that handles arbitrary types that support arithmetic * operations. * * User-defined types such as $(REF BigInt, std,bigint) are also supported, as long * as they can be incremented with `++` and compared with `<` or `==`. */ /// ditto auto iota(B, E)(B begin, E end) if (!isIntegral!(CommonType!(B, E)) && !isFloatingPoint!(CommonType!(B, E)) && !isPointer!(CommonType!(B, E)) && is(typeof((ref B b) { ++b; })) && (is(typeof(B.init < E.init)) || is(typeof(B.init == E.init))) ) { static struct Result { B current; E end; @property bool empty() { static if (is(typeof(B.init < E.init))) return !(current < end); else static if (is(typeof(B.init != E.init))) return current == end; else static assert(0); } @property auto front() { return current; } void popFront() { assert(!empty); ++current; } } return Result(begin, end); } @safe unittest { import std.algorithm.comparison : equal; // Test iota() for a type that only supports ++ and != but does not have // '<'-ordering. struct Cyclic(int wrapAround) { int current; this(int start) { current = start % wrapAround; } bool opEquals(Cyclic c) const { return current == c.current; } bool opEquals(int i) const { return current == i; } void opUnary(string op)() if (op == "++") { current = (current + 1) % wrapAround; } } alias Cycle5 = Cyclic!5; // Easy case auto i1 = iota(Cycle5(1), Cycle5(4)); assert(i1.equal([1, 2, 3])); // Wraparound case auto i2 = iota(Cycle5(3), Cycle5(2)); assert(i2.equal([3, 4, 0, 1 ])); } /** Options for the $(LREF FrontTransversal) and $(LREF Transversal) ranges (below). */ enum TransverseOptions { /** When transversed, the elements of a range of ranges are assumed to have different lengths (e.g. a jagged array). */ assumeJagged, //default /** The transversal enforces that the elements of a range of ranges have all the same length (e.g. an array of arrays, all having the same length). Checking is done once upon construction of the transversal range. */ enforceNotJagged, /** The transversal assumes, without verifying, that the elements of a range of ranges have all the same length. This option is useful if checking was already done from the outside of the range. */ assumeNotJagged, } /// @safe pure unittest { import std.algorithm.comparison : equal; import std.exception : assertThrown; auto arr = [[1, 2], [3, 4, 5]]; auto r1 = arr.frontTransversal!(TransverseOptions.assumeJagged); assert(r1.equal([1, 3])); // throws on construction assertThrown!Exception(arr.frontTransversal!(TransverseOptions.enforceNotJagged)); auto r2 = arr.frontTransversal!(TransverseOptions.assumeNotJagged); assert(r2.equal([1, 3])); // either assuming or checking for equal lengths makes // the result a random access range assert(r2[0] == 1); static assert(!__traits(compiles, r1[0])); } /** Given a range of ranges, iterate transversally through the first elements of each of the enclosed ranges. */ struct FrontTransversal(Ror, TransverseOptions opt = TransverseOptions.assumeJagged) { alias RangeOfRanges = Unqual!(Ror); alias RangeType = .ElementType!RangeOfRanges; alias ElementType = .ElementType!RangeType; private void prime() { static if (opt == TransverseOptions.assumeJagged) { while (!_input.empty && _input.front.empty) { _input.popFront(); } static if (isBidirectionalRange!RangeOfRanges) { while (!_input.empty && _input.back.empty) { _input.popBack(); } } } } /** Construction from an input. */ this(RangeOfRanges input) { _input = input; prime(); static if (opt == TransverseOptions.enforceNotJagged) // (isRandomAccessRange!RangeOfRanges // && hasLength!RangeType) { import std.exception : enforce; if (empty) return; immutable commonLength = _input.front.length; foreach (e; _input) { enforce(e.length == commonLength); } } } /** Forward range primitives. */ static if (isInfinite!RangeOfRanges) { enum bool empty = false; } else { @property bool empty() { static if (opt != TransverseOptions.assumeJagged) { if (!_input.empty) return _input.front.empty; } return _input.empty; } } /// Ditto @property auto ref front() { assert(!empty, "Attempting to fetch the front of an empty FrontTransversal"); return _input.front.front; } /// Ditto static if (hasMobileElements!RangeType) { ElementType moveFront() { return _input.front.moveFront(); } } static if (hasAssignableElements!RangeType) { @property void front(ElementType val) { _input.front.front = val; } } /// Ditto void popFront() { assert(!empty, "Attempting to popFront an empty FrontTransversal"); _input.popFront(); prime(); } /** Duplicates this `frontTransversal`. Note that only the encapsulating range of range will be duplicated. Underlying ranges will not be duplicated. */ static if (isForwardRange!RangeOfRanges) { @property FrontTransversal save() { return FrontTransversal(_input.save); } } static if (isBidirectionalRange!RangeOfRanges) { /** Bidirectional primitives. They are offered if $(D isBidirectionalRange!RangeOfRanges). */ @property auto ref back() { assert(!empty, "Attempting to fetch the back of an empty FrontTransversal"); return _input.back.front; } /// Ditto void popBack() { assert(!empty, "Attempting to popBack an empty FrontTransversal"); _input.popBack(); prime(); } /// Ditto static if (hasMobileElements!RangeType) { ElementType moveBack() { return _input.back.moveFront(); } } static if (hasAssignableElements!RangeType) { @property void back(ElementType val) { _input.back.front = val; } } } static if (isRandomAccessRange!RangeOfRanges && (opt == TransverseOptions.assumeNotJagged || opt == TransverseOptions.enforceNotJagged)) { /** Random-access primitive. It is offered if $(D isRandomAccessRange!RangeOfRanges && (opt == TransverseOptions.assumeNotJagged || opt == TransverseOptions.enforceNotJagged)). */ auto ref opIndex(size_t n) { return _input[n].front; } /// Ditto static if (hasMobileElements!RangeType) { ElementType moveAt(size_t n) { return _input[n].moveFront(); } } /// Ditto static if (hasAssignableElements!RangeType) { void opIndexAssign(ElementType val, size_t n) { _input[n].front = val; } } /// Ditto static if (hasLength!RangeOfRanges) { @property size_t length() { return _input.length; } alias opDollar = length; } /** Slicing if offered if `RangeOfRanges` supports slicing and all the conditions for supporting indexing are met. */ static if (hasSlicing!RangeOfRanges) { typeof(this) opSlice(size_t lower, size_t upper) { return typeof(this)(_input[lower .. upper]); } } } auto opSlice() { return this; } private: RangeOfRanges _input; } /// Ditto FrontTransversal!(RangeOfRanges, opt) frontTransversal( TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges) (RangeOfRanges rr) { return typeof(return)(rr); } /// pure @safe nothrow unittest { import std.algorithm.comparison : equal; int[][] x = new int[][2]; x[0] = [1, 2]; x[1] = [3, 4]; auto ror = frontTransversal(x); assert(equal(ror, [ 1, 3 ][])); } @safe unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges, DummyRange, ReturnBy; static assert(is(FrontTransversal!(immutable int[][]))); foreach (DummyType; AllDummyRanges) { auto dummies = [DummyType.init, DummyType.init, DummyType.init, DummyType.init]; foreach (i, ref elem; dummies) { // Just violate the DummyRange abstraction to get what I want. elem.arr = elem.arr[i..$ - (3 - i)]; } auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(dummies); static if (isForwardRange!DummyType) { static assert(isForwardRange!(typeof(ft))); } assert(equal(ft, [1, 2, 3, 4])); // Test slicing. assert(equal(ft[0 .. 2], [1, 2])); assert(equal(ft[1 .. 3], [2, 3])); assert(ft.front == ft.moveFront()); assert(ft.back == ft.moveBack()); assert(ft.moveAt(1) == ft[1]); // Test infiniteness propagation. static assert(isInfinite!(typeof(frontTransversal(repeat("foo"))))); static if (DummyType.r == ReturnBy.Reference) { { ft.front++; scope(exit) ft.front--; assert(dummies.front.front == 2); } { ft.front = 5; scope(exit) ft.front = 1; assert(dummies[0].front == 5); } { ft.back = 88; scope(exit) ft.back = 4; assert(dummies.back.front == 88); } { ft[1] = 99; scope(exit) ft[1] = 2; assert(dummies[1].front == 99); } } } } // Issue 16363 pure @safe nothrow unittest { import std.algorithm.comparison : equal; int[][] darr = [[0, 1], [4, 5]]; auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(darr); assert(equal(ft, [0, 4])); static assert(isRandomAccessRange!(typeof(ft))); } // Bugzilla 16442 pure @safe nothrow unittest { int[][] arr = [[], []]; auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(arr); assert(ft.empty); } // ditto pure @safe unittest { int[][] arr = [[], []]; auto ft = frontTransversal!(TransverseOptions.enforceNotJagged)(arr); assert(ft.empty); } /** Given a range of ranges, iterate transversally through the `n`th element of each of the enclosed ranges. This function is similar to `unzip` in other languages. Params: opt = Controls the assumptions the function makes about the lengths of the ranges rr = An input range of random access ranges Returns: At minimum, an input range. Range primitives such as bidirectionality and random access are given if the element type of `rr` provides them. */ struct Transversal(Ror, TransverseOptions opt = TransverseOptions.assumeJagged) { private alias RangeOfRanges = Unqual!Ror; private alias InnerRange = ElementType!RangeOfRanges; private alias E = ElementType!InnerRange; private void prime() { static if (opt == TransverseOptions.assumeJagged) { while (!_input.empty && _input.front.length <= _n) { _input.popFront(); } static if (isBidirectionalRange!RangeOfRanges) { while (!_input.empty && _input.back.length <= _n) { _input.popBack(); } } } } /** Construction from an input and an index. */ this(RangeOfRanges input, size_t n) { _input = input; _n = n; prime(); static if (opt == TransverseOptions.enforceNotJagged) { import std.exception : enforce; if (empty) return; immutable commonLength = _input.front.length; foreach (e; _input) { enforce(e.length == commonLength); } } } /** Forward range primitives. */ static if (isInfinite!(RangeOfRanges)) { enum bool empty = false; } else { @property bool empty() { return _input.empty; } } /// Ditto @property auto ref front() { assert(!empty, "Attempting to fetch the front of an empty Transversal"); return _input.front[_n]; } /// Ditto static if (hasMobileElements!InnerRange) { E moveFront() { return _input.front.moveAt(_n); } } /// Ditto static if (hasAssignableElements!InnerRange) { @property void front(E val) { _input.front[_n] = val; } } /// Ditto void popFront() { assert(!empty, "Attempting to popFront an empty Transversal"); _input.popFront(); prime(); } /// Ditto static if (isForwardRange!RangeOfRanges) { @property typeof(this) save() { auto ret = this; ret._input = _input.save; return ret; } } static if (isBidirectionalRange!RangeOfRanges) { /** Bidirectional primitives. They are offered if $(D isBidirectionalRange!RangeOfRanges). */ @property auto ref back() { assert(!empty, "Attempting to fetch the back of an empty Transversal"); return _input.back[_n]; } /// Ditto void popBack() { assert(!empty, "Attempting to popBack an empty Transversal"); _input.popBack(); prime(); } /// Ditto static if (hasMobileElements!InnerRange) { E moveBack() { return _input.back.moveAt(_n); } } /// Ditto static if (hasAssignableElements!InnerRange) { @property void back(E val) { _input.back[_n] = val; } } } static if (isRandomAccessRange!RangeOfRanges && (opt == TransverseOptions.assumeNotJagged || opt == TransverseOptions.enforceNotJagged)) { /** Random-access primitive. It is offered if $(D isRandomAccessRange!RangeOfRanges && (opt == TransverseOptions.assumeNotJagged || opt == TransverseOptions.enforceNotJagged)). */ auto ref opIndex(size_t n) { return _input[n][_n]; } /// Ditto static if (hasMobileElements!InnerRange) { E moveAt(size_t n) { return _input[n].moveAt(_n); } } /// Ditto static if (hasAssignableElements!InnerRange) { void opIndexAssign(E val, size_t n) { _input[n][_n] = val; } } /// Ditto static if (hasLength!RangeOfRanges) { @property size_t length() { return _input.length; } alias opDollar = length; } /** Slicing if offered if `RangeOfRanges` supports slicing and all the conditions for supporting indexing are met. */ static if (hasSlicing!RangeOfRanges) { typeof(this) opSlice(size_t lower, size_t upper) { return typeof(this)(_input[lower .. upper], _n); } } } auto opSlice() { return this; } private: RangeOfRanges _input; size_t _n; } /// Ditto Transversal!(RangeOfRanges, opt) transversal (TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges) (RangeOfRanges rr, size_t n) { return typeof(return)(rr, n); } /// @safe unittest { import std.algorithm.comparison : equal; int[][] x = new int[][2]; x[0] = [1, 2]; x[1] = [3, 4]; auto ror = transversal(x, 1); assert(equal(ror, [ 2, 4 ])); } /// The following code does a full unzip @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; int[][] y = [[1, 2, 3], [4, 5, 6]]; auto z = y.front.walkLength.iota.map!(i => transversal(y, i)); assert(equal!equal(z, [[1, 4], [2, 5], [3, 6]])); } @safe unittest { import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy; int[][] x = new int[][2]; x[0] = [ 1, 2 ]; x[1] = [3, 4]; auto ror = transversal!(TransverseOptions.assumeNotJagged)(x, 1); auto witness = [ 2, 4 ]; uint i; foreach (e; ror) assert(e == witness[i++]); assert(i == 2); assert(ror.length == 2); static assert(is(Transversal!(immutable int[][]))); // Make sure ref, assign is being propagated. { ror.front++; scope(exit) ror.front--; assert(x[0][1] == 3); } { ror.front = 5; scope(exit) ror.front = 2; assert(x[0][1] == 5); assert(ror.moveFront() == 5); } { ror.back = 999; scope(exit) ror.back = 4; assert(x[1][1] == 999); assert(ror.moveBack() == 999); } { ror[0] = 999; scope(exit) ror[0] = 2; assert(x[0][1] == 999); assert(ror.moveAt(0) == 999); } // Test w/o ref return. alias D = DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random); auto drs = [D.init, D.init]; foreach (num; 0 .. 10) { auto t = transversal!(TransverseOptions.enforceNotJagged)(drs, num); assert(t[0] == t[1]); assert(t[1] == num + 1); } static assert(isInfinite!(typeof(transversal(repeat([1,2,3]), 1)))); // Test slicing. auto mat = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]; auto mat1 = transversal!(TransverseOptions.assumeNotJagged)(mat, 1)[1 .. 3]; assert(mat1[0] == 6); assert(mat1[1] == 10); } struct Transposed(RangeOfRanges, TransverseOptions opt = TransverseOptions.assumeJagged) if (isForwardRange!RangeOfRanges && isInputRange!(ElementType!RangeOfRanges) && hasAssignableElements!RangeOfRanges) { this(RangeOfRanges input) { this._input = input; static if (opt == TransverseOptions.enforceNotJagged) { import std.exception : enforce; if (empty) return; immutable commonLength = _input.front.length; foreach (e; _input) { enforce(e.length == commonLength); } } } @property auto front() { import std.algorithm.iteration : filter, map; return _input.save .filter!(a => !a.empty) .map!(a => a.front); } void popFront() { // Advance the position of each subrange. auto r = _input.save; while (!r.empty) { auto e = r.front; if (!e.empty) { e.popFront(); r.front = e; } r.popFront(); } } static if (isRandomAccessRange!(ElementType!RangeOfRanges)) { auto ref opIndex(size_t n) { return transversal!opt(_input, n); } } @property bool empty() { if (_input.empty) return true; foreach (e; _input.save) { if (!e.empty) return false; } return true; } deprecated("This function is incorrect and will be removed November 2018. See the docs for more details.") @property Transposed save() { return Transposed(_input.save); } auto opSlice() { return this; } private: RangeOfRanges _input; } @safe unittest { // Boundary case: transpose of empty range should be empty int[][] ror = []; assert(transposed(ror).empty); } // Issue 9507 @safe unittest { import std.algorithm.comparison : equal; auto r = [[1,2], [3], [4,5], [], [6]]; assert(r.transposed.equal!equal([ [1, 3, 4, 6], [2, 5] ])); } // Issue 17742 @safe unittest { import std.algorithm.iteration : map; import std.algorithm.comparison : equal; auto ror = 5.iota.map!(y => 5.iota.map!(x => x * y).array).array; assert(ror[3][2] == 6); auto result = transposed!(TransverseOptions.assumeNotJagged)(ror); assert(result[2][3] == 6); auto x = [[1,2,3],[4,5,6]]; auto y = transposed!(TransverseOptions.assumeNotJagged)(x); assert(y.front.equal([1,4])); assert(y[0].equal([1,4])); assert(y[0][0] == 1); assert(y[1].equal([2,5])); assert(y[1][1] == 5); auto yy = transposed!(TransverseOptions.enforceNotJagged)(x); assert(yy.front.equal([1,4])); assert(yy[0].equal([1,4])); assert(yy[0][0] == 1); assert(yy[1].equal([2,5])); assert(yy[1][1] == 5); auto z = x.transposed; // assumeJagged assert(z.front.equal([1,4])); assert(z[0].equal([1,4])); assert(!is(typeof(z[0][0]))); } @safe unittest { import std.exception : assertThrown; auto r = [[1,2], [3], [4,5], [], [6]]; assertThrown(r.transposed!(TransverseOptions.enforceNotJagged)); } /** Given a range of ranges, returns a range of ranges where the $(I i)'th subrange contains the $(I i)'th elements of the original subranges. $(RED `Transposed` currently defines `save`, but does not work as a forward range. Consuming a copy made with `save` will consume all copies, even the original sub-ranges fed into `Transposed`.) Params: opt = Controls the assumptions the function makes about the lengths of the ranges (i.e. jagged or not) rr = Range of ranges */ Transposed!(RangeOfRanges, opt) transposed (TransverseOptions opt = TransverseOptions.assumeJagged, RangeOfRanges) (RangeOfRanges rr) if (isForwardRange!RangeOfRanges && isInputRange!(ElementType!RangeOfRanges) && hasAssignableElements!RangeOfRanges) { return Transposed!(RangeOfRanges, opt)(rr); } /// @safe unittest { import std.algorithm.comparison : equal; int[][] ror = [ [1, 2, 3], [4, 5, 6] ]; auto xp = transposed(ror); assert(equal!"a.equal(b)"(xp, [ [1, 4], [2, 5], [3, 6] ])); } /// @safe unittest { int[][] x = new int[][2]; x[0] = [1, 2]; x[1] = [3, 4]; auto tr = transposed(x); int[][] witness = [ [ 1, 3 ], [ 2, 4 ] ]; uint i; foreach (e; tr) { assert(array(e) == witness[i++]); } } // Issue 8764 @safe unittest { import std.algorithm.comparison : equal; ulong[1] t0 = [ 123 ]; assert(!hasAssignableElements!(typeof(t0[].chunks(1)))); assert(!is(typeof(transposed(t0[].chunks(1))))); assert(is(typeof(transposed(t0[].chunks(1).array())))); auto t1 = transposed(t0[].chunks(1).array()); assert(equal!"a.equal(b)"(t1, [[123]])); } /** This struct takes two ranges, `source` and `indices`, and creates a view of `source` as if its elements were reordered according to `indices`. `indices` may include only a subset of the elements of `source` and may also repeat elements. `Source` must be a random access range. The returned range will be bidirectional or random-access if `Indices` is bidirectional or random-access, respectively. */ struct Indexed(Source, Indices) if (isRandomAccessRange!Source && isInputRange!Indices && is(typeof(Source.init[ElementType!(Indices).init]))) { this(Source source, Indices indices) { this._source = source; this._indices = indices; } /// Range primitives @property auto ref front() { assert(!empty, "Attempting to fetch the front of an empty Indexed"); return _source[_indices.front]; } /// Ditto void popFront() { assert(!empty, "Attempting to popFront an empty Indexed"); _indices.popFront(); } static if (isInfinite!Indices) { enum bool empty = false; } else { /// Ditto @property bool empty() { return _indices.empty; } } static if (isForwardRange!Indices) { /// Ditto @property typeof(this) save() { // Don't need to save _source because it's never consumed. return typeof(this)(_source, _indices.save); } } /// Ditto static if (hasAssignableElements!Source) { @property auto ref front(ElementType!Source newVal) { assert(!empty); return _source[_indices.front] = newVal; } } static if (hasMobileElements!Source) { /// Ditto auto moveFront() { assert(!empty); return _source.moveAt(_indices.front); } } static if (isBidirectionalRange!Indices) { /// Ditto @property auto ref back() { assert(!empty, "Attempting to fetch the back of an empty Indexed"); return _source[_indices.back]; } /// Ditto void popBack() { assert(!empty, "Attempting to popBack an empty Indexed"); _indices.popBack(); } /// Ditto static if (hasAssignableElements!Source) { @property auto ref back(ElementType!Source newVal) { assert(!empty); return _source[_indices.back] = newVal; } } static if (hasMobileElements!Source) { /// Ditto auto moveBack() { assert(!empty); return _source.moveAt(_indices.back); } } } static if (hasLength!Indices) { /// Ditto @property size_t length() { return _indices.length; } alias opDollar = length; } static if (isRandomAccessRange!Indices) { /// Ditto auto ref opIndex(size_t index) { return _source[_indices[index]]; } static if (hasSlicing!Indices) { /// Ditto typeof(this) opSlice(size_t a, size_t b) { return typeof(this)(_source, _indices[a .. b]); } } static if (hasAssignableElements!Source) { /// Ditto auto opIndexAssign(ElementType!Source newVal, size_t index) { return _source[_indices[index]] = newVal; } } static if (hasMobileElements!Source) { /// Ditto auto moveAt(size_t index) { return _source.moveAt(_indices[index]); } } } // All this stuff is useful if someone wants to index an Indexed // without adding a layer of indirection. /** Returns the source range. */ @property Source source() { return _source; } /** Returns the indices range. */ @property Indices indices() { return _indices; } static if (isRandomAccessRange!Indices) { /** Returns the physical index into the source range corresponding to a given logical index. This is useful, for example, when indexing an `Indexed` without adding another layer of indirection. */ size_t physicalIndex(size_t logicalIndex) { return _indices[logicalIndex]; } /// @safe unittest { auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]); assert(ind.physicalIndex(0) == 1); } } private: Source _source; Indices _indices; } /// Ditto Indexed!(Source, Indices) indexed(Source, Indices)(Source source, Indices indices) { return typeof(return)(source, indices); } /// @safe unittest { import std.algorithm.comparison : equal; auto source = [1, 2, 3, 4, 5]; auto indices = [4, 3, 1, 2, 0, 4]; auto ind = indexed(source, indices); assert(equal(ind, [5, 4, 2, 3, 1, 5])); assert(equal(retro(ind), [5, 1, 3, 2, 4, 5])); } @safe unittest { { auto ind = indexed([1, 2, 3, 4, 5], [1, 3, 4]); assert(ind.physicalIndex(0) == 1); } auto source = [1, 2, 3, 4, 5]; auto indices = [4, 3, 1, 2, 0, 4]; auto ind = indexed(source, indices); // When elements of indices are duplicated and Source has lvalue elements, // these are aliased in ind. ind[0]++; assert(ind[0] == 6); assert(ind[5] == 6); } @safe unittest { import std.internal.test.dummyrange : AllDummyRanges, propagatesLength, propagatesRangeType, RangeType; foreach (DummyType; AllDummyRanges) { auto d = DummyType.init; auto r = indexed([1, 2, 3, 4, 5], d); static assert(propagatesRangeType!(DummyType, typeof(r))); static assert(propagatesLength!(DummyType, typeof(r))); } } /** This range iterates over fixed-sized chunks of size `chunkSize` of a `source` range. `Source` must be an $(REF_ALTTEXT input range, isInputRange, std,range,primitives). `chunkSize` must be greater than zero. If `!isInfinite!Source` and `source.walkLength` is not evenly divisible by `chunkSize`, the back element of this range will contain fewer than `chunkSize` elements. If `Source` is a forward range, the resulting range will be forward ranges as well. Otherwise, the resulting chunks will be input ranges consuming the same input: iterating over `front` will shrink the chunk such that subsequent invocations of `front` will no longer return the full chunk, and calling `popFront` on the outer range will invalidate any lingering references to previous values of `front`. Params: source = Range from which the chunks will be selected chunkSize = Chunk size See_Also: $(LREF slide) Returns: Range of chunks. */ struct Chunks(Source) if (isInputRange!Source) { static if (isForwardRange!Source) { /// Standard constructor this(Source source, size_t chunkSize) { assert(chunkSize != 0, "Cannot create a Chunk with an empty chunkSize"); _source = source; _chunkSize = chunkSize; } /// Input range primitives. Always present. @property auto front() { assert(!empty, "Attempting to fetch the front of an empty Chunks"); return _source.save.take(_chunkSize); } /// Ditto void popFront() { assert(!empty, "Attempting to popFront and empty Chunks"); _source.popFrontN(_chunkSize); } static if (!isInfinite!Source) /// Ditto @property bool empty() { return _source.empty; } else // undocumented enum empty = false; /// Forward range primitives. Only present if `Source` is a forward range. @property typeof(this) save() { return typeof(this)(_source.save, _chunkSize); } static if (hasLength!Source) { /// Length. Only if `hasLength!Source` is `true` @property size_t length() { // Note: _source.length + _chunkSize may actually overflow. // We cast to ulong to mitigate the problem on x86 machines. // For x64 machines, we just suppose we'll never overflow. // The "safe" code would require either an extra branch, or a // modulo operation, which is too expensive for such a rare case return cast(size_t)((cast(ulong)(_source.length) + _chunkSize - 1) / _chunkSize); } //Note: No point in defining opDollar here without slicing. //opDollar is defined below in the hasSlicing!Source section } static if (hasSlicing!Source) { //Used for various purposes private enum hasSliceToEnd = is(typeof(Source.init[_chunkSize .. $]) == Source); /** Indexing and slicing operations. Provided only if `hasSlicing!Source` is `true`. */ auto opIndex(size_t index) { immutable start = index * _chunkSize; immutable end = start + _chunkSize; static if (isInfinite!Source) return _source[start .. end]; else { import std.algorithm.comparison : min; immutable len = _source.length; assert(start < len, "chunks index out of bounds"); return _source[start .. min(end, len)]; } } /// Ditto static if (hasLength!Source) typeof(this) opSlice(size_t lower, size_t upper) { import std.algorithm.comparison : min; assert(lower <= upper && upper <= length, "chunks slicing index out of bounds"); immutable len = _source.length; return chunks(_source[min(lower * _chunkSize, len) .. min(upper * _chunkSize, len)], _chunkSize); } else static if (hasSliceToEnd) //For slicing an infinite chunk, we need to slice the source to the end. typeof(takeExactly(this, 0)) opSlice(size_t lower, size_t upper) { assert(lower <= upper, "chunks slicing index out of bounds"); return chunks(_source[lower * _chunkSize .. $], _chunkSize).takeExactly(upper - lower); } static if (isInfinite!Source) { static if (hasSliceToEnd) { private static struct DollarToken{} DollarToken opDollar() { return DollarToken(); } //Slice to dollar typeof(this) opSlice(size_t lower, DollarToken) { return typeof(this)(_source[lower * _chunkSize .. $], _chunkSize); } } } else { //Dollar token carries a static type, with no extra information. //It can lazily transform into _source.length on algorithmic //operations such as : chunks[$/2, $-1]; private static struct DollarToken { Chunks!Source* mom; @property size_t momLength() { return mom.length; } alias momLength this; } DollarToken opDollar() { return DollarToken(&this); } //Slice overloads optimized for using dollar. Without this, to slice to end, we would... //1. Evaluate chunks.length //2. Multiply by _chunksSize //3. To finally just compare it (with min) to the original length of source (!) //These overloads avoid that. typeof(this) opSlice(DollarToken, DollarToken) { static if (hasSliceToEnd) return chunks(_source[$ .. $], _chunkSize); else { immutable len = _source.length; return chunks(_source[len .. len], _chunkSize); } } typeof(this) opSlice(size_t lower, DollarToken) { import std.algorithm.comparison : min; assert(lower <= length, "chunks slicing index out of bounds"); static if (hasSliceToEnd) return chunks(_source[min(lower * _chunkSize, _source.length) .. $], _chunkSize); else { immutable len = _source.length; return chunks(_source[min(lower * _chunkSize, len) .. len], _chunkSize); } } typeof(this) opSlice(DollarToken, size_t upper) { assert(upper == length, "chunks slicing index out of bounds"); return this[$ .. $]; } } } //Bidirectional range primitives static if (hasSlicing!Source && hasLength!Source) { /** Bidirectional range primitives. Provided only if both `hasSlicing!Source` and `hasLength!Source` are `true`. */ @property auto back() { assert(!empty, "back called on empty chunks"); immutable len = _source.length; immutable start = (len - 1) / _chunkSize * _chunkSize; return _source[start .. len]; } /// Ditto void popBack() { assert(!empty, "popBack() called on empty chunks"); immutable end = (_source.length - 1) / _chunkSize * _chunkSize; _source = _source[0 .. end]; } } private: Source _source; size_t _chunkSize; } else // is input range only { import std.typecons : RefCounted; static struct Chunk { private RefCounted!Impl impl; @property bool empty() { return impl.curSizeLeft == 0 || impl.r.empty; } @property auto front() { return impl.r.front; } void popFront() { assert(impl.curSizeLeft > 0 && !impl.r.empty); impl.curSizeLeft--; impl.r.popFront(); } } static struct Impl { private Source r; private size_t chunkSize; private size_t curSizeLeft; } private RefCounted!Impl impl; private this(Source r, size_t chunkSize) { impl = RefCounted!Impl(r, r.empty ? 0 : chunkSize, chunkSize); } @property bool empty() { return impl.chunkSize == 0; } @property Chunk front() return { return Chunk(impl); } void popFront() { impl.curSizeLeft -= impl.r.popFrontN(impl.curSizeLeft); if (!impl.r.empty) impl.curSizeLeft = impl.chunkSize; else impl.chunkSize = 0; } static assert(isInputRange!(typeof(this))); } } /// Ditto Chunks!Source chunks(Source)(Source source, size_t chunkSize) if (isInputRange!Source) { return typeof(return)(source, chunkSize); } /// @safe unittest { import std.algorithm.comparison : equal; auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; auto chunks = chunks(source, 4); assert(chunks[0] == [1, 2, 3, 4]); assert(chunks[1] == [5, 6, 7, 8]); assert(chunks[2] == [9, 10]); assert(chunks.back == chunks[2]); assert(chunks.front == chunks[0]); assert(chunks.length == 3); assert(equal(retro(array(chunks)), array(retro(chunks)))); } /// Non-forward input ranges are supported, but with limited semantics. @system /*@safe*/ unittest // FIXME: can't be @safe because RefCounted isn't. { import std.algorithm.comparison : equal; int i; // The generator doesn't save state, so it cannot be a forward range. auto inputRange = generate!(() => ++i).take(10); // We can still process it in chunks, but it will be single-pass only. auto chunked = inputRange.chunks(2); assert(chunked.front.equal([1, 2])); assert(chunked.front.empty); // Iterating the chunk has consumed it chunked.popFront; assert(chunked.front.equal([3, 4])); } @system /*@safe*/ unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : ReferenceInputRange; auto data = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; auto r = new ReferenceInputRange!int(data).chunks(3); assert(r.equal!equal([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ], [ 10 ] ])); auto data2 = [ 1, 2, 3, 4, 5, 6 ]; auto r2 = new ReferenceInputRange!int(data2).chunks(3); assert(r2.equal!equal([ [ 1, 2, 3 ], [ 4, 5, 6 ] ])); auto data3 = [ 1, 2, 3, 4, 5 ]; auto r3 = new ReferenceInputRange!int(data3).chunks(2); assert(r3.front.equal([1, 2])); r3.popFront(); assert(!r3.empty); r3.popFront(); assert(r3.front.equal([5])); } @safe unittest { auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; auto chunks = chunks(source, 4); auto chunks2 = chunks.save; chunks.popFront(); assert(chunks[0] == [5, 6, 7, 8]); assert(chunks[1] == [9, 10]); chunks2.popBack(); assert(chunks2[1] == [5, 6, 7, 8]); assert(chunks2.length == 2); static assert(isRandomAccessRange!(typeof(chunks))); } @safe unittest { import std.algorithm.comparison : equal; //Extra toying with slicing and indexing. auto chunks1 = [0, 0, 1, 1, 2, 2, 3, 3, 4].chunks(2); auto chunks2 = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4].chunks(2); assert(chunks1.length == 5); assert(chunks2.length == 5); assert(chunks1[4] == [4]); assert(chunks2[4] == [4, 4]); assert(chunks1.back == [4]); assert(chunks2.back == [4, 4]); assert(chunks1[0 .. 1].equal([[0, 0]])); assert(chunks1[0 .. 2].equal([[0, 0], [1, 1]])); assert(chunks1[4 .. 5].equal([[4]])); assert(chunks2[4 .. 5].equal([[4, 4]])); assert(chunks1[0 .. 0].equal((int[][]).init)); assert(chunks1[5 .. 5].equal((int[][]).init)); assert(chunks2[5 .. 5].equal((int[][]).init)); //Fun with opDollar assert(chunks1[$ .. $].equal((int[][]).init)); //Quick assert(chunks2[$ .. $].equal((int[][]).init)); //Quick assert(chunks1[$ - 1 .. $].equal([[4]])); //Semiquick assert(chunks2[$ - 1 .. $].equal([[4, 4]])); //Semiquick assert(chunks1[$ .. 5].equal((int[][]).init)); //Semiquick assert(chunks2[$ .. 5].equal((int[][]).init)); //Semiquick assert(chunks1[$ / 2 .. $ - 1].equal([[2, 2], [3, 3]])); //Slow } @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter; //ForwardRange auto r = filter!"true"([1, 2, 3, 4, 5]).chunks(2); assert(equal!"equal(a, b)"(r, [[1, 2], [3, 4], [5]])); //InfiniteRange w/o RA auto fibsByPairs = recurrence!"a[n-1] + a[n-2]"(1, 1).chunks(2); assert(equal!`equal(a, b)`(fibsByPairs.take(2), [[ 1, 1], [ 2, 3]])); //InfiniteRange w/ RA and slicing auto odds = sequence!("a[0] + n * a[1]")(1, 2); auto oddsByPairs = odds.chunks(2); assert(equal!`equal(a, b)`(oddsByPairs.take(2), [[ 1, 3], [ 5, 7]])); //Requires phobos#991 for Sequence to have slice to end static assert(hasSlicing!(typeof(odds))); assert(equal!`equal(a, b)`(oddsByPairs[3 .. 5], [[13, 15], [17, 19]])); assert(equal!`equal(a, b)`(oddsByPairs[3 .. $].take(2), [[13, 15], [17, 19]])); } /** This range splits a `source` range into `chunkCount` chunks of approximately equal length. `Source` must be a forward range with known length. Unlike $(LREF chunks), `evenChunks` takes a chunk count (not size). The returned range will contain zero or more $(D source.length / chunkCount + 1) elements followed by $(D source.length / chunkCount) elements. If $(D source.length < chunkCount), some chunks will be empty. `chunkCount` must not be zero, unless `source` is also empty. */ struct EvenChunks(Source) if (isForwardRange!Source && hasLength!Source) { /// Standard constructor this(Source source, size_t chunkCount) { assert(chunkCount != 0 || source.empty, "Cannot create EvenChunks with a zero chunkCount"); _source = source; _chunkCount = chunkCount; } /// Forward range primitives. Always present. @property auto front() { assert(!empty, "Attempting to fetch the front of an empty evenChunks"); return _source.save.take(_chunkPos(1)); } /// Ditto void popFront() { assert(!empty, "Attempting to popFront an empty evenChunks"); _source.popFrontN(_chunkPos(1)); _chunkCount--; } /// Ditto @property bool empty() { return _source.empty; } /// Ditto @property typeof(this) save() { return typeof(this)(_source.save, _chunkCount); } /// Length @property size_t length() const { return _chunkCount; } //Note: No point in defining opDollar here without slicing. //opDollar is defined below in the hasSlicing!Source section static if (hasSlicing!Source) { /** Indexing, slicing and bidirectional operations and range primitives. Provided only if `hasSlicing!Source` is `true`. */ auto opIndex(size_t index) { assert(index < _chunkCount, "evenChunks index out of bounds"); return _source[_chunkPos(index) .. _chunkPos(index+1)]; } /// Ditto typeof(this) opSlice(size_t lower, size_t upper) { assert(lower <= upper && upper <= length, "evenChunks slicing index out of bounds"); return evenChunks(_source[_chunkPos(lower) .. _chunkPos(upper)], upper - lower); } /// Ditto @property auto back() { assert(!empty, "back called on empty evenChunks"); return _source[_chunkPos(_chunkCount - 1) .. _source.length]; } /// Ditto void popBack() { assert(!empty, "popBack() called on empty evenChunks"); _source = _source[0 .. _chunkPos(_chunkCount - 1)]; _chunkCount--; } } private: Source _source; size_t _chunkCount; size_t _chunkPos(size_t i) { /* _chunkCount = 5, _source.length = 13: chunk0 | chunk3 | | v v +-+-+-+-+-+ ^ |0|3|.| | | | +-+-+-+-+-+ | div |1|4|.| | | | +-+-+-+-+-+ v |2|5|.| +-+-+-+ <-----> mod <---------> _chunkCount One column is one chunk. popFront and popBack pop the left-most and right-most column, respectively. */ auto div = _source.length / _chunkCount; auto mod = _source.length % _chunkCount; auto pos = i <= mod ? i * (div+1) : mod * (div+1) + (i-mod) * div ; //auto len = i < mod // ? div+1 // : div //; return pos; } } /// Ditto EvenChunks!Source evenChunks(Source)(Source source, size_t chunkCount) if (isForwardRange!Source && hasLength!Source) { return typeof(return)(source, chunkCount); } /// @safe unittest { import std.algorithm.comparison : equal; auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; auto chunks = evenChunks(source, 3); assert(chunks[0] == [1, 2, 3, 4]); assert(chunks[1] == [5, 6, 7]); assert(chunks[2] == [8, 9, 10]); } @safe unittest { import std.algorithm.comparison : equal; auto source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; auto chunks = evenChunks(source, 3); assert(chunks.back == chunks[2]); assert(chunks.front == chunks[0]); assert(chunks.length == 3); assert(equal(retro(array(chunks)), array(retro(chunks)))); auto chunks2 = chunks.save; chunks.popFront(); assert(chunks[0] == [5, 6, 7]); assert(chunks[1] == [8, 9, 10]); chunks2.popBack(); assert(chunks2[1] == [5, 6, 7]); assert(chunks2.length == 2); static assert(isRandomAccessRange!(typeof(chunks))); } @safe unittest { import std.algorithm.comparison : equal; int[] source = []; auto chunks = source.evenChunks(0); assert(chunks.length == 0); chunks = source.evenChunks(3); assert(equal(chunks, [[], [], []])); chunks = [1, 2, 3].evenChunks(5); assert(equal(chunks, [[1], [2], [3], [], []])); } /** A fixed-sized sliding window iteration of size `windowSize` over a `source` range by a custom `stepSize`. The `Source` range must be at least a $(REF_ALTTEXT ForwardRange, isForwardRange, std,range,primitives) and the `windowSize` must be greater than zero. For `windowSize = 1` it splits the range into single element groups (aka `unflatten`) For `windowSize = 2` it is similar to `zip(source, source.save.dropOne)`. Params: f = Whether the last element has fewer elements than `windowSize` it should be be ignored (`No.withPartial`) or added (`Yes.withPartial`) source = Range from which the slide will be selected windowSize = Sliding window size stepSize = Steps between the windows (by default 1) Returns: Range of all sliding windows with propagated bi-directionality, forwarding, random access, and slicing. Note: To avoid performance overhead, $(REF_ALTTEXT bi-directionality, isBidirectionalRange, std,range,primitives) is only available when $(REF hasSlicing, std,range,primitives) and $(REF hasLength, std,range,primitives) are true. See_Also: $(LREF chunks) */ auto slide(Flag!"withPartial" f = Yes.withPartial, Source)(Source source, size_t windowSize, size_t stepSize = 1) if (isForwardRange!Source) { return Slides!(f, Source)(source, windowSize, stepSize); } /// Iterate over ranges with windows @safe pure nothrow unittest { import std.algorithm.comparison : equal; assert([0, 1, 2, 3].slide(2).equal!equal( [[0, 1], [1, 2], [2, 3]] )); assert(5.iota.slide(3).equal!equal( [[0, 1, 2], [1, 2, 3], [2, 3, 4]] )); } /// set a custom stepsize (default 1) @safe pure nothrow unittest { import std.algorithm.comparison : equal; assert(6.iota.slide(1, 2).equal!equal( [[0], [2], [4]] )); assert(6.iota.slide(2, 4).equal!equal( [[0, 1], [4, 5]] )); assert(iota(7).slide(2, 2).equal!equal( [[0, 1], [2, 3], [4, 5], [6]] )); assert(iota(12).slide(2, 4).equal!equal( [[0, 1], [4, 5], [8, 9]] )); } /// Allow the last slide to have fewer elements than windowSize @safe pure nothrow unittest { import std.algorithm.comparison : equal; assert(3.iota.slide!(No.withPartial)(4).empty); assert(3.iota.slide!(Yes.withPartial)(4).equal!equal( [[0, 1, 2]] )); } /// Count all the possible substrings of length 2 @safe pure nothrow unittest { import std.algorithm.iteration : each; int[dstring] d; "AGAGA"d.slide!(Yes.withPartial)(2).each!(a => d[a]++); assert(d == ["AG"d: 2, "GA"d: 2]); } /// withPartial only has an effect if last element in the range doesn't have the full size @safe pure nothrow unittest { import std.algorithm.comparison : equal; assert(5.iota.slide!(Yes.withPartial)(3, 4).equal!equal([[0, 1, 2], [4]])); assert(6.iota.slide!(Yes.withPartial)(3, 4).equal!equal([[0, 1, 2], [4, 5]])); assert(7.iota.slide!(Yes.withPartial)(3, 4).equal!equal([[0, 1, 2], [4, 5, 6]])); assert(5.iota.slide!(No.withPartial)(3, 4).equal!equal([[0, 1, 2]])); assert(6.iota.slide!(No.withPartial)(3, 4).equal!equal([[0, 1, 2]])); assert(7.iota.slide!(No.withPartial)(3, 4).equal!equal([[0, 1, 2], [4, 5, 6]])); } private struct Slides(Flag!"withPartial" withPartial = Yes.withPartial, Source) if (isForwardRange!Source) { private: Source source; size_t windowSize; size_t stepSize; static if (hasLength!Source) { enum needsEndTracker = false; } else { // If there's no information about the length, track needs to be kept manually Source nextSource; enum needsEndTracker = true; } bool _empty; static if (hasSlicing!Source) enum hasSliceToEnd = hasSlicing!Source && is(typeof(Source.init[0 .. $]) == Source); static if (withPartial) bool hasShownPartialBefore; public: /// Standard constructor this(Source source, size_t windowSize, size_t stepSize) { assert(windowSize > 0, "windowSize must be greater than zero"); assert(stepSize > 0, "stepSize must be greater than zero"); this.source = source; this.windowSize = windowSize; this.stepSize = stepSize; static if (needsEndTracker) { // `nextSource` is used to "look one step into the future" and check for the end // this means `nextSource` is advanced by `stepSize` on every `popFront` nextSource = source.save.drop(windowSize); } if (source.empty) { _empty = true; return; } static if (withPartial) { static if (needsEndTracker) { if (nextSource.empty) hasShownPartialBefore = true; } else { if (source.length <= windowSize) hasShownPartialBefore = true; } } else { // empty source range is needed, s.t. length, slicing etc. works properly static if (needsEndTracker) { if (nextSource.empty) _empty = true; } else { if (source.length < windowSize) _empty = true; } } } /// Forward range primitives. Always present. @property auto front() { assert(!empty, "Attempting to access front on an empty slide."); static if (hasSlicing!Source && hasLength!Source) { static if (withPartial) { import std.algorithm.comparison : min; return source[0 .. min(windowSize, source.length)]; } else { assert(windowSize <= source.length, "The last element is smaller than the current windowSize."); return source[0 .. windowSize]; } } else { static if (withPartial) return source.save.take(windowSize); else return source.save.takeExactly(windowSize); } } /// Ditto void popFront() { assert(!empty, "Attempting to call popFront() on an empty slide."); source.popFrontN(stepSize); if (source.empty) { _empty = true; return; } static if (withPartial) { if (hasShownPartialBefore) _empty = true; } static if (needsEndTracker) { // Check the upcoming slide auto poppedElements = nextSource.popFrontN(stepSize); static if (withPartial) { if (poppedElements < stepSize || nextSource.empty) hasShownPartialBefore = true; } else { if (poppedElements < stepSize) _empty = true; } } else { static if (withPartial) { if (source.length <= windowSize) hasShownPartialBefore = true; } else { if (source.length < windowSize) _empty = true; } } } static if (!isInfinite!Source) { /// Ditto @property bool empty() const { return _empty; } } else { // undocumented enum empty = false; } /// Ditto @property typeof(this) save() { return typeof(this)(source.save, windowSize, stepSize); } static if (hasLength!Source) { // gaps between the last element and the end of the range private size_t gap() { /* * Note: * - In the following `end` is the exclusive end as used in opSlice * - For the trivial case with `stepSize = 1` `end` is at `len`: * * iota(4).slide(2) = [[0, 1], [1, 2], [2, 3]] (end = 4) * iota(4).slide(3) = [[0, 1, 2], [1, 2, 3]] (end = 4) * * - For the non-trivial cases, we need to calculate the gap * between `len` and `end` - this is the number of missing elements * from the input range: * * iota(7).slide(2, 3) = [[0, 1], [3, 4]] || <gap: 2> 6 * iota(7).slide(2, 4) = [[0, 1], [4, 5]] || <gap: 1> 6 * iota(7).slide(1, 5) = [[0], [5]] || <gap: 1> 6 * * As it can be seen `gap` can be at most `stepSize - 1` * More generally the elements of the sliding window with * `w = windowSize` and `s = stepSize` are: * * [0, w], [s, s + w], [2 * s, 2 * s + w], ... [n * s, n * s + w] * * We can thus calculate the gap between the `end` and `len` as: * * gap = len - (n * s + w) = len - w - (n * s) * * As we aren't interested in exact value of `n`, but the best * minimal `gap` value, we can use modulo to "cut" `len - w` optimally: * * gap = len - w - (s - s ... - s) = (len - w) % s * * So for example: * * iota(7).slide(2, 3) = [[0, 1], [3, 4]] * gap: (7 - 2) % 3 = 5 % 3 = 2 * end: 7 - 2 = 5 * * iota(7).slide(4, 2) = [[0, 1, 2, 3], [2, 3, 4, 5]] * gap: (7 - 4) % 2 = 3 % 2 = 1 * end: 7 - 1 = 6 */ return (source.length - windowSize) % stepSize; } private size_t numberOfFullFrames() { /** 5.iota.slides(2, 1) => [0, 1], [1, 2], [2, 3], [3, 4] (4) 7.iota.slides(2, 2) => [0, 1], [2, 3], [4, 5], [6] (3) 7.iota.slides(2, 3) => [0, 1], [3, 4], [6] (2) 6.iota.slides(3, 2) => [0, 1, 2], [2, 3, 4], [4, 5] (2) 7.iota.slides(3, 3) => [0, 1, 2], [3, 4, 5], [6] (2) As the last window is only added iff its complete, we don't count the last window except if it's full due to integer rounding. */ return 1 + (source.length - windowSize) / stepSize; } // Whether the last slide frame size is less than windowSize private bool hasPartialElements() { static if (withPartial) return gap != 0 && source.length > numberOfFullFrames * stepSize; else return 0; } /// Length. Only if `hasLength!Source` is `true` @property size_t length() { if (source.length < windowSize) { static if (withPartial) return source.length > 0; else return 0; } else { /*** We bump the pointer by stepSize for every element. If withPartial, we don't count the last element if its size isn't windowSize At most: [p, p + stepSize, ..., p + stepSize * n] 5.iota.slides(2, 1) => [0, 1], [1, 2], [2, 3], [3, 4] (4) 7.iota.slides(2, 2) => [0, 1], [2, 3], [4, 5], [6] (4) 7.iota.slides(2, 3) => [0, 1], [3, 4], [6] (3) 7.iota.slides(3, 2) => [0, 1, 2], [2, 3, 4], [4, 5, 6] (3) 7.iota.slides(3, 3) => [0, 1, 2], [3, 4, 5], [6] (3) */ return numberOfFullFrames + hasPartialElements; } } } static if (hasSlicing!Source) { /** Indexing and slicing operations. Provided only if `hasSlicing!Source` is `true`. */ auto opIndex(size_t index) { immutable start = index * stepSize; static if (isInfinite!Source) { immutable end = start + windowSize; } else { import std.algorithm.comparison : min; immutable len = source.length; assert(start < len, "slide index out of bounds"); immutable end = min(start + windowSize, len); } return source[start .. end]; } static if (!isInfinite!Source) { /// ditto typeof(this) opSlice(size_t lower, size_t upper) { import std.algorithm.comparison : min; assert(upper <= length, "slide slicing index out of bounds"); assert(lower <= upper, "slide slicing index out of bounds"); lower *= stepSize; upper *= stepSize; immutable len = source.length; static if (withPartial) { import std.algorithm.comparison : max; if (lower == upper) return this[$ .. $]; /* A) If `stepSize` >= `windowSize` => `rightPos = upper` [0, 1, 2, 3, 4, 5, 6].slide(2, 3) -> s = [[0, 1], [3, 4], [6]] rightPos for s[0 .. 2]: (upper=2) * (stepSize=3) = 6 6.iota.slide(2, 3) = [[0, 1], [3, 4]] B) If `stepSize` < `windowSize` => add `windowSize - stepSize` to `upper` [0, 1, 2, 3].slide(2) = [[0, 1], [1, 2], [2, 3]] rightPos for s[0 .. 1]: = (upper=1) * (stepSize=1) = 1 1.iota.slide(2) = [[0]] rightPos for s[0 .. 1]: = (upper=1) * (stepSize=1) + (windowSize-stepSize=1) = 2 1.iota.slide(2) = [[0, 1]] More complex: 20.iota.slide(7, 6)[0 .. 2] rightPos: (upper=2) * (stepSize=6) = 12.iota 12.iota.slide(7, 6) = [[0, 1, 2, 3, 4, 5, 6], [6, 7, 8, 9, 10, 11]] Now we add up for the difference between `windowSize` and `stepSize`: rightPos: (upper=2) * (stepSize=6) + (windowSize-stepSize=1) = 13.iota 13.iota.slide(7, 6) = [[0, 1, 2, 3, 4, 5, 6], [6, 7, 8, 9, 10, 11, 12]] */ immutable rightPos = min(len, upper + max(0, windowSize - stepSize)); } else { /* After we have normalized `lower` and `upper` by `stepSize`, we only need to look at the case of `stepSize=1`. As `leftPos`, is equal to `lower`, we will only look `rightPos`. Notice that starting from `upper`, we only need to move for `windowSize - 1` to the right: - [0, 1, 2, 3].slide(2) -> s = [[0, 1], [1, 2], [2, 3]] rightPos for s[0 .. 3]: (upper=3) + (windowSize=2) - 1 = 4 - [0, 1, 2, 3].slide(3) -> s = [[0, 1, 2], [1, 2, 3]] rightPos for s[0 .. 2]: (upper=2) + (windowSize=3) - 1 = 4 - [0, 1, 2, 3, 4].slide(4) -> s = [[0, 1, 2, 3], [1, 2, 3, 4]] rightPos for s[0 .. 2]: (upper=2) + (windowSize=4) - 1 = 5 */ immutable rightPos = min(upper + windowSize - 1, len); } return typeof(this)(source[min(lower, len) .. rightPos], windowSize, stepSize); } } else static if (hasSliceToEnd) { // For slicing an infinite chunk, we need to slice the source to the infinite end. auto opSlice(size_t lower, size_t upper) { assert(lower <= upper, "slide slicing index out of bounds"); return typeof(this)(source[lower * stepSize .. $], windowSize, stepSize) .takeExactly(upper - lower); } } static if (isInfinite!Source) { static if (hasSliceToEnd) { private static struct DollarToken{} DollarToken opDollar() { return DollarToken(); } //Slice to dollar typeof(this) opSlice(size_t lower, DollarToken) { return typeof(this)(source[lower * stepSize .. $], windowSize, stepSize); } } } else { // Dollar token carries a static type, with no extra information. // It can lazily transform into source.length on algorithmic // operations such as : slide[$/2, $-1]; private static struct DollarToken { private size_t _length; alias _length this; } DollarToken opDollar() { return DollarToken(this.length); } // Optimized slice overloads optimized for using dollar. typeof(this) opSlice(DollarToken, DollarToken) { static if (hasSliceToEnd) { return typeof(this)(source[$ .. $], windowSize, stepSize); } else { immutable len = source.length; return typeof(this)(source[len .. len], windowSize, stepSize); } } // Optimized slice overloads optimized for using dollar. typeof(this) opSlice(size_t lower, DollarToken) { import std.algorithm.comparison : min; assert(lower <= length, "slide slicing index out of bounds"); lower *= stepSize; static if (hasSliceToEnd) { return typeof(this)(source[min(lower, source.length) .. $], windowSize, stepSize); } else { immutable len = source.length; return typeof(this)(source[min(lower, len) .. len], windowSize, stepSize); } } // Optimized slice overloads optimized for using dollar. typeof(this) opSlice(DollarToken, size_t upper) { assert(upper == length, "slide slicing index out of bounds"); return this[$ .. $]; } } // Bidirectional range primitives static if (!isInfinite!Source) { /** Bidirectional range primitives. Provided only if both `hasSlicing!Source` and `!isInfinite!Source` are `true`. */ @property auto back() { import std.algorithm.comparison : max; assert(!empty, "Attempting to access front on an empty slide"); immutable len = source.length; static if (withPartial) { if (source.length <= windowSize) return source[0 .. source.length]; if (hasPartialElements) return source[numberOfFullFrames * stepSize .. len]; } // check for underflow immutable start = (len > windowSize + gap) ? len - windowSize - gap : 0; return source[start .. len - gap]; } /// Ditto void popBack() { assert(!empty, "Attempting to call popBack() on an empty slide"); // Move by stepSize immutable end = source.length > stepSize ? source.length - stepSize : 0; static if (withPartial) { if (hasShownPartialBefore || source.empty) { _empty = true; return; } // pop by stepSize, except for the partial frame at the end if (hasPartialElements) source = source[0 .. source.length - gap]; else source = source[0 .. end]; } else { source = source[0 .. end]; } if (source.length < windowSize) _empty = true; } } } } // test @nogc @safe pure nothrow @nogc unittest { import std.algorithm.comparison : equal; static immutable res1 = [[0], [1], [2], [3]]; assert(4.iota.slide!(Yes.withPartial)(1).equal!equal(res1)); static immutable res2 = [[0, 1], [1, 2], [2, 3]]; assert(4.iota.slide!(Yes.withPartial)(2).equal!equal(res2)); } // test different window sizes @safe pure nothrow unittest { import std.array : array; import std.algorithm.comparison : equal; assert([0, 1, 2, 3].slide!(Yes.withPartial)(1).array == [[0], [1], [2], [3]]); assert([0, 1, 2, 3].slide!(Yes.withPartial)(2).array == [[0, 1], [1, 2], [2, 3]]); assert([0, 1, 2, 3].slide!(Yes.withPartial)(3).array == [[0, 1, 2], [1, 2, 3]]); assert([0, 1, 2, 3].slide!(Yes.withPartial)(4).array == [[0, 1, 2, 3]]); assert([0, 1, 2, 3].slide!(No.withPartial)(5).walkLength == 0); assert([0, 1, 2, 3].slide!(Yes.withPartial)(5).array == [[0, 1, 2, 3]]); assert(iota(2).slide!(Yes.withPartial)(2).front.equal([0, 1])); assert(iota(3).slide!(Yes.withPartial)(2).equal!equal([[0, 1],[1, 2]])); assert(iota(3).slide!(Yes.withPartial)(3).equal!equal([[0, 1, 2]])); assert(iota(3).slide!(No.withPartial)(4).walkLength == 0); assert(iota(3).slide!(Yes.withPartial)(4).equal!equal([[0, 1, 2]])); assert(iota(1, 4).slide!(Yes.withPartial)(1).equal!equal([[1], [2], [3]])); assert(iota(1, 4).slide!(Yes.withPartial)(3).equal!equal([[1, 2, 3]])); } // test combinations @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.typecons : tuple; alias t = tuple; auto list = [ t(t(1, 1), [[0], [1], [2], [3], [4], [5]]), t(t(1, 2), [[0], [2], [4]]), t(t(1, 3), [[0], [3]]), t(t(1, 4), [[0], [4]]), t(t(1, 5), [[0], [5]]), t(t(2, 1), [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]]), t(t(2, 2), [[0, 1], [2, 3], [4, 5]]), t(t(2, 3), [[0, 1], [3, 4]]), t(t(2, 4), [[0, 1], [4, 5]]), t(t(3, 1), [[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5]]), t(t(3, 3), [[0, 1, 2], [3, 4, 5]]), t(t(4, 1), [[0, 1, 2, 3], [1, 2, 3, 4], [2, 3, 4, 5]]), t(t(4, 2), [[0, 1, 2, 3], [2, 3, 4, 5]]), t(t(5, 1), [[0, 1, 2, 3, 4], [1, 2, 3, 4, 5]]), ]; static foreach (Partial; [Yes.withPartial, No.withPartial]) foreach (e; list) assert(6.iota.slide!Partial(e[0].expand).equal!equal(e[1])); auto listSpecial = [ t(t(2, 5), [[0, 1], [5]]), t(t(3, 2), [[0, 1, 2], [2, 3, 4], [4, 5]]), t(t(3, 4), [[0, 1, 2], [4, 5]]), t(t(4, 3), [[0, 1, 2, 3], [3, 4, 5]]), t(t(5, 2), [[0, 1, 2, 3, 4], [2, 3, 4, 5]]), t(t(5, 3), [[0, 1, 2, 3, 4], [3, 4, 5]]), ]; foreach (e; listSpecial) { assert(6.iota.slide!(Yes.withPartial)(e[0].expand).equal!equal(e[1])); assert(6.iota.slide!(No.withPartial)(e[0].expand).equal!equal(e[1].dropBackOne)); } } // test emptiness and copyability @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; // check with empty input int[] d; assert(d.slide!(Yes.withPartial)(2).empty); assert(d.slide!(Yes.withPartial)(2, 2).empty); // is copyable? auto e = iota(5).slide!(Yes.withPartial)(2); e.popFront; assert(e.save.equal!equal([[1, 2], [2, 3], [3, 4]])); assert(e.save.equal!equal([[1, 2], [2, 3], [3, 4]])); assert(e.map!"a.array".array == [[1, 2], [2, 3], [3, 4]]); } // test with strings @safe pure nothrow unittest { import std.algorithm.iteration : each; int[dstring] f; "AGAGA"d.slide!(Yes.withPartial)(3).each!(a => f[a]++); assert(f == ["AGA"d: 2, "GAG"d: 1]); int[dstring] g; "ABCDEFG"d.slide!(Yes.withPartial)(3, 3).each!(a => g[a]++); assert(g == ["ABC"d:1, "DEF"d:1, "G": 1]); g = null; "ABCDEFG"d.slide!(No.withPartial)(3, 3).each!(a => g[a]++); assert(g == ["ABC"d:1, "DEF"d:1]); } // test with utf8 strings @safe unittest { import std.stdio; import std.algorithm.comparison : equal; assert("ä.ö.ü.".slide!(Yes.withPartial)(3, 2).equal!equal(["ä.ö", "ö.ü", "ü."])); assert("ä.ö.ü.".slide!(No.withPartial)(3, 2).equal!equal(["ä.ö", "ö.ü"])); "😄😅😆😇😈😄😅😆😇😈".slide!(Yes.withPartial)(2, 4).equal!equal(["😄😅", "😈😄", "😇😈"]); "😄😅😆😇😈😄😅😆😇😈".slide!(No.withPartial)(2, 4).equal!equal(["😄😅", "😈😄", "😇😈"]); "😄😅😆😇😈😄😅😆😇😈".slide!(Yes.withPartial)(3, 3).equal!equal(["😄😅😆", "😇😈😄", "😅😆😇", "😈"]); "😄😅😆😇😈😄😅😆😇😈".slide!(No.withPartial)(3, 3).equal!equal(["😄😅😆", "😇😈😄", "😅😆😇"]); } // test length @safe pure nothrow unittest { // Slides with fewer elements are empty or 1 for Yes.withPartial static foreach (expectedLength, Partial; [No.withPartial, Yes.withPartial]) {{ assert(3.iota.slide!(Partial)(4, 2).walkLength == expectedLength); assert(3.iota.slide!(Partial)(4).walkLength == expectedLength); assert(3.iota.slide!(Partial)(4, 3).walkLength == expectedLength); }} static immutable list = [ // iota slide expected [4, 2, 1, 3, 3], [5, 3, 1, 3, 3], [7, 2, 2, 4, 3], [12, 2, 4, 3, 3], [6, 1, 2, 3, 3], [6, 2, 4, 2, 2], [3, 2, 4, 1, 1], [5, 2, 1, 4, 4], [7, 2, 2, 4, 3], [7, 2, 3, 3, 2], [7, 3, 2, 3, 3], [7, 3, 3, 3, 2], ]; foreach (e; list) { assert(e[0].iota.slide!(Yes.withPartial)(e[1], e[2]).length == e[3]); assert(e[0].iota.slide!(No.withPartial)(e[1], e[2]).length == e[4]); } } // test index and slicing @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.array : array; static foreach (Partial; [Yes.withPartial, No.withPartial]) { foreach (s; [5, 7, 10, 15, 20]) foreach (windowSize; 1 .. 10) foreach (stepSize; 1 .. 10) { auto r = s.iota.slide!Partial(windowSize, stepSize); auto arr = r.array; assert(r.length == arr.length); // test indexing foreach (i; 0 .. arr.length) assert(r[i] == arr[i]); // test slicing foreach (i; 0 .. arr.length) { foreach (j; i .. arr.length) assert(r[i .. j].equal(arr[i .. j])); assert(r[i .. $].equal(arr[i .. $])); } // test opDollar slicing assert(r[$/2 .. $].equal(arr[$/2 .. $])); assert(r[$ .. $].empty); if (arr.empty) { assert(r[$ .. 0].empty); assert(r[$/2 .. $].empty); } } } } // test with infinite ranges @safe pure nothrow unittest { import std.algorithm.comparison : equal; static foreach (Partial; [Yes.withPartial, No.withPartial]) {{ // InfiniteRange without RandomAccess auto fibs = recurrence!"a[n-1] + a[n-2]"(1, 1); assert(fibs.slide!Partial(2).take(2).equal!equal([[1, 1], [1, 2]])); assert(fibs.slide!Partial(2, 3).take(2).equal!equal([[1, 1], [3, 5]])); // InfiniteRange with RandomAccess and slicing auto odds = sequence!("a[0] + n * a[1]")(1, 2); auto oddsByPairs = odds.slide!Partial(2); assert(oddsByPairs.take(2).equal!equal([[ 1, 3], [ 3, 5]])); assert(oddsByPairs[1].equal([3, 5])); assert(oddsByPairs[4].equal([9, 11])); static assert(hasSlicing!(typeof(odds))); assert(oddsByPairs[3 .. 5].equal!equal([[7, 9], [9, 11]])); assert(oddsByPairs[3 .. $].take(2).equal!equal([[7, 9], [9, 11]])); auto oddsWithGaps = odds.slide!Partial(2, 4); assert(oddsWithGaps.take(3).equal!equal([[1, 3], [9, 11], [17, 19]])); assert(oddsWithGaps[2].equal([17, 19])); assert(oddsWithGaps[1 .. 3].equal!equal([[9, 11], [17, 19]])); assert(oddsWithGaps[1 .. $].take(2).equal!equal([[9, 11], [17, 19]])); }} } // test reverse @safe pure nothrow unittest { import std.algorithm.comparison : equal; static foreach (Partial; [Yes.withPartial, No.withPartial]) {{ foreach (windowSize; 1 .. 15) foreach (stepSize; 1 .. 15) { auto r = 20.iota.slide!Partial(windowSize, stepSize); auto rArr = r.array.retro; auto rRetro = r.retro; assert(rRetro.length == rArr.length); assert(rRetro.equal(rArr)); assert(rRetro.array.retro.equal(r)); } }} } // test with dummy ranges @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; import std.meta : Filter; static foreach (Range; Filter!(isForwardRange, AllDummyRanges)) {{ Range r; static foreach (Partial; [Yes.withPartial, No.withPartial]) { assert(r.slide!Partial(1).equal!equal( [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10]] )); assert(r.slide!Partial(2).equal!equal( [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]] )); assert(r.slide!Partial(3).equal!equal( [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7], [6, 7, 8], [7, 8, 9], [8, 9, 10]] )); assert(r.slide!Partial(6).equal!equal( [[1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8], [4, 5, 6, 7, 8, 9], [5, 6, 7, 8, 9, 10]] )); } // special cases assert(r.slide!(Yes.withPartial)(15).equal!equal(iota(1, 11).only)); assert(r.slide!(Yes.withPartial)(15).walkLength == 1); assert(r.slide!(No.withPartial)(15).empty); assert(r.slide!(No.withPartial)(15).walkLength == 0); }} } // test with dummy ranges @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; import std.meta : Filter; import std.typecons : tuple; alias t = tuple; static immutable list = [ // iota slide expected t(6, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6]]), t(6, t(4, 6), [[1, 2, 3, 4]]), t(6, t(4, 1), [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6]]), t(7, t(4, 1), [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]]), t(7, t(4, 3), [[1, 2, 3, 4], [4, 5, 6, 7]]), t(8, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7, 8]]), t(8, t(4, 1), [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7], [5, 6, 7, 8]]), t(8, t(3, 4), [[1, 2, 3], [5, 6, 7]]), t(10, t(3, 7), [[1, 2, 3], [8, 9, 10]]), ]; static foreach (Range; Filter!(isForwardRange, AllDummyRanges)) static foreach (Partial; [Yes.withPartial, No.withPartial]) foreach (e; list) assert(Range().take(e[0]).slide!Partial(e[1].expand).equal!equal(e[2])); static immutable listSpecial = [ // iota slide expected t(6, t(4, 3), [[1, 2, 3, 4], [4, 5, 6]]), t(7, t(4, 5), [[1, 2, 3, 4], [6, 7]]), t(7, t(4, 4), [[1, 2, 3, 4], [5, 6, 7]]), t(7, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7]]), t(8, t(4, 3), [[1, 2, 3, 4], [4, 5, 6, 7], [7, 8]]), t(8, t(3, 3), [[1, 2, 3], [4, 5, 6], [7, 8]]), t(8, t(3, 6), [[1, 2, 3], [7, 8]]), t(10, t(7, 6), [[1, 2, 3, 4, 5, 6, 7], [7, 8, 9, 10]]), t(10, t(3, 8), [[1, 2, 3], [9, 10]]), ]; static foreach (Range; Filter!(isForwardRange, AllDummyRanges)) static foreach (Partial; [Yes.withPartial, No.withPartial]) foreach (e; listSpecial) { Range r; assert(r.take(e[0]).slide!(Yes.withPartial)(e[1].expand).equal!equal(e[2])); assert(r.take(e[0]).slide!(No.withPartial)(e[1].expand).equal!equal(e[2].dropBackOne)); } } // test reverse with dummy ranges @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; import std.meta : Filter, templateAnd; import std.typecons : tuple; alias t = tuple; static immutable list = [ // slide expected t(1, 1, [[10], [9], [8], [7], [6], [5], [4], [3], [2], [1]]), t(2, 1, [[9, 10], [8, 9], [7, 8], [6, 7], [5, 6], [4, 5], [3, 4], [2, 3], [1, 2]]), t(5, 1, [[6, 7, 8, 9, 10], [5, 6, 7, 8, 9], [4, 5, 6, 7, 8], [3, 4, 5, 6, 7], [2, 3, 4, 5, 6], [1, 2, 3, 4, 5]]), t(2, 2, [[9, 10], [7, 8], [5, 6], [3, 4], [1, 2]]), t(2, 4, [[9, 10], [5, 6], [1, 2]]), ]; static foreach (Range; Filter!(templateAnd!(hasSlicing, hasLength, isBidirectionalRange), AllDummyRanges)) {{ Range r; static foreach (Partial; [Yes.withPartial, No.withPartial]) { foreach (e; list) assert(r.slide!Partial(e[0], e[1]).retro.equal!equal(e[2])); // front = back foreach (windowSize; 1 .. 10) foreach (stepSize; 1 .. 10) { auto slider = r.slide!Partial(windowSize, stepSize); auto sliderRetro = slider.retro.array; assert(slider.length == sliderRetro.length); assert(sliderRetro.retro.equal!equal(slider)); } } // special cases assert(r.slide!(No.withPartial)(15).retro.walkLength == 0); assert(r.slide!(Yes.withPartial)(15).retro.equal!equal(iota(1, 11).only)); }} } // test different sliceable ranges @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges; import std.meta : AliasSeq; struct SliceableRange(Range, Flag!"withOpDollar" withOpDollar = No.withOpDollar, Flag!"withInfiniteness" withInfiniteness = No.withInfiniteness) { Range arr = 10.iota.array; // similar to DummyRange @property auto save() { return typeof(this)(arr); } @property auto front() { return arr[0]; } void popFront() { arr.popFront(); } auto opSlice(size_t i, size_t j) { // subslices can't be infinite return SliceableRange!(Range, withOpDollar, No.withInfiniteness)(arr[i .. j]); } static if (withInfiniteness) { enum empty = false; } else { @property bool empty() { return arr.empty; } @property auto length() { return arr.length; } } static if (withOpDollar) { static if (withInfiniteness) { struct Dollar {} Dollar opDollar() const { return Dollar.init; } // Slice to dollar typeof(this) opSlice(size_t lower, Dollar) { return typeof(this)(arr[lower .. $]); } } else { alias opDollar = length; } } } alias SliceableDummyRanges = Filter!(hasSlicing, AllDummyRanges); static foreach (Partial; [Yes.withPartial, No.withPartial]) {{ static foreach (Range; SliceableDummyRanges) {{ Range r; r.reinit; r.arr[] -= 1; // use a 0-based array (for clarity) assert(r.slide!Partial(2)[0].equal([0, 1])); assert(r.slide!Partial(2)[1].equal([1, 2])); // saveable auto s = r.slide!Partial(2); assert(s[0 .. 2].equal!equal([[0, 1], [1, 2]])); s.save.popFront; assert(s[0 .. 2].equal!equal([[0, 1], [1, 2]])); assert(r.slide!Partial(3)[1 .. 3].equal!equal([[1, 2, 3], [2, 3, 4]])); }} static foreach (Range; Filter!(templateNot!isInfinite, SliceableDummyRanges)) {{ Range r; r.reinit; r.arr[] -= 1; // use a 0-based array (for clarity) assert(r.slide!(No.withPartial)(6).equal!equal( [[0, 1, 2, 3, 4, 5], [1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 7], [3, 4, 5, 6, 7, 8], [4, 5, 6, 7, 8, 9]] )); assert(r.slide!(No.withPartial)(16).empty); assert(r.slide!Partial(4)[0 .. $].equal(r.slide!Partial(4))); assert(r.slide!Partial(2)[$/2 .. $].equal!equal([[4, 5], [5, 6], [6, 7], [7, 8], [8, 9]])); assert(r.slide!Partial(2)[$ .. $].empty); assert(r.slide!Partial(3).retro.equal!equal( [[7, 8, 9], [6, 7, 8], [5, 6, 7], [4, 5, 6], [3, 4, 5], [2, 3, 4], [1, 2, 3], [0, 1, 2]] )); }} alias T = int[]; // separate checks for infinity auto infIndex = SliceableRange!(T, No.withOpDollar, Yes.withInfiniteness)([0, 1, 2, 3]); assert(infIndex.slide!Partial(2)[0].equal([0, 1])); assert(infIndex.slide!Partial(2)[1].equal([1, 2])); auto infDollar = SliceableRange!(T, Yes.withOpDollar, Yes.withInfiniteness)(); assert(infDollar.slide!Partial(2)[1 .. $].front.equal([1, 2])); assert(infDollar.slide!Partial(4)[0 .. $].front.equal([0, 1, 2, 3])); assert(infDollar.slide!Partial(4)[2 .. $].front.equal([2, 3, 4, 5])); }} } // https://issues.dlang.org/show_bug.cgi?id=19082 @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; assert([1].map!(x => x).slide(2).equal!equal([[1]])); } private struct OnlyResult(T, size_t arity) { private this(Values...)(return scope auto ref Values values) { this.data = [values]; this.backIndex = arity; } bool empty() @property { return frontIndex >= backIndex; } T front() @property { assert(!empty, "Attempting to fetch the front of an empty Only range"); return data[frontIndex]; } void popFront() { assert(!empty, "Attempting to popFront an empty Only range"); ++frontIndex; } T back() @property { assert(!empty, "Attempting to fetch the back of an empty Only range"); return data[backIndex - 1]; } void popBack() { assert(!empty, "Attempting to popBack an empty Only range"); --backIndex; } OnlyResult save() @property { return this; } size_t length() const @property { return backIndex - frontIndex; } alias opDollar = length; T opIndex(size_t idx) { // when i + idx points to elements popped // with popBack assert(idx < length, "Attempting to fetch an out of bounds index from an Only range"); return data[frontIndex + idx]; } OnlyResult opSlice() { return this; } OnlyResult opSlice(size_t from, size_t to) { OnlyResult result = this; result.frontIndex += from; result.backIndex = this.frontIndex + to; assert( from <= to, "Attempting to slice an Only range with a larger first argument than the second." ); assert( to <= length, "Attempting to slice using an out of bounds index on an Only range" ); return result; } private size_t frontIndex = 0; private size_t backIndex = 0; // @@@BUG@@@ 10643 version (none) { import std.traits : hasElaborateAssign; static if (hasElaborateAssign!T) private T[arity] data; else private T[arity] data = void; } else private T[arity] data; } // Specialize for single-element results private struct OnlyResult(T, size_t arity : 1) { @property T front() { assert(!empty, "Attempting to fetch the front of an empty Only range"); return _value; } @property T back() { assert(!empty, "Attempting to fetch the back of an empty Only range"); return _value; } @property bool empty() const { return _empty; } @property size_t length() const { return !_empty; } @property auto save() { return this; } void popFront() { assert(!_empty, "Attempting to popFront an empty Only range"); _empty = true; } void popBack() { assert(!_empty, "Attempting to popBack an empty Only range"); _empty = true; } alias opDollar = length; private this()(return scope auto ref T value) { this._value = value; this._empty = false; } T opIndex(size_t i) { assert(!_empty && i == 0, "Attempting to fetch an out of bounds index from an Only range"); return _value; } OnlyResult opSlice() { return this; } OnlyResult opSlice(size_t from, size_t to) { assert( from <= to, "Attempting to slice an Only range with a larger first argument than the second." ); assert( to <= length, "Attempting to slice using an out of bounds index on an Only range" ); OnlyResult copy = this; copy._empty = _empty || from == to; return copy; } private Unqual!T _value; private bool _empty = true; } // Specialize for the empty range private struct OnlyResult(T, size_t arity : 0) { private static struct EmptyElementType {} bool empty() @property { return true; } size_t length() const @property { return 0; } alias opDollar = length; EmptyElementType front() @property { assert(false); } void popFront() { assert(false); } EmptyElementType back() @property { assert(false); } void popBack() { assert(false); } OnlyResult save() @property { return this; } EmptyElementType opIndex(size_t i) { assert(false); } OnlyResult opSlice() { return this; } OnlyResult opSlice(size_t from, size_t to) { assert(from == 0 && to == 0); return this; } } /** Assemble `values` into a range that carries all its elements in-situ. Useful when a single value or multiple disconnected values must be passed to an algorithm expecting a range, without having to perform dynamic memory allocation. As copying the range means copying all elements, it can be safely returned from functions. For the same reason, copying the returned range may be expensive for a large number of arguments. Params: values = the values to assemble together Returns: A `RandomAccessRange` of the assembled values. See_Also: $(LREF chain) to chain ranges */ auto only(Values...)(return scope auto ref Values values) if (!is(CommonType!Values == void) || Values.length == 0) { return OnlyResult!(CommonType!Values, Values.length)(values); } /// @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter, joiner, map; import std.algorithm.searching : findSplitBefore; import std.uni : isUpper; assert(equal(only('♡'), "♡")); assert([1, 2, 3, 4].findSplitBefore(only(3))[0] == [1, 2]); assert(only("one", "two", "three").joiner(" ").equal("one two three")); string title = "The D Programming Language"; assert(title .filter!isUpper // take the upper case letters .map!only // make each letter its own range .joiner(".") // join the ranges together lazily .equal("T.D.P.L")); } @safe unittest { // Verify that the same common type and same arity // results in the same template instantiation static assert(is(typeof(only(byte.init, int.init)) == typeof(only(int.init, byte.init)))); static assert(is(typeof(only((const(char)[]).init, string.init)) == typeof(only((const(char)[]).init, (const(char)[]).init)))); } // Tests the zero-element result @safe unittest { import std.algorithm.comparison : equal; auto emptyRange = only(); alias EmptyRange = typeof(emptyRange); static assert(isInputRange!EmptyRange); static assert(isForwardRange!EmptyRange); static assert(isBidirectionalRange!EmptyRange); static assert(isRandomAccessRange!EmptyRange); static assert(hasLength!EmptyRange); static assert(hasSlicing!EmptyRange); assert(emptyRange.empty); assert(emptyRange.length == 0); assert(emptyRange.equal(emptyRange[])); assert(emptyRange.equal(emptyRange.save)); assert(emptyRange[0 .. 0].equal(emptyRange)); } // Tests the single-element result @safe unittest { import std.algorithm.comparison : equal; import std.typecons : tuple; foreach (x; tuple(1, '1', 1.0, "1", [1])) { auto a = only(x); typeof(x)[] e = []; assert(a.front == x); assert(a.back == x); assert(!a.empty); assert(a.length == 1); assert(equal(a, a[])); assert(equal(a, a[0 .. 1])); assert(equal(a[0 .. 0], e)); assert(equal(a[1 .. 1], e)); assert(a[0] == x); auto b = a.save; assert(equal(a, b)); a.popFront(); assert(a.empty && a.length == 0 && a[].empty); b.popBack(); assert(b.empty && b.length == 0 && b[].empty); alias A = typeof(a); static assert(isInputRange!A); static assert(isForwardRange!A); static assert(isBidirectionalRange!A); static assert(isRandomAccessRange!A); static assert(hasLength!A); static assert(hasSlicing!A); } auto imm = only!(immutable int)(1); immutable int[] imme = []; assert(imm.front == 1); assert(imm.back == 1); assert(!imm.empty); assert(imm.init.empty); // Issue 13441 assert(imm.length == 1); assert(equal(imm, imm[])); assert(equal(imm, imm[0 .. 1])); assert(equal(imm[0 .. 0], imme)); assert(equal(imm[1 .. 1], imme)); assert(imm[0] == 1); } // Tests multiple-element results @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : joiner; import std.meta : AliasSeq; static assert(!__traits(compiles, only(1, "1"))); auto nums = only!(byte, uint, long)(1, 2, 3); static assert(is(ElementType!(typeof(nums)) == long)); assert(nums.length == 3); foreach (i; 0 .. 3) assert(nums[i] == i + 1); auto saved = nums.save; foreach (i; 1 .. 4) { assert(nums.front == nums[0]); assert(nums.front == i); nums.popFront(); assert(nums.length == 3 - i); } assert(nums.empty); assert(saved.equal(only(1, 2, 3))); assert(saved.equal(saved[])); assert(saved[0 .. 1].equal(only(1))); assert(saved[0 .. 2].equal(only(1, 2))); assert(saved[0 .. 3].equal(saved)); assert(saved[1 .. 3].equal(only(2, 3))); assert(saved[2 .. 3].equal(only(3))); assert(saved[0 .. 0].empty); assert(saved[3 .. 3].empty); alias data = AliasSeq!("one", "two", "three", "four"); static joined = ["one two", "one two three", "one two three four"]; string[] joinedRange = joined; static foreach (argCount; 2 .. 5) {{ auto values = only(data[0 .. argCount]); alias Values = typeof(values); static assert(is(ElementType!Values == string)); static assert(isInputRange!Values); static assert(isForwardRange!Values); static assert(isBidirectionalRange!Values); static assert(isRandomAccessRange!Values); static assert(hasSlicing!Values); static assert(hasLength!Values); assert(values.length == argCount); assert(values[0 .. $].equal(values[0 .. values.length])); assert(values.joiner(" ").equal(joinedRange.front)); joinedRange.popFront(); }} assert(saved.retro.equal(only(3, 2, 1))); assert(saved.length == 3); assert(saved.back == 3); saved.popBack(); assert(saved.length == 2); assert(saved.back == 2); assert(saved.front == 1); saved.popFront(); assert(saved.length == 1); assert(saved.front == 2); saved.popBack(); assert(saved.empty); auto imm = only!(immutable int, immutable int)(42, 24); alias Imm = typeof(imm); static assert(is(ElementType!Imm == immutable(int))); assert(!imm.empty); assert(imm.init.empty); // Issue 13441 assert(imm.front == 42); imm.popFront(); assert(imm.front == 24); imm.popFront(); assert(imm.empty); static struct Test { int* a; } immutable(Test) test; cast(void) only(test, test); // Works with mutable indirection } /** Iterate over `range` with an attached index variable. Each element is a $(REF Tuple, std,typecons) containing the index and the element, in that order, where the index member is named `index` and the element member is named `value`. The index starts at `start` and is incremented by one on every iteration. Overflow: If `range` has length, then it is an error to pass a value for `start` so that `start + range.length` is bigger than `Enumerator.max`, thus it is ensured that overflow cannot happen. If `range` does not have length, and `popFront` is called when `front.index == Enumerator.max`, the index will overflow and continue from `Enumerator.min`. Params: range = the $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to attach indexes to start = the number to start the index counter from Returns: At minimum, an input range. All other range primitives are given in the resulting range if `range` has them. The exceptions are the bidirectional primitives, which are propagated only if `range` has length. Example: Useful for using `foreach` with an index loop variable: ---- import std.stdio : stdin, stdout; import std.range : enumerate; foreach (lineNum, line; stdin.byLine().enumerate(1)) stdout.writefln("line #%s: %s", lineNum, line); ---- */ auto enumerate(Enumerator = size_t, Range)(Range range, Enumerator start = 0) if (isIntegral!Enumerator && isInputRange!Range) in { static if (hasLength!Range) { // TODO: core.checkedint supports mixed signedness yet? import core.checkedint : adds, addu; import std.conv : ConvException, to; import std.traits : isSigned, Largest, Signed; alias LengthType = typeof(range.length); bool overflow; static if (isSigned!Enumerator && isSigned!LengthType) auto result = adds(start, range.length, overflow); else static if (isSigned!Enumerator) { Largest!(Enumerator, Signed!LengthType) signedLength; try signedLength = to!(typeof(signedLength))(range.length); catch (ConvException) overflow = true; catch (Exception) assert(false); auto result = adds(start, signedLength, overflow); } else { static if (isSigned!LengthType) assert(range.length >= 0); auto result = addu(start, range.length, overflow); } assert(!overflow && result <= Enumerator.max); } } do { // TODO: Relax isIntegral!Enumerator to allow user-defined integral types static struct Result { import std.typecons : Tuple; private: alias ElemType = Tuple!(Enumerator, "index", ElementType!Range, "value"); Range range; Enumerator index; public: ElemType front() @property { assert(!range.empty, "Attempting to fetch the front of an empty enumerate"); return typeof(return)(index, range.front); } static if (isInfinite!Range) enum bool empty = false; else { bool empty() @property { return range.empty; } } void popFront() { assert(!range.empty, "Attempting to popFront an empty enumerate"); range.popFront(); ++index; // When !hasLength!Range, overflow is expected } static if (isForwardRange!Range) { Result save() @property { return typeof(return)(range.save, index); } } static if (hasLength!Range) { size_t length() @property { return range.length; } alias opDollar = length; static if (isBidirectionalRange!Range) { ElemType back() @property { assert(!range.empty, "Attempting to fetch the back of an empty enumerate"); return typeof(return)(cast(Enumerator)(index + range.length - 1), range.back); } void popBack() { assert(!range.empty, "Attempting to popBack an empty enumerate"); range.popBack(); } } } static if (isRandomAccessRange!Range) { ElemType opIndex(size_t i) { return typeof(return)(cast(Enumerator)(index + i), range[i]); } } static if (hasSlicing!Range) { static if (hasLength!Range) { Result opSlice(size_t i, size_t j) { return typeof(return)(range[i .. j], cast(Enumerator)(index + i)); } } else { static struct DollarToken {} enum opDollar = DollarToken.init; Result opSlice(size_t i, DollarToken) { return typeof(return)(range[i .. $], cast(Enumerator)(index + i)); } auto opSlice(size_t i, size_t j) { return this[i .. $].takeExactly(j - 1); } } } } return Result(range, start); } /// Can start enumeration from a negative position: pure @safe nothrow unittest { import std.array : assocArray; import std.range : enumerate; bool[int] aa = true.repeat(3).enumerate(-1).assocArray(); assert(aa[-1]); assert(aa[0]); assert(aa[1]); } pure @safe nothrow unittest { import std.internal.test.dummyrange : AllDummyRanges; import std.meta : AliasSeq; import std.typecons : tuple; static struct HasSlicing { typeof(this) front() @property { return typeof(this).init; } bool empty() @property { return true; } void popFront() {} typeof(this) opSlice(size_t, size_t) { return typeof(this)(); } } static foreach (DummyType; AliasSeq!(AllDummyRanges, HasSlicing)) {{ alias R = typeof(enumerate(DummyType.init)); static assert(isInputRange!R); static assert(isForwardRange!R == isForwardRange!DummyType); static assert(isRandomAccessRange!R == isRandomAccessRange!DummyType); static assert(!hasAssignableElements!R); static if (hasLength!DummyType) { static assert(hasLength!R); static assert(isBidirectionalRange!R == isBidirectionalRange!DummyType); } static assert(hasSlicing!R == hasSlicing!DummyType); }} static immutable values = ["zero", "one", "two", "three"]; auto enumerated = values[].enumerate(); assert(!enumerated.empty); assert(enumerated.front == tuple(0, "zero")); assert(enumerated.back == tuple(3, "three")); typeof(enumerated) saved = enumerated.save; saved.popFront(); assert(enumerated.front == tuple(0, "zero")); assert(saved.front == tuple(1, "one")); assert(saved.length == enumerated.length - 1); saved.popBack(); assert(enumerated.back == tuple(3, "three")); assert(saved.back == tuple(2, "two")); saved.popFront(); assert(saved.front == tuple(2, "two")); assert(saved.back == tuple(2, "two")); saved.popFront(); assert(saved.empty); size_t control = 0; foreach (i, v; enumerated) { static assert(is(typeof(i) == size_t)); static assert(is(typeof(v) == typeof(values[0]))); assert(i == control); assert(v == values[i]); assert(tuple(i, v) == enumerated[i]); ++control; } assert(enumerated[0 .. $].front == tuple(0, "zero")); assert(enumerated[$ - 1 .. $].front == tuple(3, "three")); foreach (i; 0 .. 10) { auto shifted = values[0 .. 2].enumerate(i); assert(shifted.front == tuple(i, "zero")); assert(shifted[0] == shifted.front); auto next = tuple(i + 1, "one"); assert(shifted[1] == next); shifted.popFront(); assert(shifted.front == next); shifted.popFront(); assert(shifted.empty); } static foreach (T; AliasSeq!(ubyte, byte, uint, int)) {{ auto inf = 42.repeat().enumerate(T.max); alias Inf = typeof(inf); static assert(isInfinite!Inf); static assert(hasSlicing!Inf); // test overflow assert(inf.front == tuple(T.max, 42)); inf.popFront(); assert(inf.front == tuple(T.min, 42)); // test slicing inf = inf[42 .. $]; assert(inf.front == tuple(T.min + 42, 42)); auto window = inf[0 .. 2]; assert(window.length == 1); assert(window.front == inf.front); window.popFront(); assert(window.empty); }} } pure @safe unittest { import std.algorithm.comparison : equal; import std.meta : AliasSeq; static immutable int[] values = [0, 1, 2, 3, 4]; static foreach (T; AliasSeq!(ubyte, ushort, uint, ulong)) {{ auto enumerated = values.enumerate!T(); static assert(is(typeof(enumerated.front.index) == T)); assert(enumerated.equal(values[].zip(values))); foreach (T i; 0 .. 5) { auto subset = values[cast(size_t) i .. $]; auto offsetEnumerated = subset.enumerate(i); static assert(is(typeof(enumerated.front.index) == T)); assert(offsetEnumerated.equal(subset.zip(subset))); } }} } version (none) // @@@BUG@@@ 10939 { // Re-enable (or remove) if 10939 is resolved. /+pure+/ @safe unittest // Impure because of std.conv.to { import core.exception : RangeError; import std.exception : assertNotThrown, assertThrown; import std.meta : AliasSeq; static immutable values = [42]; static struct SignedLengthRange { immutable(int)[] _values = values; int front() @property { assert(false); } bool empty() @property { assert(false); } void popFront() { assert(false); } int length() @property { return cast(int)_values.length; } } SignedLengthRange svalues; static foreach (Enumerator; AliasSeq!(ubyte, byte, ushort, short, uint, int, ulong, long)) { assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max)); assertNotThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length)); assertThrown!RangeError(values[].enumerate!Enumerator(Enumerator.max - values.length + 1)); assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max)); assertNotThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length)); assertThrown!RangeError(svalues.enumerate!Enumerator(Enumerator.max - values.length + 1)); } static foreach (Enumerator; AliasSeq!(byte, short, int)) { assertThrown!RangeError(repeat(0, uint.max).enumerate!Enumerator()); } assertNotThrown!RangeError(repeat(0, uint.max).enumerate!long()); } } /** Returns true if `fn` accepts variables of type T1 and T2 in any order. The following code should compile: --- T1 foo(); T2 bar(); fn(foo(), bar()); fn(bar(), foo()); --- */ template isTwoWayCompatible(alias fn, T1, T2) { enum isTwoWayCompatible = is(typeof( (){ T1 foo(); T2 bar(); cast(void) fn(foo(), bar()); cast(void) fn(bar(), foo()); } )); } /// @safe unittest { void func1(int a, int b); void func2(int a, float b); static assert(isTwoWayCompatible!(func1, int, int)); static assert(isTwoWayCompatible!(func1, short, int)); static assert(!isTwoWayCompatible!(func2, int, float)); } /** Policy used with the searching primitives `lowerBound`, $(D upperBound), and `equalRange` of $(LREF SortedRange) below. */ enum SearchPolicy { /** Searches in a linear fashion. */ linear, /** Searches with a step that is grows linearly (1, 2, 3,...) leading to a quadratic search schedule (indexes tried are 0, 1, 3, 6, 10, 15, 21, 28,...) Once the search overshoots its target, the remaining interval is searched using binary search. The search is completed in $(BIGOH sqrt(n)) time. Use it when you are reasonably confident that the value is around the beginning of the range. */ trot, /** Performs a $(LINK2 https://en.wikipedia.org/wiki/Exponential_search, galloping search algorithm), i.e. searches with a step that doubles every time, (1, 2, 4, 8, ...) leading to an exponential search schedule (indexes tried are 0, 1, 3, 7, 15, 31, 63,...) Once the search overshoots its target, the remaining interval is searched using binary search. A value is found in $(BIGOH log(n)) time. */ gallop, /** Searches using a classic interval halving policy. The search starts in the middle of the range, and each search step cuts the range in half. This policy finds a value in $(BIGOH log(n)) time but is less cache friendly than `gallop` for large ranges. The `binarySearch` policy is used as the last step of `trot`, `gallop`, `trotBackwards`, and $(D gallopBackwards) strategies. */ binarySearch, /** Similar to `trot` but starts backwards. Use it when confident that the value is around the end of the range. */ trotBackwards, /** Similar to `gallop` but starts backwards. Use it when confident that the value is around the end of the range. */ gallopBackwards } /// @safe unittest { import std.algorithm.comparison : equal; auto a = assumeSorted([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); auto p1 = a.upperBound!(SearchPolicy.binarySearch)(3); assert(p1.equal([4, 5, 6, 7, 8, 9])); auto p2 = a.lowerBound!(SearchPolicy.gallop)(4); assert(p2.equal([0, 1, 2, 3])); } /** Represents a sorted range. In addition to the regular range primitives, supports additional operations that take advantage of the ordering, such as merge and binary search. To obtain a $(D SortedRange) from an unsorted range `r`, use $(REF sort, std,algorithm,sorting) which sorts `r` in place and returns the corresponding `SortedRange`. To construct a `SortedRange` from a range `r` that is known to be already sorted, use $(LREF assumeSorted) described below. */ struct SortedRange(Range, alias pred = "a < b") if (isInputRange!Range && !isInstanceOf!(SortedRange, Range)) { import std.functional : binaryFun; private alias predFun = binaryFun!pred; private bool geq(L, R)(L lhs, R rhs) { return !predFun(lhs, rhs); } private bool gt(L, R)(L lhs, R rhs) { return predFun(rhs, lhs); } private Range _input; // Undocummented because a clearer way to invoke is by calling // assumeSorted. this(Range input) out { // moved out of the body as a workaround for Issue 12661 dbgVerifySorted(); } do { this._input = input; } // Assertion only. private void dbgVerifySorted() { if (!__ctfe) debug { static if (isRandomAccessRange!Range && hasLength!Range) { import core.bitop : bsr; import std.algorithm.sorting : isSorted; // Check the sortedness of the input if (this._input.length < 2) return; immutable size_t msb = bsr(this._input.length) + 1; assert(msb > 0 && msb <= this._input.length); immutable step = this._input.length / msb; auto st = stride(this._input, step); assert(isSorted!pred(st), "Range is not sorted"); } } } /// Range primitives. @property bool empty() //const { return this._input.empty; } /// Ditto static if (isForwardRange!Range) @property auto save() { // Avoid the constructor typeof(this) result = this; result._input = _input.save; return result; } /// Ditto @property auto ref front() { return _input.front; } /// Ditto void popFront() { _input.popFront(); } /// Ditto static if (isBidirectionalRange!Range) { @property auto ref back() { return _input.back; } /// Ditto void popBack() { _input.popBack(); } } /// Ditto static if (isRandomAccessRange!Range) auto ref opIndex(size_t i) { return _input[i]; } /// Ditto static if (hasSlicing!Range) auto opSlice(size_t a, size_t b) return scope @trusted { assert( a <= b, "Attempting to slice a SortedRange with a larger first argument than the second." ); typeof(this) result = this; result._input = _input[a .. b];// skip checking return result; } /// Ditto static if (hasLength!Range) { @property size_t length() //const { return _input.length; } alias opDollar = length; } /** Releases the controlled range and returns it. */ auto release() { import std.algorithm.mutation : move; return move(_input); } // Assuming a predicate "test" that returns 0 for a left portion // of the range and then 1 for the rest, returns the index at // which the first 1 appears. Used internally by the search routines. private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v) if (sp == SearchPolicy.binarySearch && isRandomAccessRange!Range && hasLength!Range) { size_t first = 0, count = _input.length; while (count > 0) { immutable step = count / 2, it = first + step; if (!test(_input[it], v)) { first = it + 1; count -= step + 1; } else { count = step; } } return first; } // Specialization for trot and gallop private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v) if ((sp == SearchPolicy.trot || sp == SearchPolicy.gallop) && isRandomAccessRange!Range) { if (empty || test(front, v)) return 0; immutable count = length; if (count == 1) return 1; size_t below = 0, above = 1, step = 2; while (!test(_input[above], v)) { // Still too small, update below and increase gait below = above; immutable next = above + step; if (next >= count) { // Overshot - the next step took us beyond the end. So // now adjust next and simply exit the loop to do the // binary search thingie. above = count; break; } // Still in business, increase step and continue above = next; static if (sp == SearchPolicy.trot) ++step; else step <<= 1; } return below + this[below .. above].getTransitionIndex!( SearchPolicy.binarySearch, test, V)(v); } // Specialization for trotBackwards and gallopBackwards private size_t getTransitionIndex(SearchPolicy sp, alias test, V)(V v) if ((sp == SearchPolicy.trotBackwards || sp == SearchPolicy.gallopBackwards) && isRandomAccessRange!Range) { immutable count = length; if (empty || !test(back, v)) return count; if (count == 1) return 0; size_t below = count - 2, above = count - 1, step = 2; while (test(_input[below], v)) { // Still too large, update above and increase gait above = below; if (below < step) { // Overshot - the next step took us beyond the end. So // now adjust next and simply fall through to do the // binary search thingie. below = 0; break; } // Still in business, increase step and continue below -= step; static if (sp == SearchPolicy.trot) ++step; else step <<= 1; } return below + this[below .. above].getTransitionIndex!( SearchPolicy.binarySearch, test, V)(v); } // lowerBound /** This function uses a search with policy `sp` to find the largest left subrange on which $(D pred(x, value)) is `true` for all `x` (e.g., if `pred` is "less than", returns the portion of the range with elements strictly smaller than `value`). The search schedule and its complexity are documented in $(LREF SearchPolicy). */ auto lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V) && hasSlicing!Range) { return this[0 .. getTransitionIndex!(sp, geq)(value)]; } /// @safe unittest { import std.algorithm.comparison : equal; auto a = assumeSorted([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]); auto p = a.lowerBound(4); assert(equal(p, [ 0, 1, 2, 3 ])); } // upperBound /** This function searches with policy `sp` to find the largest right subrange on which $(D pred(value, x)) is `true` for all `x` (e.g., if `pred` is "less than", returns the portion of the range with elements strictly greater than `value`). The search schedule and its complexity are documented in $(LREF SearchPolicy). For ranges that do not offer random access, `SearchPolicy.linear` is the only policy allowed (and it must be specified explicitly lest it exposes user code to unexpected inefficiencies). For random-access searches, all policies are allowed, and `SearchPolicy.binarySearch` is the default. */ auto upperBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V)) { static assert(hasSlicing!Range || sp == SearchPolicy.linear, "Specify SearchPolicy.linear explicitly for " ~ typeof(this).stringof); static if (sp == SearchPolicy.linear) { for (; !_input.empty && !predFun(value, _input.front); _input.popFront()) { } return this; } else { return this[getTransitionIndex!(sp, gt)(value) .. length]; } } /// @safe unittest { import std.algorithm.comparison : equal; auto a = assumeSorted([ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]); auto p = a.upperBound(3); assert(equal(p, [4, 4, 5, 6])); } // equalRange /** Returns the subrange containing all elements `e` for which both $(D pred(e, value)) and $(D pred(value, e)) evaluate to `false` (e.g., if `pred` is "less than", returns the portion of the range with elements equal to `value`). Uses a classic binary search with interval halving until it finds a value that satisfies the condition, then uses `SearchPolicy.gallopBackwards` to find the left boundary and `SearchPolicy.gallop` to find the right boundary. These policies are justified by the fact that the two boundaries are likely to be near the first found value (i.e., equal ranges are relatively small). Completes the entire search in $(BIGOH log(n)) time. */ auto equalRange(V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V) && isRandomAccessRange!Range) { size_t first = 0, count = _input.length; while (count > 0) { immutable step = count / 2; auto it = first + step; if (predFun(_input[it], value)) { // Less than value, bump left bound up first = it + 1; count -= step + 1; } else if (predFun(value, _input[it])) { // Greater than value, chop count count = step; } else { // Equal to value, do binary searches in the // leftover portions // Gallop towards the left end as it's likely nearby immutable left = first + this[first .. it] .lowerBound!(SearchPolicy.gallopBackwards)(value).length; first += count; // Gallop towards the right end as it's likely nearby immutable right = first - this[it + 1 .. first] .upperBound!(SearchPolicy.gallop)(value).length; return this[left .. right]; } } return this.init; } /// @safe unittest { import std.algorithm.comparison : equal; auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]; auto r = a.assumeSorted.equalRange(3); assert(equal(r, [ 3, 3, 3 ])); } // trisect /** Returns a tuple `r` such that `r[0]` is the same as the result of `lowerBound(value)`, `r[1]` is the same as the result of $(D equalRange(value)), and `r[2]` is the same as the result of $(D upperBound(value)). The call is faster than computing all three separately. Uses a search schedule similar to $(D equalRange). Completes the entire search in $(BIGOH log(n)) time. */ auto trisect(V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V) && isRandomAccessRange!Range && hasLength!Range) { import std.typecons : tuple; size_t first = 0, count = _input.length; while (count > 0) { immutable step = count / 2; auto it = first + step; if (predFun(_input[it], value)) { // Less than value, bump left bound up first = it + 1; count -= step + 1; } else if (predFun(value, _input[it])) { // Greater than value, chop count count = step; } else { // Equal to value, do binary searches in the // leftover portions // Gallop towards the left end as it's likely nearby immutable left = first + this[first .. it] .lowerBound!(SearchPolicy.gallopBackwards)(value).length; first += count; // Gallop towards the right end as it's likely nearby immutable right = first - this[it + 1 .. first] .upperBound!(SearchPolicy.gallop)(value).length; return tuple(this[0 .. left], this[left .. right], this[right .. length]); } } // No equal element was found return tuple(this[0 .. first], this.init, this[first .. length]); } /// @safe unittest { import std.algorithm.comparison : equal; auto a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]; auto r = assumeSorted(a).trisect(3); assert(equal(r[0], [ 1, 2 ])); assert(equal(r[1], [ 3, 3, 3 ])); assert(equal(r[2], [ 4, 4, 5, 6 ])); } // contains /** Returns `true` if and only if `value` can be found in $(D range), which is assumed to be sorted. Performs $(BIGOH log(r.length)) evaluations of `pred`. */ bool contains(V)(V value) if (isRandomAccessRange!Range) { if (empty) return false; immutable i = getTransitionIndex!(SearchPolicy.binarySearch, geq)(value); if (i >= length) return false; return !predFun(value, _input[i]); } /** Like `contains`, but the value is specified before the range. */ auto opBinaryRight(string op, V)(V value) if (op == "in" && isRandomAccessRange!Range) { return contains(value); } // groupBy /** Returns a range of subranges of elements that are equivalent according to the sorting relation. */ auto groupBy()() { import std.algorithm.iteration : chunkBy; return _input.chunkBy!((a, b) => !predFun(a, b) && !predFun(b, a)); } } /// ditto template SortedRange(Range, alias pred = "a < b") if (isInstanceOf!(SortedRange, Range)) { // Avoid nesting SortedRange types (see Issue 18933); alias SortedRange = SortedRange!(Unqual!(typeof(Range._input)), pred); } /// @safe unittest { import std.algorithm.sorting : sort; auto a = [ 1, 2, 3, 42, 52, 64 ]; auto r = assumeSorted(a); assert(r.contains(3)); assert(!(32 in r)); auto r1 = sort!"a > b"(a); assert(3 in r1); assert(!r1.contains(32)); assert(r1.release() == [ 64, 52, 42, 3, 2, 1 ]); } /** `SortedRange` could accept ranges weaker than random-access, but it is unable to provide interesting functionality for them. Therefore, `SortedRange` is currently restricted to random-access ranges. No copy of the original range is ever made. If the underlying range is changed concurrently with its corresponding `SortedRange` in ways that break its sorted-ness, `SortedRange` will work erratically. */ @safe unittest { import std.algorithm.mutation : swap; auto a = [ 1, 2, 3, 42, 52, 64 ]; auto r = assumeSorted(a); assert(r.contains(42)); swap(a[3], a[5]); // illegal to break sortedness of original range assert(!r.contains(42)); // passes although it shouldn't } @safe unittest { import std.algorithm.comparison : equal; auto a = [ 10, 20, 30, 30, 30, 40, 40, 50, 60 ]; auto r = assumeSorted(a).trisect(30); assert(equal(r[0], [ 10, 20 ])); assert(equal(r[1], [ 30, 30, 30 ])); assert(equal(r[2], [ 40, 40, 50, 60 ])); r = assumeSorted(a).trisect(35); assert(equal(r[0], [ 10, 20, 30, 30, 30 ])); assert(r[1].empty); assert(equal(r[2], [ 40, 40, 50, 60 ])); } @safe unittest { import std.algorithm.comparison : equal; auto a = [ "A", "AG", "B", "E", "F" ]; auto r = assumeSorted!"cmp(a,b) < 0"(a).trisect("B"w); assert(equal(r[0], [ "A", "AG" ])); assert(equal(r[1], [ "B" ])); assert(equal(r[2], [ "E", "F" ])); r = assumeSorted!"cmp(a,b) < 0"(a).trisect("A"d); assert(r[0].empty); assert(equal(r[1], [ "A" ])); assert(equal(r[2], [ "AG", "B", "E", "F" ])); } @safe unittest { import std.algorithm.comparison : equal; static void test(SearchPolicy pol)() { auto a = [ 1, 2, 3, 42, 52, 64 ]; auto r = assumeSorted(a); assert(equal(r.lowerBound(42), [1, 2, 3])); assert(equal(r.lowerBound!(pol)(42), [1, 2, 3])); assert(equal(r.lowerBound!(pol)(41), [1, 2, 3])); assert(equal(r.lowerBound!(pol)(43), [1, 2, 3, 42])); assert(equal(r.lowerBound!(pol)(51), [1, 2, 3, 42])); assert(equal(r.lowerBound!(pol)(3), [1, 2])); assert(equal(r.lowerBound!(pol)(55), [1, 2, 3, 42, 52])); assert(equal(r.lowerBound!(pol)(420), a)); assert(equal(r.lowerBound!(pol)(0), a[0 .. 0])); assert(equal(r.upperBound!(pol)(42), [52, 64])); assert(equal(r.upperBound!(pol)(41), [42, 52, 64])); assert(equal(r.upperBound!(pol)(43), [52, 64])); assert(equal(r.upperBound!(pol)(51), [52, 64])); assert(equal(r.upperBound!(pol)(53), [64])); assert(equal(r.upperBound!(pol)(55), [64])); assert(equal(r.upperBound!(pol)(420), a[0 .. 0])); assert(equal(r.upperBound!(pol)(0), a)); } test!(SearchPolicy.trot)(); test!(SearchPolicy.gallop)(); test!(SearchPolicy.trotBackwards)(); test!(SearchPolicy.gallopBackwards)(); test!(SearchPolicy.binarySearch)(); } @safe unittest { // Check for small arrays int[] a; auto r = assumeSorted(a); a = [ 1 ]; r = assumeSorted(a); a = [ 1, 2 ]; r = assumeSorted(a); a = [ 1, 2, 3 ]; r = assumeSorted(a); } @safe unittest { import std.algorithm.mutation : swap; auto a = [ 1, 2, 3, 42, 52, 64 ]; auto r = assumeSorted(a); assert(r.contains(42)); swap(a[3], a[5]); // illegal to break sortedness of original range assert(!r.contains(42)); // passes although it shouldn't } @safe unittest { immutable(int)[] arr = [ 1, 2, 3 ]; auto s = assumeSorted(arr); } @system unittest { import std.algorithm.comparison : equal; int[] arr = [100, 101, 102, 200, 201, 300]; auto s = assumeSorted!((a, b) => a / 100 < b / 100)(arr); assert(s.groupBy.equal!equal([[100, 101, 102], [200, 201], [300]])); } // Test on an input range @system unittest { import std.conv : text; import std.file : exists, remove, tempDir; import std.path : buildPath; import std.stdio : File; import std.uuid : randomUUID; auto name = buildPath(tempDir(), "test.std.range.line-" ~ text(__LINE__) ~ "." ~ randomUUID().toString()); auto f = File(name, "w"); scope(exit) if (exists(name)) remove(name); // write a sorted range of lines to the file f.write("abc\ndef\nghi\njkl"); f.close(); f.open(name, "r"); auto r = assumeSorted(f.byLine()); auto r1 = r.upperBound!(SearchPolicy.linear)("def"); assert(r1.front == "ghi", r1.front); f.close(); } // https://issues.dlang.org/show_bug.cgi?id=19337 @safe unittest { import std.algorithm.sorting : sort; auto a = [ 1, 2, 3, 42, 52, 64 ]; a.sort.sort!"a > b"; } /** Assumes `r` is sorted by predicate `pred` and returns the corresponding $(D SortedRange!(pred, R)) having `r` as support. To keep the checking costs low, the cost is $(BIGOH 1) in release mode (no checks for sorted-ness are performed). In debug mode, a few random elements of `r` are checked for sorted-ness. The size of the sample is proportional $(BIGOH log(r.length)). That way, checking has no effect on the complexity of subsequent operations specific to sorted ranges (such as binary search). The probability of an arbitrary unsorted range failing the test is very high (however, an almost-sorted range is likely to pass it). To check for sorted-ness at cost $(BIGOH n), use $(REF isSorted, std,algorithm,sorting). */ auto assumeSorted(alias pred = "a < b", R)(R r) if (isInputRange!(Unqual!R)) { // Avoid senseless `SortedRange!(SortedRange!(...), pred)` nesting. static if (is(R == SortedRange!(RRange, RPred), RRange, alias RPred)) { static if (isInputRange!R && __traits(isSame, pred, RPred)) // If the predicate is the same and we don't need to cast away // constness for the result to be an input range. return r; else return SortedRange!(Unqual!(typeof(r._input)), pred)(r._input); } else { return SortedRange!(Unqual!R, pred)(r); } } /// @safe unittest { import std.algorithm.comparison : equal; int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; auto p = assumeSorted(a); assert(equal(p.lowerBound(4), [0, 1, 2, 3])); assert(equal(p.lowerBound(5), [0, 1, 2, 3, 4])); assert(equal(p.lowerBound(6), [0, 1, 2, 3, 4, 5])); assert(equal(p.lowerBound(6.9), [0, 1, 2, 3, 4, 5, 6])); } @safe unittest { import std.algorithm.comparison : equal; static assert(isRandomAccessRange!(SortedRange!(int[]))); int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]; auto p = assumeSorted(a).upperBound(3); assert(equal(p, [4, 4, 5, 6 ])); p = assumeSorted(a).upperBound(4.2); assert(equal(p, [ 5, 6 ])); // Issue 18933 - don't create senselessly nested SortedRange types. assert(is(typeof(assumeSorted(a)) == typeof(assumeSorted(assumeSorted(a))))); assert(is(typeof(assumeSorted(a)) == typeof(assumeSorted(assumeSorted!"a > b"(a))))); } @safe unittest { import std.algorithm.comparison : equal; import std.conv : text; int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]; auto p = assumeSorted(a).equalRange(3); assert(equal(p, [ 3, 3, 3 ]), text(p)); p = assumeSorted(a).equalRange(4); assert(equal(p, [ 4, 4 ]), text(p)); p = assumeSorted(a).equalRange(2); assert(equal(p, [ 2 ])); p = assumeSorted(a).equalRange(0); assert(p.empty); p = assumeSorted(a).equalRange(7); assert(p.empty); p = assumeSorted(a).equalRange(3.0); assert(equal(p, [ 3, 3, 3])); } @safe unittest { int[] a = [ 1, 2, 3, 3, 3, 4, 4, 5, 6 ]; if (a.length) { auto b = a[a.length / 2]; //auto r = sort(a); //assert(r.contains(b)); } } @safe unittest { auto a = [ 5, 7, 34, 345, 677 ]; auto r = assumeSorted(a); a = null; r = assumeSorted(a); a = [ 1 ]; r = assumeSorted(a); } @system unittest { bool ok = true; try { auto r2 = assumeSorted([ 677, 345, 34, 7, 5 ]); debug ok = false; } catch (Throwable) { } assert(ok); } // issue 15003 @nogc @safe unittest { static immutable a = [1, 2, 3, 4]; auto r = a.assumeSorted; } /++ Wrapper which effectively makes it possible to pass a range by reference. Both the original range and the RefRange will always have the exact same elements. Any operation done on one will affect the other. So, for instance, if it's passed to a function which would implicitly copy the original range if it were passed to it, the original range is $(I not) copied but is consumed as if it were a reference type. Note: `save` works as normal and operates on a new range, so if `save` is ever called on the `RefRange`, then no operations on the saved range will affect the original. Params: range = the range to construct the `RefRange` from Returns: A `RefRange`. If the given range is a class type (and thus is already a reference type), then the original range is returned rather than a `RefRange`. +/ struct RefRange(R) if (isInputRange!R) { public: /++ +/ this(R* range) @safe pure nothrow { _range = range; } /++ This does not assign the pointer of `rhs` to this `RefRange`. Rather it assigns the range pointed to by `rhs` to the range pointed to by this `RefRange`. This is because $(I any) operation on a `RefRange` is the same is if it occurred to the original range. The one exception is when a `RefRange` is assigned `null` either directly or because `rhs` is `null`. In that case, `RefRange` no longer refers to the original range but is `null`. +/ auto opAssign(RefRange rhs) { if (_range && rhs._range) *_range = *rhs._range; else _range = rhs._range; return this; } /++ +/ void opAssign(typeof(null) rhs) { _range = null; } /++ A pointer to the wrapped range. +/ @property inout(R*) ptr() @safe inout pure nothrow { return _range; } version (StdDdoc) { /++ +/ @property auto front() {assert(0);} /++ Ditto +/ @property auto front() const {assert(0);} /++ Ditto +/ @property auto front(ElementType!R value) {assert(0);} } else { @property auto front() { return (*_range).front; } static if (is(typeof((*(cast(const R*)_range)).front))) @property auto front() const { return (*_range).front; } static if (is(typeof((*_range).front = (*_range).front))) @property auto front(ElementType!R value) { return (*_range).front = value; } } version (StdDdoc) { @property bool empty(); /// @property bool empty() const; ///Ditto } else static if (isInfinite!R) enum empty = false; else { @property bool empty() { return (*_range).empty; } static if (is(typeof((*cast(const R*)_range).empty))) @property bool empty() const { return (*_range).empty; } } /++ +/ void popFront() { return (*_range).popFront(); } version (StdDdoc) { /++ Only defined if `isForwardRange!R` is `true`. +/ @property auto save() {assert(0);} /++ Ditto +/ @property auto save() const {assert(0);} /++ Ditto +/ auto opSlice() {assert(0);} /++ Ditto +/ auto opSlice() const {assert(0);} } else static if (isForwardRange!R) { import std.traits : isSafe; private alias S = typeof((*_range).save); static if (is(typeof((*cast(const R*)_range).save))) private alias CS = typeof((*cast(const R*)_range).save); static if (isSafe!((R* r) => (*r).save)) { @property RefRange!S save() @trusted { mixin(_genSave()); } static if (is(typeof((*cast(const R*)_range).save))) @property RefRange!CS save() @trusted const { mixin(_genSave()); } } else { @property RefRange!S save() { mixin(_genSave()); } static if (is(typeof((*cast(const R*)_range).save))) @property RefRange!CS save() const { mixin(_genSave()); } } auto opSlice()() { return save; } auto opSlice()() const { return save; } private static string _genSave() @safe pure nothrow { return `import std.conv : emplace;` ~ `alias S = typeof((*_range).save);` ~ `static assert(isForwardRange!S, S.stringof ~ " is not a forward range.");` ~ `auto mem = new void[S.sizeof];` ~ `emplace!S(mem, cast(S)(*_range).save);` ~ `return RefRange!S(cast(S*) mem.ptr);`; } static assert(isForwardRange!RefRange); } version (StdDdoc) { /++ Only defined if `isBidirectionalRange!R` is `true`. +/ @property auto back() {assert(0);} /++ Ditto +/ @property auto back() const {assert(0);} /++ Ditto +/ @property auto back(ElementType!R value) {assert(0);} } else static if (isBidirectionalRange!R) { @property auto back() { return (*_range).back; } static if (is(typeof((*(cast(const R*)_range)).back))) @property auto back() const { return (*_range).back; } static if (is(typeof((*_range).back = (*_range).back))) @property auto back(ElementType!R value) { return (*_range).back = value; } } /++ Ditto +/ static if (isBidirectionalRange!R) void popBack() { return (*_range).popBack(); } version (StdDdoc) { /++ Only defined if `isRandomAccesRange!R` is `true`. +/ auto ref opIndex(IndexType)(IndexType index) {assert(0);} /++ Ditto +/ auto ref opIndex(IndexType)(IndexType index) const {assert(0);} } else static if (isRandomAccessRange!R) { auto ref opIndex(IndexType)(IndexType index) if (is(typeof((*_range)[index]))) { return (*_range)[index]; } auto ref opIndex(IndexType)(IndexType index) const if (is(typeof((*cast(const R*)_range)[index]))) { return (*_range)[index]; } } /++ Only defined if `hasMobileElements!R` and `isForwardRange!R` are `true`. +/ static if (hasMobileElements!R && isForwardRange!R) auto moveFront() { return (*_range).moveFront(); } /++ Only defined if `hasMobileElements!R` and `isBidirectionalRange!R` are `true`. +/ static if (hasMobileElements!R && isBidirectionalRange!R) auto moveBack() { return (*_range).moveBack(); } /++ Only defined if `hasMobileElements!R` and `isRandomAccessRange!R` are `true`. +/ static if (hasMobileElements!R && isRandomAccessRange!R) auto moveAt(size_t index) { return (*_range).moveAt(index); } version (StdDdoc) { /++ Only defined if `hasLength!R` is `true`. +/ @property auto length() {assert(0);} /++ Ditto +/ @property auto length() const {assert(0);} /++ Ditto +/ alias opDollar = length; } else static if (hasLength!R) { @property auto length() { return (*_range).length; } static if (is(typeof((*cast(const R*)_range).length))) @property auto length() const { return (*_range).length; } alias opDollar = length; } version (StdDdoc) { /++ Only defined if `hasSlicing!R` is `true`. +/ auto opSlice(IndexType1, IndexType2) (IndexType1 begin, IndexType2 end) {assert(0);} /++ Ditto +/ auto opSlice(IndexType1, IndexType2) (IndexType1 begin, IndexType2 end) const {assert(0);} } else static if (hasSlicing!R) { private alias T = typeof((*_range)[1 .. 2]); static if (is(typeof((*cast(const R*)_range)[1 .. 2]))) { private alias CT = typeof((*cast(const R*)_range)[1 .. 2]); } RefRange!T opSlice(IndexType1, IndexType2) (IndexType1 begin, IndexType2 end) if (is(typeof((*_range)[begin .. end]))) { mixin(_genOpSlice()); } RefRange!CT opSlice(IndexType1, IndexType2) (IndexType1 begin, IndexType2 end) const if (is(typeof((*cast(const R*)_range)[begin .. end]))) { mixin(_genOpSlice()); } private static string _genOpSlice() @safe pure nothrow { return `import std.conv : emplace;` ~ `alias S = typeof((*_range)[begin .. end]);` ~ `static assert(hasSlicing!S, S.stringof ~ " is not sliceable.");` ~ `auto mem = new void[S.sizeof];` ~ `emplace!S(mem, cast(S)(*_range)[begin .. end]);` ~ `return RefRange!S(cast(S*) mem.ptr);`; } } private: R* _range; } /// Basic Example @system unittest { import std.algorithm.searching : find; ubyte[] buffer = [1, 9, 45, 12, 22]; auto found1 = find(buffer, 45); assert(found1 == [45, 12, 22]); assert(buffer == [1, 9, 45, 12, 22]); auto wrapped1 = refRange(&buffer); auto found2 = find(wrapped1, 45); assert(*found2.ptr == [45, 12, 22]); assert(buffer == [45, 12, 22]); auto found3 = find(wrapped1.save, 22); assert(*found3.ptr == [22]); assert(buffer == [45, 12, 22]); string str = "hello world"; auto wrappedStr = refRange(&str); assert(str.front == 'h'); str.popFrontN(5); assert(str == " world"); assert(wrappedStr.front == ' '); assert(*wrappedStr.ptr == " world"); } /// opAssign Example. @system unittest { ubyte[] buffer1 = [1, 2, 3, 4, 5]; ubyte[] buffer2 = [6, 7, 8, 9, 10]; auto wrapped1 = refRange(&buffer1); auto wrapped2 = refRange(&buffer2); assert(wrapped1.ptr is &buffer1); assert(wrapped2.ptr is &buffer2); assert(wrapped1.ptr !is wrapped2.ptr); assert(buffer1 != buffer2); wrapped1 = wrapped2; //Everything points to the same stuff as before. assert(wrapped1.ptr is &buffer1); assert(wrapped2.ptr is &buffer2); assert(wrapped1.ptr !is wrapped2.ptr); //But buffer1 has changed due to the assignment. assert(buffer1 == [6, 7, 8, 9, 10]); assert(buffer2 == [6, 7, 8, 9, 10]); buffer2 = [11, 12, 13, 14, 15]; //Everything points to the same stuff as before. assert(wrapped1.ptr is &buffer1); assert(wrapped2.ptr is &buffer2); assert(wrapped1.ptr !is wrapped2.ptr); //But buffer2 has changed due to the assignment. assert(buffer1 == [6, 7, 8, 9, 10]); assert(buffer2 == [11, 12, 13, 14, 15]); wrapped2 = null; //The pointer changed for wrapped2 but not wrapped1. assert(wrapped1.ptr is &buffer1); assert(wrapped2.ptr is null); assert(wrapped1.ptr !is wrapped2.ptr); //buffer2 is not affected by the assignment. assert(buffer1 == [6, 7, 8, 9, 10]); assert(buffer2 == [11, 12, 13, 14, 15]); } @system unittest { import std.algorithm.iteration : filter; { ubyte[] buffer = [1, 2, 3, 4, 5]; auto wrapper = refRange(&buffer); auto p = wrapper.ptr; auto f = wrapper.front; wrapper.front = f; auto e = wrapper.empty; wrapper.popFront(); auto s = wrapper.save; auto b = wrapper.back; wrapper.back = b; wrapper.popBack(); auto i = wrapper[0]; wrapper.moveFront(); wrapper.moveBack(); wrapper.moveAt(0); auto l = wrapper.length; auto sl = wrapper[0 .. 1]; assert(wrapper[0 .. $].length == buffer[0 .. $].length); } { ubyte[] buffer = [1, 2, 3, 4, 5]; const wrapper = refRange(&buffer); const p = wrapper.ptr; const f = wrapper.front; const e = wrapper.empty; const s = wrapper.save; const b = wrapper.back; const i = wrapper[0]; const l = wrapper.length; const sl = wrapper[0 .. 1]; } { ubyte[] buffer = [1, 2, 3, 4, 5]; auto filtered = filter!"true"(buffer); auto wrapper = refRange(&filtered); auto p = wrapper.ptr; auto f = wrapper.front; wrapper.front = f; auto e = wrapper.empty; wrapper.popFront(); auto s = wrapper.save; wrapper.moveFront(); } { ubyte[] buffer = [1, 2, 3, 4, 5]; auto filtered = filter!"true"(buffer); const wrapper = refRange(&filtered); const p = wrapper.ptr; //Cannot currently be const. filter needs to be updated to handle const. /+ const f = wrapper.front; const e = wrapper.empty; const s = wrapper.save; +/ } { string str = "hello world"; auto wrapper = refRange(&str); auto p = wrapper.ptr; auto f = wrapper.front; auto e = wrapper.empty; wrapper.popFront(); auto s = wrapper.save; auto b = wrapper.back; wrapper.popBack(); } { // Issue 16534 - opDollar should be defined if the // wrapped range defines length. auto range = 10.iota.takeExactly(5); auto wrapper = refRange(&range); assert(wrapper.length == 5); assert(wrapper[0 .. $ - 1].length == 4); } } //Test assignment. @system unittest { ubyte[] buffer1 = [1, 2, 3, 4, 5]; ubyte[] buffer2 = [6, 7, 8, 9, 10]; RefRange!(ubyte[]) wrapper1; RefRange!(ubyte[]) wrapper2 = refRange(&buffer2); assert(wrapper1.ptr is null); assert(wrapper2.ptr is &buffer2); wrapper1 = refRange(&buffer1); assert(wrapper1.ptr is &buffer1); wrapper1 = wrapper2; assert(wrapper1.ptr is &buffer1); assert(buffer1 == buffer2); wrapper1 = RefRange!(ubyte[]).init; assert(wrapper1.ptr is null); assert(wrapper2.ptr is &buffer2); assert(buffer1 == buffer2); assert(buffer1 == [6, 7, 8, 9, 10]); wrapper2 = null; assert(wrapper2.ptr is null); assert(buffer2 == [6, 7, 8, 9, 10]); } @system unittest { import std.algorithm.comparison : equal; import std.algorithm.mutation : bringToFront; import std.algorithm.searching : commonPrefix, find, until; import std.algorithm.sorting : sort; //Test that ranges are properly consumed. { int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9]; auto wrapper = refRange(&arr); assert(*find(wrapper, 41).ptr == [41, 3, 40, 4, 42, 9]); assert(arr == [41, 3, 40, 4, 42, 9]); assert(*drop(wrapper, 2).ptr == [40, 4, 42, 9]); assert(arr == [40, 4, 42, 9]); assert(equal(until(wrapper, 42), [40, 4])); assert(arr == [42, 9]); assert(find(wrapper, 12).empty); assert(arr.empty); } { string str = "Hello, world-like object."; auto wrapper = refRange(&str); assert(*find(wrapper, "l").ptr == "llo, world-like object."); assert(str == "llo, world-like object."); assert(equal(take(wrapper, 5), "llo, ")); assert(str == "world-like object."); } //Test that operating on saved ranges does not consume the original. { int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9]; auto wrapper = refRange(&arr); auto saved = wrapper.save; saved.popFrontN(3); assert(*saved.ptr == [41, 3, 40, 4, 42, 9]); assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]); } { string str = "Hello, world-like object."; auto wrapper = refRange(&str); auto saved = wrapper.save; saved.popFrontN(13); assert(*saved.ptr == "like object."); assert(str == "Hello, world-like object."); } //Test that functions which use save work properly. { int[] arr = [1, 42]; auto wrapper = refRange(&arr); assert(equal(commonPrefix(wrapper, [1, 27]), [1])); } { int[] arr = [4, 5, 6, 7, 1, 2, 3]; auto wrapper = refRange(&arr); assert(bringToFront(wrapper[0 .. 4], wrapper[4 .. arr.length]) == 3); assert(arr == [1, 2, 3, 4, 5, 6, 7]); } //Test bidirectional functions. { int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9]; auto wrapper = refRange(&arr); assert(wrapper.back == 9); assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]); wrapper.popBack(); assert(arr == [1, 42, 2, 41, 3, 40, 4, 42]); } { string str = "Hello, world-like object."; auto wrapper = refRange(&str); assert(wrapper.back == '.'); assert(str == "Hello, world-like object."); wrapper.popBack(); assert(str == "Hello, world-like object"); } //Test random access functions. { int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9]; auto wrapper = refRange(&arr); assert(wrapper[2] == 2); assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]); assert(*wrapper[3 .. 6].ptr != null, [41, 3, 40]); assert(arr == [1, 42, 2, 41, 3, 40, 4, 42, 9]); } //Test move functions. { int[] arr = [1, 42, 2, 41, 3, 40, 4, 42, 9]; auto wrapper = refRange(&arr); auto t1 = wrapper.moveFront(); auto t2 = wrapper.moveBack(); wrapper.front = t2; wrapper.back = t1; assert(arr == [9, 42, 2, 41, 3, 40, 4, 42, 1]); sort(wrapper.save); assert(arr == [1, 2, 3, 4, 9, 40, 41, 42, 42]); } } @system unittest { struct S { @property int front() @safe const pure nothrow { return 0; } enum bool empty = false; void popFront() @safe pure nothrow { } @property auto save() @safe pure nothrow { return this; } } S s; auto wrapper = refRange(&s); static assert(isInfinite!(typeof(wrapper))); } @system unittest { class C { @property int front() @safe const pure nothrow { return 0; } @property bool empty() @safe const pure nothrow { return false; } void popFront() @safe pure nothrow { } @property auto save() @safe pure nothrow { return this; } } static assert(isForwardRange!C); auto c = new C; auto cWrapper = refRange(&c); static assert(is(typeof(cWrapper) == C)); assert(cWrapper is c); } @system unittest // issue 14373 { static struct R { @property int front() {return 0;} void popFront() {empty = true;} bool empty = false; } R r; refRange(&r).popFront(); assert(r.empty); } @system unittest // issue 14575 { struct R { Object front; alias back = front; bool empty = false; void popFront() {empty = true;} alias popBack = popFront; @property R save() {return this;} } static assert(isBidirectionalRange!R); R r; auto rr = refRange(&r); struct R2 { @property Object front() {return null;} @property const(Object) front() const {return null;} alias back = front; bool empty = false; void popFront() {empty = true;} alias popBack = popFront; @property R2 save() {return this;} } static assert(isBidirectionalRange!R2); R2 r2; auto rr2 = refRange(&r2); } /// ditto auto refRange(R)(R* range) if (isInputRange!R) { static if (!is(R == class)) return RefRange!R(range); else return *range; } /*****************************************************************************/ @safe unittest // bug 9060 { import std.algorithm.iteration : map, joiner, group; import std.algorithm.searching : until; // fix for std.algorithm auto r = map!(x => 0)([1]); chain(r, r); zip(r, r); roundRobin(r, r); struct NRAR { typeof(r) input; @property empty() { return input.empty; } @property front() { return input.front; } void popFront() { input.popFront(); } @property save() { return NRAR(input.save); } } auto n1 = NRAR(r); cycle(n1); // non random access range version assumeSorted(r); // fix for std.range joiner([r], [9]); struct NRAR2 { NRAR input; @property empty() { return true; } @property front() { return input; } void popFront() { } @property save() { return NRAR2(input.save); } } auto n2 = NRAR2(n1); joiner(n2); group(r); until(r, 7); static void foo(R)(R r) { until!(x => x > 7)(r); } foo(r); } private struct Bitwise(R) if (isInputRange!R && isIntegral!(ElementType!R)) { private: alias ElemType = ElementType!R; alias UnsignedElemType = Unsigned!ElemType; R parent; enum bitsNum = ElemType.sizeof * 8; size_t maskPos = 1; static if (isBidirectionalRange!R) { size_t backMaskPos = bitsNum; } public: this()(auto ref R range) { parent = range; } static if (isInfinite!R) { enum empty = false; } else { /** * Check if the range is empty * * Returns: a boolean true or false */ bool empty() { static if (hasLength!R) { return length == 0; } else static if (isBidirectionalRange!R) { if (parent.empty) { return true; } else { /* If we have consumed the last element of the range both from the front and the back, then the masks positions will overlap */ return parent.save.dropOne.empty && (maskPos > backMaskPos); } } else { /* If we consumed the last element of the range, but not all the bits in the last element */ return parent.empty; } } } bool front() { assert(!empty); return (parent.front & mask(maskPos)) != 0; } void popFront() { assert(!empty); ++maskPos; if (maskPos > bitsNum) { parent.popFront; maskPos = 1; } } static if (hasLength!R) { size_t length() { auto len = parent.length * bitsNum - (maskPos - 1); static if (isBidirectionalRange!R) { len -= bitsNum - backMaskPos; } return len; } alias opDollar = length; } static if (isForwardRange!R) { typeof(this) save() { auto result = this; result.parent = parent.save; return result; } } static if (isBidirectionalRange!R) { bool back() { assert(!empty); return (parent.back & mask(backMaskPos)) != 0; } void popBack() { assert(!empty); --backMaskPos; if (backMaskPos == 0) { parent.popBack; backMaskPos = bitsNum; } } } static if (isRandomAccessRange!R) { /** Return the `n`th bit within the range */ bool opIndex(size_t n) in { /* If it does not have the length property, it means that R is an infinite range */ static if (hasLength!R) { assert(n < length, "Index out of bounds"); } } do { immutable size_t remainingBits = bitsNum - maskPos + 1; // If n >= maskPos, then the bit sign will be 1, otherwise 0 immutable sizediff_t sign = (remainingBits - n - 1) >> (sizediff_t.sizeof * 8 - 1); /* By truncating n with remainingBits bits we have skipped the remaining bits in parent[0], so we need to add 1 to elemIndex. Because bitsNum is a power of 2, n / bitsNum == n >> bitsNum.bsf */ import core.bitop : bsf; immutable size_t elemIndex = sign * (((n - remainingBits) >> bitsNum.bsf) + 1); /* Since the indexing is from LSB to MSB, we need to index at the remainder of (n - remainingBits). Because bitsNum is a power of 2, n % bitsNum == n & (bitsNum - 1) */ immutable size_t elemMaskPos = (sign ^ 1) * (maskPos + n) + sign * (1 + ((n - remainingBits) & (bitsNum - 1))); return (parent[elemIndex] & mask(elemMaskPos)) != 0; } static if (hasAssignableElements!R) { /** Assigns `flag` to the `n`th bit within the range */ void opIndexAssign(bool flag, size_t n) in { static if (hasLength!R) { assert(n < length, "Index out of bounds"); } } do { import core.bitop : bsf; immutable size_t remainingBits = bitsNum - maskPos + 1; immutable sizediff_t sign = (remainingBits - n - 1) >> (sizediff_t.sizeof * 8 - 1); immutable size_t elemIndex = sign * (((n - remainingBits) >> bitsNum.bsf) + 1); immutable size_t elemMaskPos = (sign ^ 1) * (maskPos + n) + sign * (1 + ((n - remainingBits) & (bitsNum - 1))); auto elem = parent[elemIndex]; auto elemMask = mask(elemMaskPos); parent[elemIndex] = cast(UnsignedElemType)(flag * (elem | elemMask) + (flag ^ 1) * (elem & ~elemMask)); } } Bitwise!R opSlice() { return this.save; } Bitwise!R opSlice(size_t start, size_t end) in { assert(start < end, "Invalid bounds: end <= start"); } do { import core.bitop : bsf; size_t remainingBits = bitsNum - maskPos + 1; sizediff_t sign = (remainingBits - start - 1) >> (sizediff_t.sizeof * 8 - 1); immutable size_t startElemIndex = sign * (((start - remainingBits) >> bitsNum.bsf) + 1); immutable size_t startElemMaskPos = (sign ^ 1) * (maskPos + start) + sign * (1 + ((start - remainingBits) & (bitsNum - 1))); immutable size_t sliceLen = end - start - 1; remainingBits = bitsNum - startElemMaskPos + 1; sign = (remainingBits - sliceLen - 1) >> (sizediff_t.sizeof * 8 - 1); immutable size_t endElemIndex = startElemIndex + sign * (((sliceLen - remainingBits) >> bitsNum.bsf) + 1); immutable size_t endElemMaskPos = (sign ^ 1) * (startElemMaskPos + sliceLen) + sign * (1 + ((sliceLen - remainingBits) & (bitsNum - 1))); typeof(return) result; // Get the slice to be returned from the parent result.parent = (parent[startElemIndex .. endElemIndex + 1]).save; result.maskPos = startElemMaskPos; static if (isBidirectionalRange!R) { result.backMaskPos = endElemMaskPos; } return result; } } private: auto mask(size_t maskPos) { return (1UL << (maskPos - 1UL)); } } /** Bitwise adapter over an integral type range. Consumes the range elements bit by bit, from the least significant bit to the most significant bit. Params: R = an integral $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to iterate over range = range to consume bit by by Returns: A `Bitwise` input range with propagated forward, bidirectional and random access capabilities */ auto bitwise(R)(auto ref R range) if (isInputRange!R && isIntegral!(ElementType!R)) { return Bitwise!R(range); } /// @safe pure unittest { import std.algorithm.comparison : equal; import std.format : format; // 00000011 00001001 ubyte[] arr = [3, 9]; auto r = arr.bitwise; // iterate through it as with any other range assert(format("%(%d%)", r) == "1100000010010000"); assert(format("%(%d%)", r.retro).equal("1100000010010000".retro)); auto r2 = r[5 .. $]; // set a bit r[2] = 1; assert(arr[0] == 7); assert(r[5] == r2[0]); } /// You can use bitwise to implement an uniform bool generator @safe unittest { import std.algorithm.comparison : equal; import std.random : rndGen; auto rb = rndGen.bitwise; static assert(isInfinite!(typeof(rb))); auto rb2 = rndGen.bitwise; // Don't forget that structs are passed by value assert(rb.take(10).equal(rb2.take(10))); } // Test nogc inference @safe @nogc unittest { static ubyte[] arr = [3, 9]; auto bw = arr.bitwise; auto bw2 = bw[]; auto bw3 = bw[8 .. $]; bw3[2] = true; assert(arr[1] == 13); assert(bw[$ - 6]); assert(bw[$ - 6] == bw2[$ - 6]); assert(bw[$ - 6] == bw3[$ - 6]); } // Test all range types over all integral types @safe pure nothrow unittest { import std.internal.test.dummyrange; alias IntegralTypes = AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong); foreach (IntegralType; IntegralTypes) { foreach (T; AllDummyRangesType!(IntegralType[])) { T a; auto bw = Bitwise!T(a); static if (isForwardRange!T) { auto bwFwdSave = bw.save; } static if (isBidirectionalRange!T) { auto bwBack = bw.save; auto bwBackSave = bw.save; } static if (hasLength!T) { auto bwLength = bw.length; assert(bw.length == (IntegralType.sizeof * 8 * a.length)); static if (isForwardRange!T) { assert(bw.length == bwFwdSave.length); } } // Make sure front and back are not the mechanisms that modify the range long numCalls = 42; bool initialFrontValue; if (!bw.empty) { initialFrontValue = bw.front; } while (!bw.empty && (--numCalls)) { bw.front; assert(bw.front == initialFrontValue); } /* Check that empty works properly and that popFront does not get called more times than it should */ numCalls = 0; while (!bw.empty) { ++numCalls; static if (hasLength!T) { assert(bw.length == bwLength); --bwLength; } static if (isForwardRange!T) { assert(bw.front == bwFwdSave.front); bwFwdSave.popFront(); } static if (isBidirectionalRange!T) { assert(bwBack.front == bwBackSave.front); bwBack.popBack(); bwBackSave.popBack(); } bw.popFront(); } auto rangeLen = numCalls / (IntegralType.sizeof * 8); assert(numCalls == (IntegralType.sizeof * 8 * rangeLen)); assert(bw.empty); static if (isForwardRange!T) { assert(bwFwdSave.empty); } static if (isBidirectionalRange!T) { assert(bwBack.empty); } } } } // Test opIndex and opSlice @system unittest { alias IntegralTypes = AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong); foreach (IntegralType; IntegralTypes) { size_t bitsNum = IntegralType.sizeof * 8; auto first = cast(IntegralType)(1); // 2 ^ (bitsNum - 1) auto second = cast(IntegralType)(cast(IntegralType)(1) << (bitsNum - 2)); IntegralType[] a = [first, second]; auto bw = Bitwise!(IntegralType[])(a); // Check against lsb of a[0] assert(bw[0] == true); // Check against msb - 1 of a[1] assert(bw[2 * bitsNum - 2] == true); bw.popFront(); assert(bw[2 * bitsNum - 3] == true); import std.exception : assertThrown; // Check out of bounds error assertThrown!Error(bw[2 * bitsNum - 1]); bw[2] = true; assert(bw[2] == true); bw.popFront(); assert(bw[1] == true); auto bw2 = bw[0 .. $ - 5]; auto bw3 = bw2[]; assert(bw2.length == (bw.length - 5)); assert(bw2.length == bw3.length); bw2.popFront(); assert(bw2.length != bw3.length); } } /********************************* * An OutputRange that discards the data it receives. */ struct NullSink { void put(E)(scope const E) pure @safe @nogc nothrow {} } /// ditto auto ref nullSink() { static NullSink sink; return sink; } /// @safe nothrow unittest { import std.algorithm.iteration : map; import std.algorithm.mutation : copy; [4, 5, 6].map!(x => x * 2).copy(nullSink); // data is discarded } /// @safe unittest { import std.csv : csvNextToken; string line = "a,b,c"; // ignore the first column line.csvNextToken(nullSink, ',', '"'); line.popFront; // look at the second column Appender!string app; line.csvNextToken(app, ',', '"'); assert(app.data == "b"); } @safe unittest { auto r = 10.iota .tee(nullSink) .dropOne; assert(r.front == 1); } /++ Implements a "tee" style pipe, wrapping an input range so that elements of the range can be passed to a provided function or $(LREF OutputRange) as they are iterated over. This is useful for printing out intermediate values in a long chain of range code, performing some operation with side-effects on each call to `front` or `popFront`, or diverting the elements of a range into an auxiliary $(LREF OutputRange). It is important to note that as the resultant range is evaluated lazily, in the case of the version of `tee` that takes a function, the function will not actually be executed until the range is "walked" using functions that evaluate ranges, such as $(REF array, std,array) or $(REF fold, std,algorithm,iteration). Params: pipeOnPop = If `Yes.pipeOnPop`, simply iterating the range without ever calling `front` is enough to have `tee` mirror elements to `outputRange` (or, respectively, `fun`). If `No.pipeOnPop`, only elements for which `front` does get called will be also sent to `outputRange`/`fun`. inputRange = The input range being passed through. outputRange = This range will receive elements of `inputRange` progressively as iteration proceeds. fun = This function will be called with elements of `inputRange` progressively as iteration proceeds. Returns: An input range that offers the elements of `inputRange`. Regardless of whether `inputRange` is a more powerful range (forward, bidirectional etc), the result is always an input range. Reading this causes `inputRange` to be iterated and returns its elements in turn. In addition, the same elements will be passed to `outputRange` or `fun` as well. See_Also: $(REF each, std,algorithm,iteration) +/ auto tee(Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1, R2)(R1 inputRange, R2 outputRange) if (isInputRange!R1 && isOutputRange!(R2, ElementType!R1)) { static struct Result { private R1 _input; private R2 _output; static if (!pipeOnPop) { private bool _frontAccessed; } static if (hasLength!R1) { @property auto length() { return _input.length; } } static if (isInfinite!R1) { enum bool empty = false; } else { @property bool empty() { return _input.empty; } } void popFront() { assert(!_input.empty, "Attempting to popFront an empty tee"); static if (pipeOnPop) { put(_output, _input.front); } else { _frontAccessed = false; } _input.popFront(); } @property auto ref front() { assert(!_input.empty, "Attempting to fetch the front of an empty tee"); static if (!pipeOnPop) { if (!_frontAccessed) { _frontAccessed = true; put(_output, _input.front); } } return _input.front; } } return Result(inputRange, outputRange); } /// Ditto auto tee(alias fun, Flag!"pipeOnPop" pipeOnPop = Yes.pipeOnPop, R1)(R1 inputRange) if (is(typeof(fun) == void) || isSomeFunction!fun) { import std.traits : isDelegate, isFunctionPointer; /* Distinguish between function literals and template lambdas when using either as an $(LREF OutputRange). Since a template has no type, typeof(template) will always return void. If it's a template lambda, it's first necessary to instantiate it with `ElementType!R1`. */ static if (is(typeof(fun) == void)) alias _fun = fun!(ElementType!R1); else alias _fun = fun; static if (isFunctionPointer!_fun || isDelegate!_fun) { return tee!pipeOnPop(inputRange, _fun); } else { return tee!pipeOnPop(inputRange, &_fun); } } /// @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter, map; // Sum values while copying int[] values = [1, 4, 9, 16, 25]; int sum = 0; auto newValues = values.tee!(a => sum += a).array; assert(equal(newValues, values)); assert(sum == 1 + 4 + 9 + 16 + 25); // Count values that pass the first filter int count = 0; auto newValues4 = values.filter!(a => a < 10) .tee!(a => count++) .map!(a => a + 1) .filter!(a => a < 10); //Fine, equal also evaluates any lazy ranges passed to it. //count is not 3 until equal evaluates newValues4 assert(equal(newValues4, [2, 5])); assert(count == 3); } // @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter, map; int[] values = [1, 4, 9, 16, 25]; int count = 0; auto newValues = values.filter!(a => a < 10) .tee!(a => count++, No.pipeOnPop) .map!(a => a + 1) .filter!(a => a < 10); auto val = newValues.front; assert(count == 1); //front is only evaluated once per element val = newValues.front; assert(count == 1); //popFront() called, fun will be called //again on the next access to front newValues.popFront(); newValues.front; assert(count == 2); int[] preMap = new int[](3), postMap = []; auto mappedValues = values.filter!(a => a < 10) //Note the two different ways of using tee .tee(preMap) .map!(a => a + 1) .tee!(a => postMap ~= a) .filter!(a => a < 10); assert(equal(mappedValues, [2, 5])); assert(equal(preMap, [1, 4, 9])); assert(equal(postMap, [2, 5, 10])); } // @safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter, map; char[] txt = "Line one, Line 2".dup; bool isVowel(dchar c) { import std.string : indexOf; return "AaEeIiOoUu".indexOf(c) != -1; } int vowelCount = 0; int shiftedCount = 0; auto removeVowels = txt.tee!(c => isVowel(c) ? vowelCount++ : 0) .filter!(c => !isVowel(c)) .map!(c => (c == ' ') ? c : c + 1) .tee!(c => isVowel(c) ? shiftedCount++ : 0); assert(equal(removeVowels, "Mo o- Mo 3")); assert(vowelCount == 6); assert(shiftedCount == 3); } @safe unittest { // Manually stride to test different pipe behavior. void testRange(Range)(Range r) { const int strideLen = 3; int i = 0; ElementType!Range elem1; ElementType!Range elem2; while (!r.empty) { if (i % strideLen == 0) { //Make sure front is only //evaluated once per item elem1 = r.front; elem2 = r.front; assert(elem1 == elem2); } r.popFront(); i++; } } string txt = "abcdefghijklmnopqrstuvwxyz"; int popCount = 0; auto pipeOnPop = txt.tee!(a => popCount++); testRange(pipeOnPop); assert(popCount == 26); int frontCount = 0; auto pipeOnFront = txt.tee!(a => frontCount++, No.pipeOnPop); testRange(pipeOnFront); assert(frontCount == 9); } @safe unittest { import std.algorithm.comparison : equal; import std.meta : AliasSeq; //Test diverting elements to an OutputRange string txt = "abcdefghijklmnopqrstuvwxyz"; dchar[] asink1 = []; auto fsink = (dchar c) { asink1 ~= c; }; auto result1 = txt.tee(fsink).array; assert(equal(txt, result1) && (equal(result1, asink1))); dchar[] _asink1 = []; auto _result1 = txt.tee!((dchar c) { _asink1 ~= c; })().array; assert(equal(txt, _result1) && (equal(_result1, _asink1))); dchar[] asink2 = new dchar[](txt.length); void fsink2(dchar c) { static int i = 0; asink2[i] = c; i++; } auto result2 = txt.tee(&fsink2).array; assert(equal(txt, result2) && equal(result2, asink2)); dchar[] asink3 = new dchar[](txt.length); auto result3 = txt.tee(asink3).array; assert(equal(txt, result3) && equal(result3, asink3)); static foreach (CharType; AliasSeq!(char, wchar, dchar)) {{ auto appSink = appender!(CharType[])(); auto appResult = txt.tee(appSink).array; assert(equal(txt, appResult) && equal(appResult, appSink.data)); }} static foreach (StringType; AliasSeq!(string, wstring, dstring)) {{ auto appSink = appender!StringType(); auto appResult = txt.tee(appSink).array; assert(equal(txt, appResult) && equal(appResult, appSink.data)); }} } @safe unittest { // Issue 13483 static void func1(T)(T x) {} void func2(int x) {} auto r = [1, 2, 3, 4].tee!func1.tee!func2; } /** Extends the length of the input range `r` by padding out the start of the range with the element `e`. The element `e` must be of a common type with the element type of the range `r` as defined by $(REF CommonType, std, traits). If `n` is less than the length of of `r`, then `r` is returned unmodified. If `r` is a string with Unicode characters in it, `padLeft` follows D's rules about length for strings, which is not the number of characters, or graphemes, but instead the number of encoding units. If you want to treat each grapheme as only one encoding unit long, then call $(REF byGrapheme, std, uni) before calling this function. If `r` has a length, then this is $(BIGOH 1). Otherwise, it's $(BIGOH r.length). Params: r = an $(REF_ALTTEXT input range, isInputRange, std,range,primitives) with a length, or a forward range e = element to pad the range with n = the length to pad to Returns: A range containing the elements of the original range with the extra padding See Also: $(REF leftJustifier, std, string) */ auto padLeft(R, E)(R r, E e, size_t n) if ( ((isInputRange!R && hasLength!R) || isForwardRange!R) && !is(CommonType!(ElementType!R, E) == void) ) { static if (hasLength!R) auto dataLength = r.length; else auto dataLength = r.save.walkLength(n); return e.repeat(n > dataLength ? n - dataLength : 0).chain(r); } /// @safe pure unittest { import std.algorithm.comparison : equal; assert([1, 2, 3, 4].padLeft(0, 6).equal([0, 0, 1, 2, 3, 4])); assert([1, 2, 3, 4].padLeft(0, 3).equal([1, 2, 3, 4])); assert("abc".padLeft('_', 6).equal("___abc")); } @safe pure nothrow unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : DummyRange, Length, RangeType, ReturnBy; import std.meta : AliasSeq; alias DummyRanges = AliasSeq!( DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Input), DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Forward), DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Bidirectional), DummyRange!(ReturnBy.Reference, Length.Yes, RangeType.Random), DummyRange!(ReturnBy.Reference, Length.No, RangeType.Forward), DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Input), DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Forward), DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Bidirectional), DummyRange!(ReturnBy.Value, Length.Yes, RangeType.Random), DummyRange!(ReturnBy.Value, Length.No, RangeType.Forward) ); foreach (Range; DummyRanges) { Range r; assert(r .padLeft(0, 12) .equal([0, 0, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U]) ); } } // Test nogc inference @safe @nogc pure unittest { import std.algorithm.comparison : equal; static immutable r1 = [1, 2, 3, 4]; static immutable r2 = [0, 0, 1, 2, 3, 4]; assert(r1.padLeft(0, 6).equal(r2)); } /** Extend the length of the input range `r` by padding out the end of the range with the element `e`. The element `e` must be of a common type with the element type of the range `r` as defined by $(REF CommonType, std, traits). If `n` is less than the length of of `r`, then the contents of `r` are returned. The range primitives that the resulting range provides depends whether or not `r` provides them. Except the functions `back` and `popBack`, which also require the range to have a length as well as `back` and `popBack` Params: r = an $(REF_ALTTEXT input range, isInputRange, std,range,primitives) with a length e = element to pad the range with n = the length to pad to Returns: A range containing the elements of the original range with the extra padding See Also: $(REF rightJustifier, std, string) */ auto padRight(R, E)(R r, E e, size_t n) if ( isInputRange!R && !isInfinite!R && !is(CommonType!(ElementType!R, E) == void)) { static struct Result { private: R data; E element; static if (hasLength!R) { size_t padLength; } else { size_t minLength; size_t consumed; } public: bool empty() @property { static if (hasLength!R) { return data.empty && padLength == 0; } else { return data.empty && consumed >= minLength; } } auto front() @property { assert(!empty, "Attempting to fetch the front of an empty padRight"); return data.empty ? element : data.front; } void popFront() { assert(!empty, "Attempting to popFront an empty padRight"); static if (hasLength!R) { if (!data.empty) { data.popFront; } else { --padLength; } } else { ++consumed; if (!data.empty) { data.popFront; } } } static if (hasLength!R) { size_t length() @property { return data.length + padLength; } } static if (isForwardRange!R) { auto save() @property { typeof(this) result = this; data = data.save; return result; } } static if (isBidirectionalRange!R && hasLength!R) { auto back() @property { assert(!empty, "Attempting to fetch the back of an empty padRight"); return padLength > 0 ? element : data.back; } void popBack() { assert(!empty, "Attempting to popBack an empty padRight"); if (padLength > 0) { --padLength; } else { data.popBack; } } } static if (isRandomAccessRange!R && hasLength!R) { E opIndex(size_t index) { assert(index <= this.length, "Index out of bounds"); return index >= data.length ? element : data[index]; } } static if (hasSlicing!R && hasLength!R) { auto opSlice(size_t a, size_t b) { assert( a <= b, "Attempting to slice a padRight with a larger first argument than the second." ); assert( b <= length, "Attempting to slice using an out of bounds index on a padRight" ); return Result( a >= data.length ? data[0 .. 0] : b <= data.length ? data[a .. b] : data[a .. data.length], element, b - a); } alias opDollar = length; } this(R r, E e, size_t n) { data = r; element = e; static if (hasLength!R) { padLength = n > data.length ? n - data.length : 0; } else { minLength = n; } } @disable this(); } return Result(r, e, n); } /// @safe pure unittest { import std.algorithm.comparison : equal; assert([1, 2, 3, 4].padRight(0, 6).equal([1, 2, 3, 4, 0, 0])); assert([1, 2, 3, 4].padRight(0, 4).equal([1, 2, 3, 4])); assert("abc".padRight('_', 6).equal("abc___")); } pure @safe unittest { import std.algorithm.comparison : equal; import std.internal.test.dummyrange : AllDummyRanges, ReferenceInputRange; import std.meta : AliasSeq; auto string_input_range = new ReferenceInputRange!dchar(['a', 'b', 'c']); dchar padding = '_'; assert(string_input_range.padRight(padding, 6).equal("abc___")); foreach (RangeType; AllDummyRanges) { RangeType r1; assert(r1 .padRight(0, 12) .equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0, 0]) ); // test if Result properly uses random access ranges static if (isRandomAccessRange!RangeType) { RangeType r3; assert(r3.padRight(0, 12)[0] == 1); assert(r3.padRight(0, 12)[2] == 3); assert(r3.padRight(0, 12)[9] == 10); assert(r3.padRight(0, 12)[10] == 0); assert(r3.padRight(0, 12)[11] == 0); } // test if Result properly uses slicing and opDollar static if (hasSlicing!RangeType) { RangeType r4; assert(r4 .padRight(0, 12)[0 .. 3] .equal([1, 2, 3]) ); assert(r4 .padRight(0, 12)[0 .. 10] .equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U]) ); assert(r4 .padRight(0, 12)[0 .. 11] .equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0]) ); assert(r4 .padRight(0, 12)[2 .. $] .equal([3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0, 0]) ); assert(r4 .padRight(0, 12)[0 .. $] .equal([1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 0, 0]) ); } // drop & dropBack test opslice ranges when available, popFront/popBack otherwise RangeType r5; foreach (i; 1 .. 13) assert(r5.padRight(0, 12).drop(i).walkLength == 12 - i); } } // Test nogc inference @safe @nogc pure unittest { import std.algorithm.comparison : equal; static immutable r1 = [1, 2, 3, 4]; static immutable r2 = [1, 2, 3, 4, 0, 0]; assert(r1.padRight(0, 6).equal(r2)); } // Test back, popBack, and save @safe pure unittest { import std.algorithm.comparison : equal; auto r1 = [1, 2, 3, 4].padRight(0, 6); assert(r1.back == 0); r1.popBack; auto r2 = r1.save; assert(r1.equal([1, 2, 3, 4, 0])); assert(r2.equal([1, 2, 3, 4, 0])); r1.popBackN(2); assert(r1.back == 3); assert(r1.length == 3); assert(r2.length == 5); assert(r2.equal([1, 2, 3, 4, 0])); r2.popFront; assert(r2.length == 4); assert(r2[0] == 2); assert(r2[1] == 3); assert(r2[2] == 4); assert(r2[3] == 0); assert(r2.equal([2, 3, 4, 0])); r2.popBack; assert(r2.equal([2, 3, 4])); auto r3 = [1, 2, 3, 4].padRight(0, 6); size_t len = 0; while (!r3.empty) { ++len; r3.popBack; } assert(len == 6); } // Issue 19042 @safe pure unittest { import std.algorithm.comparison : equal; assert([2, 5, 13].padRight(42, 10).chunks(5) .equal!equal([[2, 5, 13, 42, 42], [42, 42, 42, 42, 42]])); assert([1, 2, 3, 4].padRight(0, 10)[7 .. 9].equal([0, 0])); }
D
/Users/Ashley/Desktop/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate.o : /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/MultipartFormData.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Timeline.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Alamofire.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Response.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/TaskDelegate.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/SessionDelegate.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Validation.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/SessionManager.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/AFError.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Notifications.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Result.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Request.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ServerTrustPolicy.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/Ashley/Desktop/Bandsintown/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Ashley/Desktop/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Users/Ashley/Desktop/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate~partial.swiftmodule : /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/MultipartFormData.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Timeline.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Alamofire.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Response.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/TaskDelegate.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/SessionDelegate.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Validation.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/SessionManager.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/AFError.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Notifications.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Result.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Request.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ServerTrustPolicy.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/Ashley/Desktop/Bandsintown/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Ashley/Desktop/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap /Users/Ashley/Desktop/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/Objects-normal/x86_64/SessionDelegate~partial.swiftdoc : /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/MultipartFormData.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Timeline.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Alamofire.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Response.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/TaskDelegate.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/SessionDelegate.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ParameterEncoding.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Validation.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ResponseSerialization.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/SessionManager.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/NetworkReachabilityManager.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/AFError.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Notifications.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Result.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/Request.swift /Users/Ashley/Desktop/Bandsintown/Pods/Alamofire/Source/ServerTrustPolicy.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/Ashley/Desktop/Bandsintown/Pods/Target\ Support\ Files/Alamofire/Alamofire-umbrella.h /Users/Ashley/Desktop/Bandsintown/Build/Intermediates/Pods.build/Debug-iphonesimulator/Alamofire.build/unextended-module.modulemap
D
module godot.physics2ddirectspacestate; import std.meta : AliasSeq, staticIndexOf; import std.traits : Unqual; import godot.d.meta; import godot.core; import godot.c; import godot.object; import godot.physics2dshapequeryparameters; @GodotBaseClass struct Physics2DDirectSpaceState { static immutable string _GODOT_internal_name = "Physics2DDirectSpaceState"; public: union { godot_object _godot_object; GodotObject base; } alias base this; alias BaseClasses = AliasSeq!(typeof(base), typeof(base).BaseClasses); package(godot) void* opCast(T : void*)() const { return cast(void*)_godot_object.ptr; } godot_object opCast(T : godot_object)() const { return cast(godot_object)_godot_object; } bool opEquals(in Physics2DDirectSpaceState other) const { return _godot_object.ptr is other._godot_object.ptr; } Physics2DDirectSpaceState opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } bool opCast(T : bool)() const { return _godot_object.ptr !is null; } inout(T) opCast(T)() inout if(isGodotBaseClass!T) { static assert(staticIndexOf!(Physics2DDirectSpaceState, T.BaseClasses) != -1, "Godot class "~T.stringof~" does not inherit Physics2DDirectSpaceState"); if(_godot_object.ptr is null) return T.init; String c = String(T._GODOT_internal_name); if(is_class(c)) return inout(T)(_godot_object); return T.init; } inout(T) opCast(T)() inout if(extendsGodotBaseClass!T) { static assert(is(typeof(T.owner) : Physics2DDirectSpaceState) || staticIndexOf!(Physics2DDirectSpaceState, typeof(T.owner).BaseClasses) != -1, "D class "~T.stringof~" does not extend Physics2DDirectSpaceState"); if(_godot_object.ptr is null) return null; if(has_method(String(`_GDNATIVE_D_typeid`))) { Object o = cast(Object)godot_nativescript_get_userdata(opCast!godot_object); return cast(inout(T))o; } return null; } static Physics2DDirectSpaceState _new() { static godot_class_constructor constructor; if(constructor is null) constructor = godot_get_class_constructor("Physics2DDirectSpaceState"); if(constructor is null) return typeof(this).init; return cast(Physics2DDirectSpaceState)(constructor()); } enum int TYPE_MASK_KINEMATIC_BODY = 2; enum int TYPE_MASK_CHARACTER_BODY = 8; enum int TYPE_MASK_AREA = 16; enum int TYPE_MASK_COLLISION = 15; enum int TYPE_MASK_RIGID_BODY = 4; enum int TYPE_MASK_STATIC_BODY = 1; Array intersect_point(in Vector2 point, in int max_results = 32, in Array exclude = Array.empty_array, in int collision_layer = 2147483647, in int type_mask = 15) { static godot_method_bind* mb = null; if(mb is null) mb = godot_method_bind_get_method("Physics2DDirectSpaceState", "intersect_point"); Array _GODOT_ret = Array.empty_array; const(void*)[5] _GODOT_args = [cast(void*)(&point), cast(void*)(&max_results), cast(void*)(&exclude), cast(void*)(&collision_layer), cast(void*)(&type_mask), ]; godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret); return _GODOT_ret; } Dictionary intersect_ray(in Vector2 from, in Vector2 to, in Array exclude = Array.empty_array, in int collision_layer = 2147483647, in int type_mask = 15) { static godot_method_bind* mb = null; if(mb is null) mb = godot_method_bind_get_method("Physics2DDirectSpaceState", "intersect_ray"); Dictionary _GODOT_ret = Dictionary.empty_dictionary; const(void*)[5] _GODOT_args = [cast(void*)(&from), cast(void*)(&to), cast(void*)(&exclude), cast(void*)(&collision_layer), cast(void*)(&type_mask), ]; godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret); return _GODOT_ret; } Array intersect_shape(in Physics2DShapeQueryParameters shape, in int max_results = 32) { static godot_method_bind* mb = null; if(mb is null) mb = godot_method_bind_get_method("Physics2DDirectSpaceState", "intersect_shape"); Array _GODOT_ret = Array.empty_array; const(void*)[2] _GODOT_args = [cast(void*)(shape), cast(void*)(&max_results), ]; godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret); return _GODOT_ret; } Array cast_motion(in Physics2DShapeQueryParameters shape) { static godot_method_bind* mb = null; if(mb is null) mb = godot_method_bind_get_method("Physics2DDirectSpaceState", "cast_motion"); Array _GODOT_ret = Array.empty_array; const(void*)[1] _GODOT_args = [cast(void*)(shape), ]; godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret); return _GODOT_ret; } Array collide_shape(in Physics2DShapeQueryParameters shape, in int max_results = 32) { static godot_method_bind* mb = null; if(mb is null) mb = godot_method_bind_get_method("Physics2DDirectSpaceState", "collide_shape"); Array _GODOT_ret = Array.empty_array; const(void*)[2] _GODOT_args = [cast(void*)(shape), cast(void*)(&max_results), ]; godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret); return _GODOT_ret; } Dictionary get_rest_info(in Physics2DShapeQueryParameters shape) { static godot_method_bind* mb = null; if(mb is null) mb = godot_method_bind_get_method("Physics2DDirectSpaceState", "get_rest_info"); Dictionary _GODOT_ret = Dictionary.empty_dictionary; const(void*)[1] _GODOT_args = [cast(void*)(shape), ]; godot_method_bind_ptrcall(mb, cast(godot_object)(this), _GODOT_args.ptr, cast(void*)&_GODOT_ret); return _GODOT_ret; } }
D
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableConstraintAlgorithm.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableConstraintAlgorithm~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableConstraintAlgorithm~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/SQLTableConstraintAlgorithm~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBind.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoinMethod.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSerializable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDataType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdate.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDelete.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBoolLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDefaultLiteral.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraintAlgorithm.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLJoin.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCollation.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKeyAction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLConnection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDirection.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunction.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnDefinition.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLAlterTableBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLUpdateBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDeleteBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPredicateGroupBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelectBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsertBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLRawBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndexBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryBuilder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQueryFetcher.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIndexModifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLBinaryOperator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLSelect.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDistinct.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLFunctionArgument.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLTableConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLColumnConstraint.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLInsert.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLCreateIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLDropIndex.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLGroupBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLOrderBy.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLForeignKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLPrimaryKey.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/sql/Sources/SQL/SQLQuery.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.swiftmodule /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/cpp_magic.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/ifaddrs-android.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIODarwin/include/CNIODarwin.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOAtomics/include/CNIOAtomics.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/swift-nio/Sources/CNIOLinux/include/CNIOLinux.h /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOHTTP1.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/MySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentMySQL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CCryptoOpenSSL.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIO.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/HTTP.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOTLS.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOZlib.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Async.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Command.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Service.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Console.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Core.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentSQLite.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOPriorityQueue.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Logging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Debugging.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Routing.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/SQLBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/FluentBenchmark.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/COperatingSystem.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Random.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/URLEncodedForm.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Authentication.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Validation.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Crypto.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/App.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOHTTPParser.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Vapor.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOConcurrencyHelpers.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Bits.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOFoundationCompat.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/WebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/NIOWebSocket.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/DatabaseKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Fluent.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/Multipart.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.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
module hello; import dguihub; class MainForm : Form { private ComboBox combo; public this() { this.text = "DGui Form"; this.size = Size(500, 400); this.startPosition = FormStartPosition.centerScreen; // Set Form Position combo = new ComboBox(); combo.dropDownStyle(DropDownStyles.simple); //combo.dock = DockStyle.top; // x, y, w, h combo.bounds = Rect(10, 10, 80, 160); import std.string; for (size_t i = 0; i < 176; ++i) { combo.addItem("OUT %2d".format(i)); } combo.parent = this; combo.itemChanged.attach(&this.onBtnClick); } private void onBtnClick(Control sender, EventArgs e) { import std.conv; if (combo !is null) { MsgBox.show("Click Event", combo.selectedIndex.to!string()); //MsgBox.show("Click Event", combo.selectedItem.to!string()); } else { MsgBox.show("Click Event", "null"); } } } int main(string[] args) { return Application.run(new MainForm()); // Start the application }
D
/* EXTRA_FILES: imports/fail20637b.d TEST_OUTPUT: --- fail_compilation/fail20637.d(12): Error: no property `foo` for type `imports.fail20637b.A` --- */ module fail20637; import imports.fail20637b; void main() { A.foo; }
D
/Users/obuchiyuki/Desktop/SaftyDrive/Build/Intermediates/IBDesignables/Intermediates/SaftyDrive.build/Debug-iphonesimulator/SaftyDrive.build/Objects-normal/x86_64/MKImageView.o : /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSnackbar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMMenu.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMTip.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKImageView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/etc.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKColor.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKNavigationBar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSwitch.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCollectionViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingCellViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLayer.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKActivityIndicator.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMReachability.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedMainControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMNavigationViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingDataController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedDrawerControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKRefreshControl.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSideDrawerViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCardView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTextField.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTableViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/ViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMAlertController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/swiftyJSON.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLabel.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKButton.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/AppDelegate.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMHorizontalMenu.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/obuchiyuki/Desktop/SaftyDrive/Build/Intermediates/IBDesignables/Intermediates/SaftyDrive.build/Debug-iphonesimulator/SaftyDrive.build/Objects-normal/x86_64/MKImageView~partial.swiftmodule : /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSnackbar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMMenu.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMTip.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKImageView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/etc.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKColor.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKNavigationBar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSwitch.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCollectionViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingCellViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLayer.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKActivityIndicator.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMReachability.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedMainControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMNavigationViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingDataController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedDrawerControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKRefreshControl.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSideDrawerViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCardView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTextField.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTableViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/ViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMAlertController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/swiftyJSON.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLabel.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKButton.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/AppDelegate.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMHorizontalMenu.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/obuchiyuki/Desktop/SaftyDrive/Build/Intermediates/IBDesignables/Intermediates/SaftyDrive.build/Debug-iphonesimulator/SaftyDrive.build/Objects-normal/x86_64/MKImageView~partial.swiftdoc : /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSnackbar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMMenu.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMTip.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKImageView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/etc.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKColor.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKNavigationBar.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSwitch.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCollectionViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingCellViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLayer.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKActivityIndicator.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMReachability.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedMainControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMNavigationViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingDataController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKEmbedDrawerControllerSegue.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKRefreshControl.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKSideDrawerViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKCardView.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/PagingViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTextField.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKTableViewCell.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/ViewController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMAlertController.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/swiftyJSON.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKLabel.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/MK/MKButton.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/AppDelegate.swift /Users/obuchiyuki/Desktop/SaftyDrive/SaftyDrive/RMHorizontalMenu.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
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE 298.700012 68.4000015 2.9000001 130.600006 23 28 -38.4000015 144.300003 138 4.80000019 4.80000019 0.2 sediments, limestone 264.399994 75 15.6000004 0 2 65 -8.80000019 126.699997 1206 10.3999996 18 0.0317460317 extrusives, intrusives 349.5 78.1999969 4.69999981 999.900024 5 35 -36.0999985 149.100006 1153 6.0999999 7.5999999 0.0666666667 sediments, weathered volcanics 317 63 14 16 23 56 -32.5 151 1840 20 20 0.0606060606 extrusives, basalts 305 73 17 29 23 56 -42 147 1821 25 29 0.0606060606 extrusives, basalts 236.600006 78.5 0 7.5 0 35 -17.2000008 131.5 1894 0 0 0.0571428571 sediments, red mudstones 274 66 27.6000004 8.60000038 25 65 -41.2999992 145.899994 1873 39.7999992 46.9000015 0.05 intrusives, granite 321 64 6 27.5 25 65 -35.5999985 137.5 1874 10 11 0.05 sediments 294 75 11 7 25 65 -41.0999985 146.100006 1871 16.2999992 18.8999996 0.05 sediments, sandstone 315 66 10.5 18 25 65 -41 145.5 1872 18.2000008 19.6000004 0.05 extrusives, sediments 295.100006 74.0999985 5.19999981 0 23 35 -27 143 1971 6.5999999 6.5999999 0.166666667 sediments, weathered 288.799988 81.1999969 3.4000001 140 16 29 -29 115 1939 4.5 4.5 0.153846154 sediments 272.399994 68.9000015 0 0 25 35 -35 150 1926 4.30000019 4.30000019 0.2 extrusives, basalts
D
(folklore) fairies that are somewhat mischievous below 3 kilohertz
D
instance Pal_214_Ritter(Npc_Default) { name[0] = NAME_Ritter; guild = GIL_PAL; id = 214; voice = 12; flags = 0; npcType = NPCTYPE_AMBIENT; B_SetAttributesToChapter(self,4); fight_tactic = FAI_HUMAN_MASTER; EquipItem(self,ItMw_2h_Pal_Sword); B_CreateAmbientInv(self); B_SetNpcVisual(self,MALE,"Hum_Head_FatBald",Face_L_Tough01,BodyTex_L,ItAr_PAL_M); Mdl_SetModelFatness(self,2); Mdl_ApplyOverlayMds(self,"Humans_Militia.mds"); B_GiveNpcTalents(self); B_SetFightSkills(self,55); daily_routine = Rtn_Start_214; }; func void Rtn_Start_214() { TA_Smalltalk(7,5,19,5,"NW_CITY_UPTOWN_PATH_05"); TA_Read_Bookstand(19,5,23,0,"NW_CITY_UPTOWN_HUT_03_03"); TA_Sleep(23,0,7,5,"NW_CITY_LEOMAR_BED_05"); };
D
instance MENU_OPT_CONTROLS(C_MENU_DEF) { backPic = MENU_BACK_PIC; items[0] = "MENU_ITEM_CHG_KEYS_HEADLINE"; items[1] = "MENU_ITEM_KEY_UP"; items[2] = "MENU_ITEM_KEY_DOWN"; items[3] = "MENU_ITEM_KEY_LEFT"; items[4] = "MENU_ITEM_KEY_RIGHT"; items[5] = "MENU_ITEM_KEY_STRAFE_LEFT"; items[6] = "MENU_ITEM_KEY_STRAFE_RIGHT"; items[7] = "MENU_ITEM_KEY_JUMPCLIMBSTRAFE"; items[8] = "MENU_ITEM_KEY_RUNMODETOGGLE"; items[9] = "MENU_ITEM_KEY_SNEAK"; items[10] = "MENU_ITEM_KEY_ACTION"; items[11] = "MENU_ITEM_KEY_WEAPON"; items[12] = "MENU_ITEM_KEY_MAP"; items[13] = "MENU_ITEM_KEY_LOOK"; items[14] = "MENU_ITEM_KEY_LOOK_FP"; items[15] = "MENU_ITEM_KEY_INVENTORY"; items[16] = "MENU_ITEM_KEY_SCREEN_STATUS"; items[17] = "MENU_ITEM_KEY_SCREEN_LOG"; items[18] = "MENU_ITEM_INP_UP"; items[19] = "MENU_ITEM_INP_DOWN"; items[20] = "MENU_ITEM_INP_LEFT"; items[21] = "MENU_ITEM_INP_RIGHT"; items[22] = "MENU_ITEM_INP_STRAFE_LEFT"; items[23] = "MENU_ITEM_INP_STRAFE_RIGHT"; items[24] = "MENU_ITEM_INP_JUMPCLIMBSTRAFE"; items[25] = "MENU_ITEM_INP_RUNMODETOGGLE"; items[26] = "MENU_ITEM_INP_SNEAK"; items[27] = "MENU_ITEM_INP_ACTION"; items[28] = "MENU_ITEM_INP_WEAPON"; items[29] = "MENU_ITEM_INP_MAP"; items[30] = "MENU_ITEM_INP_LOOK"; items[31] = "MENU_ITEM_INP_LOOK_FP"; items[32] = "MENU_ITEM_INP_INVENTORY"; items[33] = "MENU_ITEM_INP_SCREEN_STATUS"; items[34] = "MENU_ITEM_INP_SCREEN_LOG"; items[35] = "MENU_ITEM_CHG_KEYS_SET_DEFAULT"; items[36] = "MENU_ITEM_CHG_KEYS_SET_ALTERNATIVE"; items[37] = "MENUITEM_CHG_KEYS_BACK"; items[38] = "MENU_ITEM_NEXTMENU"; flags = flags | MENU_SHOW_INFO; }; instance MENU_ITEM_NEXTMENU(C_MENU_ITEM_DEF) { backPic = MENU_ITEM_BACK_PIC; text[0] = "Další klávesy..."; text[1] = "Konfigurace dalších kláves"; posx = CTRL_SP1_1 + 2500; posy = CTRL_Y_START + (CTRL_Y_STEP * 21) + CTRL_GROUP6; dimy = 300; fontname = MENU_FONT_SMALL; onselaction_s[0] = "MENU_OPT_CONTROLS_EXTKEYS"; onselaction[0] = SEL_ACTION_STARTMENU; flags = flags | IT_TXT_CENTER; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_OPT_CONTROLS_EXTKEYS(C_MENU_DEF) { backPic = MENU_BACK_PIC; items[0] = "MENU_ITEM_CHG_EXTKEYS_HEADLINE"; items[1] = "MENU_ITEM_KEY_WEAPON_LEFT"; items[2] = "MENU_ITEM_KEY_WEAPON_RIGHT"; items[3] = "MENU_ITEM_KEY_WEAPON_PARADE"; items[4] = "MENU_ITEM_KEY_LOCKFOCUS"; items[5] = "MENU_ITEM_KEY_QUICKMANA"; items[6] = "MENU_ITEM_KEY_QUICKHEALTH"; items[7] = "MENU_ITEM_INP_WEAPON_LEFT"; items[8] = "MENU_ITEM_INP_WEAPON_RIGHT"; items[9] = "MENU_ITEM_INP_WEAPON_PARADE"; items[10] = "MENU_ITEM_INP_LOCKFOCUS"; items[11] = "MENU_ITEM_INP_QUICKMANA"; items[12] = "MENU_ITEM_INP_QUICKHEALTH"; items[13] = "MENU_ITEM_CHG_KEYS_SET_DEFAULT"; items[14] = "MENU_ITEM_CHG_KEYS_SET_ALTERNATIVE"; items[15] = "MENUITEM_CHG_KEYS_BACK"; flags = flags | MENU_SHOW_INFO; }; const int CTRL_SP1_1 = 600; const int CTRL_SP1_2 = 3100; const int CTRL_DIMX = 4600; const int CTRL_Y_STEP = 260; const int CTRL_Y_STEP2 = 180; const int CTRL_Y_TITLE = 500; const int CTRL_Y_START = 1020; const int CTRL_GROUP1 = 0; const int CTRL_GROUP2 = 180; const int CTRL_GROUP3 = 360; const int CTRL_GROUP4 = 540; const int CTRL_GROUP5 = 720; const int CTRL_GROUP6 = 900; instance MENU_ITEM_KEY_WEAPON_LEFT(C_MENU_ITEM_DEF) { text[0] = "Levý útok"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 1) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_WEAPON_LEFT"; fontname = MENU_FONT_SMALL; flags = flags; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_KEY_WEAPON_RIGHT(C_MENU_ITEM_DEF) { text[0] = "Pravý útok"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 2) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_WEAPON_RIGHT"; fontname = MENU_FONT_SMALL; flags = flags; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_KEY_WEAPON_PARADE(C_MENU_ITEM_DEF) { text[0] = "Krytí"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 3) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_WEAPON_PARADE"; fontname = MENU_FONT_SMALL; flags = flags; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_INP_WEAPON_LEFT(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 1) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyActionLeft"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_INP_WEAPON_RIGHT(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 2) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyActionRight"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_INP_WEAPON_PARADE(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 3) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyParade"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_KEY_LOCKFOCUS(C_MENU_ITEM_DEF) { text[0] = "Zaměřění cíle"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 4) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_LOCKFOCUS"; fontname = MENU_FONT_SMALL; flags = flags; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; }; instance MENU_ITEM_KEY_QUICKMANA(C_MENU_ITEM_DEF) { text[0] = "Lektvary many"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 5) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_QUICKMANA"; fontname = MENU_FONT_SMALL; flags = flags; hideifoptionsectionset = "GAME"; hideifoptionset = "usePotionKeys"; hideonvalue = 0; }; instance MENU_ITEM_KEY_QUICKHEALTH(C_MENU_ITEM_DEF) { text[0] = "Lektvary života"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 6) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_QUICKHEALTH"; fontname = MENU_FONT_SMALL; flags = flags; hideifoptionsectionset = "GAME"; hideifoptionset = "usePotionKeys"; hideonvalue = 0; }; instance MENU_ITEM_INP_LOCKFOCUS(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 4) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyLockTarget"; onchgsetoptionsection = "KEYS"; hideifoptionsectionset = "GAME"; hideifoptionset = "useGothic1Controls"; hideonvalue = 1; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_QUICKMANA(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 5) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyPotion"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; hideifoptionsectionset = "GAME"; hideifoptionset = "usePotionKeys"; hideonvalue = 0; }; instance MENU_ITEM_INP_QUICKHEALTH(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 6) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyHeal"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; hideifoptionsectionset = "GAME"; hideifoptionset = "usePotionKeys"; hideonvalue = 0; }; instance MENU_ITEM_CHG_KEYS_HEADLINE(C_MENU_ITEM_DEF) { text[0] = "OVLÁDÁNÍ"; type = MENU_ITEM_TEXT; posx = 0; posy = CTRL_Y_TITLE; dimx = 8100; fontname = MENU_FONT_BRIGHT; flags = flags & ~IT_SELECTABLE; flags = flags | IT_TXT_CENTER; }; instance MENU_ITEM_CHG_EXTKEYS_HEADLINE(C_MENU_ITEM_DEF) { text[0] = "ROZŠÍŘENÉ OVLÁDÁNÍ"; type = MENU_ITEM_TEXT; posx = 0; posy = CTRL_Y_TITLE; dimx = 8100; fontname = MENU_FONT_BRIGHT; flags = flags & ~IT_SELECTABLE; flags = flags | IT_TXT_CENTER; }; instance MENU_ITEM_KEY_UP(C_MENU_ITEM_DEF) { text[0] = "Dopředu"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 0) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_UP"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_DOWN(C_MENU_ITEM_DEF) { text[0] = "Dozadu"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 1) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_DOWN"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_LEFT(C_MENU_ITEM_DEF) { text[0] = "Otočit vlevo"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 2) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_LEFT"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_RIGHT(C_MENU_ITEM_DEF) { text[0] = "Otočit vpravo"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 3) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_RIGHT"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_STRAFE_LEFT(C_MENU_ITEM_DEF) { text[0] = "Úkrok vlevo"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 4) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_STRAFE_LEFT"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_STRAFE_RIGHT(C_MENU_ITEM_DEF) { text[0] = "Úkrok vpravo"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 5) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_STRAFE_RIGHT"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_JUMPCLIMBSTRAFE(C_MENU_ITEM_DEF) { text[0] = "Skok"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 6) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_JUMPCLIMBSTRAFE"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_RUNMODETOGGLE(C_MENU_ITEM_DEF) { text[0] = "Pomalá chůze"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 7) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_RUNMODETOGGLE"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_SNEAK(C_MENU_ITEM_DEF) { text[0] = "Plížení"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 8) + CTRL_GROUP1; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_SNEAK"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_ACTION(C_MENU_ITEM_DEF) { text[0] = "Akce"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 9) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_ACTION"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_WEAPON(C_MENU_ITEM_DEF) { text[0] = "Tasení zbraně"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 10) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_WEAPON"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_MAP(C_MENU_ITEM_DEF) { text[0] = "Mapa"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 11) + CTRL_GROUP2; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_MAP"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_LOOK(C_MENU_ITEM_DEF) { text[0] = "Rozhlížení"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 14) + CTRL_GROUP3; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_LOOK"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_LOOK_FP(C_MENU_ITEM_DEF) { text[0] = "Pohled z 1. osoby"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 15) + CTRL_GROUP3; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_LOOK_FP"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_INVENTORY(C_MENU_ITEM_DEF) { text[0] = "Inventář"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 16) + CTRL_GROUP4; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_INVENTORY"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_SCREEN_STATUS(C_MENU_ITEM_DEF) { text[0] = "Statistiky"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 17) + CTRL_GROUP4; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_SCREEN_STATUS"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_KEY_SCREEN_LOG(C_MENU_ITEM_DEF) { text[0] = "Úkoly/záznamy"; text[1] = "kláv. DEL uvolníš a pomocí ENTER znovu nadefinuješ"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 18) + CTRL_GROUP4; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "RUN MENU_ITEM_INP_SCREEN_LOG"; fontname = MENU_FONT_SMALL; flags = flags; }; instance MENU_ITEM_INP_UP(C_MENU_ITEM_DEF) { backPic = MENU_KBDINPUT_BACK_PIC; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; type = MENU_ITEM_INPUT; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 0) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; onchgsetoption = "keyUp"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_DOWN(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 1) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyDown"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_LEFT(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 2) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyLeft"; onchgsetoptionsection = "KEYS"; flags = IT_CHROMAKEYED | IT_TRANSPARENT; }; instance MENU_ITEM_INP_RIGHT(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 3) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyRight"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_STRAFE_LEFT(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 4) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyStrafeLeft"; onchgsetoptionsection = "KEYS"; flags = IT_CHROMAKEYED | IT_TRANSPARENT; }; instance MENU_ITEM_INP_STRAFE_RIGHT(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 5) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyStrafeRight"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_JUMPCLIMBSTRAFE(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 6) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keySMove"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_RUNMODETOGGLE(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 7) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keySlow"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_SNEAK(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 8) + CTRL_GROUP1; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keySneak"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_ACTION(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 9) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyAction"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_WEAPON(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 10) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyWeapon"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_MAP(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 11) + CTRL_GROUP2; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyShowMap"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_LOOK(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 14) + CTRL_GROUP3; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyLook"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_LOOK_FP(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 15) + CTRL_GROUP3; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyLookFP"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_INVENTORY(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 16) + CTRL_GROUP4; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyInventory"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_SCREEN_STATUS(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 17) + CTRL_GROUP4; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyShowStatus"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_INP_SCREEN_LOG(C_MENU_ITEM_DEF) { type = MENU_ITEM_INPUT; text[1] = "Stiskni klávesu, kterou chceš této akci přiřadit"; posx = CTRL_SP1_2; posy = CTRL_Y_START + (CTRL_Y_STEP * 18) + CTRL_GROUP4; dimx = CTRL_DIMX; dimy = 300; fontname = MENU_FONT_SMALL; backPic = MENU_KBDINPUT_BACK_PIC; onchgsetoption = "keyShowLog"; onchgsetoptionsection = "KEYS"; flags = flags & ~IT_SELECTABLE; }; instance MENU_ITEM_CHG_KEYS_SET_DEFAULT(C_MENU_ITEM_DEF) { text[0] = "Implicitní nastavení"; text[1] = "Nastavit ovládání zpět na implicitní"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 19) + CTRL_GROUP5; dimy = 300; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "SETDEFAULT"; fontname = MENU_FONT_SMALL; flags = flags | IT_TXT_CENTER; }; instance MENU_ITEM_CHG_KEYS_SET_ALTERNATIVE(C_MENU_ITEM_DEF) { text[0] = "Alternativní nastavení"; text[1] = "Nastavit ovládání na alternativní"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 20) + CTRL_GROUP5; dimy = 300; onselaction[0] = SEL_ACTION_EXECCOMMANDS; onselaction_s[0] = "SETALTERNATIVE"; fontname = MENU_FONT_SMALL; flags = flags | IT_TXT_CENTER; }; instance MENUITEM_CHG_KEYS_BACK(C_MENU_ITEM_DEF) { backPic = MENU_ITEM_BACK_PIC; text[0] = "Zpět"; posx = CTRL_SP1_1; posy = CTRL_Y_START + (CTRL_Y_STEP * 21) + CTRL_GROUP6; dimy = 300; fontname = MENU_FONT_SMALL; onselaction[0] = SEL_ACTION_BACK; flags = flags | IT_TXT_CENTER; };
D
module GameResources;
D
module mecca.reactor.impl.fibril; // Licensed under the Boost license. Full copyright information in the AUTHORS file import mecca.lib.exception; import mecca.log; // Disable tracing instrumentation for the whole file @("notrace") void traceDisableCompileTimeInstrumentation(); version (D_InlineAsm_X86_64) version (Posix) { private pure nothrow @trusted @nogc: void* _fibril_init_stack(void[] stackArea, void function(void*) nothrow fn, void* opaque) { // set rsp to top of stack, and make sure it's 16-byte aligned auto rsp = cast(void*)((((cast(size_t)stackArea.ptr) + stackArea.length) >> 4) << 4); auto rbp = rsp; void push(void* v) nothrow pure @nogc { rsp -= v.sizeof; *(cast(void**)rsp) = v; } push(null); // Fake RET of entrypoint push(&_fibril_trampoline); // RIP push(rbp); // RBP push(null); // RBX push(null); // R12 push(null); // R13 push(fn); // R14 push(opaque); // R15 return rsp; } extern(C) void _fibril_trampoline() nothrow { pragma(inline, false); asm pure nothrow @nogc { naked; mov RDI, R14; // fn mov RSI, R15; // opaque // this has to be a jmp (not a call), otherwise exception-handling will see // this function in the stack and be... unhappy jmp _fibril_wrapper; } } extern(C) void _fibril_switch(void** fromRSP /* RDI */, void* toRSP /* RSI */, void** rspForGc /* RDX */) { pragma(inline, false); asm pure nothrow @nogc { naked; // save current state, then store RSP into `fromRSP` // RET is already pushed at TOS push RBP; push RBX; push R12; push R13; push R14; push R15; mov [RDI], RSP; mov [RDX], RSP; // set RSP to `toRSP` and load state // and return to caller (RET is at TOS) mov RSP, RSI; pop R15; pop R14; pop R13; pop R12; pop RBX; pop RBP; ret; } } } extern(C) private void _fibril_wrapper(void function(void*) fn /* RDI */, void* opaque /* RSI */) { import core.stdc.stdlib: abort; void writeErr(const(char[]) text) { import core.sys.posix.unistd: write; // Write error directly to stderr write(2, text.ptr, text.length); } try { fn(opaque); DIE("Fibril functio must never return", __FILE_FULL_PATH__, __LINE__, true); } catch (Throwable ex) { LOG_EXCEPTION(ex); DIE("Fibril functio must never throw", __FILE_FULL_PATH__, __LINE__, true); } // we add an extra call to abort here, so the compiler would be forced to emit `call` instead of `jmp` // above, thus leaving this function on the call stack. it produces a more readable backtrace. abort(); } struct Fibril { void* rsp; void reset() nothrow @nogc { rsp = null; } void set(void[] stackArea, void function(void*) nothrow fn, void* opaque) nothrow @nogc { assert (rsp is null, "already set"); rsp = _fibril_init_stack(stackArea, fn, opaque); } void set(void[] stackArea, void delegate() nothrow dg) nothrow @nogc { set(stackArea, cast(void function(void*) nothrow)dg.funcptr, dg.ptr); } void switchTo(ref Fibril next, void** rspForGc) nothrow @trusted @nogc { pragma(inline, true); _fibril_switch(&this.rsp, next.rsp, rspForGc); } } unittest { import std.stdio; import std.range; ubyte[4096] stack1; ubyte[4096] stack2; Fibril mainFib, fib1, fib2; void* mainGcRsp, fib1GcRsp, fib2GcRsp; char[] order; void func1() nothrow { while (true) { order ~= '1'; //try{writefln("in fib1");} catch(Throwable){} fib1.switchTo(fib2, &fib1GcRsp); } } void func2() nothrow { while (true) { order ~= '2'; //try{writefln("in fib2");} catch(Throwable){} fib2.switchTo(mainFib, &fib2GcRsp); } } fib1.set(stack1, &func1); fib2.set(stack2, &func2); enum ITERS = 10; order.reserve(ITERS * 3); foreach(_; 0 .. ITERS) { order ~= 'M'; //try{writefln("in main");} catch(Throwable){} mainFib.switchTo(fib1, &mainGcRsp); } assert (order == "M12".repeat(ITERS).join(""), order); } unittest { import std.stdio; ubyte[4096] stack1; ubyte[4096] stack2; Fibril mainFib, fib1, fib2; void* mainGcRsp, fib1GcRsp, fib2GcRsp; size_t counter; void func1() nothrow { while (true) { counter++; fib1.switchTo(fib2, &fib1GcRsp); } } void func2() nothrow { while (true) { fib2.switchTo(mainFib, &fib2GcRsp); } } fib1.set(stack1, &func1); fib2.set(stack2, &func2); enum ITERS = 10_000_000; import mecca.lib.time: TscTimePoint; auto t0 = TscTimePoint.hardNow; foreach(_; 0 .. ITERS) { mainFib.switchTo(fib1, &mainGcRsp); } auto dt = TscTimePoint.hardNow.diff!"cycles"(t0); assert (counter == ITERS); writefln("total %s cycles, per iteration %s", dt, dt / (ITERS * 3.0)); }
D
module glfw3; enum { GLFW_VERSION_MAJOR = 3, GLFW_VERSION_MINOR = 0, GLFW_VERSION_REVISION = 0 } enum { GLFW_RELEASE = 0, GLFW_PRESS = 1, GLFW_REPEAT = 2, } enum { GLFW_KEY_UNKNOWN = -1, GLFW_KEY_SPACE = 32, GLFW_KEY_APOSTROPHE = 39, GLFW_KEY_COMMA = 44, GLFW_KEY_MINUS = 45, GLFW_KEY_PERIOD = 46, GLFW_KEY_SLASH = 47, GLFW_KEY_0 = 48, GLFW_KEY_1 = 49, GLFW_KEY_2 = 50, GLFW_KEY_3 = 51, GLFW_KEY_4 = 52, GLFW_KEY_5 = 53, GLFW_KEY_6 = 54, GLFW_KEY_7 = 55, GLFW_KEY_8 = 56, GLFW_KEY_9 = 57, GLFW_KEY_SEMICOLON = 59, GLFW_KEY_EQUAL = 61, GLFW_KEY_A = 65, GLFW_KEY_B = 66, GLFW_KEY_C = 67, GLFW_KEY_D = 68, GLFW_KEY_E = 69, GLFW_KEY_F = 70, GLFW_KEY_G = 71, GLFW_KEY_H = 72, GLFW_KEY_I = 73, GLFW_KEY_J = 74, GLFW_KEY_K = 75, GLFW_KEY_L = 76, GLFW_KEY_M = 77, GLFW_KEY_N = 78, GLFW_KEY_O = 79, GLFW_KEY_P = 80, GLFW_KEY_Q = 81, GLFW_KEY_R = 82, GLFW_KEY_S = 83, GLFW_KEY_T = 84, GLFW_KEY_U = 85, GLFW_KEY_V = 86, GLFW_KEY_W = 87, GLFW_KEY_X = 88, GLFW_KEY_Y = 89, GLFW_KEY_Z = 90, GLFW_KEY_LEFT_BRACKET = 91, GLFW_KEY_BACKSLASH = 92, GLFW_KEY_RIGHT_BRACKET = 93, GLFW_KEY_GRAVE_ACCENT = 96, GLFW_KEY_WORLD_1 = 161, GLFW_KEY_WORLD_2 = 162, GLFW_KEY_ESCAPE = 256, GLFW_KEY_ENTER = 257, GLFW_KEY_TAB = 258, GLFW_KEY_BACKSPACE = 259, GLFW_KEY_INSERT = 260, GLFW_KEY_DELETE = 261, GLFW_KEY_RIGHT = 262, GLFW_KEY_LEFT = 263, GLFW_KEY_DOWN = 264, GLFW_KEY_UP = 265, GLFW_KEY_PAGE_UP = 266, GLFW_KEY_PAGE_DOWN = 267, GLFW_KEY_HOME = 268, GLFW_KEY_END = 269, GLFW_KEY_CAPS_LOCK = 280, GLFW_KEY_SCROLL_LOCK = 281, GLFW_KEY_NUM_LOCK = 282, GLFW_KEY_PRINT_SCREEN = 283, GLFW_KEY_PAUSE = 284, GLFW_KEY_F1 = 290, GLFW_KEY_F2 = 291, GLFW_KEY_F3 = 292, GLFW_KEY_F4 = 293, GLFW_KEY_F5 = 294, GLFW_KEY_F6 = 295, GLFW_KEY_F7 = 296, GLFW_KEY_F8 = 297, GLFW_KEY_F9 = 298, GLFW_KEY_F10 = 299, GLFW_KEY_F11 = 300, GLFW_KEY_F12 = 301, GLFW_KEY_F13 = 302, GLFW_KEY_F14 = 303, GLFW_KEY_F15 = 304, GLFW_KEY_F16 = 305, GLFW_KEY_F17 = 306, GLFW_KEY_F18 = 307, GLFW_KEY_F19 = 308, GLFW_KEY_F20 = 309, GLFW_KEY_F21 = 310, GLFW_KEY_F22 = 311, GLFW_KEY_F23 = 312, GLFW_KEY_F24 = 313, GLFW_KEY_F25 = 314, GLFW_KEY_KP_0 = 320, GLFW_KEY_KP_1 = 321, GLFW_KEY_KP_2 = 322, GLFW_KEY_KP_3 = 323, GLFW_KEY_KP_4 = 324, GLFW_KEY_KP_5 = 325, GLFW_KEY_KP_6 = 326, GLFW_KEY_KP_7 = 327, GLFW_KEY_KP_8 = 328, GLFW_KEY_KP_9 = 329, GLFW_KEY_KP_DECIMAL = 330, GLFW_KEY_KP_DIVIDE = 331, GLFW_KEY_KP_MULTIPLY = 332, GLFW_KEY_KP_SUBTRACT = 333, GLFW_KEY_KP_ADD = 334, GLFW_KEY_KP_ENTER = 335, GLFW_KEY_KP_EQUAL = 336, GLFW_KEY_LEFT_SHIFT = 340, GLFW_KEY_LEFT_CONTROL = 341, GLFW_KEY_LEFT_ALT = 342, GLFW_KEY_LEFT_SUPER = 343, GLFW_KEY_RIGHT_SHIFT = 344, GLFW_KEY_RIGHT_CONTROL = 345, GLFW_KEY_RIGHT_ALT = 346, GLFW_KEY_RIGHT_SUPER = 347, GLFW_KEY_MENU = 348, GLFW_KEY_LAST = GLFW_KEY_MENU, GLFW_KEY_ESC = GLFW_KEY_ESCAPE, GLFW_KEY_DEL = GLFW_KEY_DELETE, GLFW_KEY_PAGEUP = GLFW_KEY_PAGE_UP, GLFW_KEY_PAGEDOWN = GLFW_KEY_PAGE_DOWN, GLFW_KEY_KP_NUM_LOCK = GLFW_KEY_NUM_LOCK, GLFW_KEY_LCTRL = GLFW_KEY_LEFT_CONTROL, GLFW_KEY_LSHIFT = GLFW_KEY_LEFT_SHIFT, GLFW_KEY_LALT = GLFW_KEY_LEFT_ALT, GLFW_KEY_LSUPER = GLFW_KEY_LEFT_SUPER, GLFW_KEY_RCTRL = GLFW_KEY_RIGHT_CONTROL, GLFW_KEY_RSHIFT = GLFW_KEY_RIGHT_SHIFT, GLFW_KEY_RALT = GLFW_KEY_RIGHT_ALT, GLFW_KEY_RSUPER = GLFW_KEY_RIGHT_SUPER, GLFW_MOD_SHIFT = 0x0001, GLFW_MOD_CONTROL = 0x0002, GLFW_MOD_ALT = 0x0004, GLFW_MOD_SUPER = 0x0008, GLFW_MOUSE_BUTTON_1 = 0, GLFW_MOUSE_BUTTON_2 = 1, GLFW_MOUSE_BUTTON_3 = 2, GLFW_MOUSE_BUTTON_4 = 3, GLFW_MOUSE_BUTTON_5 = 4, GLFW_MOUSE_BUTTON_6 = 5, GLFW_MOUSE_BUTTON_7 = 6, GLFW_MOUSE_BUTTON_8 = 7, GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8, GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1, GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2, GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3, GLFW_JOYSTICK_1 = 0, GLFW_JOYSTICK_2 = 1, GLFW_JOYSTICK_3 = 2, GLFW_JOYSTICK_4 = 3, GLFW_JOYSTICK_5 = 4, GLFW_JOYSTICK_6 = 5, GLFW_JOYSTICK_7 = 6, GLFW_JOYSTICK_8 = 7, GLFW_JOYSTICK_9 = 8, GLFW_JOYSTICK_10 = 9, GLFW_JOYSTICK_11 = 10, GLFW_JOYSTICK_12 = 11, GLFW_JOYSTICK_13 = 12, GLFW_JOYSTICK_14 = 13, GLFW_JOYSTICK_15 = 14, GLFW_JOYSTICK_16 = 15, GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16, } enum { GLFW_NOT_INITIALIZED = 0x00010001, GLFW_NO_CURRENT_CONTEXT = 0x00010002, GLFW_INVALID_ENUM = 0x00010003, GLFW_INVALID_VALUE = 0x00010004, GLFW_OUT_OF_MEMORY = 0x00010005, GLFW_API_UNAVAILABLE = 0x00010006, GLFW_VERSION_UNAVAILABLE = 0x00010007, GLFW_PLATFORM_ERROR = 0x00010008, GLFW_FORMAT_UNAVAILABLE = 0x00010009, GLFW_FOCUSED = 0x00020001, GLFW_ICONIFIED = 0x00020002, GLFW_RESIZABLE = 0x00020003, GLFW_VISIBLE = 0x00020004, GLFW_DECORATED = 0x00020005, GLFW_RED_BITS = 0x00021001, GLFW_GREEN_BITS = 0x00021002, GLFW_BLUE_BITS = 0x00021003, GLFW_ALPHA_BITS = 0x00021004, GLFW_DEPTH_BITS = 0x00021005, GLFW_STENCIL_BITS = 0x00021006, GLFW_ACCUM_RED_BITS = 0x00021007, GLFW_ACCUM_GREEN_BITS = 0x00021008, GLFW_ACCUM_BLUE_BITS = 0x00021009, GLFW_ACCUM_ALPHA_BITS = 0x0002100A, GLFW_AUX_BUFFERS = 0x0002100B, GLFW_STEREO = 0x0002100C, GLFW_SAMPLES = 0x0002100D, GLFW_SRGB_CAPABLE = 0x0002100E, GLFW_REFRESH_RATE = 0x0002100F, GLFW_CLIENT_API = 0x00022001, GLFW_CONTEXT_VERSION_MAJOR = 0x00022002, GLFW_CONTEXT_VERSION_MINOR = 0x00022003, GLFW_CONTEXT_REVISION = 0x00022004, GLFW_CONTEXT_ROBUSTNESS = 0x00022005, GLFW_OPENGL_FORWARD_COMPAT = 0x00022006, GLFW_OPENGL_DEBUG_CONTEXT = 0x00022007, GLFW_OPENGL_PROFILE = 0x00022008, GLFW_OPENGL_API = 0x00030001, GLFW_OPENGL_ES_API = 0x00030002, GLFW_NO_ROBUSTNESS = 0, GLFW_NO_RESET_NOTIFICATION = 0x00031001, GLFW_LOSE_CONTEXT_ON_RESET = 0x00031002, GLFW_OPENGL_NO_PROFILE = 0, GLFW_OPENGL_CORE_PROFILE = 0x00032001, GLFW_OPENGL_COMPAT_PROFILE = 0x00032002, GLFW_CURSOR = 0x00033001, GLFW_STICKY_KEYS = 0x00033002, GLFW_STICKY_MOUSE_BUTTONS = 0x00033003, GLFW_CURSOR_NORMAL = 0x00034001, GLFW_CURSOR_HIDDEN = 0x00034002, GLFW_CURSOR_DISABLED = 0x00034003, GLFW_CONNECTED = 0x00040001, GLFW_DISCONNECTED = 0x00040002, } extern( C ) @nogc nothrow alias void function() GLFWglproc; struct GLFWmonitor; struct GLFWwindow; extern( C ) nothrow { alias GLFWerrorfun = void function( int, const( char )* ); alias GLFWwindowposfun = void function( GLFWwindow*, int, int ); alias GLFWwindowsizefun = void function( GLFWwindow*, int, int ); alias GLFWwindowclosefun = void function( GLFWwindow* ); alias GLFWwindowrefreshfun = void function( GLFWwindow* ); alias GLFWwindowfocusfun = void function( GLFWwindow*, int ); alias GLFWwindowiconifyfun = void function( GLFWwindow*, int ); alias GLFWframebuffersizefun = void function( GLFWwindow*, int, int ); alias GLFWmousebuttonfun = void function( GLFWwindow*, int, int, int ); alias GLFWcursorposfun = void function( GLFWwindow*, double, double ); alias GLFWcursorenterfun = void function( GLFWwindow*, int ); alias GLFWscrollfun = void function( GLFWwindow*, double, double ); alias GLFWkeyfun = void function( GLFWwindow*, int, int, int, int ); alias GLFWcharfun = void function( GLFWwindow*, uint ); alias GLFWmonitorfun = void function( GLFWmonitor*, int ); } struct GLFWvidmode { int width; int height; int redBits; int greenBits; int blueBits; int refreshRate; } struct GLFWgammaramp { ushort* red; ushort* green; ushort* blue; uint size; } extern( C ) @nogc nothrow { alias glfwInit = int function(); alias glfwTerminate = void function(); alias glfwGetVersion = void function( int*, int*, int* ); alias glfwGetVersionString = const( char )* function(); alias glfwSetErrorCallback = GLFWerrorfun function( GLFWerrorfun ); alias glfwGetMonitors = GLFWmonitor** function( int* ); alias glfwGetPrimaryMonitor = GLFWmonitor* function(); alias glfwGetMonitorPos = void function( GLFWmonitor*, int*, int* ); alias glfwGetMonitorPhysicalSize = void function( GLFWmonitor*, int*, int* ); alias glfwGetMonitorName = const( char )* function( GLFWmonitor* ); alias glfwSetMonitorCallback = GLFWmonitorfun function( GLFWmonitorfun ); alias glfwGetVideoModes = const( GLFWvidmode )* function( GLFWmonitor*, int* ); alias glfwGetVideoMode = const( GLFWvidmode )* function( GLFWmonitor* ); alias glfwSetGamma = void function( GLFWmonitor*,float ); alias glfwGetGammaRamp = const( GLFWgammaramp* ) function( GLFWmonitor* ); alias glfwSetGammaRamp = void function( GLFWmonitor*,const( GLFWgammaramp )* ); alias glfwDefaultWindowHints = void function(); alias glfwWindowHint = void function( int, int ); alias glfwCreateWindow = GLFWwindow* function( int, int, const( char )*, GLFWmonitor*, GLFWwindow* ); alias glfwDestroyWindow = void function( GLFWwindow* ); alias glfwWindowShouldClose = int function( GLFWwindow* ); alias glfwSetWindowShouldClose = void function( GLFWwindow*, int ); alias glfwSetWindowTitle = void function( GLFWwindow*, const( char )* ); alias glfwGetWindowPos = void function( GLFWwindow*, int*, int* ); alias glfwSetWindowPos = void function( GLFWwindow*, int, int ); alias glfwGetWindowSize = void function( GLFWwindow*, int*, int* ); alias glfwSetWindowSize = void function( GLFWwindow*, int, int ); alias glfwGetFramebufferSize = void function( GLFWwindow*, int*, int* ); alias glfwIconifyWindow = void function( GLFWwindow* ); alias glfwRestoreWindow = void function( GLFWwindow* ); alias glfwShowWindow = void function( GLFWwindow* ); // alias glfwHideWindow = void function( GLFWwindow* ); void glfwHideWindow( GLFWwindow* ); alias glfwGetWindowMonitor = GLFWmonitor* function( GLFWwindow* ); alias glfwGetWindowAttrib = int function( GLFWwindow*, int ); alias glfwSetWindowUserPointer = void function( GLFWwindow*, void* ); alias glfwGetWindowUserPointer = void* function( GLFWwindow* ); alias glfwSetWindowPosCallback = GLFWwindowposfun function( GLFWwindow*, GLFWwindowposfun ); alias glfwSetWindowSizeCallback = GLFWwindowsizefun function( GLFWwindow*, GLFWwindowsizefun ); alias glfwSetWindowCloseCallback = GLFWwindowclosefun function( GLFWwindow*, GLFWwindowclosefun ); alias glfwSetWindowRefreshCallback = GLFWwindowrefreshfun function( GLFWwindow*, GLFWwindowrefreshfun ); alias glfwSetWindowFocusCallback = GLFWwindowfocusfun function( GLFWwindow*, GLFWwindowfocusfun ); alias glfwSetWindowIconifyCallback = GLFWwindowiconifyfun function( GLFWwindow*, GLFWwindowiconifyfun ); alias glfwSetFramebufferSizeCallback = GLFWframebuffersizefun function( GLFWwindow*, GLFWframebuffersizefun ); alias glfwPollEvents = void function(); alias glfwWaitEvents = void function(); alias glfwGetInputMode = int function( GLFWwindow*, int ); alias glfwSetInputMode = void function( GLFWwindow*, int, int ); alias glfwGetKey = int function( GLFWwindow*, int ); alias glfwGetMouseButton = int function( GLFWwindow*, int ); alias glfwGetCursorPos = void function( GLFWwindow*, double*, double* ); alias glfwSetCursorPos = void function( GLFWwindow*, double, double ); alias glfwSetKeyCallback = GLFWkeyfun function( GLFWwindow*, GLFWkeyfun ); alias glfwSetCharCallback = GLFWcharfun function( GLFWwindow*, GLFWcharfun ); alias glfwSetMouseButtonCallback = GLFWmousebuttonfun function( GLFWwindow*, GLFWmousebuttonfun ); alias glfwSetCursorPosCallback = GLFWcursorposfun function( GLFWwindow*, GLFWcursorposfun ); alias glfwSetCursorEnterCallback = GLFWcursorenterfun function( GLFWwindow*, GLFWcursorenterfun ); alias glfwSetScrollCallback = GLFWscrollfun function( GLFWwindow*, GLFWscrollfun ); alias glfwJoystickPresent = int function( int ); alias glfwGetJoystickAxes = float* function( int, int* ); alias glfwGetJoystickButtons = ubyte* function( int, int* ); alias glfwGetJoystickName = const( char )* function( int ); alias glfwSetClipboardString = void function( GLFWwindow*, const( char )* ); alias glfwGetClipboardString = const( char )* function( GLFWwindow* ); alias glfwGetTime = double function(); alias glfwSetTime = void function( double ); alias glfwMakeContextCurrent = void function( GLFWwindow* ); alias glfwGetCurrentContext = GLFWwindow* function(); alias glfwSwapBuffers = void function( GLFWwindow* ); alias glfwSwapInterval = void function( int ); alias glfwExtensionSupported = int function( const( char )* ); alias glfwGetProcAddress = GLFWglproc function( const( char )* ); }
D
module hip.api.assets.globals; public import hip.api.data.font; public import hip.api.renderer.texture; version(Have_hipreme_engine) version = DirectCall; version(DirectCall){} else { void initGlobalAssets() { import hip.api.internal; loadClassFunctionPointers!HipGlobalAssetsBinding; import hip.api.console; log("HipEngineAPI: Initialized Global Assets"); } class HipGlobalAssetsBinding { extern(System) __gshared { const(IHipFont) function() getDefaultFont; IHipFont function(uint size) getDefaultFontWithSize; const(IHipTexture) function() getDefaultTexture; } } import hip.api.internal; mixin ExpandClassFunctionPointers!HipGlobalAssetsBinding; }
D
sram.o: C:/Users/stero/Documents/GitHub/Chirpys-Adventure/source/sram.c
D
/***********************************\ READ-ONLY \***********************************/ // Folgende Konstanten dürfen NICHT verändert, nur verwendet werden. //======================================== // Anim8 //======================================== // Bewegungsformen const int A8_Constant = 1; const int A8_SlowEnd = 2; const int A8_SlowStart = 3; const int A8_Wait = 4; //======================================== // Buttons //======================================== const int BUTTON_ACTIVE = 1; const int BUTTON_ENTERED = 2; //======================================== // Aligns (benutzt in View) //======================================== const int ALIGN_CENTER = 0; const int ALIGN_LEFT = 1; const int ALIGN_RIGHT = 2; const int ALIGN_TOP = 3; const int ALIGN_BOTTOM = 4; //======================================== // Interface //======================================== // R G B A R G B const int COL_Aqua = (255<<8) | (255<<0) | (255<<24); //#00FFFF const int COL_Black = (255<<24); //#000000 const int COL_Blue = (255<<0) | (255<<24); //#0000FF const int COL_Fuchsia = (255<<16) | (255<<0) | (255<<24); //#FF00FF const int COL_Gray = (128<<16) | (128<<8) | (128<<0) | (255<<24); //#808080 const int COL_Green = (128<<8) | (255<<24); //#008000 const int COL_Lime = (255<<8) | (255<<24); //#00FF00 const int COL_Maroon = (128<<16) | (255<<24); //#800000 const int COL_Navy = (128<<0) | (255<<24); //#000080 const int COL_Olive = (128<<16) | (128<<8) | (255<<24); //#808000 const int COL_Purple = (128<<16) | (128<<0) | (255<<24); //#800080 const int COL_Red = (255<<16) | (255<<24); //#FF0000 const int COL_Silver = (192<<16) | (192<<8) | (192<<0) | (255<<24); //#C0C0C0 const int COL_Teal = (128<<8) | (128<<0) | (255<<24); //#008080 const int COL_White = (255<<16) | (255<<8) | (255<<0) | (255<<24); //#FFFFFF const int COL_Yellow = (255<<16) | (255<<8) | (255<<24); //#FFFF00 const int PS_X = 0; const int PS_Y = 1; const int PS_VMax = 8192; //======================================== // Gamestate //======================================== const int Gamestate_NewGame = 0; const int Gamestate_Loaded = 1; const int Gamestate_WorldChange = 2; const int Gamestate_Saving = 3; //======================================== // Cursor //======================================== const int CUR_LeftClick = 0; const int CUR_RightClick = 1; const int CUR_MidClick = 2; const int CUR_WheelUp = 3; const int CUR_WheelDown = 4; /***********************************\ MODIFY \***********************************/ // Folgende Konstanten dienen nicht als Parameter sondern als Vorgaben. // Sie dürfen frei verändert werden. //======================================== // Bloodsplats //======================================== const int BLOODSPLAT_NUM = 15; // Maximale Anzahl auf dem Screen const int BLOODSPLAT_TEX = 6; // Maximale Anzahl an Texturen ( "BLOODSPLAT" + texID + ".TGA" ) const int BLOODSPLAT_DAM = 7; // Schadensmultiplikator bzgl. der Texturgröße ( damage * 2^BLOODSPLAT_DAM ) //======================================== // Cursor //======================================== const string Cursor_Texture = "CURSOR.TGA"; // Genutzte Textur, LeGo stellt eine "CURSOR.TGA" bereit //======================================== // Interface //======================================== const string Print_LineSeperator = "~"; // Sollte man lieber nicht ändern /* ==== PrintS ==== */ // <<Virtuelle Positionen>> const int PF_PrintX = 200; // Startposition X const int PF_PrintY = 5000; // Startposition Y const int PF_TextHeight = 170; // Abstand zwischen einzelnen Zeilen // <<Milisekunden>> const int PF_FadeInTime = 300; // Zeit zum einblenden der Textzeilen const int PF_FadeOutTime = 1000; // Zeit zum ausblenden der Textzeilen const int PF_MoveYTime = 300; // Zeit zum verschieben einer Zeile const int PF_WaitTime = 3000; // Zeit die gewartet wird, bis wieder ausgeblendet wird const string PF_Font = "FONT_OLD_10_WHITE.TGA"; //Verwendete Schriftart //======================================== // Talents //======================================== const int AIV_TALENT = AIV_TALENT_INDEX; // Genutzte AI-Var //======================================== // Dialoggestures //======================================== // Die abgespielte Animation kann so beschrieben werden: // DIAG_Prefix + AniName + DIAG_Suffix + ((rand() % (Max - (Min - 1))) + Min).ToString("00"); const string DIAG_Prefix = "DG_"; const string DIAG_Suffix = "_";
D
ext_svr.o: C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/ext_svr.c \ C:/Users/Eren/Desktop/ders/arduinomega2560_servocontrol_sweep_ert_rtw/rtwtypes.h \ C:/Users/Eren/Desktop/ders/arduinomega2560_servocontrol_sweep_ert_rtw/multiword_types.h \ C:/Users/Eren/Desktop/ders/arduinomega2560_servocontrol_sweep_ert_rtw/rtwtypes.h \ C:/PROGRA~1/MATLAB/R2015b/simulink/include/rtw_extmode.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/ext_types.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/ext_share.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/ext_test.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/ext_svr_transport.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/updown.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/upsup_public.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/ext_mode/common/updown_util.h \ C:/PROGRA~1/MATLAB/R2015b/rtw/c/src/dt_info.h
D
the state of being absent failure to be present the time interval during which something or somebody is away the occurrence of an abrupt, transient loss or impairment of consciousness (which is not subsequently remembered), sometimes with light twitching, fluttering eyelids, etc.
D
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range; void get(Args...)(ref Args args) { import std.traits, std.meta, std.typecons; static if (Args.length == 1) { alias Arg = Args[0]; static if (isArray!Arg) { static if (isSomeChar!(ElementType!Arg)) { args[0] = readln.chomp.to!Arg; } else { args[0] = readln.split.to!Arg; } } else static if (isTuple!Arg) { auto input = readln.split; static foreach (i; 0..Fields!Arg.length) { args[0][i] = input[i].to!(Fields!Arg[i]); } } else { args[0] = readln.chomp.to!Arg; } } else { auto input = readln.split; assert(input.length == Args.length); static foreach (i; 0..Args.length) { args[i] = input[i].to!(Args[i]); } } } void get_lines(Args...)(size_t N, ref Args args) { import std.traits, std.range; static foreach (i; 0..Args.length) { static assert(isArray!(Args[i])); args[i].length = N; } foreach (i; 0..N) { static if (Args.length == 1) { get(args[0][i]); } else { auto input = readln.split; static foreach (j; 0..Args.length) { args[j][i] = input[j].to!(ElementType!(Args[j])); } } } } void main() { int N; get(N); int[] AS; get(AS); int r, x; foreach (i; 2..1001) { int rr; foreach (a; AS) if (a%i == 0) ++rr; if (rr > r) { x = i; r = rr; } } writeln(x); }
D
module mruby.data; extern (C): import mruby; import mruby.mrb_class; import mruby.object; import mruby.variable; import mruby.value; struct mrb_data_type { const(char)* struct_name; void function (mrb_state*, void*) dfree; } struct RData { enum mrb_vtype { MRB_TT_FALSE = 0, MRB_TT_FREE = 1, MRB_TT_TRUE = 2, MRB_TT_FIXNUM = 3, MRB_TT_SYMBOL = 4, MRB_TT_UNDEF = 5, MRB_TT_FLOAT = 6, MRB_TT_CPTR = 7, MRB_TT_OBJECT = 8, MRB_TT_CLASS = 9, MRB_TT_MODULE = 10, MRB_TT_ICLASS = 11, MRB_TT_SCLASS = 12, MRB_TT_PROC = 13, MRB_TT_ARRAY = 14, MRB_TT_HASH = 15, MRB_TT_STRING = 16, MRB_TT_RANGE = 17, MRB_TT_EXCEPTION = 18, MRB_TT_FILE = 19, MRB_TT_ENV = 20, MRB_TT_DATA = 21, MRB_TT_FIBER = 22, MRB_TT_MAXDEFINE = 23 } mrb_vtype tt; uint color; uint flags; RClass* c; RBasic* gcnext; iv_tbl* iv; const(mrb_data_type)* type; void* data; } RData* mrb_data_object_alloc (mrb_state* mrb, RClass* klass, void* datap, const(mrb_data_type)* type); void mrb_data_check_type (mrb_state* mrb, mrb_value, const(mrb_data_type)*); void* mrb_data_get_ptr (mrb_state* mrb, mrb_value, const(mrb_data_type)*); void* mrb_data_check_get_ptr (mrb_state* mrb, mrb_value, const(mrb_data_type)*); void mrb_data_init (mrb_value v, void* ptr, const(mrb_data_type)* type);
D
//---------------------------------------------------------------------- // Copyright 2007-2011 Mentor Graphics Corporation // Copyright 2007-2009 Cadence Design Systems, Inc. // Copyright 2010 Synopsys, Inc. // Copyright 2014 Coverify Systems Technology // All Rights Reserved Worldwide // // 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. //---------------------------------------------------------------------- // `ifndef UVM_HEARTBEAT_SVH // `define UVM_HEARTBEAT_SVH module uvm.base.uvm_heartbeat; import uvm.base.uvm_root; import uvm.base.uvm_object; import uvm.base.uvm_object_globals; import uvm.base.uvm_component; import uvm.base.uvm_callback; import uvm.base.uvm_event; import uvm.base.uvm_objection; import esdl.base.core; import esdl.base.time; import uvm.meta.misc; enum uvm_heartbeat_modes { UVM_ALL_ACTIVE, UVM_ONE_ACTIVE, UVM_ANY_ACTIVE, UVM_NO_HB_MODE } mixin(declareEnums!uvm_heartbeat_modes()); // typedef class uvm_heartbeat_callback; alias uvm_callbacks!(uvm_callbacks_objection, uvm_heartbeat_callback) uvm_heartbeat_cbs_t; //------------------------------------------------------------------------------ // // Class: uvm_heartbeat // //------------------------------------------------------------------------------ // Heartbeats provide a way for environments to easily ensure that their // descendants are alive. A uvm_heartbeat is associated with a specific // objection object. A component that is being tracked by the heartbeat // object must raise (or drop) the synchronizing objection during // the heartbeat window. The synchronizing objection must be a // <uvm_callbacks_objection> type. // // The uvm_heartbeat object has a list of participating objects. The heartbeat // can be configured so that all components (UVM_ALL_ACTIVE), exactly one // (UVM_ONE_ACTIVE), or any component (UVM_ANY_ACTIVE) must trigger the // objection in order to satisfy the heartbeat condition. //------------------------------------------------------------------------------ // typedef class uvm_objection_callback; class uvm_heartbeat: uvm_object { mixin(uvm_sync!uvm_heartbeat); protected uvm_callbacks_objection _m_objection; @uvm_immutable_sync protected uvm_heartbeat_callback _m_cb; protected uvm_component _m_cntxt; protected uvm_heartbeat_modes _m_mode; // protected Queue!uvm_component _m_hblist; // FIXME -- variable not used anywhere @uvm_private_sync protected uvm_event _m_event; protected bool _m_started; protected Event _m_stop_event; // Function: new // // Creates a new heartbeat instance associated with ~cntxt~. The context // is the hierarchical location that the heartbeat objections will flow // through and be monitored at. The ~objection~ associated with the heartbeat // is optional, if it is left null but it must be set before the heartbeat // monitor will activate. // //| uvm_callbacks_objection myobjection = new("myobjection"); //some shared objection //| class myenv extends uvm_env; //| uvm_heartbeat hb = new("hb", this, myobjection); //| ... //| endclass public this(string name, uvm_component cntxt, uvm_callbacks_objection objection = null) { synchronized(this) { super(name); _m_objection = objection; //if a cntxt is given it will be used for reporting. if(cntxt !is null) _m_cntxt = cntxt; else _m_cntxt = uvm_root.get(); _m_cb = new uvm_heartbeat_callback(name ~ "_cb", _m_cntxt); _m_stop_event.init(); } } // Function: set_mode // // Sets or retrieves the heartbeat mode. The current value for the heartbeat // mode is returned. If an argument is specified to change the mode then the // mode is changed to the new value. final public uvm_heartbeat_modes set_mode(uvm_heartbeat_modes mode = UVM_NO_HB_MODE) { synchronized(this) { auto retval = _m_mode; if(mode is UVM_ANY_ACTIVE || mode is UVM_ONE_ACTIVE || mode is UVM_ALL_ACTIVE) { _m_mode = mode; } return retval; } } // Function: set_heartbeat // // Sets up the heartbeat event and assigns a list of objects to watch. The // monitoring is started as soon as this method is called. Once the // monitoring has been started with a specific event, providing a new // monitor event results in an error. To change trigger events, you // must first <stop> the monitor and then <start> with a new event trigger. // // If the trigger event ~e~ is null and there was no previously set // trigger event, then the monitoring is not started. Monitoring can be // started by explicitly calling <start>. final public void set_heartbeat(uvm_event e, // ref Queue!uvm_component comps) { synchronized(m_cb) { foreach(c; comps) { if(c !in m_cb._cnt) { m_cb._cnt[c] = 0; } if(c !in m_cb._last_trigger) { m_cb._last_trigger[c] = 0; } } if(e is null && m_event is null) return; start(e); } } final public void set_heartbeat(uvm_event e, uvm_component[] comps) { synchronized(m_cb) { foreach(c; comps) { if(c !in m_cb._cnt) { m_cb._cnt[c] = 0; } if(c !in m_cb._last_trigger) { m_cb._last_trigger[c] = 0; } } if(e is null && m_event is null) return; start(e); } } // Function: add // // Add a single component to the set of components to be monitored. // This does not cause monitoring to be started. If monitoring is // currently active then this component will be immediately added // to the list of components and will be expected to participate // in the currently active event window. final public void add (uvm_component comp) { synchronized(m_cb) { uvm_object c = comp; if(c in m_cb._cnt) return; m_cb._cnt[c] = 0; m_cb._last_trigger[c] = 0; } } // Function: remove // // Remove a single component to the set of components being monitored. // Monitoring is not stopped, even if the last component has been // removed (an explicit stop is required). final public void remove (uvm_component comp) { synchronized(m_cb) { uvm_object c = comp; if(c in m_cb._cnt) m_cb._cnt.remove(c); if(c in m_cb._last_trigger) m_cb._last_trigger.remove(c); } } // Function: start // // Starts the heartbeat monitor. If ~e~ is null then whatever event // was previously set is used. If no event was previously set then // a warning is issued. It is an error if the monitor is currently // running and ~e~ is specifying a different trigger event from the // current event. final public void start (uvm_event e = null) { synchronized(this) { if(_m_event is null && e is null) { _m_cntxt.uvm_report_warning("NOEVNT", "start() was called for: " ~ get_name() ~ " with a null trigger and no currently" " set trigger", UVM_NONE); return; } if((_m_event !is null) && (e !is _m_event) && _m_started) { _m_cntxt.uvm_report_error("ILHBVNT", "start() was called for: " ~ get_name() ~ " with trigger " ~ e.get_name() ~ " which is different " ~ "from the original trigger " ~ _m_event.get_name(), UVM_NONE); return; } if(e !is null) _m_event = e; m_enable_cb(); m_start_hb_process(); } } // Function: stop // // Stops the heartbeat monitor. Current state information is reset so // that if <start> is called again the process will wait for the first // event trigger to start the monitoring. final public void stop () { synchronized(this) { _m_started = 0; _m_stop_event.notify(); m_disable_cb(); } } final public void m_start_hb_process() { synchronized(this) { if(_m_started) return; _m_started = 1; fork({m_hb_process();}); } } protected bool _m_added; final public void m_enable_cb() { synchronized(this) { _m_cb.callback_mode(true); if(_m_objection is null) return; if(!_m_added) { uvm_heartbeat_cbs_t.add(_m_objection, _m_cb); } _m_added = true; } } final public void m_disable_cb() { synchronized(this) { m_cb.callback_mode(false); } } // task final public void m_hb_process_1() { bool triggered = false; SimTime last_trigger = 0; // The process waits for the event trigger. The first trigger is // ignored, but sets the first start window. On susequent triggers // the monitor tests that the mode criteria was full-filled. while(true) { m_event.wait_trigger(); synchronized(this, m_cb) { if(triggered) { final switch (_m_mode) { case UVM_ALL_ACTIVE: foreach(obj, c; m_cb._cnt) { if(! m_cb._cnt[obj]) { _m_cntxt.uvm_report_fatal("HBFAIL", format("Did not recieve an update of" " %s for component %s since" " last event trigger at time" " %0t : last update time was" " %0t", _m_objection.get_name(), obj.get_full_name(), last_trigger, m_cb._last_trigger[obj]), UVM_NONE); } } break; case UVM_ANY_ACTIVE: if(m_cb._cnt.length && !m_cb.objects_triggered()) { string s; foreach(obj, c; m_cb._cnt) { s ~= "\n " ~ obj.get_full_name(); } _m_cntxt.uvm_report_fatal("HBFAIL", format("Did not recieve an update of" " %s on any component since" " last event trigger at time" " %0t. The list of registered" " components is:%s", _m_objection.get_name(), last_trigger, s), UVM_NONE); } break; case UVM_ONE_ACTIVE: if(m_cb.objects_triggered() > 1) { string s; foreach(obj, c; m_cb._cnt) { if(m_cb._cnt[obj]) { s = format("%s\n %s (updated: %0t)", s, obj.get_full_name(), m_cb._last_trigger[obj]); } } _m_cntxt.uvm_report_fatal("HBFAIL", format("Recieved update of %s from " "more than one component since" " last event trigger at time" " %0t. The list of triggered" " components is:%s", _m_objection.get_name(), last_trigger, s), UVM_NONE); } if(m_cb._cnt.length && !m_cb.objects_triggered()) { string s; foreach(obj, c; m_cb._cnt) { s ~= "\n " ~ obj.get_full_name(); } _m_cntxt.uvm_report_fatal("HBFAIL", format("Did not recieve an update of" " %s on any component since " "last event trigger at time " "%0t. The list of registered " "components is:%s", _m_objection.get_name(), last_trigger, s), UVM_NONE); } break; case UVM_NO_HB_MODE: // FIXME -- SV version does not do anything in this switch case leg assert(false, "Should not reach UVM_NO_HB_MODE"); } } m_cb.reset_counts(); last_trigger = getSimTime(); triggered = true; } } } // task final public void m_hb_process() { // uvm_object obj; Fork hb_process = fork({ m_hb_process_1(); }, { // _m_stop_event is effectively immutable wait(_m_stop_event); }); hb_process.joinAny(); hb_process.abortRec(); } } class uvm_heartbeat_callback: uvm_objection_callback { private int[uvm_object] _cnt; private SimTime[uvm_object] _last_trigger; private uvm_object _target; public this(string name, uvm_object target) { synchronized(this) { super(name); if (target !is null) { _target = target; } else { _target = uvm_root.get(); } } } override public void raised (uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count) { synchronized(this) { if(obj is _target) { if(source_obj !in _cnt) { _cnt[source_obj] = 0; } _cnt[source_obj] += 1; _last_trigger[source_obj] = getSimTime(); } } } override public void dropped (uvm_objection objection, uvm_object obj, uvm_object source_obj, string description, int count) { raised(objection, obj, source_obj, description, count); } final public void reset_counts() { synchronized(this) { foreach(ref c; _cnt) c = 0; } } final public int objects_triggered() { synchronized(this) { int retval = 0; foreach(c; _cnt) { if (c !is 0) { ++retval; } } return retval; } } }
D
import std.format,std.conv; import std.stdio; debug { private File fdebug; static this() { fdebug.open("debug.txt","w"); } static ~this() { fdebug.close(); } } class ListException: Exception { this() { super("ListException"); } } private struct Node(Type) { Type datum; Node* left, right; this(Type datum) { this.datum=datum; } ~this() { datum=Type.init; left=null; right=null; } } class List(Type) { private Node!Type *beg, end; int size; this() nothrow {} nothrow ~this () { clear(); } void pushBack(Type datum) { Node!Type *p=new Node!Type(datum); pushBack(p); } private void pushBack(Node!Type* p) nothrow { if(p) { p.left=end; if(end) { end.right=p; } else { beg=p; } end=p; p=null; ++size; } } void pushFront(Type datum) { Node!Type *p=new Node!Type(datum); pushFront(p); } private void pushFront(Node!Type* p) nothrow { if(p) { p.right=beg; if(beg) { beg.left=p; } else { end=p; } beg=p; p=null; ++size; } } private Node!Type* popNodeBack() { if(!isEmpty) { auto p=end; end=end.left; if(!end) beg=null; --size; p.left=null; return p; } return null; } void popBack() nothrow { if(!isEmpty) { Node!Type* p=end; end=end.left; if(!end) beg=null; p=null; } --size; } private Node!Type* popNodeFront() { if(!isEmpty) { auto p=beg; beg=beg.right; if(!beg) end=null; --size; p.right=null; return p; } return null; } void popFront() nothrow { if(!isEmpty) deleteForward(); } void clear() nothrow { while(!isEmpty) deleteForward(); size = 0; } private void deleteForward() nothrow { Node!Type* p=beg; beg=beg.right; if(!beg) end=null; p=null; --size; } @property Type onBack() const { if(!isEmpty) return end.datum; else throw new ListException; } @property Type onFront() const { if(!isEmpty) return beg.datum; else throw new ListException; } @property bool isEmpty() const nothrow { return !beg && !end; } void verify() { if(!isEmpty) { Node!Type* p; p=beg; while(p!=end) { assert(p !is null); p=p.right; } assert(p !is null); p=p.right; assert(p is null); p=end; while(p!=beg) { assert(p !is null); p=p.left; } assert(p !is null); p=p.left; assert(p is null); } else { assert(size==0); } } void print(string fileName) /+nothrow+/ { //f.writeln("list:"); if(this.isEmpty) { // f.writeln(""); } else { auto f= File(fileName,"w"); Node!Type* p=beg; //while(p!=end) for(auto i=0; i<size; ++i) { static if ( is(Type T: int)) { } else { f.writeln(p.datum.toString()); } p=p.right; } /* p=end; while(p) { write(p.datum," "); p=p.left; } writeln();*/ f.close(); } } void swap(int i,int j) { if(!isEmpty && i>=0 && i<size && j>=0 && j<=size) { Node!Type* p=beg, q=beg; for(int ii=0; ii<i; ++ii, p=p.right) {} for(int jj=0; jj<j; ++jj, q=q.right) {} if(p.datum != q.datum && i != j) { Node!Type* prebeg=new Node!Type(Type.init), postend= new Node!Type(Type.init); prebeg.right=beg; beg.left=prebeg; postend.left=end; end.right=postend; if(p.right!=q && q.right!=p) { Node!Type* pLeft=p.left; Node!Type* pRight=p.right; Node!Type* qLeft=q.left; Node!Type* qRight=q.right; q.left=pLeft; q.right=pRight; pLeft.right=q; pRight.left=q; p.left=qLeft; p.right=qRight; qLeft.right=p; qRight.left=p; assert(q.left.right==q); assert(q.right.left==q); assert(p.left.right==p); assert(p.right.left==p); } else { if(q.right==p) { auto t=p; p=q; q=t; } Node!Type* pLeft=p.left; Node!Type* qRight=q.right; q.left = pLeft; p.right = qRight; q.right = p; p.left = q; pLeft.right=q; qRight.left=p; } beg = prebeg.right; beg.left = null; end = postend.left; end.right = null; prebeg = null; postend = null; } } } /* private ref List!Type cutSubList(Node!Type* p, Node!Type* q) { }*/ } void sortByInsertion(Type)(List!Type list) { if(!list.isEmpty) { Node!Type* prebeg=new Node!Type(Type.init), postend= new Node!Type(Type.init); prebeg.right=list.beg; list.beg.left=prebeg; postend.left=list.end; list.end.right=postend; Node!Type* p=list.beg.right; while(p!=postend) { Node!Type* q=p.left; while(q!=prebeg && p.datum<q.datum) q=q.left; if(q.right!=p) { p.left.right=p.right; p.right.left=p.left; p.left=q; p.right=q.right; p.left.right=p; p.right.left=p; } p=p.right; } list.beg=prebeg.right; list.end=postend.left; list.beg.left=null; list.end.right=null; //prebeg.~this(); //postbeg.~this(); prebeg=null; postend=null; } } unittest { List!int list= new List!int; list.pushBack(1); list.pushBack(2); list.pushBack(3); list.pushBack(4); auto size = list.size; assert(size==4); assert(list.beg.datum==1); assert(list.beg.right.datum==2); assert(list.beg.right.right.datum==3); assert(list.beg.right.right.right.datum==4); assert(list.beg.right.right.right.right is null); assert(list.end.datum==4); assert(list.end.left.datum==3); assert(list.end.left.left.datum==2); assert(list.end.left.left.left.datum==1); assert(list.end.left.left.left.left is null); list.swap(1,2); string msg; assert(size==4); assert(list.beg.left is null); assert(list.beg.right !is null); assert(list.end.left !is null); assert(list.end.right is null); assert(list.beg.right.right.right==list.end); assert(list.end.left.left.left==list.beg); assert(list.beg.datum==1); assert(list.beg.right.datum==3); assert(list.beg.right.right.datum==2); assert(list.beg.right.right.right.datum==4); assert(list.beg.right.right.right.right is null); assert(list.end.datum==4); assert(list.end.left.datum==2); assert(list.end.left.left.datum==3); assert(list.end.left.left.left.datum==1); assert(list.end.left.left.left.left is null); list.swap(0,2); assert(size==4); assert(list.beg.left is null); assert(list.beg.right !is null); assert(list.end.left !is null); assert(list.end.right is null); assert(list.beg.right.right.right==list.end); assert(list.end.left.left.left==list.beg); assert(list.beg.datum==2); assert(list.beg.right.datum==3); assert(list.beg.right.right.datum==1); assert(list.beg.right.right.right.datum==4); assert(list.beg.right.right.right.right is null); assert(list.end.datum==4); assert(list.end.left.datum==1); assert(list.end.left.left.datum==3); assert(list.end.left.left.left.datum==2); assert(list.end.left.left.left.left is null); list.swap(2,3); assert(size==4); assert(list.beg.left is null); assert(list.beg.right !is null); assert(list.end.left !is null); assert(list.end.right is null); assert(list.beg.right.right.right==list.end); assert(list.end.left.left.left==list.beg); assert(list.beg.datum==2); assert(list.beg.right.datum==3); assert(list.beg.right.right.datum==4); assert(list.beg.right.right.right.datum==1); assert(list.beg.right.right.right.right is null); assert(list.end.datum==1); assert(list.end.left.datum==4); assert(list.end.left.left.datum==3); assert(list.end.left.left.left.datum==2); assert(list.end.left.left.left.left is null); } void sortByMerge(Type)(List!Type list) { if(!list.isEmpty) { auto part = new List!Type; split(list,part); if(list.size>1) sortByMerge(list); if(part.size>1) sortByMerge(part); merge(list,part); part = null; } } private void connect(Type)(List!Type list, List!Type part) { if(!part.isEmpty) { if(!list.isEmpty) { list.end.right = part.beg; part.beg.left = list.end; list.size += part.size; list.end = part.end; } else { list.beg=part.beg; list.end=part.end; list.size=part.size; } part.beg = null; part.end = null; part.size = 0; } } private void split(Type)(List!Type list, List!Type part) { //list.print(); bool direction=false; Node!Type* p=list.beg, q=list.end; int pSize=1,qSize=1; // writeln("p ",p.datum," q ",q.datum); while(p.right!=q) { if(direction) { p=p.right; ++pSize; } else { q=q.left; ++qSize; } // writeln("p ",p.datum," q ",q.datum); direction=!direction; } //writeln("list ",list.size); // writeln("p+q ",pSize+qSize); assert(list.size == pSize+qSize); part.beg=q; part.end=list.end; list.end=p; p.right=null; q.left=null; list.size=pSize; part.size=qSize; p=null; q=null; } private void merge(Type)(List!Type list, List!Type part) { auto temp= new List!Type; temp.beg=list.beg; temp.end=list.end; temp.size=list.size; list.beg=null; list.end=null; list.size=0; while(!temp.isEmpty && !part.isEmpty) { if(temp.onFront <= part.onFront) { list.pushBack(temp.popNodeFront); } else { list.pushBack(part.popNodeFront); } } if(!temp.isEmpty) { connect(list,temp); } if(!part.isEmpty) { connect(list,part); } temp = null; } void sortByTimsort(Type)(List!Type list) { immutable uint minrunTreshold=64; uint lengthMinrun(uint size) { uint flag = 0; while(size>=minrunTreshold) { flag |= size & 1; size >>= 1; } return size+flag; } uint minrun = lengthMinrun(list.size); debug fdebug.writeln("minrun = ", minrun); List!Type[] stack=new List!Type[list.size/minrun+1]; int top = 0; //split on run List!Type run; while(!list.isEmpty) { run = new List!Type; if(list.size>1) { Node!Type* q = list.beg.right; uint size = 2; if(list.beg.datum<=q.datum) { // non descdending order while(q!=list.end && q.datum<=q.right.datum) { q=q.right; ++size; } beisen(run,q,size,list); } else { // descending oreder while(q!=list.end && q.datum > q.right.datum) { q=q.right; ++size; } beisen(run,q,size,list); reverse(run); } } else { run = list; //list = null; } if(!list.isEmpty && run.size<minrun) { List!Type apendix = new List!Type; Node!Type* q=list.beg; uint apendixSize =minrun-run.size; uint size = 1; for(int i=0; q!=list.end && i<apendixSize; ++i) { q=q.right; ++size; } beisen(apendix,q,size,list); connect(run,apendix); sortByInsertion(run); apendix = null; } stack[top++]=run; debug fdebug.writeln("top = ",top); debug fdebug.writefln("run =%d",run.size); run = null; // merging bool a,b; while((top>=3 && (stack[top-3].size <= stack[top-2].size+stack[top-1].size)) || (top>=2 && (stack[top-2].size <= stack[top-1].size))) { debug { fdebug.writeln("top = ", top); fdebug.writeln("stack:"); for(int i=0; i<top; ++i) fdebug.writef("%5d ", stack[i].size); fdebug.writeln(); } if(top>=3 && (stack[top-3].size <= stack[top-2].size+stack[top-1].size)) { if(stack[top-3].size<=stack[top-1].size) { merge(stack[top - 3],stack[top - 2]); stack[top - 2] = stack[top - 1]; stack[top - 1] = null; --top; } else { merge(stack[top - 2],stack[top - 1]); stack[top - 1] = null; --top; } } else if(top>=2 && (stack[top-2].size <= stack[top-1].size)) { merge(stack[top - 2],stack[top - 1]); stack[top - 1] = null; --top; } } debug { fdebug.writeln("top = ", top); fdebug.writeln("stack:"); for(int i=0; i<top; ++i) fdebug.writef("%5d ", stack[i].size); fdebug.writeln(); } } while(top >= 2) { merge(stack[top - 2],stack[top - 1]); stack[top - 1] = null; --top; debug { fdebug.writeln("top = ", top); fdebug.writeln("stack:"); for(int i=0; i<top; ++i) fdebug.writef("%5d ", stack[i].size); fdebug.writeln(); } } list.beg = stack[top - 1].beg; list.end = stack[top - 1].end; list.size = stack[top - 1].size; stack[top - 1] = null; --top; } private void beisen(Type)(List!Type run, Node!Type* q, uint size, List!Type list) nothrow { run.beg = list.beg; run.end = q; run.size = size; list.beg = q.right; list.size -= size; q.right = null; if(list.beg) { list.beg.left = null; } else { list.end = null; } } private void reverse(Type)(List!Type list) { if(!list.isEmpty) { List!Type temp = new List!Type; while(!list.isEmpty) { temp.pushBack(list.popNodeBack()); } list.beg=temp.beg; list.end=temp.end; temp=null; } } void sortByQuickDPP(Type)(List!Type list) { if(!list.isEmpty) { Node!Type* p=list.beg, q=list.beg; for(int mid=list.size/2, i=0; i<mid; ++i, p=p.right) {} List!Type minor = new List!Type; List!Type major = new List!Type; List!Type media = new List!Type; Type val = p.datum; while(q) { if(q.datum<val) { minor.pushBack(list.popNodeFront()); } else if(q.datum==val) { media.pushBack(list.popNodeFront()); } else { major.pushBack(list.popNodeFront()); } q=list.beg; } if(minor.size>1)sortByQuickDPP(minor); if(major.size>1)sortByQuickDPP(major); connect(minor,media); connect(minor,major); list.beg=minor.beg; list.end=minor.end; list.size=minor.size; minor.beg =null; minor.end =null; minor.size =0; minor =null; media =null; major =null; } }
D
module diesel.gl.window; import diesel.gl.core; import std.exception; import std.conv : to; import std.stdio; import std.string : startsWith, toz = toStringz; version(raspberry) import diesel.linux.input_event_codes; // Mixin to translate all Linux KEY_ symbols into DK_ symbols string generateKeys() { string entries = ""; foreach(m; __traits(allMembers, diesel.linux.input_event_codes)) { static if(m.startsWith("KEY_")) { enum v = __traits(getMember, diesel.linux.input_event_codes, m); enum line = ("static const int DK" ~ m[3..$] ~ " = " ~ to!string(v + 0x0080_0000) ~ ";\n"); entries ~= line; } } return entries; } class Window { int width; int height; ulong frameCounter = 0; bool fullScreen = false; int factor = 1; int getScale() { return factor; } void delegate(int, int) resize_cb; void onResize(void delegate(int,int) cb) { resize_cb = cb; } import diesel.keycodes; version(raspberry) { import diesel.broadcom; import derelict.gles.egl; import std.concurrency; import diesel.linux.keyboard; // Pull in Linux KEY_* symbols and translate them to DK_* symbols mixin(generateKeys()); EGLConfig eglConfig; EGLContext eglContext; EGLDisplay eglDisplay; EGLSurface eglSurface; EGL_DISPMANX_WINDOW_T nativeWindow; void initEGL() { EGLint numConfigs; EGLConfig config; EGLConfig[32] configList; eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); EGLint m0; EGLint m1; eglInitialize(eglDisplay, &m0, &m1); eglGetConfigs(eglDisplay, configList.ptr, 32, &numConfigs); for(int i=0; i<numConfigs; i++) { EGLint conf, stype, caveat, sbuffers; eglGetConfigAttrib(eglDisplay, configList[i], EGL_CONFORMANT, &conf); eglGetConfigAttrib(eglDisplay, configList[i], EGL_SURFACE_TYPE, &stype); eglGetConfigAttrib(eglDisplay, configList[i], EGL_CONFIG_CAVEAT, &caveat); eglGetConfigAttrib(eglDisplay, configList[i], EGL_SAMPLE_BUFFERS, &sbuffers); // Pick a ES 2 context that preferably has some AA if((conf & EGL_OPENGL_ES2_BIT) && (stype & EGL_WINDOW_BIT)) { config = configList[i]; if(sbuffers > 0) { break; } } } if(config == null) throw new gl_exception("Could not find compatible config"); EGLint[] attribs = [ EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE, EGL_NONE ]; eglContext = eglCreateContext(eglDisplay, config, null, attribs.ptr); if(eglContext == EGL_NO_CONTEXT) throw new gl_exception("Cound not create GL context"); eglSurface = eglCreateWindowSurface(eglDisplay, config, cast(Display*)&nativeWindow, null); if(eglSurface == EGL_NO_SURFACE) throw new gl_exception("Cound not create GL surface"); if(eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext) == EGL_FALSE) throw new gl_exception("Cound not set context"); eglConfig = config; } void broadcom_init() { DISPMANX_ELEMENT_HANDLE_T dispman_element; DISPMANX_DISPLAY_HANDLE_T dispman_display; DISPMANX_UPDATE_HANDLE_T dispman_update; VC_RECT_T dst_rect; VC_RECT_T src_rect; uint display_width; uint display_height; bcm_host_init(); if(graphics_get_display_size(0 /* LCD */, &display_width, &display_height) < 0) throw new gl_exception("Cound not get display size"); dst_rect.x = 0; dst_rect.y = 0; dst_rect.width = display_width; dst_rect.height = display_height; ushort dwa = 0; ushort dha = 0; // Scale 50% on hires screens /* if(display_width > 1280) { */ /* display_width /= 2; */ /* display_height /= 2; */ /* dwa = cast(ushort)display_width; */ /* dha = cast(ushort)display_height; */ /* } */ width = display_width; height = display_height; src_rect.x = 0; src_rect.y = 0; src_rect.width = display_width << 16 | dwa; src_rect.height = display_height << 16 | dha; dispman_display = vc_dispmanx_display_open(0 /* LCD */); dispman_update = vc_dispmanx_update_start(0); dispman_element = vc_dispmanx_element_add(dispman_update, dispman_display, 0, &dst_rect, 0, &src_rect, DISPMANX_PROTECTION_NONE, null, null, DISPMANX_TRANSFORM_T.DISPMANX_NO_ROTATE); nativeWindow.element = dispman_element; nativeWindow.width = display_width; nativeWindow.height = display_height; vc_dispmanx_update_submit_sync(dispman_update); } void runLoop(void delegate() looper) { while(!doQuit) { //kbd.pollKeyboard(1); frameCounter++; looper(); eglSwapBuffers(eglDisplay, eglSurface); } } void swap() { eglSwapBuffers(eglDisplay, eglSurface); } Tid keyTid; import core.time : Duration, dur; LinuxKeyboard kbd; struct KeyCode { uint key; alias key this; } uint getKey() { uint key = 0; //if(kbd.haveKeys()) // key = kbd.nextKey(); receiveTimeout(dur!"usecs"(1), (KeyCode x) { key = x; } ); return key; } shared static bool quitKeyboard = false; void exit() { if(!quitKeyboard) { quitKeyboard = true; writeln("Waiting for keyboard"); receiveTimeout(dur!"seconds"(1), (LinkTerminated l) { writeln("Keyboard terminated"); } ); } } static const string toa = "\000\0001234567890-=\x08\x09qwertyuiop[]\x0d\000asdfghjkl;'\000\000\\zxcvbnm,./\000\000\000 "; static const string toa_up = "\000\000!@#$%^&*()_+\000\000QWERTYUIOP{}\000\000ASDFGHJKL:\"\000\000|ZXCVBNM<>?\000\000\000 "; static uint to_ascii(int code, bool shift) { uint a; if(code < toa.length) { a = shift ? toa_up[code] : toa[code]; } return a; } void init() { import derelict.util.loader; (cast(SharedLibLoader)DerelictGLES2).load(); DerelictEGL.load(); //kbd = new LinuxKeyboard(); keyTid = spawnLinked((Tid parentTid) { auto lk = new LinuxKeyboard(); while(!quitKeyboard) { lk.pollKeyboard(100_000); if(!lk.haveKeys()) continue; bool shift = lk.isPressed( KEY_LEFTSHIFT ) || lk.isPressed( KEY_RIGHTSHIFT ); bool ctrl = lk.isPressed( KEY_LEFTCTRL ) || lk.isPressed( KEY_RIGHTCTRL ); bool alt = lk.isPressed( KEY_LEFTALT ) || lk.isPressed( KEY_RIGHTALT ); bool meta = lk.isPressed( KEY_LEFTMETA ) || lk.isPressed( KEY_RIGHTMETA ); while(lk.haveKeys()) { auto code = lk.nextKey(); uint a = to_ascii(code, shift); if(a == 0) { a = code + KEYCODE; if(shift) a |= DKM_SHIFT; if(ctrl) a |= DKM_CTRL; if(alt) a |= DKM_ALT; if(meta) a |= DKM_CMD; writefln("CODE %x", a); } else { if(ctrl) a |= DKM_CTRL; if(meta) a |= DKM_CMD; } send(parentTid, KeyCode(a)); } } }, thisTid); broadcom_init(); initEGL(); } int[2] getMouse() { return [-1,-1]; } } else { import derelict.sdl2.sdl; SDL_Window* window; SDL_Renderer* renderer; uint[] keys; int[2] currentMouse; bool haveMouse = false; uint sdlToDkm(uint x) { uint rc = 0; if(x & KMOD_SHIFT) rc |= DKM_SHIFT; if(x & KMOD_ALT) rc |= DKM_ALT; if(x & KMOD_CTRL) rc |= DKM_CTRL; if(x & KMOD_GUI) rc |= DKM_CMD; return rc; } int[2] getMouse() { if(haveMouse) return currentMouse; SDL_GetMouseState(currentMouse.ptr, currentMouse.ptr+1); currentMouse[] *= factor; haveMouse = true; return currentMouse; } bool spaceMod = false; bool spacePressed = false; bool spaceUsed = false; bool keyDown = false; void runLoop(void delegate() looper) { import std.utf; import std.algorithm.searching : find; SDL_Event e; static int[] mbuttons = [SDL_BUTTON_LEFT, SDL_BUTTON_RIGHT, SDL_BUTTON_MIDDLE, SDL_BUTTON_X1, SDL_BUTTON_X2]; while(!doQuit) { haveMouse = false; frameCounter++; uint savedKey = 0; uint lastSym = 0; while(SDL_PollEvent(&e) != 0) { uint s = 0; auto sym = e.key.keysym.sym; auto mod = e.key.keysym.mod; if(e.type == SDL_KEYDOWN) { // Deal with Ubuntu stupidities if(sym == SDLK_LGUI && (mod & KMOD_LGUI)) continue; if(sym == SDLK_LALT && (mod & KMOD_LALT)) continue; if(sym == lastSym) continue; } /* if(e.type == SDL_KEYUP || e.type == SDL_KEYDOWN || e.type == SDL_TEXTINPUT) { */ /* if(e.type == SDL_TEXTINPUT) { */ /* auto txt = to!string(cast(const char *)e.text.text); */ /* writefln("#TEXT '%s'", txt); */ /* } else */ /* writefln("#KEY %s %x(%x)", e.type == SDL_KEYUP ? "up" : "down", sym, mod); */ /* } */ if(e.type == SDL_MOUSEWHEEL) { if(e.wheel.y > 0) s = DK_WHEEL_UP; if(e.wheel.y < 0) s = DK_WHEEL_DOWN; } else if(e.type == SDL_MOUSEBUTTONDOWN) { auto f = find(mbuttons, cast(int)e.button.button); s = DK_LEFT_MOUSE_DOWN + cast(uint)(5 - f.length); currentMouse[0] = e.button.x * factor; currentMouse[1] = e.button.y * factor; haveMouse = true; } else if(e.type == SDL_MOUSEBUTTONUP) { auto f = find(mbuttons, cast(int)e.button.button); s = DK_LEFT_MOUSE_UP + cast(uint)(5 - f.length); currentMouse[0] = e.button.x * factor; currentMouse[1] = e.button.y * factor; haveMouse = true; } else if(e.type == SDL_WINDOWEVENT) { if(e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { SDL_GetRendererOutputSize(renderer, &width, &height); factor = width / e.window.data1; resize_cb(width, height); } } else if(e.type == SDL_KEYUP) { if(savedKey != 0) { keys ~= savedKey; savedKey = 0; } keyDown = false; } else if(e.type == SDL_KEYDOWN) { lastSym = sym; if(savedKey != 0) { keys ~= savedKey; savedKey = 0; } keyDown = true; if(sym >= 0x10000) savedKey = e.key.keysym.scancode | KEYCODE; else savedKey = sym; savedKey |= sdlToDkm(mod); } else if(e.type == SDL_TEXTINPUT) { auto txt = to!string(cast(const char *)e.text.text); size_t index = 0; s = std.utf.decode(txt, index); if((savedKey & 0xffffff) == s) s = savedKey; savedKey = 0; } else if(e.type == SDL_QUIT) doQuit = true; if(s != 0) keys ~= s; } if(savedKey != 0) { keys ~= savedKey; savedKey = 0; } looper(); SDL_GL_SwapWindow(window); } } string getClipboard() { return to!string(SDL_GetClipboardText()); } void putClipboard(string text) { writeln("Copy ", text); auto t = toz(text); SDL_SetClipboardText(t); } void swap() { SDL_GL_SwapWindow(window); } uint getKey() { uint rc = 0; if(keys.length > 0) { rc = keys[0]; keys = keys[1 .. $]; } return rc; } void exit() { } void init() { DerelictSDL2.load(); DerelictGL3.load(); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); enforce(SDL_Init(SDL_INIT_VIDEO) >= 0, "Failed to initialize SDL: " ~ to!string(SDL_GetError())); int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE ; flags |= SDL_WINDOW_ALLOW_HIGHDPI; if(fullScreen) { flags |= SDL_WINDOW_FULLSCREEN; if(width == 0) flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; } else { if(width == 0) { width = 800; height = 480; } } window = SDL_CreateWindow("Jterm", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, cast(SDL_WindowFlags)flags); renderer = SDL_CreateRenderer(window, -1, cast(SDL_RendererFlags)0); enforce(SDL_GL_CreateContext(window) != null); SDL_GetRendererOutputSize(renderer, &width, &height); int w, h; SDL_GetWindowSize(window, &w, &h); factor = width / w; //width *= 2; //height *= 2; SDL_GL_SetSwapInterval(1); DerelictGL3.reload(); } } // Common code this(int w, int h, bool fs = false) { fullScreen = fs; init(); setViewPort([width,height]); } ~this() { exit(); } void setTarget() { check!glBindFramebuffer(GL_FRAMEBUFFER, 0); setViewPort([width,height]); } bool doQuit = false; void quit() { doQuit = true; } }
D
/* * Copyright 2015-2018 HuntLabs.cn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ module hunt.sql.dialect.mysql.ast.statement.MySqlShowProfilesStatement; import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor; import hunt.sql.dialect.mysql.ast.statement.MySqlStatementImpl; import hunt.sql.dialect.mysql.ast.statement.MySqlShowStatement; public class MySqlShowProfilesStatement : MySqlStatementImpl , MySqlShowStatement { alias accept0 = MySqlStatementImpl.accept0; override public void accept0(MySqlASTVisitor visitor) { visitor.visit(this); visitor.endVisit(this); } }
D