code
stringlengths
3
10M
language
stringclasses
31 values
# FIXED UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.c UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_struct.h UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.obj: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_sdfm_drivers.h C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/Comun/common/F2837xD_sdfm_drivers.c: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F28x_Project.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_typedefs.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_device.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/assert.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/linkage.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdarg.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdbool.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stddef.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/ti-cgt-c2000_16.9.6.LTS/include/stdint.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_adc.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_analogsubsys.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_can.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cla.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cmpss.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_cputimer.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dac.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dcsm.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_dma.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ecap.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_emif.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_epwm_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_eqep.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_flash.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_gpio.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_i2c.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_input_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_ipc.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_mcbsp.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_memconfig.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_nmiintrupt.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_output_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_piectrl.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_pievect.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sci.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sdfm.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_spi.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_sysctrl.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_upp.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xbar.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_headers/include/F2837xD_xint.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Examples.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_GlobalPrototypes.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_cputimervars.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Cla_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_EPwm_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Adc_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Emif_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Gpio_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_I2c_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Ipc_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Pie_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Dma_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_SysCtrl_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_Upp_defines.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_defaultisr.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_struct.h: C:/Users/dagaro/workspace/Firmware_Test/UFCharger/F2837xD/F2837xD_common/include/F2837xD_sdfm_drivers.h:
D
interface GHFetch<T> { (url: string): Promise<T> } type URLString = string; export type GithubUser = { login: string, id: number, node_id: string, avatar_url?: string, gravatar_id?: string, url: string, html_url: string, followers_url: string, following_url: string, gists_url: string, starred_url: string, subscriptions_url: string, organizations_url: string, repos_url: string, events_url: string, received_events_url: string, type: string, site_admin: boolean, } type Issue = { id: number, node_id: string, url: string, repository_url: string, labels_url: string, comments_url: string, events_url: string, html_url: string, "number": number, state: string, title: string, body: string, body_html: string, user: GithubUser, } type IssueComment = { id: number, node_id: string, url: string, html_url: string, body: string, body_html: string, created_at: string, updated_at: string, user: GithubUser, }
D
prototype Mst_Default_Gobbo_Black(C_Npc) { name[0] = "Black Goblin"; guild = GIL_GOBBO; aivar[AIV_MM_REAL_ID] = ID_GOBBO_BLACK; level = 8; attribute[ATR_STRENGTH] = 45; attribute[ATR_DEXTERITY] = 45; attribute[ATR_HITPOINTS_MAX] = 45; attribute[ATR_HITPOINTS] = 45; attribute[ATR_MANA_MAX] = 0; attribute[ATR_MANA] = 0; protection[PROT_BLUNT] = 40; protection[PROT_EDGE] = 45; protection[PROT_POINT] = 45; protection[PROT_FIRE] = 2; protection[PROT_FLY] = 40; protection[PROT_MAGIC] = 5; damagetype = DAM_BLUNT; fight_tactic = FAI_GOBBO; senses = SENSE_HEAR | SENSE_SEE | SENSE_SMELL; senses_range = PERC_DIST_MONSTER_ACTIVE_MAX; aivar[AIV_MM_ThreatenBeforeAttack] = TRUE; aivar[AIV_MM_FollowTime] = FOLLOWTIME_MEDIUM; aivar[AIV_MM_FollowInWater] = FALSE; aivar[AIV_MM_Packhunter] = TRUE; start_aistate = ZS_MM_AllScheduler; aivar[AIV_MM_RestStart] = OnlyRoutine; }; func void B_SetVisuals_Gobbo_Black() { Mdl_SetVisual(self,"Gobbo.mds"); Mdl_SetVisualBody(self,"Gob_Body",1,DEFAULT,"",DEFAULT,DEFAULT,-1); }; instance Gobbo_Black(Mst_Default_Gobbo_Black) { B_SetVisuals_Gobbo_Black(); Npc_SetToFightMode(self,ItMw_1h_Bau_Mace); }; instance Gobbo_DaronsStatuenKlauer(Mst_Default_Gobbo_Black) { B_SetVisuals_Gobbo_Black(); name[0] = "Goblin Leader"; level = 12; attribute[ATR_STRENGTH] = 55; attribute[ATR_DEXTERITY] = 55; attribute[ATR_HITPOINTS_MAX] = 110; attribute[ATR_HITPOINTS] = 110; protection[PROT_BLUNT] = 45; protection[PROT_EDGE] = 45; protection[PROT_POINT] = 45; protection[PROT_FIRE] = 0; protection[PROT_FLY] = 40; protection[PROT_MAGIC] = 5; CreateInvItems(self,ItMi_LostInnosStatue_Daron,1); Npc_SetToFightMode(self,ItMw_1h_Bau_Mace); };
D
module ui.notificationrenderer; import client; import message; import messagebroker; import observer; import serverstub; import utils; import ui.renderer; import ui.renderhelper; import world.nation; import world.nationprototype; import derelict.sdl2.sdl; import std.conv; /** * renderer as child of InGameRenderer to render notifications * * - year change * - nation change **/ class NotificationRenderer : Renderer, Observer { private MessageBroker messageBroker; private ServerStub serverStub; // sdl_tick when last notification started private uint startNotifyNation; public this(Client client, RenderHelper renderer, MessageBroker messageBroker) { super(client, renderer); this.serverStub = this.client.getServerStub(); this.messageBroker = messageBroker; this.messageBroker.register(this, "nationChanged"); } public ~this() { this.messageBroker.unregister(this, "nationChanged"); } public override void notify(const(Message) message) { // active nation changed if (message.text == "nationChanged") { this.startNotifyNation = SDL_GetTicks(); } } public override void render(int tick=0) { uint diffStartNotifyNation = SDL_GetTicks() - this.startNotifyNation; if (diffStartNotifyNation < 1360) { int alpha = 180 - ((cast(int)diffStartNotifyNation - 1000) / 2); alpha = min(180, alpha); this.renderer.drawTextureAlpha( this.screenRegion.x, this.screenRegion.y + 30, this.screenRegion.w, 50, "black", cast(ubyte)alpha); } if (diffStartNotifyNation < 1000) { const(Nation) nation = this.serverStub.getCurrentNation(); const(NationPrototype) nationPrototype = nation.getPrototype(); // flag this.renderer.drawTexture( this.screenRegion.x + 51, this.screenRegion.y + 41, nationPrototype.getFlagImageName()); this.renderer.drawTexture( this.screenRegion.x + 50, this.screenRegion.y + 40, "border_round_30"); // nation name this.renderer.drawText( this.screenRegion.x + 100, this.screenRegion.y + 38, nation.getName(), "notificationLarge"); // year this.renderer.drawText( this.screenRegion.x + this.screenRegion.w - 200, this.screenRegion.y + 38, "Year " ~ text(this.serverStub.getCurrentYear()), "notificationLarge"); } } public override void handleEvent(SDL_Event event) { } }
D
/++ dub.sdl: name "test" dependency "eventcore" path=".." +/ module test; import eventcore.core; import core.stdc.signal; import core.time : Duration, msecs; import core.thread : Thread; void test(Duration timeout) { while (true) { auto reason = eventDriver.core.processEvents(timeout); final switch (reason) with (ExitReason) { case exited: assert(false, "Manual exit without call to exit()!?"); case timeout: assert(false, "Event loop timed out, although no waiters exist!?"); case idle: break; case outOfWaiters: return; } } } void main() { assert(eventDriver.core.waiterCount == 0, "Initial waiter count not 0!"); test(100.msecs); assert(eventDriver.core.waiterCount == 0, "Waiter count after outOfWaiters not 0!"); test(Duration.max); assert(eventDriver.core.waiterCount == 0); }
D
INSTANCE Info_Mod_Valentine_Hi (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Hi_Condition; information = Info_Mod_Valentine_Hi_Info; permanent = 0; important = 0; description = "Wer bist du?"; }; FUNC INT Info_Mod_Valentine_Hi_Condition() { return 1; }; FUNC VOID Info_Mod_Valentine_Hi_Info() { B_Say (hero, self, "$WHOAREYOU"); AI_Output(self, hero, "Info_Mod_Valentine_Hi_16_01"); //Ich bin Valentine, Valentinos Schwester. }; INSTANCE Info_Mod_Valentine_Kapitel2 (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kapitel2_Condition; information = Info_Mod_Valentine_Kapitel2_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_Kapitel2_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Hi)) && (Kapitel >= 2) && (!Npc_KnowsInfo(hero, Info_Mod_Moe_Geruechte3)) && (Npc_KnowsInfo(hero, Info_Mod_Canthar_Port)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kapitel2_Info() { AI_Output(self, hero, "Info_Mod_Valentine_Kapitel2_16_00"); //(ungläubig) Was willst DU denn hier? AI_StopProcessInfos (self); }; INSTANCE Info_Mod_Valentine_WoValentino (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_WoValentino_Condition; information = Info_Mod_Valentine_WoValentino_Info; permanent = 1; important = 0; description = "Ich komme von Moe. Es geht um Valentino."; }; FUNC INT Info_Mod_Valentine_WoValentino_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Hi)) && (Npc_KnowsInfo(hero, Info_Mod_Moe_Geruechte3)) && (Mod_Moe_Valentino == 0) { return 1; }; }; FUNC VOID Info_Mod_Valentine_WoValentino_Info() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_15_00"); //Ich komme von Moe. Es geht um Valentino. AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_16_01"); //Bist du nicht derjenige, den Canthar haben will? Info_ClearChoices (Info_Mod_Valentine_WoValentino); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Nein, wer behauptet denn so etwas?", Info_Mod_Valentine_WoValentino_B); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Ja, das stimmt.", Info_Mod_Valentine_WoValentino_A); }; FUNC VOID Info_Mod_Valentine_WoValentino_E() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_E_15_00"); //Ich will versuchen, Valentino zu retten. AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_E_16_01"); //(spöttisch) Valentino retten? Du? Allein? Info_ClearChoices (Info_Mod_Valentine_WoValentino); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Ja, ich allein. Wo ist er?", Info_Mod_Valentine_WoValentino_G); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Hast du eine bessere Idee?", Info_Mod_Valentine_WoValentino_F); }; FUNC VOID Info_Mod_Valentine_WoValentino_B() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_B_15_00"); //Nein, wer behauptet denn so etwas? AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_B_16_01"); //(argwöhnisch) Canthar beschrieb in seiner Forderung einen Menschen, dessen Beschreibung auf dich zutreffen würde. Info_ClearChoices (Info_Mod_Valentine_WoValentino); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Das muss Zufall sein.", Info_Mod_Valentine_WoValentino_D); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Vielleicht bin ich das doch. Ja, je länger ich darüber nachdenke ...", Info_Mod_Valentine_WoValentino_C); }; FUNC VOID Info_Mod_Valentine_WoValentino_A() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_A_15_00"); //Ja, das stimmt. AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_A_16_01"); //Was willst du dann von mir? Info_Mod_Valentine_WoValentino_E(); }; FUNC VOID Info_Mod_Valentine_WoValentino_D() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_D_15_00"); //Das muss Zufall sein. AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_D_16_01"); //Aha ... na schön, was willst du? Info_Mod_Valentine_WoValentino_E(); }; FUNC VOID Info_Mod_Valentine_WoValentino_C() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_C_15_00"); //Vielleicht bin ich das doch. Ja, je länger ich darüber nachdenke ... AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_C_16_01"); //(genervt) Was soll das? Komm wieder, wenn du dir sicher bist. Info_ClearChoices (Info_Mod_Valentine_WoValentino); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Valentine_WoValentino_G() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_G_15_00"); //(grob) Ja, ich allein. Wo ist er? AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_G_16_01"); //(einsilbig) Auf der Höhe von Jacks Leuchtturm. Viel Glück. Info_ClearChoices (Info_Mod_Valentine_WoValentino); AI_StopProcessInfos (self); B_StartOtherRoutine (Mod_754_NONE_Valentino_NW, "KIDNAPPED"); Mod_Moe_Valentino = 1; B_LogEntry (TOPIC_MOD_MOE_VALENTINO, "Valentino wird auf dem Plateau in der Nähe von Jacks Leuchtturm festgehalten. Da werde ich ihn wohl irgendwie rausholen müssen."); // Pfad zum Leuchtturm Wld_InsertNpc (Mod_7026_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7027_OUT_Entfuehrer_NW, "TAVERNE"); // Um Zelt Wld_InsertNpc (Mod_7028_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7029_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7030_OUT_Entfuehrer_NW, "TAVERNE"); // In Zelt Wld_InsertNpc (Mod_7031_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7032_OUT_Entfuehrer_NW, "TAVERNE"); // Lager hochfahren Wld_SendTrigger ("EVT_NW_VALENTINOZELT"); Wld_InsertItem (ItWr_CantharZettel_Valentino, "FP_ITEM_VALENTINO_RAMIREZ_ZETTEL"); }; FUNC VOID Info_Mod_Valentine_WoValentino_F() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_F_15_00"); //Hast du eine bessere Idee? AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_F_16_01"); //Canthar will dich in die Finger bekommen, und du willst ihm allein entgegenlaufen? AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_F_16_02"); //Nein, du darfst dich seinen Häschern nicht zu erkennen geben. (bestimmt) Ich werde mitkommen. Info_ClearChoices (Info_Mod_Valentine_WoValentino); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Auf keinen Fall nehme ich dich mit. Wo sind die Entführer?", Info_Mod_Valentine_WoValentino_I); Info_AddChoice (Info_Mod_Valentine_WoValentino, "Das findest du nicht zu gefährlich?", Info_Mod_Valentine_WoValentino_H); }; FUNC VOID Info_Mod_Valentine_WoValentino_I() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_I_15_00"); //Auf keinen Fall nehme ich dich mit. Wo sind die Entführer? AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_I_16_01"); //(einsilbig) Na schön. Auf der Höhe von Jacks Leuchtturm. Viel Glück. Info_ClearChoices (Info_Mod_Valentine_WoValentino); AI_StopProcessInfos (self); B_StartOtherRoutine (Mod_754_NONE_Valentino_NW, "KIDNAPPED"); Mod_Moe_Valentino = 1; B_LogEntry (TOPIC_MOD_MOE_VALENTINO, "Valentino wird auf dem Plateau in der Nähe von Jacks Leuchtturm festgehalten. Da werde ich ihn wohl irgendwie rausholen müssen."); // Pfad zum Leuchtturm Wld_InsertNpc (Mod_7026_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7027_OUT_Entfuehrer_NW, "TAVERNE"); // Um Zelt Wld_InsertNpc (Mod_7028_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7029_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7030_OUT_Entfuehrer_NW, "TAVERNE"); // In Zelt Wld_InsertNpc (Mod_7031_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7032_OUT_Entfuehrer_NW, "TAVERNE"); // Lager hochfahren Wld_SendTrigger ("EVT_NW_VALENTINOZELT"); Wld_InsertItem (ItWr_CantharZettel_Valentino, "FP_ITEM_VALENTINO_RAMIREZ_ZETTEL"); }; FUNC VOID Info_Mod_Valentine_WoValentino_H() { AI_Output(hero, self, "Info_Mod_Valentine_WoValentino_H_15_00"); //Das findest du nicht zu gefährlich? AI_Output(self, hero, "Info_Mod_Valentine_WoValentino_H_16_01"); //Ich habe schon einen Plan ... Folge mir, ich bringe dich zu dem Lager der Entführer. Info_ClearChoices (Info_Mod_Valentine_WoValentino); Mod_Moe_Valentino = 2; B_LogEntry (TOPIC_MOD_MOE_VALENTINO, "Valentine wird mich zu dem Ort führen, an dem Valentino festgehalten wird. Sie meint, sie habe einen Plan ..."); // Pfad zum Leuchtturm Wld_InsertNpc (Mod_7026_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7027_OUT_Entfuehrer_NW, "TAVERNE"); // Um Zelt Wld_InsertNpc (Mod_7028_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7029_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7030_OUT_Entfuehrer_NW, "TAVERNE"); // In Zelt Wld_InsertNpc (Mod_7031_OUT_Entfuehrer_NW, "TAVERNE"); Wld_InsertNpc (Mod_7032_OUT_Entfuehrer_NW, "TAVERNE"); // Lager hochfahren Wld_SendTrigger ("EVT_NW_VALENTINOZELT"); B_StartOtherRoutine (Mod_754_NONE_Valentino_NW, "KIDNAPPED"); Wld_InsertItem (ItWr_CantharZettel_Valentino, "FP_ITEM_VALENTINO_RAMIREZ_ZETTEL"); }; INSTANCE Info_Mod_Valentine_LosZuValentino (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_LosZuValentino_Condition; information = Info_Mod_Valentine_LosZuValentino_Info; permanent = 0; important = 0; description = "Los geht's!"; }; FUNC INT Info_Mod_Valentine_LosZuValentino_Condition() { if (Mod_Moe_Valentino == 2) { return 1; }; }; FUNC VOID Info_Mod_Valentine_LosZuValentino_Info() { AI_Output(hero, self, "Info_Mod_Valentine_LosZuValentino_15_00"); //Los geht's! AI_StopProcessInfos (self); B_StartOtherRoutine (self, "VALENTINO"); }; INSTANCE Info_Mod_Valentine_FirstStop (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_FirstStop_Condition; information = Info_Mod_Valentine_FirstStop_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_FirstStop_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_LosZuValentino)) && (Npc_GetDistToWp(self, "NW_CITY_TO_LIGHTHOUSE_04") < 300) { return 1; }; }; FUNC VOID Info_Mod_Valentine_FirstStop_Info() { AI_Output(self, hero, "Info_Mod_Valentine_FirstStop_16_00"); //(flüsternd) Dort vorn sind schon die ersten beiden dieser Verbrecherbande. AI_Output(self, hero, "Info_Mod_Valentine_FirstStop_16_01"); //Scheinen mir aber noch Neulinge zu sein, sie sehen nicht gerade wie ernste Gegner aus. AI_Output(self, hero, "Info_Mod_Valentine_FirstStop_16_02"); //Ich denke, du kannst sie ohne Weiteres ausschalten. Pass nur auf, dass sie keine Verstärkung holen. AI_StopProcessInfos (self); B_StartOtherRoutine (self, "FIRSTGANGSTER"); }; INSTANCE Info_Mod_Valentine_FirstStop_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_FirstStop_Fertig_Condition; information = Info_Mod_Valentine_FirstStop_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_FirstStop_Fertig_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_FirstStop)) && (Npc_IsDead(Mod_7026_OUT_Entfuehrer_NW)) && (Npc_IsDead(Mod_7027_OUT_Entfuehrer_NW)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_FirstStop_Fertig_Info() { AI_Output(self, hero, "Info_Mod_Valentine_FirstStop_Fertig_16_00"); //Gut so! Aber der schwierige Teil kommt erst noch. Folge mir! AI_StopProcessInfos (self); B_StartOtherRoutine (self, "TOZELT"); }; INSTANCE Info_Mod_Valentine_SecondStop (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_SecondStop_Condition; information = Info_Mod_Valentine_SecondStop_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_SecondStop_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_FirstStop_Fertig)) && (Npc_GetDistToWp(self, "NW_CITY_JAEGER_08") < 300) { return 1; }; }; FUNC VOID Info_Mod_Valentine_SecondStop_Info() { AI_Output(self, hero, "Info_Mod_Valentine_SecondStop_16_00"); //(die ganze Zeit über flüsternd) Psst! Da vorn sind sie. AI_Output(self, hero, "Info_Mod_Valentine_SecondStop_16_01"); //Jetzt zu meinem Plan: Du bleibst genau hier stehen und ich schleiche mich an das Lager heran und spioniere die Bewacher aus. AI_Output(self, hero, "Info_Mod_Valentine_SecondStop_16_02"); //Vielleicht kann man sie irgendwie voneinander trennen oder sich an ihnen vorbei schleichen. AI_Output(hero, self, "Info_Mod_Valentine_SecondStop_15_03"); //(ebenfalls immer flüsternd) Wieso soll nicht ich das machen? AI_Output(self, hero, "Info_Mod_Valentine_SecondStop_16_04"); //Weil sie dich suchen und mich nicht. Wenn ich entdeckt werde, kann ich immer noch unschuldig tun. AI_Output(self, hero, "Info_Mod_Valentine_SecondStop_16_05"); //Aber am besten wäre es wohl, du sagst mir, was ich tun soll. Das ist meine erste Unternehmung dieser Art! AI_StopProcessInfos (self); B_StartOtherRoutine (self, "ATZELT"); }; INSTANCE Info_Mod_Valentine_Spy01 (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Spy01_Condition; information = Info_Mod_Valentine_Spy01_Info; permanent = 0; important = 0; description = "Kundschafte das Lager heimlich aus."; }; FUNC INT Info_Mod_Valentine_Spy01_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_SecondStop)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Spy01_Info() { AI_Output(hero, self, "Info_Mod_Valentine_Spy01_15_00"); //Kundschafte das Lager heimlich aus. AI_SetWalkMode (self, NPC_SNEAK); AI_GotoWP (self, "NW_CITY_JAEGER_11"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; INSTANCE Info_Mod_Valentine_Spy01_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Spy01_Fertig_Condition; information = Info_Mod_Valentine_Spy01_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_Spy01_Fertig_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Spy01)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Spy01_Fertig_Info() { AI_Output(self, hero, "Info_Mod_Valentine_Spy01_Fertig_16_00"); //Drei Mann stehen um das Zelt herum, und im Zelt zeichnen sich drei Schatten ab; einer davon wird Valentino sein. AI_Output(self, hero, "Info_Mod_Valentine_Spy01_Fertig_16_01"); //Was soll ich jetzt tun? B_LogEntry (TOPIC_MOD_MOE_VALENTINO, "Valentino wird in einem Zelt von zwei Männern bewacht. Um das Zelt herum stehen drei weitere Wächter. Es wird wohl etwas mehr als Draufhauen brauchen, an Valentino heran zu kommen ..."); }; INSTANCE Info_Mod_Valentine_Spy02 (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Spy02_Condition; information = Info_Mod_Valentine_Spy02_Info; permanent = 0; important = 0; description = "Kundschafte das Lager noch mal aus und achte auf besondere Eigenschaften."; }; FUNC INT Info_Mod_Valentine_Spy02_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Spy01_Fertig)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Spy02_Info() { AI_Output(hero, self, "Info_Mod_Valentine_Spy02_15_00"); //Kundschafte das Lager noch mal aus und achte auf besondere Eigenschaften der Wächter. AI_SetWalkMode (self, NPC_SNEAK); AI_GotoWP (self, "NW_CITY_JAEGER_11"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; INSTANCE Info_Mod_Valentine_Spy02_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Spy02_Fertig_Condition; information = Info_Mod_Valentine_Spy02_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_Spy02_Fertig_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Spy02)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Spy02_Fertig_Info() { if (!Npc_IsDead(Mod_7032_OUT_Entfuehrer_NW)) { AI_Output(self, hero, "Info_Mod_Valentine_Spy02_Fertig_16_00"); //Einer der Wächter bleibt immer auf der Stelle stehen und trinkt unablässig Bier. }; if (!Npc_IsDead(Mod_7030_OUT_Entfuehrer_NW)) { AI_Output(self, hero, "Info_Mod_Valentine_Spy02_Fertig_16_01"); //Einer hat anscheinend eine schwache Blase, er entfernt sich ungefähr zu jeder geraden Stunde vom Lager, um sich zu erleichtern. }; if (!Npc_IsDead(Mod_7031_OUT_Entfuehrer_NW)) { AI_Output(self, hero, "Info_Mod_Valentine_Spy02_Fertig_16_02"); //Einer patrouilliert zwar durchs Lager, sieht dafür aber nicht sehr kräftig aus. }; }; INSTANCE Info_Mod_Valentine_Kill01 (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kill01_Condition; information = Info_Mod_Valentine_Kill01_Info; permanent = 1; important = 0; description = "Misch' dem ersten Wächter eine Überdosis in sein Bier."; }; FUNC INT Info_Mod_Valentine_Kill01_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Spy02_Fertig)) && (!C_NpcIsDown(Mod_7032_OUT_Entfuehrer_NW)) && (Mod_ValentineKill01 == 0) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kill01_Info() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_15_00"); //Misch dem ersten Wächter eine Überdosis in sein Bier. AI_Output(self, hero, "Info_Mod_Valentine_Kill01_16_01"); //Was genau soll ich denn mixen? AI_Output(self, hero, "Info_Mod_Valentine_Kill01_16_02"); //Wenn du zehn Blauflieder hast, wird er von der Überdosis einschlafen. AI_Output(self, hero, "Info_Mod_Valentine_Kill01_16_03"); //Falls du eine Portion Gift hast, wird er zumindest für längere Zeit in Ohnmacht fallen. AI_Output(self, hero, "Info_Mod_Valentine_Kill01_16_04"); //Von drei Portionen Gift dürfte er sicher sterben. Info_ClearChoices (Info_Mod_Valentine_Kill01); Info_AddChoice (Info_Mod_Valentine_Kill01, "Ich überleg's mir doch noch mal.", Info_Mod_Valentine_Kill01_D); if (Npc_HasItems(hero, ItPo_Gift) >= 3) { Info_AddChoice (Info_Mod_Valentine_Kill01, "Gift hab ich genug, daran wird's nicht scheitern.", Info_Mod_Valentine_Kill01_C); }; if (Npc_HasItems(hero, ItPo_Gift) >= 1) { Info_AddChoice (Info_Mod_Valentine_Kill01, "Ich hab nur eine Portion Gift.", Info_Mod_Valentine_Kill01_B); }; if (Npc_HasItems(hero, ItPo_Tiergift) >= 1) { Info_AddChoice (Info_Mod_Valentine_Kill01, "Ich hab hier etwas Tiergift.", Info_Mod_Valentine_Kill01_G); }; if (Npc_HasItems(hero, ItPo_Pflanzengift) >= 1) { Info_AddChoice (Info_Mod_Valentine_Kill01, "Ich hab hier etwas Gewächsgift.", Info_Mod_Valentine_Kill01_F); }; if (Npc_HasItems(hero, ItPo_Mischgift) >= 1) { Info_AddChoice (Info_Mod_Valentine_Kill01, "Ich hab dieses spezielle Gift.", Info_Mod_Valentine_Kill01_E); }; if (Npc_HasItems(hero, ItPl_BluePlant) >= 10) { Info_AddChoice (Info_Mod_Valentine_Kill01, "Hier hast du 10 Blauflieder.", Info_Mod_Valentine_Kill01_A); }; }; FUNC VOID Info_Mod_Valentine_Kill01_D() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_D_15_00"); //Ich überleg's mir doch noch mal. Info_ClearChoices (Info_Mod_Valentine_Kill01); }; FUNC VOID Info_Mod_Valentine_Kill01_C() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_C_15_00"); //Gift hab ich genug, daran wird's nicht scheitern. B_GiveInvItems (hero, self, ItPo_Gift, 3); Mod_ValentineKill01 = 1; Info_ClearChoices (Info_Mod_Valentine_Kill01); AI_SetWalkMode (self, NPC_RUN); AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Valentine_Kill01_B() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_B_15_00"); //Ich hab nur eine Portion Gift. B_GiveInvItems (hero, self, ItPo_Gift, 1); Mod_ValentineKill01 = 1; Info_ClearChoices (Info_Mod_Valentine_Kill01); AI_SetWalkMode (self, NPC_RUN); AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Valentine_Kill01_G() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_G_15_00"); //Ich hab hier etwas Tiergift. B_GiveInvItems (hero, self, ItPo_Tiergift, 1); Mod_ValentineKill01 = 1; Info_ClearChoices (Info_Mod_Valentine_Kill01); AI_SetWalkMode (self, NPC_RUN); AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Valentine_Kill01_F() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_F_15_00"); //Ich hab hier etwas Gewächsgift. B_GiveInvItems (hero, self, ItPo_Pflanzengift, 1); Mod_ValentineKill01 = 1; Info_ClearChoices (Info_Mod_Valentine_Kill01); AI_SetWalkMode (self, NPC_RUN); AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Valentine_Kill01_E() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_E_15_00"); //Ich hab dieses spezielle Gift. B_GiveInvItems (hero, self, ItPo_Mischgift, 1); Mod_ValentineKill01 = 1; Info_ClearChoices (Info_Mod_Valentine_Kill01); AI_SetWalkMode (self, NPC_RUN); AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; FUNC VOID Info_Mod_Valentine_Kill01_A() { AI_Output(hero, self, "Info_Mod_Valentine_Kill01_A_15_00"); //Hier hast du 10 Blauflieder. B_GiveInvItems (hero, self, ItPl_BluePlant, 10); Mod_ValentineKill01 = 1; Info_ClearChoices (Info_Mod_Valentine_Kill01); AI_SetWalkMode (self, NPC_RUN); AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); }; INSTANCE Info_Mod_Valentine_Kill01_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kill01_Fertig_Condition; information = Info_Mod_Valentine_Kill01_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_Kill01_Fertig_Condition() { if ((Npc_HasItems(self, ItPo_Gift) >= 3) || (Npc_HasItems(self, ItPo_Gift) >= 1) || (Npc_HasItems(self, ItPo_Mischgift) >= 1) || (Npc_HasItems(self, ItPo_Tiergift) >= 1) || (Npc_HasItems(self, ItPo_Pflanzengift) >= 1) || (Npc_HasItems(self, ItPl_BluePlant) >= 10)) && (Mod_ValentineKill01 == 1) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kill01_Fertig_Info() { if (Npc_HasItems(self, ItPo_Gift) >= 3) || (Npc_HasItems(self, ItPo_Pflanzengift) >= 1) || (Npc_HasItems(self, ItPo_Tiergift) >= 1) || (Npc_HasItems(self, ItPo_Mischgift) >= 1) { AI_Output(self, hero, "Info_Mod_Valentine_Kill01_Fertig_16_00"); //Der dürfte nie wieder aufstehen. B_GivePlayerXP (Mod_7032_OUT_Entfuehrer_NW.level/2); B_KillNpc (Mod_7032_OUT_Entfuehrer_NW); } else if (Npc_HasItems(self, ItPo_Gift) >= 1) { AI_Output(self, hero, "Info_Mod_Valentine_Kill01_Fertig_16_01"); //Der wird so bald nicht mehr aufstehen. B_StartOtherRoutine (Mod_7032_OUT_Entfuehrer_NW, "SLEEP"); Mod_7032_OUT_Entfuehrer_NW.flags = 2; } else if (Npc_HasItems(self, ItPl_BluePlant) >= 10) { AI_Output(self, hero, "Info_Mod_Valentine_Kill01_Fertig_16_02"); //Der macht erstmal ein kleines Schläfchen. B_StartOtherRoutine (Mod_7032_OUT_Entfuehrer_NW, "SLEEP"); Mod_7032_OUT_Entfuehrer_NW.flags = 2; }; }; INSTANCE Info_Mod_Valentine_Kill02 (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kill02_Condition; information = Info_Mod_Valentine_Kill02_Info; permanent = 1; important = 0; description = "Locke den schwachen Wächter hierher."; }; FUNC INT Info_Mod_Valentine_Kill02_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Spy02_Fertig)) && (!Npc_IsDead(Mod_7031_OUT_Entfuehrer_NW)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kill02_Info() { AI_Output(hero, self, "Info_Mod_Valentine_Kill02_15_00"); //Locke den schwachen Wächter hierher. AI_SetWalkMode (self, NPC_RUN); Mod_ValentineKill02 = 1; AI_GotoWP (self, "NW_CITY_JAEGER_18"); AI_GotoWP (self, "NW_CITY_JAEGER_08"); AI_StopProcessInfos (self); B_StartOtherRoutine (Mod_7031_OUT_Entfuehrer_NW, "KILLER"); }; INSTANCE Info_Mod_Valentine_Kill02_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kill02_Fertig_Condition; information = Info_Mod_Valentine_Kill02_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_Kill02_Fertig_Condition() { if (Mod_ValentineKill02 == 1) && (Npc_IsDead(Mod_7031_OUT_Entfuehrer_NW)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kill02_Fertig_Info() { AI_Output(self, hero, "Info_Mod_Valentine_Kill02_Fertig_16_00"); //Der steht so schnell nicht wieder auf. Einer weniger, um den wir uns sorgen müssen. }; INSTANCE Info_Mod_Valentine_Kill03 (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kill03_Condition; information = Info_Mod_Valentine_Kill03_Info; permanent = 1; important = 0; description = "Ich kümmere mich mal kurz um den mit der schwachen Blase."; }; FUNC INT Info_Mod_Valentine_Kill03_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_Spy02_Fertig)) && (!Npc_IsDead(Mod_7031_OUT_Entfuehrer_NW)) && (Mod_ValentineKill03 == 0) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kill03_Info() { AI_Output(hero, self, "Info_Mod_Valentine_Kill03_15_00"); //Ich kümmere mich mal kurz um den mit der schwachen Blase. Mod_ValentineKill03 = 1; AI_StopProcessInfos (self); }; INSTANCE Info_Mod_Valentine_Kill03_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Kill03_Fertig_Condition; information = Info_Mod_Valentine_Kill03_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_Kill03_Fertig_Condition() { if ((Mod_ValentineKill03 == 1) && (Npc_IsDead(Mod_7030_OUT_Entfuehrer_NW))) || (Mod_ValentineKill03 == 2) { return 1; }; }; FUNC VOID Info_Mod_Valentine_Kill03_Fertig_Info() { AI_Output(self, hero, "Info_Mod_Valentine_Kill03_Fertig_16_00"); //Gut gemacht. Was kommt als nächstes? }; INSTANCE Info_Mod_Valentine_AllKills_Fertig (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_AllKills_Fertig_Condition; information = Info_Mod_Valentine_AllKills_Fertig_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_AllKills_Fertig_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_SecondStop)) && ((Npc_IsDead(Mod_7030_OUT_Entfuehrer_NW)) || (Mod_ValentineKill03 == 2)) && (Npc_IsDead(Mod_7031_OUT_Entfuehrer_NW)) && ((Npc_IsDead(Mod_7032_OUT_Entfuehrer_NW)) || (Npc_IsInState(Mod_7032_OUT_Entfuehrer_NW, ZS_Drained))) { return 1; }; }; FUNC VOID Info_Mod_Valentine_AllKills_Fertig_Info() { AI_Output(self, hero, "Info_Mod_Valentine_AllKills_Fertig_16_00"); //Gut! Ich hätte nicht damit gerechnet, dass wir so weit kommen. AI_Output(self, hero, "Info_Mod_Valentine_AllKills_Fertig_16_01"); //Jetzt müssen wir nur noch die zwei Verbrecher im Zelt erledigen, ohne dass sie Valentino etwas antun. B_LogEntry (TOPIC_MOD_MOE_VALENTINO, "Die ersten drei Wächter sind erledigt, bleiben zwei."); }; INSTANCE Info_Mod_Valentine_ValentinoFrei (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_ValentinoFrei_Condition; information = Info_Mod_Valentine_ValentinoFrei_Info; permanent = 0; important = 1; }; FUNC INT Info_Mod_Valentine_ValentinoFrei_Condition() { if (Npc_KnowsInfo(hero, Info_Mod_Valentine_AllKills_Fertig)) && (Npc_KnowsInfo(hero, Info_Mod_Valentino_Kidnapped)) { return 1; }; }; FUNC VOID Info_Mod_Valentine_ValentinoFrei_Info() { AI_Output(self, hero, "Info_Mod_Valentine_ValentinoFrei_16_00"); //(fröhlich) Hätte nicht gedacht, dass das so einfach wird. AI_Output(hero, self, "Info_Mod_Valentine_ValentinoFrei_15_01"); //Es war auch nicht besonders einfach. AI_Output(self, hero, "Info_Mod_Valentine_ValentinoFrei_16_02"); //Wie auch immer. Ich fand es unglaublich spannend. AI_StopProcessInfos (self); B_StartOtherRoutine (self, "START"); }; INSTANCE Info_Mod_Valentine_Pickpocket (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_Pickpocket_Condition; information = Info_Mod_Valentine_Pickpocket_Info; permanent = 1; important = 0; description = Pickpocket_60_Female; }; FUNC INT Info_Mod_Valentine_Pickpocket_Condition() { C_Beklauen (56, ItMi_Gold, 85); }; FUNC VOID Info_Mod_Valentine_Pickpocket_Info() { Info_ClearChoices (Info_Mod_Valentine_Pickpocket); Info_AddChoice (Info_Mod_Valentine_Pickpocket, DIALOG_BACK, Info_Mod_Valentine_Pickpocket_BACK); Info_AddChoice (Info_Mod_Valentine_Pickpocket, DIALOG_PICKPOCKET, Info_Mod_Valentine_Pickpocket_DoIt); }; FUNC VOID Info_Mod_Valentine_Pickpocket_BACK() { Info_ClearChoices (Info_Mod_Valentine_Pickpocket); }; FUNC VOID Info_Mod_Valentine_Pickpocket_DoIt() { if (B_Beklauen() == TRUE) { Info_ClearChoices (Info_Mod_Valentine_Pickpocket); } else { Info_ClearChoices (Info_Mod_Valentine_Pickpocket); Info_AddChoice (Info_Mod_Valentine_Pickpocket, DIALOG_PP_BESCHIMPFEN, Info_Mod_Valentine_Pickpocket_Beschimpfen); Info_AddChoice (Info_Mod_Valentine_Pickpocket, DIALOG_PP_BESTECHUNG, Info_Mod_Valentine_Pickpocket_Bestechung); Info_AddChoice (Info_Mod_Valentine_Pickpocket, DIALOG_PP_HERAUSREDEN, Info_Mod_Valentine_Pickpocket_Herausreden); }; }; FUNC VOID Info_Mod_Valentine_Pickpocket_Beschimpfen() { B_Say (hero, self, "$PICKPOCKET_BESCHIMPFEN"); B_Say (self, hero, "$DIRTYTHIEF"); Info_ClearChoices (Info_Mod_Valentine_Pickpocket); AI_StopProcessInfos (self); B_Attack (self, hero, AR_Theft, 1); }; FUNC VOID Info_Mod_Valentine_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_Valentine_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_Valentine_Pickpocket); AI_StopProcessInfos (self); }; }; FUNC VOID Info_Mod_Valentine_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_Valentine_Pickpocket); } else { B_Say (self, hero, "$PICKPOCKET_HERAUSREDEN_02"); }; }; INSTANCE Info_Mod_Valentine_EXIT (C_INFO) { npc = Mod_1197_VLK_Valentine_NW; nr = 1; condition = Info_Mod_Valentine_EXIT_Condition; information = Info_Mod_Valentine_EXIT_Info; permanent = 1; important = 0; description = DIALOG_ENDE; }; FUNC INT Info_Mod_Valentine_EXIT_Condition() { return 1; }; FUNC VOID Info_Mod_Valentine_EXIT_Info() { AI_StopProcessInfos (self); };
D
/** Reference counting using the GC. The RefCounted struct simply stores the item in a GC block, and also adds a root to that block. Once all known references to the block are removed (tracked by a reference count in the block), then the block is removed, and the destructor run. Since it's a root, it can run the full destructor of the data underneath, without worrying about GC data being collected underneath it. This depends on the block not being involved in a cycle, which should be fine for iopipes. Note that atomics are used for the reference count because the GC can destroy things in other threads. */ module iopipe.refc; /** * A struct to ensure only one copy of the provided item exists. * * This differs from Phobos' std.typecons.RefCounted by using the GC to store * the memory, instead of C's heap. The benefit here is that this version of * RefCounted can be @safe. * * The block containing the item is pinned in the GC until all references are * gone, which means the destructor will be run synchronously when the last * reference is removed. Therefore, it is safe to store a RefCounted struct * inside a GC allocated type. */ struct RefCounted(T) { /// Constructor. the underlying T is constructed using the parameters. this(Args...)(auto ref Args args) { import core.memory : GC; // need to use untyped memory, so we don't get a dtor call by the GC. import std.traits : hasIndirections; import std.conv : emplace; static if(hasIndirections!T) auto rawMem = new void[Impl.sizeof]; else auto rawMem = new ubyte[Impl.sizeof]; _impl = (() @trusted => cast(Impl*)rawMem.ptr)(); emplace(_impl, args); () @trusted { GC.addRoot(_impl); }(); } private struct Impl { this(ref T _item) { import std.algorithm : move; item = move(_item); } this(Args...)(auto ref Args args) { item = T(args); } T item; shared int _count = 1; } /** Get a reference to the item. Note that if you store a reference to this * item, it is possible the item will in the future be destroyed, but the * memory will still be present (until the GC cleans it up). */ ref T _get() return { assert(_impl, "Invalid refcounted access"); return _impl.item; } this(this) { if(_impl) { import core.atomic; _impl._count.atomicOp!"+="(1); } } ~this() { if(_impl) { assert(_impl._count > 0, "Invalid count detected"); import core.atomic; if(_impl._count.atomicOp!"-="(1) == 0) { destroy(_impl.item); import core.memory : GC; () @trusted { GC.removeRoot(_impl); } (); } _impl = null; } } /// Assignment to another ref counted item. void opAssign(RefCounted other) { import std.algorithm : swap; swap(_impl, other._impl); } /// Assignment to another T. void opAssign(T other) { import std.algorithm : move; move(other, _impl.item); } /// Alias the item to this struct. alias _get this; private: private Impl * _impl; } /// Return a ref counted version of the given item. RefCounted!T refCounted(T)(auto ref T item) { return RefCounted!T(item); } /// @safe unittest { // note that destructor is called from the parameter to refCounted, so we // must trigger only counting destruction of non-init instances of the // struct. size_t dtorcalled = 0; struct S { int x; @safe ~this() {if(x) dtorcalled++;} @disable this(this); } { auto destroyme = S(1).refCounted; auto dm2 = destroyme; auto dm3 = destroyme; } assert(dtorcalled == 1); }
D
/** * Provide aliases for arrays of certain declarations or statements. * * 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/dmd/arraytypes.d, _arraytypes.d) * Documentation: https://dlang.org/phobos/dmd_arraytypes.html * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/arraytypes.d */ module dmd.arraytypes; import dmd.dclass; import dmd.declaration; import dmd.dmodule; import dmd.dsymbol; import dmd.dtemplate; import dmd.expression; import dmd.func; import dmd.identifier; import dmd.init; import dmd.mtype; import dmd.root.array; import dmd.root.rootobject; import dmd.statement; alias Strings = Array!(const(char)*); alias Identifiers = Array!(Identifier); alias TemplateParameters = Array!(TemplateParameter); alias Expressions = Array!(Expression); alias Statements = Array!(Statement); alias BaseClasses = Array!(BaseClass*); alias ClassDeclarations = Array!(ClassDeclaration); alias Dsymbols = Array!(Dsymbol); alias Objects = Array!(RootObject); alias DtorDeclarations = Array!(DtorDeclaration); alias FuncDeclarations = Array!(FuncDeclaration); alias Parameters = Array!(Parameter); alias Initializers = Array!(Initializer); alias VarDeclarations = Array!(VarDeclaration); alias Types = Array!(Type); alias Catches = Array!(Catch); alias StaticDtorDeclarations = Array!(StaticDtorDeclaration); alias SharedStaticDtorDeclarations = Array!(SharedStaticDtorDeclaration); alias AliasDeclarations = Array!(AliasDeclaration); alias Modules = Array!(Module); alias CaseStatements = Array!(CaseStatement); alias ScopeStatements = Array!(ScopeStatement); alias GotoCaseStatements = Array!(GotoCaseStatement); alias ReturnStatements = Array!(ReturnStatement); alias GotoStatements = Array!(GotoStatement); alias TemplateInstances = Array!(TemplateInstance); alias Ensures = Array!(Ensure); alias Designators = Array!(Designator); alias DesigInits = Array!(DesigInit);
D
module android.java.android.view.animation.DecelerateInterpolator_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import1 = android.java.android.util.AttributeSet_d_interface; import import2 = android.java.java.lang.Class_d_interface; import import0 = android.java.android.content.Context_d_interface; final class DecelerateInterpolator : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import this(arsd.jni.Default); @Import this(float); @Import this(import0.Context, import1.AttributeSet); @Import float getInterpolation(float); @Import import2.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/animation/DecelerateInterpolator;"; }
D
/++ $(H2 Constant Interpolation) See_also: $(REF_ALTTEXT $(TT interp1), interp1, mir, interpolate) License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0). Copyright: Copyright © 2017, Kaleidic Associates Advisory Limited Authors: Ilya Yaroshenko Macros: SUBREF = $(REF_ALTTEXT $(TT $2), $2, mir, interpolate, $1)$(NBSP) T2=$(TR $(TDNW $(LREF $1)) $(TD $+)) +/ module mir.interpolate.constant; @optmath: /// version(mir_test) @safe pure unittest { import mir.ndslice; import std.math: approxEqual; immutable x = [0, 1, 2, 3]; immutable y = [10, 20, 30, 40]; auto interpolant = constant!int(x.sliced, y.sliced); assert(interpolant(-1) == 10); assert(interpolant(0) == 10); assert(interpolant(0.5) == 10); assert(interpolant(1) == 20); assert(interpolant(3) == 40); assert(interpolant(4) == 40); } import std.traits; import std.meta: AliasSeq, staticMap; import mir.array.primitives; import mir.ndslice.slice; import mir.internal.utility; import mir.math.common: optmath; public import mir.interpolate: atInterval; import mir.interpolate; /++ Constructs multivariate constant interpolant with nodes on rectilinear grid. Params: grid = `x` values for interpolant values = `f(x)` values for interpolant Constraints: `grid`, `values` must have the same length >= 1 Returns: $(LREF Constant) +/ template constant(T, size_t N = 1, FirstGridIterator = immutable(T)*, NextGridIterators = Repeat!(N - 1, FirstGridIterator)) if (is(T == Unqual!T) && N <= 6) { static if (N > 1) pragma(msg, "Warning: multivariate constant interpolant was not tested."); @optmath: private alias GridIterators = AliasSeq!(FirstGridIterator, NextGridIterators); private alias GridVectors = Constant!(T, N, GridIterators).GridVectors; /++ Params: grid = immutable `x` values for interpolant values = `f(x)` values for interpolant forceCopyValues = always copy `values` if set Constraints: `grid` and `values` must have the same length >= 3 Returns: $(LREF Spline) +/ Constant!(T, N, GridIterators) constant(SliceKind ykind, yIterator)( GridVectors grid, scope Slice!(ykind, [1], yIterator) values, bool forceCopyValues = false ) pure { static if (__traits(compiles, typeof(return)(grid, values))) { if (!forceCopyValues) { return typeof(return)(grid, values); } } import std.algorithm.mutation: move; auto ret = typeof(return)(grid); ret._data[] = values; return ret.move; } } /++ Multivariate constant interpolant with nodes on rectilinear grid. +/ struct Constant(F, size_t N = 1, FirstGridIterator = immutable(F)*, NextGridIterators = Repeat!(N - 1, FirstGridIterator)) if (N && N <= 6 && NextGridIterators.length == N - 1) { package alias GridIterators = AliasSeq!(FirstGridIterator, NextGridIterators); package alias GridVectors = staticMap!(GridVector, GridIterators); @optmath: /// Aligned buffer allocated with `mir.internal.memory`. $(RED For internal use.) Slice!(Contiguous, [N], F*) _data; /// Grid iterators. $(RED For internal use.) GridIterators _grid; /// bool _ownsData; import mir.utility: min, max; package enum alignment = min(64u, F.sizeof).max(size_t.sizeof); package ref shared(sizediff_t) counter() @trusted @property { assert(_ownsData); auto p = cast(shared sizediff_t*) _data.ptr; return *(p - 1); } /// this(this) @safe nothrow @nogc { import core.atomic: atomicOp; if (_ownsData) counter.atomicOp!"+="(1); } /++ Frees _data if $(LREF Spline._freeData) is true. +/ ~this() @trusted nothrow @nogc { import mir.internal.memory; import core.atomic: atomicOp; if (_ownsData) if (counter.atomicOp!"-="(1) <= 0) alignedFree(cast(void*)(_data.ptr) - alignment); } /++ +/ this()(GridVectors grid) @trusted nothrow @nogc { import mir.internal.memory; import mir.ndslice.topology: iota; size_t[N] shape; foreach(i, ref x; grid) { assert(x.length >= 1, "constant interpolant: minimal allowed length for the grid equals 1."); shape[i] = x.length; } auto data_ptr = cast(F*) (alignedAllocate(F.sizeof * shape.iota.elementsCount + alignment, alignment) + alignment); if(data_ptr is null) assert(0, "No memory"); this._data = data_ptr.sliced(shape); this._grid = staticMap!(iter, grid); this._ownsData = true; this.counter = 1; } /++ +/ this()(GridVectors grid, Slice!(Contiguous, [N], immutable(F)*) values) @trusted nothrow @nogc { foreach(i, ref x; grid) { assert(x.length >= 1, "constant interpolant: minimal allowed length for the grid equals 1."); assert(values.length!i == x.length, "grid length should mutch to the values length"); } this._data = values; this._grid = staticMap!(iter, grid); this._ownsData = false; } @trusted: /// GridVectors[dimension] grid(size_t dimension = 0)() const @property if (dimension < N) { return _grid[dimension].sliced(_data._lengths[dimension]); } /++ Returns: intervals count. +/ size_t intervalCount(size_t dimension = 0)() const @property { assert(_data._lengths[dimension] > 0); return _data._lengths[dimension] - 0; } /// size_t[N] gridShape()() const @property { return _data.shape; } /// enum uint derivativeOrder = 0; /// template opCall(uint derivative = 0) if (derivative <= derivativeOrder) { @trusted: /++ `(x)` and `[x]` operators. Complexity: `O(log(grid.length))` +/ auto opCall(X...)(in X xs) const if (X.length == N) // @FUTURE@ // X.length == N || derivative == 0 && X.length && X.length <= N { size_t[N] indexes = void; foreach(i; Iota!N) { static if (isInterval!(typeof(xs[i]))) indexes[i] = xs[i][1]; else indexes[i] = _data._lengths[i] > 1 ? this.findInterval!i(xs[i]) : 0; } return _data[indexes]; } } }
D
/Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.build/Portal.swift.o : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/RFC1123.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Polymorphic.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Sequence.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Collection+Safe.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Cache.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Extendable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/EmptyInitializable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataFile.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+CaseInsensitiveCompare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Semaphore.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Dispatch.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Lock.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Portal.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/FileProtocol.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/StaticDataBuffer.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/DispatchTime+Utilities.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Bits.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Result.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Int+Hex.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Array.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/WorkingDirectory.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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 /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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.build/Portal~partial.swiftmodule : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/RFC1123.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Polymorphic.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Sequence.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Collection+Safe.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Cache.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Extendable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/EmptyInitializable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataFile.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+CaseInsensitiveCompare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Semaphore.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Dispatch.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Lock.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Portal.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/FileProtocol.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/StaticDataBuffer.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/DispatchTime+Utilities.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Bits.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Result.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Int+Hex.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Array.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/WorkingDirectory.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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 /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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Core.build/Portal~partial.swiftdoc : /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/RFC1123.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+Polymorphic.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Sequence.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Collection+Safe.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Cache.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Extendable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/EmptyInitializable.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/DataFile.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String+CaseInsensitiveCompare.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Semaphore.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/String.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Dispatch.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Lock.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Portal.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/FileProtocol.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/StaticDataBuffer.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/DispatchTime+Utilities.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Bits.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Exports.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Result.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Int+Hex.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/Array.swift /Users/chenzuncheng/Desktop/vaporTest/.build/checkouts/core.git-9210800844849382486/Sources/Core/WorkingDirectory.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/libc.swiftmodule /Users/chenzuncheng/Desktop/vaporTest/.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 /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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/Bits.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/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap /Users/chenzuncheng/Desktop/vaporTest/.build/x86_64-apple-macosx10.10/debug/CSQLite.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
module android.java.android.preference.CheckBoxPreference; public import android.java.android.preference.CheckBoxPreference_d_interface; import arsd.jni : ImportExportImpl; mixin ImportExportImpl!CheckBoxPreference; import import6 = android.java.android.view.View; import import12 = android.java.android.content.SharedPreferences_Editor; import import15 = android.java.android.preference.PreferenceGroup; import import17 = android.java.java.lang.Class; import import11 = android.java.android.content.SharedPreferences; import import14 = android.java.android.preference.PreferenceManager; import import5 = android.java.android.os.Bundle;
D
// Written in the D programming language. /** Utilities for manipulating files and scanning directories. Functions in this module handle files as a unit, e.g., read or write one file at a time. For opening files and manipulating them via handles refer to module $(MREF std, stdio). $(SCRIPT inhibitQuickIndex = 1;) $(BOOKTABLE, $(TR $(TH Category) $(TH Functions)) $(TR $(TD General) $(TD $(LREF exists) $(LREF isDir) $(LREF isFile) $(LREF isSymlink) $(LREF rename) $(LREF thisExePath) )) $(TR $(TD Directories) $(TD $(LREF chdir) $(LREF dirEntries) $(LREF getcwd) $(LREF mkdir) $(LREF mkdirRecurse) $(LREF rmdir) $(LREF rmdirRecurse) $(LREF tempDir) )) $(TR $(TD Files) $(TD $(LREF append) $(LREF copy) $(LREF read) $(LREF readText) $(LREF remove) $(LREF slurp) $(LREF write) )) $(TR $(TD Symlinks) $(TD $(LREF symlink) $(LREF readLink) )) $(TR $(TD Attributes) $(TD $(LREF attrIsDir) $(LREF attrIsFile) $(LREF attrIsSymlink) $(LREF getAttributes) $(LREF getLinkAttributes) $(LREF getSize) $(LREF setAttributes) )) $(TR $(TD Timestamp) $(TD $(LREF getTimes) $(LREF getTimesWin) $(LREF setTimes) $(LREF timeLastModified) $(LREF timeLastAccessed) $(LREF timeStatusChanged) )) $(TR $(TD Other) $(TD $(LREF DirEntry) $(LREF FileException) $(LREF PreserveAttributes) $(LREF SpanMode) )) ) Copyright: Copyright The D Language Foundation 2007 - 2011. See_Also: The $(HTTP ddili.org/ders/d.en/files.html, official tutorial) for an introduction to working with files in D, module $(MREF std, stdio) for opening files and manipulating them via handles, and module $(MREF std, path) for manipulating path strings. License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(HTTP digitalmars.com, Walter Bright), $(HTTP erdani.org, Andrei Alexandrescu), $(HTTP jmdavisprog.com, Jonathan M Davis) Source: $(PHOBOSSRC std/file.d) */ module std.file; import core.stdc.errno, core.stdc.stdlib, core.stdc.string; import core.time : abs, dur, hnsecs, seconds; import std.datetime.date : DateTime; import std.datetime.systime : Clock, SysTime, unixTimeToStdTime; import std.internal.cstring; import std.meta; import std.range.primitives; import std.traits; import std.typecons; version (Windows) { import core.sys.windows.winbase, core.sys.windows.winnt, std.windows.syserror; } else version (Posix) { import core.sys.posix.dirent, core.sys.posix.fcntl, core.sys.posix.sys.stat, core.sys.posix.sys.time, core.sys.posix.unistd, core.sys.posix.utime; } else static assert(false, "Module " ~ .stringof ~ " not implemented for this OS."); // Character type used for operating system filesystem APIs version (Windows) { private alias FSChar = WCHAR; // WCHAR can be aliased to wchar or wchar_t } else version (Posix) { private alias FSChar = char; } else static assert(0); // Purposefully not documented. Use at your own risk @property string deleteme() @safe { import std.conv : text; import std.path : buildPath; import std.process : thisProcessID; enum base = "deleteme.dmd.unittest.pid"; static string fileName; if (!fileName) fileName = text(buildPath(tempDir(), base), thisProcessID); return fileName; } version (unittest) private struct TestAliasedString { string get() @safe @nogc pure nothrow { return _s; } alias get this; @disable this(this); string _s; } version (Android) { package enum system_directory = "/system/etc"; package enum system_file = "/system/etc/hosts"; } else version (Posix) { package enum system_directory = "/usr/include"; package enum system_file = "/usr/include/assert.h"; } /++ Exception thrown for file I/O errors. +/ class FileException : Exception { import std.conv : text, to; /++ OS error code. +/ immutable uint errno; private this(scope const(char)[] name, scope const(char)[] msg, string file, size_t line, uint errno) @safe pure { if (msg.empty) super(name.idup, file, line); else super(text(name, ": ", msg), file, line); this.errno = errno; } /++ Constructor which takes an error message. Params: name = Name of file for which the error occurred. msg = Message describing the error. file = The file where the error occurred. line = The _line where the error occurred. +/ this(scope const(char)[] name, scope const(char)[] msg, string file = __FILE__, size_t line = __LINE__) @safe pure { this(name, msg, file, line, 0); } /++ Constructor which takes the error number ($(LUCKY GetLastError) in Windows, $(D_PARAM errno) in Posix). Params: name = Name of file for which the error occurred. errno = The error number. file = The file where the error occurred. Defaults to `__FILE__`. line = The _line where the error occurred. Defaults to `__LINE__`. +/ version (Windows) this(scope const(char)[] name, uint errno = .GetLastError(), string file = __FILE__, size_t line = __LINE__) @safe { this(name, sysErrorString(errno), file, line, errno); } else version (Posix) this(scope const(char)[] name, uint errno = .errno, string file = __FILE__, size_t line = __LINE__) @trusted { import std.exception : errnoString; this(name, errnoString(errno), file, line, errno); } } /// @safe unittest { import std.exception : assertThrown; assertThrown!FileException("non.existing.file.".readText); } private T cenforce(T)(T condition, lazy scope const(char)[] name, string file = __FILE__, size_t line = __LINE__) { if (condition) return condition; version (Windows) { throw new FileException(name, .GetLastError(), file, line); } else version (Posix) { throw new FileException(name, .errno, file, line); } } version (Windows) @trusted private T cenforce(T)(T condition, scope const(char)[] name, scope const(FSChar)* namez, string file = __FILE__, size_t line = __LINE__) { if (condition) return condition; if (!name) { import core.stdc.wchar_ : wcslen; import std.conv : to; auto len = namez ? wcslen(namez) : 0; name = to!string(namez[0 .. len]); } throw new FileException(name, .GetLastError(), file, line); } version (Posix) @trusted private T cenforce(T)(T condition, scope const(char)[] name, scope const(FSChar)* namez, string file = __FILE__, size_t line = __LINE__) { if (condition) return condition; if (!name) { import core.stdc.string : strlen; auto len = namez ? strlen(namez) : 0; name = namez[0 .. len].idup; } throw new FileException(name, .errno, file, line); } @safe unittest { // issue 17102 try { cenforce(false, null, null, __FILE__, __LINE__); } catch (FileException) {} } /* ********************************** * Basic File operations. */ /******************************************** Read entire contents of file `name` and returns it as an untyped array. If the file size is larger than `upTo`, only `upTo` bytes are _read. Params: name = string or range of characters representing the file _name upTo = if present, the maximum number of bytes to _read Returns: Untyped array of bytes _read. Throws: $(LREF FileException) on error. */ void[] read(R)(R name, size_t upTo = size_t.max) if (isInputRange!R && isSomeChar!(ElementEncodingType!R) && !isInfinite!R && !isConvertibleToString!R) { static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) return readImpl(name, name.tempCString!FSChar(), upTo); else return readImpl(null, name.tempCString!FSChar(), upTo); } /// @safe unittest { import std.utf : byChar; scope(exit) { assert(exists(deleteme)); remove(deleteme); } std.file.write(deleteme, "1234"); // deleteme is the name of a temporary file assert(read(deleteme, 2) == "12"); assert(read(deleteme.byChar) == "1234"); assert((cast(const(ubyte)[])read(deleteme)).length == 4); } /// ditto void[] read(R)(auto ref R name, size_t upTo = size_t.max) if (isConvertibleToString!R) { return read!(StringTypeOf!R)(name, upTo); } @safe unittest { static assert(__traits(compiles, read(TestAliasedString(null)))); } version (Posix) private void[] readImpl(scope const(char)[] name, scope const(FSChar)* namez, size_t upTo = size_t.max) @trusted { import core.memory : GC; import std.algorithm.comparison : min; import std.conv : to; import std.experimental.checkedint : checked; // A few internal configuration parameters { enum size_t minInitialAlloc = 1024 * 4, maxInitialAlloc = size_t.max / 2, sizeIncrement = 1024 * 16, maxSlackMemoryAllowed = 1024; // } immutable fd = core.sys.posix.fcntl.open(namez, core.sys.posix.fcntl.O_RDONLY); cenforce(fd != -1, name); scope(exit) core.sys.posix.unistd.close(fd); stat_t statbuf = void; cenforce(fstat(fd, &statbuf) == 0, name, namez); immutable initialAlloc = min(upTo, to!size_t(statbuf.st_size ? min(statbuf.st_size + 1, maxInitialAlloc) : minInitialAlloc)); void[] result = GC.malloc(initialAlloc, GC.BlkAttr.NO_SCAN)[0 .. initialAlloc]; scope(failure) GC.free(result.ptr); auto size = checked(size_t(0)); for (;;) { immutable actual = core.sys.posix.unistd.read(fd, result.ptr + size.get, (min(result.length, upTo) - size).get); cenforce(actual != -1, name, namez); if (actual == 0) break; size += actual; if (size >= upTo) break; if (size < result.length) continue; immutable newAlloc = size + sizeIncrement; result = GC.realloc(result.ptr, newAlloc.get, GC.BlkAttr.NO_SCAN)[0 .. newAlloc.get]; } return result.length - size >= maxSlackMemoryAllowed ? GC.realloc(result.ptr, size.get, GC.BlkAttr.NO_SCAN)[0 .. size.get] : result[0 .. size.get]; } version (Windows) private void[] readImpl(scope const(char)[] name, scope const(FSChar)* namez, size_t upTo = size_t.max) @safe { import core.memory : GC; import std.algorithm.comparison : min; static trustedCreateFileW(scope const(wchar)* namez, DWORD dwDesiredAccess, DWORD dwShareMode, SECURITY_ATTRIBUTES *lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) @trusted { return CreateFileW(namez, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); } static trustedCloseHandle(HANDLE hObject) @trusted { return CloseHandle(hObject); } static trustedGetFileSize(HANDLE hFile, out ulong fileSize) @trusted { DWORD sizeHigh; DWORD sizeLow = GetFileSize(hFile, &sizeHigh); const bool result = sizeLow != INVALID_FILE_SIZE; if (result) fileSize = makeUlong(sizeLow, sizeHigh); return result; } static trustedReadFile(HANDLE hFile, void *lpBuffer, ulong nNumberOfBytesToRead) @trusted { // Read by chunks of size < 4GB (Windows API limit) ulong totalNumRead = 0; while (totalNumRead != nNumberOfBytesToRead) { const uint chunkSize = min(nNumberOfBytesToRead - totalNumRead, 0xffff_0000); DWORD numRead = void; const result = ReadFile(hFile, lpBuffer + totalNumRead, chunkSize, &numRead, null); if (result == 0 || numRead != chunkSize) return false; totalNumRead += chunkSize; } return true; } alias defaults = AliasSeq!(GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, (SECURITY_ATTRIBUTES*).init, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, HANDLE.init); auto h = trustedCreateFileW(namez, defaults); cenforce(h != INVALID_HANDLE_VALUE, name, namez); scope(exit) cenforce(trustedCloseHandle(h), name, namez); ulong fileSize = void; cenforce(trustedGetFileSize(h, fileSize), name, namez); size_t size = min(upTo, fileSize); auto buf = () @trusted { return GC.malloc(size, GC.BlkAttr.NO_SCAN)[0 .. size]; } (); scope(failure) { () @trusted { GC.free(buf.ptr); } (); } if (size) cenforce(trustedReadFile(h, &buf[0], size), name, namez); return buf[0 .. size]; } version (linux) @safe unittest { // A file with "zero" length that doesn't have 0 length at all auto s = std.file.readText("/proc/cpuinfo"); assert(s.length > 0); //writefln("'%s'", s); } @safe unittest { scope(exit) if (exists(deleteme)) remove(deleteme); import std.stdio; auto f = File(deleteme, "w"); f.write("abcd"); f.flush(); assert(read(deleteme) == "abcd"); } /++ Reads and validates (using $(REF validate, std, utf)) a text file. S can be an array of any character type. However, no width or endian conversions are performed. So, if the width or endianness of the characters in the given file differ from the width or endianness of the element type of S, then validation will fail. Params: S = the string type of the file name = string or range of characters representing the file _name Returns: Array of characters read. Throws: $(LREF FileException) if there is an error reading the file, $(REF UTFException, std, utf) on UTF decoding error. +/ S readText(S = string, R)(auto ref R name) if (isSomeString!S && (isInputRange!R && !isInfinite!R && isSomeChar!(ElementType!R) || is(StringTypeOf!R))) { import std.algorithm.searching : startsWith; import std.encoding : getBOM, BOM; import std.exception : enforce; import std.format : format; import std.utf : UTFException, validate; static if (is(StringTypeOf!R)) StringTypeOf!R filename = name; else auto filename = name; static auto trustedCast(T)(void[] buf) @trusted { return cast(T) buf; } auto data = trustedCast!(ubyte[])(read(filename)); immutable bomSeq = getBOM(data); immutable bom = bomSeq.schema; static if (is(Unqual!(ElementEncodingType!S) == char)) { with(BOM) switch (bom) { case utf16be: case utf16le: throw new UTFException("UTF-8 requested. BOM is for UTF-16"); case utf32be: case utf32le: throw new UTFException("UTF-8 requested. BOM is for UTF-32"); default: break; } } else static if (is(Unqual!(ElementEncodingType!S) == wchar)) { with(BOM) switch (bom) { case utf8: throw new UTFException("UTF-16 requested. BOM is for UTF-8"); case utf16be: { version (BigEndian) break; else throw new UTFException("BOM is for UTF-16 LE on Big Endian machine"); } case utf16le: { version (BigEndian) throw new UTFException("BOM is for UTF-16 BE on Little Endian machine"); else break; } case utf32be: case utf32le: throw new UTFException("UTF-8 requested. BOM is for UTF-32"); default: break; } } else { with(BOM) switch (bom) { case utf8: throw new UTFException("UTF-16 requested. BOM is for UTF-8"); case utf16be: case utf16le: throw new UTFException("UTF-8 requested. BOM is for UTF-16"); case utf32be: { version (BigEndian) break; else throw new UTFException("BOM is for UTF-32 LE on Big Endian machine"); } case utf32le: { version (BigEndian) throw new UTFException("BOM is for UTF-32 BE on Little Endian machine"); else break; } default: break; } } if (data.length % ElementEncodingType!S.sizeof != 0) throw new UTFException(format!"The content of %s is not UTF-%s"(filename, ElementEncodingType!S.sizeof * 8)); auto result = trustedCast!S(data); validate(result); return result; } /// Read file with UTF-8 text. @safe unittest { write(deleteme, "abc"); // deleteme is the name of a temporary file scope(exit) remove(deleteme); string content = readText(deleteme); assert(content == "abc"); } // Read file with UTF-8 text but try to read it as UTF-16. @safe unittest { import std.exception : assertThrown; import std.utf : UTFException; write(deleteme, "abc"); scope(exit) remove(deleteme); // Throws because the file is not valid UTF-16. assertThrown!UTFException(readText!wstring(deleteme)); } // Read file with UTF-16 text. @safe unittest { import std.algorithm.searching : skipOver; write(deleteme, "\uFEFFabc"w); // With BOM scope(exit) remove(deleteme); auto content = readText!wstring(deleteme); assert(content == "\uFEFFabc"w); // Strips BOM if present. content.skipOver('\uFEFF'); assert(content == "abc"w); } @safe unittest { static assert(__traits(compiles, readText(TestAliasedString(null)))); } @system unittest { import std.array : appender; import std.bitmanip : append, Endian; import std.exception : assertThrown; import std.path : buildPath; import std.string : representation; import std.utf : UTFException; mkdir(deleteme); scope(exit) rmdirRecurse(deleteme); immutable none8 = buildPath(deleteme, "none8"); immutable none16 = buildPath(deleteme, "none16"); immutable utf8 = buildPath(deleteme, "utf8"); immutable utf16be = buildPath(deleteme, "utf16be"); immutable utf16le = buildPath(deleteme, "utf16le"); immutable utf32be = buildPath(deleteme, "utf32be"); immutable utf32le = buildPath(deleteme, "utf32le"); immutable utf7 = buildPath(deleteme, "utf7"); write(none8, "京都市"); write(none16, "京都市"w); write(utf8, (cast(char[])[0xEF, 0xBB, 0xBF]) ~ "京都市"); { auto str = "\uFEFF京都市"w; auto arr = appender!(ubyte[])(); foreach (c; str) arr.append(c); write(utf16be, arr.data); } { auto str = "\uFEFF京都市"w; auto arr = appender!(ubyte[])(); foreach (c; str) arr.append!(ushort, Endian.littleEndian)(c); write(utf16le, arr.data); } { auto str = "\U0000FEFF京都市"d; auto arr = appender!(ubyte[])(); foreach (c; str) arr.append(c); write(utf32be, arr.data); } { auto str = "\U0000FEFF京都市"d; auto arr = appender!(ubyte[])(); foreach (c; str) arr.append!(uint, Endian.littleEndian)(c); write(utf32le, arr.data); } write(utf7, (cast(ubyte[])[0x2B, 0x2F, 0x76, 0x38, 0x2D]) ~ "foobar".representation); assertThrown!UTFException(readText(none16)); assert(readText(utf8) == (cast(char[])[0xEF, 0xBB, 0xBF]) ~ "京都市"); assertThrown!UTFException(readText(utf16be)); assertThrown!UTFException(readText(utf16le)); assertThrown!UTFException(readText(utf32be)); assertThrown!UTFException(readText(utf32le)); assert(readText(utf7) == (cast(char[])[0x2B, 0x2F, 0x76, 0x38, 0x2D]) ~ "foobar"); assertThrown!UTFException(readText!wstring(none8)); assert(readText!wstring(none16) == "京都市"w); assertThrown!UTFException(readText!wstring(utf8)); version (BigEndian) { assert(readText!wstring(utf16be) == "\uFEFF京都市"w); assertThrown!UTFException(readText!wstring(utf16le)); } else { assertThrown!UTFException(readText!wstring(utf16be)); assert(readText!wstring(utf16le) == "\uFEFF京都市"w); } assertThrown!UTFException(readText!wstring(utf32be)); assertThrown!UTFException(readText!wstring(utf32le)); assertThrown!UTFException(readText!wstring(utf7)); assertThrown!UTFException(readText!dstring(utf8)); assertThrown!UTFException(readText!dstring(utf16be)); assertThrown!UTFException(readText!dstring(utf16le)); version (BigEndian) { assert(readText!dstring(utf32be) == "\U0000FEFF京都市"d); assertThrown!UTFException(readText!dstring(utf32le)); } else { assertThrown!UTFException(readText!dstring(utf32be)); assert(readText!dstring(utf32le) == "\U0000FEFF京都市"d); } assertThrown!UTFException(readText!dstring(utf7)); } /********************************************* Write `buffer` to file `name`. Creates the file if it does not already exist. Params: name = string or range of characters representing the file _name buffer = data to be written to file Throws: $(LREF FileException) on error. See_also: $(REF toFile, std,stdio) */ void write(R)(R name, const void[] buffer) if ((isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) || isSomeString!R) && !isConvertibleToString!R) { static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) writeImpl(name, name.tempCString!FSChar(), buffer, false); else writeImpl(null, name.tempCString!FSChar(), buffer, false); } /// @system unittest { scope(exit) { assert(exists(deleteme)); remove(deleteme); } int[] a = [ 0, 1, 1, 2, 3, 5, 8 ]; write(deleteme, a); // deleteme is the name of a temporary file assert(cast(int[]) read(deleteme) == a); } /// ditto void write(R)(auto ref R name, const void[] buffer) if (isConvertibleToString!R) { write!(StringTypeOf!R)(name, buffer); } @safe unittest { static assert(__traits(compiles, write(TestAliasedString(null), null))); } /********************************************* Appends `buffer` to file `name`. Creates the file if it does not already exist. Params: name = string or range of characters representing the file _name buffer = data to be appended to file Throws: $(LREF FileException) on error. */ void append(R)(R name, const void[] buffer) if ((isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) || isSomeString!R) && !isConvertibleToString!R) { static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) writeImpl(name, name.tempCString!FSChar(), buffer, true); else writeImpl(null, name.tempCString!FSChar(), buffer, true); } /// @system unittest { scope(exit) { assert(exists(deleteme)); remove(deleteme); } int[] a = [ 0, 1, 1, 2, 3, 5, 8 ]; write(deleteme, a); // deleteme is the name of a temporary file int[] b = [ 13, 21 ]; append(deleteme, b); assert(cast(int[]) read(deleteme) == a ~ b); } /// ditto void append(R)(auto ref R name, const void[] buffer) if (isConvertibleToString!R) { append!(StringTypeOf!R)(name, buffer); } @safe unittest { static assert(__traits(compiles, append(TestAliasedString("foo"), [0, 1, 2, 3]))); } // Posix implementation helper for write and append version (Posix) private void writeImpl(scope const(char)[] name, scope const(FSChar)* namez, scope const(void)[] buffer, bool append) @trusted { import std.conv : octal; // append or write auto mode = append ? O_CREAT | O_WRONLY | O_APPEND : O_CREAT | O_WRONLY | O_TRUNC; immutable fd = core.sys.posix.fcntl.open(namez, mode, octal!666); cenforce(fd != -1, name, namez); { scope(failure) core.sys.posix.unistd.close(fd); immutable size = buffer.length; size_t sum, cnt = void; while (sum != size) { cnt = (size - sum < 2^^30) ? (size - sum) : 2^^30; const numwritten = core.sys.posix.unistd.write(fd, buffer.ptr + sum, cnt); if (numwritten != cnt) break; sum += numwritten; } cenforce(sum == size, name, namez); } cenforce(core.sys.posix.unistd.close(fd) == 0, name, namez); } // Windows implementation helper for write and append version (Windows) private void writeImpl(scope const(char)[] name, scope const(FSChar)* namez, scope const(void)[] buffer, bool append) @trusted { HANDLE h; if (append) { alias defaults = AliasSeq!(GENERIC_WRITE, 0, null, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, HANDLE.init); h = CreateFileW(namez, defaults); cenforce(h != INVALID_HANDLE_VALUE, name, namez); cenforce(SetFilePointer(h, 0, null, FILE_END) != INVALID_SET_FILE_POINTER, name, namez); } else // write { alias defaults = AliasSeq!(GENERIC_WRITE, 0, null, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, HANDLE.init); h = CreateFileW(namez, defaults); cenforce(h != INVALID_HANDLE_VALUE, name, namez); } immutable size = buffer.length; size_t sum, cnt = void; DWORD numwritten = void; while (sum != size) { cnt = (size - sum < 2^^30) ? (size - sum) : 2^^30; WriteFile(h, buffer.ptr + sum, cast(uint) cnt, &numwritten, null); if (numwritten != cnt) break; sum += numwritten; } cenforce(sum == size && CloseHandle(h), name, namez); } /*************************************************** * Rename file `from` _to `to`. * If the target file exists, it is overwritten. * Params: * from = string or range of characters representing the existing file name * to = string or range of characters representing the target file name * Throws: $(LREF FileException) on error. */ void rename(RF, RT)(RF from, RT to) if ((isInputRange!RF && !isInfinite!RF && isSomeChar!(ElementEncodingType!RF) || isSomeString!RF) && !isConvertibleToString!RF && (isInputRange!RT && !isInfinite!RT && isSomeChar!(ElementEncodingType!RT) || isSomeString!RT) && !isConvertibleToString!RT) { // Place outside of @trusted block auto fromz = from.tempCString!FSChar(); auto toz = to.tempCString!FSChar(); static if (isNarrowString!RF && is(Unqual!(ElementEncodingType!RF) == char)) alias f = from; else enum string f = null; static if (isNarrowString!RT && is(Unqual!(ElementEncodingType!RT) == char)) alias t = to; else enum string t = null; renameImpl(f, t, fromz, toz); } /// ditto void rename(RF, RT)(auto ref RF from, auto ref RT to) if (isConvertibleToString!RF || isConvertibleToString!RT) { import std.meta : staticMap; alias Types = staticMap!(convertToString, RF, RT); rename!Types(from, to); } @safe unittest { static assert(__traits(compiles, rename(TestAliasedString(null), TestAliasedString(null)))); static assert(__traits(compiles, rename("", TestAliasedString(null)))); static assert(__traits(compiles, rename(TestAliasedString(null), ""))); import std.utf : byChar; static assert(__traits(compiles, rename(TestAliasedString(null), "".byChar))); } /// @safe unittest { auto t1 = deleteme, t2 = deleteme~"2"; scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove(); t1.write("1"); t1.rename(t2); assert(t2.readText == "1"); t1.write("2"); t1.rename(t2); assert(t2.readText == "2"); } private void renameImpl(scope const(char)[] f, scope const(char)[] t, scope const(FSChar)* fromz, scope const(FSChar)* toz) @trusted { version (Windows) { import std.exception : enforce; const result = MoveFileExW(fromz, toz, MOVEFILE_REPLACE_EXISTING); if (!result) { import core.stdc.wchar_ : wcslen; import std.conv : to, text; if (!f) f = to!(typeof(f))(fromz[0 .. wcslen(fromz)]); if (!t) t = to!(typeof(t))(toz[0 .. wcslen(toz)]); enforce(false, new FileException( text("Attempting to rename file ", f, " to ", t))); } } else version (Posix) { static import core.stdc.stdio; cenforce(core.stdc.stdio.rename(fromz, toz) == 0, t, toz); } } @safe unittest { import std.utf : byWchar; auto t1 = deleteme, t2 = deleteme~"2"; scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove(); write(t1, "1"); rename(t1, t2); assert(readText(t2) == "1"); write(t1, "2"); rename(t1, t2.byWchar); assert(readText(t2) == "2"); } /*************************************************** Delete file `name`. Params: name = string or range of characters representing the file _name Throws: $(LREF FileException) on error. */ void remove(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) removeImpl(name, name.tempCString!FSChar()); else removeImpl(null, name.tempCString!FSChar()); } /// ditto void remove(R)(auto ref R name) if (isConvertibleToString!R) { remove!(StringTypeOf!R)(name); } /// @safe unittest { import std.exception : assertThrown; deleteme.write("Hello"); assert(deleteme.readText == "Hello"); deleteme.remove; assertThrown!FileException(deleteme.readText); } @safe unittest { static assert(__traits(compiles, remove(TestAliasedString("foo")))); } private void removeImpl(scope const(char)[] name, scope const(FSChar)* namez) @trusted { version (Windows) { cenforce(DeleteFileW(namez), name, namez); } else version (Posix) { static import core.stdc.stdio; if (!name) { import core.stdc.string : strlen; auto len = strlen(namez); name = namez[0 .. len]; } cenforce(core.stdc.stdio.remove(namez) == 0, "Failed to remove file " ~ name); } } version (Windows) private WIN32_FILE_ATTRIBUTE_DATA getFileAttributesWin(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R)) { auto namez = name.tempCString!FSChar(); WIN32_FILE_ATTRIBUTE_DATA fad = void; static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) { static void getFA(scope const(char)[] name, scope const(FSChar)* namez, out WIN32_FILE_ATTRIBUTE_DATA fad) @trusted { import std.exception : enforce; enforce(GetFileAttributesExW(namez, GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard, &fad), new FileException(name.idup)); } getFA(name, namez, fad); } else { static void getFA(scope const(FSChar)* namez, out WIN32_FILE_ATTRIBUTE_DATA fad) @trusted { import core.stdc.wchar_ : wcslen; import std.conv : to; import std.exception : enforce; enforce(GetFileAttributesExW(namez, GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard, &fad), new FileException(namez[0 .. wcslen(namez)].to!string)); } getFA(namez, fad); } return fad; } version (Windows) private ulong makeUlong(DWORD dwLow, DWORD dwHigh) @safe pure nothrow @nogc { ULARGE_INTEGER li; li.LowPart = dwLow; li.HighPart = dwHigh; return li.QuadPart; } /** Get size of file `name` in bytes. Params: name = string or range of characters representing the file _name Returns: The size of file in bytes. Throws: $(LREF FileException) on error (e.g., file not found). */ ulong getSize(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { with (getFileAttributesWin(name)) return makeUlong(nFileSizeLow, nFileSizeHigh); } else version (Posix) { auto namez = name.tempCString(); static trustedStat(const(FSChar)* namez, out stat_t buf) @trusted { return stat(namez, &buf); } static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; stat_t statbuf = void; cenforce(trustedStat(namez, statbuf) == 0, names, namez); return statbuf.st_size; } } /// ditto ulong getSize(R)(auto ref R name) if (isConvertibleToString!R) { return getSize!(StringTypeOf!R)(name); } @safe unittest { static assert(__traits(compiles, getSize(TestAliasedString("foo")))); } /// @safe unittest { scope(exit) deleteme.remove; // create a file of size 1 write(deleteme, "a"); assert(getSize(deleteme) == 1); // create a file of size 3 write(deleteme, "abc"); assert(getSize(deleteme) == 3); } @safe unittest { // create a file of size 1 write(deleteme, "a"); scope(exit) deleteme.exists && deleteme.remove; assert(getSize(deleteme) == 1); // create a file of size 3 write(deleteme, "abc"); import std.utf : byChar; assert(getSize(deleteme.byChar) == 3); } // Reads a time field from a stat_t with full precision. version (Posix) private SysTime statTimeToStdTime(char which)(ref const stat_t statbuf) { auto unixTime = mixin(`statbuf.st_` ~ which ~ `time`); long stdTime = unixTimeToStdTime(unixTime); static if (is(typeof(mixin(`statbuf.st_` ~ which ~ `tim`)))) stdTime += mixin(`statbuf.st_` ~ which ~ `tim.tv_nsec`) / 100; else static if (is(typeof(mixin(`statbuf.st_` ~ which ~ `timensec`)))) stdTime += mixin(`statbuf.st_` ~ which ~ `timensec`) / 100; else static if (is(typeof(mixin(`statbuf.st_` ~ which ~ `time_nsec`)))) stdTime += mixin(`statbuf.st_` ~ which ~ `time_nsec`) / 100; else static if (is(typeof(mixin(`statbuf.__st_` ~ which ~ `timensec`)))) stdTime += mixin(`statbuf.__st_` ~ which ~ `timensec`) / 100; return SysTime(stdTime); } /++ Get the access and modified times of file or folder `name`. Params: name = File/Folder _name to get times for. accessTime = Time the file/folder was last accessed. modificationTime = Time the file/folder was last modified. Throws: $(LREF FileException) on error. +/ void getTimes(R)(R name, out SysTime accessTime, out SysTime modificationTime) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { import std.datetime.systime : FILETIMEToSysTime; with (getFileAttributesWin(name)) { accessTime = FILETIMEToSysTime(&ftLastAccessTime); modificationTime = FILETIMEToSysTime(&ftLastWriteTime); } } else version (Posix) { auto namez = name.tempCString(); static auto trustedStat(const(FSChar)* namez, ref stat_t buf) @trusted { return stat(namez, &buf); } stat_t statbuf = void; static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedStat(namez, statbuf) == 0, names, namez); accessTime = statTimeToStdTime!'a'(statbuf); modificationTime = statTimeToStdTime!'m'(statbuf); } } /// ditto void getTimes(R)(auto ref R name, out SysTime accessTime, out SysTime modificationTime) if (isConvertibleToString!R) { return getTimes!(StringTypeOf!R)(name, accessTime, modificationTime); } /// @safe unittest { import std.datetime : abs, SysTime; scope(exit) deleteme.remove; write(deleteme, "a"); SysTime accessTime, modificationTime; getTimes(deleteme, accessTime, modificationTime); import std.datetime : Clock, seconds; auto currTime = Clock.currTime(); enum leeway = 5.seconds; auto diffAccess = accessTime - currTime; auto diffModification = modificationTime - currTime; assert(abs(diffAccess) <= leeway); assert(abs(diffModification) <= leeway); } @safe unittest { SysTime atime, mtime; static assert(__traits(compiles, getTimes(TestAliasedString("foo"), atime, mtime))); } @system unittest { import std.stdio : writefln; auto currTime = Clock.currTime(); write(deleteme, "a"); scope(exit) assert(deleteme.exists), deleteme.remove; SysTime accessTime1 = void; SysTime modificationTime1 = void; getTimes(deleteme, accessTime1, modificationTime1); enum leeway = 5.seconds; { auto diffa = accessTime1 - currTime; auto diffm = modificationTime1 - currTime; scope(failure) writefln("[%s] [%s] [%s] [%s] [%s]", accessTime1, modificationTime1, currTime, diffa, diffm); assert(abs(diffa) <= leeway); assert(abs(diffm) <= leeway); } version (fullFileTests) { import core.thread; enum sleepTime = dur!"seconds"(2); Thread.sleep(sleepTime); currTime = Clock.currTime(); write(deleteme, "b"); SysTime accessTime2 = void; SysTime modificationTime2 = void; getTimes(deleteme, accessTime2, modificationTime2); { auto diffa = accessTime2 - currTime; auto diffm = modificationTime2 - currTime; scope(failure) writefln("[%s] [%s] [%s] [%s] [%s]", accessTime2, modificationTime2, currTime, diffa, diffm); //There is no guarantee that the access time will be updated. assert(abs(diffa) <= leeway + sleepTime); assert(abs(diffm) <= leeway); } assert(accessTime1 <= accessTime2); assert(modificationTime1 <= modificationTime2); } } version (StdDdoc) { /++ $(BLUE This function is Windows-Only.) Get creation/access/modified times of file `name`. This is the same as `getTimes` except that it also gives you the file creation time - which isn't possible on Posix systems. Params: name = File _name to get times for. fileCreationTime = Time the file was created. fileAccessTime = Time the file was last accessed. fileModificationTime = Time the file was last modified. Throws: $(LREF FileException) on error. +/ void getTimesWin(R)(R name, out SysTime fileCreationTime, out SysTime fileAccessTime, out SysTime fileModificationTime) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R); } else version (Windows) { void getTimesWin(R)(R name, out SysTime fileCreationTime, out SysTime fileAccessTime, out SysTime fileModificationTime) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { import std.datetime.systime : FILETIMEToSysTime; with (getFileAttributesWin(name)) { fileCreationTime = FILETIMEToSysTime(&ftCreationTime); fileAccessTime = FILETIMEToSysTime(&ftLastAccessTime); fileModificationTime = FILETIMEToSysTime(&ftLastWriteTime); } } void getTimesWin(R)(auto ref R name, out SysTime fileCreationTime, out SysTime fileAccessTime, out SysTime fileModificationTime) if (isConvertibleToString!R) { getTimesWin!(StringTypeOf!R)(name, fileCreationTime, fileAccessTime, fileModificationTime); } } version (Windows) @system unittest { import std.stdio : writefln; auto currTime = Clock.currTime(); write(deleteme, "a"); scope(exit) { assert(exists(deleteme)); remove(deleteme); } SysTime creationTime1 = void; SysTime accessTime1 = void; SysTime modificationTime1 = void; getTimesWin(deleteme, creationTime1, accessTime1, modificationTime1); enum leeway = dur!"seconds"(5); { auto diffc = creationTime1 - currTime; auto diffa = accessTime1 - currTime; auto diffm = modificationTime1 - currTime; scope(failure) { writefln("[%s] [%s] [%s] [%s] [%s] [%s] [%s]", creationTime1, accessTime1, modificationTime1, currTime, diffc, diffa, diffm); } // Deleting and recreating a file doesn't seem to always reset the "file creation time" //assert(abs(diffc) <= leeway); assert(abs(diffa) <= leeway); assert(abs(diffm) <= leeway); } version (fullFileTests) { import core.thread; Thread.sleep(dur!"seconds"(2)); currTime = Clock.currTime(); write(deleteme, "b"); SysTime creationTime2 = void; SysTime accessTime2 = void; SysTime modificationTime2 = void; getTimesWin(deleteme, creationTime2, accessTime2, modificationTime2); { auto diffa = accessTime2 - currTime; auto diffm = modificationTime2 - currTime; scope(failure) { writefln("[%s] [%s] [%s] [%s] [%s]", accessTime2, modificationTime2, currTime, diffa, diffm); } assert(abs(diffa) <= leeway); assert(abs(diffm) <= leeway); } assert(creationTime1 == creationTime2); assert(accessTime1 <= accessTime2); assert(modificationTime1 <= modificationTime2); } { SysTime ctime, atime, mtime; static assert(__traits(compiles, getTimesWin(TestAliasedString("foo"), ctime, atime, mtime))); } } /++ Set access/modified times of file or folder `name`. Params: name = File/Folder _name to get times for. accessTime = Time the file/folder was last accessed. modificationTime = Time the file/folder was last modified. Throws: $(LREF FileException) on error. +/ void setTimes(R)(R name, SysTime accessTime, SysTime modificationTime) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { import std.datetime.systime : SysTimeToFILETIME; auto namez = name.tempCString!FSChar(); static auto trustedCreateFileW(const(FSChar)* namez, DWORD dwDesiredAccess, DWORD dwShareMode, SECURITY_ATTRIBUTES *lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) @trusted { return CreateFileW(namez, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); } static auto trustedCloseHandle(HANDLE hObject) @trusted { return CloseHandle(hObject); } static auto trustedSetFileTime(HANDLE hFile, in FILETIME *lpCreationTime, in ref FILETIME lpLastAccessTime, in ref FILETIME lpLastWriteTime) @trusted { return SetFileTime(hFile, lpCreationTime, &lpLastAccessTime, &lpLastWriteTime); } const ta = SysTimeToFILETIME(accessTime); const tm = SysTimeToFILETIME(modificationTime); alias defaults = AliasSeq!(GENERIC_WRITE, 0, null, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY | FILE_FLAG_BACKUP_SEMANTICS, HANDLE.init); auto h = trustedCreateFileW(namez, defaults); static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(h != INVALID_HANDLE_VALUE, names, namez); scope(exit) cenforce(trustedCloseHandle(h), names, namez); cenforce(trustedSetFileTime(h, null, ta, tm), names, namez); } else version (Posix) { auto namez = name.tempCString!FSChar(); static if (is(typeof(&utimensat))) { static auto trustedUtimensat(int fd, const(FSChar)* namez, const ref timespec[2] times, int flags) @trusted { return utimensat(fd, namez, times, flags); } timespec[2] t = void; t[0] = accessTime.toTimeSpec(); t[1] = modificationTime.toTimeSpec(); static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedUtimensat(AT_FDCWD, namez, t, 0) == 0, names, namez); } else { static auto trustedUtimes(const(FSChar)* namez, const ref timeval[2] times) @trusted { return utimes(namez, times); } timeval[2] t = void; t[0] = accessTime.toTimeVal(); t[1] = modificationTime.toTimeVal(); static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedUtimes(namez, t) == 0, names, namez); } } } /// @safe unittest { import std.datetime : DateTime, hnsecs, SysTime; scope(exit) deleteme.remove; write(deleteme, "a"); SysTime accessTime = SysTime(DateTime(2010, 10, 4, 0, 0, 30)); SysTime modificationTime = SysTime(DateTime(2018, 10, 4, 0, 0, 30)); setTimes(deleteme, accessTime, modificationTime); SysTime accessTimeResolved, modificationTimeResolved; getTimes(deleteme, accessTimeResolved, modificationTimeResolved); assert(accessTime == accessTimeResolved); assert(modificationTime == modificationTimeResolved); } /// ditto void setTimes(R)(auto ref R name, SysTime accessTime, SysTime modificationTime) if (isConvertibleToString!R) { setTimes!(StringTypeOf!R)(name, accessTime, modificationTime); } @safe unittest { if (false) // Test instatiation setTimes(TestAliasedString("foo"), SysTime.init, SysTime.init); } @system unittest { import std.stdio : File; string newdir = deleteme ~ r".dir"; string dir = newdir ~ r"/a/b/c"; string file = dir ~ "/file"; if (!exists(dir)) mkdirRecurse(dir); { auto f = File(file, "w"); } void testTimes(int hnsecValue) { foreach (path; [file, dir]) // test file and dir { SysTime atime = SysTime(DateTime(2010, 10, 4, 0, 0, 30), hnsecs(hnsecValue)); SysTime mtime = SysTime(DateTime(2011, 10, 4, 0, 0, 30), hnsecs(hnsecValue)); setTimes(path, atime, mtime); SysTime atime_res; SysTime mtime_res; getTimes(path, atime_res, mtime_res); assert(atime == atime_res); assert(mtime == mtime_res); } } testTimes(0); version (linux) testTimes(123_456_7); rmdirRecurse(newdir); } /++ Returns the time that the given file was last modified. Params: name = the name of the file to check Returns: A $(REF SysTime,std,datetime,systime). Throws: $(LREF FileException) if the given file does not exist. +/ SysTime timeLastModified(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { SysTime dummy; SysTime ftm; getTimesWin(name, dummy, dummy, ftm); return ftm; } else version (Posix) { auto namez = name.tempCString!FSChar(); static auto trustedStat(const(FSChar)* namez, ref stat_t buf) @trusted { return stat(namez, &buf); } stat_t statbuf = void; static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedStat(namez, statbuf) == 0, names, namez); return statTimeToStdTime!'m'(statbuf); } } /// ditto SysTime timeLastModified(R)(auto ref R name) if (isConvertibleToString!R) { return timeLastModified!(StringTypeOf!R)(name); } /// @safe unittest { import std.datetime : abs, DateTime, hnsecs, SysTime; scope(exit) deleteme.remove; import std.datetime : Clock, seconds; auto currTime = Clock.currTime(); enum leeway = 5.seconds; deleteme.write("bb"); assert(abs(deleteme.timeLastModified - currTime) <= leeway); } @safe unittest { static assert(__traits(compiles, timeLastModified(TestAliasedString("foo")))); } /++ Returns the time that the given file was last modified. If the file does not exist, returns `returnIfMissing`. A frequent usage pattern occurs in build automation tools such as $(HTTP gnu.org/software/make, make) or $(HTTP en.wikipedia.org/wiki/Apache_Ant, ant). To check whether file $(D target) must be rebuilt from file `source` (i.e., `target` is older than `source` or does not exist), use the comparison below. The code throws a $(LREF FileException) if `source` does not exist (as it should). On the other hand, the `SysTime.min` default makes a non-existing `target` seem infinitely old so the test correctly prompts building it. Params: name = The name of the file to get the modification time for. returnIfMissing = The time to return if the given file does not exist. Returns: A $(REF SysTime,std,datetime,systime). Example: -------------------- if (source.timeLastModified >= target.timeLastModified(SysTime.min)) { // must (re)build } else { // target is up-to-date } -------------------- +/ SysTime timeLastModified(R)(R name, SysTime returnIfMissing) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R)) { version (Windows) { if (!exists(name)) return returnIfMissing; SysTime dummy; SysTime ftm; getTimesWin(name, dummy, dummy, ftm); return ftm; } else version (Posix) { auto namez = name.tempCString!FSChar(); static auto trustedStat(const(FSChar)* namez, ref stat_t buf) @trusted { return stat(namez, &buf); } stat_t statbuf = void; return trustedStat(namez, statbuf) != 0 ? returnIfMissing : statTimeToStdTime!'m'(statbuf); } } /// @safe unittest { import std.datetime : SysTime; assert("file.does.not.exist".timeLastModified(SysTime.min) == SysTime.min); auto source = deleteme ~ "source"; auto target = deleteme ~ "target"; scope(exit) source.remove, target.remove; source.write("."); assert(target.timeLastModified(SysTime.min) < source.timeLastModified); target.write("."); assert(target.timeLastModified(SysTime.min) >= source.timeLastModified); } version (StdDdoc) { /++ $(BLUE This function is Posix-Only.) Returns the time that the given file was last modified. Params: statbuf = stat_t retrieved from file. +/ SysTime timeLastModified()(auto ref stat_t statbuf) pure nothrow {assert(false);} /++ $(BLUE This function is Posix-Only.) Returns the time that the given file was last accessed. Params: statbuf = stat_t retrieved from file. +/ SysTime timeLastAccessed()(auto ref stat_t statbuf) pure nothrow {assert(false);} /++ $(BLUE This function is Posix-Only.) Returns the time that the given file was last changed. Params: statbuf = stat_t retrieved from file. +/ SysTime timeStatusChanged()(auto ref stat_t statbuf) pure nothrow {assert(false);} } else version (Posix) { SysTime timeLastModified()(auto ref stat_t statbuf) pure nothrow { return statTimeToStdTime!'m'(statbuf); } SysTime timeLastAccessed()(auto ref stat_t statbuf) pure nothrow { return statTimeToStdTime!'a'(statbuf); } SysTime timeStatusChanged()(auto ref stat_t statbuf) pure nothrow { return statTimeToStdTime!'c'(statbuf); } @safe unittest { stat_t statbuf; // check that both lvalues and rvalues work timeLastAccessed(statbuf); timeLastAccessed(stat_t.init); } } @safe unittest { //std.process.executeShell("echo a > deleteme"); if (exists(deleteme)) remove(deleteme); write(deleteme, "a\n"); scope(exit) { assert(exists(deleteme)); remove(deleteme); } // assert(lastModified("deleteme") > // lastModified("this file does not exist", SysTime.min)); //assert(lastModified("deleteme") > lastModified(__FILE__)); } // Tests sub-second precision of querying file times. // Should pass on most modern systems running on modern filesystems. // Exceptions: // - FreeBSD, where one would need to first set the // vfs.timestamp_precision sysctl to a value greater than zero. // - OS X, where the native filesystem (HFS+) stores filesystem // timestamps with 1-second precision. version (FreeBSD) {} else version (DragonFlyBSD) {} else version (OSX) {} else @system unittest { import core.thread; if (exists(deleteme)) remove(deleteme); SysTime lastTime; foreach (n; 0 .. 3) { write(deleteme, "a"); auto time = timeLastModified(deleteme); remove(deleteme); assert(time != lastTime); lastTime = time; Thread.sleep(10.msecs); } } /** * Determine whether the given file (or directory) _exists. * Params: * name = string or range of characters representing the file _name * Returns: * true if the file _name specified as input _exists */ bool exists(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { return existsImpl(name.tempCString!FSChar()); } /// ditto bool exists(R)(auto ref R name) if (isConvertibleToString!R) { return exists!(StringTypeOf!R)(name); } /// @safe unittest { auto f = deleteme ~ "does.not.exist"; assert(!f.exists); f.write("hello"); assert(f.exists); f.remove; assert(!f.exists); } private bool existsImpl(const(FSChar)* namez) @trusted nothrow @nogc { version (Windows) { // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ // fileio/base/getfileattributes.asp return GetFileAttributesW(namez) != 0xFFFFFFFF; } else version (Posix) { /* The reason why we use stat (and not access) here is the quirky behavior of access for SUID programs: if we used access, a file may not appear to "exist", despite that the program would be able to open it just fine. The behavior in question is described as follows in the access man page: > The check is done using the calling process's real > UID and GID, rather than the effective IDs as is > done when actually attempting an operation (e.g., > open(2)) on the file. This allows set-user-ID > programs to easily determine the invoking user's > authority. While various operating systems provide eaccess or euidaccess functions, these are not part of POSIX - so it's safer to use stat instead. */ stat_t statbuf = void; return lstat(namez, &statbuf) == 0; } else static assert(0); } /// @safe unittest { assert(".".exists); assert(!"this file does not exist".exists); deleteme.write("a\n"); scope(exit) deleteme.remove; assert(deleteme.exists); } @safe unittest // Bugzilla 16573 { enum S : string { foo = "foo" } assert(__traits(compiles, S.foo.exists)); } /++ Returns the attributes of the given file. Note that the file attributes on Windows and Posix systems are completely different. On Windows, they're what is returned by $(HTTP msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx, GetFileAttributes), whereas on Posix systems, they're the `st_mode` value which is part of the $(D stat struct) gotten by calling the $(HTTP en.wikipedia.org/wiki/Stat_%28Unix%29, `stat`) function. On Posix systems, if the given file is a symbolic link, then attributes are the attributes of the file pointed to by the symbolic link. Params: name = The file to get the attributes of. Returns: The attributes of the file as a `uint`. Throws: $(LREF FileException) on error. +/ uint getAttributes(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { auto namez = name.tempCString!FSChar(); static auto trustedGetFileAttributesW(const(FSChar)* namez) @trusted { return GetFileAttributesW(namez); } immutable result = trustedGetFileAttributesW(namez); static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(result != INVALID_FILE_ATTRIBUTES, names, namez); return result; } else version (Posix) { auto namez = name.tempCString!FSChar(); static auto trustedStat(const(FSChar)* namez, ref stat_t buf) @trusted { return stat(namez, &buf); } stat_t statbuf = void; static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedStat(namez, statbuf) == 0, names, namez); return statbuf.st_mode; } } /// ditto uint getAttributes(R)(auto ref R name) if (isConvertibleToString!R) { return getAttributes!(StringTypeOf!R)(name); } /// getAttributes with a file @safe unittest { import std.exception : assertThrown; auto f = deleteme ~ "file"; scope(exit) f.remove; assert(!f.exists); assertThrown!FileException(f.getAttributes); f.write("."); auto attributes = f.getAttributes; assert(!attributes.attrIsDir); assert(attributes.attrIsFile); } /// getAttributes with a directory @safe unittest { import std.exception : assertThrown; auto dir = deleteme ~ "dir"; scope(exit) dir.rmdir; assert(!dir.exists); assertThrown!FileException(dir.getAttributes); dir.mkdir; auto attributes = dir.getAttributes; assert(attributes.attrIsDir); assert(!attributes.attrIsFile); } @safe unittest { static assert(__traits(compiles, getAttributes(TestAliasedString(null)))); } /++ If the given file is a symbolic link, then this returns the attributes of the symbolic link itself rather than file that it points to. If the given file is $(I not) a symbolic link, then this function returns the same result as getAttributes. On Windows, getLinkAttributes is identical to getAttributes. It exists on Windows so that you don't have to special-case code for Windows when dealing with symbolic links. Params: name = The file to get the symbolic link attributes of. Returns: the attributes Throws: $(LREF FileException) on error. +/ uint getLinkAttributes(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { return getAttributes(name); } else version (Posix) { auto namez = name.tempCString!FSChar(); static auto trustedLstat(const(FSChar)* namez, ref stat_t buf) @trusted { return lstat(namez, &buf); } stat_t lstatbuf = void; static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedLstat(namez, lstatbuf) == 0, names, namez); return lstatbuf.st_mode; } } /// ditto uint getLinkAttributes(R)(auto ref R name) if (isConvertibleToString!R) { return getLinkAttributes!(StringTypeOf!R)(name); } /// @safe unittest { import std.exception : assertThrown; auto source = deleteme ~ "source"; auto target = deleteme ~ "target"; assert(!source.exists); assertThrown!FileException(source.getLinkAttributes); // symlinking isn't available on Windows version (Posix) { scope(exit) source.remove, target.remove; target.write("target"); target.symlink(source); assert(source.readText == "target"); assert(source.isSymlink); assert(source.getLinkAttributes.attrIsSymlink); } } /// if the file is no symlink, getLinkAttributes behaves like getAttributes @safe unittest { import std.exception : assertThrown; auto f = deleteme ~ "file"; scope(exit) f.remove; assert(!f.exists); assertThrown!FileException(f.getLinkAttributes); f.write("."); auto attributes = f.getLinkAttributes; assert(!attributes.attrIsDir); assert(attributes.attrIsFile); } /// if the file is no symlink, getLinkAttributes behaves like getAttributes @safe unittest { import std.exception : assertThrown; auto dir = deleteme ~ "dir"; scope(exit) dir.rmdir; assert(!dir.exists); assertThrown!FileException(dir.getLinkAttributes); dir.mkdir; auto attributes = dir.getLinkAttributes; assert(attributes.attrIsDir); assert(!attributes.attrIsFile); } @safe unittest { static assert(__traits(compiles, getLinkAttributes(TestAliasedString(null)))); } /++ Set the _attributes of the given file. Params: name = the file _name attributes = the _attributes to set the file to Throws: $(LREF FileException) if the given file does not exist. +/ void setAttributes(R)(R name, uint attributes) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { auto namez = name.tempCString!FSChar(); static auto trustedSetFileAttributesW(const(FSChar)* namez, uint dwFileAttributes) @trusted { return SetFileAttributesW(namez, dwFileAttributes); } static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(trustedSetFileAttributesW(namez, attributes), names, namez); } else version (Posix) { auto namez = name.tempCString!FSChar(); static auto trustedChmod(const(FSChar)* namez, mode_t mode) @trusted { return chmod(namez, mode); } assert(attributes <= mode_t.max); static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias names = name; else string names = null; cenforce(!trustedChmod(namez, cast(mode_t) attributes), names, namez); } } /// ditto void setAttributes(R)(auto ref R name, uint attributes) if (isConvertibleToString!R) { return setAttributes!(StringTypeOf!R)(name, attributes); } @safe unittest { static assert(__traits(compiles, setAttributes(TestAliasedString(null), 0))); } /// setAttributes with a file @safe unittest { import std.exception : assertThrown; import std.conv : octal; auto f = deleteme ~ "file"; version (Posix) { scope(exit) f.remove; assert(!f.exists); assertThrown!FileException(f.setAttributes(octal!777)); f.write("."); auto attributes = f.getAttributes; assert(!attributes.attrIsDir); assert(attributes.attrIsFile); f.setAttributes(octal!777); attributes = f.getAttributes; assert((attributes & 1023) == octal!777); } } /// setAttributes with a directory @safe unittest { import std.exception : assertThrown; import std.conv : octal; auto dir = deleteme ~ "dir"; version (Posix) { scope(exit) dir.rmdir; assert(!dir.exists); assertThrown!FileException(dir.setAttributes(octal!777)); dir.mkdir; auto attributes = dir.getAttributes; assert(attributes.attrIsDir); assert(!attributes.attrIsFile); dir.setAttributes(octal!777); attributes = dir.getAttributes; assert((attributes & 1023) == octal!777); } } /++ Returns whether the given file is a directory. Params: name = The path to the file. Returns: true if name specifies a directory Throws: $(LREF FileException) if the given file does not exist. +/ @property bool isDir(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) { return (getAttributes(name) & FILE_ATTRIBUTE_DIRECTORY) != 0; } else version (Posix) { return (getAttributes(name) & S_IFMT) == S_IFDIR; } } /// ditto @property bool isDir(R)(auto ref R name) if (isConvertibleToString!R) { return name.isDir!(StringTypeOf!R); } /// @safe unittest { import std.exception : assertThrown; auto dir = deleteme ~ "dir"; auto f = deleteme ~ "f"; scope(exit) dir.rmdir, f.remove; assert(!dir.exists); assertThrown!FileException(dir.isDir); dir.mkdir; assert(dir.isDir); f.write("."); assert(!f.isDir); } @safe unittest { static assert(__traits(compiles, TestAliasedString(null).isDir)); } @safe unittest { version (Windows) { if ("C:\\Program Files\\".exists) assert("C:\\Program Files\\".isDir); if ("C:\\Windows\\system.ini".exists) assert(!"C:\\Windows\\system.ini".isDir); } else version (Posix) { if (system_directory.exists) assert(system_directory.isDir); if (system_file.exists) assert(!system_file.isDir); } } @system unittest { version (Windows) enum dir = "C:\\Program Files\\"; else version (Posix) enum dir = system_directory; if (dir.exists) { DirEntry de = DirEntry(dir); assert(de.isDir); assert(DirEntry(dir).isDir); } } /++ Returns whether the given file _attributes are for a directory. Params: attributes = The file _attributes. Returns: true if attributes specifies a directory +/ bool attrIsDir(uint attributes) @safe pure nothrow @nogc { version (Windows) { return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } else version (Posix) { return (attributes & S_IFMT) == S_IFDIR; } } /// @safe unittest { import std.exception : assertThrown; auto dir = deleteme ~ "dir"; auto f = deleteme ~ "f"; scope(exit) dir.rmdir, f.remove; assert(!dir.exists); assertThrown!FileException(dir.getAttributes.attrIsDir); dir.mkdir; assert(dir.isDir); assert(dir.getAttributes.attrIsDir); f.write("."); assert(!f.isDir); assert(!f.getAttributes.attrIsDir); } @safe unittest { version (Windows) { if ("C:\\Program Files\\".exists) { assert(attrIsDir(getAttributes("C:\\Program Files\\"))); assert(attrIsDir(getLinkAttributes("C:\\Program Files\\"))); } if ("C:\\Windows\\system.ini".exists) { assert(!attrIsDir(getAttributes("C:\\Windows\\system.ini"))); assert(!attrIsDir(getLinkAttributes("C:\\Windows\\system.ini"))); } } else version (Posix) { if (system_directory.exists) { assert(attrIsDir(getAttributes(system_directory))); assert(attrIsDir(getLinkAttributes(system_directory))); } if (system_file.exists) { assert(!attrIsDir(getAttributes(system_file))); assert(!attrIsDir(getLinkAttributes(system_file))); } } } /++ Returns whether the given file (or directory) is a file. On Windows, if a file is not a directory, then it's a file. So, either `isFile` or `isDir` will return true for any given file. On Posix systems, if `isFile` is `true`, that indicates that the file is a regular file (e.g. not a block not device). So, on Posix systems, it's possible for both `isFile` and `isDir` to be `false` for a particular file (in which case, it's a special file). You can use `getAttributes` to get the attributes to figure out what type of special it is, or you can use `DirEntry` to get at its `statBuf`, which is the result from `stat`. In either case, see the man page for `stat` for more information. Params: name = The path to the file. Returns: true if name specifies a file Throws: $(LREF FileException) if the given file does not exist. +/ @property bool isFile(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) return !name.isDir; else version (Posix) return (getAttributes(name) & S_IFMT) == S_IFREG; } /// ditto @property bool isFile(R)(auto ref R name) if (isConvertibleToString!R) { return isFile!(StringTypeOf!R)(name); } /// @safe unittest { import std.exception : assertThrown; auto dir = deleteme ~ "dir"; auto f = deleteme ~ "f"; scope(exit) dir.rmdir, f.remove; dir.mkdir; assert(!dir.isFile); assert(!f.exists); assertThrown!FileException(f.isFile); f.write("."); assert(f.isFile); } @system unittest // bugzilla 15658 { DirEntry e = DirEntry("."); static assert(is(typeof(isFile(e)))); } @safe unittest { static assert(__traits(compiles, TestAliasedString(null).isFile)); } @safe unittest { version (Windows) { if ("C:\\Program Files\\".exists) assert(!"C:\\Program Files\\".isFile); if ("C:\\Windows\\system.ini".exists) assert("C:\\Windows\\system.ini".isFile); } else version (Posix) { if (system_directory.exists) assert(!system_directory.isFile); if (system_file.exists) assert(system_file.isFile); } } /++ Returns whether the given file _attributes are for a file. On Windows, if a file is not a directory, it's a file. So, either `attrIsFile` or `attrIsDir` will return `true` for the _attributes of any given file. On Posix systems, if `attrIsFile` is `true`, that indicates that the file is a regular file (e.g. not a block not device). So, on Posix systems, it's possible for both `attrIsFile` and `attrIsDir` to be `false` for a particular file (in which case, it's a special file). If a file is a special file, you can use the _attributes to check what type of special file it is (see the man page for `stat` for more information). Params: attributes = The file _attributes. Returns: true if the given file _attributes are for a file Example: -------------------- assert(attrIsFile(getAttributes("/etc/fonts/fonts.conf"))); assert(attrIsFile(getLinkAttributes("/etc/fonts/fonts.conf"))); -------------------- +/ bool attrIsFile(uint attributes) @safe pure nothrow @nogc { version (Windows) { return (attributes & FILE_ATTRIBUTE_DIRECTORY) == 0; } else version (Posix) { return (attributes & S_IFMT) == S_IFREG; } } /// @safe unittest { import std.exception : assertThrown; auto dir = deleteme ~ "dir"; auto f = deleteme ~ "f"; scope(exit) dir.rmdir, f.remove; dir.mkdir; assert(!dir.isFile); assert(!dir.getAttributes.attrIsFile); assert(!f.exists); assertThrown!FileException(f.getAttributes.attrIsFile); f.write("."); assert(f.isFile); assert(f.getAttributes.attrIsFile); } @safe unittest { version (Windows) { if ("C:\\Program Files\\".exists) { assert(!attrIsFile(getAttributes("C:\\Program Files\\"))); assert(!attrIsFile(getLinkAttributes("C:\\Program Files\\"))); } if ("C:\\Windows\\system.ini".exists) { assert(attrIsFile(getAttributes("C:\\Windows\\system.ini"))); assert(attrIsFile(getLinkAttributes("C:\\Windows\\system.ini"))); } } else version (Posix) { if (system_directory.exists) { assert(!attrIsFile(getAttributes(system_directory))); assert(!attrIsFile(getLinkAttributes(system_directory))); } if (system_file.exists) { assert(attrIsFile(getAttributes(system_file))); assert(attrIsFile(getLinkAttributes(system_file))); } } } /++ Returns whether the given file is a symbolic link. On Windows, returns `true` when the file is either a symbolic link or a junction point. Params: name = The path to the file. Returns: true if name is a symbolic link Throws: $(LREF FileException) if the given file does not exist. +/ @property bool isSymlink(R)(R name) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { version (Windows) return (getAttributes(name) & FILE_ATTRIBUTE_REPARSE_POINT) != 0; else version (Posix) return (getLinkAttributes(name) & S_IFMT) == S_IFLNK; } /// ditto @property bool isSymlink(R)(auto ref R name) if (isConvertibleToString!R) { return name.isSymlink!(StringTypeOf!R); } @safe unittest { static assert(__traits(compiles, TestAliasedString(null).isSymlink)); } /// @safe unittest { import std.exception : assertThrown; auto source = deleteme ~ "source"; auto target = deleteme ~ "target"; assert(!source.exists); assertThrown!FileException(source.isSymlink); // symlinking isn't available on Windows version (Posix) { scope(exit) source.remove, target.remove; target.write("target"); target.symlink(source); assert(source.readText == "target"); assert(source.isSymlink); assert(source.getLinkAttributes.attrIsSymlink); } } @system unittest { version (Windows) { if ("C:\\Program Files\\".exists) assert(!"C:\\Program Files\\".isSymlink); if ("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists) assert("C:\\Documents and Settings\\".isSymlink); enum fakeSymFile = "C:\\Windows\\system.ini"; if (fakeSymFile.exists) { assert(!fakeSymFile.isSymlink); assert(!fakeSymFile.isSymlink); assert(!attrIsSymlink(getAttributes(fakeSymFile))); assert(!attrIsSymlink(getLinkAttributes(fakeSymFile))); assert(attrIsFile(getAttributes(fakeSymFile))); assert(attrIsFile(getLinkAttributes(fakeSymFile))); assert(!attrIsDir(getAttributes(fakeSymFile))); assert(!attrIsDir(getLinkAttributes(fakeSymFile))); assert(getAttributes(fakeSymFile) == getLinkAttributes(fakeSymFile)); } } else version (Posix) { if (system_directory.exists) { assert(!system_directory.isSymlink); immutable symfile = deleteme ~ "_slink\0"; scope(exit) if (symfile.exists) symfile.remove(); core.sys.posix.unistd.symlink(system_directory, symfile.ptr); assert(symfile.isSymlink); assert(!attrIsSymlink(getAttributes(symfile))); assert(attrIsSymlink(getLinkAttributes(symfile))); assert(attrIsDir(getAttributes(symfile))); assert(!attrIsDir(getLinkAttributes(symfile))); assert(!attrIsFile(getAttributes(symfile))); assert(!attrIsFile(getLinkAttributes(symfile))); } if (system_file.exists) { assert(!system_file.isSymlink); immutable symfile = deleteme ~ "_slink\0"; scope(exit) if (symfile.exists) symfile.remove(); core.sys.posix.unistd.symlink(system_file, symfile.ptr); assert(symfile.isSymlink); assert(!attrIsSymlink(getAttributes(symfile))); assert(attrIsSymlink(getLinkAttributes(symfile))); assert(!attrIsDir(getAttributes(symfile))); assert(!attrIsDir(getLinkAttributes(symfile))); assert(attrIsFile(getAttributes(symfile))); assert(!attrIsFile(getLinkAttributes(symfile))); } } static assert(__traits(compiles, () @safe { return "dummy".isSymlink; })); } /++ Returns whether the given file attributes are for a symbolic link. On Windows, return `true` when the file is either a symbolic link or a junction point. Params: attributes = The file attributes. Returns: true if attributes are for a symbolic link Example: -------------------- core.sys.posix.unistd.symlink("/etc/fonts/fonts.conf", "/tmp/alink"); assert(!getAttributes("/tmp/alink").isSymlink); assert(getLinkAttributes("/tmp/alink").isSymlink); -------------------- +/ bool attrIsSymlink(uint attributes) @safe pure nothrow @nogc { version (Windows) return (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; else version (Posix) return (attributes & S_IFMT) == S_IFLNK; } /// @safe unittest { import std.exception : assertThrown; auto source = deleteme ~ "source"; auto target = deleteme ~ "target"; assert(!source.exists); assertThrown!FileException(source.getLinkAttributes.attrIsSymlink); // symlinking isn't available on Windows version (Posix) { scope(exit) source.remove, target.remove; target.write("target"); target.symlink(source); assert(source.readText == "target"); assert(source.isSymlink); assert(source.getLinkAttributes.attrIsSymlink); } } /** Change directory to `pathname`. Equivalent to `cd` on Windows and Posix. Params: pathname = the directory to step into Throws: $(LREF FileException) on error. */ void chdir(R)(R pathname) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { // Place outside of @trusted block auto pathz = pathname.tempCString!FSChar(); version (Windows) { static auto trustedChdir(const(FSChar)* pathz) @trusted { return SetCurrentDirectoryW(pathz); } } else version (Posix) { static auto trustedChdir(const(FSChar)* pathz) @trusted { return core.sys.posix.unistd.chdir(pathz) == 0; } } static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias pathStr = pathname; else string pathStr = null; cenforce(trustedChdir(pathz), pathStr, pathz); } /// ditto void chdir(R)(auto ref R pathname) if (isConvertibleToString!R) { return chdir!(StringTypeOf!R)(pathname); } /// @system unittest { import std.algorithm.comparison : equal; import std.path : buildPath; auto cwd = getcwd; auto dir = deleteme ~ "dir"; dir.mkdir; scope(exit) cwd.chdir, dir.rmdirRecurse; dir.buildPath("a").write("."); dir.chdir; // step into dir "b".write("."); dirEntries(".", SpanMode.shallow).equal( [".".buildPath("b"), ".".buildPath("a")] ); } @safe unittest { static assert(__traits(compiles, chdir(TestAliasedString(null)))); } /** Make a new directory `pathname`. Params: pathname = the path of the directory to make Throws: $(LREF FileException) on Posix or $(LREF WindowsException) on Windows if an error occured. */ void mkdir(R)(R pathname) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { // Place outside of @trusted block const pathz = pathname.tempCString!FSChar(); version (Windows) { static auto trustedCreateDirectoryW(const(FSChar)* pathz) @trusted { return CreateDirectoryW(pathz, null); } static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias pathStr = pathname; else string pathStr = null; wenforce(trustedCreateDirectoryW(pathz), pathStr, pathz); } else version (Posix) { import std.conv : octal; static auto trustedMkdir(const(FSChar)* pathz, mode_t mode) @trusted { return core.sys.posix.sys.stat.mkdir(pathz, mode); } static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias pathStr = pathname; else string pathStr = null; cenforce(trustedMkdir(pathz, octal!777) == 0, pathStr, pathz); } } /// ditto void mkdir(R)(auto ref R pathname) if (isConvertibleToString!R) { return mkdir!(StringTypeOf!R)(pathname); } @safe unittest { import std.file : mkdir; static assert(__traits(compiles, mkdir(TestAliasedString(null)))); } /// @safe unittest { import std.file : mkdir; auto dir = deleteme ~ "dir"; scope(exit) dir.rmdir; dir.mkdir; assert(dir.exists); } /// @safe unittest { import std.exception : assertThrown; assertThrown("a/b/c/d/e".mkdir); } // Same as mkdir but ignores "already exists" errors. // Returns: "true" if the directory was created, // "false" if it already existed. private bool ensureDirExists()(scope const(char)[] pathname) { import std.exception : enforce; const pathz = pathname.tempCString!FSChar(); version (Windows) { if (() @trusted { return CreateDirectoryW(pathz, null); }()) return true; cenforce(GetLastError() == ERROR_ALREADY_EXISTS, pathname.idup); } else version (Posix) { import std.conv : octal; if (() @trusted { return core.sys.posix.sys.stat.mkdir(pathz, octal!777); }() == 0) return true; cenforce(errno == EEXIST || errno == EISDIR, pathname); } enforce(pathname.isDir, new FileException(pathname.idup)); return false; } /** Make directory and all parent directories as needed. Does nothing if the directory specified by `pathname` already exists. Params: pathname = the full path of the directory to create Throws: $(LREF FileException) on error. */ void mkdirRecurse(scope const(char)[] pathname) @safe { import std.path : dirName, baseName; const left = dirName(pathname); if (left.length != pathname.length && !exists(left)) { mkdirRecurse(left); } if (!baseName(pathname).empty) { ensureDirExists(pathname); } } /// @system unittest { import std.path : buildPath; auto dir = deleteme ~ "dir"; scope(exit) dir.rmdirRecurse; dir.mkdir; assert(dir.exists); dir.mkdirRecurse; // does nothing // creates all parent directories as needed auto nested = dir.buildPath("a", "b", "c"); nested.mkdirRecurse; assert(nested.exists); } /// @safe unittest { import std.exception : assertThrown; scope(exit) deleteme.remove; deleteme.write("a"); // cannot make directory as it's already a file assertThrown!FileException(deleteme.mkdirRecurse); } @safe unittest { import std.exception : assertThrown; { import std.path : buildPath, buildNormalizedPath; immutable basepath = deleteme ~ "_dir"; scope(exit) () @trusted { rmdirRecurse(basepath); }(); auto path = buildPath(basepath, "a", "..", "b"); mkdirRecurse(path); path = path.buildNormalizedPath; assert(path.isDir); path = buildPath(basepath, "c"); write(path, ""); assertThrown!FileException(mkdirRecurse(path)); path = buildPath(basepath, "d"); mkdirRecurse(path); mkdirRecurse(path); // should not throw } version (Windows) { assertThrown!FileException(mkdirRecurse(`1:\foobar`)); } // bug3570 { immutable basepath = deleteme ~ "_dir"; version (Windows) { immutable path = basepath ~ "\\fake\\here\\"; } else version (Posix) { immutable path = basepath ~ `/fake/here/`; } mkdirRecurse(path); assert(basepath.exists && basepath.isDir); scope(exit) () @trusted { rmdirRecurse(basepath); }(); assert(path.exists && path.isDir); } } /**************************************************** Remove directory `pathname`. Params: pathname = Range or string specifying the directory name Throws: $(LREF FileException) on error. */ void rmdir(R)(R pathname) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) && !isConvertibleToString!R) { // Place outside of @trusted block auto pathz = pathname.tempCString!FSChar(); version (Windows) { static auto trustedRmdir(const(FSChar)* pathz) @trusted { return RemoveDirectoryW(pathz); } } else version (Posix) { static auto trustedRmdir(const(FSChar)* pathz) @trusted { return core.sys.posix.unistd.rmdir(pathz) == 0; } } static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias pathStr = pathname; else string pathStr = null; cenforce(trustedRmdir(pathz), pathStr, pathz); } /// ditto void rmdir(R)(auto ref R pathname) if (isConvertibleToString!R) { rmdir!(StringTypeOf!R)(pathname); } @safe unittest { static assert(__traits(compiles, rmdir(TestAliasedString(null)))); } /// @system unittest { auto dir = deleteme ~ "dir"; dir.mkdir; assert(dir.exists); dir.rmdir; assert(!dir.exists); } /++ $(BLUE This function is Posix-Only.) Creates a symbolic _link (_symlink). Params: original = The file that is being linked. This is the target path that's stored in the _symlink. A relative path is relative to the created _symlink. link = The _symlink to create. A relative path is relative to the current working directory. Throws: $(LREF FileException) on error (which includes if the _symlink already exists). +/ version (StdDdoc) void symlink(RO, RL)(RO original, RL link) if ((isInputRange!RO && !isInfinite!RO && isSomeChar!(ElementEncodingType!RO) || isConvertibleToString!RO) && (isInputRange!RL && !isInfinite!RL && isSomeChar!(ElementEncodingType!RL) || isConvertibleToString!RL)); else version (Posix) void symlink(RO, RL)(RO original, RL link) if ((isInputRange!RO && !isInfinite!RO && isSomeChar!(ElementEncodingType!RO) || isConvertibleToString!RO) && (isInputRange!RL && !isInfinite!RL && isSomeChar!(ElementEncodingType!RL) || isConvertibleToString!RL)) { static if (isConvertibleToString!RO || isConvertibleToString!RL) { import std.meta : staticMap; alias Types = staticMap!(convertToString, RO, RL); symlink!Types(original, link); } else { import std.conv : text; auto oz = original.tempCString(); auto lz = link.tempCString(); alias posixSymlink = core.sys.posix.unistd.symlink; immutable int result = () @trusted { return posixSymlink(oz, lz); } (); cenforce(result == 0, text(link)); } } version (Posix) @safe unittest { if (system_directory.exists) { immutable symfile = deleteme ~ "_slink\0"; scope(exit) if (symfile.exists) symfile.remove(); symlink(system_directory, symfile); assert(symfile.exists); assert(symfile.isSymlink); assert(!attrIsSymlink(getAttributes(symfile))); assert(attrIsSymlink(getLinkAttributes(symfile))); assert(attrIsDir(getAttributes(symfile))); assert(!attrIsDir(getLinkAttributes(symfile))); assert(!attrIsFile(getAttributes(symfile))); assert(!attrIsFile(getLinkAttributes(symfile))); } if (system_file.exists) { assert(!system_file.isSymlink); immutable symfile = deleteme ~ "_slink\0"; scope(exit) if (symfile.exists) symfile.remove(); symlink(system_file, symfile); assert(symfile.exists); assert(symfile.isSymlink); assert(!attrIsSymlink(getAttributes(symfile))); assert(attrIsSymlink(getLinkAttributes(symfile))); assert(!attrIsDir(getAttributes(symfile))); assert(!attrIsDir(getLinkAttributes(symfile))); assert(attrIsFile(getAttributes(symfile))); assert(!attrIsFile(getLinkAttributes(symfile))); } } version (Posix) @safe unittest { static assert(__traits(compiles, symlink(TestAliasedString(null), TestAliasedString(null)))); } /++ $(BLUE This function is Posix-Only.) Returns the path to the file pointed to by a symlink. Note that the path could be either relative or absolute depending on the symlink. If the path is relative, it's relative to the symlink, not the current working directory. Throws: $(LREF FileException) on error. +/ version (StdDdoc) string readLink(R)(R link) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) || isConvertibleToString!R); else version (Posix) string readLink(R)(R link) if (isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R) || isConvertibleToString!R) { static if (isConvertibleToString!R) { return readLink!(convertToString!R)(link); } else { import std.conv : to; import std.exception : assumeUnique; alias posixReadlink = core.sys.posix.unistd.readlink; enum bufferLen = 2048; enum maxCodeUnits = 6; char[bufferLen] buffer; const linkz = link.tempCString(); auto size = () @trusted { return posixReadlink(linkz, buffer.ptr, buffer.length); } (); cenforce(size != -1, to!string(link)); if (size <= bufferLen - maxCodeUnits) return to!string(buffer[0 .. size]); auto dynamicBuffer = new char[](bufferLen * 3 / 2); foreach (i; 0 .. 10) { size = () @trusted { return posixReadlink(linkz, dynamicBuffer.ptr, dynamicBuffer.length); } (); cenforce(size != -1, to!string(link)); if (size <= dynamicBuffer.length - maxCodeUnits) { dynamicBuffer.length = size; return () @trusted { return assumeUnique(dynamicBuffer); } (); } dynamicBuffer.length = dynamicBuffer.length * 3 / 2; } throw new FileException(to!string(link), "Path is too long to read."); } } version (Posix) @safe unittest { import std.exception : assertThrown; import std.string; foreach (file; [system_directory, system_file]) { if (file.exists) { immutable symfile = deleteme ~ "_slink\0"; scope(exit) if (symfile.exists) symfile.remove(); symlink(file, symfile); assert(readLink(symfile) == file, format("Failed file: %s", file)); } } assertThrown!FileException(readLink("/doesnotexist")); } version (Posix) @safe unittest { static assert(__traits(compiles, readLink(TestAliasedString("foo")))); } version (Posix) @system unittest // input range of dchars { mkdirRecurse(deleteme); scope(exit) if (deleteme.exists) rmdirRecurse(deleteme); write(deleteme ~ "/f", ""); import std.range.interfaces : InputRange, inputRangeObject; import std.utf : byChar; immutable string link = deleteme ~ "/l"; symlink("f", link); InputRange!dchar linkr = inputRangeObject(link); alias R = typeof(linkr); static assert(isInputRange!R); static assert(!isForwardRange!R); assert(readLink(linkr) == "f"); } /**************************************************** * Get the current working directory. * Throws: $(LREF FileException) on error. */ version (Windows) string getcwd() @trusted { import std.conv : to; import std.experimental.checkedint : checked; /* GetCurrentDirectory's return value: 1. function succeeds: the number of characters that are written to the buffer, not including the terminating null character. 2. function fails: zero 3. the buffer (lpBuffer) is not large enough: the required size of the buffer, in characters, including the null-terminating character. */ version (unittest) enum BUF_SIZE = 10; // trigger reallocation code else enum BUF_SIZE = 4096; // enough for most common case wchar[BUF_SIZE] buffW = void; immutable n = cenforce(GetCurrentDirectoryW(to!DWORD(buffW.length), buffW.ptr), "getcwd"); // we can do it because toUTFX always produces a fresh string if (n < buffW.length) { return buffW[0 .. n].to!string; } else //staticBuff isn't enough { auto cn = checked(n); auto ptr = cast(wchar*) malloc((cn * wchar.sizeof).get); scope(exit) free(ptr); immutable n2 = GetCurrentDirectoryW(cn.get, ptr); cenforce(n2 && n2 < cn, "getcwd"); return ptr[0 .. n2].to!string; } } else version (Solaris) string getcwd() @trusted { /* BUF_SIZE >= PATH_MAX */ enum BUF_SIZE = 4096; /* The user should be able to specify any size buffer > 0 */ auto p = cenforce(core.sys.posix.unistd.getcwd(null, BUF_SIZE), "cannot get cwd"); scope(exit) core.stdc.stdlib.free(p); return p[0 .. core.stdc.string.strlen(p)].idup; } else version (Posix) string getcwd() @trusted { auto p = cenforce(core.sys.posix.unistd.getcwd(null, 0), "cannot get cwd"); scope(exit) core.stdc.stdlib.free(p); return p[0 .. core.stdc.string.strlen(p)].idup; } /// @safe unittest { auto s = getcwd(); assert(s.length); } version (OSX) private extern (C) int _NSGetExecutablePath(char* buf, uint* bufsize); else version (FreeBSD) private extern (C) int sysctl (const int* name, uint namelen, void* oldp, size_t* oldlenp, const void* newp, size_t newlen); else version (NetBSD) private extern (C) int sysctl (const int* name, uint namelen, void* oldp, size_t* oldlenp, const void* newp, size_t newlen); /** * Returns the full path of the current executable. * * Returns: * The path of the executable as a `string`. * * Throws: * $(REF1 Exception, object) */ @trusted string thisExePath() { version (OSX) { import core.sys.posix.stdlib : realpath; import std.conv : to; import std.exception : errnoEnforce; uint size; _NSGetExecutablePath(null, &size); // get the length of the path auto buffer = new char[size]; _NSGetExecutablePath(buffer.ptr, &size); auto absolutePath = realpath(buffer.ptr, null); // let the function allocate scope (exit) { if (absolutePath) free(absolutePath); } errnoEnforce(absolutePath); return to!(string)(absolutePath); } else version (linux) { return readLink("/proc/self/exe"); } else version (Windows) { import std.conv : to; import std.exception : enforce; wchar[MAX_PATH] buf; wchar[] buffer = buf[]; while (true) { auto len = GetModuleFileNameW(null, buffer.ptr, cast(DWORD) buffer.length); enforce(len, sysErrorString(GetLastError())); if (len != buffer.length) return to!(string)(buffer[0 .. len]); buffer.length *= 2; } } else version (FreeBSD) { import std.exception : errnoEnforce, assumeUnique; enum { CTL_KERN = 1, KERN_PROC = 14, KERN_PROC_PATHNAME = 12 } int[4] mib = [CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1]; size_t len; auto result = sysctl(mib.ptr, mib.length, null, &len, null, 0); // get the length of the path errnoEnforce(result == 0); auto buffer = new char[len - 1]; result = sysctl(mib.ptr, mib.length, buffer.ptr, &len, null, 0); errnoEnforce(result == 0); return buffer.assumeUnique; } else version (NetBSD) { return readLink("/proc/self/exe"); } else version (DragonFlyBSD) { return readLink("/proc/curproc/file"); } else version (Solaris) { import core.sys.posix.unistd : getpid; import std.string : format; // Only Solaris 10 and later return readLink(format("/proc/%d/path/a.out", getpid())); } else static assert(0, "thisExePath is not supported on this platform"); } /// @safe unittest { import std.path : isAbsolute; auto path = thisExePath(); assert(path.exists); assert(path.isAbsolute); assert(path.isFile); } version (StdDdoc) { /++ Info on a file, similar to what you'd get from stat on a Posix system. +/ struct DirEntry { @safe: /++ Constructs a `DirEntry` for the given file (or directory). Params: path = The file (or directory) to get a DirEntry for. Throws: $(LREF FileException) if the file does not exist. +/ this(string path); version (Windows) { private this(string path, in WIN32_FIND_DATAW *fd); } else version (Posix) { private this(string path, core.sys.posix.dirent.dirent* fd); } /++ Returns the path to the file represented by this `DirEntry`. Example: -------------------- auto de1 = DirEntry("/etc/fonts/fonts.conf"); assert(de1.name == "/etc/fonts/fonts.conf"); auto de2 = DirEntry("/usr/share/include"); assert(de2.name == "/usr/share/include"); -------------------- +/ @property string name() const; /++ Returns whether the file represented by this `DirEntry` is a directory. Example: -------------------- auto de1 = DirEntry("/etc/fonts/fonts.conf"); assert(!de1.isDir); auto de2 = DirEntry("/usr/share/include"); assert(de2.isDir); -------------------- +/ @property bool isDir(); /++ Returns whether the file represented by this `DirEntry` is a file. On Windows, if a file is not a directory, then it's a file. So, either `isFile` or `isDir` will return `true`. On Posix systems, if `isFile` is `true`, that indicates that the file is a regular file (e.g. not a block not device). So, on Posix systems, it's possible for both `isFile` and `isDir` to be `false` for a particular file (in which case, it's a special file). You can use `attributes` or `statBuf` to get more information about a special file (see the stat man page for more details). Example: -------------------- auto de1 = DirEntry("/etc/fonts/fonts.conf"); assert(de1.isFile); auto de2 = DirEntry("/usr/share/include"); assert(!de2.isFile); -------------------- +/ @property bool isFile(); /++ Returns whether the file represented by this `DirEntry` is a symbolic link. On Windows, return `true` when the file is either a symbolic link or a junction point. +/ @property bool isSymlink(); /++ Returns the size of the the file represented by this `DirEntry` in bytes. +/ @property ulong size(); /++ $(BLUE This function is Windows-Only.) Returns the creation time of the file represented by this `DirEntry`. +/ @property SysTime timeCreated() const; /++ Returns the time that the file represented by this `DirEntry` was last accessed. Note that many file systems do not update the access time for files (generally for performance reasons), so there's a good chance that `timeLastAccessed` will return the same value as `timeLastModified`. +/ @property SysTime timeLastAccessed(); /++ Returns the time that the file represented by this `DirEntry` was last modified. +/ @property SysTime timeLastModified(); /++ $(BLUE This function is Posix-Only.) Returns the time that the file represented by this `DirEntry` was last changed (not only in contents, but also in permissions or ownership). +/ @property SysTime timeStatusChanged() const; /++ Returns the _attributes of the file represented by this `DirEntry`. Note that the file _attributes on Windows and Posix systems are completely different. On, Windows, they're what is returned by `GetFileAttributes` $(HTTP msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx, GetFileAttributes) Whereas, an Posix systems, they're the `st_mode` value which is part of the `stat` struct gotten by calling `stat`. On Posix systems, if the file represented by this `DirEntry` is a symbolic link, then _attributes are the _attributes of the file pointed to by the symbolic link. +/ @property uint attributes(); /++ On Posix systems, if the file represented by this `DirEntry` is a symbolic link, then `linkAttributes` are the attributes of the symbolic link itself. Otherwise, `linkAttributes` is identical to `attributes`. On Windows, `linkAttributes` is identical to `attributes`. It exists on Windows so that you don't have to special-case code for Windows when dealing with symbolic links. +/ @property uint linkAttributes(); version (Windows) alias stat_t = void*; /++ $(BLUE This function is Posix-Only.) The `stat` struct gotten from calling `stat`. +/ @property stat_t statBuf(); } } else version (Windows) { struct DirEntry { @safe: public: alias name this; this(string path) { import std.datetime.systime : FILETIMEToSysTime; if (!path.exists()) throw new FileException(path, "File does not exist"); _name = path; with (getFileAttributesWin(path)) { _size = makeUlong(nFileSizeLow, nFileSizeHigh); _timeCreated = FILETIMEToSysTime(&ftCreationTime); _timeLastAccessed = FILETIMEToSysTime(&ftLastAccessTime); _timeLastModified = FILETIMEToSysTime(&ftLastWriteTime); _attributes = dwFileAttributes; } } private this(string path, WIN32_FIND_DATAW *fd) @trusted { import core.stdc.wchar_ : wcslen; import std.conv : to; import std.datetime.systime : FILETIMEToSysTime; import std.path : buildPath; fd.cFileName[$ - 1] = 0; size_t clength = wcslen(&fd.cFileName[0]); _name = buildPath(path, fd.cFileName[0 .. clength].to!string); _size = (cast(ulong) fd.nFileSizeHigh << 32) | fd.nFileSizeLow; _timeCreated = FILETIMEToSysTime(&fd.ftCreationTime); _timeLastAccessed = FILETIMEToSysTime(&fd.ftLastAccessTime); _timeLastModified = FILETIMEToSysTime(&fd.ftLastWriteTime); _attributes = fd.dwFileAttributes; } @property string name() const pure nothrow { return _name; } @property bool isDir() const pure nothrow { return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } @property bool isFile() const pure nothrow { //Are there no options in Windows other than directory and file? //If there are, then this probably isn't the best way to determine //whether this DirEntry is a file or not. return !isDir; } @property bool isSymlink() const pure nothrow { return (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; } @property ulong size() const pure nothrow { return _size; } @property SysTime timeCreated() const pure nothrow { return cast(SysTime)_timeCreated; } @property SysTime timeLastAccessed() const pure nothrow { return cast(SysTime)_timeLastAccessed; } @property SysTime timeLastModified() const pure nothrow { return cast(SysTime)_timeLastModified; } @property uint attributes() const pure nothrow { return _attributes; } @property uint linkAttributes() const pure nothrow { return _attributes; } private: string _name; /// The file or directory represented by this DirEntry. SysTime _timeCreated; /// The time when the file was created. SysTime _timeLastAccessed; /// The time when the file was last accessed. SysTime _timeLastModified; /// The time when the file was last modified. ulong _size; /// The size of the file in bytes. uint _attributes; /// The file attributes from WIN32_FIND_DATAW. } } else version (Posix) { struct DirEntry { @safe: public: alias name this; this(string path) { if (!path.exists) throw new FileException(path, "File does not exist"); _name = path; _didLStat = false; _didStat = false; _dTypeSet = false; } private this(string path, core.sys.posix.dirent.dirent* fd) @safe { import std.path : buildPath; static if (is(typeof(fd.d_namlen))) immutable len = fd.d_namlen; else immutable len = (() @trusted => core.stdc.string.strlen(fd.d_name.ptr))(); _name = buildPath(path, (() @trusted => fd.d_name.ptr[0 .. len])()); _didLStat = false; _didStat = false; //fd_d_type doesn't work for all file systems, //in which case the result is DT_UNKOWN. But we //can determine the correct type from lstat, so //we'll only set the dtype here if we could //correctly determine it (not lstat in the case //of DT_UNKNOWN in case we don't ever actually //need the dtype, thus potentially avoiding the //cost of calling lstat). static if (__traits(compiles, fd.d_type != DT_UNKNOWN)) { if (fd.d_type != DT_UNKNOWN) { _dType = fd.d_type; _dTypeSet = true; } else _dTypeSet = false; } else { // e.g. Solaris does not have the d_type member _dTypeSet = false; } } @property string name() const pure nothrow { return _name; } @property bool isDir() { _ensureStatOrLStatDone(); return (_statBuf.st_mode & S_IFMT) == S_IFDIR; } @property bool isFile() { _ensureStatOrLStatDone(); return (_statBuf.st_mode & S_IFMT) == S_IFREG; } @property bool isSymlink() { _ensureLStatDone(); return (_lstatMode & S_IFMT) == S_IFLNK; } @property ulong size() { _ensureStatDone(); return _statBuf.st_size; } @property SysTime timeStatusChanged() { _ensureStatDone(); return statTimeToStdTime!'c'(_statBuf); } @property SysTime timeLastAccessed() { _ensureStatDone(); return statTimeToStdTime!'a'(_statBuf); } @property SysTime timeLastModified() { _ensureStatDone(); return statTimeToStdTime!'m'(_statBuf); } @property uint attributes() { _ensureStatDone(); return _statBuf.st_mode; } @property uint linkAttributes() { _ensureLStatDone(); return _lstatMode; } @property stat_t statBuf() { _ensureStatDone(); return _statBuf; } private: /++ This is to support lazy evaluation, because doing stat's is expensive and not always needed. +/ void _ensureStatDone() @trusted { import std.exception : enforce; if (_didStat) return; enforce(stat(_name.tempCString(), &_statBuf) == 0, "Failed to stat file `" ~ _name ~ "'"); _didStat = true; } /++ This is to support lazy evaluation, because doing stat's is expensive and not always needed. Try both stat and lstat for isFile and isDir to detect broken symlinks. +/ void _ensureStatOrLStatDone() @trusted { if (_didStat) return; if (stat(_name.tempCString(), &_statBuf) != 0) { _ensureLStatDone(); _statBuf = stat_t.init; _statBuf.st_mode = S_IFLNK; } else { _didStat = true; } } /++ This is to support lazy evaluation, because doing stat's is expensive and not always needed. +/ void _ensureLStatDone() @trusted { import std.exception : enforce; if (_didLStat) return; stat_t statbuf = void; enforce(lstat(_name.tempCString(), &statbuf) == 0, "Failed to stat file `" ~ _name ~ "'"); _lstatMode = statbuf.st_mode; _dTypeSet = true; _didLStat = true; } string _name; /// The file or directory represented by this DirEntry. stat_t _statBuf = void; /// The result of stat(). uint _lstatMode; /// The stat mode from lstat(). ubyte _dType; /// The type of the file. bool _didLStat = false; /// Whether lstat() has been called for this DirEntry. bool _didStat = false; /// Whether stat() has been called for this DirEntry. bool _dTypeSet = false; /// Whether the dType of the file has been set. } } @system unittest { version (Windows) { if ("C:\\Program Files\\".exists) { auto de = DirEntry("C:\\Program Files\\"); assert(!de.isFile); assert(de.isDir); assert(!de.isSymlink); } if ("C:\\Users\\".exists && "C:\\Documents and Settings\\".exists) { auto de = DirEntry("C:\\Documents and Settings\\"); assert(de.isSymlink); } if ("C:\\Windows\\system.ini".exists) { auto de = DirEntry("C:\\Windows\\system.ini"); assert(de.isFile); assert(!de.isDir); assert(!de.isSymlink); } } else version (Posix) { import std.exception : assertThrown; if (system_directory.exists) { { auto de = DirEntry(system_directory); assert(!de.isFile); assert(de.isDir); assert(!de.isSymlink); } immutable symfile = deleteme ~ "_slink\0"; scope(exit) if (symfile.exists) symfile.remove(); core.sys.posix.unistd.symlink(system_directory, symfile.ptr); { auto de = DirEntry(symfile); assert(!de.isFile); assert(de.isDir); assert(de.isSymlink); } symfile.remove(); core.sys.posix.unistd.symlink((deleteme ~ "_broken_symlink\0").ptr, symfile.ptr); { //Issue 8298 DirEntry de = DirEntry(symfile); assert(!de.isFile); assert(!de.isDir); assert(de.isSymlink); assertThrown(de.size); assertThrown(de.timeStatusChanged); assertThrown(de.timeLastAccessed); assertThrown(de.timeLastModified); assertThrown(de.attributes); assertThrown(de.statBuf); assert(symfile.exists); symfile.remove(); } } if (system_file.exists) { auto de = DirEntry(system_file); assert(de.isFile); assert(!de.isDir); assert(!de.isSymlink); } } } alias PreserveAttributes = Flag!"preserveAttributes"; version (StdDdoc) { /// Defaults to `Yes.preserveAttributes` on Windows, and the opposite on all other platforms. PreserveAttributes preserveAttributesDefault; } else version (Windows) { enum preserveAttributesDefault = Yes.preserveAttributes; } else { enum preserveAttributesDefault = No.preserveAttributes; } /*************************************************** Copy file `from` _to file `to`. File timestamps are preserved. File attributes are preserved, if `preserve` equals `Yes.preserveAttributes`. On Windows only `Yes.preserveAttributes` (the default on Windows) is supported. If the target file exists, it is overwritten. Params: from = string or range of characters representing the existing file name to = string or range of characters representing the target file name preserve = whether to _preserve the file attributes Throws: $(LREF FileException) on error. */ void copy(RF, RT)(RF from, RT to, PreserveAttributes preserve = preserveAttributesDefault) if (isInputRange!RF && !isInfinite!RF && isSomeChar!(ElementEncodingType!RF) && !isConvertibleToString!RF && isInputRange!RT && !isInfinite!RT && isSomeChar!(ElementEncodingType!RT) && !isConvertibleToString!RT) { // Place outside of @trusted block auto fromz = from.tempCString!FSChar(); auto toz = to.tempCString!FSChar(); static if (isNarrowString!RF && is(Unqual!(ElementEncodingType!RF) == char)) alias f = from; else enum string f = null; static if (isNarrowString!RT && is(Unqual!(ElementEncodingType!RT) == char)) alias t = to; else enum string t = null; copyImpl(f, t, fromz, toz, preserve); } /// ditto void copy(RF, RT)(auto ref RF from, auto ref RT to, PreserveAttributes preserve = preserveAttributesDefault) if (isConvertibleToString!RF || isConvertibleToString!RT) { import std.meta : staticMap; alias Types = staticMap!(convertToString, RF, RT); copy!Types(from, to, preserve); } /// @safe unittest { auto source = deleteme ~ "source"; auto target = deleteme ~ "target"; auto targetNonExistent = deleteme ~ "target2"; scope(exit) source.remove, target.remove, targetNonExistent.remove; source.write("source"); target.write("target"); assert(target.readText == "target"); source.copy(target); assert(target.readText == "source"); source.copy(targetNonExistent); assert(targetNonExistent.readText == "source"); } @safe unittest // issue 15319 { assert(__traits(compiles, copy("from.txt", "to.txt"))); } private void copyImpl(scope const(char)[] f, scope const(char)[] t, scope const(FSChar)* fromz, scope const(FSChar)* toz, PreserveAttributes preserve) @trusted { version (Windows) { assert(preserve == Yes.preserveAttributes); immutable result = CopyFileW(fromz, toz, false); if (!result) { import core.stdc.wchar_ : wcslen; import std.conv : to; if (!t) t = to!(typeof(t))(toz[0 .. wcslen(toz)]); throw new FileException(t); } } else version (Posix) { static import core.stdc.stdio; import std.conv : to, octal; immutable fdr = core.sys.posix.fcntl.open(fromz, O_RDONLY); cenforce(fdr != -1, f, fromz); scope(exit) core.sys.posix.unistd.close(fdr); stat_t statbufr = void; cenforce(fstat(fdr, &statbufr) == 0, f, fromz); //cenforce(core.sys.posix.sys.stat.fstat(fdr, &statbufr) == 0, f, fromz); immutable fdw = core.sys.posix.fcntl.open(toz, O_CREAT | O_WRONLY, octal!666); cenforce(fdw != -1, t, toz); { scope(failure) core.sys.posix.unistd.close(fdw); stat_t statbufw = void; cenforce(fstat(fdw, &statbufw) == 0, t, toz); if (statbufr.st_dev == statbufw.st_dev && statbufr.st_ino == statbufw.st_ino) throw new FileException(t, "Source and destination are the same file"); } scope(failure) core.stdc.stdio.remove(toz); { scope(failure) core.sys.posix.unistd.close(fdw); cenforce(ftruncate(fdw, 0) == 0, t, toz); auto BUFSIZ = 4096u * 16; auto buf = core.stdc.stdlib.malloc(BUFSIZ); if (!buf) { BUFSIZ = 4096; buf = core.stdc.stdlib.malloc(BUFSIZ); if (!buf) { import core.exception : onOutOfMemoryError; onOutOfMemoryError(); } } scope(exit) core.stdc.stdlib.free(buf); for (auto size = statbufr.st_size; size; ) { immutable toxfer = (size > BUFSIZ) ? BUFSIZ : cast(size_t) size; cenforce( core.sys.posix.unistd.read(fdr, buf, toxfer) == toxfer && core.sys.posix.unistd.write(fdw, buf, toxfer) == toxfer, f, fromz); assert(size >= toxfer); size -= toxfer; } if (preserve) cenforce(fchmod(fdw, to!mode_t(statbufr.st_mode)) == 0, f, fromz); } cenforce(core.sys.posix.unistd.close(fdw) != -1, f, fromz); utimbuf utim = void; utim.actime = cast(time_t) statbufr.st_atime; utim.modtime = cast(time_t) statbufr.st_mtime; cenforce(utime(toz, &utim) != -1, f, fromz); } } @safe unittest { import std.algorithm, std.file; // issue 14817 auto t1 = deleteme, t2 = deleteme~"2"; scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove(); write(t1, "11"); copy(t1, t2); assert(readText(t2) == "11"); write(t1, "2"); copy(t1, t2); assert(readText(t2) == "2"); import std.utf : byChar; copy(t1.byChar, t2.byChar); assert(readText(t2.byChar) == "2"); } @safe version (Posix) @safe unittest //issue 11434 { import std.conv : octal; auto t1 = deleteme, t2 = deleteme~"2"; scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove(); write(t1, "1"); setAttributes(t1, octal!767); copy(t1, t2, Yes.preserveAttributes); assert(readText(t2) == "1"); assert(getAttributes(t2) == octal!100767); } @safe unittest // issue 15865 { import std.exception : assertThrown; auto t = deleteme; write(t, "a"); scope(exit) t.remove(); assertThrown!FileException(copy(t, t)); assert(readText(t) == "a"); } /++ Remove directory and all of its content and subdirectories, recursively. Params: pathname = the path of the directory to completely remove de = The $(LREF DirEntry) to remove Throws: $(LREF FileException) if there is an error (including if the given file is not a directory). +/ void rmdirRecurse(scope const(char)[] pathname) { //No references to pathname will be kept after rmdirRecurse, //so the cast is safe rmdirRecurse(DirEntry(cast(string) pathname)); } /// ditto void rmdirRecurse(ref DirEntry de) { if (!de.isDir) throw new FileException(de.name, "Not a directory"); if (de.isSymlink) { version (Windows) rmdir(de.name); else remove(de.name); } else { // all children, recursively depth-first foreach (DirEntry e; dirEntries(de.name, SpanMode.depth, false)) { attrIsDir(e.linkAttributes) ? rmdir(e.name) : remove(e.name); } // the dir itself rmdir(de.name); } } ///ditto //Note, without this overload, passing an RValue DirEntry still works, but //actually fully reconstructs a DirEntry inside the //"rmdirRecurse(in char[] pathname)" implementation. That is needlessly //expensive. //A DirEntry is a bit big (72B), so keeping the "by ref" signature is desirable. void rmdirRecurse(DirEntry de) { rmdirRecurse(de); } /// @system unittest { import std.path : buildPath; auto dir = deleteme.buildPath("a", "b", "c"); dir.mkdirRecurse; assert(dir.exists); deleteme.rmdirRecurse; assert(!dir.exists); assert(!deleteme.exists); } version (Windows) @system unittest { import std.exception : enforce; auto d = deleteme ~ r".dir\a\b\c\d\e\f\g"; mkdirRecurse(d); rmdirRecurse(deleteme ~ ".dir"); enforce(!exists(deleteme ~ ".dir")); } version (Posix) @system unittest { import std.exception : enforce, collectException; import std.process : executeShell; collectException(rmdirRecurse(deleteme)); auto d = deleteme~"/a/b/c/d/e/f/g"; enforce(collectException(mkdir(d))); mkdirRecurse(d); core.sys.posix.unistd.symlink((deleteme~"/a/b/c\0").ptr, (deleteme~"/link\0").ptr); rmdirRecurse(deleteme~"/link"); enforce(exists(d)); rmdirRecurse(deleteme); enforce(!exists(deleteme)); d = deleteme~"/a/b/c/d/e/f/g"; mkdirRecurse(d); version (Android) string link_cmd = "ln -s "; else string link_cmd = "ln -sf "; executeShell(link_cmd~deleteme~"/a/b/c "~deleteme~"/link"); rmdirRecurse(deleteme); enforce(!exists(deleteme)); } @system unittest { void[] buf; buf = new void[10]; (cast(byte[]) buf)[] = 3; string unit_file = deleteme ~ "-unittest_write.tmp"; if (exists(unit_file)) remove(unit_file); write(unit_file, buf); void[] buf2 = read(unit_file); assert(buf == buf2); string unit2_file = deleteme ~ "-unittest_write2.tmp"; copy(unit_file, unit2_file); buf2 = read(unit2_file); assert(buf == buf2); remove(unit_file); assert(!exists(unit_file)); remove(unit2_file); assert(!exists(unit2_file)); } /** * Dictates directory spanning policy for $(D_PARAM dirEntries) (see below). */ enum SpanMode { /** Only spans one directory. */ shallow, /** Spans the directory in $(HTTPS en.wikipedia.org/wiki/Tree_traversal#Post-order, _depth-first $(B post)-order), i.e. the content of any subdirectory is spanned before that subdirectory itself. Useful e.g. when recursively deleting files. */ depth, /** Spans the directory in $(HTTPS en.wikipedia.org/wiki/Tree_traversal#Pre-order, depth-first $(B pre)-order), i.e. the content of any subdirectory is spanned right after that subdirectory itself. Note that `SpanMode.breadth` will not result in all directory members occurring before any subdirectory members, i.e. it is not _true $(HTTPS en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search, _breadth-first traversal). */ breadth, } /// @system unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; import std.path : buildPath, relativePath; auto root = deleteme ~ "root"; scope(exit) root.rmdirRecurse; root.mkdir; root.buildPath("animals").mkdir; root.buildPath("animals", "cat").mkdir; root.buildPath("animals", "dog").mkdir; root.buildPath("plants").mkdir; alias removeRoot = (e) => e.relativePath(root); root.dirEntries(SpanMode.shallow).map!removeRoot.equal( ["plants", "animals"]); root.dirEntries(SpanMode.depth).map!removeRoot.equal( ["plants", "animals/dog", "animals/cat", "animals"]); root.dirEntries(SpanMode.breadth).map!removeRoot.equal( ["plants", "animals", "animals/dog", "animals/cat"]); } private struct DirIteratorImpl { @safe: SpanMode _mode; // Whether we should follow symlinked directories while iterating. // It also indicates whether we should avoid functions which call // stat (since we should only need lstat in this case and it would // be more efficient to not call stat in addition to lstat). bool _followSymlink; DirEntry _cur; DirHandle[] _stack; DirEntry[] _stashed; //used in depth first mode //stack helpers void pushExtra(DirEntry de) { _stashed ~= de; } //ditto bool hasExtra() { return _stashed.length != 0; } //ditto DirEntry popExtra() { DirEntry de; de = _stashed[$-1]; _stashed.popBack(); return de; } version (Windows) { WIN32_FIND_DATAW _findinfo; struct DirHandle { string dirpath; HANDLE h; } bool stepIn(string directory) @safe { import std.path : chainPath; auto searchPattern = chainPath(directory, "*.*"); static auto trustedFindFirstFileW(typeof(searchPattern) pattern, WIN32_FIND_DATAW* findinfo) @trusted { return FindFirstFileW(pattern.tempCString!FSChar(), findinfo); } HANDLE h = trustedFindFirstFileW(searchPattern, &_findinfo); cenforce(h != INVALID_HANDLE_VALUE, directory); _stack ~= DirHandle(directory, h); return toNext(false, &_findinfo); } bool next() { if (_stack.length == 0) return false; return toNext(true, &_findinfo); } bool toNext(bool fetch, WIN32_FIND_DATAW* findinfo) @trusted { import core.stdc.wchar_ : wcscmp; if (fetch) { if (FindNextFileW(_stack[$-1].h, findinfo) == FALSE) { popDirStack(); return false; } } while (wcscmp(&findinfo.cFileName[0], ".") == 0 || wcscmp(&findinfo.cFileName[0], "..") == 0) if (FindNextFileW(_stack[$-1].h, findinfo) == FALSE) { popDirStack(); return false; } _cur = DirEntry(_stack[$-1].dirpath, findinfo); return true; } void popDirStack() @trusted { assert(_stack.length != 0); FindClose(_stack[$-1].h); _stack.popBack(); } void releaseDirStack() @trusted { foreach (d; _stack) FindClose(d.h); } bool mayStepIn() { return _followSymlink ? _cur.isDir : _cur.isDir && !_cur.isSymlink; } } else version (Posix) { struct DirHandle { string dirpath; DIR* h; } bool stepIn(string directory) { static auto trustedOpendir(string dir) @trusted { return opendir(dir.tempCString()); } auto h = directory.length ? trustedOpendir(directory) : trustedOpendir("."); cenforce(h, directory); _stack ~= (DirHandle(directory, h)); return next(); } bool next() @trusted { if (_stack.length == 0) return false; for (dirent* fdata; (fdata = readdir(_stack[$-1].h)) != null; ) { // Skip "." and ".." if (core.stdc.string.strcmp(&fdata.d_name[0], ".") && core.stdc.string.strcmp(&fdata.d_name[0], "..")) { _cur = DirEntry(_stack[$-1].dirpath, fdata); return true; } } popDirStack(); return false; } void popDirStack() @trusted { assert(_stack.length != 0); closedir(_stack[$-1].h); _stack.popBack(); } void releaseDirStack() @trusted { foreach (d; _stack) closedir(d.h); } bool mayStepIn() { return _followSymlink ? _cur.isDir : attrIsDir(_cur.linkAttributes); } } this(R)(R pathname, SpanMode mode, bool followSymlink) if (isInputRange!R && isSomeChar!(ElementEncodingType!R)) { _mode = mode; _followSymlink = followSymlink; static if (isNarrowString!R && is(Unqual!(ElementEncodingType!R) == char)) alias pathnameStr = pathname; else { import std.array : array; string pathnameStr = pathname.array; } if (stepIn(pathnameStr)) { if (_mode == SpanMode.depth) while (mayStepIn()) { auto thisDir = _cur; if (stepIn(_cur.name)) { pushExtra(thisDir); } else break; } } } @property bool empty() { return _stashed.length == 0 && _stack.length == 0; } @property DirEntry front() { return _cur; } void popFront() { switch (_mode) { case SpanMode.depth: if (next()) { while (mayStepIn()) { auto thisDir = _cur; if (stepIn(_cur.name)) { pushExtra(thisDir); } else break; } } else if (hasExtra()) _cur = popExtra(); break; case SpanMode.breadth: if (mayStepIn()) { if (!stepIn(_cur.name)) while (!empty && !next()){} } else while (!empty && !next()){} break; default: next(); } } ~this() { releaseDirStack(); } } struct DirIterator { @safe: private: RefCounted!(DirIteratorImpl, RefCountedAutoInitialize.no) impl = void; this(string pathname, SpanMode mode, bool followSymlink) @trusted { impl = typeof(impl)(pathname, mode, followSymlink); } public: @property bool empty() { return impl.empty; } @property DirEntry front() { return impl.front; } void popFront() { impl.popFront(); } } /++ Returns an $(REF_ALTTEXT input range, isInputRange, std,range,primitives) of `DirEntry` that lazily iterates a given directory, also provides two ways of foreach iteration. The iteration variable can be of type `string` if only the name is needed, or `DirEntry` if additional details are needed. The span _mode dictates how the directory is traversed. The name of each iterated directory entry contains the absolute or relative _path (depending on _pathname). Params: path = The directory to iterate over. If empty, the current directory will be iterated. pattern = Optional string with wildcards, such as $(RED "*.d"). When present, it is used to filter the results by their file name. The supported wildcard strings are described under $(REF globMatch, std,_path). mode = Whether the directory's sub-directories should be iterated in depth-first post-order ($(LREF depth)), depth-first pre-order ($(LREF breadth)), or not at all ($(LREF shallow)). followSymlink = Whether symbolic links which point to directories should be treated as directories and their contents iterated over. Returns: An $(REF_ALTTEXT input range, isInputRange,std,range,primitives) of $(LREF DirEntry). Throws: $(LREF FileException) if the directory does not exist. Example: -------------------- // Iterate a directory in depth foreach (string name; dirEntries("destroy/me", SpanMode.depth)) { remove(name); } // Iterate the current directory in breadth foreach (string name; dirEntries("", SpanMode.breadth)) { writeln(name); } // Iterate a directory and get detailed info about it foreach (DirEntry e; dirEntries("dmd-testing", SpanMode.breadth)) { writeln(e.name, "\t", e.size); } // Iterate over all *.d files in current directory and all its subdirectories auto dFiles = dirEntries("", SpanMode.depth).filter!(f => f.name.endsWith(".d")); foreach (d; dFiles) writeln(d.name); // Hook it up with std.parallelism to compile them all in parallel: foreach (d; parallel(dFiles, 1)) //passes by 1 file to each thread { string cmd = "dmd -c " ~ d.name; writeln(cmd); std.process.executeShell(cmd); } // Iterate over all D source files in current directory and all its // subdirectories auto dFiles = dirEntries("","*.{d,di}",SpanMode.depth); foreach (d; dFiles) writeln(d.name); -------------------- +/ auto dirEntries(string path, SpanMode mode, bool followSymlink = true) { return DirIterator(path, mode, followSymlink); } /// Duplicate functionality of D1's `std.file.listdir()`: @safe unittest { string[] listdir(string pathname) { import std.algorithm; import std.array; import std.file; import std.path; return std.file.dirEntries(pathname, SpanMode.shallow) .filter!(a => a.isFile) .map!(a => std.path.baseName(a.name)) .array; } void main(string[] args) { import std.stdio; string[] files = listdir(args[1]); writefln("%s", files); } } @system unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; import std.algorithm.searching : startsWith; import std.array : array; import std.conv : to; import std.path : buildPath, absolutePath; import std.file : dirEntries; import std.process : thisProcessID; import std.range.primitives : walkLength; version (Android) string testdir = deleteme; // This has to be an absolute path when // called from a shared library on Android, // ie an apk else string testdir = "deleteme.dmd.unittest.std.file" ~ to!string(thisProcessID); // needs to be relative mkdirRecurse(buildPath(testdir, "somedir")); scope(exit) rmdirRecurse(testdir); write(buildPath(testdir, "somefile"), null); write(buildPath(testdir, "somedir", "somedeepfile"), null); // testing range interface size_t equalEntries(string relpath, SpanMode mode) { import std.exception : enforce; auto len = enforce(walkLength(dirEntries(absolutePath(relpath), mode))); assert(walkLength(dirEntries(relpath, mode)) == len); assert(equal( map!(a => absolutePath(a.name))(dirEntries(relpath, mode)), map!(a => a.name)(dirEntries(absolutePath(relpath), mode)))); return len; } assert(equalEntries(testdir, SpanMode.shallow) == 2); assert(equalEntries(testdir, SpanMode.depth) == 3); assert(equalEntries(testdir, SpanMode.breadth) == 3); // testing opApply foreach (string name; dirEntries(testdir, SpanMode.breadth)) { //writeln(name); assert(name.startsWith(testdir)); } foreach (DirEntry e; dirEntries(absolutePath(testdir), SpanMode.breadth)) { //writeln(name); assert(e.isFile || e.isDir, e.name); } //issue 7264 foreach (string name; dirEntries(testdir, "*.d", SpanMode.breadth)) { } foreach (entry; dirEntries(testdir, SpanMode.breadth)) { static assert(is(typeof(entry) == DirEntry)); } //issue 7138 auto a = array(dirEntries(testdir, SpanMode.shallow)); // issue 11392 auto dFiles = dirEntries(testdir, SpanMode.shallow); foreach (d; dFiles){} // issue 15146 dirEntries("", SpanMode.shallow).walkLength(); } /// Ditto auto dirEntries(string path, string pattern, SpanMode mode, bool followSymlink = true) { import std.algorithm.iteration : filter; import std.path : globMatch, baseName; bool f(DirEntry de) { return globMatch(baseName(de.name), pattern); } return filter!f(DirIterator(path, mode, followSymlink)); } @system unittest { import std.stdio : writefln; immutable dpath = deleteme ~ "_dir"; immutable fpath = deleteme ~ "_file"; immutable sdpath = deleteme ~ "_sdir"; immutable sfpath = deleteme ~ "_sfile"; scope(exit) { if (dpath.exists) rmdirRecurse(dpath); if (fpath.exists) remove(fpath); if (sdpath.exists) remove(sdpath); if (sfpath.exists) remove(sfpath); } mkdir(dpath); write(fpath, "hello world"); version (Posix) { core.sys.posix.unistd.symlink((dpath ~ '\0').ptr, (sdpath ~ '\0').ptr); core.sys.posix.unistd.symlink((fpath ~ '\0').ptr, (sfpath ~ '\0').ptr); } static struct Flags { bool dir, file, link; } auto tests = [dpath : Flags(true), fpath : Flags(false, true)]; version (Posix) { tests[sdpath] = Flags(true, false, true); tests[sfpath] = Flags(false, true, true); } auto past = Clock.currTime() - 2.seconds; auto future = past + 4.seconds; foreach (path, flags; tests) { auto de = DirEntry(path); assert(de.name == path); assert(de.isDir == flags.dir); assert(de.isFile == flags.file); assert(de.isSymlink == flags.link); assert(de.isDir == path.isDir); assert(de.isFile == path.isFile); assert(de.isSymlink == path.isSymlink); assert(de.size == path.getSize()); assert(de.attributes == getAttributes(path)); assert(de.linkAttributes == getLinkAttributes(path)); scope(failure) writefln("[%s] [%s] [%s] [%s]", past, de.timeLastAccessed, de.timeLastModified, future); assert(de.timeLastAccessed > past); assert(de.timeLastAccessed < future); assert(de.timeLastModified > past); assert(de.timeLastModified < future); assert(attrIsDir(de.attributes) == flags.dir); assert(attrIsDir(de.linkAttributes) == (flags.dir && !flags.link)); assert(attrIsFile(de.attributes) == flags.file); assert(attrIsFile(de.linkAttributes) == (flags.file && !flags.link)); assert(!attrIsSymlink(de.attributes)); assert(attrIsSymlink(de.linkAttributes) == flags.link); version (Windows) { assert(de.timeCreated > past); assert(de.timeCreated < future); } else version (Posix) { assert(de.timeStatusChanged > past); assert(de.timeStatusChanged < future); assert(de.attributes == de.statBuf.st_mode); } } } // Bugzilla 17962 - Make sure that dirEntries does not butcher Unicode file names. @system unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; import std.algorithm.sorting : sort; import std.array : array; import std.path : buildPath; import std.uni : normalize; // The Unicode normalization is required to make the tests pass on Mac OS X. auto dir = deleteme ~ normalize("𐐷"); scope(exit) if (dir.exists) rmdirRecurse(dir); mkdir(dir); auto files = ["Hello World", "Ma Chérie.jpeg", "さいごの果実.txt"].map!(a => buildPath(dir, normalize(a)))().array(); sort(files); foreach (file; files) write(file, "nothing"); auto result = dirEntries(dir, SpanMode.shallow).map!(a => a.name.normalize()).array(); sort(result); assert(equal(files, result)); } /** * Reads a file line by line and parses the line into a single value or a * $(REF Tuple, std,typecons) of values depending on the length of `Types`. * The lines are parsed using the specified format string. The format string is * passed to $(REF formattedRead, std,_format), and therefore must conform to the * _format string specification outlined in $(MREF std, _format). * * Params: * Types = the types that each of the elements in the line should be returned as * filename = the name of the file to read * format = the _format string to use when reading * * Returns: * If only one type is passed, then an array of that type. Otherwise, an * array of $(REF Tuple, std,typecons)s. * * Throws: * `Exception` if the format string is malformed. Also, throws `Exception` * if any of the lines in the file are not fully consumed by the call * to $(REF formattedRead, std,_format). Meaning that no empty lines or lines * with extra characters are allowed. */ Select!(Types.length == 1, Types[0][], Tuple!(Types)[]) slurp(Types...)(string filename, scope const(char)[] format) { import std.array : appender; import std.conv : text; import std.exception : enforce; import std.format : formattedRead; import std.stdio : File; import std.string : stripRight; auto app = appender!(typeof(return))(); ElementType!(typeof(return)) toAdd; auto f = File(filename); scope(exit) f.close(); foreach (line; f.byLine()) { formattedRead(line, format, &toAdd); enforce(line.stripRight("\r").empty, text("Trailing characters at the end of line: `", line, "'")); app.put(toAdd); } return app.data; } /// @system unittest { import std.typecons : tuple; scope(exit) { assert(exists(deleteme)); remove(deleteme); } write(deleteme, "12 12.25\n345 1.125"); // deleteme is the name of a temporary file // Load file; each line is an int followed by comma, whitespace and a // double. auto a = slurp!(int, double)(deleteme, "%s %s"); assert(a.length == 2); assert(a[0] == tuple(12, 12.25)); assert(a[1] == tuple(345, 1.125)); } @system unittest { import std.typecons : tuple; scope(exit) { assert(exists(deleteme)); remove(deleteme); } write(deleteme, "10\r\n20"); assert(slurp!(int)(deleteme, "%d") == [10, 20]); } /** Returns the path to a directory for temporary files. The return value of the function is cached, so the procedures described below will only be performed the first time the function is called. All subsequent runs will return the same string, regardless of whether environment variables and directory structures have changed in the meantime. The POSIX `tempDir` algorithm is inspired by Python's $(LINK2 http://docs.python.org/library/tempfile.html#tempfile.tempdir, `tempfile.tempdir`). Returns: On Windows, this function returns the result of calling the Windows API function $(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992.aspx, `GetTempPath`). On POSIX platforms, it searches through the following list of directories and returns the first one which is found to exist: $(OL $(LI The directory given by the `TMPDIR` environment variable.) $(LI The directory given by the `TEMP` environment variable.) $(LI The directory given by the `TMP` environment variable.) $(LI `/tmp`) $(LI `/var/tmp`) $(LI `/usr/tmp`) ) On all platforms, `tempDir` returns `"."` on failure, representing the current working directory. */ string tempDir() @trusted { static string cache; if (cache is null) { version (Windows) { import std.conv : to; // http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992(v=vs.85).aspx wchar[MAX_PATH + 2] buf; DWORD len = GetTempPathW(buf.length, buf.ptr); if (len) cache = buf[0 .. len].to!string; } else version (Posix) { import std.process : environment; // This function looks through the list of alternative directories // and returns the first one which exists and is a directory. static string findExistingDir(T...)(lazy T alternatives) { foreach (dir; alternatives) if (!dir.empty && exists(dir)) return dir; return null; } cache = findExistingDir(environment.get("TMPDIR"), environment.get("TEMP"), environment.get("TMP"), "/tmp", "/var/tmp", "/usr/tmp"); } else static assert(false, "Unsupported platform"); if (cache is null) cache = getcwd(); } return cache; } /// @safe unittest { import std.ascii : letters; import std.conv : to; import std.path : buildPath; import std.random : randomSample; import std.utf : byCodeUnit; // random id with 20 letters auto id = letters.byCodeUnit.randomSample(20).to!string; auto myFile = tempDir.buildPath(id ~ "my_tmp_file"); scope(exit) myFile.remove; myFile.write("hello"); assert(myFile.readText == "hello"); }
D
// Generated by gnome-h2d.rb <http://github.com/ddude/gnome.d>. module gio.proxy; /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* GIO - GLib Input, Output and Streaming Library * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> */ /+ #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) #error "Only <gio/gio.h> can be included directly." //#endif +/ public import gio.types; extern(C): //#define G_TYPE_PROXY (g_proxy_get_type ()) //#define G_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_PROXY, GProxy)) //#define G_IS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_PROXY)) //#define G_PROXY_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_PROXY, GProxyInterface)) /** * G_PROXY_EXTENSION_POINT_NAME: * * Extension point for proxy functionality. * See <link linkend="extending-gio">Extending GIO</link>. * * Since: 2.26 */ //#define G_PROXY_EXTENSION_POINT_NAME "gio-proxy" /** * GProxy: * * Interface that handles proxy connection and payload. * * Since: 2.26 */ //struct _GProxyInterface GProxyInterface; /** * GProxyInterface: * @g_iface: The parent interface. * @connect: Connect to proxy server and wrap (if required) the #connection * to handle payload. * @connect_async: Same as connect() but asynchronous. * @connect_finish: Returns the result of connect_async() * @supports_hostname: Returns whether the proxy supports hostname lookups. * * Provides an interface for handling proxy connection and payload. * * Since: 2.26 */ struct GProxyInterface { GTypeInterface g_iface; /* Virtual Table */ GIOStream * function(GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GError **error) connect; void function(GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) connect_async; GIOStream * function(GProxy *proxy, GAsyncResult *result, GError **error) connect_finish; gboolean function(GProxy *proxy) supports_hostname; }; GType g_proxy_get_type () pure; GProxy *g_proxy_get_default_for_protocol (const(gchar)* protocol); GIOStream *g_proxy_connect (GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GError **error); void g_proxy_connect_async (GProxy *proxy, GIOStream *connection, GProxyAddress *proxy_address, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GIOStream *g_proxy_connect_finish (GProxy *proxy, GAsyncResult *result, GError **error); gboolean g_proxy_supports_hostname (GProxy *proxy);
D
const string TOPIC_MOD_NEBENGILDEN = "Nebengilden"; const string TOPIC_MOD_GESINNUNG = "Gesinnungen"; const string TOPIC_MOD_OBELISK = "Teleport-Obelisk"; const string TOPIC_MOD_STEINKREIS = "Steinkreise"; const string TOPIC_MOD_GIFT = "Über Gifte"; const string TOPIC_MOD_KRANKHEIT = "Über Krankheiten"; const string TOPIC_MOD_PFEILE = "Pfeilherstellung"; const string TOPIC_MOD_KOCHREZEPTE = "Rezepte"; const string TOPIC_MOD_MOOR = "Das Moor in Relendel"; const string TOPIC_MOD_PRISMA = "Allgemeine Infos"; const string TOPIC_MOD_SCHAGBY = "Schagby"; const string TOPIC_MOD_SCHMUCK = "Schmuckbaupläne"; const string TOPIC_MOD_RUESTUNGSUPGADSE = "Rüstungsverbesserung";
D
/Users/wilsonvinson/Documents/GitHub/RUST01/rust01_01/target/debug/deps/window-9225ef87b0dccc9d.rmeta: /Users/wilsonvinson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.31.0/src/lib.rs /Users/wilsonvinson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.31.0/src/no_window.rs /Users/wilsonvinson/Documents/GitHub/RUST01/rust01_01/target/debug/deps/window-9225ef87b0dccc9d.d: /Users/wilsonvinson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.31.0/src/lib.rs /Users/wilsonvinson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.31.0/src/no_window.rs /Users/wilsonvinson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.31.0/src/lib.rs: /Users/wilsonvinson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.31.0/src/no_window.rs:
D
//СТРАННИК Модула-Си-Паскаль для Win32 //Модуль TRAP (трансляция модуля, язык Паскаль) //Файл SMTRAP.D definition module SmTraP; import Win32,SmDat; procedure trapMODULE(var S:recStream); end SmTraP.
D
// // 結果 https://paiza.jp/poh/joshibato/tsubame/result/62a1085b // import std.stdio; void main() { int n, n1, n10, r; readf("%d", &n); n1 = n % 10; n10 = (n - n1) / 10; r = n + n1 + n10; writeln(r); }
D
PLONG PLAT ED95 KD LOMAGAGE HIMAGAGE SLAT SLONG RESULTNO DP DM WT ROCKTYPE 292.5 65.5 1.60000002 262.700012 34 39 -38.7999992 143.399994 7097 2.5 2.5 0.955004591 sediments, red-brown clays 264.399994 75 15.6000004 0 2 65 -8.80000019 126.699997 1206 10.3999996 18 0.444444444 extrusives, intrusives 346 61 9 41.2000008 35 100 -31.3999996 138.600006 1170 13 15 0.841346154 sediments 333 45 9 16.5 35 100 -30.3999996 139.399994 1161 17 18 0.902777778 sediments, tillite 317 57 5 200 35 100 -30.5 139.300003 1165 9 10 0.742857143 sediments, redbeds 329 58 25 4.0999999 35 100 -30.2000008 139 1166 41.5999985 45.5999985 0.89047619 sediments, sandstone, tillite 223 26 13 14.8000002 35 100 -30.2999992 139.5 1157 26 26 0.868965517 extrusives 320 63 9 15.5 34 65 -38 145.5 1854 16 16 0.931 extrusives 317 63 14 16 23 56 -32.5 151 1840 20 20 0.851351351 extrusives, basalts 302.700012 66.8000031 6.80000019 35 34 65 -38 145.5 1819 10.8000002 12.1000004 0.912592593 extrusives 305 73 17 29 23 56 -42 147 1821 25 29 0.65625 extrusives, basalts 274 66 27.6000004 8.60000038 25 65 -41.2999992 145.899994 1873 39.7999992 46.9000015 0.766666667 intrusives, granite 321 64 6 27.5 25 65 -35.5999985 137.5 1874 10 11 0.935454545 sediments 294 75 11 7 25 65 -41.0999985 146.100006 1871 16.2999992 18.8999996 0.625 sediments, sandstone 315 66 10.5 18 25 65 -41 145.5 1872 18.2000008 19.6000004 0.895833333 extrusives, sediments 298 58.7999992 2.4000001 0 35 65 -27 141.5 1972 3.79999995 3.79999995 0.486486486 sediments, weathered
D
// Written in the D programming language. /++ $(P The $(D std.uni) module provides an implementation of fundamental Unicode algorithms and data structures. This doesn't include UTF encoding and decoding primitives, see $(XREF _utf, decode) and $(XREF _utf, encode) in std.utf for this functionality. ) $(P All primitives listed operate on Unicode characters and sets of characters. For functions which operate on ASCII characters and ignore Unicode $(CHARACTERS), see $(LINK2 std_ascii.html, std.ascii). For definitions of Unicode $(CHARACTER), $(CODEPOINT) and other terms used throughout this module see the $(S_LINK Terminology, terminology) section below. ) $(P The focus of this module is the core needs of developing Unicode-aware applications. To that effect it provides the following optimized primitives: ) $(UL $(LI Character classification by category and common properties: $(LREF isAlpha), $(LREF isWhite) and others. ) $(LI Case-insensitive string comparison ($(LREF sicmp), $(LREF icmp)). ) $(LI Converting text to any of the four normalization forms via $(LREF normalize). ) $(LI Decoding ($(LREF decodeGrapheme)) and iteration ($(LREF byGrapheme), $(LREF graphemeStride)) by user-perceived characters, that is by $(LREF Grapheme) clusters. ) $(LI Decomposing and composing of individual character(s) according to canonical or compatibility rules, see $(LREF compose) and $(LREF decompose), including the specific version for Hangul syllables $(LREF composeJamo) and $(LREF decomposeHangul). ) ) $(P It's recognized that an application may need further enhancements and extensions, such as less commonly known algorithms, or tailoring existing ones for region specific needs. To help users with building any extra functionality beyond the core primitives, the module provides: ) $(UL $(LI $(LREF CodepointSet), a type for easy manipulation of sets of characters. Besides the typical set algebra it provides an unusual feature: a D source code generator for detection of $(CODEPOINTS) in this set. This is a boon for meta-programming parser frameworks, and is used internally to power classification in small sets like $(LREF isWhite). ) $(LI A way to construct optimal packed multi-stage tables also known as a special case of $(LUCKY Trie). The functions $(LREF codepointTrie), $(LREF codepointSetTrie) construct custom tries that map dchar to value. The end result is a fast and predictable $(BIGOH 1) lookup that powers functions like $(LREF isAlpha) and $(LREF combiningClass), but for user-defined data sets. ) $(LI A useful technique for Unicode-aware parsers that perform character classification of encoded $(CODEPOINTS) is to avoid unnecassary decoding at all costs. $(LREF utfMatcher) provides an improvement over the usual workflow of decode-classify-process, combining the decoding and classification steps. By extracting necessary bits directly from encoded $(S_LINK Code unit, code units) matchers achieve significant performance improvements. See $(LREF MatcherConcept) for the common interface of UTF matchers. ) $(LI Generally useful building blocks for customized normalization: $(LREF combiningClass) for querying combining class and $(LREF allowedIn) for testing the Quick_Check property of a given normalization form. ) $(LI Access to a large selection of commonly used sets of $(CODEPOINTS). $(S_LINK Unicode properties, Supported sets) include Script, Block and General Category. The exact contents of a set can be observed in the CLDR utility, on the $(WEB www.unicode.org/cldr/utility/properties.jsp, property index) page of the Unicode website. See $(LREF unicode) for easy and (optionally) compile-time checked set queries. ) ) $(SECTION Synopsis) --- import std.uni; void main() { // initialize code point sets using script/block or property name // now 'set' contains code points from both scripts. auto set = unicode("Cyrillic") | unicode("Armenian"); // same thing but simpler and checked at compile-time auto ascii = unicode.ASCII; auto currency = unicode.Currency_Symbol; // easy set ops auto a = set & ascii; assert(a.empty); // as it has no intersection with ascii a = set | ascii; auto b = currency - a; // subtract all ASCII, Cyrillic and Armenian // some properties of code point sets assert(b.length > 45); // 46 items in Unicode 6.1, even more in 6.2 // testing presence of a code point in a set // is just fine, it is O(logN) assert(!b['$']); assert(!b['\u058F']); // Armenian dram sign assert(b['¥']); // building fast lookup tables, these guarantee O(1) complexity // 1-level Trie lookup table essentially a huge bit-set ~262Kb auto oneTrie = toTrie!1(b); // 2-level far more compact but typically slightly slower auto twoTrie = toTrie!2(b); // 3-level even smaller, and a bit slower yet auto threeTrie = toTrie!3(b); assert(oneTrie['£']); assert(twoTrie['£']); assert(threeTrie['£']); // build the trie with the most sensible trie level // and bind it as a functor auto cyrillicOrArmenian = toDelegate(set); auto balance = find!(cyrillicOrArmenian)("Hello ընկեր!"); assert(balance == "ընկեր!"); // compatible with bool delegate(dchar) bool delegate(dchar) bindIt = cyrillicOrArmenian; // Normalization string s = "Plain ascii (and not only), is always normalized!"; assert(s is normalize(s));// is the same string string nonS = "A\u0308ffin"; // A ligature auto nS = normalize(nonS); // to NFC, the W3C endorsed standard assert(nS == "Äffin"); assert(nS != nonS); string composed = "Äffin"; assert(normalize!NFD(composed) == "A\u0308ffin"); // to NFKD, compatibility decomposition useful for fuzzy matching/searching assert(normalize!NFKD("2¹⁰") == "210"); } --- $(SECTION Terminology) $(P The following is a list of important Unicode notions and definitions. Any conventions used specifically in this module alone are marked as such. The descriptions are based on the formal definition as found in $(WEB www.unicode.org/versions/Unicode6.2.0/ch03.pdf, chapter three of The Unicode Standard Core Specification.) ) $(P $(DEF Abstract character) A unit of information used for the organization, control, or representation of textual data. Note that: $(UL $(LI When representing data, the nature of that data is generally symbolic as opposed to some other kind of data (for example, visual).) $(LI An abstract character has no concrete form and should not be confused with a $(S_LINK Glyph, glyph).) $(LI An abstract character does not necessarily correspond to what a user thinks of as a “character” and should not be confused with a $(LREF Grapheme).) $(LI The abstract characters encoded (see Encoded character) are known as Unicode abstract characters.) $(LI Abstract characters not directly encoded by the Unicode Standard can often be represented by the use of combining character sequences.) ) ) $(P $(DEF Canonical decomposition) The decomposition of a character or character sequence that results from recursively applying the canonical mappings found in the Unicode Character Database and these described in Conjoining Jamo Behavior (section 12 of $(WEB www.unicode.org/uni2book/ch03.pdf, Unicode Conformance)). ) $(P $(DEF Canonical composition) The precise definition of the Canonical composition is the algorithm as specified in $(WEB www.unicode.org/uni2book/ch03.pdf, Unicode Conformance) section 11. Informally it's the process that does the reverse of the canonical decomposition with the addition of certain rules that e.g. prevent legacy characters from appearing in the composed result. ) $(P $(DEF Canonical equivalent) Two character sequences are said to be canonical equivalents if their full canonical decompositions are identical. ) $(P $(DEF Character) Typically differs by context. For the purpose of this documentation the term $(I character) implies $(I encoded character), that is, a code point having an assigned abstract character (a symbolic meaning). ) $(P $(DEF Code point) Any value in the Unicode codespace; that is, the range of integers from 0 to 10FFFF (hex). Not all code points are assigned to encoded characters. ) $(P $(DEF Code unit) The minimal bit combination that can represent a unit of encoded text for processing or interchange. Depending on the encoding this could be: 8-bit code units in the UTF-8 ($(D char)), 16-bit code units in the UTF-16 ($(D wchar)), and 32-bit code units in the UTF-32 ($(D dchar)). $(I Note that in UTF-32, a code unit is a code point and is represented by the D $(D dchar) type.) ) $(P $(DEF Combining character) A character with the General Category of Combining Mark(M). $(UL $(LI All characters with non-zero canonical combining class are combining characters, but the reverse is not the case: there are combining characters with a zero combining class. ) $(LI These characters are not normally used in isolation unless they are being described. They include such characters as accents, diacritics, Hebrew points, Arabic vowel signs, and Indic matras. ) ) ) $(P $(DEF Combining class) A numerical value used by the Unicode Canonical Ordering Algorithm to determine which sequences of combining marks are to be considered canonically equivalent and which are not. ) $(P $(DEF Compatibility decomposition) The decomposition of a character or character sequence that results from recursively applying both the compatibility mappings and the canonical mappings found in the Unicode Character Database, and those described in Conjoining Jamo Behavior no characters can be further decomposed. ) $(P $(DEF Compatibility equivalent) Two character sequences are said to be compatibility equivalents if their full compatibility decompositions are identical. ) $(P $(DEF Encoded character) An association (or mapping) between an abstract character and a code point. ) $(P $(DEF Glyph) The actual, concrete image of a glyph representation having been rasterized or otherwise imaged onto some display surface. ) $(P $(DEF Grapheme base) A character with the property Grapheme_Base, or any standard Korean syllable block. ) $(P $(DEF Grapheme cluster) Defined as the text between grapheme boundaries as specified by Unicode Standard Annex #29, $(WEB www.unicode.org/reports/tr29/, Unicode text segmentation). Important general properties of a grapheme: $(UL $(LI The grapheme cluster represents a horizontally segmentable unit of text, consisting of some grapheme base (which may consist of a Korean syllable) together with any number of nonspacing marks applied to it. ) $(LI A grapheme cluster typically starts with a grapheme base and then extends across any subsequent sequence of nonspacing marks. A grapheme cluster is most directly relevant to text rendering and processes such as cursor placement and text selection in editing, but may also be relevant to comparison and searching. ) $(LI For many processes, a grapheme cluster behaves as if it was a single character with the same properties as its grapheme base. Effectively, nonspacing marks apply $(I graphically) to the base, but do not change its properties. ) ) $(P This module defines a number of primitives that work with graphemes: $(LREF Grapheme), $(LREF decodeGrapheme) and $(LREF graphemeStride). All of them are using $(I extended grapheme) boundaries as defined in the aforementioned standard annex. ) ) $(P $(DEF Nonspacing mark) A combining character with the General Category of Nonspacing Mark (Mn) or Enclosing Mark (Me). ) $(P $(DEF Spacing mark) A combining character that is not a nonspacing mark.) $(SECTION Normalization) $(P The concepts of $(S_LINK Canonical equivalent, canonical equivalent) or $(S_LINK Compatibility equivalent, compatibility equivalent) characters in the Unicode Standard make it necessary to have a full, formal definition of equivalence for Unicode strings. String equivalence is determined by a process called normalization, whereby strings are converted into forms which are compared directly for identity. This is the primary goal of the normalization process, see the function $(LREF normalize) to convert into any of the four defined forms. ) $(P A very important attribute of the Unicode Normalization Forms is that they must remain stable between versions of the Unicode Standard. A Unicode string normalized to a particular Unicode Normalization Form in one version of the standard is guaranteed to remain in that Normalization Form for implementations of future versions of the standard. ) $(P The Unicode Standard specifies four normalization forms. Informally, two of these forms are defined by maximal decomposition of equivalent sequences, and two of these forms are defined by maximal $(I composition) of equivalent sequences. $(UL $(LI Normalization Form D (NFD): The $(S_LINK Canonical decomposition, canonical decomposition) of a character sequence.) $(LI Normalization Form KD (NFKD): The $(S_LINK Compatibility decomposition, compatibility decomposition) of a character sequence.) $(LI Normalization Form C (NFC): The canonical composition of the $(S_LINK Canonical decomposition, canonical decomposition) of a coded character sequence.) $(LI Normalization Form KC (NFKC): The canonical composition of the $(S_LINK Compatibility decomposition, compatibility decomposition) of a character sequence) ) ) $(P The choice of the normalization form depends on the particular use case. NFC is the best form for general text, since it's more compatible with strings converted from legacy encodings. NFKC is the preferred form for identifiers, especially where there are security concerns. NFD and NFKD are the most useful for internal processing. ) $(SECTION Construction of lookup tables) $(P The Unicode standard describes a set of algorithms that depend on having the ability to quickly look up various properties of a code point. Given the the codespace of about 1 million $(CODEPOINTS), it is not a trivial task to provide a space-efficient solution for the multitude of properties.) $(P Common approaches such as hash-tables or binary search over sorted code point intervals (as in $(LREF InversionList)) are insufficient. Hash-tables have enormous memory footprint and binary search over intervals is not fast enough for some heavy-duty algorithms. ) $(P The recommended solution (see Unicode Implementation Guidelines) is using multi-stage tables that are an implementation of the $(WEB en.wikipedia.org/wiki/Trie, Trie) data structure with integer keys and a fixed number of stages. For the remainder of the section this will be called a fixed trie. The following describes a particular implementation that is aimed for the speed of access at the expense of ideal size savings. ) $(P Taking a 2-level Trie as an example the principle of operation is as follows. Split the number of bits in a key (code point, 21 bits) into 2 components (e.g. 15 and 8). The first is the number of bits in the index of the trie and the other is number of bits in each page of the trie. The layout of the trie is then an array of size 2^^bits-of-index followed an array of memory chunks of size 2^^bits-of-page/bits-per-element. ) $(P The number of pages is variable (but not less then 1) unlike the number of entries in the index. The slots of the index all have to contain a number of a page that is present. The lookup is then just a couple of operations - slice the upper bits, lookup an index for these, take a page at this index and use the lower bits as an offset within this page. Assuming that pages are laid out consequently in one array at $(D pages), the pseudo-code is: ) --- auto elemsPerPage = (2 ^^ bits_per_page) / Value.sizeOfInBits; pages[index[n >> bits_per_page]][n & (elemsPerPage - 1)]; --- $(P Where if $(D elemsPerPage) is a power of 2 the whole process is a handful of simple instructions and 2 array reads. Subsequent levels of the trie are introduced by recursing on this notion - the index array is treated as values. The number of bits in index is then again split into 2 parts, with pages over 'current-index' and the new 'upper-index'. ) $(P For completeness a level 1 trie is simply an array. The current implementation takes advantage of bit-packing values when the range is known to be limited in advance (such as $(D bool)). See also $(LREF BitPacked) for enforcing it manually. The major size advantage however comes from the fact that multiple $(B identical pages on every level are merged) by construction. ) $(P The process of constructing a trie is more involved and is hidden from the user in a form of the convenience functions $(LREF codepointTrie), $(LREF codepointSetTrie) and the even more convenient $(LREF toTrie). In general a set or built-in AA with $(D dchar) type can be turned into a trie. The trie object in this module is read-only (immutable); it's effectively frozen after construction. ) $(SECTION Unicode properties) $(P This is a full list of Unicode properties accessible through $(LREF unicode) with specific helpers per category nested within. Consult the $(WEB www.unicode.org/cldr/utility/properties.jsp, CLDR utility) when in doubt about the contents of a particular set.) $(P General category sets listed below are only accessible with the $(LREF unicode) shorthand accessor.) $(BOOKTABLE $(B General category ), $(TR $(TH Abb.) $(TH Long form) $(TH Abb.) $(TH Long form)$(TH Abb.) $(TH Long form)) $(TR $(TD L) $(TD Letter) $(TD Cn) $(TD Unassigned) $(TD Po) $(TD Other_Punctuation)) $(TR $(TD Ll) $(TD Lowercase_Letter) $(TD Co) $(TD Private_Use) $(TD Ps) $(TD Open_Punctuation)) $(TR $(TD Lm) $(TD Modifier_Letter) $(TD Cs) $(TD Surrogate) $(TD S) $(TD Symbol)) $(TR $(TD Lo) $(TD Other_Letter) $(TD N) $(TD Number) $(TD Sc) $(TD Currency_Symbol)) $(TR $(TD Lt) $(TD Titlecase_Letter) $(TD Nd) $(TD Decimal_Number) $(TD Sk) $(TD Modifier_Symbol)) $(TR $(TD Lu) $(TD Uppercase_Letter) $(TD Nl) $(TD Letter_Number) $(TD Sm) $(TD Math_Symbol)) $(TR $(TD M) $(TD Mark) $(TD No) $(TD Other_Number) $(TD So) $(TD Other_Symbol)) $(TR $(TD Mc) $(TD Spacing_Mark) $(TD P) $(TD Punctuation) $(TD Z) $(TD Separator)) $(TR $(TD Me) $(TD Enclosing_Mark) $(TD Pc) $(TD Connector_Punctuation) $(TD Zl) $(TD Line_Separator)) $(TR $(TD Mn) $(TD Nonspacing_Mark) $(TD Pd) $(TD Dash_Punctuation) $(TD Zp) $(TD Paragraph_Separator)) $(TR $(TD C) $(TD Other) $(TD Pe) $(TD Close_Punctuation) $(TD Zs) $(TD Space_Separator)) $(TR $(TD Cc) $(TD Control) $(TD Pf) $(TD Final_Punctuation) $(TD -) $(TD Any)) $(TR $(TD Cf) $(TD Format) $(TD Pi) $(TD Initial_Punctuation) $(TD -) $(TD ASCII)) ) $(P Sets for other commonly useful properties that are accessible with $(LREF unicode):) $(BOOKTABLE $(B Common binary properties), $(TR $(TH Name) $(TH Name) $(TH Name)) $(TR $(TD Alphabetic) $(TD Ideographic) $(TD Other_Uppercase)) $(TR $(TD ASCII_Hex_Digit) $(TD IDS_Binary_Operator) $(TD Pattern_Syntax)) $(TR $(TD Bidi_Control) $(TD ID_Start) $(TD Pattern_White_Space)) $(TR $(TD Cased) $(TD IDS_Trinary_Operator) $(TD Quotation_Mark)) $(TR $(TD Case_Ignorable) $(TD Join_Control) $(TD Radical)) $(TR $(TD Dash) $(TD Logical_Order_Exception) $(TD Soft_Dotted)) $(TR $(TD Default_Ignorable_Code_Point) $(TD Lowercase) $(TD STerm)) $(TR $(TD Deprecated) $(TD Math) $(TD Terminal_Punctuation)) $(TR $(TD Diacritic) $(TD Noncharacter_Code_Point) $(TD Unified_Ideograph)) $(TR $(TD Extender) $(TD Other_Alphabetic) $(TD Uppercase)) $(TR $(TD Grapheme_Base) $(TD Other_Default_Ignorable_Code_Point) $(TD Variation_Selector)) $(TR $(TD Grapheme_Extend) $(TD Other_Grapheme_Extend) $(TD White_Space)) $(TR $(TD Grapheme_Link) $(TD Other_ID_Continue) $(TD XID_Continue)) $(TR $(TD Hex_Digit) $(TD Other_ID_Start) $(TD XID_Start)) $(TR $(TD Hyphen) $(TD Other_Lowercase) ) $(TR $(TD ID_Continue) $(TD Other_Math) ) ) $(P Bellow is the table with block names accepted by $(LREF unicode.block). Note that the shorthand version $(LREF unicode) requires "In" to be prepended to the names of blocks so as to disambiguate scripts and blocks.) $(BOOKTABLE $(B Blocks), $(TR $(TD Aegean Numbers) $(TD Ethiopic Extended) $(TD Mongolian)) $(TR $(TD Alchemical Symbols) $(TD Ethiopic Extended-A) $(TD Musical Symbols)) $(TR $(TD Alphabetic Presentation Forms) $(TD Ethiopic Supplement) $(TD Myanmar)) $(TR $(TD Ancient Greek Musical Notation) $(TD General Punctuation) $(TD Myanmar Extended-A)) $(TR $(TD Ancient Greek Numbers) $(TD Geometric Shapes) $(TD New Tai Lue)) $(TR $(TD Ancient Symbols) $(TD Georgian) $(TD NKo)) $(TR $(TD Arabic) $(TD Georgian Supplement) $(TD Number Forms)) $(TR $(TD Arabic Extended-A) $(TD Glagolitic) $(TD Ogham)) $(TR $(TD Arabic Mathematical Alphabetic Symbols) $(TD Gothic) $(TD Ol Chiki)) $(TR $(TD Arabic Presentation Forms-A) $(TD Greek and Coptic) $(TD Old Italic)) $(TR $(TD Arabic Presentation Forms-B) $(TD Greek Extended) $(TD Old Persian)) $(TR $(TD Arabic Supplement) $(TD Gujarati) $(TD Old South Arabian)) $(TR $(TD Armenian) $(TD Gurmukhi) $(TD Old Turkic)) $(TR $(TD Arrows) $(TD Halfwidth and Fullwidth Forms) $(TD Optical Character Recognition)) $(TR $(TD Avestan) $(TD Hangul Compatibility Jamo) $(TD Oriya)) $(TR $(TD Balinese) $(TD Hangul Jamo) $(TD Osmanya)) $(TR $(TD Bamum) $(TD Hangul Jamo Extended-A) $(TD Phags-pa)) $(TR $(TD Bamum Supplement) $(TD Hangul Jamo Extended-B) $(TD Phaistos Disc)) $(TR $(TD Basic Latin) $(TD Hangul Syllables) $(TD Phoenician)) $(TR $(TD Batak) $(TD Hanunoo) $(TD Phonetic Extensions)) $(TR $(TD Bengali) $(TD Hebrew) $(TD Phonetic Extensions Supplement)) $(TR $(TD Block Elements) $(TD High Private Use Surrogates) $(TD Playing Cards)) $(TR $(TD Bopomofo) $(TD High Surrogates) $(TD Private Use Area)) $(TR $(TD Bopomofo Extended) $(TD Hiragana) $(TD Rejang)) $(TR $(TD Box Drawing) $(TD Ideographic Description Characters) $(TD Rumi Numeral Symbols)) $(TR $(TD Brahmi) $(TD Imperial Aramaic) $(TD Runic)) $(TR $(TD Braille Patterns) $(TD Inscriptional Pahlavi) $(TD Samaritan)) $(TR $(TD Buginese) $(TD Inscriptional Parthian) $(TD Saurashtra)) $(TR $(TD Buhid) $(TD IPA Extensions) $(TD Sharada)) $(TR $(TD Byzantine Musical Symbols) $(TD Javanese) $(TD Shavian)) $(TR $(TD Carian) $(TD Kaithi) $(TD Sinhala)) $(TR $(TD Chakma) $(TD Kana Supplement) $(TD Small Form Variants)) $(TR $(TD Cham) $(TD Kanbun) $(TD Sora Sompeng)) $(TR $(TD Cherokee) $(TD Kangxi Radicals) $(TD Spacing Modifier Letters)) $(TR $(TD CJK Compatibility) $(TD Kannada) $(TD Specials)) $(TR $(TD CJK Compatibility Forms) $(TD Katakana) $(TD Sundanese)) $(TR $(TD CJK Compatibility Ideographs) $(TD Katakana Phonetic Extensions) $(TD Sundanese Supplement)) $(TR $(TD CJK Compatibility Ideographs Supplement) $(TD Kayah Li) $(TD Superscripts and Subscripts)) $(TR $(TD CJK Radicals Supplement) $(TD Kharoshthi) $(TD Supplemental Arrows-A)) $(TR $(TD CJK Strokes) $(TD Khmer) $(TD Supplemental Arrows-B)) $(TR $(TD CJK Symbols and Punctuation) $(TD Khmer Symbols) $(TD Supplemental Mathematical Operators)) $(TR $(TD CJK Unified Ideographs) $(TD Lao) $(TD Supplemental Punctuation)) $(TR $(TD CJK Unified Ideographs Extension A) $(TD Latin-1 Supplement) $(TD Supplementary Private Use Area-A)) $(TR $(TD CJK Unified Ideographs Extension B) $(TD Latin Extended-A) $(TD Supplementary Private Use Area-B)) $(TR $(TD CJK Unified Ideographs Extension C) $(TD Latin Extended Additional) $(TD Syloti Nagri)) $(TR $(TD CJK Unified Ideographs Extension D) $(TD Latin Extended-B) $(TD Syriac)) $(TR $(TD Combining Diacritical Marks) $(TD Latin Extended-C) $(TD Tagalog)) $(TR $(TD Combining Diacritical Marks for Symbols) $(TD Latin Extended-D) $(TD Tagbanwa)) $(TR $(TD Combining Diacritical Marks Supplement) $(TD Lepcha) $(TD Tags)) $(TR $(TD Combining Half Marks) $(TD Letterlike Symbols) $(TD Tai Le)) $(TR $(TD Common Indic Number Forms) $(TD Limbu) $(TD Tai Tham)) $(TR $(TD Control Pictures) $(TD Linear B Ideograms) $(TD Tai Viet)) $(TR $(TD Coptic) $(TD Linear B Syllabary) $(TD Tai Xuan Jing Symbols)) $(TR $(TD Counting Rod Numerals) $(TD Lisu) $(TD Takri)) $(TR $(TD Cuneiform) $(TD Low Surrogates) $(TD Tamil)) $(TR $(TD Cuneiform Numbers and Punctuation) $(TD Lycian) $(TD Telugu)) $(TR $(TD Currency Symbols) $(TD Lydian) $(TD Thaana)) $(TR $(TD Cypriot Syllabary) $(TD Mahjong Tiles) $(TD Thai)) $(TR $(TD Cyrillic) $(TD Malayalam) $(TD Tibetan)) $(TR $(TD Cyrillic Extended-A) $(TD Mandaic) $(TD Tifinagh)) $(TR $(TD Cyrillic Extended-B) $(TD Mathematical Alphanumeric Symbols) $(TD Transport And Map Symbols)) $(TR $(TD Cyrillic Supplement) $(TD Mathematical Operators) $(TD Ugaritic)) $(TR $(TD Deseret) $(TD Meetei Mayek) $(TD Unified Canadian Aboriginal Syllabics)) $(TR $(TD Devanagari) $(TD Meetei Mayek Extensions) $(TD Unified Canadian Aboriginal Syllabics Extended)) $(TR $(TD Devanagari Extended) $(TD Meroitic Cursive) $(TD Vai)) $(TR $(TD Dingbats) $(TD Meroitic Hieroglyphs) $(TD Variation Selectors)) $(TR $(TD Domino Tiles) $(TD Miao) $(TD Variation Selectors Supplement)) $(TR $(TD Egyptian Hieroglyphs) $(TD Miscellaneous Mathematical Symbols-A) $(TD Vedic Extensions)) $(TR $(TD Emoticons) $(TD Miscellaneous Mathematical Symbols-B) $(TD Vertical Forms)) $(TR $(TD Enclosed Alphanumerics) $(TD Miscellaneous Symbols) $(TD Yijing Hexagram Symbols)) $(TR $(TD Enclosed Alphanumeric Supplement) $(TD Miscellaneous Symbols and Arrows) $(TD Yi Radicals)) $(TR $(TD Enclosed CJK Letters and Months) $(TD Miscellaneous Symbols And Pictographs) $(TD Yi Syllables)) $(TR $(TD Enclosed Ideographic Supplement) $(TD Miscellaneous Technical) ) $(TR $(TD Ethiopic) $(TD Modifier Tone Letters) ) ) $(P Bellow is the table with script names accepted by $(LREF unicode.script) and by the shorthand version $(LREF unicode):) $(BOOKTABLE $(B Scripts), $(TR $(TD Arabic) $(TD Hanunoo) $(TD Old_Italic)) $(TR $(TD Armenian) $(TD Hebrew) $(TD Old_Persian)) $(TR $(TD Avestan) $(TD Hiragana) $(TD Old_South_Arabian)) $(TR $(TD Balinese) $(TD Imperial_Aramaic) $(TD Old_Turkic)) $(TR $(TD Bamum) $(TD Inherited) $(TD Oriya)) $(TR $(TD Batak) $(TD Inscriptional_Pahlavi) $(TD Osmanya)) $(TR $(TD Bengali) $(TD Inscriptional_Parthian) $(TD Phags_Pa)) $(TR $(TD Bopomofo) $(TD Javanese) $(TD Phoenician)) $(TR $(TD Brahmi) $(TD Kaithi) $(TD Rejang)) $(TR $(TD Braille) $(TD Kannada) $(TD Runic)) $(TR $(TD Buginese) $(TD Katakana) $(TD Samaritan)) $(TR $(TD Buhid) $(TD Kayah_Li) $(TD Saurashtra)) $(TR $(TD Canadian_Aboriginal) $(TD Kharoshthi) $(TD Sharada)) $(TR $(TD Carian) $(TD Khmer) $(TD Shavian)) $(TR $(TD Chakma) $(TD Lao) $(TD Sinhala)) $(TR $(TD Cham) $(TD Latin) $(TD Sora_Sompeng)) $(TR $(TD Cherokee) $(TD Lepcha) $(TD Sundanese)) $(TR $(TD Common) $(TD Limbu) $(TD Syloti_Nagri)) $(TR $(TD Coptic) $(TD Linear_B) $(TD Syriac)) $(TR $(TD Cuneiform) $(TD Lisu) $(TD Tagalog)) $(TR $(TD Cypriot) $(TD Lycian) $(TD Tagbanwa)) $(TR $(TD Cyrillic) $(TD Lydian) $(TD Tai_Le)) $(TR $(TD Deseret) $(TD Malayalam) $(TD Tai_Tham)) $(TR $(TD Devanagari) $(TD Mandaic) $(TD Tai_Viet)) $(TR $(TD Egyptian_Hieroglyphs) $(TD Meetei_Mayek) $(TD Takri)) $(TR $(TD Ethiopic) $(TD Meroitic_Cursive) $(TD Tamil)) $(TR $(TD Georgian) $(TD Meroitic_Hieroglyphs) $(TD Telugu)) $(TR $(TD Glagolitic) $(TD Miao) $(TD Thaana)) $(TR $(TD Gothic) $(TD Mongolian) $(TD Thai)) $(TR $(TD Greek) $(TD Myanmar) $(TD Tibetan)) $(TR $(TD Gujarati) $(TD New_Tai_Lue) $(TD Tifinagh)) $(TR $(TD Gurmukhi) $(TD Nko) $(TD Ugaritic)) $(TR $(TD Han) $(TD Ogham) $(TD Vai)) $(TR $(TD Hangul) $(TD Ol_Chiki) $(TD Yi)) ) $(P Bellow is the table of names accepted by $(LREF unicode.hangulSyllableType).) $(BOOKTABLE $(B Hangul syllable type), $(TR $(TH Abb.) $(TH Long form)) $(TR $(TD L) $(TD Leading_Jamo)) $(TR $(TD LV) $(TD LV_Syllable)) $(TR $(TD LVT) $(TD LVT_Syllable) ) $(TR $(TD T) $(TD Trailing_Jamo)) $(TR $(TD V) $(TD Vowel_Jamo)) ) References: $(WEB www.digitalmars.com/d/ascii-table.html, ASCII Table), $(WEB en.wikipedia.org/wiki/Unicode, Wikipedia), $(WEB www.unicode.org, The Unicode Consortium), $(WEB www.unicode.org/reports/tr15/, Unicode normalization forms), $(WEB www.unicode.org/reports/tr29/, Unicode text segmentation) $(WEB www.unicode.org/uni2book/ch05.pdf, Unicode Implementation Guidelines) $(WEB www.unicode.org/uni2book/ch03.pdf, Unicode Conformance) Trademarks: Unicode(tm) is a trademark of Unicode, Inc. Macros: WIKI=Phobos/StdUni Copyright: Copyright 2013 - License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: Dmitry Olshansky Source: $(PHOBOSSRC std/_uni.d) Standards: $(WEB www.unicode.org/versions/Unicode6.2.0/, Unicode v6.2) Macros: SECTION = <h3><a id="$1">$0</a></h3> DEF = <div><a id="$1"><i>$0</i></a></div> S_LINK = <a href="#$1">$+</a> CODEPOINT = $(S_LINK Code point, code point) CODEPOINTS = $(S_LINK Code point, code points) CHARACTER = $(S_LINK Character, character) CHARACTERS = $(S_LINK Character, characters) CLUSTER = $(S_LINK Grapheme cluster, grapheme cluster) +/ module std.uni; import core.stdc.stdlib; import std.meta, std.traits; import std.range.primitives; // debug = std_uni; debug(std_uni) import std.stdio; private: version (unittest) { private: struct TestAliasedString { string get() @safe @nogc pure nothrow { return _s; } alias get this; @disable this(this); string _s; } bool testAliasedString(alias func, Args...)(string s, Args args) { import std.algorithm.comparison : equal; auto a = func(TestAliasedString(s), args); auto b = func(s, args); static if (is(typeof(equal(a, b)))) { // For ranges, compare contents instead of object identity. return equal(a, b); } else { return a == b; } } } version(std_uni_bootstrap){} else { import std.internal.unicode_tables; // generated file } void copyBackwards(T,U)(T[] src, U[] dest) { assert(src.length == dest.length); for(size_t i=src.length; i-- > 0; ) dest[i] = src[i]; } void copyForward(T,U)(T[] src, U[] dest) { assert(src.length == dest.length); for(size_t i=0; i<src.length; i++) dest[i] = src[i]; } // TODO: update to reflect all major CPUs supporting unaligned reads version(X86) enum hasUnalignedReads = true; else version(X86_64) enum hasUnalignedReads = true; else enum hasUnalignedReads = false; // better be safe then sorry public enum dchar lineSep = '\u2028'; /// Constant $(CODEPOINT) (0x2028) - line separator. public enum dchar paraSep = '\u2029'; /// Constant $(CODEPOINT) (0x2029) - paragraph separator. public enum dchar nelSep = '\u0085'; /// Constant $(CODEPOINT) (0x0085) - next line. // test the intro example @safe unittest { import std.algorithm : find; // initialize code point sets using script/block or property name // set contains code points from both scripts. auto set = unicode("Cyrillic") | unicode("Armenian"); // or simpler and statically-checked look auto ascii = unicode.ASCII; auto currency = unicode.Currency_Symbol; // easy set ops auto a = set & ascii; assert(a.empty); // as it has no intersection with ascii a = set | ascii; auto b = currency - a; // subtract all ASCII, Cyrillic and Armenian // some properties of code point sets assert(b.length > 45); // 46 items in Unicode 6.1, even more in 6.2 // testing presence of a code point in a set // is just fine, it is O(logN) assert(!b['$']); assert(!b['\u058F']); // Armenian dram sign assert(b['¥']); // building fast lookup tables, these guarantee O(1) complexity // 1-level Trie lookup table essentially a huge bit-set ~262Kb auto oneTrie = toTrie!1(b); // 2-level far more compact but typically slightly slower auto twoTrie = toTrie!2(b); // 3-level even smaller, and a bit slower yet auto threeTrie = toTrie!3(b); assert(oneTrie['£']); assert(twoTrie['£']); assert(threeTrie['£']); // build the trie with the most sensible trie level // and bind it as a functor auto cyrillicOrArmenian = toDelegate(set); auto balance = find!(cyrillicOrArmenian)("Hello ընկեր!"); assert(balance == "ընկեր!"); // compatible with bool delegate(dchar) bool delegate(dchar) bindIt = cyrillicOrArmenian; // Normalization string s = "Plain ascii (and not only), is always normalized!"; assert(s is normalize(s));// is the same string string nonS = "A\u0308ffin"; // A ligature auto nS = normalize(nonS); // to NFC, the W3C endorsed standard assert(nS == "Äffin"); assert(nS != nonS); string composed = "Äffin"; assert(normalize!NFD(composed) == "A\u0308ffin"); // to NFKD, compatibility decomposition useful for fuzzy matching/searching assert(normalize!NFKD("2¹⁰") == "210"); } enum lastDchar = 0x10FFFF; auto force(T, F)(F from) if(isIntegral!T && !is(T == F)) { assert(from <= T.max && from >= T.min); return cast(T)from; } auto force(T, F)(F from) if(isBitPacked!T && !is(T == F)) { assert(from <= 2^^bitSizeOf!T-1); return T(cast(TypeOfBitPacked!T)from); } auto force(T, F)(F from) if(is(T == F)) { return from; } // repeat X times the bit-pattern in val assuming it's length is 'bits' size_t replicateBits(size_t times, size_t bits)(size_t val) @safe pure nothrow @nogc { static if(times == 1) return val; else static if(bits == 1) { static if(times == size_t.sizeof*8) return val ? size_t.max : 0; else return val ? (1<<times)-1 : 0; } else static if(times % 2) return (replicateBits!(times-1, bits)(val)<<bits) | val; else return replicateBits!(times/2, bits*2)((val<<bits) | val); } @safe pure nothrow @nogc unittest // for replicate { import std.algorithm : sum, map; import std.range : iota; size_t m = 0b111; size_t m2 = 0b01; foreach(i; AliasSeq!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) { assert(replicateBits!(i, 3)(m)+1 == (1<<(3*i))); assert(replicateBits!(i, 2)(m2) == iota(0, i).map!"2^^(2*a)"().sum()); } } // multiple arrays squashed into one memory block struct MultiArray(Types...) { this(size_t[] sizes...) @safe pure nothrow { assert(dim == sizes.length); size_t full_size; foreach(i, v; Types) { full_size += spaceFor!(bitSizeOf!v)(sizes[i]); sz[i] = sizes[i]; static if(i >= 1) offsets[i] = offsets[i-1] + spaceFor!(bitSizeOf!(Types[i-1]))(sizes[i-1]); } storage = new size_t[full_size]; } this(const(size_t)[] raw_offsets, const(size_t)[] raw_sizes, const(size_t)[] data)const @safe pure nothrow @nogc { offsets[] = raw_offsets[]; sz[] = raw_sizes[]; storage = data; } @property auto slice(size_t n)()inout pure nothrow @nogc { auto ptr = raw_ptr!n; return packedArrayView!(Types[n])(ptr, sz[n]); } @property auto ptr(size_t n)()inout pure nothrow @nogc { auto ptr = raw_ptr!n; return inout(PackedPtr!(Types[n]))(ptr); } template length(size_t n) { @property size_t length()const @safe pure nothrow @nogc{ return sz[n]; } @property void length(size_t new_size) { if(new_size > sz[n]) {// extend size_t delta = (new_size - sz[n]); sz[n] += delta; delta = spaceFor!(bitSizeOf!(Types[n]))(delta); storage.length += delta;// extend space at end // raw_slice!x must follow resize as it could be moved! // next stmts move all data past this array, last-one-goes-first static if(n != dim-1) { auto start = raw_ptr!(n+1); // len includes delta size_t len = (storage.ptr+storage.length-start); copyBackwards(start[0..len-delta], start[delta..len]); start[0..delta] = 0; // offsets are used for raw_slice, ptr etc. foreach(i; n+1..dim) offsets[i] += delta; } } else if(new_size < sz[n]) {// shrink size_t delta = (sz[n] - new_size); sz[n] -= delta; delta = spaceFor!(bitSizeOf!(Types[n]))(delta); // move all data past this array, forward direction static if(n != dim-1) { auto start = raw_ptr!(n+1); size_t len = (storage.ptr+storage.length-start); copyForward(start[0..len-delta], start[delta..len]); // adjust offsets last, they affect raw_slice foreach(i; n+1..dim) offsets[i] -= delta; } storage.length -= delta; } // else - NOP } } @property size_t bytes(size_t n=size_t.max)() const { static if(n == size_t.max) return storage.length*size_t.sizeof; else static if(n != Types.length-1) return (raw_ptr!(n+1)-raw_ptr!n)*size_t.sizeof; else return (storage.ptr+storage.length - raw_ptr!n)*size_t.sizeof; } void store(OutRange)(scope OutRange sink) const if(isOutputRange!(OutRange, char)) { import std.format; formattedWrite(sink, "[%( 0x%x, %)]", offsets[]); formattedWrite(sink, ", [%( 0x%x, %)]", sz[]); formattedWrite(sink, ", [%( 0x%x, %)]", storage); } private: @property auto raw_ptr(size_t n)()inout pure nothrow @nogc { static if(n == 0) return storage.ptr; else { return storage.ptr+offsets[n]; } } enum dim = Types.length; size_t[dim] offsets;// offset for level x size_t[dim] sz;// size of level x alias bitWidth = staticMap!(bitSizeOf, Types); size_t[] storage; } unittest { import std.conv; enum dg = (){ // sizes are: // lvl0: 3, lvl1 : 2, lvl2: 1 auto m = MultiArray!(int, ubyte, int)(3,2,1); static void check(size_t k, T)(ref T m, int n) { foreach(i; 0..n) assert(m.slice!(k)[i] == i+1, text("level:",i," : ",m.slice!(k)[0..n])); } static void checkB(size_t k, T)(ref T m, int n) { foreach(i; 0..n) assert(m.slice!(k)[i] == n-i, text("level:",i," : ",m.slice!(k)[0..n])); } static void fill(size_t k, T)(ref T m, int n) { foreach(i; 0..n) m.slice!(k)[i] = force!ubyte(i+1); } static void fillB(size_t k, T)(ref T m, int n) { foreach(i; 0..n) m.slice!(k)[i] = force!ubyte(n-i); } m.length!1 = 100; fill!1(m, 100); check!1(m, 100); m.length!0 = 220; fill!0(m, 220); check!1(m, 100); check!0(m, 220); m.length!2 = 17; fillB!2(m, 17); checkB!2(m, 17); check!0(m, 220); check!1(m, 100); m.length!2 = 33; checkB!2(m, 17); fillB!2(m, 33); checkB!2(m, 33); check!0(m, 220); check!1(m, 100); m.length!1 = 195; fillB!1(m, 195); checkB!1(m, 195); checkB!2(m, 33); check!0(m, 220); auto marr = MultiArray!(BitPacked!(uint, 4), BitPacked!(uint, 6))(20, 10); marr.length!0 = 15; marr.length!1 = 30; fill!1(marr, 30); fill!0(marr, 15); check!1(marr, 30); check!0(marr, 15); return 0; }; enum ct = dg(); auto rt = dg(); } unittest {// more bitpacking tests import std.conv; alias Bitty = MultiArray!(BitPacked!(size_t, 3) , BitPacked!(size_t, 4) , BitPacked!(size_t, 3) , BitPacked!(size_t, 6) , bool); alias fn1 = sliceBits!(13, 16); alias fn2 = sliceBits!( 9, 13); alias fn3 = sliceBits!( 6, 9); alias fn4 = sliceBits!( 0, 6); static void check(size_t lvl, MA)(ref MA arr){ for(size_t i = 0; i< arr.length!lvl; i++) assert(arr.slice!(lvl)[i] == i, text("Mismatch on lvl ", lvl, " idx ", i, " value: ", arr.slice!(lvl)[i])); } static void fillIdx(size_t lvl, MA)(ref MA arr){ for(size_t i = 0; i< arr.length!lvl; i++) arr.slice!(lvl)[i] = i; } Bitty m1; m1.length!4 = 10; m1.length!3 = 2^^6; m1.length!2 = 2^^3; m1.length!1 = 2^^4; m1.length!0 = 2^^3; m1.length!4 = 2^^16; for(size_t i = 0; i< m1.length!4; i++) m1.slice!(4)[i] = i % 2; fillIdx!1(m1); check!1(m1); fillIdx!2(m1); check!2(m1); fillIdx!3(m1); check!3(m1); fillIdx!0(m1); check!0(m1); check!3(m1); check!2(m1); check!1(m1); for(size_t i=0; i < 2^^16; i++) { m1.slice!(4)[i] = i % 2; m1.slice!(0)[fn1(i)] = fn1(i); m1.slice!(1)[fn2(i)] = fn2(i); m1.slice!(2)[fn3(i)] = fn3(i); m1.slice!(3)[fn4(i)] = fn4(i); } for(size_t i=0; i < 2^^16; i++) { assert(m1.slice!(4)[i] == i % 2); assert(m1.slice!(0)[fn1(i)] == fn1(i)); assert(m1.slice!(1)[fn2(i)] == fn2(i)); assert(m1.slice!(2)[fn3(i)] == fn3(i)); assert(m1.slice!(3)[fn4(i)] == fn4(i)); } } size_t spaceFor(size_t _bits)(size_t new_len) @safe pure nothrow @nogc { enum bits = _bits == 1 ? 1 : ceilPowerOf2(_bits);// see PackedArrayView static if(bits > 8*size_t.sizeof) { static assert(bits % (size_t.sizeof*8) == 0); return new_len * bits/(8*size_t.sizeof); } else { enum factor = size_t.sizeof*8/bits; return (new_len+factor-1)/factor; // rounded up } } template isBitPackableType(T) { enum isBitPackableType = isBitPacked!T || isIntegral!T || is(T == bool) || isSomeChar!T; } //============================================================================ template PackedArrayView(T) if((is(T dummy == BitPacked!(U, sz), U, size_t sz) && isBitPackableType!U) || isBitPackableType!T) { private enum bits = bitSizeOf!T; alias PackedArrayView = PackedArrayViewImpl!(T, bits > 1 ? ceilPowerOf2(bits) : 1); } //unsafe and fast access to a chunk of RAM as if it contains packed values template PackedPtr(T) if((is(T dummy == BitPacked!(U, sz), U, size_t sz) && isBitPackableType!U) || isBitPackableType!T) { private enum bits = bitSizeOf!T; alias PackedPtr = PackedPtrImpl!(T, bits > 1 ? ceilPowerOf2(bits) : 1); } @trusted struct PackedPtrImpl(T, size_t bits) { pure nothrow: static assert(isPowerOf2(bits)); this(inout(size_t)* ptr)inout @safe @nogc { origin = ptr; } private T simpleIndex(size_t n) inout { auto q = n / factor; auto r = n % factor; return cast(T)((origin[q] >> bits*r) & mask); } private void simpleWrite(TypeOfBitPacked!T val, size_t n) in { static if(isIntegral!T) assert(val <= mask); } body { auto q = n / factor; auto r = n % factor; size_t tgt_shift = bits*r; size_t word = origin[q]; origin[q] = (word & ~(mask<<tgt_shift)) | (cast(size_t)val << tgt_shift); } static if(factor == bytesPerWord// can safely pack by byte || factor == 1 // a whole word at a time || ((factor == bytesPerWord/2 || factor == bytesPerWord/4) && hasUnalignedReads)) // this needs unaligned reads { static if(factor == bytesPerWord) alias U = ubyte; else static if(factor == bytesPerWord/2) alias U = ushort; else static if(factor == bytesPerWord/4) alias U = uint; else static if(size_t.sizeof == 8 && factor == bytesPerWord/8) alias U = ulong; T opIndex(size_t idx) inout { return __ctfe ? simpleIndex(idx) : cast(inout(T))(cast(U*)origin)[idx]; } static if(isBitPacked!T) // lack of user-defined implicit conversion { void opIndexAssign(T val, size_t idx) { return opIndexAssign(cast(TypeOfBitPacked!T)val, idx); } } void opIndexAssign(TypeOfBitPacked!T val, size_t idx) { if(__ctfe) simpleWrite(val, idx); else (cast(U*)origin)[idx] = cast(U)val; } } else { T opIndex(size_t n) inout { return simpleIndex(n); } static if(isBitPacked!T) // lack of user-defined implicit conversion { void opIndexAssign(T val, size_t idx) { return opIndexAssign(cast(TypeOfBitPacked!T)val, idx); } } void opIndexAssign(TypeOfBitPacked!T val, size_t n) { return simpleWrite(val, n); } } private: // factor - number of elements in one machine word enum factor = size_t.sizeof*8/bits, mask = 2^^bits-1; enum bytesPerWord = size_t.sizeof; size_t* origin; } // data is packed only by power of two sized packs per word, // thus avoiding mul/div overhead at the cost of ultimate packing // this construct doesn't own memory, only provides access, see MultiArray for usage @trusted struct PackedArrayViewImpl(T, size_t bits) { pure nothrow: this(inout(size_t)* origin, size_t offset, size_t items) inout { ptr = inout(PackedPtr!(T))(origin); ofs = offset; limit = items; } bool zeros(size_t s, size_t e) in { assert(s <= e); } body { s += ofs; e += ofs; size_t pad_s = roundUp(s); if ( s >= e) { foreach (i; s..e) if(ptr[i]) return false; return true; } size_t pad_e = roundDown(e); size_t i; for(i=s; i<pad_s; i++) if(ptr[i]) return false; // all in between is x*factor elements for(size_t j=i/factor; i<pad_e; i+=factor, j++) if(ptr.origin[j]) return false; for(; i<e; i++) if(ptr[i]) return false; return true; } T opIndex(size_t idx) inout in { assert(idx < limit); } body { return ptr[ofs + idx]; } static if(isBitPacked!T) // lack of user-defined implicit conversion { void opIndexAssign(T val, size_t idx) { return opIndexAssign(cast(TypeOfBitPacked!T)val, idx); } } void opIndexAssign(TypeOfBitPacked!T val, size_t idx) in { assert(idx < limit); } body { ptr[ofs + idx] = val; } static if(isBitPacked!T) // lack of user-defined implicit conversions { void opSliceAssign(T val, size_t start, size_t end) { opSliceAssign(cast(TypeOfBitPacked!T)val, start, end); } } void opSliceAssign(TypeOfBitPacked!T val, size_t start, size_t end) in { assert(start <= end); assert(end <= limit); } body { // account for ofsetted view start += ofs; end += ofs; // rounded to factor granularity size_t pad_start = roundUp(start);// rounded up if(pad_start >= end) //rounded up >= then end of slice { //nothing to gain, use per element assignment foreach(i; start..end) ptr[i] = val; return; } size_t pad_end = roundDown(end); // rounded down size_t i; for(i=start; i<pad_start; i++) ptr[i] = val; // all in between is x*factor elements if(pad_start != pad_end) { size_t repval = replicateBits!(factor, bits)(val); for(size_t j=i/factor; i<pad_end; i+=factor, j++) ptr.origin[j] = repval;// so speed it up by factor } for(; i<end; i++) ptr[i] = val; } auto opSlice(size_t from, size_t to)inout in { assert(from <= to); assert(ofs + to <= limit); } body { return typeof(this)(ptr.origin, ofs + from, to - from); } auto opSlice(){ return opSlice(0, length); } bool opEquals(T)(auto ref T arr) const { if(limit != arr.limit) return false; size_t s1 = ofs, s2 = arr.ofs; size_t e1 = s1 + limit, e2 = s2 + limit; if(s1 % factor == 0 && s2 % factor == 0 && length % factor == 0) { return ptr.origin[s1/factor .. e1/factor] == arr.ptr.origin[s2/factor .. e2/factor]; } for(size_t i=0;i<limit; i++) if(this[i] != arr[i]) return false; return true; } @property size_t length()const{ return limit; } private: auto roundUp()(size_t val){ return (val+factor-1)/factor*factor; } auto roundDown()(size_t val){ return val/factor*factor; } // factor - number of elements in one machine word enum factor = size_t.sizeof*8/bits; PackedPtr!(T) ptr; size_t ofs, limit; } private struct SliceOverIndexed(T) { enum assignableIndex = is(typeof((){ T.init[0] = Item.init; })); enum assignableSlice = is(typeof((){ T.init[0..0] = Item.init; })); auto opIndex(size_t idx)const in { assert(idx < to - from); } body { return (*arr)[from+idx]; } static if(assignableIndex) void opIndexAssign(Item val, size_t idx) in { assert(idx < to - from); } body { (*arr)[from+idx] = val; } auto opSlice(size_t a, size_t b) { return typeof(this)(from+a, from+b, arr); } // static if(assignableSlice) void opSliceAssign(T)(T val, size_t start, size_t end) { (*arr)[start+from .. end+from] = val; } auto opSlice() { return typeof(this)(from, to, arr); } @property size_t length()const { return to-from;} auto opDollar()const { return length; } @property bool empty()const { return from == to; } @property auto front()const { return (*arr)[from]; } static if(assignableIndex) @property void front(Item val) { (*arr)[from] = val; } @property auto back()const { return (*arr)[to-1]; } static if(assignableIndex) @property void back(Item val) { (*arr)[to-1] = val; } @property auto save() inout { return this; } void popFront() { from++; } void popBack() { to--; } bool opEquals(T)(auto ref T arr) const { if(arr.length != length) return false; for(size_t i=0; i <length; i++) if(this[i] != arr[i]) return false; return true; } private: alias Item = typeof(T.init[0]); size_t from, to; T* arr; } static assert(isRandomAccessRange!(SliceOverIndexed!(int[]))); // BUG? forward reference to return type of sliceOverIndexed!Grapheme SliceOverIndexed!(const(T)) sliceOverIndexed(T)(size_t a, size_t b, const(T)* x) if(is(Unqual!T == T)) { return SliceOverIndexed!(const(T))(a, b, x); } // BUG? inout is out of reach //...SliceOverIndexed.arr only parameters or stack based variables can be inout SliceOverIndexed!T sliceOverIndexed(T)(size_t a, size_t b, T* x) if(is(Unqual!T == T)) { return SliceOverIndexed!T(a, b, x); } unittest { int[] idxArray = [2, 3, 5, 8, 13]; auto sliced = sliceOverIndexed(0, idxArray.length, &idxArray); assert(!sliced.empty); assert(sliced.front == 2); sliced.front = 1; assert(sliced.front == 1); assert(sliced.back == 13); sliced.popFront(); assert(sliced.front == 3); assert(sliced.back == 13); sliced.back = 11; assert(sliced.back == 11); sliced.popBack(); assert(sliced.front == 3); assert(sliced[$-1] == 8); sliced = sliced[]; assert(sliced[0] == 3); assert(sliced.back == 8); sliced = sliced[1..$]; assert(sliced.front == 5); sliced = sliced[0..$-1]; assert(sliced[$-1] == 5); int[] other = [2, 5]; assert(sliced[] == sliceOverIndexed(1, 2, &other)); sliceOverIndexed(0, 2, &idxArray)[0..2] = -1; assert(idxArray[0..2] == [-1, -1]); uint[] nullArr = null; auto nullSlice = sliceOverIndexed(0, 0, &idxArray); assert(nullSlice.empty); } private auto packedArrayView(T)(inout(size_t)* ptr, size_t items) @trusted pure nothrow { return inout(PackedArrayView!T)(ptr, 0, items); } //============================================================================ // Partially unrolled binary search using Shar's method //============================================================================ string genUnrolledSwitchSearch(size_t size) { import std.conv : to; import core.bitop : bsr; import std.array : replace; assert(isPowerOf2(size)); string code = ` import core.bitop : bsr; auto power = bsr(m)+1; switch(power){`; size_t i = bsr(size); foreach_reverse(val; 0..bsr(size)) { auto v = 2^^val; code ~= ` case pow: if(pred(range[idx+m], needle)) idx += m; goto case; `.replace("m", to!string(v)) .replace("pow", to!string(i)); i--; } code ~= ` case 0: if(pred(range[idx], needle)) idx += 1; goto default; `; code ~= ` default: }`; return code; } bool isPowerOf2(size_t sz) @safe pure nothrow @nogc { return (sz & (sz-1)) == 0; } size_t uniformLowerBound(alias pred, Range, T)(Range range, T needle) if(is(T : ElementType!Range)) { assert(isPowerOf2(range.length)); size_t idx = 0, m = range.length/2; while(m != 0) { if(pred(range[idx+m], needle)) idx += m; m /= 2; } if(pred(range[idx], needle)) idx += 1; return idx; } size_t switchUniformLowerBound(alias pred, Range, T)(Range range, T needle) if(is(T : ElementType!Range)) { assert(isPowerOf2(range.length)); size_t idx = 0, m = range.length/2; enum max = 1<<10; while(m >= max) { if(pred(range[idx+m], needle)) idx += m; m /= 2; } mixin(genUnrolledSwitchSearch(max)); return idx; } // size_t floorPowerOf2(size_t arg) @safe pure nothrow @nogc { import core.bitop : bsr; assert(arg > 1); // else bsr is undefined return 1<<bsr(arg-1); } size_t ceilPowerOf2(size_t arg) @safe pure nothrow @nogc { import core.bitop : bsr; assert(arg > 1); // else bsr is undefined return 1<<bsr(arg-1)+1; } template sharMethod(alias uniLowerBound) { size_t sharMethod(alias _pred="a<b", Range, T)(Range range, T needle) if(is(T : ElementType!Range)) { import std.functional; alias pred = binaryFun!_pred; if(range.length == 0) return 0; if(isPowerOf2(range.length)) return uniLowerBound!pred(range, needle); size_t n = floorPowerOf2(range.length); if(pred(range[n-1], needle)) {// search in another 2^^k area that fully covers the tail of range size_t k = ceilPowerOf2(range.length - n + 1); return range.length - k + uniLowerBound!pred(range[$-k..$], needle); } else return uniLowerBound!pred(range[0..n], needle); } } alias sharLowerBound = sharMethod!uniformLowerBound; alias sharSwitchLowerBound = sharMethod!switchUniformLowerBound; unittest { import std.range; auto stdLowerBound(T)(T[] range, T needle) { return assumeSorted(range).lowerBound(needle).length; } immutable MAX = 5*1173; auto arr = array(iota(5, MAX, 5)); assert(arr.length == MAX/5-1); foreach(i; 0..MAX+5) { auto st = stdLowerBound(arr, i); assert(st == sharLowerBound(arr, i)); assert(st == sharSwitchLowerBound(arr, i)); } arr = []; auto st = stdLowerBound(arr, 33); assert(st == sharLowerBound(arr, 33)); assert(st == sharSwitchLowerBound(arr, 33)); } //============================================================================ @safe { // hope to see simillar stuff in public interface... once Allocators are out //@@@BUG moveFront and friends? dunno, for now it's POD-only @trusted size_t genericReplace(Policy=void, T, Range) (ref T dest, size_t from, size_t to, Range stuff) { import std.algorithm : copy; size_t delta = to - from; size_t stuff_end = from+stuff.length; if(stuff.length > delta) {// replace increases length delta = stuff.length - delta;// now, new is > old by delta static if(is(Policy == void)) dest.length = dest.length+delta;//@@@BUG lame @property else dest = Policy.realloc(dest, dest.length+delta); copyBackwards(dest[to..dest.length-delta], dest[to+delta..dest.length]); copyForward(stuff, dest[from..stuff_end]); } else if(stuff.length == delta) { copy(stuff, dest[from..to]); } else {// replace decreases length by delta delta = delta - stuff.length; copy(stuff, dest[from..stuff_end]); copyForward(dest[to..dest.length], dest[stuff_end..dest.length-delta]); static if(is(Policy == void)) dest.length = dest.length - delta;//@@@BUG lame @property else dest = Policy.realloc(dest, dest.length-delta); } return stuff_end; } // Simple storage manipulation policy @trusted public struct GcPolicy { static T[] dup(T)(const T[] arr) { return arr.dup; } static T[] alloc(T)(size_t size) { return new T[size]; } static T[] realloc(T)(T[] arr, size_t sz) { arr.length = sz; return arr; } static void replaceImpl(T, Range)(ref T[] dest, size_t from, size_t to, Range stuff) { replaceInPlace(dest, from, to, stuff); } static void append(T, V)(ref T[] arr, V value) if(!isInputRange!V) { arr ~= force!T(value); } static void append(T, V)(ref T[] arr, V value) if(isInputRange!V) { insertInPlace(arr, arr.length, value); } static void destroy(T)(ref T arr) if(isDynamicArray!T && is(Unqual!T == T)) { debug { arr[] = cast(typeof(T.init[0]))(0xdead_beef); } arr = null; } static void destroy(T)(ref T arr) if(isDynamicArray!T && !is(Unqual!T == T)) { arr = null; } } // ditto @trusted struct ReallocPolicy { static T[] dup(T)(const T[] arr) { auto result = alloc!T(arr.length); result[] = arr[]; return result; } static T[] alloc(T)(size_t size) { import std.exception : enforce; auto ptr = cast(T*)enforce(malloc(T.sizeof*size), "out of memory on C heap"); return ptr[0..size]; } static T[] realloc(T)(T[] arr, size_t size) { import std.exception : enforce; if(!size) { destroy(arr); return null; } auto ptr = cast(T*)enforce(core.stdc.stdlib.realloc( arr.ptr, T.sizeof*size), "out of memory on C heap"); return ptr[0..size]; } static void replaceImpl(T, Range)(ref T[] dest, size_t from, size_t to, Range stuff) { genericReplace!(ReallocPolicy)(dest, from, to, stuff); } static void append(T, V)(ref T[] arr, V value) if(!isInputRange!V) { arr = realloc(arr, arr.length+1); arr[$-1] = force!T(value); } static void append(T, V)(ref T[] arr, V value) if(isInputRange!V && hasLength!V) { arr = realloc(arr, arr.length+value.length); copy(value, arr[$-value.length..$]); } static void destroy(T)(ref T[] arr) { if(arr.ptr) free(arr.ptr); arr = null; } } //build hack alias _RealArray = CowArray!ReallocPolicy; unittest { with(ReallocPolicy) { bool test(T, U, V)(T orig, size_t from, size_t to, U toReplace, V result, string file = __FILE__, size_t line = __LINE__) { { replaceImpl(orig, from, to, toReplace); scope(exit) destroy(orig); if(!equalS(orig, result)) return false; } return true; } static T[] arr(T)(T[] args... ) { return dup(args); } assert(test(arr([1, 2, 3, 4]), 0, 0, [5, 6, 7], [5, 6, 7, 1, 2, 3, 4])); assert(test(arr([1, 2, 3, 4]), 0, 2, cast(int[])[], [3, 4])); assert(test(arr([1, 2, 3, 4]), 0, 4, [5, 6, 7], [5, 6, 7])); assert(test(arr([1, 2, 3, 4]), 0, 2, [5, 6, 7], [5, 6, 7, 3, 4])); assert(test(arr([1, 2, 3, 4]), 2, 3, [5, 6, 7], [1, 2, 5, 6, 7, 4])); } } /** Tests if T is some kind a set of code points. Intended for template constraints. */ public template isCodepointSet(T) { static if(is(T dummy == InversionList!(Args), Args...)) enum isCodepointSet = true; else enum isCodepointSet = false; } /** Tests if $(D T) is a pair of integers that implicitly convert to $(D V). The following code must compile for any pair $(D T): --- (T x){ V a = x[0]; V b = x[1];} --- The following must not compile: --- (T x){ V c = x[2];} --- */ public template isIntegralPair(T, V=uint) { enum isIntegralPair = is(typeof((T x){ V a = x[0]; V b = x[1];})) && !is(typeof((T x){ V c = x[2]; })); } /** The recommended default type for set of $(CODEPOINTS). For details, see the current implementation: $(LREF InversionList). */ public alias CodepointSet = InversionList!GcPolicy; //@@@BUG: std.typecons tuples depend on std.format to produce fields mixin // which relies on std.uni.isGraphical and this chain blows up with Forward reference error // hence below doesn't seem to work // public alias CodepointInterval = Tuple!(uint, "a", uint, "b"); /** The recommended type of $(XREF _typecons, Tuple) to represent [a, b$(RPAREN) intervals of $(CODEPOINTS). As used in $(LREF InversionList). Any interval type should pass $(LREF isIntegralPair) trait. */ public struct CodepointInterval { pure: uint[2] _tuple; alias _tuple this; @safe pure nothrow @nogc: this(uint low, uint high) { _tuple[0] = low; _tuple[1] = high; } bool opEquals(T)(T val) const { return this[0] == val[0] && this[1] == val[1]; } @property ref inout(uint) a() inout { return _tuple[0]; } @property ref inout(uint) b() inout { return _tuple[1]; } } //@@@BUG another forward reference workaround @trusted bool equalS(R1, R2)(R1 lhs, R2 rhs) { for(;;){ if(lhs.empty) return rhs.empty; if(rhs.empty) return false; if(lhs.front != rhs.front) return false; lhs.popFront(); rhs.popFront(); } } /** $(P $(D InversionList) is a set of $(CODEPOINTS) represented as an array of open-right [a, b$(RPAREN) intervals (see $(LREF CodepointInterval) above). The name comes from the way the representation reads left to right. For instance a set of all values [10, 50$(RPAREN), [80, 90$(RPAREN), plus a singular value 60 looks like this: ) --- 10, 50, 60, 61, 80, 90 --- $(P The way to read this is: start with negative meaning that all numbers smaller then the next one are not present in this set (and positive - the contrary). Then switch positive/negative after each number passed from left to right. ) $(P This way negative spans until 10, then positive until 50, then negative until 60, then positive until 61, and so on. As seen this provides a space-efficient storage of highly redundant data that comes in long runs. A description which Unicode $(CHARACTER) properties fit nicely. The technique itself could be seen as a variation on $(LUCKY RLE encoding). ) $(P Sets are value types (just like $(D int) is) thus they are never aliased. ) Example: --- auto a = CodepointSet('a', 'z'+1); auto b = CodepointSet('A', 'Z'+1); auto c = a; a = a | b; assert(a == CodepointSet('A', 'Z'+1, 'a', 'z'+1)); assert(a != c); --- $(P See also $(LREF unicode) for simpler construction of sets from predefined ones. ) $(P Memory usage is 8 bytes per each contiguous interval in a set. The value semantics are achieved by using the $(WEB en.wikipedia.org/wiki/Copy-on-write, COW) technique and thus it's $(RED not) safe to cast this type to $(D_KEYWORD shared). ) Note: $(P It's not recommended to rely on the template parameters or the exact type of a current $(CODEPOINT) set in $(D std.uni). The type and parameters may change when the standard allocators design is finalized. Use $(LREF isCodepointSet) with templates or just stick with the default alias $(LREF CodepointSet) throughout the whole code base. ) */ @trusted public struct InversionList(SP=GcPolicy) { import std.range : assumeSorted; public: /** Construct from another code point set of any type. */ this(Set)(Set set) pure if(isCodepointSet!Set) { uint[] arr; foreach(v; set.byInterval) { arr ~= v.a; arr ~= v.b; } data = CowArray!(SP).reuse(arr); } /** Construct a set from a forward range of code point intervals. */ this(Range)(Range intervals) pure if(isForwardRange!Range && isIntegralPair!(ElementType!Range)) { uint[] arr; foreach(v; intervals) { SP.append(arr, v.a); SP.append(arr, v.b); } data = CowArray!(SP).reuse(arr); sanitize(); //enforce invariant: sort intervals etc. } //helper function that avoids sanity check to be CTFE-friendly private static fromIntervals(Range)(Range intervals) pure { import std.algorithm : map; import std.range : roundRobin; auto flattened = roundRobin(intervals.save.map!"a[0]"(), intervals.save.map!"a[1]"()); InversionList set; set.data = CowArray!(SP)(flattened); return set; } //ditto untill sort is CTFE-able private static fromIntervals()(uint[] intervals...) pure in { import std.conv : text; assert(intervals.length % 2 == 0, "Odd number of interval bounds [a, b)!"); for (uint i = 0; i < intervals.length; i += 2) { auto a = intervals[i], b = intervals[i+1]; assert(a < b, text("illegal interval [a, b): ", a, " > ", b)); } } body { InversionList set; set.data = CowArray!(SP)(intervals); return set; } /** Construct a set from plain values of code point intervals. */ this()(uint[] intervals...) in { import std.conv : text; assert(intervals.length % 2 == 0, "Odd number of interval bounds [a, b)!"); for (uint i = 0; i < intervals.length; i += 2) { auto a = intervals[i], b = intervals[i+1]; assert(a < b, text("illegal interval [a, b): ", a, " > ", b)); } } body { data = CowArray!(SP)(intervals); sanitize(); //enforce invariant: sort intervals etc. } /// unittest { import std.algorithm.comparison : equal; auto set = CodepointSet('a', 'z'+1, 'а', 'я'+1); foreach(v; 'a'..'z'+1) assert(set[v]); // Cyrillic lowercase interval foreach(v; 'а'..'я'+1) assert(set[v]); //specific order is not required, intervals may interesect auto set2 = CodepointSet('а', 'я'+1, 'a', 'd', 'b', 'z'+1); //the same end result assert(set2.byInterval.equal(set.byInterval)); } /** Get range that spans all of the $(CODEPOINT) intervals in this $(LREF InversionList). Example: ----------- import std.algorithm.comparison : equal; import std.typecons : tuple; auto set = CodepointSet('A', 'D'+1, 'a', 'd'+1); assert(set.byInterval.equal([tuple('A','E'), tuple('a','e')])); ----------- */ @property auto byInterval() { return Intervals!(typeof(data))(data); } /** Tests the presence of code point $(D val) in this set. */ bool opIndex(uint val) const { // the <= ensures that searching in interval of [a, b) for 'a' you get .length == 1 // return assumeSorted!((a,b) => a<=b)(data[]).lowerBound(val).length & 1; return sharSwitchLowerBound!"a<=b"(data[], val) & 1; } /// unittest { auto gothic = unicode.Gothic; // Gothic letter ahsa assert(gothic['\U00010330']); // no ascii in Gothic obviously assert(!gothic['$']); } // Linear scan for $(D ch). Useful only for small sets. // TODO: // used internally in std.regex // should be properly exposed in a public API ? package auto scanFor()(dchar ch) const { immutable len = data.length; for(size_t i = 0; i < len; i++) if(ch < data[i]) return i & 1; return 0; } /// Number of $(CODEPOINTS) in this set @property size_t length() { size_t sum = 0; foreach(iv; byInterval) { sum += iv.b - iv.a; } return sum; } // bootstrap full set operations from 4 primitives (suitable as a template mixin): // addInterval, skipUpTo, dropUpTo & byInterval iteration //============================================================================ public: /** $(P Sets support natural syntax for set algebra, namely: ) $(BOOKTABLE , $(TR $(TH Operator) $(TH Math notation) $(TH Description) ) $(TR $(TD &) $(TD a ∩ b) $(TD intersection) ) $(TR $(TD |) $(TD a ∪ b) $(TD union) ) $(TR $(TD -) $(TD a ∖ b) $(TD subtraction) ) $(TR $(TD ~) $(TD a ~ b) $(TD symmetric set difference i.e. (a ∪ b) \ (a ∩ b)) ) ) */ This opBinary(string op, U)(U rhs) if(isCodepointSet!U || is(U:dchar)) { static if(op == "&" || op == "|" || op == "~") {// symmetric ops thus can swap arguments to reuse r-value static if(is(U:dchar)) { auto tmp = this; mixin("tmp "~op~"= rhs; "); return tmp; } else { static if(is(Unqual!U == U)) { // try hard to reuse r-value mixin("rhs "~op~"= this;"); return rhs; } else { auto tmp = this; mixin("tmp "~op~"= rhs;"); return tmp; } } } else static if(op == "-") // anti-symmetric { auto tmp = this; tmp -= rhs; return tmp; } else static assert(0, "no operator "~op~" defined for Set"); } /// unittest { import std.algorithm.comparison : equal; import std.range : iota; auto lower = unicode.LowerCase; auto upper = unicode.UpperCase; auto ascii = unicode.ASCII; assert((lower & upper).empty); // no intersection auto lowerASCII = lower & ascii; assert(lowerASCII.byCodepoint.equal(iota('a', 'z'+1))); // throw away all of the lowercase ASCII assert((ascii - lower).length == 128 - 26); auto onlyOneOf = lower ~ ascii; assert(!onlyOneOf['Δ']); // not ASCII and not lowercase assert(onlyOneOf['$']); // ASCII and not lowercase assert(!onlyOneOf['a']); // ASCII and lowercase assert(onlyOneOf['я']); // not ASCII but lowercase // throw away all cased letters from ASCII auto noLetters = ascii - (lower | upper); assert(noLetters.length == 128 - 26*2); } /// The 'op=' versions of the above overloaded operators. ref This opOpAssign(string op, U)(U rhs) if(isCodepointSet!U || is(U:dchar)) { static if(op == "|") // union { static if(is(U:dchar)) { this.addInterval(rhs, rhs+1); return this; } else return this.add(rhs); } else static if(op == "&") // intersection return this.intersect(rhs);// overloaded else static if(op == "-") // set difference return this.sub(rhs);// overloaded else static if(op == "~") // symmetric set difference { auto copy = this & rhs; this |= rhs; this -= copy; return this; } else static assert(0, "no operator "~op~" defined for Set"); } /** Tests the presence of codepoint $(D ch) in this set, the same as $(LREF opIndex). */ bool opBinaryRight(string op: "in", U)(U ch) const if(is(U : dchar)) { return this[ch]; } /// unittest { assert('я' in unicode.Cyrillic); assert(!('z' in unicode.Cyrillic)); } /** * Obtains a set that is the inversion of this set. * * See_Also: $(LREF inverted) */ auto opUnary(string op: "!")() { return this.inverted; } /** A range that spans each $(CODEPOINT) in this set. */ @property auto byCodepoint() { @trusted static struct CodepointRange { this(This set) { r = set.byInterval; if(!r.empty) cur = r.front.a; } @property dchar front() const { return cast(dchar)cur; } @property bool empty() const { return r.empty; } void popFront() { cur++; while(cur >= r.front.b) { r.popFront(); if(r.empty) break; cur = r.front.a; } } private: uint cur; typeof(This.init.byInterval) r; } return CodepointRange(this); } /// unittest { import std.algorithm.comparison : equal; import std.range : iota; auto set = unicode.ASCII; set.byCodepoint.equal(iota(0, 0x80)); } /** $(P Obtain textual representation of this set in from of open-right intervals and feed it to $(D sink). ) $(P Used by various standard formatting facilities such as $(XREF _format, formattedWrite), $(XREF _stdio, write), $(XREF _stdio, writef), $(XREF _conv, to) and others. ) Example: --- import std.conv; assert(unicode.ASCII.to!string == "[0..128$(RPAREN)"); --- */ private import std.format : FormatException, FormatSpec; /*************************************** * Obtain a textual representation of this InversionList * in form of open-right intervals. * * The formatting flag is applied individually to each value, for example: * $(LI $(B %s) and $(B %d) format the intervals as a [low..high$(RPAREN) range of integrals) * $(LI $(B %x) formats the intervals as a [low..high$(RPAREN) range of lowercase hex characters) * $(LI $(B %X) formats the intervals as a [low..high$(RPAREN) range of uppercase hex characters) */ void toString(scope void delegate(const(char)[]) sink, FormatSpec!char fmt) /* const */ { import std.format; auto range = byInterval; if(range.empty) return; while (1) { auto i = range.front; range.popFront(); put(sink, "["); formatValue(sink, i.a, fmt); put(sink, ".."); formatValue(sink, i.b, fmt); put(sink, ")"); if (range.empty) return; put(sink, " "); } } /// unittest { import std.conv : to; import std.format : format; import std.uni : unicode; assert(unicode.Cyrillic.to!string == "[1024..1157) [1159..1320) [7467..7468) [7544..7545) [11744..11776) [42560..42648) [42655..42656)"); // The specs '%s' and '%d' are equivalent to the to!string call above. assert(format("%d", unicode.Cyrillic) == unicode.Cyrillic.to!string); assert(format("%#x", unicode.Cyrillic) == "[0x400..0x485) [0x487..0x528) [0x1d2b..0x1d2c) [0x1d78..0x1d79) [0x2de0..0x2e00) [0xa640..0xa698) [0xa69f..0xa6a0)"); assert(format("%#X", unicode.Cyrillic) == "[0X400..0X485) [0X487..0X528) [0X1D2B..0X1D2C) [0X1D78..0X1D79) [0X2DE0..0X2E00) [0XA640..0XA698) [0XA69F..0XA6A0)"); } unittest { import std.exception : assertThrown; import std.format : format; assertThrown!FormatException(format("%a", unicode.ASCII)); } /** Add an interval [a, b$(RPAREN) to this set. */ ref add()(uint a, uint b) { addInterval(a, b); return this; } /// unittest { CodepointSet someSet; someSet.add('0', '5').add('A','Z'+1); someSet.add('5', '9'+1); assert(someSet['0']); assert(someSet['5']); assert(someSet['9']); assert(someSet['Z']); } private: package(std) // used from: std.regex.internal.parser ref intersect(U)(U rhs) if(isCodepointSet!U) { Marker mark; foreach( i; rhs.byInterval) { mark = this.dropUpTo(i.a, mark); mark = this.skipUpTo(i.b, mark); } this.dropUpTo(uint.max, mark); return this; } ref intersect()(dchar ch) { foreach(i; byInterval) if(i.a <= ch && ch < i.b) return this = This.init.add(ch, ch+1); this = This.init; return this; } /// unittest { assert(unicode.Cyrillic.intersect('-').byInterval.empty); } ref sub()(dchar ch) { return subChar(ch); } // same as the above except that skip & drop parts are swapped package(std) // used from: std.regex.internal.parser ref sub(U)(U rhs) if(isCodepointSet!U) { uint top; Marker mark; foreach(i; rhs.byInterval) { mark = this.skipUpTo(i.a, mark); mark = this.dropUpTo(i.b, mark); } return this; } package(std) // used from: std.regex.internal.parse ref add(U)(U rhs) if(isCodepointSet!U) { Marker start; foreach(i; rhs.byInterval) { start = addInterval(i.a, i.b, start); } return this; } // end of mixin-able part //============================================================================ public: /** Obtains a set that is the inversion of this set. See the '!' $(LREF opUnary) for the same but using operators. */ @property auto inverted() { InversionList inversion = this; if(inversion.data.length == 0) { inversion.addInterval(0, lastDchar+1); return inversion; } if(inversion.data[0] != 0) genericReplace(inversion.data, 0, 0, [0]); else genericReplace(inversion.data, 0, 1, cast(uint[])null); if(data[data.length-1] != lastDchar+1) genericReplace(inversion.data, inversion.data.length, inversion.data.length, [lastDchar+1]); else genericReplace(inversion.data, inversion.data.length-1, inversion.data.length, cast(uint[])null); return inversion; } /// unittest { auto set = unicode.ASCII; // union with the inverse gets all of the code points in the Unicode assert((set | set.inverted).length == 0x110000); // no intersection with the inverse assert((set & set.inverted).empty); } /** Generates string with D source code of unary function with name of $(D funcName) taking a single $(D dchar) argument. If $(D funcName) is empty the code is adjusted to be a lambda function. The function generated tests if the $(CODEPOINT) passed belongs to this set or not. The result is to be used with string mixin. The intended usage area is aggressive optimization via meta programming in parser generators and the like. Note: Use with care for relatively small or regular sets. It could end up being slower then just using multi-staged tables. Example: --- import std.stdio; // construct set directly from [a, b$RPAREN intervals auto set = CodepointSet(10, 12, 45, 65, 100, 200); writeln(set); writeln(set.toSourceCode("func")); --- The above outputs something along the lines of: --- bool func(dchar ch) @safe pure nothrow @nogc { if(ch < 45) { if(ch == 10 || ch == 11) return true; return false; } else if (ch < 65) return true; else { if(ch < 100) return false; if(ch < 200) return true; return false; } } --- */ string toSourceCode(string funcName="") { import std.array : array; import std.format : format; import std.algorithm : countUntil; enum maxBinary = 3; static string linearScope(R)(R ivals, string indent) { string result = indent~"{\n"; string deeper = indent~" "; foreach(ival; ivals) { auto span = ival[1] - ival[0]; assert(span != 0); if(span == 1) { result ~= format("%sif(ch == %s) return true;\n", deeper, ival[0]); } else if(span == 2) { result ~= format("%sif(ch == %s || ch == %s) return true;\n", deeper, ival[0], ival[0]+1); } else { if(ival[0] != 0) // dchar is unsigned and < 0 is useless result ~= format("%sif(ch < %s) return false;\n", deeper, ival[0]); result ~= format("%sif(ch < %s) return true;\n", deeper, ival[1]); } } result ~= format("%sreturn false;\n%s}\n", deeper, indent); // including empty range of intervals return result; } static string binaryScope(R)(R ivals, string indent) { // time to do unrolled comparisons? if(ivals.length < maxBinary) return linearScope(ivals, indent); else return bisect(ivals, ivals.length/2, indent); } // not used yet if/elsebinary search is far better with DMD as of 2.061 // and GDC is doing fine job either way static string switchScope(R)(R ivals, string indent) { string result = indent~"switch(ch){\n"; string deeper = indent~" "; foreach(ival; ivals) { if(ival[0]+1 == ival[1]) { result ~= format("%scase %s: return true;\n", deeper, ival[0]); } else { result ~= format("%scase %s: .. case %s: return true;\n", deeper, ival[0], ival[1]-1); } } result ~= deeper~"default: return false;\n"~indent~"}\n"; return result; } static string bisect(R)(R range, size_t idx, string indent) { string deeper = indent ~ " "; // bisect on one [a, b) interval at idx string result = indent~"{\n"; // less branch, < a result ~= format("%sif(ch < %s)\n%s", deeper, range[idx][0], binaryScope(range[0..idx], deeper)); // middle point, >= a && < b result ~= format("%selse if (ch < %s) return true;\n", deeper, range[idx][1]); // greater or equal branch, >= b result ~= format("%selse\n%s", deeper, binaryScope(range[idx+1..$], deeper)); return result~indent~"}\n"; } string code = format("bool %s(dchar ch) @safe pure nothrow @nogc\n", funcName.empty ? "function" : funcName); auto range = byInterval.array(); // special case first bisection to be on ASCII vs beyond auto tillAscii = countUntil!"a[0] > 0x80"(range); if(tillAscii <= 0) // everything is ASCII or nothing is ascii (-1 & 0) code ~= binaryScope(range, ""); else code ~= bisect(range, tillAscii, ""); return code; } /** True if this set doesn't contain any $(CODEPOINTS). */ @property bool empty() const { return data.length == 0; } /// unittest { CodepointSet emptySet; assert(emptySet.length == 0); assert(emptySet.empty); } private: alias This = typeof(this); alias Marker = size_t; // a random-access range of integral pairs static struct Intervals(Range) { this(Range sp) { slice = sp; start = 0; end = sp.length; } this(Range sp, size_t s, size_t e) { slice = sp; start = s; end = e; } @property auto front()const { uint a = slice[start]; uint b = slice[start+1]; return CodepointInterval(a, b); } //may break sorted property - but we need std.sort to access it //hence package protection attribute package @property auto front(CodepointInterval val) { slice[start] = val.a; slice[start+1] = val.b; } @property auto back()const { uint a = slice[end-2]; uint b = slice[end-1]; return CodepointInterval(a, b); } //ditto about package package @property auto back(CodepointInterval val) { slice[end-2] = val.a; slice[end-1] = val.b; } void popFront() { start += 2; } void popBack() { end -= 2; } auto opIndex(size_t idx) const { uint a = slice[start+idx*2]; uint b = slice[start+idx*2+1]; return CodepointInterval(a, b); } //ditto about package package auto opIndexAssign(CodepointInterval val, size_t idx) { slice[start+idx*2] = val.a; slice[start+idx*2+1] = val.b; } auto opSlice(size_t s, size_t e) { return Intervals(slice, s*2+start, e*2+start); } @property size_t length()const { return slice.length/2; } @property bool empty()const { return start == end; } @property auto save(){ return this; } private: size_t start, end; Range slice; } // called after construction from intervals // to make sure invariants hold void sanitize() { import std.algorithm : sort, SwapStrategy, max; if (data.length == 0) return; alias Ival = CodepointInterval; //intervals wrapper for a _range_ over packed array auto ivals = Intervals!(typeof(data[]))(data[]); //@@@BUG@@@ can't use "a.a < b.a" see issue 12265 sort!((a,b) => a.a < b.a, SwapStrategy.stable)(ivals); // what follows is a variation on stable remove // differences: // - predicate is binary, and is tested against // the last kept element (at 'i'). // - predicate mutates lhs (merges rhs into lhs) size_t len = ivals.length; size_t i = 0; size_t j = 1; while (j < len) { if (ivals[i].b >= ivals[j].a) { ivals[i] = Ival(ivals[i].a, max(ivals[i].b, ivals[j].b)); j++; } else //unmergable { // check if there is a hole after merges // (in the best case we do 0 writes to ivals) if (j != i+1) ivals[i+1] = ivals[j]; //copy over i++; j++; } } len = i + 1; for (size_t k=0; k + 1 < len; k++) { assert(ivals[k].a < ivals[k].b); assert(ivals[k].b < ivals[k+1].a); } data.length = len * 2; } // special case for normal InversionList ref subChar(dchar ch) { auto mark = skipUpTo(ch); if(mark != data.length && data[mark] == ch && data[mark-1] == ch) { // it has split, meaning that ch happens to be in one of intervals data[mark] = data[mark]+1; } return this; } // Marker addInterval(int a, int b, Marker hint=Marker.init) in { assert(a <= b); } body { import std.range : assumeSorted, SearchPolicy; auto range = assumeSorted(data[]); size_t pos; size_t a_idx = hint + range[hint..$].lowerBound!(SearchPolicy.gallop)(a).length; if(a_idx == range.length) { // [---+++----++++----++++++] // [ a b] data.append(a, b); return data.length-1; } size_t b_idx = range[a_idx..range.length].lowerBound!(SearchPolicy.gallop)(b).length+a_idx; uint[3] buf = void; uint to_insert; debug(std_uni) { writefln("a_idx=%d; b_idx=%d;", a_idx, b_idx); } if(b_idx == range.length) { // [-------++++++++----++++++-] // [ s a b] if(a_idx & 1)// a in positive { buf[0] = b; to_insert = 1; } else// a in negative { buf[0] = a; buf[1] = b; to_insert = 2; } pos = genericReplace(data, a_idx, b_idx, buf[0..to_insert]); return pos - 1; } uint top = data[b_idx]; debug(std_uni) { writefln("a_idx=%d; b_idx=%d;", a_idx, b_idx); writefln("a=%s; b=%s; top=%s;", a, b, top); } if(a_idx & 1) {// a in positive if(b_idx & 1)// b in positive { // [-------++++++++----++++++-] // [ s a b ] buf[0] = top; to_insert = 1; } else // b in negative { // [-------++++++++----++++++-] // [ s a b ] if(top == b) { assert(b_idx+1 < data.length); buf[0] = data[b_idx+1]; pos = genericReplace(data, a_idx, b_idx+2, buf[0..1]); return pos - 1; } buf[0] = b; buf[1] = top; to_insert = 2; } } else { // a in negative if(b_idx & 1) // b in positive { // [----------+++++----++++++-] // [ a b ] buf[0] = a; buf[1] = top; to_insert = 2; } else// b in negative { // [----------+++++----++++++-] // [ a s b ] if(top == b) { assert(b_idx+1 < data.length); buf[0] = a; buf[1] = data[b_idx+1]; pos = genericReplace(data, a_idx, b_idx+2, buf[0..2]); return pos - 1; } buf[0] = a; buf[1] = b; buf[2] = top; to_insert = 3; } } pos = genericReplace(data, a_idx, b_idx+1, buf[0..to_insert]); debug(std_uni) { writefln("marker idx: %d; length=%d", pos, data[pos], data.length); writeln("inserting ", buf[0..to_insert]); } return pos - 1; } // Marker dropUpTo(uint a, Marker pos=Marker.init) in { assert(pos % 2 == 0); // at start of interval } body { auto range = assumeSorted!"a<=b"(data[pos..data.length]); if(range.empty) return pos; size_t idx = pos; idx += range.lowerBound(a).length; debug(std_uni) { writeln("dropUpTo full length=", data.length); writeln(pos,"~~~", idx); } if(idx == data.length) return genericReplace(data, pos, idx, cast(uint[])[]); if(idx & 1) { // a in positive //[--+++----++++++----+++++++------...] // |<---si s a t genericReplace(data, pos, idx, [a]); } else { // a in negative //[--+++----++++++----+++++++-------+++...] // |<---si s a t genericReplace(data, pos, idx, cast(uint[])[]); } return pos; } // Marker skipUpTo(uint a, Marker pos=Marker.init) out(result) { assert(result % 2 == 0);// always start of interval //(may be 0-width after-split) } body { assert(data.length % 2 == 0); auto range = assumeSorted!"a<=b"(data[pos..data.length]); size_t idx = pos+range.lowerBound(a).length; if(idx >= data.length) // could have Marker point to recently removed stuff return data.length; if(idx & 1)// inside of interval, check for split { uint top = data[idx]; if(top == a)// no need to split, it's end return idx+1; uint start = data[idx-1]; if(a == start) return idx-1; // split it up genericReplace(data, idx, idx+1, [a, a, top]); return idx+1; // avoid odd index } return idx; } CowArray!SP data; } @system unittest { import std.conv; assert(unicode.ASCII.to!string() == "[0..128)"); } // pedantic version for ctfe, and aligned-access only architectures @trusted uint safeRead24(const ubyte* ptr, size_t idx) pure nothrow @nogc { idx *= 3; version(LittleEndian) return ptr[idx] + (cast(uint)ptr[idx+1]<<8) + (cast(uint)ptr[idx+2]<<16); else return (cast(uint)ptr[idx]<<16) + (cast(uint)ptr[idx+1]<<8) + ptr[idx+2]; } // ditto @trusted void safeWrite24(ubyte* ptr, uint val, size_t idx) pure nothrow @nogc { idx *= 3; version(LittleEndian) { ptr[idx] = val & 0xFF; ptr[idx+1] = (val>>8) & 0xFF; ptr[idx+2] = (val>>16) & 0xFF; } else { ptr[idx] = (val>>16) & 0xFF; ptr[idx+1] = (val>>8) & 0xFF; ptr[idx+2] = val & 0xFF; } } // unaligned x86-like read/write functions @trusted uint unalignedRead24(const ubyte* ptr, size_t idx) pure nothrow @nogc { uint* src = cast(uint*)(ptr+3*idx); version(LittleEndian) return *src & 0xFF_FFFF; else return *src >> 8; } // ditto @trusted void unalignedWrite24(ubyte* ptr, uint val, size_t idx) pure nothrow @nogc { uint* dest = cast(uint*)(cast(ubyte*)ptr + 3*idx); version(LittleEndian) *dest = val | (*dest & 0xFF00_0000); else *dest = (val<<8) | (*dest & 0xFF); } uint read24(const ubyte* ptr, size_t idx) @safe pure nothrow @nogc { static if(hasUnalignedReads) return __ctfe ? safeRead24(ptr, idx) : unalignedRead24(ptr, idx); else return safeRead24(ptr, idx); } void write24(ubyte* ptr, uint val, size_t idx) @safe pure nothrow @nogc { static if(hasUnalignedReads) return __ctfe ? safeWrite24(ptr, val, idx) : unalignedWrite24(ptr, val, idx); else return safeWrite24(ptr, val, idx); } @trusted struct CowArray(SP=GcPolicy) { static auto reuse(uint[] arr) { CowArray cow; cow.data = arr; SP.append(cow.data, 1); assert(cow.refCount == 1); assert(cow.length == arr.length); return cow; } this(Range)(Range range) if(isInputRange!Range && hasLength!Range) { import std.algorithm : copy; length = range.length; copy(range, data[0..$-1]); } this(Range)(Range range) if(isForwardRange!Range && !hasLength!Range) { import std.algorithm : copy; auto len = walkLength(range.save); length = len; copy(range, data[0..$-1]); } this(this) { if(!empty) { refCount = refCount + 1; } } ~this() { if(!empty) { auto cnt = refCount; if(cnt == 1) SP.destroy(data); else refCount = cnt - 1; } } // no ref-count for empty U24 array @property bool empty() const { return data.length == 0; } // report one less then actual size @property size_t length() const { return data.length ? data.length - 1 : 0; } //+ an extra slot for ref-count @property void length(size_t len) { import std.algorithm : min, copy; if(len == 0) { if(!empty) freeThisReference(); return; } immutable total = len + 1; // including ref-count if(empty) { data = SP.alloc!uint(total); refCount = 1; return; } auto cur_cnt = refCount; if(cur_cnt != 1) // have more references to this memory { refCount = cur_cnt - 1; auto new_data = SP.alloc!uint(total); // take shrinking into account auto to_copy = min(total, data.length) - 1; copy(data[0..to_copy], new_data[0..to_copy]); data = new_data; // before setting refCount! refCount = 1; } else // 'this' is the only reference { // use the realloc (hopefully in-place operation) data = SP.realloc(data, total); refCount = 1; // setup a ref-count in the new end of the array } } alias opDollar = length; uint opIndex()(size_t idx)const { return data[idx]; } void opIndexAssign(uint val, size_t idx) { auto cnt = refCount; if(cnt != 1) dupThisReference(cnt); data[idx] = val; } // auto opSlice(size_t from, size_t to) { if(!empty) { auto cnt = refCount; if(cnt != 1) dupThisReference(cnt); } return data[from .. to]; } // auto opSlice(size_t from, size_t to) const { return data[from .. to]; } // length slices before the ref count auto opSlice() { return opSlice(0, length); } // ditto auto opSlice() const { return opSlice(0, length); } void append(Range)(Range range) if(isInputRange!Range && hasLength!Range && is(ElementType!Range : uint)) { size_t nl = length + range.length; length = nl; copy(range, this[nl-range.length..nl]); } void append()(uint[] val...) { length = length + val.length; data[$-val.length-1 .. $-1] = val[]; } bool opEquals()(auto const ref CowArray rhs)const { if(empty ^ rhs.empty) return false; // one is empty and the other isn't return empty || data[0..$-1] == rhs.data[0..$-1]; } private: // ref-count is right after the data @property uint refCount() const { return data[$-1]; } @property void refCount(uint cnt) { data[$-1] = cnt; } void freeThisReference() { auto count = refCount; if(count != 1) // have more references to this memory { // dec shared ref-count refCount = count - 1; data = []; } else SP.destroy(data); assert(!data.ptr); } void dupThisReference(uint count) in { assert(!empty && count != 1 && count == refCount); } body { import std.algorithm : copy; // dec shared ref-count refCount = count - 1; // copy to the new chunk of RAM auto new_data = SP.alloc!uint(data.length); // bit-blit old stuff except the counter copy(data[0..$-1], new_data[0..$-1]); data = new_data; // before setting refCount! refCount = 1; // so that this updates the right one } uint[] data; } @safe unittest// Uint24 tests { import std.algorithm; import std.conv; import std.range; void funcRef(T)(ref T u24) { u24.length = 2; u24[1] = 1024; T u24_c = u24; assert(u24[1] == 1024); u24.length = 0; assert(u24.empty); u24.append([1, 2]); assert(equalS(u24[], [1, 2])); u24.append(111); assert(equalS(u24[], [1, 2, 111])); assert(!u24_c.empty && u24_c[1] == 1024); u24.length = 3; copy(iota(0, 3), u24[]); assert(equalS(u24[], iota(0, 3))); assert(u24_c[1] == 1024); } void func2(T)(T u24) { T u24_2 = u24; T u24_3; u24_3 = u24_2; assert(u24_2 == u24_3); assert(equalS(u24[], u24_2[])); assert(equalS(u24_2[], u24_3[])); funcRef(u24_3); assert(equalS(u24_3[], iota(0, 3))); assert(!equalS(u24_2[], u24_3[])); assert(equalS(u24_2[], u24[])); u24_2 = u24_3; assert(equalS(u24_2[], iota(0, 3))); // to test that passed arg is intact outside // plus try out opEquals u24 = u24_3; u24 = T.init; u24_3 = T.init; assert(u24.empty); assert(u24 == u24_3); assert(u24 != u24_2); } foreach(Policy; AliasSeq!(GcPolicy, ReallocPolicy)) { alias Range = typeof(CowArray!Policy.init[]); alias U24A = CowArray!Policy; static assert(isForwardRange!Range); static assert(isBidirectionalRange!Range); static assert(isOutputRange!(Range, uint)); static assert(isRandomAccessRange!(Range)); auto arr = U24A([42u, 36, 100]); assert(arr[0] == 42); assert(arr[1] == 36); arr[0] = 72; arr[1] = 0xFE_FEFE; assert(arr[0] == 72); assert(arr[1] == 0xFE_FEFE); assert(arr[2] == 100); U24A arr2 = arr; assert(arr2[0] == 72); arr2[0] = 11; // test COW-ness assert(arr[0] == 72); assert(arr2[0] == 11); // set this to about 100M to stress-test COW memory management foreach(v; 0..10_000) func2(arr); assert(equalS(arr[], [72, 0xFE_FEFE, 100])); auto r2 = U24A(iota(0, 100)); assert(equalS(r2[], iota(0, 100)), text(r2[])); copy(iota(10, 170, 2), r2[10..90]); assert(equalS(r2[], chain(iota(0, 10), iota(10, 170, 2), iota(90, 100))) , text(r2[])); } } version(unittest) { private alias AllSets = AliasSeq!(InversionList!GcPolicy, InversionList!ReallocPolicy); } @safe unittest// core set primitives test { import std.conv; foreach(CodeList; AllSets) { CodeList a; //"plug a hole" test a.add(10, 20).add(25, 30).add(15, 27); assert(a == CodeList(10, 30), text(a)); auto x = CodeList.init; x.add(10, 20).add(30, 40).add(50, 60); a = x; a.add(20, 49);//[10, 49) [50, 60) assert(a == CodeList(10, 49, 50 ,60)); a = x; a.add(20, 50); assert(a == CodeList(10, 60), text(a)); // simple unions, mostly edge effects x = CodeList.init; x.add(10, 20).add(40, 60); a = x; a.add(10, 25); //[10, 25) [40, 60) assert(a == CodeList(10, 25, 40, 60)); a = x; a.add(5, 15); //[5, 20) [40, 60) assert(a == CodeList(5, 20, 40, 60)); a = x; a.add(0, 10); // [0, 20) [40, 60) assert(a == CodeList(0, 20, 40, 60)); a = x; a.add(0, 5); // prepand assert(a == CodeList(0, 5, 10, 20, 40, 60), text(a)); a = x; a.add(5, 20); assert(a == CodeList(5, 20, 40, 60)); a = x; a.add(3, 37); assert(a == CodeList(3, 37, 40, 60)); a = x; a.add(37, 65); assert(a == CodeList(10, 20, 37, 65)); // some tests on helpers for set intersection x = CodeList.init.add(10, 20).add(40, 60).add(100, 120); a = x; auto m = a.skipUpTo(60); a.dropUpTo(110, m); assert(a == CodeList(10, 20, 40, 60, 110, 120), text(a.data[])); a = x; a.dropUpTo(100); assert(a == CodeList(100, 120), text(a.data[])); a = x; m = a.skipUpTo(50); a.dropUpTo(140, m); assert(a == CodeList(10, 20, 40, 50), text(a.data[])); a = x; a.dropUpTo(60); assert(a == CodeList(100, 120), text(a.data[])); } } //test constructor to work with any order of intervals @safe unittest { import std.conv, std.range, std.algorithm; import std.typecons; //ensure constructor handles bad ordering and overlap auto c1 = CodepointSet('а', 'я'+1, 'А','Я'+1); foreach(ch; chain(iota('а', 'я'+1), iota('А','Я'+1))) assert(ch in c1, to!string(ch)); //contiguos assert(CodepointSet(1000, 1006, 1006, 1009) .byInterval.equal([tuple(1000, 1009)])); //contains assert(CodepointSet(900, 1200, 1000, 1100) .byInterval.equal([tuple(900, 1200)])); //intersect left assert(CodepointSet(900, 1100, 1000, 1200) .byInterval.equal([tuple(900, 1200)])); //intersect right assert(CodepointSet(1000, 1200, 900, 1100) .byInterval.equal([tuple(900, 1200)])); //ditto with extra items at end assert(CodepointSet(1000, 1200, 900, 1100, 800, 850) .byInterval.equal([tuple(800, 850), tuple(900, 1200)])); assert(CodepointSet(900, 1100, 1000, 1200, 800, 850) .byInterval.equal([tuple(800, 850), tuple(900, 1200)])); //"plug a hole" test auto c2 = CodepointSet(20, 40, 60, 80, 100, 140, 150, 200, 40, 60, 80, 100, 140, 150 ); assert(c2.byInterval.equal([tuple(20, 200)])); auto c3 = CodepointSet( 20, 40, 60, 80, 100, 140, 150, 200, 0, 10, 15, 100, 10, 20, 200, 220); assert(c3.byInterval.equal([tuple(0, 140), tuple(150, 220)])); } @safe unittest { // full set operations import std.conv; foreach(CodeList; AllSets) { CodeList a, b, c, d; //"plug a hole" a.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b.add(40, 60).add(80, 100).add(140, 150); c = a | b; d = b | a; assert(c == CodeList(20, 200), text(CodeList.stringof," ", c)); assert(c == d, text(c," vs ", d)); b = CodeList.init.add(25, 45).add(65, 85).add(95,110).add(150, 210); c = a | b; //[20,45) [60, 85) [95, 140) [150, 210) d = b | a; assert(c == CodeList(20, 45, 60, 85, 95, 140, 150, 210), text(c)); assert(c == d, text(c," vs ", d)); b = CodeList.init.add(10, 20).add(30,100).add(145,200); c = a | b;//[10, 140) [145, 200) d = b | a; assert(c == CodeList(10, 140, 145, 200)); assert(c == d, text(c," vs ", d)); b = CodeList.init.add(0, 10).add(15, 100).add(10, 20).add(200, 220); c = a | b;//[0, 140) [150, 220) d = b | a; assert(c == CodeList(0, 140, 150, 220)); assert(c == d, text(c," vs ", d)); a = CodeList.init.add(20, 40).add(60, 80); b = CodeList.init.add(25, 35).add(65, 75); c = a & b; d = b & a; assert(c == CodeList(25, 35, 65, 75), text(c)); assert(c == d, text(c," vs ", d)); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(25, 35).add(65, 75).add(110, 130).add(160, 180); c = a & b; d = b & a; assert(c == CodeList(25, 35, 65, 75, 110, 130, 160, 180), text(c)); assert(c == d, text(c," vs ", d)); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(10, 30).add(60, 120).add(135, 160); c = a & b;//[20, 30)[60, 80) [100, 120) [135, 140) [150, 160) d = b & a; assert(c == CodeList(20, 30, 60, 80, 100, 120, 135, 140, 150, 160),text(c)); assert(c == d, text(c, " vs ",d)); assert((c & a) == c); assert((d & b) == d); assert((c & d) == d); b = CodeList.init.add(40, 60).add(80, 100).add(140, 200); c = a & b; d = b & a; assert(c == CodeList(150, 200), text(c)); assert(c == d, text(c, " vs ",d)); assert((c & a) == c); assert((d & b) == d); assert((c & d) == d); assert((a & a) == a); assert((b & b) == b); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(30, 60).add(75, 120).add(190, 300); c = a - b;// [30, 40) [60, 75) [120, 140) [150, 190) d = b - a;// [40, 60) [80, 100) [200, 300) assert(c == CodeList(20, 30, 60, 75, 120, 140, 150, 190), text(c)); assert(d == CodeList(40, 60, 80, 100, 200, 300), text(d)); assert(c - d == c, text(c-d, " vs ", c)); assert(d - c == d, text(d-c, " vs ", d)); assert(c - c == CodeList.init); assert(d - d == CodeList.init); a = CodeList.init.add(20, 40).add( 60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(10, 50).add(60, 160).add(190, 300); c = a - b;// [160, 190) d = b - a;// [10, 20) [40, 50) [80, 100) [140, 150) [200, 300) assert(c == CodeList(160, 190), text(c)); assert(d == CodeList(10, 20, 40, 50, 80, 100, 140, 150, 200, 300), text(d)); assert(c - d == c, text(c-d, " vs ", c)); assert(d - c == d, text(d-c, " vs ", d)); assert(c - c == CodeList.init); assert(d - d == CodeList.init); a = CodeList.init.add(20, 40).add(60, 80).add(100, 140).add(150, 200); b = CodeList.init.add(10, 30).add(45, 100).add(130, 190); c = a ~ b; // [10, 20) [30, 40) [45, 60) [80, 130) [140, 150) [190, 200) d = b ~ a; assert(c == CodeList(10, 20, 30, 40, 45, 60, 80, 130, 140, 150, 190, 200), text(c)); assert(c == d, text(c, " vs ", d)); } } } @safe unittest// vs single dchar { import std.conv; CodepointSet a = CodepointSet(10, 100, 120, 200); assert(a - 'A' == CodepointSet(10, 65, 66, 100, 120, 200), text(a - 'A')); assert((a & 'B') == CodepointSet(66, 67)); } @safe unittest// iteration & opIndex { import std.conv; import std.typecons; foreach(CodeList; AliasSeq!(InversionList!(ReallocPolicy))) { auto arr = "ABCDEFGHIJKLMabcdefghijklm"d; auto a = CodeList('A','N','a', 'n'); assert(equalS(a.byInterval, [tuple(cast(uint)'A', cast(uint)'N'), tuple(cast(uint)'a', cast(uint)'n')] ), text(a.byInterval)); // same @@@BUG as in issue 8949 ? version(bug8949) { assert(equalS(retro(a.byInterval), [tuple(cast(uint)'a', cast(uint)'n'), tuple(cast(uint)'A', cast(uint)'N')] ), text(retro(a.byInterval))); } auto achr = a.byCodepoint; assert(equalS(achr, arr), text(a.byCodepoint)); foreach(ch; a.byCodepoint) assert(a[ch]); auto x = CodeList(100, 500, 600, 900, 1200, 1500); assert(equalS(x.byInterval, [ tuple(100, 500), tuple(600, 900), tuple(1200, 1500)]), text(x.byInterval)); foreach(ch; x.byCodepoint) assert(x[ch]); static if(is(CodeList == CodepointSet)) { auto y = CodeList(x.byInterval); assert(equalS(x.byInterval, y.byInterval)); } assert(equalS(CodepointSet.init.byInterval, cast(Tuple!(uint, uint)[])[])); assert(equalS(CodepointSet.init.byCodepoint, cast(dchar[])[])); } } //============================================================================ // Generic Trie template and various ways to build it //============================================================================ // debug helper to get a shortened array dump auto arrayRepr(T)(T x) { import std.conv : text; if(x.length > 32) { return text(x[0..16],"~...~", x[x.length-16..x.length]); } else return text(x); } /** Maps $(D Key) to a suitable integer index within the range of $(D size_t). The mapping is constructed by applying predicates from $(D Prefix) left to right and concatenating the resulting bits. The first (leftmost) predicate defines the most significant bits of the resulting index. */ template mapTrieIndex(Prefix...) { size_t mapTrieIndex(Key)(Key key) if(isValidPrefixForTrie!(Key, Prefix)) { alias p = Prefix; size_t idx; foreach(i, v; p[0..$-1]) { idx |= p[i](key); idx <<= p[i+1].bitSize; } idx |= p[$-1](key); return idx; } } /* $(D TrieBuilder) is a type used for incremental construction of $(LREF Trie)s. See $(LREF buildTrie) for generic helpers built on top of it. */ @trusted struct TrieBuilder(Value, Key, Args...) if(isBitPackableType!Value && isValidArgsForTrie!(Key, Args)) { import std.exception : enforce; private: // last index is not stored in table, it is used as an offset to values in a block. static if(is(Value == bool))// always pack bool alias V = BitPacked!(Value, 1); else alias V = Value; static auto deduceMaxIndex(Preds...)() { size_t idx = 1; foreach(v; Preds) idx *= 2^^v.bitSize; return idx; } static if(is(typeof(Args[0]) : Key)) // Args start with upper bound on Key { alias Prefix = Args[1..$]; enum lastPageSize = 2^^Prefix[$-1].bitSize; enum translatedMaxIndex = mapTrieIndex!(Prefix)(Args[0]); enum roughedMaxIndex = (translatedMaxIndex + lastPageSize-1)/lastPageSize*lastPageSize; // check warp around - if wrapped, use the default deduction rule enum maxIndex = roughedMaxIndex < translatedMaxIndex ? deduceMaxIndex!(Prefix)() : roughedMaxIndex; } else { alias Prefix = Args; enum maxIndex = deduceMaxIndex!(Prefix)(); } alias getIndex = mapTrieIndex!(Prefix); enum lastLevel = Prefix.length-1; struct ConstructState { size_t idx_zeros, idx_ones; } // iteration over levels of Trie, each indexes its own level and thus a shortened domain size_t[Prefix.length] indices; // default filler value to use Value defValue; // this is a full-width index of next item size_t curIndex; // all-zeros page index, all-ones page index (+ indicator if there is such a page) ConstructState[Prefix.length] state; // the table being constructed MultiArray!(idxTypes!(Key, fullBitSize!(Prefix), Prefix[0..$]), V) table; @disable this(); //shortcut for index variable at level 'level' @property ref idx(size_t level)(){ return indices[level]; } // this function assumes no holes in the input so // indices are going one by one void addValue(size_t level, T)(T val, size_t numVals) { alias j = idx!level; enum pageSize = 1<<Prefix[level].bitSize; if(numVals == 0) return; auto ptr = table.slice!(level); if(numVals == 1) { static if(level == Prefix.length-1) ptr[j] = val; else {// can incur narrowing conversion assert(j < ptr.length); ptr[j] = force!(typeof(ptr[j]))(val); } j++; if(j % pageSize == 0) spillToNextPage!level(ptr); return; } // longer row of values // get to the next page boundary size_t nextPB = (j + pageSize) & ~(pageSize-1); size_t n = nextPB - j;// can fill right in this page if(numVals < n) //fits in current page { ptr[j..j+numVals] = val; j += numVals; return; } static if(level != 0)//on the first level it always fits { numVals -= n; //write till the end of current page ptr[j..j+n] = val; j += n; //spill to the next page spillToNextPage!level(ptr); // page at once loop if(state[level].idx_zeros != size_t.max && val == T.init) { alias NextIdx = typeof(table.slice!(level-1)[0]); addValue!(level-1)(force!NextIdx(state[level].idx_zeros), numVals/pageSize); ptr = table.slice!level; //table structure might have changed numVals %= pageSize; } else { while(numVals >= pageSize) { numVals -= pageSize; ptr[j..j+pageSize] = val; j += pageSize; spillToNextPage!level(ptr); } } if(numVals) { // the leftovers, an incomplete page ptr[j..j+numVals] = val; j += numVals; } } } void spillToNextPage(size_t level, Slice)(ref Slice ptr) { // last level (i.e. topmost) has 1 "page" // thus it need not to add a new page on upper level static if(level != 0) spillToNextPageImpl!(level)(ptr); } // this can re-use the current page if duplicate or allocate a new one // it also makes sure that previous levels point to the correct page in this level void spillToNextPageImpl(size_t level, Slice)(ref Slice ptr) { alias NextIdx = typeof(table.slice!(level-1)[0]); NextIdx next_lvl_index; enum pageSize = 1<<Prefix[level].bitSize; assert(idx!level % pageSize == 0); auto last = idx!level-pageSize; auto slice = ptr[idx!level - pageSize..idx!level]; size_t j; for(j=0; j<last; j+=pageSize) { if(ptr[j..j+pageSize] == slice) { // get index to it, reuse ptr space for the next block next_lvl_index = force!NextIdx(j/pageSize); version(none) { writefln("LEVEL(%s) page maped idx: %s: 0..%s ---> [%s..%s]" ,level ,indices[level-1], pageSize, j, j+pageSize); writeln("LEVEL(", level , ") mapped page is: ", slice, ": ", arrayRepr(ptr[j..j+pageSize])); writeln("LEVEL(", level , ") src page is :", ptr, ": ", arrayRepr(slice[0..pageSize])); } idx!level -= pageSize; // reuse this page, it is duplicate break; } } if(j == last) { L_allocate_page: next_lvl_index = force!NextIdx(idx!level/pageSize - 1); if(state[level].idx_zeros == size_t.max && ptr.zeros(j, j+pageSize)) { state[level].idx_zeros = next_lvl_index; } // allocate next page version(none) { writefln("LEVEL(%s) page allocated: %s" , level, arrayRepr(slice[0..pageSize])); writefln("LEVEL(%s) index: %s ; page at this index %s" , level , next_lvl_index , arrayRepr( table.slice!(level) [pageSize*next_lvl_index..(next_lvl_index+1)*pageSize] )); } table.length!level = table.length!level + pageSize; } L_know_index: // for the previous level, values are indices to the pages in the current level addValue!(level-1)(next_lvl_index, 1); ptr = table.slice!level; //re-load the slice after moves } // idx - full-width index to fill with v (full-width index != key) // fills everything in the range of [curIndex, idx) with filler void putAt(size_t idx, Value v) { assert(idx >= curIndex); size_t numFillers = idx - curIndex; addValue!lastLevel(defValue, numFillers); addValue!lastLevel(v, 1); curIndex = idx + 1; } // ditto, but sets the range of [idxA, idxB) to v void putRangeAt(size_t idxA, size_t idxB, Value v) { assert(idxA >= curIndex); assert(idxB >= idxA); size_t numFillers = idxA - curIndex; addValue!lastLevel(defValue, numFillers); addValue!lastLevel(v, idxB - idxA); curIndex = idxB; // open-right } enum errMsg = "non-monotonic prefix function(s), an unsorted range or "~ "duplicate key->value mapping"; public: /** Construct a builder, where $(D filler) is a value to indicate empty slots (or "not found" condition). */ this(Value filler) { curIndex = 0; defValue = filler; // zeros-page index, ones-page index foreach(ref v; state) v = ConstructState(size_t.max, size_t.max); table = typeof(table)(indices); // one page per level is a bootstrap minimum foreach(i, Pred; Prefix) table.length!i = (1<<Pred.bitSize); } /** Put a value $(D v) into interval as mapped by keys from $(D a) to $(D b). All slots prior to $(D a) are filled with the default filler. */ void putRange(Key a, Key b, Value v) { auto idxA = getIndex(a), idxB = getIndex(b); // indexes of key should always grow enforce(idxB >= idxA && idxA >= curIndex, errMsg); putRangeAt(idxA, idxB, v); } /** Put a value $(D v) into slot mapped by $(D key). All slots prior to $(D key) are filled with the default filler. */ void putValue(Key key, Value v) { import std.conv : text; auto idx = getIndex(key); enforce(idx >= curIndex, text(errMsg, " ", idx)); putAt(idx, v); } /// Finishes construction of Trie, yielding an immutable Trie instance. auto build() { static if(maxIndex != 0) // doesn't cover full range of size_t { assert(curIndex <= maxIndex); addValue!lastLevel(defValue, maxIndex - curIndex); } else { if(curIndex != 0 // couldn't wrap around || (Prefix.length != 1 && indices[lastLevel] == 0)) // can be just empty { addValue!lastLevel(defValue, size_t.max - curIndex); addValue!lastLevel(defValue, 1); } // else curIndex already completed the full range of size_t by wrapping around } return Trie!(V, Key, maxIndex, Prefix)(table); } } /* $(P A generic Trie data-structure for a fixed number of stages. The design goal is optimal speed with smallest footprint size. ) $(P It's intentionally read-only and doesn't provide constructors. To construct one use a special builder, see $(LREF TrieBuilder) and $(LREF buildTrie). ) */ @trusted public struct Trie(Value, Key, Args...) if(isValidPrefixForTrie!(Key, Args) || (isValidPrefixForTrie!(Key, Args[1..$]) && is(typeof(Args[0]) : size_t))) { static if(is(typeof(Args[0]) : size_t)) { enum maxIndex = Args[0]; enum hasBoundsCheck = true; alias Prefix = Args[1..$]; } else { enum hasBoundsCheck = false; alias Prefix = Args; } private this()(typeof(_table) table) { _table = table; } // only for constant Tries constructed from precompiled tables private this()(const(size_t)[] offsets, const(size_t)[] sizes, const(size_t)[] data) const { _table = typeof(_table)(offsets, sizes, data); } /* $(P Lookup the $(D key) in this $(D Trie). ) $(P The lookup always succeeds if key fits the domain provided during construction. The whole domain defined is covered so instead of not found condition the sentinel (filler) value could be used. ) $(P See $(LREF buildTrie), $(LREF TrieBuilder) for how to define a domain of $(D Trie) keys and the sentinel value. ) Note: Domain range-checking is only enabled in debug builds and results in assertion failure. */ // templated to auto-detect pure, @safe and nothrow TypeOfBitPacked!Value opIndex()(Key key) const { static if(hasBoundsCheck) assert(mapTrieIndex!Prefix(key) < maxIndex); size_t idx; alias p = Prefix; idx = cast(size_t)p[0](key); foreach(i, v; p[0..$-1]) idx = cast(size_t)((_table.ptr!i[idx]<<p[i+1].bitSize) + p[i+1](key)); return _table.ptr!(p.length-1)[idx]; } @property size_t bytes(size_t n=size_t.max)() const { return _table.bytes!n; } @property size_t pages(size_t n)() const { return (bytes!n+2^^(Prefix[n].bitSize-1)) /2^^Prefix[n].bitSize; } void store(OutRange)(scope OutRange sink) const if(isOutputRange!(OutRange, char)) { _table.store(sink); } private: MultiArray!(idxTypes!(Key, fullBitSize!(Prefix), Prefix[0..$]), Value) _table; } // create a tuple of 'sliceBits' that slice the 'top' of bits into pieces of sizes 'sizes' // left-to-right, the most significant bits first template GetBitSlicing(size_t top, sizes...) { static if(sizes.length > 0) alias GetBitSlicing = AliasSeq!(sliceBits!(top - sizes[0], top), GetBitSlicing!(top - sizes[0], sizes[1..$])); else alias GetBitSlicing = AliasSeq!(); } template callableWith(T) { template callableWith(alias Pred) { static if(!is(typeof(Pred(T.init)))) enum callableWith = false; else { alias Result = typeof(Pred(T.init)); enum callableWith = isBitPackableType!(TypeOfBitPacked!(Result)); } } } /* Check if $(D Prefix) is a valid set of predicates for $(D Trie) template having $(D Key) as the type of keys. This requires all predicates to be callable, take single argument of type $(D Key) and return unsigned value. */ template isValidPrefixForTrie(Key, Prefix...) { enum isValidPrefixForTrie = allSatisfy!(callableWith!Key, Prefix); // TODO: tighten the screws } /* Check if $(D Args) is a set of maximum key value followed by valid predicates for $(D Trie) template having $(D Key) as the type of keys. */ template isValidArgsForTrie(Key, Args...) { static if(Args.length > 1) { enum isValidArgsForTrie = isValidPrefixForTrie!(Key, Args) || (isValidPrefixForTrie!(Key, Args[1..$]) && is(typeof(Args[0]) : Key)); } else enum isValidArgsForTrie = isValidPrefixForTrie!Args; } @property size_t sumOfIntegerTuple(ints...)() { size_t count=0; foreach(v; ints) count += v; return count; } /** A shorthand for creating a custom multi-level fixed Trie from a $(D CodepointSet). $(D sizes) are numbers of bits per level, with the most significant bits used first. Note: The sum of $(D sizes) must be equal 21. See_Also: $(LREF toTrie), which is even simpler. Example: --- { import std.stdio; auto set = unicode("Number"); auto trie = codepointSetTrie!(8, 5, 8)(set); writeln("Input code points to test:"); foreach(line; stdin.byLine) { int count=0; foreach(dchar ch; line) if(trie[ch])// is number count++; writefln("Contains %d number code points.", count); } } --- */ public template codepointSetTrie(sizes...) if(sumOfIntegerTuple!sizes == 21) { auto codepointSetTrie(Set)(Set set) if(isCodepointSet!Set) { auto builder = TrieBuilder!(bool, dchar, lastDchar+1, GetBitSlicing!(21, sizes))(false); foreach(ival; set.byInterval) builder.putRange(ival[0], ival[1], true); return builder.build(); } } /// Type of Trie generated by codepointSetTrie function. public template CodepointSetTrie(sizes...) if(sumOfIntegerTuple!sizes == 21) { alias Prefix = GetBitSlicing!(21, sizes); alias CodepointSetTrie = typeof(TrieBuilder!(bool, dchar, lastDchar+1, Prefix)(false).build()); } /** A slightly more general tool for building fixed $(D Trie) for the Unicode data. Specifically unlike $(D codepointSetTrie) it's allows creating mappings of $(D dchar) to an arbitrary type $(D T). Note: Overload taking $(D CodepointSet)s will naturally convert only to bool mapping $(D Trie)s. */ public template codepointTrie(T, sizes...) if(sumOfIntegerTuple!sizes == 21) { alias Prefix = GetBitSlicing!(21, sizes); static if(is(TypeOfBitPacked!T == bool)) { auto codepointTrie(Set)(in Set set) if(isCodepointSet!Set) { return codepointSetTrie(set); } } auto codepointTrie()(T[dchar] map, T defValue=T.init) { return buildTrie!(T, dchar, Prefix)(map, defValue); } // unsorted range of pairs auto codepointTrie(R)(R range, T defValue=T.init) if(isInputRange!R && is(typeof(ElementType!R.init[0]) : T) && is(typeof(ElementType!R.init[1]) : dchar)) { // build from unsorted array of pairs // TODO: expose index sorting functions for Trie return buildTrie!(T, dchar, Prefix)(range, defValue, true); } } /// pure unittest { import std.algorithm.comparison : max; import std.algorithm.searching : count; // pick characters from the Greek script auto set = unicode.Greek; // a user-defined property (or an expensive function) // that we want to look up static uint luckFactor(dchar ch) { // here we consider a character lucky // if its code point has a lot of identical hex-digits // e.g. arabic letter DDAL (\u0688) has a "luck factor" of 2 ubyte[6] nibbles; // 6 4-bit chunks of code point uint value = ch; foreach(i; 0..6) { nibbles[i] = value & 0xF; value >>= 4; } uint luck; foreach(n; nibbles) luck = cast(uint)max(luck, count(nibbles[], n)); return luck; } // only unsigned built-ins are supported at the moment alias LuckFactor = BitPacked!(uint, 3); // create a temporary associative array (AA) LuckFactor[dchar] map; foreach(ch; set.byCodepoint) map[ch] = LuckFactor(luckFactor(ch)); // bits per stage are chosen randomly, fell free to optimize auto trie = codepointTrie!(LuckFactor, 8, 5, 8)(map); // from now on the AA is not needed foreach(ch; set.byCodepoint) assert(trie[ch] == luckFactor(ch)); // verify // CJK is not Greek, thus it has the default value assert(trie['\u4444'] == 0); // and here is a couple of quite lucky Greek characters: // Greek small letter epsilon with dasia assert(trie['\u1F11'] == 3); // Ancient Greek metretes sign assert(trie['\U00010181'] == 3); } /// Type of Trie as generated by codepointTrie function. public template CodepointTrie(T, sizes...) if(sumOfIntegerTuple!sizes == 21) { alias Prefix = GetBitSlicing!(21, sizes); alias CodepointTrie = typeof(TrieBuilder!(T, dchar, lastDchar+1, Prefix)(T.init).build()); } // @@@BUG multiSort can's access private symbols from uni public template cmpK0(alias Pred) { import std.typecons; static bool cmpK0(Value, Key) (Tuple!(Value, Key) a, Tuple!(Value, Key) b) { return Pred(a[1]) < Pred(b[1]); } } /* The most general utility for construction of $(D Trie)s short of using $(D TrieBuilder) directly. Provides a number of convenience overloads. $(D Args) is tuple of maximum key value followed by predicates to construct index from key. Alternatively if the first argument is not a value convertible to $(D Key) then the whole tuple of $(D Args) is treated as predicates and the maximum Key is deduced from predicates. */ public template buildTrie(Value, Key, Args...) if(isValidArgsForTrie!(Key, Args)) { static if(is(typeof(Args[0]) : Key)) // prefix starts with upper bound on Key { alias Prefix = Args[1..$]; } else alias Prefix = Args; alias getIndex = mapTrieIndex!(Prefix); // for multi-sort template GetComparators(size_t n) { static if(n > 0) alias GetComparators = AliasSeq!(GetComparators!(n-1), cmpK0!(Prefix[n-1])); else alias GetComparators = AliasSeq!(); } /* Build $(D Trie) from a range of a Key-Value pairs, assuming it is sorted by Key as defined by the following lambda: ------ (a, b) => mapTrieIndex!(Prefix)(a) < mapTrieIndex!(Prefix)(b) ------ Exception is thrown if it's detected that the above order doesn't hold. In other words $(LREF mapTrieIndex) should be a monotonically increasing function that maps $(D Key) to an integer. See_Also: $(XREF _algorithm, sort), $(XREF _range, SortedRange), $(XREF _algorithm, setUnion). */ auto buildTrie(Range)(Range range, Value filler=Value.init) if(isInputRange!Range && is(typeof(Range.init.front[0]) : Value) && is(typeof(Range.init.front[1]) : Key)) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(v; range) builder.putValue(v[1], v[0]); return builder.build(); } /* If $(D Value) is bool (or BitPacked!(bool, x)) then it's possible to build $(D Trie) from a range of open-right intervals of $(D Key)s. The requirement on the ordering of keys (and the behavior on the violation of it) is the same as for Key-Value range overload. Intervals denote ranges of !$(D filler) i.e. the opposite of filler. If no filler provided keys inside of the intervals map to true, and $(D filler) is false. */ auto buildTrie(Range)(Range range, Value filler=Value.init) if(is(TypeOfBitPacked!Value == bool) && isInputRange!Range && is(typeof(Range.init.front[0]) : Key) && is(typeof(Range.init.front[1]) : Key)) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(ival; range) builder.putRange(ival[0], ival[1], !filler); return builder.build(); } auto buildTrie(Range)(Range range, Value filler, bool unsorted) if(isInputRange!Range && is(typeof(Range.init.front[0]) : Value) && is(typeof(Range.init.front[1]) : Key)) { import std.algorithm : multiSort; alias Comps = GetComparators!(Prefix.length); if(unsorted) multiSort!(Comps)(range); return buildTrie(range, filler); } /* If $(D Value) is bool (or BitPacked!(bool, x)) then it's possible to build $(D Trie) simply from an input range of $(D Key)s. The requirement on the ordering of keys (and the behavior on the violation of it) is the same as for Key-Value range overload. Keys found in range denote !$(D filler) i.e. the opposite of filler. If no filler provided keys map to true, and $(D filler) is false. */ auto buildTrie(Range)(Range range, Value filler=Value.init) if(is(TypeOfBitPacked!Value == bool) && isInputRange!Range && is(typeof(Range.init.front) : Key)) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(v; range) builder.putValue(v, !filler); return builder.build(); } /* If $(D Key) is unsigned integer $(D Trie) could be constructed from array of values where array index serves as key. */ auto buildTrie()(Value[] array, Value filler=Value.init) if(isUnsigned!Key) { auto builder = TrieBuilder!(Value, Key, Prefix)(filler); foreach(idx, v; array) builder.putValue(idx, v); return builder.build(); } /* Builds $(D Trie) from associative array. */ auto buildTrie(Key, Value)(Value[Key] map, Value filler=Value.init) { import std.range : zip, array; auto range = array(zip(map.values, map.keys)); return buildTrie(range, filler, true); // sort it } } // helper in place of assumeSize to //reduce mangled name & help DMD inline Trie functors struct clamp(size_t bits) { static size_t opCall(T)(T arg){ return arg; } enum bitSize = bits; } struct clampIdx(size_t idx, size_t bits) { static size_t opCall(T)(T arg){ return arg[idx]; } enum bitSize = bits; } /** Conceptual type that outlines the common properties of all UTF Matchers. Note: For illustration purposes only, every method call results in assertion failure. Use $(LREF utfMatcher) to obtain a concrete matcher for UTF-8 or UTF-16 encodings. */ public struct MatcherConcept { /** $(P Perform a semantic equivalent 2 operations: decoding a $(CODEPOINT) at front of $(D inp) and testing if it belongs to the set of $(CODEPOINTS) of this matcher. ) $(P The effect on $(D inp) depends on the kind of function called:) $(P Match. If the codepoint is found in the set then range $(D inp) is advanced by its size in $(S_LINK Code unit, code units), otherwise the range is not modifed.) $(P Skip. The range is always advanced by the size of the tested $(CODEPOINT) regardless of the result of test.) $(P Test. The range is left unaffected regardless of the result of test.) */ public bool match(Range)(ref Range inp) if(isRandomAccessRange!Range && is(ElementType!Range : char)) { assert(false); } ///ditto public bool skip(Range)(ref Range inp) if(isRandomAccessRange!Range && is(ElementType!Range : char)) { assert(false); } ///ditto public bool test(Range)(ref Range inp) if(isRandomAccessRange!Range && is(ElementType!Range : char)) { assert(false); } /// @safe unittest { string truth = "2² = 4"; auto m = utfMatcher!char(unicode.Number); assert(m.match(truth)); // '2' is a number all right assert(truth == "² = 4"); // skips on match assert(m.match(truth)); // so is the superscript '2' assert(!m.match(truth)); // space is not a number assert(truth == " = 4"); // unaffected on no match assert(!m.skip(truth)); // same test ... assert(truth == "= 4"); // but skips a codepoint regardless assert(!m.test(truth)); // '=' is not a number assert(truth == "= 4"); // test never affects argument } /* Advanced feature - provide direct access to a subset of matcher based a set of known encoding lengths. Lengths are provided in $(S_LINK Code unit, code units). The sub-matcher then may do less operations per any $(D test)/$(D match). Use with care as the sub-matcher won't match any $(CODEPOINTS) that have encoded length that doesn't belong to the selected set of lengths. Also the sub-matcher object references the parent matcher and must not be used past the liftetime of the latter. Another caveat of using sub-matcher is that skip is not available preciesly because sub-matcher doesn't detect all lengths. */ @property auto subMatcher(Lengths...)() { assert(0); return this; } /// @safe unittest { auto m = utfMatcher!char(unicode.Number); string square = "2²"; // about sub-matchers assert(!m.subMatcher!(2,3,4).test(square)); // ASCII no covered assert(m.subMatcher!1.match(square)); // ASCII-only, works assert(!m.subMatcher!1.test(square)); // unicode '²' assert(m.subMatcher!(2,3,4).match(square)); // assert(square == ""); wstring wsquare = "2²"; auto m16 = utfMatcher!wchar(unicode.Number); // may keep ref, but the orignal (m16) must be kept alive auto bmp = m16.subMatcher!1; assert(bmp.match(wsquare)); // Okay, in basic multilingual plan assert(bmp.match(wsquare)); // And '²' too } } /** Test if $(D M) is an UTF Matcher for ranges of $(D Char). */ public enum isUtfMatcher(M, C) = __traits(compiles, (){ C[] s; auto d = s.decoder; M m; assert(is(typeof(m.match(d)) == bool)); assert(is(typeof(m.test(d)) == bool)); static if(is(typeof(m.skip(d)))) { assert(is(typeof(m.skip(d)) == bool)); assert(is(typeof(m.skip(s)) == bool)); } assert(is(typeof(m.match(s)) == bool)); assert(is(typeof(m.test(s)) == bool)); }); unittest { alias CharMatcher = typeof(utfMatcher!char(CodepointSet.init)); alias WcharMatcher = typeof(utfMatcher!wchar(CodepointSet.init)); static assert(isUtfMatcher!(CharMatcher, char)); static assert(isUtfMatcher!(CharMatcher, immutable(char))); static assert(isUtfMatcher!(WcharMatcher, wchar)); static assert(isUtfMatcher!(WcharMatcher, immutable(wchar))); } enum Mode { alwaysSkip, neverSkip, skipOnMatch } mixin template ForwardStrings() { private bool fwdStr(string fn, C)(ref C[] str) const pure { alias type = typeof(units(str)); return mixin(fn~"(*cast(type*)&str)"); } } template Utf8Matcher() { enum validSize(int sz) = sz >= 1 && sz <=4; void badEncoding() pure @safe { import std.utf; throw new UTFException("Invalid UTF-8 sequence"); } //for 1-stage ASCII alias AsciiSpec = AliasSeq!(bool, char, clamp!7); //for 2-stage lookup of 2 byte UTF-8 sequences alias Utf8Spec2 = AliasSeq!(bool, char[2], clampIdx!(0, 5), clampIdx!(1, 6)); //ditto for 3 byte alias Utf8Spec3 = AliasSeq!(bool, char[3], clampIdx!(0, 4), clampIdx!(1, 6), clampIdx!(2, 6) ); //ditto for 4 byte alias Utf8Spec4 = AliasSeq!(bool, char[4], clampIdx!(0, 3), clampIdx!(1, 6), clampIdx!(2, 6), clampIdx!(3, 6) ); alias Tables = AliasSeq!( typeof(TrieBuilder!(AsciiSpec)(false).build()), typeof(TrieBuilder!(Utf8Spec2)(false).build()), typeof(TrieBuilder!(Utf8Spec3)(false).build()), typeof(TrieBuilder!(Utf8Spec4)(false).build()) ); alias Table(int size) = Tables[size-1]; enum leadMask(size_t size) = (cast(size_t)1<<(7 - size))-1; enum encMask(size_t size) = ((1<<size)-1)<<(8-size); char truncate()(char ch) pure @safe { ch -= 0x80; if (ch < 0x40) { return ch; } else { badEncoding(); return cast(char)0; } } static auto encode(size_t sz)(dchar ch) if(sz > 1) { import std.utf : encode; char[4] buf; std.utf.encode(buf, ch); char[sz] ret; buf[0] &= leadMask!sz; foreach(n; 1..sz) buf[n] = buf[n] & 0x3f; //keep 6 lower bits ret[] = buf[0..sz]; return ret; } auto build(Set)(Set set) { import std.algorithm : map; auto ascii = set & unicode.ASCII; auto utf8_2 = set & CodepointSet(0x80, 0x800); auto utf8_3 = set & CodepointSet(0x800, 0x1_0000); auto utf8_4 = set & CodepointSet(0x1_0000, lastDchar+1); auto asciiT = ascii.byCodepoint.map!(x=>cast(char)x).buildTrie!(AsciiSpec); auto utf8_2T = utf8_2.byCodepoint.map!(x=>encode!2(x)).buildTrie!(Utf8Spec2); auto utf8_3T = utf8_3.byCodepoint.map!(x=>encode!3(x)).buildTrie!(Utf8Spec3); auto utf8_4T = utf8_4.byCodepoint.map!(x=>encode!4(x)).buildTrie!(Utf8Spec4); alias Ret = Impl!(1,2,3,4); return Ret(asciiT, utf8_2T, utf8_3T, utf8_4T); } // Bootstrap UTF-8 static matcher interface // from 3 primitives: tab!(size), lookup and Sizes mixin template DefMatcher() { import std.format : format; enum hasASCII = staticIndexOf!(1, Sizes) >= 0; alias UniSizes = Erase!(1, Sizes); //generate dispatch code sequence for unicode parts static auto genDispatch() { string code; foreach(size; UniSizes) code ~= format(q{ if ((ch & ~leadMask!%d) == encMask!(%d)) return lookup!(%d, mode)(inp); else }, size, size, size); static if (Sizes.length == 4) //covers all code unit cases code ~= "{ badEncoding(); return false; }"; else code ~= "return false;"; //may be just fine but not covered return code; } enum dispatch = genDispatch(); public bool match(Range)(ref Range inp) const pure @trusted if(isRandomAccessRange!Range && is(ElementType!Range : char)) { enum mode = Mode.skipOnMatch; assert(!inp.empty); auto ch = inp[0]; static if(hasASCII) { if (ch < 0x80) { bool r = tab!1[ch]; if(r) inp.popFront(); return r; } else mixin(dispatch); } else mixin(dispatch); } static if(Sizes.length == 4) // can skip iff can detect all encodings { public bool skip(Range)(ref Range inp) const pure @trusted if(isRandomAccessRange!Range && is(ElementType!Range : char)) { enum mode = Mode.alwaysSkip; assert(!inp.empty); auto ch = inp[0]; static if(hasASCII) { if (ch < 0x80) { inp.popFront(); return tab!1[ch]; } else mixin(dispatch); } else mixin(dispatch); } } public bool test(Range)(ref Range inp) const pure @trusted if(isRandomAccessRange!Range && is(ElementType!Range : char)) { enum mode = Mode.neverSkip; assert(!inp.empty); auto ch = inp[0]; static if(hasASCII) { if (ch < 0x80) return tab!1[ch]; else mixin(dispatch); } else mixin(dispatch); } bool match(C)(ref C[] str) const pure @trusted if(isSomeChar!C) { return fwdStr!"match"(str); } bool skip(C)(ref C[] str) const pure @trusted if(isSomeChar!C) { return fwdStr!"skip"(str); } bool test(C)(ref C[] str) const pure @trusted if(isSomeChar!C) { return fwdStr!"test"(str); } mixin ForwardStrings; } struct Impl(Sizes...) { static assert(allSatisfy!(validSize, Sizes), "Only lengths of 1, 2, 3 and 4 code unit are possible for UTF-8"); private: //pick tables for chosen sizes alias OurTabs = staticMap!(Table, Sizes); OurTabs tables; mixin DefMatcher; //static disptach helper UTF size ==> table alias tab(int i) = tables[i - 1]; package @property auto subMatcher(SizesToPick...)() @trusted { return CherryPick!(Impl, SizesToPick)(&this); } bool lookup(int size, Mode mode, Range)(ref Range inp) const pure @trusted { import std.typecons; if(inp.length < size) { badEncoding(); return false; } char[size] needle = void; needle[0] = leadMask!size & inp[0]; foreach(i; staticIota!(1, size)) { needle[i] = truncate(inp[i]); } //overlong encoding checks static if(size == 2) { //0x80-0x7FF //got 6 bits in needle[1], must use at least 8 bits //must use at least 2 bits in needle[1] if(needle[0] < 2) badEncoding(); } else static if(size == 3) { //0x800-0xFFFF //got 6 bits in needle[2], must use at least 12bits //must use 6 bits in needle[1] or anything in needle[0] if(needle[0] == 0 && needle[1] < 0x20) badEncoding(); } else static if(size == 4) { //0x800-0xFFFF //got 2x6=12 bits in needle[2..3] must use at least 17bits //must use 5 bits (or above) in needle[1] or anything in needle[0] if(needle[0] == 0 && needle[1] < 0x10) badEncoding(); } static if(mode == Mode.alwaysSkip) { inp.popFrontN(size); return tab!size[needle]; } else static if(mode == Mode.neverSkip) { return tab!size[needle]; } else { static assert(mode == Mode.skipOnMatch); if (tab!size[needle]) { inp.popFrontN(size); return true; } else return false; } } } struct CherryPick(I, Sizes...) { static assert(allSatisfy!(validSize, Sizes), "Only lengths of 1, 2, 3 and 4 code unit are possible for UTF-8"); private: I* m; @property ref tab(int i)() const pure { return m.tables[i - 1]; } bool lookup(int size, Mode mode, Range)(ref Range inp) const pure { return m.lookup!(size, mode)(inp); } mixin DefMatcher; } } template Utf16Matcher() { enum validSize(int sz) = sz >= 1 && sz <=2; void badEncoding() pure { import std.utf; throw new UTFException("Invalid UTF-16 sequence"); } // 1-stage ASCII alias AsciiSpec = AliasSeq!(bool, wchar, clamp!7); //2-stage BMP alias BmpSpec = AliasSeq!(bool, wchar, sliceBits!(7, 16), sliceBits!(0, 7)); //4-stage - full Unicode //assume that 0xD800 & 0xDC00 bits are cleared //thus leaving 10 bit per wchar to worry about alias UniSpec = AliasSeq!(bool, wchar[2], assumeSize!(x=>x[0]>>4, 6), assumeSize!(x=>x[0]&0xf, 4), assumeSize!(x=>x[1]>>6, 4), assumeSize!(x=>x[1]&0x3f, 6), ); alias Ascii = typeof(TrieBuilder!(AsciiSpec)(false).build()); alias Bmp = typeof(TrieBuilder!(BmpSpec)(false).build()); alias Uni = typeof(TrieBuilder!(UniSpec)(false).build()); auto encode2(dchar ch) { ch -= 0x1_0000; assert(ch <= 0xF_FFFF); wchar[2] ret; //do not put surrogate bits, they are sliced off ret[0] = cast(wchar)(ch>>10); ret[1] = (ch & 0xFFF); return ret; } auto build(Set)(Set set) { import std.algorithm : map; auto ascii = set & unicode.ASCII; auto bmp = (set & CodepointSet.fromIntervals(0x80, 0xFFFF+1)) - CodepointSet.fromIntervals(0xD800, 0xDFFF+1); auto other = set - (bmp | ascii); auto asciiT = ascii.byCodepoint.map!(x=>cast(char)x).buildTrie!(AsciiSpec); auto bmpT = bmp.byCodepoint.map!(x=>cast(wchar)x).buildTrie!(BmpSpec); auto otherT = other.byCodepoint.map!(x=>encode2(x)).buildTrie!(UniSpec); alias Ret = Impl!(1,2); return Ret(asciiT, bmpT, otherT); } //bootstrap full UTF-16 matcher interace from //sizeFlags, lookupUni and ascii mixin template DefMatcher() { public bool match(Range)(ref Range inp) const pure @trusted if(isRandomAccessRange!Range && is(ElementType!Range : wchar)) { enum mode = Mode.skipOnMatch; assert(!inp.empty); auto ch = inp[0]; static if(sizeFlags & 1) { if (ch < 0x80) { if (ascii[ch]) { inp.popFront(); return true; } else return false; } return lookupUni!mode(inp); } else return lookupUni!mode(inp); } static if(Sizes.length == 2) { public bool skip(Range)(ref Range inp) const pure @trusted if(isRandomAccessRange!Range && is(ElementType!Range : wchar)) { enum mode = Mode.alwaysSkip; assert(!inp.empty); auto ch = inp[0]; static if(sizeFlags & 1) { if (ch < 0x80) { inp.popFront(); return ascii[ch]; } else return lookupUni!mode(inp); } else return lookupUni!mode(inp); } } public bool test(Range)(ref Range inp) const pure @trusted if(isRandomAccessRange!Range && is(ElementType!Range : wchar)) { enum mode = Mode.neverSkip; assert(!inp.empty); auto ch = inp[0]; static if(sizeFlags & 1) return ch < 0x80 ? ascii[ch] : lookupUni!mode(inp); else return lookupUni!mode(inp); } bool match(C)(ref C[] str) const pure @trusted if(isSomeChar!C) { return fwdStr!"match"(str); } bool skip(C)(ref C[] str) const pure @trusted if(isSomeChar!C) { return fwdStr!"skip"(str); } bool test(C)(ref C[] str) const pure @trusted if(isSomeChar!C) { return fwdStr!"test"(str); } mixin ForwardStrings; //dispatch strings to range versions } struct Impl(Sizes...) if(Sizes.length >= 1 && Sizes.length <= 2) { private: static assert(allSatisfy!(validSize, Sizes), "Only lengths of 1 and 2 code units are possible in UTF-16"); static if(Sizes.length > 1) enum sizeFlags = Sizes[0] | Sizes[1]; else enum sizeFlags = Sizes[0]; static if(sizeFlags & 1) { Ascii ascii; Bmp bmp; } static if(sizeFlags & 2) { Uni uni; } mixin DefMatcher; package @property auto subMatcher(SizesToPick...)() @trusted { return CherryPick!(Impl, SizesToPick)(&this); } bool lookupUni(Mode mode, Range)(ref Range inp) const pure { wchar x = cast(wchar)(inp[0] - 0xD800); //not a high surrogate if(x > 0x3FF) { //low surrogate if(x <= 0x7FF) badEncoding(); static if(sizeFlags & 1) { auto ch = inp[0]; static if(mode == Mode.alwaysSkip) inp.popFront(); static if(mode == Mode.skipOnMatch) { if (bmp[ch]) { inp.popFront(); return true; } else return false; } else return bmp[ch]; } else //skip is not available for sub-matchers, so just false return false; } else { static if(sizeFlags & 2) { if(inp.length < 2) badEncoding(); wchar y = cast(wchar)(inp[1] - 0xDC00); //not a low surrogate if(y > 0x3FF) badEncoding(); wchar[2] needle = [inp[0] & 0x3ff, inp[1] & 0x3ff]; static if(mode == Mode.alwaysSkip) inp.popFrontN(2); static if(mode == Mode.skipOnMatch) { if (uni[needle]) { inp.popFrontN(2); return true; } else return false; } else return uni[needle]; } else //ditto return false; } } } struct CherryPick(I, Sizes...) if(Sizes.length >= 1 && Sizes.length <= 2) { private: I* m; enum sizeFlags = I.sizeFlags; static if(sizeFlags & 1) { @property ref ascii()() const pure{ return m.ascii; } } bool lookupUni(Mode mode, Range)(ref Range inp) const pure { return m.lookupUni!mode(inp); } mixin DefMatcher; static assert(allSatisfy!(validSize, Sizes), "Only lengths of 1 and 2 code units are possible in UTF-16"); } } private auto utf8Matcher(Set)(Set set) @trusted { return Utf8Matcher!().build(set); } private auto utf16Matcher(Set)(Set set) @trusted { return Utf16Matcher!().build(set); } /** Constructs a matcher object to classify $(CODEPOINTS) from the $(D set) for encoding that has $(D Char) as code unit. See $(LREF MatcherConcept) for API outline. */ public auto utfMatcher(Char, Set)(Set set) @trusted if(isCodepointSet!Set) { static if(is(Char : char)) return utf8Matcher(set); else static if(is(Char : wchar)) return utf16Matcher(set); else static if(is(Char : dchar)) static assert(false, "UTF-32 needs no decoding, and thus not supported by utfMatcher"); else static assert(false, "Only character types 'char' and 'wchar' are allowed"); } //a range of code units, packed with index to speed up forward iteration package auto decoder(C)(C[] s, size_t offset=0) @safe pure nothrow @nogc if(is(C : wchar) || is(C : char)) { static struct Decoder { pure nothrow: C[] str; size_t idx; @property C front(){ return str[idx]; } @property C back(){ return str[$-1]; } void popFront(){ idx++; } void popBack(){ str = str[0..$-1]; } void popFrontN(size_t n){ idx += n; } @property bool empty(){ return idx == str.length; } @property auto save(){ return this; } auto opIndex(size_t i){ return str[idx+i]; } @property size_t length(){ return str.length - idx; } alias opDollar = length; auto opSlice(size_t a, size_t b){ return Decoder(str[0..idx+b], idx+a); } } static assert(isRandomAccessRange!Decoder); static assert(is(ElementType!Decoder : C)); return Decoder(s, offset); } /* Expose UTF string $(D s) as a random-access range of $(S_LINK Code unit, code units). */ package auto units(C)(C[] s) @safe pure nothrow @nogc if(is(C : wchar) || is(C : char)) { static struct Units { pure nothrow: C[] str; @property C front(){ return str[0]; } @property C back(){ return str[$-1]; } void popFront(){ str = str[1..$]; } void popBack(){ str = str[0..$-1]; } void popFrontN(size_t n){ str = str[n..$]; } @property bool empty(){ return 0 == str.length; } @property auto save(){ return this; } auto opIndex(size_t i){ return str[i]; } @property size_t length(){ return str.length; } alias opDollar = length; auto opSlice(size_t a, size_t b){ return Units(str[a..b]); } } static assert(isRandomAccessRange!Units); static assert(is(ElementType!Units : C)); return Units(s); } @safe unittest { import std.range; string rs = "hi! ネемног砀 текста"; auto codec = rs.decoder; auto utf8 = utf8Matcher(unicode.Letter); auto asc = utf8.subMatcher!(1); auto uni = utf8.subMatcher!(2,3,4); assert(asc.test(codec)); assert(!uni.match(codec)); assert(utf8.skip(codec)); assert(codec.idx == 1); assert(!uni.match(codec)); assert(asc.test(codec)); assert(utf8.skip(codec)); assert(codec.idx == 2); assert(!asc.match(codec)); assert(!utf8.test(codec)); assert(!utf8.skip(codec)); assert(!asc.test(codec)); assert(!utf8.test(codec)); assert(!utf8.skip(codec)); assert(utf8.test(codec)); foreach(i; 0..7) { assert(!asc.test(codec)); assert(uni.test(codec)); assert(utf8.skip(codec)); } assert(!utf8.test(codec)); assert(!utf8.skip(codec)); //the same with match where applicable codec = rs.decoder; assert(utf8.match(codec)); assert(codec.idx == 1); assert(utf8.match(codec)); assert(codec.idx == 2); assert(!utf8.match(codec)); assert(codec.idx == 2); assert(!utf8.skip(codec)); assert(!utf8.skip(codec)); foreach(i; 0..7) { assert(!asc.test(codec)); assert(utf8.test(codec)); assert(utf8.match(codec)); } auto i = codec.idx; assert(!utf8.match(codec)); assert(codec.idx == i); } @safe unittest { import std.range; static bool testAll(Matcher, Range)(ref Matcher m, ref Range r) { bool t = m.test(r); auto save = r.idx; assert(t == m.match(r)); assert(r.idx == save || t); //ether no change or was match r.idx = save; static if(is(typeof(m.skip(r)))) { assert(t == m.skip(r)); assert(r.idx != save); //always changed r.idx = save; } return t; } auto utf16 = utfMatcher!wchar(unicode.L); auto bmp = utf16.subMatcher!1; auto nonBmp = utf16.subMatcher!1; auto utf8 = utfMatcher!char(unicode.L); auto ascii = utf8.subMatcher!1; auto uni2 = utf8.subMatcher!2; auto uni3 = utf8.subMatcher!3; auto uni24 = utf8.subMatcher!(2,4); foreach(ch; unicode.L.byCodepoint.stride(3)) { import std.utf : encode; char[4] buf; wchar[2] buf16; auto len = encode(buf, ch); auto len16 = encode(buf16, ch); auto c8 = buf[0..len].decoder; auto c16 = buf16[0..len16].decoder; assert(testAll(utf16, c16)); assert(testAll(bmp, c16) || len16 != 1); assert(testAll(nonBmp, c16) || len16 != 2); assert(testAll(utf8, c8)); //submatchers return false on out of their domain assert(testAll(ascii, c8) || len != 1); assert(testAll(uni2, c8) || len != 2); assert(testAll(uni3, c8) || len != 3); assert(testAll(uni24, c8) || (len != 2 && len !=4)); } } // cover decode fail cases of Matcher unittest { import std.exception : collectException; import std.format : format; import std.algorithm; auto utf16 = utfMatcher!wchar(unicode.L); auto utf8 = utfMatcher!char(unicode.L); //decode failure cases UTF-8 alias fails8 = AliasSeq!("\xC1", "\x80\x00","\xC0\x00", "\xCF\x79", "\xFF\x00\0x00\0x00\x00", "\xC0\0x80\0x80\x80", "\x80\0x00\0x00\x00", "\xCF\x00\0x00\0x00\x00"); foreach(msg; fails8){ assert(collectException((){ auto s = msg; import std.utf; size_t idx = 0; //decode(s, idx); utf8.test(s); }()), format("%( %2x %)", cast(ubyte[])msg)); } //decode failure cases UTF-16 alias fails16 = AliasSeq!([0xD811], [0xDC02]); foreach(msg; fails16){ assert(collectException((){ auto s = msg.map!(x => cast(wchar)x); utf16.test(s); }())); } } /++ Convenience function to construct optimal configurations for packed Trie from any $(D set) of $(CODEPOINTS). The parameter $(D level) indicates the number of trie levels to use, allowed values are: 1, 2, 3 or 4. Levels represent different trade-offs speed-size wise. $(P Level 1 is fastest and the most memory hungry (a bit array). ) $(P Level 4 is the slowest and has the smallest footprint. ) See the $(S_LINK Synopsis, Synopsis) section for example. Note: Level 4 stays very practical (being faster and more predictable) compared to using direct lookup on the $(D set) itself. +/ public auto toTrie(size_t level, Set)(Set set) if(isCodepointSet!Set) { static if(level == 1) return codepointSetTrie!(21)(set); else static if(level == 2) return codepointSetTrie!(10, 11)(set); else static if(level == 3) return codepointSetTrie!(8, 5, 8)(set); else static if(level == 4) return codepointSetTrie!(6, 4, 4, 7)(set); else static assert(false, "Sorry, toTrie doesn't support levels > 4, use codepointSetTrie directly"); } /** $(P Builds a $(D Trie) with typically optimal speed-size trade-off and wraps it into a delegate of the following type: $(D bool delegate(dchar ch)). ) $(P Effectively this creates a 'tester' lambda suitable for algorithms like std.algorithm.find that take unary predicates. ) See the $(S_LINK Synopsis, Synopsis) section for example. */ public auto toDelegate(Set)(Set set) if(isCodepointSet!Set) { // 3 is very small and is almost as fast as 2-level (due to CPU caches?) auto t = toTrie!3(set); return (dchar ch) => t[ch]; } /** $(P Opaque wrapper around unsigned built-in integers and code unit (char/wchar/dchar) types. Parameter $(D sz) indicates that the value is confined to the range of [0, 2^^sz$(RPAREN). With this knowledge it can be packed more tightly when stored in certain data-structures like trie. ) Note: $(P The $(D BitPacked!(T, sz)) is implicitly convertible to $(D T) but not vise-versa. Users have to ensure the value fits in the range required and use the $(D cast) operator to perform the conversion.) */ struct BitPacked(T, size_t sz) if(isIntegral!T || is(T:dchar)) { enum bitSize = sz; T _value; alias _value this; } /* Depending on the form of the passed argument $(D bitSizeOf) returns the amount of bits required to represent a given type or a return type of a given functor. */ template bitSizeOf(Args...) if(Args.length == 1) { alias T = Args[0]; static if(__traits(compiles, { size_t val = T.bitSize; })) //(is(typeof(T.bitSize) : size_t)) { enum bitSizeOf = T.bitSize; } else static if(is(ReturnType!T dummy == BitPacked!(U, bits), U, size_t bits)) { enum bitSizeOf = bitSizeOf!(ReturnType!T); } else { enum bitSizeOf = T.sizeof*8; } } /** Tests if $(D T) is some instantiation of $(LREF BitPacked)!(U, x) and thus suitable for packing. */ template isBitPacked(T) { static if(is(T dummy == BitPacked!(U, bits), U, size_t bits)) enum isBitPacked = true; else enum isBitPacked = false; } /** Gives the type $(D U) from $(LREF BitPacked)!(U, x) or $(D T) itself for every other type. */ template TypeOfBitPacked(T) { static if(is(T dummy == BitPacked!(U, bits), U, size_t bits)) alias TypeOfBitPacked = U; else alias TypeOfBitPacked = T; } /* Wrapper, used in definition of custom data structures from $(D Trie) template. Applying it to a unary lambda function indicates that the returned value always fits within $(D bits) of bits. */ struct assumeSize(alias Fn, size_t bits) { enum bitSize = bits; static auto ref opCall(T)(auto ref T arg) { return Fn(arg); } } /* A helper for defining lambda function that yields a slice of certain bits from an unsigned integral value. The resulting lambda is wrapped in assumeSize and can be used directly with $(D Trie) template. */ struct sliceBits(size_t from, size_t to) { //for now bypass assumeSize, DMD has trouble inlining it enum bitSize = to-from; static auto opCall(T)(T x) out(result) { assert(result < (1<<to-from)); } body { static assert(from < to); static if(from == 0) return x & ((1<<to)-1); else return (x >> from) & ((1<<(to-from))-1); } } @safe pure nothrow @nogc uint low_8(uint x) { return x&0xFF; } @safe pure nothrow @nogc uint midlow_8(uint x){ return (x&0xFF00)>>8; } alias lo8 = assumeSize!(low_8, 8); alias mlo8 = assumeSize!(midlow_8, 8); static assert(bitSizeOf!lo8 == 8); static assert(bitSizeOf!(sliceBits!(4, 7)) == 3); static assert(bitSizeOf!(BitPacked!(uint, 2)) == 2); template Sequence(size_t start, size_t end) { static if(start < end) alias Sequence = AliasSeq!(start, Sequence!(start+1, end)); else alias Sequence = AliasSeq!(); } //---- TRIE TESTS ---- unittest { import std.conv; import std.algorithm; import std.range; static trieStats(TRIE)(TRIE t) { version(std_uni_stats) { import std.stdio; writeln("---TRIE FOOTPRINT STATS---"); foreach(i; staticIota!(0, t.table.dim) ) { writefln("lvl%s = %s bytes; %s pages" , i, t.bytes!i, t.pages!i); } writefln("TOTAL: %s bytes", t.bytes); version(none) { writeln("INDEX (excluding value level):"); foreach(i; staticIota!(0, t.table.dim-1) ) writeln(t.table.slice!(i)[0..t.table.length!i]); } writeln("---------------------------"); } } //@@@BUG link failure, lambdas not found by linker somehow (in case of trie2) // alias lo8 = assumeSize!(8, function (uint x) { return x&0xFF; }); // alias next8 = assumeSize!(7, function (uint x) { return (x&0x7F00)>>8; }); alias Set = CodepointSet; auto set = Set('A','Z','a','z'); auto trie = buildTrie!(bool, uint, 256, lo8)(set.byInterval);// simple bool array for(int a='a'; a<'z';a++) assert(trie[a]); for(int a='A'; a<'Z';a++) assert(trie[a]); for(int a=0; a<'A'; a++) assert(!trie[a]); for(int a ='Z'; a<'a'; a++) assert(!trie[a]); trieStats(trie); auto redundant2 = Set( 1, 18, 256+2, 256+111, 512+1, 512+18, 768+2, 768+111); auto trie2 = buildTrie!(bool, uint, 1024, mlo8, lo8)(redundant2.byInterval); trieStats(trie2); foreach(e; redundant2.byCodepoint) assert(trie2[e], text(cast(uint)e, " - ", trie2[e])); foreach(i; 0..1024) { assert(trie2[i] == (i in redundant2)); } auto redundant3 = Set( 2, 4, 6, 8, 16, 2+16, 4+16, 16+6, 16+8, 16+16, 2+32, 4+32, 32+6, 32+8, ); enum max3 = 256; // sliceBits auto trie3 = buildTrie!(bool, uint, max3, sliceBits!(6,8), sliceBits!(4,6), sliceBits!(0,4) )(redundant3.byInterval); trieStats(trie3); foreach(i; 0..max3) assert(trie3[i] == (i in redundant3), text(cast(uint)i)); auto redundant4 = Set( 10, 64, 64+10, 128, 128+10, 256, 256+10, 512, 1000, 2000, 3000, 4000, 5000, 6000 ); enum max4 = 2^^16; auto trie4 = buildTrie!(bool, size_t, max4, sliceBits!(13, 16), sliceBits!(9, 13), sliceBits!(6, 9) , sliceBits!(0, 6) )(redundant4.byInterval); foreach(i; 0..max4){ if(i in redundant4) assert(trie4[i], text(cast(uint)i)); } trieStats(trie4); alias mapToS = mapTrieIndex!(useItemAt!(0, char)); string[] redundantS = ["tea", "start", "orange"]; redundantS.sort!((a,b) => mapToS(a) < mapToS(b))(); auto strie = buildTrie!(bool, string, useItemAt!(0, char))(redundantS); // using first char only assert(redundantS == ["orange", "start", "tea"]); assert(strie["test"], text(strie["test"])); assert(!strie["aea"]); assert(strie["s"]); // a bit size test auto a = array(map!(x => to!ubyte(x))(iota(0, 256))); auto bt = buildTrie!(bool, ubyte, sliceBits!(7, 8), sliceBits!(5, 7), sliceBits!(0, 5))(a); trieStats(bt); foreach(i; 0..256) assert(bt[cast(ubyte)i]); } template useItemAt(size_t idx, T) if(isIntegral!T || is(T: dchar)) { size_t impl(in T[] arr){ return arr[idx]; } alias useItemAt = assumeSize!(impl, 8*T.sizeof); } template useLastItem(T) { size_t impl(in T[] arr){ return arr[$-1]; } alias useLastItem = assumeSize!(impl, 8*T.sizeof); } template fullBitSize(Prefix...) { static if(Prefix.length > 0) enum fullBitSize = bitSizeOf!(Prefix[0])+fullBitSize!(Prefix[1..$]); else enum fullBitSize = 0; } template idxTypes(Key, size_t fullBits, Prefix...) { static if(Prefix.length == 1) {// the last level is value level, so no index once reduced to 1-level alias idxTypes = AliasSeq!(); } else { // Important note on bit packing // Each level has to hold enough of bits to address the next one // The bottom level is known to hold full bit width // thus it's size in pages is full_bit_width - size_of_last_prefix // Recourse on this notion alias idxTypes = AliasSeq!( idxTypes!(Key, fullBits - bitSizeOf!(Prefix[$-1]), Prefix[0..$-1]), BitPacked!(typeof(Prefix[$-2](Key.init)), fullBits - bitSizeOf!(Prefix[$-1])) ); } } //============================================================================ @safe pure int comparePropertyName(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) if (is(Char1 : dchar) && is(Char2 : dchar)) { import std.ascii : toLower; import std.algorithm : cmp, map, filter; static bool pred(dchar c) {return !c.isWhite && c != '-' && c != '_';} return cmp( a.map!toLower.filter!pred, b.map!toLower.filter!pred); } @safe pure unittest { assert(!comparePropertyName("foo-bar", "fooBar")); } bool propertyNameLess(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) @safe pure if (is(Char1 : dchar) && is(Char2 : dchar)) { return comparePropertyName(a, b) < 0; } //============================================================================ // Utilities for compression of Unicode code point sets //============================================================================ @safe void compressTo(uint val, ref ubyte[] arr) pure nothrow { // not optimized as usually done 1 time (and not public interface) if(val < 128) arr ~= cast(ubyte)val; else if(val < (1<<13)) { arr ~= (0b1_00<<5) | cast(ubyte)(val>>8); arr ~= val & 0xFF; } else { assert(val < (1<<21)); arr ~= (0b1_01<<5) | cast(ubyte)(val>>16); arr ~= (val >> 8) & 0xFF; arr ~= val & 0xFF; } } @safe uint decompressFrom(const(ubyte)[] arr, ref size_t idx) pure { import std.exception : enforce; uint first = arr[idx++]; if(!(first & 0x80)) // no top bit -> [0..127] return first; uint extra = ((first>>5) & 1) + 1; // [1, 2] uint val = (first & 0x1F); enforce(idx + extra <= arr.length, "bad code point interval encoding"); foreach(j; 0..extra) val = (val<<8) | arr[idx+j]; idx += extra; return val; } package ubyte[] compressIntervals(Range)(Range intervals) if(isInputRange!Range && isIntegralPair!(ElementType!Range)) { ubyte[] storage; uint base = 0; // RLE encode foreach(val; intervals) { compressTo(val[0]-base, storage); base = val[0]; if(val[1] != lastDchar+1) // till the end of the domain so don't store it { compressTo(val[1]-base, storage); base = val[1]; } } return storage; } @safe pure unittest { import std.typecons; auto run = [tuple(80, 127), tuple(128, (1<<10)+128)]; ubyte[] enc = [cast(ubyte)80, 47, 1, (0b1_00<<5) | (1<<2), 0]; assert(compressIntervals(run) == enc); auto run2 = [tuple(0, (1<<20)+512+1), tuple((1<<20)+512+4, lastDchar+1)]; ubyte[] enc2 = [cast(ubyte)0, (0b1_01<<5) | (1<<4), 2, 1, 3]; // odd length-ed assert(compressIntervals(run2) == enc2); size_t idx = 0; assert(decompressFrom(enc, idx) == 80); assert(decompressFrom(enc, idx) == 47); assert(decompressFrom(enc, idx) == 1); assert(decompressFrom(enc, idx) == (1<<10)); idx = 0; assert(decompressFrom(enc2, idx) == 0); assert(decompressFrom(enc2, idx) == (1<<20)+512+1); assert(equalS(decompressIntervals(compressIntervals(run)), run)); assert(equalS(decompressIntervals(compressIntervals(run2)), run2)); } // Creates a range of $(D CodepointInterval) that lazily decodes compressed data. @safe package auto decompressIntervals(const(ubyte)[] data) pure { return DecompressedIntervals(data); } @safe struct DecompressedIntervals { pure: const(ubyte)[] _stream; size_t _idx; CodepointInterval _front; this(const(ubyte)[] stream) { _stream = stream; popFront(); } @property CodepointInterval front() { assert(!empty); return _front; } void popFront() { if(_idx == _stream.length) { _idx = size_t.max; return; } uint base = _front[1]; _front[0] = base + decompressFrom(_stream, _idx); if(_idx == _stream.length)// odd length ---> till the end _front[1] = lastDchar+1; else { base = _front[0]; _front[1] = base + decompressFrom(_stream, _idx); } } @property bool empty() const { return _idx == size_t.max; } @property DecompressedIntervals save() { return this; } } static assert(isInputRange!DecompressedIntervals); static assert(isForwardRange!DecompressedIntervals); //============================================================================ version(std_uni_bootstrap){} else { // helper for looking up code point sets @trusted ptrdiff_t findUnicodeSet(alias table, C)(in C[] name) pure { import std.range : assumeSorted; import std.algorithm : map; auto range = assumeSorted!((a,b) => propertyNameLess(a,b)) (table.map!"a.name"()); size_t idx = range.lowerBound(name).length; if(idx < range.length && comparePropertyName(range[idx], name) == 0) return idx; return -1; } // another one that loads it @trusted bool loadUnicodeSet(alias table, Set, C)(in C[] name, ref Set dest) pure { auto idx = findUnicodeSet!table(name); if(idx >= 0) { dest = Set(asSet(table[idx].compressed)); return true; } return false; } @trusted bool loadProperty(Set=CodepointSet, C) (in C[] name, ref Set target) pure { alias ucmp = comparePropertyName; // conjure cumulative properties by hand if(ucmp(name, "L") == 0 || ucmp(name, "Letter") == 0) { target = asSet(uniProps.Lu); target |= asSet(uniProps.Ll); target |= asSet(uniProps.Lt); target |= asSet(uniProps.Lo); target |= asSet(uniProps.Lm); } else if(ucmp(name,"LC") == 0 || ucmp(name,"Cased Letter")==0) { target = asSet(uniProps.Ll); target |= asSet(uniProps.Lu); target |= asSet(uniProps.Lt);// Title case } else if(ucmp(name, "M") == 0 || ucmp(name, "Mark") == 0) { target = asSet(uniProps.Mn); target |= asSet(uniProps.Mc); target |= asSet(uniProps.Me); } else if(ucmp(name, "N") == 0 || ucmp(name, "Number") == 0) { target = asSet(uniProps.Nd); target |= asSet(uniProps.Nl); target |= asSet(uniProps.No); } else if(ucmp(name, "P") == 0 || ucmp(name, "Punctuation") == 0) { target = asSet(uniProps.Pc); target |= asSet(uniProps.Pd); target |= asSet(uniProps.Ps); target |= asSet(uniProps.Pe); target |= asSet(uniProps.Pi); target |= asSet(uniProps.Pf); target |= asSet(uniProps.Po); } else if(ucmp(name, "S") == 0 || ucmp(name, "Symbol") == 0) { target = asSet(uniProps.Sm); target |= asSet(uniProps.Sc); target |= asSet(uniProps.Sk); target |= asSet(uniProps.So); } else if(ucmp(name, "Z") == 0 || ucmp(name, "Separator") == 0) { target = asSet(uniProps.Zs); target |= asSet(uniProps.Zl); target |= asSet(uniProps.Zp); } else if(ucmp(name, "C") == 0 || ucmp(name, "Other") == 0) { target = asSet(uniProps.Co); target |= asSet(uniProps.Lo); target |= asSet(uniProps.No); target |= asSet(uniProps.So); target |= asSet(uniProps.Po); } else if(ucmp(name, "graphical") == 0){ target = asSet(uniProps.Alphabetic); target |= asSet(uniProps.Mn); target |= asSet(uniProps.Mc); target |= asSet(uniProps.Me); target |= asSet(uniProps.Nd); target |= asSet(uniProps.Nl); target |= asSet(uniProps.No); target |= asSet(uniProps.Pc); target |= asSet(uniProps.Pd); target |= asSet(uniProps.Ps); target |= asSet(uniProps.Pe); target |= asSet(uniProps.Pi); target |= asSet(uniProps.Pf); target |= asSet(uniProps.Po); target |= asSet(uniProps.Zs); target |= asSet(uniProps.Sm); target |= asSet(uniProps.Sc); target |= asSet(uniProps.Sk); target |= asSet(uniProps.So); } else if(ucmp(name, "any") == 0) target = Set.fromIntervals(0, 0x110000); else if(ucmp(name, "ascii") == 0) target = Set.fromIntervals(0, 0x80); else return loadUnicodeSet!(uniProps.tab)(name, target); return true; } // CTFE-only helper for checking property names at compile-time @safe bool isPrettyPropertyName(C)(in C[] name) { import std.algorithm : find; auto names = [ "L", "Letter", "LC", "Cased Letter", "M", "Mark", "N", "Number", "P", "Punctuation", "S", "Symbol", "Z", "Separator", "Graphical", "any", "ascii" ]; auto x = find!(x => comparePropertyName(x, name) == 0)(names); return !x.empty; } // ditto, CTFE-only, not optimized @safe private static bool findSetName(alias table, C)(in C[] name) { return findUnicodeSet!table(name) >= 0; } template SetSearcher(alias table, string kind) { /// Run-time checked search. static auto opCall(C)(in C[] name) if(is(C : dchar)) { import std.conv : to; CodepointSet set; if(loadUnicodeSet!table(name, set)) return set; throw new Exception("No unicode set for "~kind~" by name " ~name.to!string()~" was found."); } /// Compile-time checked search. static @property auto opDispatch(string name)() { static if(findSetName!table(name)) { CodepointSet set; loadUnicodeSet!table(name, set); return set; } else static assert(false, "No unicode set for "~kind~" by name " ~name~" was found."); } } /** A single entry point to lookup Unicode $(CODEPOINT) sets by name or alias of a block, script or general category. It uses well defined standard rules of property name lookup. This includes fuzzy matching of names, so that 'White_Space', 'white-SpAce' and 'whitespace' are all considered equal and yield the same set of white space $(CHARACTERS). */ @safe public struct unicode { /** Performs the lookup of set of $(CODEPOINTS) with compile-time correctness checking. This short-cut version combines 3 searches: across blocks, scripts, and common binary properties. Note that since scripts and blocks overlap the usual trick to disambiguate is used - to get a block use $(D unicode.InBlockName), to search a script use $(D unicode.ScriptName). See_Also: $(LREF block), $(LREF script) and (not included in this search) $(LREF hangulSyllableType). */ static @property auto opDispatch(string name)() pure { static if(findAny(name)) return loadAny(name); else static assert(false, "No unicode set by name "~name~" was found."); } /// unittest { auto ascii = unicode.ASCII; assert(ascii['A']); assert(ascii['~']); assert(!ascii['\u00e0']); // matching is case-insensitive assert(ascii == unicode.ascII); assert(!ascii['à']); // underscores, '-' and whitespace in names are ignored too auto latin = unicode.in_latin1_Supplement; assert(latin['à']); assert(!latin['$']); // BTW Latin 1 Supplement is a block, hence "In" prefix assert(latin == unicode("In Latin 1 Supplement")); import std.exception; // run-time look up throws if no such set is found assert(collectException(unicode("InCyrilliac"))); } /** The same lookup across blocks, scripts, or binary properties, but performed at run-time. This version is provided for cases where $(D name) is not known beforehand; otherwise compile-time checked $(LREF opDispatch) is typically a better choice. See the $(S_LINK Unicode properties, table of properties) for available sets. */ static auto opCall(C)(in C[] name) if(is(C : dchar)) { return loadAny(name); } /** Narrows down the search for sets of $(CODEPOINTS) to all Unicode blocks. Note: Here block names are unambiguous as no scripts are searched and thus to search use simply $(D unicode.block.BlockName) notation. See $(S_LINK Unicode properties, table of properties) for available sets. See_Also: $(S_LINK Unicode properties, table of properties). */ struct block { mixin SetSearcher!(blocks.tab, "block"); } /// unittest { // use .block for explicitness assert(unicode.block.Greek_and_Coptic == unicode.InGreek_and_Coptic); } /** Narrows down the search for sets of $(CODEPOINTS) to all Unicode scripts. See the $(S_LINK Unicode properties, table of properties) for available sets. */ struct script { mixin SetSearcher!(scripts.tab, "script"); } /// unittest { auto arabicScript = unicode.script.arabic; auto arabicBlock = unicode.block.arabic; // there is an intersection between script and block assert(arabicBlock['؁']); assert(arabicScript['؁']); // but they are different assert(arabicBlock != arabicScript); assert(arabicBlock == unicode.inArabic); assert(arabicScript == unicode.arabic); } /** Fetch a set of $(CODEPOINTS) that have the given hangul syllable type. Other non-binary properties (once supported) follow the same notation - $(D unicode.propertyName.propertyValue) for compile-time checked access and $(D unicode.propertyName(propertyValue)) for run-time checked one. See the $(S_LINK Unicode properties, table of properties) for available sets. */ struct hangulSyllableType { mixin SetSearcher!(hangul.tab, "hangul syllable type"); } /// unittest { // L here is syllable type not Letter as in unicode.L short-cut auto leadingVowel = unicode.hangulSyllableType("L"); // check that some leading vowels are present foreach(vowel; '\u1110'..'\u115F') assert(leadingVowel[vowel]); assert(leadingVowel == unicode.hangulSyllableType.L); } private: alias ucmp = comparePropertyName; static bool findAny(string name) { return isPrettyPropertyName(name) || findSetName!(uniProps.tab)(name) || findSetName!(scripts.tab)(name) || (ucmp(name[0..2],"In") == 0 && findSetName!(blocks.tab)(name[2..$])); } static auto loadAny(Set=CodepointSet, C)(in C[] name) pure { import std.conv : to; Set set; bool loaded = loadProperty(name, set) || loadUnicodeSet!(scripts.tab)(name, set) || (name.length > 2 && ucmp(name[0..2],"In") == 0 && loadUnicodeSet!(blocks.tab)(name[2..$], set)); if(loaded) return set; throw new Exception("No unicode set by name "~name.to!string()~" was found."); } // FIXME: re-disable once the compiler is fixed // Disabled to prevent the mistake of creating instances of this pseudo-struct. //@disable ~this(); } unittest { assert(unicode("InHebrew") == asSet(blocks.Hebrew)); assert(unicode("separator") == (asSet(uniProps.Zs) | asSet(uniProps.Zl) | asSet(uniProps.Zp))); assert(unicode("In-Kharoshthi") == asSet(blocks.Kharoshthi)); } enum EMPTY_CASE_TRIE = ushort.max;// from what gen_uni uses internally // control - '\r' enum controlSwitch = ` case '\u0000':..case '\u0008':case '\u000E':..case '\u001F':case '\u007F':..case '\u0084':case '\u0086':..case '\u009F': case '\u0009':..case '\u000C': case '\u0085': `; // TODO: redo the most of hangul stuff algorithmically in case of Graphemes too // kill unrolled switches private static bool isRegionalIndicator(dchar ch) @safe { return ch >= '\U0001F1E6' && ch <= '\U0001F1FF'; } template genericDecodeGrapheme(bool getValue) { alias graphemeExtend = graphemeExtendTrie; alias spacingMark = mcTrie; static if(getValue) alias Value = Grapheme; else alias Value = void; Value genericDecodeGrapheme(Input)(ref Input range) { enum GraphemeState { Start, CR, RI, L, V, LVT } static if(getValue) Grapheme grapheme; auto state = GraphemeState.Start; enum eat = q{ static if(getValue) grapheme ~= ch; range.popFront(); }; dchar ch; assert(!range.empty, "Attempting to decode grapheme from an empty " ~ Input.stringof); while(!range.empty) { ch = range.front; final switch(state) with(GraphemeState) { case Start: mixin(eat); if(ch == '\r') state = CR; else if(isRegionalIndicator(ch)) state = RI; else if(isHangL(ch)) state = L; else if(hangLV[ch] || isHangV(ch)) state = V; else if(hangLVT[ch]) state = LVT; else if(isHangT(ch)) state = LVT; else { switch(ch) { mixin(controlSwitch); goto L_End; default: goto L_End_Extend; } } break; case CR: if(ch == '\n') mixin(eat); goto L_End_Extend; case RI: if(isRegionalIndicator(ch)) mixin(eat); else goto L_End_Extend; break; case L: if(isHangL(ch)) mixin(eat); else if(isHangV(ch) || hangLV[ch]) { state = V; mixin(eat); } else if(hangLVT[ch]) { state = LVT; mixin(eat); } else goto L_End_Extend; break; case V: if(isHangV(ch)) mixin(eat); else if(isHangT(ch)) { state = LVT; mixin(eat); } else goto L_End_Extend; break; case LVT: if(isHangT(ch)) { mixin(eat); } else goto L_End_Extend; break; } } L_End_Extend: while(!range.empty) { ch = range.front; // extend & spacing marks if(!graphemeExtend[ch] && !spacingMark[ch]) break; mixin(eat); } L_End: static if(getValue) return grapheme; } } public: // Public API continues /++ Computes the length of grapheme cluster starting at $(D index). Both the resulting length and the $(D index) are measured in $(S_LINK Code unit, code units). Params: C = type that is implicitly convertible to $(D dchars) input = array of grapheme clusters index = starting index into $(D input[]) Returns: length of grapheme cluster +/ size_t graphemeStride(C)(in C[] input, size_t index) if(is(C : dchar)) { auto src = input[index..$]; auto n = src.length; genericDecodeGrapheme!(false)(src); return n - src.length; } /// @safe unittest { assert(graphemeStride(" ", 1) == 1); // A + combing ring above string city = "A\u030Arhus"; size_t first = graphemeStride(city, 0); assert(first == 3); //\u030A has 2 UTF-8 code units assert(city[0..first] == "A\u030A"); assert(city[first..$] == "rhus"); } /++ Reads one full grapheme cluster from an input range of dchar $(D inp). For examples see the $(LREF Grapheme) below. Note: This function modifies $(D inp) and thus $(D inp) must be an L-value. +/ Grapheme decodeGrapheme(Input)(ref Input inp) if(isInputRange!Input && is(Unqual!(ElementType!Input) == dchar)) { return genericDecodeGrapheme!true(inp); } unittest { Grapheme gr; string s = " \u0020\u0308 "; gr = decodeGrapheme(s); assert(gr.length == 1 && gr[0] == ' '); gr = decodeGrapheme(s); assert(gr.length == 2 && equalS(gr[0..2], " \u0308")); s = "\u0300\u0308\u1100"; assert(equalS(decodeGrapheme(s)[], "\u0300\u0308")); assert(equalS(decodeGrapheme(s)[], "\u1100")); s = "\u11A8\u0308\uAC01"; assert(equalS(decodeGrapheme(s)[], "\u11A8\u0308")); assert(equalS(decodeGrapheme(s)[], "\uAC01")); } /++ $(P Iterate a string by grapheme.) $(P Useful for doing string manipulation that needs to be aware of graphemes.) See_Also: $(LREF byCodePoint) +/ auto byGrapheme(Range)(Range range) if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar)) { // TODO: Bidirectional access static struct Result { private Range _range; private Grapheme _front; bool empty() @property { return _front.length == 0; } Grapheme front() @property { return _front; } void popFront() { _front = _range.empty ? Grapheme.init : _range.decodeGrapheme(); } static if(isForwardRange!Range) { Result save() @property { return Result(_range.save, _front); } } } auto result = Result(range); result.popFront(); return result; } /// unittest { import std.conv; import std.range; import std.algorithm; auto text = "noe\u0308l"; // noël using e + combining diaeresis assert(text.walkLength == 5); // 5 code points auto gText = text.byGrapheme; assert(gText.walkLength == 4); // 4 graphemes assert(gText.take(3).equal("noe\u0308".byGrapheme)); assert(gText.drop(3).equal("l".byGrapheme)); } // For testing non-forward-range input ranges version(unittest) private static struct InputRangeString { private string s; bool empty() @property { return s.empty; } dchar front() @property { return s.front; } void popFront() { s.popFront(); } } unittest { import std.conv; import std.range; import std.algorithm; assert("".byGrapheme.walkLength == 0); auto reverse = "le\u0308on"; assert(reverse.walkLength == 5); auto gReverse = reverse.byGrapheme; assert(gReverse.walkLength == 4); foreach(text; AliasSeq!("noe\u0308l"c, "noe\u0308l"w, "noe\u0308l"d)) { assert(text.walkLength == 5); static assert(isForwardRange!(typeof(text))); auto gText = text.byGrapheme; static assert(isForwardRange!(typeof(gText))); assert(gText.walkLength == 4); assert(gText.array.retro.equal(gReverse)); } auto nonForwardRange = InputRangeString("noe\u0308l").byGrapheme; static assert(!isForwardRange!(typeof(nonForwardRange))); assert(nonForwardRange.walkLength == 4); } /++ $(P Lazily transform a range of $(LREF Grapheme)s to a range of code points.) $(P Useful for converting the result to a string after doing operations on graphemes.) $(P Acts as the identity function when given a range of code points.) +/ auto byCodePoint(Range)(Range range) if(isInputRange!Range && is(Unqual!(ElementType!Range) == Grapheme)) { // TODO: Propagate bidirectional access static struct Result { private Range _range; private size_t i = 0; bool empty() @property { return _range.empty; } dchar front() @property { return _range.front[i]; } void popFront() { ++i; if(i >= _range.front.length) { _range.popFront(); i = 0; } } static if(isForwardRange!Range) { Result save() @property { return Result(_range.save, i); } } } return Result(range); } /// Ditto Range byCodePoint(Range)(Range range) if(isInputRange!Range && is(Unqual!(ElementType!Range) == dchar)) { return range; } /// unittest { import std.conv : text; import std.range; string s = "noe\u0308l"; // noël // reverse it and convert the result to a string string reverse = s.byGrapheme .array .retro .byCodePoint .text; assert(reverse == "le\u0308on"); // lëon } unittest { import std.conv; import std.algorithm; assert("".byGrapheme.byCodePoint.equal("")); string text = "noe\u0308l"; static assert(is(typeof(text.byCodePoint) == string)); auto gText = InputRangeString(text).byGrapheme; static assert(!isForwardRange!(typeof(gText))); auto cpText = gText.byCodePoint; static assert(!isForwardRange!(typeof(cpText))); assert(cpText.walkLength == text.walkLength); } @trusted: /++ $(P A structure designed to effectively pack $(CHARACTERS) of a $(CLUSTER). ) $(P $(D Grapheme) has value semantics so 2 copies of a $(D Grapheme) always refer to distinct objects. In most actual scenarios a $(D Grapheme) fits on the stack and avoids memory allocation overhead for all but quite long clusters. ) See_Also: $(LREF decodeGrapheme), $(LREF graphemeStride) +/ @trusted struct Grapheme { import std.exception : enforce; public: this(C)(in C[] chars...) if(is(C : dchar)) { this ~= chars; } this(Input)(Input seq) if(!isDynamicArray!Input && isInputRange!Input && is(ElementType!Input : dchar)) { this ~= seq; } /// Gets a $(CODEPOINT) at the given index in this cluster. dchar opIndex(size_t index) const pure nothrow @nogc { assert(index < length); return read24(isBig ? ptr_ : small_.ptr, index); } /++ Writes a $(CODEPOINT) $(D ch) at given index in this cluster. Warning: Use of this facility may invalidate grapheme cluster, see also $(LREF Grapheme.valid). +/ void opIndexAssign(dchar ch, size_t index) pure nothrow @nogc { assert(index < length); write24(isBig ? ptr_ : small_.ptr, ch, index); } /// unittest { auto g = Grapheme("A\u0302"); assert(g[0] == 'A'); assert(g.valid); g[1] = '~'; // ASCII tilda is not a combining mark assert(g[1] == '~'); assert(!g.valid); } /++ Random-access range over Grapheme's $(CHARACTERS). Warning: Invalidates when this Grapheme leaves the scope, attempts to use it then would lead to memory corruption. +/ @system auto opSlice(size_t a, size_t b) pure nothrow @nogc { return sliceOverIndexed(a, b, &this); } /// ditto @system auto opSlice() pure nothrow @nogc { return sliceOverIndexed(0, length, &this); } /// Grapheme cluster length in $(CODEPOINTS). @property size_t length() const pure nothrow @nogc { return isBig ? len_ : slen_ & 0x7F; } /++ Append $(CHARACTER) $(D ch) to this grapheme. Warning: Use of this facility may invalidate grapheme cluster, see also $(D valid). See_Also: $(LREF Grapheme.valid) +/ ref opOpAssign(string op)(dchar ch) { static if(op == "~") { if(!isBig) { if(slen_ + 1 > small_cap) convertToBig();// & fallthrough to "big" branch else { write24(small_.ptr, ch, smallLength); slen_++; return this; } } assert(isBig); if(len_ + 1 > cap_) { cap_ += grow; ptr_ = cast(ubyte*)enforce(realloc(ptr_, 3*(cap_+1)), "realloc failed"); } write24(ptr_, ch, len_++); return this; } else static assert(false, "No operation "~op~" defined for Grapheme"); } /// unittest { import std.algorithm.comparison : equal; auto g = Grapheme("A"); assert(g.valid); g ~= '\u0301'; assert(g[].equal("A\u0301")); assert(g.valid); g ~= "B"; // not a valid grapheme cluster anymore assert(!g.valid); // still could be useful though assert(g[].equal("A\u0301B")); } /// Append all $(CHARACTERS) from the input range $(D inp) to this Grapheme. ref opOpAssign(string op, Input)(Input inp) if(isInputRange!Input && is(ElementType!Input : dchar)) { static if(op == "~") { foreach(dchar ch; inp) this ~= ch; return this; } else static assert(false, "No operation "~op~" defined for Grapheme"); } /++ True if this object contains valid extended grapheme cluster. Decoding primitives of this module always return a valid $(D Grapheme). Appending to and direct manipulation of grapheme's $(CHARACTERS) may render it no longer valid. Certain applications may chose to use Grapheme as a "small string" of any $(CODEPOINTS) and ignore this property entirely. +/ @property bool valid()() /*const*/ { auto r = this[]; genericDecodeGrapheme!false(r); return r.length == 0; } this(this) { if(isBig) {// dup it auto raw_cap = 3*(cap_+1); auto p = cast(ubyte*)enforce(malloc(raw_cap), "malloc failed"); p[0..raw_cap] = ptr_[0..raw_cap]; ptr_ = p; } } ~this() { if(isBig) { free(ptr_); } } private: enum small_bytes = ((ubyte*).sizeof+3*size_t.sizeof-1); // "out of the blue" grow rate, needs testing // (though graphemes are typically small < 9) enum grow = 20; enum small_cap = small_bytes/3; enum small_flag = 0x80, small_mask = 0x7F; // 16 bytes in 32bits, should be enough for the majority of cases union { struct { ubyte* ptr_; size_t cap_; size_t len_; size_t padding_; } struct { ubyte[small_bytes] small_; ubyte slen_; } } void convertToBig() { size_t k = smallLength; ubyte* p = cast(ubyte*)enforce(malloc(3*(grow+1)), "malloc failed"); for(int i=0; i<k; i++) write24(p, read24(small_.ptr, i), i); // now we can overwrite small array data ptr_ = p; len_ = slen_; assert(grow > len_); cap_ = grow; setBig(); } void setBig() pure nothrow @nogc { slen_ |= small_flag; } @property size_t smallLength() const pure nothrow @nogc { return slen_ & small_mask; } @property ubyte isBig() const pure nothrow @nogc { return slen_ & small_flag; } } static assert(Grapheme.sizeof == size_t.sizeof*4); /// unittest { import std.algorithm : filter; string bold = "ku\u0308hn"; // note that decodeGrapheme takes parameter by ref auto first = decodeGrapheme(bold); assert(first.length == 1); assert(first[0] == 'k'); // the next grapheme is 2 characters long auto wideOne = decodeGrapheme(bold); // slicing a grapheme yields a random-access range of dchar assert(wideOne[].equalS("u\u0308")); assert(wideOne.length == 2); static assert(isRandomAccessRange!(typeof(wideOne[]))); // all of the usual range manipulation is possible assert(wideOne[].filter!isMark().equalS("\u0308")); auto g = Grapheme("A"); assert(g.valid); g ~= '\u0301'; assert(g[].equalS("A\u0301")); assert(g.valid); g ~= "B"; // not a valid grapheme cluster anymore assert(!g.valid); // still could be useful though assert(g[].equalS("A\u0301B")); } unittest { auto g = Grapheme("A\u0302"); assert(g[0] == 'A'); assert(g.valid); g[1] = '~'; // ASCII tilda is not a combining mark assert(g[1] == '~'); assert(!g.valid); } unittest { import std.conv; import std.algorithm; import std.range; // not valid clusters (but it just a test) auto g = Grapheme('a', 'b', 'c', 'd', 'e'); assert(g[0] == 'a'); assert(g[1] == 'b'); assert(g[2] == 'c'); assert(g[3] == 'd'); assert(g[4] == 'e'); g[3] = 'Й'; assert(g[2] == 'c'); assert(g[3] == 'Й', text(g[3], " vs ", 'Й')); assert(g[4] == 'e'); assert(!g.valid); g ~= 'ц'; g ~= '~'; assert(g[0] == 'a'); assert(g[1] == 'b'); assert(g[2] == 'c'); assert(g[3] == 'Й'); assert(g[4] == 'e'); assert(g[5] == 'ц'); assert(g[6] == '~'); assert(!g.valid); Grapheme copy = g; copy[0] = 'X'; copy[1] = '-'; assert(g[0] == 'a' && copy[0] == 'X'); assert(g[1] == 'b' && copy[1] == '-'); assert(equalS(g[2..g.length], copy[2..copy.length])); copy = Grapheme("АБВГДЕЁЖЗИКЛМ"); assert(equalS(copy[0..8], "АБВГДЕЁЖ"), text(copy[0..8])); copy ~= "xyz"; assert(equalS(copy[13..15], "xy"), text(copy[13..15])); assert(!copy.valid); Grapheme h; foreach(dchar v; iota(cast(int)'A', cast(int)'Z'+1).map!"cast(dchar)a"()) h ~= v; assert(equalS(h[], iota(cast(int)'A', cast(int)'Z'+1))); } /++ $(P Does basic case-insensitive comparison of strings $(D str1) and $(D str2). This function uses simpler comparison rule thus achieving better performance than $(LREF icmp). However keep in mind the warning below.) Params: str1 = a string or a $(D ForwardRange) of $(D dchar)s str2 = a string or a $(D ForwardRange) of $(D dchar)s Returns: An $(D int) that is 0 if the strings match, &lt;0 if $(D str1) is lexicographically "less" than $(D str2), &gt;0 if $(D str1) is lexicographically "greater" than $(D str2) Warning: This function only handles 1:1 $(CODEPOINT) mapping and thus is not sufficient for certain alphabets like German, Greek and few others. See_Also: $(LREF icmp) $(XREF_PACK algorithm,comparison,cmp) +/ int sicmp(S1, S2)(S1 str1, S2 str2) if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar) && isForwardRange!S2 && is(Unqual!(ElementType!S2) == dchar)) { alias sTable = simpleCaseTable; size_t ridx=0; foreach(dchar lhs; str1) { if(ridx == str2.length) return 1; import std.utf : decode; dchar rhs = decode(str2, ridx); int diff = lhs - rhs; if(!diff) continue; size_t idx = simpleCaseTrie[lhs]; size_t idx2 = simpleCaseTrie[rhs]; // simpleCaseTrie is packed index table if(idx != EMPTY_CASE_TRIE) { if(idx2 != EMPTY_CASE_TRIE) {// both cased chars // adjust idx --> start of bucket idx = idx - sTable[idx].n; idx2 = idx2 - sTable[idx2].n; if(idx == idx2)// one bucket, equivalent chars continue; else// not the same bucket diff = sTable[idx].ch - sTable[idx2].ch; } else diff = sTable[idx - sTable[idx].n].ch - rhs; } else if(idx2 != EMPTY_CASE_TRIE) { diff = lhs - sTable[idx2 - sTable[idx2].n].ch; } // one of chars is not cased at all return diff; } return ridx == str2.length ? 0 : -1; } /// unittest{ assert(sicmp("Август", "авгусТ") == 0); // Greek also works as long as there is no 1:M mapping in sight assert(sicmp("ΌΎ", "όύ") == 0); // things like the following won't get matched as equal // Greek small letter iota with dialytika and tonos assert(sicmp("ΐ", "\u03B9\u0308\u0301") != 0); // while icmp has no problem with that assert(icmp("ΐ", "\u03B9\u0308\u0301") == 0); assert(icmp("ΌΎ", "όύ") == 0); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { int sicmp(const(char)[] str1, const(char)[] str2) { return sicmp!(const(char)[], const(char)[])(str1, str2); } int sicmp(const(wchar)[] str1, const(wchar)[] str2) { return sicmp!(const(wchar)[], const(wchar)[])(str1, str2); } int sicmp(const(dchar)[] str1, const(dchar)[] str2) { return sicmp!(const(dchar)[], const(dchar)[])(str1, str2); } } private int fullCasedCmp(Range)(dchar lhs, dchar rhs, ref Range rtail) @trusted pure /*TODO nothrow*/ { import std.algorithm : skipOver; alias fTable = fullCaseTable; size_t idx = fullCaseTrie[lhs]; // fullCaseTrie is packed index table if(idx == EMPTY_CASE_TRIE) return lhs; size_t start = idx - fTable[idx].n; size_t end = fTable[idx].size + start; assert(fTable[start].entry_len == 1); for(idx=start; idx<end; idx++) { auto entryLen = fTable[idx].entry_len; if(entryLen == 1) { if(fTable[idx].seq[0] == rhs) { return 0; } } else {// OK it's a long chunk, like 'ss' for German dstring seq = fTable[idx].seq[0..entryLen]; if(rhs == seq[0] && rtail.skipOver(seq[1..$])) { // note that this path modifies rtail // iff we managed to get there return 0; } } } return fTable[start].seq[0]; // new remapped character for accurate diffs } /++ $(P Does case insensitive comparison of $(D str1) and $(D str2). Follows the rules of full case-folding mapping. This includes matching as equal german ß with "ss" and other 1:M $(CODEPOINT) mappings unlike $(LREF sicmp). The cost of $(D icmp) being pedantically correct is slightly worse performance. ) +/ int icmp(S1, S2)(S1 str1, S2 str2) if(isForwardRange!S1 && is(Unqual!(ElementType!S1) == dchar) && isForwardRange!S2 && is(Unqual!(ElementType!S2) == dchar)) { for(;;) { if(str1.empty) return str2.empty ? 0 : -1; dchar lhs = str1.front; if(str2.empty) return 1; dchar rhs = str2.front; str1.popFront(); str2.popFront(); int diff = lhs - rhs; if(!diff) continue; // first try to match lhs to <rhs,right-tail> sequence int cmpLR = fullCasedCmp(lhs, rhs, str2); if(!cmpLR) continue; // then rhs to <lhs,left-tail> sequence int cmpRL = fullCasedCmp(rhs, lhs, str1); if(!cmpRL) continue; // cmpXX contain remapped codepoints // to obtain stable ordering of icmp diff = cmpLR - cmpRL; return diff; } } /// unittest{ assert(icmp("Rußland", "Russland") == 0); assert(icmp("ᾩ -> \u1F70\u03B9", "\u1F61\u03B9 -> ᾲ") == 0); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { int icmp(const(char)[] str1, const(char)[] str2) { return icmp!(const(char)[], const(char)[])(str1, str2); } int icmp(const(wchar)[] str1, const(wchar)[] str2) { return icmp!(const(wchar)[], const(wchar)[])(str1, str2); } int icmp(const(dchar)[] str1, const(dchar)[] str2) { return icmp!(const(dchar)[], const(dchar)[])(str1, str2); } } unittest { import std.conv; import std.exception : assertCTFEable; import std.algorithm; assertCTFEable!( { foreach(cfunc; AliasSeq!(icmp, sicmp)) { foreach(S1; AliasSeq!(string, wstring, dstring)) foreach(S2; AliasSeq!(string, wstring, dstring)) (){ // avoid slow optimizations for large functions @@@BUG@@@ 2396 assert(cfunc("".to!S1(), "".to!S2()) == 0); assert(cfunc("A".to!S1(), "".to!S2()) > 0); assert(cfunc("".to!S1(), "0".to!S2()) < 0); assert(cfunc("abc".to!S1(), "abc".to!S2()) == 0); assert(cfunc("abcd".to!S1(), "abc".to!S2()) > 0); assert(cfunc("abc".to!S1(), "abcd".to!S2()) < 0); assert(cfunc("Abc".to!S1(), "aBc".to!S2()) == 0); assert(cfunc("авГуст".to!S1(), "АВгУСТ".to!S2()) == 0); // Check example: assert(cfunc("Август".to!S1(), "авгусТ".to!S2()) == 0); assert(cfunc("ΌΎ".to!S1(), "όύ".to!S2()) == 0); }(); // check that the order is properly agnostic to the case auto strs = [ "Apple", "ORANGE", "orAcle", "amp", "banana"]; sort!((a,b) => cfunc(a,b) < 0)(strs); assert(strs == ["amp", "Apple", "banana", "orAcle", "ORANGE"]); } assert(icmp("ßb", "ssa") > 0); // Check example: assert(icmp("Russland", "Rußland") == 0); assert(icmp("ᾩ -> \u1F70\u03B9", "\u1F61\u03B9 -> ᾲ") == 0); assert(icmp("ΐ"w, "\u03B9\u0308\u0301") == 0); assert(sicmp("ΐ", "\u03B9\u0308\u0301") != 0); //bugzilla 11057 assert( icmp("K", "L") < 0 ); }); } // This is package for the moment to be used as a support tool for std.regex // It needs a better API /* Return a range of all $(CODEPOINTS) that casefold to and from this $(D ch). */ package auto simpleCaseFoldings(dchar ch) { alias sTable = simpleCaseTable; static struct Range { pure nothrow: uint idx; //if == uint.max, then read c. union { dchar c; // == 0 - empty range uint len; } @property bool isSmall() const { return idx == uint.max; } this(dchar ch) { idx = uint.max; c = ch; } this(uint start, uint size) { idx = start; len = size; } @property dchar front() const { assert(!empty); if(isSmall) { return c; } auto ch = sTable[idx].ch; return ch; } @property bool empty() const { if(isSmall) { return c == 0; } return len == 0; } @property uint length() const { if(isSmall) { return c == 0 ? 0 : 1; } return len; } void popFront() { if(isSmall) c = 0; else { idx++; len--; } } } immutable idx = simpleCaseTrie[ch]; if (idx == EMPTY_CASE_TRIE) return Range(ch); auto entry = sTable[idx]; immutable start = idx - entry.n; return Range(start, entry.size); } unittest { import std.exception : assertCTFEable; import std.algorithm : canFind; import std.array; assertCTFEable!((){ auto r = simpleCaseFoldings('Э').array; assert(r.length == 2); assert(r.canFind('э') && r.canFind('Э')); auto sr = simpleCaseFoldings('~'); assert(sr.equalS("~")); //A with ring above - casefolds to the same bucket as Angstrom sign sr = simpleCaseFoldings('Å'); assert(sr.length == 3); assert(sr.canFind('å') && sr.canFind('Å') && sr.canFind('\u212B')); }); } /++ $(P Returns the $(S_LINK Combining class, combining class) of $(D ch).) +/ ubyte combiningClass(dchar ch) @safe pure nothrow @nogc { return combiningClassTrie[ch]; } /// unittest{ // shorten the code alias CC = combiningClass; // combining tilda assert(CC('\u0303') == 230); // combining ring below assert(CC('\u0325') == 220); // the simple consequence is that "tilda" should be // placed after a "ring below" in a sequence } @safe pure nothrow @nogc unittest { foreach(ch; 0..0x80) assert(combiningClass(ch) == 0); assert(combiningClass('\u05BD') == 22); assert(combiningClass('\u0300') == 230); assert(combiningClass('\u0317') == 220); assert(combiningClass('\u1939') == 222); } /// Unicode character decomposition type. enum UnicodeDecomposition { /// Canonical decomposition. The result is canonically equivalent sequence. Canonical, /** Compatibility decomposition. The result is compatibility equivalent sequence. Note: Compatibility decomposition is a $(B lossy) conversion, typically suitable only for fuzzy matching and internal processing. */ Compatibility } /** Shorthand aliases for character decomposition type, passed as a template parameter to $(LREF decompose). */ enum { Canonical = UnicodeDecomposition.Canonical, Compatibility = UnicodeDecomposition.Compatibility }; /++ Try to canonically compose 2 $(CHARACTERS). Returns the composed $(CHARACTER) if they do compose and dchar.init otherwise. The assumption is that $(D first) comes before $(D second) in the original text, usually meaning that the first is a starter. Note: Hangul syllables are not covered by this function. See $(D composeJamo) below. +/ public dchar compose(dchar first, dchar second) pure nothrow { import std.internal.unicode_comp; import std.algorithm : map; import std.range : assumeSorted; size_t packed = compositionJumpTrie[first]; if(packed == ushort.max) return dchar.init; // unpack offset and length size_t idx = packed & composeIdxMask, cnt = packed >> composeCntShift; // TODO: optimize this micro binary search (no more then 4-5 steps) auto r = compositionTable[idx..idx+cnt].map!"a.rhs"().assumeSorted(); auto target = r.lowerBound(second).length; if(target == cnt) return dchar.init; auto entry = compositionTable[idx+target]; if(entry.rhs != second) return dchar.init; return entry.composed; } /// unittest{ assert(compose('A','\u0308') == '\u00C4'); assert(compose('A', 'B') == dchar.init); assert(compose('C', '\u0301') == '\u0106'); // note that the starter is the first one // thus the following doesn't compose assert(compose('\u0308', 'A') == dchar.init); } /++ Returns a full $(S_LINK Canonical decomposition, Canonical) (by default) or $(S_LINK Compatibility decomposition, Compatibility) decomposition of $(CHARACTER) $(D ch). If no decomposition is available returns a $(LREF Grapheme) with the $(D ch) itself. Note: This function also decomposes hangul syllables as prescribed by the standard. See_Also: $(LREF decomposeHangul) for a restricted version that takes into account only hangul syllables but no other decompositions. +/ public Grapheme decompose(UnicodeDecomposition decompType=Canonical)(dchar ch) { import std.internal.unicode_decomp; import std.algorithm : until; static if(decompType == Canonical) { alias table = decompCanonTable; alias mapping = canonMappingTrie; } else static if(decompType == Compatibility) { alias table = decompCompatTable; alias mapping = compatMappingTrie; } ushort idx = mapping[ch]; if(!idx) // not found, check hangul arithmetic decomposition return decomposeHangul(ch); auto decomp = table[idx..$].until(0); return Grapheme(decomp); } /// unittest { assert(compose('A','\u0308') == '\u00C4'); assert(compose('A', 'B') == dchar.init); assert(compose('C', '\u0301') == '\u0106'); // note that the starter is the first one // thus the following doesn't compose assert(compose('\u0308', 'A') == dchar.init); assert(decompose('Ĉ')[].equalS("C\u0302")); assert(decompose('D')[].equalS("D")); assert(decompose('\uD4DC')[].equalS("\u1111\u1171\u11B7")); assert(decompose!Compatibility('¹')[].equalS("1")); } //---------------------------------------------------------------------------- // Hangul specific composition/decomposition enum jamoSBase = 0xAC00; enum jamoLBase = 0x1100; enum jamoVBase = 0x1161; enum jamoTBase = 0x11A7; enum jamoLCount = 19, jamoVCount = 21, jamoTCount = 28; enum jamoNCount = jamoVCount * jamoTCount; enum jamoSCount = jamoLCount * jamoNCount; // Tests if $(D ch) is a Hangul leading consonant jamo. bool isJamoL(dchar ch) pure nothrow @nogc { // first cmp rejects ~ 1M code points above leading jamo range return ch < jamoLBase+jamoLCount && ch >= jamoLBase; } // Tests if $(D ch) is a Hangul vowel jamo. bool isJamoT(dchar ch) pure nothrow @nogc { // first cmp rejects ~ 1M code points above trailing jamo range // Note: ch == jamoTBase doesn't indicate trailing jamo (TIndex must be > 0) return ch < jamoTBase+jamoTCount && ch > jamoTBase; } // Tests if $(D ch) is a Hangul trailnig consonant jamo. bool isJamoV(dchar ch) pure nothrow @nogc { // first cmp rejects ~ 1M code points above vowel range return ch < jamoVBase+jamoVCount && ch >= jamoVBase; } int hangulSyllableIndex(dchar ch) pure nothrow @nogc { int idxS = cast(int)ch - jamoSBase; return idxS >= 0 && idxS < jamoSCount ? idxS : -1; } // internal helper: compose hangul syllables leaving dchar.init in holes void hangulRecompose(dchar[] seq) pure nothrow @nogc { for(size_t idx = 0; idx + 1 < seq.length; ) { if(isJamoL(seq[idx]) && isJamoV(seq[idx+1])) { int indexL = seq[idx] - jamoLBase; int indexV = seq[idx+1] - jamoVBase; int indexLV = indexL * jamoNCount + indexV * jamoTCount; if(idx + 2 < seq.length && isJamoT(seq[idx+2])) { seq[idx] = jamoSBase + indexLV + seq[idx+2] - jamoTBase; seq[idx+1] = dchar.init; seq[idx+2] = dchar.init; idx += 3; } else { seq[idx] = jamoSBase + indexLV; seq[idx+1] = dchar.init; idx += 2; } } else idx++; } } //---------------------------------------------------------------------------- public: /** Decomposes a Hangul syllable. If $(D ch) is not a composed syllable then this function returns $(LREF Grapheme) containing only $(D ch) as is. */ Grapheme decomposeHangul(dchar ch) { int idxS = cast(int)ch - jamoSBase; if(idxS < 0 || idxS >= jamoSCount) return Grapheme(ch); int idxL = idxS / jamoNCount; int idxV = (idxS % jamoNCount) / jamoTCount; int idxT = idxS % jamoTCount; int partL = jamoLBase + idxL; int partV = jamoVBase + idxV; if(idxT > 0) // there is a trailling consonant (T); <L,V,T> decomposition return Grapheme(partL, partV, jamoTBase + idxT); else // <L, V> decomposition return Grapheme(partL, partV); } /// unittest { import std.algorithm; assert(decomposeHangul('\uD4DB')[].equal("\u1111\u1171\u11B6")); } /++ Try to compose hangul syllable out of a leading consonant ($(D lead)), a $(D vowel) and optional $(D trailing) consonant jamos. On success returns the composed LV or LVT hangul syllable. If any of $(D lead) and $(D vowel) are not a valid hangul jamo of the respective $(CHARACTER) class returns dchar.init. +/ dchar composeJamo(dchar lead, dchar vowel, dchar trailing=dchar.init) pure nothrow @nogc { if(!isJamoL(lead)) return dchar.init; int indexL = lead - jamoLBase; if(!isJamoV(vowel)) return dchar.init; int indexV = vowel - jamoVBase; int indexLV = indexL * jamoNCount + indexV * jamoTCount; dchar syllable = jamoSBase + indexLV; return isJamoT(trailing) ? syllable + (trailing - jamoTBase) : syllable; } /// unittest { assert(composeJamo('\u1111', '\u1171', '\u11B6') == '\uD4DB'); // leaving out T-vowel, or passing any codepoint // that is not trailing consonant composes an LV-syllable assert(composeJamo('\u1111', '\u1171') == '\uD4CC'); assert(composeJamo('\u1111', '\u1171', ' ') == '\uD4CC'); assert(composeJamo('\u1111', 'A') == dchar.init); assert(composeJamo('A', '\u1171') == dchar.init); } unittest { import std.conv; static void testDecomp(UnicodeDecomposition T)(dchar ch, string r) { Grapheme g = decompose!T(ch); assert(equalS(g[], r), text(g[], " vs ", r)); } testDecomp!Canonical('\u1FF4', "\u03C9\u0301\u0345"); testDecomp!Canonical('\uF907', "\u9F9C"); testDecomp!Compatibility('\u33FF', "\u0067\u0061\u006C"); testDecomp!Compatibility('\uA7F9', "\u0153"); // check examples assert(decomposeHangul('\uD4DB')[].equalS("\u1111\u1171\u11B6")); assert(composeJamo('\u1111', '\u1171', '\u11B6') == '\uD4DB'); assert(composeJamo('\u1111', '\u1171') == '\uD4CC'); // leave out T-vowel assert(composeJamo('\u1111', '\u1171', ' ') == '\uD4CC'); assert(composeJamo('\u1111', 'A') == dchar.init); assert(composeJamo('A', '\u1171') == dchar.init); } /** Enumeration type for normalization forms, passed as template parameter for functions like $(LREF normalize). */ enum NormalizationForm { NFC, NFD, NFKC, NFKD } enum { /** Shorthand aliases from values indicating normalization forms. */ NFC = NormalizationForm.NFC, ///ditto NFD = NormalizationForm.NFD, ///ditto NFKC = NormalizationForm.NFKC, ///ditto NFKD = NormalizationForm.NFKD }; /++ Returns $(D input) string normalized to the chosen form. Form C is used by default. For more information on normalization forms see the $(S_LINK Normalization, normalization section). Note: In cases where the string in question is already normalized, it is returned unmodified and no memory allocation happens. +/ inout(C)[] normalize(NormalizationForm norm=NFC, C)(inout(C)[] input) { import std.algorithm : sort, SwapStrategy; import std.range : zip; import std.array : appender; auto anchors = splitNormalized!norm(input); if(anchors[0] == input.length && anchors[1] == input.length) return input; dchar[] decomposed; decomposed.reserve(31); ubyte[] ccc; ccc.reserve(31); auto app = appender!(C[])(); do { app.put(input[0..anchors[0]]); foreach(dchar ch; input[anchors[0]..anchors[1]]) static if(norm == NFD || norm == NFC) { foreach(dchar c; decompose!Canonical(ch)[]) decomposed ~= c; } else // NFKD & NFKC { foreach(dchar c; decompose!Compatibility(ch)[]) decomposed ~= c; } ccc.length = decomposed.length; size_t firstNonStable = 0; ubyte lastClazz = 0; foreach(idx, dchar ch; decomposed) { auto clazz = combiningClass(ch); ccc[idx] = clazz; if(clazz == 0 && lastClazz != 0) { // found a stable code point after unstable ones sort!("a[0] < b[0]", SwapStrategy.stable) (zip(ccc[firstNonStable..idx], decomposed[firstNonStable..idx])); firstNonStable = decomposed.length; } else if(clazz != 0 && lastClazz == 0) { // found first unstable code point after stable ones firstNonStable = idx; } lastClazz = clazz; } sort!("a[0] < b[0]", SwapStrategy.stable) (zip(ccc[firstNonStable..$], decomposed[firstNonStable..$])); static if(norm == NFC || norm == NFKC) { import std.algorithm : countUntil; size_t idx = 0; auto first = countUntil(ccc, 0); if(first >= 0) // no starters?? no recomposition { for(;;) { auto second = recompose(first, decomposed, ccc); if(second == decomposed.length) break; first = second; } // 2nd pass for hangul syllables hangulRecompose(decomposed); } } static if(norm == NFD || norm == NFKD) app.put(decomposed); else { import std.algorithm : remove; auto clean = remove!("a == dchar.init", SwapStrategy.stable)(decomposed); app.put(decomposed[0 .. clean.length]); } // reset variables decomposed.length = 0; decomposed.assumeSafeAppend(); ccc.length = 0; ccc.assumeSafeAppend(); input = input[anchors[1]..$]; // and move on anchors = splitNormalized!norm(input); }while(anchors[0] != input.length); app.put(input[0..anchors[0]]); return cast(inout(C)[])app.data; } /// unittest { // any encoding works wstring greet = "Hello world"; assert(normalize(greet) is greet); // the same exact slice // An example of a character with all 4 forms being different: // Greek upsilon with acute and hook symbol (code point 0x03D3) assert(normalize!NFC("ϓ") == "\u03D3"); assert(normalize!NFD("ϓ") == "\u03D2\u0301"); assert(normalize!NFKC("ϓ") == "\u038E"); assert(normalize!NFKD("ϓ") == "\u03A5\u0301"); } unittest { import std.conv; assert(normalize!NFD("abc\uF904def") == "abc\u6ED1def", text(normalize!NFD("abc\uF904def"))); assert(normalize!NFKD("2¹⁰") == "210", normalize!NFKD("2¹⁰")); assert(normalize!NFD("Äffin") == "A\u0308ffin"); // check example // any encoding works wstring greet = "Hello world"; assert(normalize(greet) is greet); // the same exact slice // An example of a character with all 4 forms being different: // Greek upsilon with acute and hook symbol (code point 0x03D3) assert(normalize!NFC("ϓ") == "\u03D3"); assert(normalize!NFD("ϓ") == "\u03D2\u0301"); assert(normalize!NFKC("ϓ") == "\u038E"); assert(normalize!NFKD("ϓ") == "\u03A5\u0301"); } // canonically recompose given slice of code points, works in-place and mutates data private size_t recompose(size_t start, dchar[] input, ubyte[] ccc) pure nothrow { assert(input.length == ccc.length); int accumCC = -1;// so that it's out of 0..255 range bool foundSolidStarter = false; // writefln("recomposing %( %04x %)", input); // first one is always a starter thus we start at i == 1 size_t i = start+1; for(; ; ) { if(i == input.length) break; int curCC = ccc[i]; // In any character sequence beginning with a starter S // a character C is blocked from S if and only if there // is some character B between S and C, and either B // is a starter or it has the same or higher combining class as C. //------------------------ // Applying to our case: // S is input[0] // accumCC is the maximum CCC of characters between C and S, // as ccc are sorted // C is input[i] if(curCC > accumCC) { dchar comp = compose(input[start], input[i]); if(comp != dchar.init) { input[start] = comp; input[i] = dchar.init;// put a sentinel // current was merged so its CCC shouldn't affect // composing with the next one } else { // if it was a starter then accumCC is now 0, end of loop accumCC = curCC; if(accumCC == 0) break; } } else{ // ditto here accumCC = curCC; if(accumCC == 0) break; } i++; } return i; } // returns tuple of 2 indexes that delimit: // normalized text, piece that needs normalization and // the rest of input starting with stable code point private auto splitNormalized(NormalizationForm norm, C)(const(C)[] input) { import std.typecons : tuple; auto result = input; ubyte lastCC = 0; foreach(idx, dchar ch; input) { static if(norm == NFC) if(ch < 0x0300) { lastCC = 0; continue; } ubyte CC = combiningClass(ch); if(lastCC > CC && CC != 0) { return seekStable!norm(idx, input); } if(notAllowedIn!norm(ch)) { return seekStable!norm(idx, input); } lastCC = CC; } return tuple(input.length, input.length); } private auto seekStable(NormalizationForm norm, C)(size_t idx, in C[] input) { import std.utf : codeLength; import std.typecons : tuple; auto br = input[0..idx]; size_t region_start = 0;// default for(;;) { if(br.empty)// start is 0 break; dchar ch = br.back; if(combiningClass(ch) == 0 && allowedIn!norm(ch)) { region_start = br.length - codeLength!C(ch); break; } br.popFront(); } ///@@@BUG@@@ can't use find: " find is a nested function and can't be used..." size_t region_end=input.length;// end is $ by default foreach(i, dchar ch; input[idx..$]) { if(combiningClass(ch) == 0 && allowedIn!norm(ch)) { region_end = i+idx; break; } } // writeln("Region to normalize: ", input[region_start..region_end]); return tuple(region_start, region_end); } /** Tests if dchar $(D ch) is always allowed (Quick_Check=YES) in normalization form $(D norm). */ public bool allowedIn(NormalizationForm norm)(dchar ch) { return !notAllowedIn!norm(ch); } /// unittest { // e.g. Cyrillic is always allowed, so is ASCII assert(allowedIn!NFC('я')); assert(allowedIn!NFD('я')); assert(allowedIn!NFKC('я')); assert(allowedIn!NFKD('я')); assert(allowedIn!NFC('Z')); } // not user friendly name but more direct private bool notAllowedIn(NormalizationForm norm)(dchar ch) { static if(norm == NFC) alias qcTrie = nfcQCTrie; else static if(norm == NFD) alias qcTrie = nfdQCTrie; else static if(norm == NFKC) alias qcTrie = nfkcQCTrie; else static if(norm == NFKD) alias qcTrie = nfkdQCTrie; else static assert("Unknown normalization form "~norm); return qcTrie[ch]; } unittest { assert(allowedIn!NFC('я')); assert(allowedIn!NFD('я')); assert(allowedIn!NFKC('я')); assert(allowedIn!NFKD('я')); assert(allowedIn!NFC('Z')); } } version(std_uni_bootstrap) { // old version used for bootstrapping of gen_uni.d that generates // up to date optimal versions of all of isXXX functions @safe pure nothrow @nogc public bool isWhite(dchar c) { import std.ascii : isWhite; return isWhite(c) || c == lineSep || c == paraSep || c == '\u0085' || c == '\u00A0' || c == '\u1680' || c == '\u180E' || (c >= '\u2000' && c <= '\u200A') || c == '\u202F' || c == '\u205F' || c == '\u3000'; } } else { // trusted -> avoid bounds check @trusted pure nothrow @nogc { // hide template instances behind functions (Bugzilla 13232) ushort toLowerIndex(dchar c) { return toLowerIndexTrie[c]; } ushort toLowerSimpleIndex(dchar c) { return toLowerSimpleIndexTrie[c]; } dchar toLowerTab(size_t idx) { return toLowerTable[idx]; } ushort toTitleIndex(dchar c) { return toTitleIndexTrie[c]; } ushort toTitleSimpleIndex(dchar c) { return toTitleSimpleIndexTrie[c]; } dchar toTitleTab(size_t idx) { return toTitleTable[idx]; } ushort toUpperIndex(dchar c) { return toUpperIndexTrie[c]; } ushort toUpperSimpleIndex(dchar c) { return toUpperSimpleIndexTrie[c]; } dchar toUpperTab(size_t idx) { return toUpperTable[idx]; } } public: /++ Whether or not $(D c) is a Unicode whitespace $(CHARACTER). (general Unicode category: Part of C0(tab, vertical tab, form feed, carriage return, and linefeed characters), Zs, Zl, Zp, and NEL(U+0085)) +/ @safe pure nothrow @nogc public bool isWhite(dchar c) { return isWhiteGen(c); // call pregenerated binary search } /++ Return whether $(D c) is a Unicode lowercase $(CHARACTER). +/ @safe pure nothrow @nogc bool isLower(dchar c) { import std.ascii : isLower, isASCII; if(isASCII(c)) return isLower(c); return lowerCaseTrie[c]; } @safe unittest { import std.ascii : isLower; foreach(v; 0..0x80) assert(isLower(v) == .isLower(v)); assert(.isLower('я')); assert(.isLower('й')); assert(!.isLower('Ж')); // Greek HETA assert(!.isLower('\u0370')); assert(.isLower('\u0371')); assert(!.isLower('\u039C')); // capital MU assert(.isLower('\u03B2')); // beta // from extended Greek assert(!.isLower('\u1F18')); assert(.isLower('\u1F00')); foreach(v; unicode.lowerCase.byCodepoint) assert(.isLower(v) && !isUpper(v)); } /++ Return whether $(D c) is a Unicode uppercase $(CHARACTER). +/ @safe pure nothrow @nogc bool isUpper(dchar c) { import std.ascii : isUpper, isASCII; if(isASCII(c)) return isUpper(c); return upperCaseTrie[c]; } @safe unittest { import std.ascii : isLower; foreach(v; 0..0x80) assert(isLower(v) == .isLower(v)); assert(!isUpper('й')); assert(isUpper('Ж')); // Greek HETA assert(isUpper('\u0370')); assert(!isUpper('\u0371')); assert(isUpper('\u039C')); // capital MU assert(!isUpper('\u03B2')); // beta // from extended Greek assert(!isUpper('\u1F00')); assert(isUpper('\u1F18')); foreach(v; unicode.upperCase.byCodepoint) assert(isUpper(v) && !.isLower(v)); } //TODO: Hidden for now, needs better API. //Other transforms could use better API as well, but this one is a new primitive. @safe pure nothrow @nogc private dchar toTitlecase(dchar c) { // optimize ASCII case if(c < 0xAA) { if(c < 'a') return c; if(c <= 'z') return c - 32; return c; } size_t idx = toTitleSimpleIndex(c); if(idx != ushort.max) { return toTitleTab(idx); } return c; } private alias UpperTriple = AliasSeq!(toUpperIndex, MAX_SIMPLE_UPPER, toUpperTab); private alias LowerTriple = AliasSeq!(toLowerIndex, MAX_SIMPLE_LOWER, toLowerTab); // generic toUpper/toLower on whole string, creates new or returns as is private S toCase(alias indexFn, uint maxIdx, alias tableFn, S)(S s) @trusted pure if(isSomeString!S) { import std.array : appender; foreach(i, dchar cOuter; s) { ushort idx = indexFn(cOuter); if(idx == ushort.max) continue; auto result = appender!S(s[0..i]); result.reserve(s.length); foreach(dchar c; s[i .. $]) { idx = indexFn(c); if(idx == ushort.max) result.put(c); else if(idx < maxIdx) { c = tableFn(idx); result.put(c); } else { auto val = tableFn(idx); // unpack length + codepoint uint len = val>>24; result.put(cast(dchar)(val & 0xFF_FFFF)); foreach(j; idx+1..idx+len) result.put(tableFn(j)); } } return result.data; } return s; } unittest //12428 { import std.array; auto s = "abcdefghij".replicate(300); s = s[0..10]; toUpper(s); assert(s == "abcdefghij"); } // generic toUpper/toLower on whole range, returns range private auto toCaser(alias indexFn, uint maxIdx, alias tableFn, Range)(Range str) // Accept range of dchar's if (isInputRange!Range && isSomeChar!(ElementEncodingType!Range) && ElementEncodingType!Range.sizeof == dchar.sizeof) { static struct ToCaserImpl { @property bool empty() { return !nLeft && r.empty; } @property auto front() { if (!nLeft) { dchar c = r.front; const idx = indexFn(c); if (idx == ushort.max) { buf[0] = c; nLeft = 1; } else if (idx < maxIdx) { buf[0] = tableFn(idx); nLeft = 1; } else { auto val = tableFn(idx); // unpack length + codepoint nLeft = val >> 24; if (nLeft == 0) nLeft = 1; assert(nLeft <= buf.length); buf[nLeft - 1] = cast(dchar)(val & 0xFF_FFFF); foreach (j; 1 .. nLeft) buf[nLeft - j - 1] = tableFn(idx + j); } } return buf[nLeft - 1]; } void popFront() { if (!nLeft) front; assert(nLeft); --nLeft; if (!nLeft) r.popFront(); } static if (isForwardRange!Range) { @property auto save() { auto ret = this; ret.r = r.save; return ret; } } private: Range r; uint nLeft; dchar[3] buf = void; } return ToCaserImpl(str); } /********************* * Convert input range or string to upper or lower case. * * Does not allocate memory. * Characters in UTF-8 or UTF-16 format that cannot be decoded * are treated as $(XREF utf, replacementDchar). * * Params: * str = string or range of characters * * Returns: * an InputRange of dchars * * See_Also: * $(LREF toUpper), $(LREF toLower) */ auto asLowerCase(Range)(Range str) if (isInputRange!Range && isSomeChar!(ElementEncodingType!Range) && !isConvertibleToString!Range) { static if (ElementEncodingType!Range.sizeof < dchar.sizeof) { import std.utf : byDchar; // Decode first return toCaser!LowerTriple(str.byDchar); } else { return toCaser!LowerTriple(str); } } /// ditto auto asUpperCase(Range)(Range str) if (isInputRange!Range && isSomeChar!(ElementEncodingType!Range) && !isConvertibleToString!Range) { static if (ElementEncodingType!Range.sizeof < dchar.sizeof) { import std.utf : byDchar; // Decode first return toCaser!UpperTriple(str.byDchar); } else { return toCaser!UpperTriple(str); } } /// @safe pure unittest { import std.algorithm.comparison : equal; assert("hEllo".asUpperCase.equal("HELLO")); } auto asLowerCase(Range)(auto ref Range str) if (isConvertibleToString!Range) { return asLowerCase!(StringTypeOf!Range)(str); } auto asUpperCase(Range)(auto ref Range str) if (isConvertibleToString!Range) { return asUpperCase!(StringTypeOf!Range)(str); } unittest { assert(testAliasedString!asLowerCase("hEllo")); assert(testAliasedString!asUpperCase("hEllo")); } unittest { import std.array; auto a = "HELLo".asLowerCase; auto savea = a.save; auto s = a.array; assert(s == "hello"); s = savea.array; assert(s == "hello"); string[] lower = ["123", "abcфеж", "\u0131\u023f\u03c9", "i\u0307\u1Fe2"]; string[] upper = ["123", "ABCФЕЖ", "I\u2c7e\u2126", "\u0130\u03A5\u0308\u0300"]; foreach (i, slwr; lower) { import std.utf : byChar; auto sx = slwr.asUpperCase.byChar.array; assert(sx == toUpper(slwr)); auto sy = upper[i].asLowerCase.byChar.array; assert(sy == toLower(upper[i])); } // Not necessary to call r.front for (auto r = lower[3].asUpperCase; !r.empty; r.popFront()) { } import std.algorithm.comparison : equal; "HELLo"w.asLowerCase.equal("hello"d); "HELLo"w.asUpperCase.equal("HELLO"d); "HELLo"d.asLowerCase.equal("hello"d); "HELLo"d.asUpperCase.equal("HELLO"d); import std.utf : byChar; assert(toLower("\u1Fe2") == asLowerCase("\u1Fe2").byChar.array); } // generic capitalizer on whole range, returns range private auto toCapitalizer(alias indexFnUpper, uint maxIdxUpper, alias tableFnUpper, Range)(Range str) // Accept range of dchar's if (isInputRange!Range && isSomeChar!(ElementEncodingType!Range) && ElementEncodingType!Range.sizeof == dchar.sizeof) { static struct ToCapitalizerImpl { @property bool empty() { return lower ? lwr.empty : !nLeft && r.empty; } @property auto front() { if (lower) return lwr.front; if (!nLeft) { dchar c = r.front; const idx = indexFnUpper(c); if (idx == ushort.max) { buf[0] = c; nLeft = 1; } else if (idx < maxIdxUpper) { buf[0] = tableFnUpper(idx); nLeft = 1; } else { auto val = tableFnUpper(idx); // unpack length + codepoint nLeft = val >> 24; if (nLeft == 0) nLeft = 1; assert(nLeft <= buf.length); buf[nLeft - 1] = cast(dchar)(val & 0xFF_FFFF); foreach (j; 1 .. nLeft) buf[nLeft - j - 1] = tableFnUpper(idx + j); } } return buf[nLeft - 1]; } void popFront() { if (lower) lwr.popFront(); else { if (!nLeft) front; assert(nLeft); --nLeft; if (!nLeft) { r.popFront(); lwr = r.asLowerCase(); lower = true; } } } static if (isForwardRange!Range) { @property auto save() { auto ret = this; ret.r = r.save; ret.lwr = lwr.save; return ret; } } private: Range r; typeof(r.asLowerCase) lwr; // range representing the lower case rest of string bool lower = false; // false for first character, true for rest of string dchar[3] buf = void; uint nLeft = 0; } return ToCapitalizerImpl(str); } /********************* * Capitalize input range or string, meaning convert the first * character to upper case and subsequent characters to lower case. * * Does not allocate memory. * Characters in UTF-8 or UTF-16 format that cannot be decoded * are treated as $(XREF utf, replacementDchar). * * Params: * str = string or range of characters * * Returns: * an InputRange of dchars * * See_Also: * $(LREF toUpper), $(LREF toLower) * $(LREF asUpperCase), $(LREF asLowerCase) */ auto asCapitalized(Range)(Range str) if (isInputRange!Range && isSomeChar!(ElementEncodingType!Range) && !isConvertibleToString!Range) { static if (ElementEncodingType!Range.sizeof < dchar.sizeof) { import std.utf : byDchar; // Decode first return toCapitalizer!UpperTriple(str.byDchar); } else { return toCapitalizer!UpperTriple(str); } } /// @safe pure unittest { import std.algorithm.comparison : equal; assert("hEllo".asCapitalized.equal("Hello")); } auto asCapitalized(Range)(auto ref Range str) if (isConvertibleToString!Range) { return asCapitalized!(StringTypeOf!Range)(str); } unittest { assert(testAliasedString!asCapitalized("hEllo")); } @safe pure nothrow @nogc unittest { auto r = "hEllo".asCapitalized(); assert(r.front == 'H'); } unittest { import std.array; auto a = "hELLo".asCapitalized; auto savea = a.save; auto s = a.array; assert(s == "Hello"); s = savea.array; assert(s == "Hello"); string[2][] cases = [ ["", ""], ["h", "H"], ["H", "H"], ["3", "3"], ["123", "123"], ["h123A", "H123a"], ["феж", "Феж"], ["\u1Fe2", "\u03a5\u0308\u0300"], ]; foreach (i; 0 .. cases.length) { import std.utf : byChar; auto r = cases[i][0].asCapitalized.byChar.array; auto result = cases[i][1]; assert(r == result); } // Don't call r.front for (auto r = "\u1Fe2".asCapitalized; !r.empty; r.popFront()) { } import std.algorithm.comparison : equal; "HELLo"w.asCapitalized.equal("Hello"d); "hElLO"w.asCapitalized.equal("Hello"d); "hello"d.asCapitalized.equal("Hello"d); "HELLO"d.asCapitalized.equal("Hello"d); import std.utf : byChar; assert(asCapitalized("\u0130").byChar.array == asUpperCase("\u0130").byChar.array); } // TODO: helper, I wish std.utf was more flexible (and stright) private size_t encodeTo(char[] buf, size_t idx, dchar c) @trusted pure nothrow @nogc { if (c <= 0x7F) { buf[idx] = cast(char)c; idx++; } else if (c <= 0x7FF) { buf[idx] = cast(char)(0xC0 | (c >> 6)); buf[idx+1] = cast(char)(0x80 | (c & 0x3F)); idx += 2; } else if (c <= 0xFFFF) { buf[idx] = cast(char)(0xE0 | (c >> 12)); buf[idx+1] = cast(char)(0x80 | ((c >> 6) & 0x3F)); buf[idx+2] = cast(char)(0x80 | (c & 0x3F)); idx += 3; } else if (c <= 0x10FFFF) { buf[idx] = cast(char)(0xF0 | (c >> 18)); buf[idx+1] = cast(char)(0x80 | ((c >> 12) & 0x3F)); buf[idx+2] = cast(char)(0x80 | ((c >> 6) & 0x3F)); buf[idx+3] = cast(char)(0x80 | (c & 0x3F)); idx += 4; } else assert(0); return idx; } unittest { char[] s = "abcd".dup; size_t i = 0; i = encodeTo(s, i, 'X'); assert(s == "Xbcd"); i = encodeTo(s, i, cast(dchar)'\u00A9'); assert(s == "X\xC2\xA9d"); } // TODO: helper, I wish std.utf was more flexible (and stright) private size_t encodeTo(wchar[] buf, size_t idx, dchar c) @trusted pure { import std.utf; if (c <= 0xFFFF) { if (0xD800 <= c && c <= 0xDFFF) throw (new UTFException("Encoding an isolated surrogate code point in UTF-16")).setSequence(c); buf[idx] = cast(wchar)c; idx++; } else if (c <= 0x10FFFF) { buf[idx] = cast(wchar)((((c - 0x10000) >> 10) & 0x3FF) + 0xD800); buf[idx+1] = cast(wchar)(((c - 0x10000) & 0x3FF) + 0xDC00); idx += 2; } else assert(0); return idx; } private size_t encodeTo(dchar[] buf, size_t idx, dchar c) @trusted pure nothrow @nogc { buf[idx] = c; idx++; return idx; } private void toCaseInPlace(alias indexFn, uint maxIdx, alias tableFn, C)(ref C[] s) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { import std.utf; size_t curIdx = 0; size_t destIdx = 0; alias slowToCase = toCaseInPlaceAlloc!(indexFn, maxIdx, tableFn); size_t lastUnchanged = 0; // in-buffer move of bytes to a new start index // the trick is that it may not need to copy at all static size_t moveTo(C[] str, size_t dest, size_t from, size_t to) { // Interestingly we may just bump pointer for a while // then have to copy if a re-cased char was smaller the original // later we may regain pace with char that got bigger // In the end it sometimes flip-flops between the 2 cases below if(dest == from) return to; // got to copy foreach(C c; str[from..to]) str[dest++] = c; return dest; } while(curIdx != s.length) { size_t startIdx = curIdx; dchar ch = decode(s, curIdx); // TODO: special case for ASCII auto caseIndex = indexFn(ch); if(caseIndex == ushort.max) // unchanged, skip over { continue; } else if(caseIndex < maxIdx) // 1:1 codepoint mapping { // previous cased chars had the same length as uncased ones // thus can just adjust pointer destIdx = moveTo(s, destIdx, lastUnchanged, startIdx); lastUnchanged = curIdx; dchar cased = tableFn(caseIndex); auto casedLen = codeLength!C(cased); if(casedLen + destIdx > curIdx) // no place to fit cased char { // switch to slow codepath, where we allocate return slowToCase(s, startIdx, destIdx); } else { destIdx = encodeTo(s, destIdx, cased); } } else // 1:m codepoint mapping, slow codepath { destIdx = moveTo(s, destIdx, lastUnchanged, startIdx); lastUnchanged = curIdx; return slowToCase(s, startIdx, destIdx); } assert(destIdx <= curIdx); } if(lastUnchanged != s.length) { destIdx = moveTo(s, destIdx, lastUnchanged, s.length); } s = s[0..destIdx]; } // helper to precalculate size of case-converted string private template toCaseLength(alias indexFn, uint maxIdx, alias tableFn) { size_t toCaseLength(C)(in C[] str) { import std.utf; size_t codeLen = 0; size_t lastNonTrivial = 0; size_t curIdx = 0; while(curIdx != str.length) { size_t startIdx = curIdx; dchar ch = decode(str, curIdx); ushort caseIndex = indexFn(ch); if(caseIndex == ushort.max) continue; else if(caseIndex < maxIdx) { codeLen += startIdx - lastNonTrivial; lastNonTrivial = curIdx; dchar cased = tableFn(caseIndex); codeLen += codeLength!C(cased); } else { codeLen += startIdx - lastNonTrivial; lastNonTrivial = curIdx; auto val = tableFn(caseIndex); auto len = val>>24; dchar cased = val & 0xFF_FFFF; codeLen += codeLength!C(cased); foreach(j; caseIndex+1..caseIndex+len) codeLen += codeLength!C(tableFn(j)); } } if(lastNonTrivial != str.length) codeLen += str.length - lastNonTrivial; return codeLen; } } unittest { import std.conv; alias toLowerLength = toCaseLength!(LowerTriple); assert(toLowerLength("abcd") == 4); assert(toLowerLength("аБВгд456") == 10+3); } // slower code path that preallocates and then copies // case-converted stuf to the new string private template toCaseInPlaceAlloc(alias indexFn, uint maxIdx, alias tableFn) { void toCaseInPlaceAlloc(C)(ref C[] s, size_t curIdx, size_t destIdx) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { import std.utf : decode; alias caseLength = toCaseLength!(indexFn, maxIdx, tableFn); auto trueLength = destIdx + caseLength(s[curIdx..$]); C[] ns = new C[trueLength]; ns[0..destIdx] = s[0..destIdx]; size_t lastUnchanged = curIdx; while(curIdx != s.length) { size_t startIdx = curIdx; // start of current codepoint dchar ch = decode(s, curIdx); auto caseIndex = indexFn(ch); if(caseIndex == ushort.max) // skip over { continue; } else if(caseIndex < maxIdx) // 1:1 codepoint mapping { dchar cased = tableFn(caseIndex); auto toCopy = startIdx - lastUnchanged; ns[destIdx .. destIdx+toCopy] = s[lastUnchanged .. startIdx]; lastUnchanged = curIdx; destIdx += toCopy; destIdx = encodeTo(ns, destIdx, cased); } else // 1:m codepoint mapping, slow codepath { auto toCopy = startIdx - lastUnchanged; ns[destIdx .. destIdx+toCopy] = s[lastUnchanged .. startIdx]; lastUnchanged = curIdx; destIdx += toCopy; auto val = tableFn(caseIndex); // unpack length + codepoint uint len = val>>24; destIdx = encodeTo(ns, destIdx, cast(dchar)(val & 0xFF_FFFF)); foreach(j; caseIndex+1..caseIndex+len) destIdx = encodeTo(ns, destIdx, tableFn(j)); } } if(lastUnchanged != s.length) { auto toCopy = s.length - lastUnchanged; ns[destIdx..destIdx+toCopy] = s[lastUnchanged..$]; destIdx += toCopy; } assert(ns.length == destIdx); s = ns; } } /++ Converts $(D s) to lowercase (by performing Unicode lowercase mapping) in place. For a few characters string length may increase after the transformation, in such a case the function reallocates exactly once. If $(D s) does not have any uppercase characters, then $(D s) is unaltered. +/ void toLowerInPlace(C)(ref C[] s) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { toCaseInPlace!(LowerTriple)(s); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { void toLowerInPlace(ref char[] s) { toLowerInPlace!char(s); } void toLowerInPlace(ref wchar[] s) { toLowerInPlace!wchar(s); } void toLowerInPlace(ref dchar[] s) { toLowerInPlace!dchar(s); } } /++ Converts $(D s) to uppercase (by performing Unicode uppercase mapping) in place. For a few characters string length may increase after the transformation, in such a case the function reallocates exactly once. If $(D s) does not have any lowercase characters, then $(D s) is unaltered. +/ void toUpperInPlace(C)(ref C[] s) @trusted pure if (is(C == char) || is(C == wchar) || is(C == dchar)) { toCaseInPlace!(UpperTriple)(s); } // overloads for the most common cases to reduce compile time/code size @safe pure /*TODO nothrow*/ { void toUpperInPlace(ref char[] s) { toUpperInPlace!char(s); } void toUpperInPlace(ref wchar[] s) { toUpperInPlace!wchar(s); } void toUpperInPlace(ref dchar[] s) { toUpperInPlace!dchar(s); } } /++ If $(D c) is a Unicode uppercase $(CHARACTER), then its lowercase equivalent is returned. Otherwise $(D c) is returned. Warning: certain alphabets like German and Greek have no 1:1 upper-lower mapping. Use overload of toLower which takes full string instead. +/ @safe pure nothrow @nogc dchar toLower(dchar c) { // optimize ASCII case if(c < 0xAA) { if(c < 'A') return c; if(c <= 'Z') return c + 32; return c; } size_t idx = toLowerSimpleIndex(c); if(idx != ushort.max) { return toLowerTab(idx); } return c; } /++ Returns a string which is identical to $(D s) except that all of its characters are converted to lowercase (by preforming Unicode lowercase mapping). If none of $(D s) characters were affected, then $(D s) itself is returned. +/ S toLower(S)(S s) @trusted pure if(isSomeString!S) { return toCase!(LowerTriple)(s); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { string toLower(string s) { return toLower!string(s); } wstring toLower(wstring s) { return toLower!wstring(s); } dstring toLower(dstring s) { return toLower!dstring(s); } } @trusted unittest //@@@BUG std.format is not @safe { import std.format : format; static import std.ascii; foreach(ch; 0..0x80) assert(std.ascii.toLower(ch) == toLower(ch)); assert(toLower('Я') == 'я'); assert(toLower('Δ') == 'δ'); foreach(ch; unicode.upperCase.byCodepoint) { dchar low = ch.toLower(); assert(low == ch || isLower(low), format("%s -> %s", ch, low)); } assert(toLower("АЯ") == "ая"); assert("\u1E9E".toLower == "\u00df"); assert("\u00df".toUpper == "SS"); } //bugzilla 9629 unittest { wchar[] test = "hello þ world"w.dup; auto piece = test[6..7]; toUpperInPlace(piece); assert(test == "hello Þ world"); } unittest { import std.algorithm : cmp; string s1 = "FoL"; string s2 = toLower(s1); assert(cmp(s2, "fol") == 0, s2); assert(s2 != s1); char[] s3 = s1.dup; toLowerInPlace(s3); assert(s3 == s2); s1 = "A\u0100B\u0101d"; s2 = toLower(s1); s3 = s1.dup; assert(cmp(s2, "a\u0101b\u0101d") == 0); assert(s2 !is s1); toLowerInPlace(s3); assert(s3 == s2); s1 = "A\u0460B\u0461d"; s2 = toLower(s1); s3 = s1.dup; assert(cmp(s2, "a\u0461b\u0461d") == 0); assert(s2 !is s1); toLowerInPlace(s3); assert(s3 == s2); s1 = "\u0130"; s2 = toLower(s1); s3 = s1.dup; assert(s2 == "i\u0307"); assert(s2 !is s1); toLowerInPlace(s3); assert(s3 == s2); // Test on wchar and dchar strings. assert(toLower("Some String"w) == "some string"w); assert(toLower("Some String"d) == "some string"d); // bugzilla 12455 dchar c = 'İ'; // '\U0130' LATIN CAPITAL LETTER I WITH DOT ABOVE assert(isUpper(c)); assert(toLower(c) == 'i'); // extend on 12455 reprot - check simple-case toUpper too c = '\u1f87'; assert(isLower(c)); assert(toUpper(c) == '\u1F8F'); } /++ If $(D c) is a Unicode lowercase $(CHARACTER), then its uppercase equivalent is returned. Otherwise $(D c) is returned. Warning: Certain alphabets like German and Greek have no 1:1 upper-lower mapping. Use overload of toUpper which takes full string instead. toUpper can be used as an argument to $(XREF_PACK algorithm,iteration,map) to produce an algorithm that can convert a range of characters to upper case without allocating memory. A string can then be produced by using $(XREF_PACK algorithm,mutation,copy) to send it to an $(XREF array, appender). +/ @safe pure nothrow @nogc dchar toUpper(dchar c) { // optimize ASCII case if(c < 0xAA) { if(c < 'a') return c; if(c <= 'z') return c - 32; return c; } size_t idx = toUpperSimpleIndex(c); if(idx != ushort.max) { return toUpperTab(idx); } return c; } /// unittest { import std.algorithm; import std.uni; import std.array; auto abuf = appender!(char[])(); "hello".map!toUpper.copy(&abuf); assert(abuf.data == "HELLO"); } @trusted unittest { import std.format : format; static import std.ascii; foreach(ch; 0..0x80) assert(std.ascii.toUpper(ch) == toUpper(ch)); assert(toUpper('я') == 'Я'); assert(toUpper('δ') == 'Δ'); auto title = unicode.Titlecase_Letter; foreach(ch; unicode.lowerCase.byCodepoint) { dchar up = ch.toUpper(); assert(up == ch || isUpper(up) || title[up], format("%x -> %x", ch, up)); } } /++ Returns a string which is identical to $(D s) except that all of its characters are converted to uppercase (by preforming Unicode uppercase mapping). If none of $(D s) characters were affected, then $(D s) itself is returned. +/ S toUpper(S)(S s) @trusted pure if(isSomeString!S) { return toCase!(UpperTriple)(s); } // overloads for the most common cases to reduce compile time @safe pure /*TODO nothrow*/ { string toUpper(string s) { return toUpper!string(s); } wstring toUpper(wstring s) { return toUpper!wstring(s); } dstring toUpper(dstring s) { return toUpper!dstring(s); } } unittest { import std.algorithm : cmp; string s1 = "FoL"; string s2; char[] s3; s2 = toUpper(s1); s3 = s1.dup; toUpperInPlace(s3); assert(s3 == s2, s3); assert(cmp(s2, "FOL") == 0); assert(s2 !is s1); s1 = "a\u0100B\u0101d"; s2 = toUpper(s1); s3 = s1.dup; toUpperInPlace(s3); assert(s3 == s2); assert(cmp(s2, "A\u0100B\u0100D") == 0); assert(s2 !is s1); s1 = "a\u0460B\u0461d"; s2 = toUpper(s1); s3 = s1.dup; toUpperInPlace(s3); assert(s3 == s2); assert(cmp(s2, "A\u0460B\u0460D") == 0); assert(s2 !is s1); } unittest { static void doTest(C)(const(C)[] s, const(C)[] trueUp, const(C)[] trueLow) { import std.format : format; string diff = "src: %( %x %)\nres: %( %x %)\ntru: %( %x %)"; auto low = s.toLower() , up = s.toUpper(); auto lowInp = s.dup, upInp = s.dup; lowInp.toLowerInPlace(); upInp.toUpperInPlace(); assert(low == trueLow, format(diff, low, trueLow)); assert(up == trueUp, format(diff, up, trueUp)); assert(lowInp == trueLow, format(diff, cast(ubyte[])s, cast(ubyte[])lowInp, cast(ubyte[])trueLow)); assert(upInp == trueUp, format(diff, cast(ubyte[])s, cast(ubyte[])upInp, cast(ubyte[])trueUp)); } foreach(S; AliasSeq!(dstring, wstring, string)) { S easy = "123"; S good = "abCФеж"; S awful = "\u0131\u023f\u2126"; S wicked = "\u0130\u1FE2"; auto options = [easy, good, awful, wicked]; S[] lower = ["123", "abcфеж", "\u0131\u023f\u03c9", "i\u0307\u1Fe2"]; S[] upper = ["123", "ABCФЕЖ", "I\u2c7e\u2126", "\u0130\u03A5\u0308\u0300"]; foreach(val; AliasSeq!(easy, good)) { auto e = val.dup; auto g = e; e.toUpperInPlace(); assert(e is g); e.toLowerInPlace(); assert(e is g); } foreach(i, v; options) { doTest(v, upper[i], lower[i]); } // a few combinatorial runs foreach(i; 0..options.length) foreach(j; i..options.length) foreach(k; j..options.length) { auto sample = options[i] ~ options[j] ~ options[k]; auto sample2 = options[k] ~ options[j] ~ options[i]; doTest(sample, upper[i] ~ upper[j] ~ upper[k], lower[i] ~ lower[j] ~ lower[k]); doTest(sample2, upper[k] ~ upper[j] ~ upper[i], lower[k] ~ lower[j] ~ lower[i]); } } } /++ Returns whether $(D c) is a Unicode alphabetic $(CHARACTER) (general Unicode category: Alphabetic). +/ @safe pure nothrow @nogc bool isAlpha(dchar c) { // optimization if(c < 0xAA) { size_t x = c - 'A'; if(x <= 'Z' - 'A') return true; else { x = c - 'a'; if(x <= 'z'-'a') return true; } return false; } return alphaTrie[c]; } @safe unittest { auto alpha = unicode("Alphabetic"); foreach(ch; alpha.byCodepoint) assert(isAlpha(ch)); foreach(ch; 0..0x4000) assert((ch in alpha) == isAlpha(ch)); } /++ Returns whether $(D c) is a Unicode mark (general Unicode category: Mn, Me, Mc). +/ @safe pure nothrow @nogc bool isMark(dchar c) { return markTrie[c]; } @safe unittest { auto mark = unicode("Mark"); foreach(ch; mark.byCodepoint) assert(isMark(ch)); foreach(ch; 0..0x4000) assert((ch in mark) == isMark(ch)); } /++ Returns whether $(D c) is a Unicode numerical $(CHARACTER) (general Unicode category: Nd, Nl, No). +/ @safe pure nothrow @nogc bool isNumber(dchar c) { // optimization for ascii case if (c <= 0x7F) { return c >= '0' && c <= '9'; } else { return numberTrie[c]; } } @safe unittest { auto n = unicode("N"); foreach(ch; n.byCodepoint) assert(isNumber(ch)); foreach(ch; 0..0x4000) assert((ch in n) == isNumber(ch)); } /++ Returns whether $(D c) is a Unicode alphabetic $(CHARACTER) or number. (general Unicode category: Alphabetic, Nd, Nl, No). Params: c = any Unicode character Returns: `true` if the character is in the Alphabetic, Nd, Nl, or No Unicode categories +/ @safe pure nothrow @nogc bool isAlphaNum(dchar c) { static import std.ascii; // optimization for ascii case if (std.ascii.isASCII(c)) { return std.ascii.isAlphaNum(c); } else { return isAlpha(c) || isNumber(c); } } @safe unittest { auto n = unicode("N"); auto alpha = unicode("Alphabetic"); foreach(ch; n.byCodepoint) assert(isAlphaNum(ch)); foreach(ch; alpha.byCodepoint) assert(isAlphaNum(ch)); foreach(ch; 0..0x4000) { assert(((ch in n) || (ch in alpha)) == isAlphaNum(ch)); } } /++ Returns whether $(D c) is a Unicode punctuation $(CHARACTER) (general Unicode category: Pd, Ps, Pe, Pc, Po, Pi, Pf). +/ @safe pure nothrow @nogc bool isPunctuation(dchar c) { static import std.ascii; // optimization for ascii case if (c <= 0x7F) { return std.ascii.isPunctuation(c); } else { return punctuationTrie[c]; } } unittest { assert(isPunctuation('\u0021')); assert(isPunctuation('\u0028')); assert(isPunctuation('\u0029')); assert(isPunctuation('\u002D')); assert(isPunctuation('\u005F')); assert(isPunctuation('\u00AB')); assert(isPunctuation('\u00BB')); foreach(ch; unicode("P").byCodepoint) assert(isPunctuation(ch)); } /++ Returns whether $(D c) is a Unicode symbol $(CHARACTER) (general Unicode category: Sm, Sc, Sk, So). +/ @safe pure nothrow @nogc bool isSymbol(dchar c) { return symbolTrie[c]; } unittest { import std.format : format; assert(isSymbol('\u0024')); assert(isSymbol('\u002B')); assert(isSymbol('\u005E')); assert(isSymbol('\u00A6')); foreach(ch; unicode("S").byCodepoint) assert(isSymbol(ch), format("%04x", ch)); } /++ Returns whether $(D c) is a Unicode space $(CHARACTER) (general Unicode category: Zs) Note: This doesn't include '\n', '\r', \t' and other non-space $(CHARACTER). For commonly used less strict semantics see $(LREF isWhite). +/ @safe pure nothrow @nogc bool isSpace(dchar c) { return isSpaceGen(c); } unittest { assert(isSpace('\u0020')); auto space = unicode.Zs; foreach(ch; space.byCodepoint) assert(isSpace(ch)); foreach(ch; 0..0x1000) assert(isSpace(ch) == space[ch]); } /++ Returns whether $(D c) is a Unicode graphical $(CHARACTER) (general Unicode category: L, M, N, P, S, Zs). +/ @safe pure nothrow @nogc bool isGraphical(dchar c) { return graphicalTrie[c]; } unittest { auto set = unicode("Graphical"); import std.format : format; foreach(ch; set.byCodepoint) assert(isGraphical(ch), format("%4x", ch)); foreach(ch; 0..0x4000) assert((ch in set) == isGraphical(ch)); } /++ Returns whether $(D c) is a Unicode control $(CHARACTER) (general Unicode category: Cc). +/ @safe pure nothrow @nogc bool isControl(dchar c) { return isControlGen(c); } unittest { assert(isControl('\u0000')); assert(isControl('\u0081')); assert(!isControl('\u0100')); auto cc = unicode.Cc; foreach(ch; cc.byCodepoint) assert(isControl(ch)); foreach(ch; 0..0x1000) assert(isControl(ch) == cc[ch]); } /++ Returns whether $(D c) is a Unicode formatting $(CHARACTER) (general Unicode category: Cf). +/ @safe pure nothrow @nogc bool isFormat(dchar c) { return isFormatGen(c); } unittest { assert(isFormat('\u00AD')); foreach(ch; unicode("Format").byCodepoint) assert(isFormat(ch)); } // code points for private use, surrogates are not likely to change in near feature // if need be they can be generated from unicode data as well /++ Returns whether $(D c) is a Unicode Private Use $(CODEPOINT) (general Unicode category: Co). +/ @safe pure nothrow @nogc bool isPrivateUse(dchar c) { return (0x00_E000 <= c && c <= 0x00_F8FF) || (0x0F_0000 <= c && c <= 0x0F_FFFD) || (0x10_0000 <= c && c <= 0x10_FFFD); } /++ Returns whether $(D c) is a Unicode surrogate $(CODEPOINT) (general Unicode category: Cs). +/ @safe pure nothrow @nogc bool isSurrogate(dchar c) { return (0xD800 <= c && c <= 0xDFFF); } /++ Returns whether $(D c) is a Unicode high surrogate (lead surrogate). +/ @safe pure nothrow @nogc bool isSurrogateHi(dchar c) { return (0xD800 <= c && c <= 0xDBFF); } /++ Returns whether $(D c) is a Unicode low surrogate (trail surrogate). +/ @safe pure nothrow @nogc bool isSurrogateLo(dchar c) { return (0xDC00 <= c && c <= 0xDFFF); } /++ Returns whether $(D c) is a Unicode non-character i.e. a $(CODEPOINT) with no assigned abstract character. (general Unicode category: Cn) +/ @safe pure nothrow @nogc bool isNonCharacter(dchar c) { return nonCharacterTrie[c]; } unittest { auto set = unicode("Cn"); foreach(ch; set.byCodepoint) assert(isNonCharacter(ch)); } private: // load static data from pre-generated tables into usable datastructures @safe auto asSet(const (ubyte)[] compressed) pure { return CodepointSet.fromIntervals(decompressIntervals(compressed)); } @safe pure nothrow auto asTrie(T...)(in TrieEntry!T e) { return const(CodepointTrie!T)(e.offsets, e.sizes, e.data); } @safe pure nothrow @nogc @property { // It's important to use auto return here, so that the compiler // only runs semantic on the return type if the function gets // used. Also these are functions rather than templates to not // increase the object size of the caller. auto lowerCaseTrie() { static immutable res = asTrie(lowerCaseTrieEntries); return res; } auto upperCaseTrie() { static immutable res = asTrie(upperCaseTrieEntries); return res; } auto simpleCaseTrie() { static immutable res = asTrie(simpleCaseTrieEntries); return res; } auto fullCaseTrie() { static immutable res = asTrie(fullCaseTrieEntries); return res; } auto alphaTrie() { static immutable res = asTrie(alphaTrieEntries); return res; } auto markTrie() { static immutable res = asTrie(markTrieEntries); return res; } auto numberTrie() { static immutable res = asTrie(numberTrieEntries); return res; } auto punctuationTrie() { static immutable res = asTrie(punctuationTrieEntries); return res; } auto symbolTrie() { static immutable res = asTrie(symbolTrieEntries); return res; } auto graphicalTrie() { static immutable res = asTrie(graphicalTrieEntries); return res; } auto nonCharacterTrie() { static immutable res = asTrie(nonCharacterTrieEntries); return res; } //normalization quick-check tables auto nfcQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfcQCTrieEntries); return res; } auto nfdQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfdQCTrieEntries); return res; } auto nfkcQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfkcQCTrieEntries); return res; } auto nfkdQCTrie() { import std.internal.unicode_norm; static immutable res = asTrie(nfkdQCTrieEntries); return res; } //grapheme breaking algorithm tables auto mcTrie() { import std.internal.unicode_grapheme; static immutable res = asTrie(mcTrieEntries); return res; } auto graphemeExtendTrie() { import std.internal.unicode_grapheme; static immutable res = asTrie(graphemeExtendTrieEntries); return res; } auto hangLV() { import std.internal.unicode_grapheme; static immutable res = asTrie(hangulLVTrieEntries); return res; } auto hangLVT() { import std.internal.unicode_grapheme; static immutable res = asTrie(hangulLVTTrieEntries); return res; } // tables below are used for composition/decomposition auto combiningClassTrie() { import std.internal.unicode_comp; static immutable res = asTrie(combiningClassTrieEntries); return res; } auto compatMappingTrie() { import std.internal.unicode_decomp; static immutable res = asTrie(compatMappingTrieEntries); return res; } auto canonMappingTrie() { import std.internal.unicode_decomp; static immutable res = asTrie(canonMappingTrieEntries); return res; } auto compositionJumpTrie() { import std.internal.unicode_comp; static immutable res = asTrie(compositionJumpTrieEntries); return res; } //case conversion tables auto toUpperIndexTrie() { static immutable res = asTrie(toUpperIndexTrieEntries); return res; } auto toLowerIndexTrie() { static immutable res = asTrie(toLowerIndexTrieEntries); return res; } auto toTitleIndexTrie() { static immutable res = asTrie(toTitleIndexTrieEntries); return res; } //simple case conversion tables auto toUpperSimpleIndexTrie() { static immutable res = asTrie(toUpperSimpleIndexTrieEntries); return res; } auto toLowerSimpleIndexTrie() { static immutable res = asTrie(toLowerSimpleIndexTrieEntries); return res; } auto toTitleSimpleIndexTrie() { static immutable res = asTrie(toTitleSimpleIndexTrieEntries); return res; } } }// version(!std_uni_bootstrap)
D
// REQUIRED_ARGS: -Icompilable/imports import test19750b; class Foo { import test19750a; void func (Bar ) {} }
D
/home/hoover/u10/breber/458/sem_proj/rust-parallelism/message_passing/target/debug/build/crossbeam-epoch-1b51710d4b8b00ec/build_script_build-1b51710d4b8b00ec: /u/breber/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.8.2/build.rs /home/hoover/u10/breber/458/sem_proj/rust-parallelism/message_passing/target/debug/build/crossbeam-epoch-1b51710d4b8b00ec/build_script_build-1b51710d4b8b00ec.d: /u/breber/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.8.2/build.rs /u/breber/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-epoch-0.8.2/build.rs:
D
func void ZS_PotionAlchemy() { PrintDebugNpc(PD_TA_FRAME,"ZS_PotionAlchemy"); B_SetPerception(self); if(!C_BodyStateContains(self,BS_MOBINTERACT_INTERRUPT)) { AI_SetWalkMode(self,NPC_WALK); if(Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == 0) { AI_GotoWP(self,self.wp); }; AI_UseMob(self,"LAB",1); }; }; func void ZS_PotionAlchemy_Loop() { var int randomizer; PrintDebugNpc(PD_TA_LOOP,"ZS_PotionAlchemy_Loop"); randomizer = Hlp_Random(20); if(Npc_GetStateTime(self) >= (100 + randomizer)) { B_InterruptMob("LAB"); }; AI_Wait(self,1); }; func void ZS_PotionAlchemy_End() { AI_UseMob(self,"LAB",-1); PrintDebugNpc(PD_TA_FRAME,"ZS_PotionAlchemy_End"); };
D
module android.java.android.provider.Contacts_ContactMethodsColumns_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import0 = android.java.java.lang.Class_d_interface; @JavaName("Contacts$ContactMethodsColumns") final class Contacts_ContactMethodsColumns : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import import0.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/provider/Contacts$ContactMethodsColumns;"; }
D
a cage in which a bird can be kept
D
module allegro5.internal.da5; char[] ColorWrapper(in char[] prefix, in char[] func, in char[] arg_decls, in char[] arg_names) { return `nothrow @nogc ALLEGRO_COLOR ` ~ func ~ `(` ~ arg_decls ~ `) { auto ret = ` ~ prefix ~ func ~ `(` ~ arg_names ~ `); version(ALLEGRO_SUB) { asm nothrow @nogc { sub ESP, 4; } } return ret; }`; } version(D_Version2) mixin(`alias const(char) const_char;`); else alias char const_char;
D
func void B_AssessQuietSound() { PrintDebugNpc(PD_ZS_FRAME,"B_AssessQuietSound"); PrintGlobals(PD_ZS_FRAME); if(Npc_GetDistToItem(self,item) > PERC_DIST_DIALOG) { PrintDebugNpc(PD_ZS_FRAME,"... to far"); return; }; if(Npc_CanSeeSource(self)) { PrintDebugNpc(PD_ZS_Check,"...kann Geräuschquelle sehen!"); if(Snd_IsSourceNpc(self)) { PrintDebugNpc(PD_ZS_Check,"...Geräuschquelle ist SC!"); if(Npc_GetTempAttitude(self,other) == ATT_HOSTILE) { PrintDebugNpc(PD_ZS_Check,"...SC ist HOSTILE!"); Npc_ClearAIQueue(self); AI_StartState(self,ZS_AssessEnemy,0,""); }; }; } else { PrintDebugNpc(PD_ZS_Check,"...kann NICHT Geräuschquelle sehen!"); if(Snd_IsSourceNpc(self)) { Npc_ClearAIQueue(self); AI_StartState(self,ZS_AssessQuietSound,0,""); }; }; };
D
; Copyright (C) 2008 The Android Open Source Project ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; http://www.apache.org/licenses/LICENSE-2.0 ; ; Unless required by applicable law or agreed to in writing, software ; distributed under the License is distributed on an "AS IS" BASIS, ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ; See the License for the specific language governing permissions and ; limitations under the License. .source T_opc_goto_3.java .class public dot.junit.opcodes.opc_goto.d.T_opc_goto_3 .super java/lang/Object .method public <init>()V .limit regs 1 invoke-direct {v0}, java/lang/Object/<init>()V return-void .end method .method public run(I)I .limit regs 5 goto Label2 Label2: return v4 .end method
D
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKBaseanti.build/Client/DescribeIpResourceFlowExecutor.swift.o : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/CleanThresholdSpec.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResource.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceFlowDetail.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceProtectInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/SetCleanThresholdExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceInfoExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceProtectInfoExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourcesExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceFlowExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/BaseantiClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceFlow.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKBaseanti.build/DescribeIpResourceFlowExecutor~partial.swiftmodule : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/CleanThresholdSpec.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResource.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceFlowDetail.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceProtectInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/SetCleanThresholdExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceInfoExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceProtectInfoExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourcesExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceFlowExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/BaseantiClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceFlow.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKBaseanti.build/DescribeIpResourceFlowExecutor~partial.swiftdoc : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/CleanThresholdSpec.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResource.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceFlowDetail.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceProtectInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/SetCleanThresholdExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceInfoExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceProtectInfoExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourcesExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/DescribeIpResourceFlowExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Client/BaseantiClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/SetCleanThresholdRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceInfoRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceProtectInfoRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourcesRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/API/DescribeIpResourceFlowRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKBaseanti/Model/IpResourceFlow.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.build/Connection/DatabaseStringFindable.swift.o : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/KeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/DatabaseKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/DictionaryKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/MemoryKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseStringFindable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseConnectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/URL+DatabaseName.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/Database.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/ConfiguredDatabase.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/DatabaseConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/KeyedCacheSupporting.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/LogSupporting.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLog.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/Container+ConnectionPool.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPool.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/Container+CachedConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/Container+NewConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Service/DatabaseKitProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/DatabaseIdentifier.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLogHandler.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/PrintLogHandler.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/DatabaseKitError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/Databases.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/Exports.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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.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/user/Documents/RiseTimeAssets/server/.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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /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/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.build/DatabaseStringFindable~partial.swiftmodule : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/KeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/DatabaseKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/DictionaryKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/MemoryKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseStringFindable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseConnectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/URL+DatabaseName.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/Database.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/ConfiguredDatabase.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/DatabaseConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/KeyedCacheSupporting.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/LogSupporting.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLog.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/Container+ConnectionPool.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPool.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/Container+CachedConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/Container+NewConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Service/DatabaseKitProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/DatabaseIdentifier.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLogHandler.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/PrintLogHandler.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/DatabaseKitError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/Databases.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/Exports.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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.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/user/Documents/RiseTimeAssets/server/.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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /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/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/DatabaseKit.build/DatabaseStringFindable~partial.swiftdoc : /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/Deprecated.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/KeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/DatabaseKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/DictionaryKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/MemoryKeyedCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolCache.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseStringFindable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseConnectable.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/URL+DatabaseName.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/Database.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/ConfiguredDatabase.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/DatabaseConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPoolConfig.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/KeyedCache/KeyedCacheSupporting.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/LogSupporting.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLog.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/Container+ConnectionPool.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/ConnectionPool/DatabaseConnectionPool.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/Container+CachedConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/DatabaseConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Connection/Container+NewConnection.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Service/DatabaseKitProvider.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLogger.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/DatabaseIdentifier.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/DatabaseLogHandler.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Log/PrintLogHandler.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/DatabaseKitError.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Database/Databases.swift /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/database-kit.git--3872818599693266265/Sources/DatabaseKit/Utilities/Exports.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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.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/user/Documents/RiseTimeAssets/server/.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/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /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/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/user/Documents/RiseTimeAssets/server/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/user/Documents/RiseTimeAssets/server/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /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
module android.java.android.telecom.Conferenceable_d_interface; import arsd.jni : IJavaObjectImplementation, JavaPackageId, JavaName, IJavaObject, ImportExportImpl, JavaInterfaceMembers; static import arsd.jni; import import0 = android.java.java.lang.Class_d_interface; final class Conferenceable : IJavaObject { static immutable string[] _d_canCastTo = [ ]; @Import import0.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/telecom/Conferenceable;"; }
D
module shu.util.pool.bufferpool; class BufferPool { this() { // Constructor code } }
D
// ************************************************** // EXIT // ************************************************** INSTANCE DIA_Kron_Exit (C_INFO) { npc = Non_4025_Kron; nr = 999; condition = DIA_Kron_Exit_Condition; information = DIA_Kron_Exit_Info; permanent = 1; description = DIALOG_ENDE; }; FUNC INT DIA_Kron_Exit_Condition() { return 1; }; FUNC VOID DIA_Kron_Exit_Info() { B_StopProcessInfos ( self ); }; // ************************************************** // hello // ************************************************** INSTANCE DIA_Kron_Hello (C_INFO) { npc = Non_4025_Kron; nr = 1; condition = DIA_Kron_Hello_Condition; information = DIA_Kron_Hello_Info; permanent = 0; important = 1; description = ""; }; FUNC INT DIA_Kron_Hello_Condition() { return 1; }; FUNC VOID DIA_Kron_Hello_Info() { AI_Output (other, self, "DIA_Kron_Hello_15_01"); //Niech mnie szlag trafi. Chędożony ork! AI_Output (self, other, "DIA_Kron_Hello_11_02"); //Gdyby moja być zły ork, Morra by już nie żyć. AI_Output (self, other, "DIA_Kron_Hello_11_03"); //Morra uważać co mówić, Moja więcej nie ostrzegać. AI_Output (other, self, "DIA_Kron_Hello_15_04"); //I do tego gada... AI_Output (self, other, "DIA_Kron_Hello_11_05"); //Morra odejść, Morra cieszyć się życie, póki móc. Log_CreateTopic (CH2_TRL_Ork, LOG_MISSION); Log_SetTopicStatus (CH2_TRL_Ork, LOG_RUNNING); B_LogEntry (CH2_TRL_Ork, "Jednym z łowców trolli jest... ork. Ten świat już całkiem stanął na głowie!"); B_StopProcessInfos (self); }; // ************************************************** INSTANCE DIA_Kron_What (C_INFO) { npc = Non_4025_Kron; nr = 2; condition = DIA_Kron_What_Condition; information = DIA_Kron_What_Info; permanent = 0; important = 0; description = "Co tu robisz?"; }; FUNC INT DIA_Kron_What_Condition() { if (Npc_KnowsInfo (hero,DIA_Kron_Hello)) { return 1; }; }; FUNC VOID DIA_Kron_What_Info() { AI_Output (other, self, "DIA_Kron_What_15_01"); //Co tu robisz? AI_Output (self, other, "DIA_Kron_What_11_02"); //Moja być renegat. Mała Morra uratować Moja z łap troll. AI_Output (self, other, "DIA_Kron_What_11_03"); //Moja być wdzięczna, moja przysięgać, że walczyć dla Mała Morra. AI_Output (other, self, "DIA_Kron_What_15_04"); //Co to za Mała Morra? AI_Output (self, other, "DIA_Kron_What_11_05"); //Mała Morra być przewodnik stada, sikać na siedząco, ale rozkazywać. AI_Output (other, self, "DIA_Kron_What_15_06"); //Mówisz o Kirze?! AI_Output (self, other, "DIA_Kron_What_11_07"); //Tak, Mała Morra, zwać się Kira. Moja przysięgać, moja zostać z Mała Morra. B_LogEntry (CH2_TRL_Ork, "Ork twierdzi, że zawdzięcza życie Kirze. Nie ufam skurczybykowi, najchętniej poszatkowałbym go na tysiąc kawałków."); B_StopProcessInfos (self); }; // ************************************************** INSTANCE DIA_Kron_Fight (C_INFO) { npc = Non_4025_Kron; nr = 3; condition = DIA_Kron_Fight_Condition; information = DIA_Kron_Fight_Info; permanent = 0; important = 0; description = "Dobry ork, to martwy ork!"; }; FUNC INT DIA_Kron_Fight_Condition() { if (Npc_KnowsInfo (hero,DIA_Kron_Hello))&&(TH_trust >= 1) { return 1; }; }; FUNC VOID DIA_Kron_Fight_Info() { AI_Output (other, self, "DIA_Kron_Fight_15_01"); //Dobry ork to martwy ork! AI_Output (self, other, "DIA_Kron_Fight_11_02"); //Morra chcieć rozgniewać Moja? Moja nie walczyć z Morra, Mała Morra zakazać zabijać inna Morra. AI_Output (other, self, "DIA_Kron_Fight_15_03"); //Słuchasz tego co mówi ci ktoś kto sika na siedząco? AI_Output (self, other, "DIA_Kron_Fight_11_04"); //Moja spłacać dług życia, Moja posłuchać Mała Morra. Moja nie zabijać inna Morra, nawet jak mieć ochota. AI_Output (self, other, "DIA_Kron_Fight_11_05"); //Morra odejść, zostawić Moja w spokój. B_LogEntry (CH2_TRL_Ork, "Spróbowałem sprowokować orka, ale albo naprawdę boi się Kiry, albo uważa mnie za natręta nie groźniejszego od muchy. Czas skopać zielone dupsko!"); B_StopProcessInfos (self); }; // ************************************************** INSTANCE DIA_Kron_Fight1 (C_INFO) { npc = Non_4025_Kron; nr = 4; condition = DIA_Kron_Fight1_Condition; information = DIA_Kron_Fight1_Info; permanent = 0; important = 0; description = "Zdychaj cholerny orku!"; }; FUNC INT DIA_Kron_Fight1_Condition() { if (Npc_KnowsInfo (hero,DIA_Kron_Fight)) { return 1; }; }; FUNC VOID DIA_Kron_Fight1_Info() { Npc_SetTempAttitude(self, ATT_FRIENDLY); AI_Output (other, self, "DIA_Kron_Fight1_15_01"); //Zdychaj cholerny orku! AI_Output (self, other, "DIA_Kron_Fight1_11_02"); //Moja nie walczyć, Morra odejść. AI_DrawWeapon (other); AI_Output (other, self, "DIA_Kron_Fight1_15_03"); //Nigdzie nie idę, pora przelać zieloną krew. AI_Output (self, other, "DIA_Kron_Fight1_11_04"); //Moja obiecać nie walczyć, ale Moja musieć się bronić. AI_DrawWeapon (self); AI_Output (self, other, "DIA_Kron_Fight1_11_05"); //Morra pożałować głupia słowa! B_LogEntry (CH2_TRL_Ork, "Wyciągnąłem miecz i postawiłem sprawę jasno - on albo ja!"); B_StopProcessInfos (self); B_SetTimedATT(self,30*events_per_sec,(-70),(-70),(-100)); B_StartAfterDialogFight(self,other,false); }; // ************************************************** INSTANCE DIA_Kron_AfterFight (C_INFO) { npc = Non_4025_Kron; nr = 5; condition = DIA_Kron_AfterFight_Condition; information = DIA_Kron_AfterFight_Info; permanent = 0; important = 1; description = ""; }; FUNC INT DIA_Kron_AfterFight_Condition() { if (Npc_KnowsInfo (hero,DIA_Kron_Fight1)) { return 1; }; }; FUNC VOID DIA_Kron_AfterFight_Info() { if (Npc_GetAivar(self,AIV_HASDEFEATEDSC) == TRUE) { AI_Output (self, other, "DIA_Kron_AfterFight_11_01"); //Moja nie chcieć walczyć, ale Morra zaatakować Moja. AI_Output (self, other, "DIA_Kron_AfterFight_11_02"); //Morra przegrać, Morra odejść i nie wracać. AI_Output (self, other, "DIA_Kron_AfterFight_11_03"); //Moja powiedzieć Mała Morra, dziwna Morra być zła. Log_SetTopicStatus (CH2_TRL_Ork, LOG_FAILED); B_LogEntry (CH2_TRL_Ork, "Ten cholerny ork mnie sprał! Z tego co zrozumiałem to chyba ładnie obsmaruje mnie przed Kirą."); B_LogEntry (CH2_TRL_Quest, "Naraziłem się temu cholernemu orkowi!"); } else if (Npc_GetAivar(self,AIV_WASDEFEATEDBYSC) == TRUE) { TH_trust = TH_trust + 1; B_GiveXP(400); AI_Output (self, other, "DIA_Kron_AfterFight_11_04"); //Morra pokonać Moja... Morra być wielka wojownik. AI_Output (self, other, "DIA_Kron_AfterFight_11_05"); //Moja nie chcieć walczyć, Morra wygrać, Morra dostać szacunek Moja. AI_Output (self, other, "DIA_Kron_AfterFight_11_06"); //Moja powiedzieć Mała Morra, dziwna Morra być dobra wojownik. AI_Output (self, other, "DIA_Kron_AfterFight_11_07"); //Morra odejść, Moja musieć odzyskać siła po walka... Log_SetTopicStatus (CH2_TRL_Ork, LOG_SUCCESS); B_LogEntry (CH2_TRL_Ork, "Pokonałem tą zieloną kupę łajna. Chociaż z drugiej strony ork okazał szacunek zwycięzcy, co ludziom rzadko się zdarza. Chyba źle go oceniłem. Może mógłbym... polubić tego dziwnego orka."); B_LogEntry (CH2_TRL_Quest, "Wygrałem walkę z orkiem i chyba zdobyłem jego szacunek."); }; B_StopProcessInfos (self); };
D
module UnrealScript.UnrealEd.StaticMeshExporterT3D; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.UnrealEd.ExporterT3DX; extern(C++) interface StaticMeshExporterT3D : ExporterT3DX { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class UnrealEd.StaticMeshExporterT3D")); } private static __gshared StaticMeshExporterT3D mDefaultProperties; @property final static StaticMeshExporterT3D DefaultProperties() { mixin(MGDPC("StaticMeshExporterT3D", "StaticMeshExporterT3D UnrealEd.Default__StaticMeshExporterT3D")); } }
D
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Routing.build/Routing/RoutableComponent.swift.o : /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/RouterNode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/Route.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/ParameterValue.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/RouterOption.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/Parameter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/TrieRouter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/RoutingError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/Parameters.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/RoutableComponent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/PathComponent.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Routing.build/RoutableComponent~partial.swiftmodule : /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/RouterNode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/Route.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/ParameterValue.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/RouterOption.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/Parameter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/TrieRouter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/RoutingError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/Parameters.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/RoutableComponent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/PathComponent.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Routing.build/RoutableComponent~partial.swiftdoc : /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/Deprecated.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/RouterNode.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/Route.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/ParameterValue.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/RouterOption.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/Parameter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/TrieRouter.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/RoutingError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Parameter/Parameters.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Utilities/Exports.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Routing/RoutableComponent.swift /Users/Khanh/vapor/TILApp/.build/checkouts/routing.git-5366657101075133678/Sources/Routing/Register/PathComponent.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Service.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
// //---------------------------------------------------------------------- // Copyright 2007-2011 Mentor Graphics Corporation // Copyright 2007-2010 Cadence Design Systems, Inc. // Copyright 2010 Synopsys, Inc. // Copyright 2012-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. //---------------------------------------------------------------------- module uvm.base.uvm_domain; import uvm.base.uvm_common_phases; import uvm.base.uvm_phase; import uvm.base.uvm_runtime_phases; import uvm.base.uvm_object_globals; import uvm.base.uvm_message_defines; import uvm.meta.misc; import esdl.data.queue; import std.algorithm; // typedef class uvm_build_phase; // typedef class uvm_connect_phase; // typedef class uvm_end_of_elaboration_phase; // typedef class uvm_start_of_simulation_phase; // typedef class uvm_run_phase; // typedef class uvm_extract_phase; // typedef class uvm_check_phase; // typedef class uvm_report_phase; // typedef class uvm_final_phase; // typedef class uvm_pre_reset_phase; // typedef class uvm_reset_phase; // typedef class uvm_post_reset_phase; // typedef class uvm_pre_configure_phase; // typedef class uvm_configure_phase; // typedef class uvm_post_configure_phase; // typedef class uvm_pre_main_phase; // typedef class uvm_main_phase; // typedef class uvm_post_main_phase; // typedef class uvm_pre_shutdown_phase; // typedef class uvm_shutdown_phase; // typedef class uvm_post_shutdown_phase; final class uvm_once_domain_globals { @uvm_public_sync uvm_phase _build_ph; @uvm_public_sync uvm_phase _connect_ph; @uvm_public_sync uvm_phase _end_of_elaboration_ph; @uvm_public_sync uvm_phase _start_of_simulation_ph; @uvm_public_sync uvm_phase _run_ph; @uvm_public_sync uvm_phase _extract_ph; @uvm_public_sync uvm_phase _check_ph; @uvm_public_sync uvm_phase _report_ph; } public uvm_once_domain_globals _uvm_domain_globals_once; mixin(uvm_once_sync!(uvm_once_domain_globals, "_uvm_domain_globals")); //------------------------------------------------------------------------------ // // Class: uvm_domain // //------------------------------------------------------------------------------ // // Phasing schedule node representing an independent branch of the schedule. // Handle used to assign domains to components or hierarchies in the testbench // final class uvm_once_domain { @uvm_private_sync private uvm_domain _m_common_domain; @uvm_private_sync private uvm_domain _m_uvm_domain; // run-time phases @uvm_private_sync private uvm_domain[string] _m_domains; @uvm_private_sync private uvm_phase _m_uvm_schedule; } class uvm_domain: uvm_phase { mixin(uvm_once_sync!(uvm_once_domain)); // Function: get_domains // // Provides a list of all domains in the provided ~domains~ argument. // static public void get_domains(out uvm_domain[string] domains) { synchronized(_once) { domains = m_domains; } } static public uvm_domain[string] get_domains() { synchronized(_once) { return m_domains; } } // Function: get_uvm_schedule // // Get the "UVM" schedule, which consists of the run-time phases that // all components execute when participating in the "UVM" domain. // static public uvm_phase get_uvm_schedule() { get_uvm_domain(); synchronized(_once) { return m_uvm_schedule; } } // Function: get_common_domain // // Get the "common" domain, which consists of the common phases that // all components execute in sync with each other. Phases in the "common" // domain are build, connect, end_of_elaboration, start_of_simulation, run, // extract, check, report, and final. // static public uvm_domain get_common_domain() { // defined in SV version but not used anywhere // uvm_phase schedule; synchronized(_once) { if (m_common_domain !is null) { return m_common_domain; } } uvm_domain domain = new uvm_domain("common"); domain.add(uvm_build_phase.get()); domain.add(uvm_connect_phase.get()); domain.add(uvm_end_of_elaboration_phase.get()); domain.add(uvm_start_of_simulation_phase.get()); domain.add(uvm_run_phase.get()); domain.add(uvm_extract_phase.get()); domain.add(uvm_check_phase.get()); domain.add(uvm_report_phase.get()); domain.add(uvm_final_phase.get()); synchronized(_once) { _once._m_domains["common"] = domain; // for backward compatibility, make common phases visible; // same as uvm_<name>_phase.get(). build_ph = domain.find(uvm_build_phase.get()); connect_ph = domain.find(uvm_connect_phase.get()); end_of_elaboration_ph = domain.find(uvm_end_of_elaboration_phase.get()); start_of_simulation_ph = domain.find(uvm_start_of_simulation_phase.get()); run_ph = domain.find(uvm_run_phase.get()); extract_ph = domain.find(uvm_extract_phase.get()); check_ph = domain.find(uvm_check_phase.get()); report_ph = domain.find(uvm_report_phase.get()); m_common_domain = domain; domain = get_uvm_domain(); m_common_domain.add(domain, m_common_domain.find(uvm_run_phase.get())); return m_common_domain; } } // Function: add_uvm_phases // // Appends to the given ~schedule~ the built-in UVM phases. // static public void add_uvm_phases(uvm_phase schedule) { schedule.add(uvm_pre_reset_phase.get()); schedule.add(uvm_reset_phase.get()); schedule.add(uvm_post_reset_phase.get()); schedule.add(uvm_pre_configure_phase.get()); schedule.add(uvm_configure_phase.get()); schedule.add(uvm_post_configure_phase.get()); schedule.add(uvm_pre_main_phase.get()); schedule.add(uvm_main_phase.get()); schedule.add(uvm_post_main_phase.get()); schedule.add(uvm_pre_shutdown_phase.get()); schedule.add(uvm_shutdown_phase.get()); schedule.add(uvm_post_shutdown_phase.get()); } // Function: get_uvm_domain // // Get a handle to the singleton ~uvm~ domain // static public uvm_domain get_uvm_domain() { synchronized(_once) { if (m_uvm_domain is null) { m_uvm_domain = new uvm_domain("uvm"); m_uvm_schedule = new uvm_phase("uvm_sched", UVM_PHASE_SCHEDULE); add_uvm_phases(m_uvm_schedule); m_uvm_domain.add(m_uvm_schedule); } return m_uvm_domain; } } // Function: new // // Create a new instance of a phase domain. public this(string name="") { super(name,UVM_PHASE_DOMAIN); synchronized(_once) { if (name in m_domains) { uvm_error("UNIQDOMNAM", format("Domain created with non-unique name '%s'", name)); } _once._m_domains[name] = this; } } // Function: jump // // jumps all active phases of this domain to to-phase if // there is a path between active-phase and to-phase override public void jump(uvm_phase phase) { // synchronized(this) { uvm_phase[] phases = m_get_transitive_children(); foreach(ph; filter!((uvm_phase p) { return (p.get_state >= UVM_PHASE_STARTED && p.get_state <= UVM_PHASE_CLEANUP); }) (phases)) { if(ph.is_before(phase) || ph.is_after(phase)) ph.jump(phase); } // } } // jump_all // -------- static public void jump_all(uvm_phase phase) { uvm_domain[string] domains = get_domains(); // get_domains(domains); foreach(domain; domains) { domain.jump(phase); } } }
D
module ithox.qrcode.common.formatinformation; import ithox.qrcode.common.errorcorrectionlevel; import ithox.qrcode.common.bitutils; /** * Encapsulates a QR Code's format information, including the data mask used and * error correction level. */ class FormatInformation { /** * Mask for format information. */ enum int FORMAT_INFO_MASK_QR = 0x5412; /** * Lookup table for decoding format information. * * See ISO 18004:2006, Annex C, Table C.1 * * @var array */ protected static int[][] formatInfoDecodeLookup = [ [0x5412, 0x00 ], [0x5125, 0x01], [ 0x5e7c, 0x02 ], [0x5b4b, 0x03], [ 0x45f9, 0x04 ], [0x40ce, 0x05], [ 0x4f97, 0x06 ], [0x4aa0, 0x07], [ 0x77c4, 0x08 ], [0x72f3, 0x09], [ 0x7daa, 0x0a ], [0x789d, 0x0b], [ 0x662f, 0x0c ], [0x6318, 0x0d], [ 0x6c41, 0x0e ], [0x6976, 0x0f], [ 0x1689, 0x10 ], [0x13be, 0x11], [ 0x1ce7, 0x12 ], [0x19d0, 0x13], [ 0x0762, 0x14 ], [0x0255, 0x15], [ 0x0d0c, 0x16 ], [0x083b, 0x17], [ 0x355f, 0x18 ], [0x3068, 0x19], [ 0x3f31, 0x1a ], [0x3a06, 0x1b], [0x24b4, 0x1c], [0x2183, 0x1d], [0x2eda, 0x1e], [0x2bed, 0x1f],]; /** * Offset i holds the number of 1 bits in the binary representation of i. * * @var array */ protected static int[] bitsSetInHalfByte = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]; /** * Error correction level. * * @var ErrorCorrectionLevel */ protected ErrorCorrectionLevel ecLevel; /** * Data mask. * * @var integer */ protected int dataMask; this(int formatInfo) { this.ecLevel = cast(ErrorCorrectionLevel)((formatInfo >> 3) & 0x3); this.dataMask = formatInfo & 0x7; } /** * Checks how many bits are different between two integers. * * @param integer a * @param integer b * @return integer */ public static int numBitsDiffering(int a, int b) { a ^= b; return (bitsSetInHalfByte[a & 0xf] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 4) & 0xf)] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 8) & 0xf)] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 12) & 0xf)] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 16) & 0xf)] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 20) & 0xf)] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 24) & 0xf)] + bitsSetInHalfByte[(BitUtils.unsignedRightShift(a, 28) & 0xf)]); } /** * Decodes format information. * * @param integer $maskedFormatInfo1 * @param integer $maskedFormatInfo2 * @return FormatInformation|null */ public static FormatInformation decodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2) { auto formatInfo = doDecodeFormatInformation(maskedFormatInfo1, maskedFormatInfo2); if (formatInfo !is null) { return formatInfo; } // Should return null, but, some QR codes apparently do not mask this // info. Try again by actually masking the pattern first. return doDecodeFormatInformation(maskedFormatInfo1 ^ FORMAT_INFO_MASK_QR, maskedFormatInfo2 ^ FORMAT_INFO_MASK_QR); } /** * Internal method for decoding format information. * * @param integer $maskedFormatInfo1 * @param integer $maskedFormatInfo2 * @return FormatInformation|null */ protected static FormatInformation doDecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2) { int bestDifference = int.max; int bestFormatInfo = 0; foreach (decodeInfo; formatInfoDecodeLookup) { auto targetInfo = decodeInfo[0]; if (targetInfo == maskedFormatInfo1 || targetInfo == maskedFormatInfo2) { // Found an exact match return new FormatInformation(decodeInfo[1]); } auto bitsDifference = numBitsDiffering(maskedFormatInfo1, targetInfo); if (bitsDifference < bestDifference) { bestFormatInfo = decodeInfo[1]; bestDifference = bitsDifference; } if (maskedFormatInfo1 != maskedFormatInfo2) { // Also try the other option bitsDifference = numBitsDiffering(maskedFormatInfo2, targetInfo); if (bitsDifference < bestDifference) { bestFormatInfo = decodeInfo[1]; bestDifference = bitsDifference; } } } // Hamming distance of the 32 masked codes is 7, by construction, so // <= 3 bits differing means we found a match. if (bestDifference <= 3) { return new FormatInformation(bestFormatInfo); } return null; } /** * Gets the error correction level. * * @return ErrorCorrectionLevel */ public ErrorCorrectionLevel getErrorCorrectionLevel() { return this.ecLevel; } /** * Gets the data mask. * * @return integer */ public int getDataMask() { return this.dataMask; } /** * Hashes the code of the EC level. * * @return integer */ public int hashCode() { return (this.ecLevel << 3) | this.dataMask; } /** * Verifies if this instance equals another one. * * @param mixed $other * @return boolean */ public bool equals(FormatInformation other) { if (typeid(FormatInformation) != typeid(other)) { return false; } return (ecLevel == other.getErrorCorrectionLevel() && dataMask == other.getDataMask()); } }
D
$(OBJDIR)/oneret.cmi: $(OBJDIR)/cil.cmi
D
module tools.mersenne; const N=624, M=397; const MATRIX_A=0x9908b0dfUL, UPPER_MASK=0x80000000UL, LOWER_MASK=0x7fffffffUL; import tools.base; version(DS) { } else version(HotBits) { import tools.downloader, tools.log; ubyte[] get_hotbits(int count) { ubyte[] res; while (res.length < count) { logln("Downloading random data from Hotbits"); res ~= cast(ubyte[]) download(Format("http://www.fourmilab.ch/cgi-bin/Hotbits?nbytes=", count-res.length, "&fmt=bin")); logln("Now got ", res.length); } return res; } } final class Mersenne : IRandom { uint[N] mt; int mti=N; this() { seed(0); } this(uint s) { seed(s); } void seed(uint s) { mt[0]=s; foreach (id, elem; mt[0..$-1]) { mt[id+1] = cast(uint) (1812433253UL * (elem ^ (elem >> 30)) + id + 1); mt[id+1] &= 0xffffffffUL; } } static if (is(typeof(&get_hotbits))) void seed_hotbits() { //mt[0 .. 16] = cast(size_t[]) get_hotbits(64); init_by_array(cast(uint[]) get_hotbits(64)); } void seedFrom(IRandom other) { uint[N] array; foreach (ref entry; array) entry = other.rand(); init_by_array(array); } void init_by_array(uint[] key) { int i=1, j=0, k=(N>key.length ? N : key.length); seed(19650218UL); while (k--) { mt[i] = cast(uint) ((mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + key[j] + j); /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; if (i>=N) { mt[0] = mt[N-1]; i=1; } if (j>=key.length) j=0; } k=N-1; while (k--) { mt[i] = cast(uint) ((mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i); /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; if (i>=N) { mt[0] = mt[N-1]; i=1; } } mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ } /* generates a random number on [0,0xffffffff]-interval */ final uint rand() { uint y; static uint[2] mag01=[0x0UL, MATRIX_A]; if (mti >= N) { /* generate N words at one time */ //if (mti == N+1) seed(5489UL); for (int kk=0; kk<N-M; kk++) { y = cast(uint) ((mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK)); mt[kk] = cast(uint) (mt[kk+M] ^ (y >> 1) ^ mag01[y & 1u]); } for (int kk=N-M; kk<N-1; kk++) { y = cast(uint) ((mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK)); mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 1u]; } y = cast(uint) ((mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK)); mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 1u]; mti = 0; } y = mt[mti++]; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return y; } alias rand opCall; final float randf() { return rand() / (1f * typeof(rand()).max); } } version(DS) { Mersenne deflt; static this() { New(deflt, 23); } uint rand() { return deflt(); } } else { import tools.threads; private TLS!(Mersenne) deflt; uint glob_seed = 23; void seed(uint k) { Mersenne gen_mers() { return new Mersenne(glob_seed + k); } deflt = new typeof(deflt)(&gen_mers); } int i; static this() { synchronized seed(i++); } uint rand() { return deflt()(); } float randf() { return rand() / (1f * typeof(rand()).max); } }
D
// https://issues.dlang.org/show_bug.cgi?id=21096 /* TEST_OUTPUT: --- fail_compilation/test21096.d(13): Error: identifier or new keyword expected following `(...)`. fail_compilation/test21096.d(13): Error: found `.` when expecting `]` fail_compilation/test21096.d(13): Error: no identifier for declarator `char` fail_compilation/test21096.d(13): Error: declaration expected, not `]` --- */ char[(void*).];
D
a marking that consists of lines that cross each other cross in a pattern, often random mark with or consist of a pattern of crossed lines mark with a pattern of crossing lines marked with crossing lines crossing one another in opposite directions
D
struct Tuple(Types...) { alias TypeTuple = Types; alias TypeTuple this; } alias list = Tuple!int; void main() { static assert(is(list.TypeTuple[0] == int)); // ok pragma(msg, list[0]); // 'int' static assert(is(list[0] == int)); // ng }
D
/** * Compiler implementation of the * $(LINK2 http://www.dlang.org, D programming language). * * Copyright: Copyright (C) 1985-1996 by Symantec * Copyright (c) 2000-2016 by Digital Mars, All Rights Reserved * Authors: $(LINK2 http://www.digitalmars.com, Walter Bright) * License: backendlicense.txt * Source: $(DMDSRC backend/_code.d) */ module ddmd.backend.code; import ddmd.backend.cc; import ddmd.backend.cdef; import ddmd.backend.code_x86; import ddmd.backend.outbuf; import ddmd.backend.type; extern (C++): alias segidx_t = int; // index into SegData[] /********************************** * Code data type */ struct _Declaration; struct _LabelDsymbol; union evc { targ_int Vint; /// also used for tmp numbers (FLtmp) targ_uns Vuns; targ_long Vlong; targ_llong Vllong; targ_size_t Vsize_t; struct { targ_size_t Vpointer; int Vseg; /// segment the pointer is in } Srcpos Vsrcpos; /// source position for OPlinnum elem *Vtor; /// OPctor/OPdtor elem block *Vswitch; /// when FLswitch and we have a switch table code *Vcode; /// when code is target of a jump (FLcode) block *Vblock; /// when block " (FLblock) struct { targ_size_t Voffset; /// offset from symbol Symbol *Vsym; /// pointer to symbol table (FLfunc,FLextern) } struct { targ_size_t Vdoffset; /// offset from symbol _Declaration *Vdsym; /// pointer to D symbol table } struct { targ_size_t Vloffset; /// offset from symbol _LabelDsymbol *Vlsym; /// pointer to D Label } struct { size_t len; char *bytes; } // asm node (FLasm) } /************************************ * Local sections on the stack */ struct LocalSection { targ_size_t offset; // offset of section from frame pointer targ_size_t size; // size of section int alignment; // alignment size void init() // initialize { offset = 0; size = 0; alignment = 0; } } extern __gshared LocalSection Para; alias IDXSTR = uint; alias IDXSEC = uint; alias IDXSYM = uint; struct seg_data { segidx_t SDseg; // index into SegData[] targ_size_t SDoffset; // starting offset for data int SDalignment; // power of 2 version (Windows) // OMFOBJ { bool isfarseg; int segidx; // internal object file segment number int lnameidx; // lname idx of segment name int classidx; // lname idx of class name uint attr; // segment attribute targ_size_t origsize; // original size long seek; // seek position in output file void* ledata; // (Ledatarec) current one we're filling in } //ELFOBJ || MACHOBJ IDXSEC SDshtidx; // section header table index Outbuffer *SDbuf; // buffer to hold data Outbuffer *SDrel; // buffer to hold relocation info //ELFOBJ IDXSYM SDsymidx; // each section is in the symbol table IDXSEC SDrelidx; // section header for relocation info targ_size_t SDrelmaxoff; // maximum offset encountered int SDrelindex; // maximum offset encountered int SDrelcnt; // number of relocations added IDXSEC SDshtidxout; // final section header table index Symbol *SDsym; // if !=NULL, comdat symbol segidx_t SDassocseg; // for COMDATs, if !=0, this is the "associated" segment uint SDaranges_offset; // if !=0, offset in .debug_aranges uint SDlinnum_count; uint SDlinnum_max; linnum_data *SDlinnum_data; // array of line number / offset data int isCode(); } struct linnum_data { const(char) *filename; uint filenumber; // corresponding file number for DW_LNS_set_file uint linoff_count; uint linoff_max; uint[2]* linoff; // [0] = line number, [1] = offset } extern __gshared seg_data **SegData; /**************************************************/ /* Allocate registers to function parameters */ struct FuncParamRegs { //this(tym_t tyf); static FuncParamRegs create(tym_t tyf); int alloc(type *t, tym_t ty, ubyte *reg1, ubyte *reg2); private: tym_t tyf; // type of function int i; // ith parameter int regcnt; // how many general purpose registers are allocated int xmmcnt; // how many fp registers are allocated uint numintegerregs; // number of gp registers that can be allocated uint numfloatregs; // number of fp registers that can be allocated const(ubyte)* argregs; // map to gp register const(ubyte)* floatregs; // map to fp register }
D
// URL: https://atcoder.jp/contests/abc070/tasks/abc070_c import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string; import std.numeric; auto rdsp(){return readln.splitter;} void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;} void pickV(R,T...)(ref R r,ref T t){foreach(ref v;t)pick(r,v);} void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);} void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);} void readM(T)(size_t r,size_t c,ref T[][]t){t=new T[][](r);foreach(ref v;t)readA(c,v);} void readC(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=rdsp;foreach(ref v;t)pick(r,v[i]);}} void readS(T)(size_t n,ref T t){t=new T(n);foreach(ref v;t){auto r=rdsp;foreach(ref j;v.tupleof)pick(r,j);}} void writeA(T)(size_t n,T t){foreach(i,v;t.enumerate){write(v);if(i<n-1)write(" ");}writeln;} version(unittest) {} else void main() { int n; readV(n); long[] t; readC(n, t); writeln(t.reduce!((a, b) => a/gcd(a,b)*b)); }
D
//Автор Кристофер Миллер. Переработано для Динрус Виталием Кулич. //Библиотека визуальных конпонентов VIZ (первоначально DFL). module viz.data; private import viz.common, viz.app; class ФорматыДанных { static class Формат // docmain { /// Данные format ID number. final цел id() // getter { return _id; } /// Данные format имя. final Ткст имя() // getter { return _name; } package: цел _id; Ткст _name; this() { } } static: /// Predefined данные formats. Ткст битмап() // getter { return дайФормат(CF_BITMAP).имя; } /+ Ткст commaSeparatedValue() // getter { return дайФормат(?).имя; } +/ Ткст dib() // getter { return дайФормат(CF_DIB).имя; } Ткст dif() // getter { return дайФормат(CF_DIF).имя; } Ткст enhandedMetaFile() // getter { return дайФормат(CF_ENHMETAFILE).имя; } Ткст fileDrop() // getter { return дайФормат(CF_HDROP).имя; } Ткст html() // getter { return дайФормат("HTML Формат").имя; } Ткст locale() // getter { return дайФормат(CF_LOCALE).имя; } Ткст metafilePict() // getter { return дайФормат(CF_METAFILEPICT).имя; } Ткст oemText() // getter { return дайФормат(CF_OEMTEXT).имя; } Ткст palette() // getter { return дайФормат(CF_PALETTE).имя; } Ткст penData() // getter { return дайФормат(CF_PENDATA).имя; } Ткст riff() // getter { return дайФормат(CF_RIFF).имя; } Ткст rtf() // getter { return дайФормат("Rich Text Format").имя; } /+ Ткст serializable() // getter { return дайФормат(?).имя; } +/ Ткст stringFormat() // getter { return utf8; // ? } Ткст utf8() // getter { return дайФормат("UTF-8").имя; } Ткст symbolicLink() // getter { return дайФормат(CF_SYLK).имя; } Ткст текст() // getter { return дайФормат(CF_TEXT).имя; } Ткст tiff() // getter { return дайФормат(CF_TIFF).имя; } Ткст текстЮникод() // getter { return дайФормат(CF_UNICODETEXT).имя; } Ткст waveAudio() // getter { return дайФормат(CF_WAVE).имя; } // Assumes _init() was already called and // -id- is not in -fmts-. private Формат _didntFindId(цел id) { Формат результат; результат = new Формат; результат._id = id; результат._name = дайИмя(id); //synchronized // _init() would need to be synchronized with it. { fmts[id] = результат; } return результат; } Формат дайФормат(цел id) { _init(); if(id in fmts) return fmts[id]; return _didntFindId(id); } // Creates the format имя if it doesn't exist. Формат дайФормат(Ткст имя) { _init(); foreach(Формат onfmt; fmts) { if(!сравнлюб(имя, onfmt.имя)) return onfmt; } // Didn't найди it. return _didntFindId(регистрируйФорматБуфОбмена(имя)); } // Extra. Формат дайФормат(ИнфОТипе тип) { return дайФорматИзТипа(тип); } private: Формат[цел] fmts; // Indexed by identifier. Must _init() before accessing! проц _init() { if(fmts.length) return; проц иницфмт(цел id, Ткст имя) in { assert(!(id in fmts)); } body { Формат фмт; фмт = new Формат; фмт._id = id; фмт._name = имя; fmts[id] = фмт; } иницфмт(CF_BITMAP, "Bitmap"); иницфмт(CF_DIB, "DeviceIndependentBitmap"); иницфмт(CF_DIF, "DataInterchangeFormat"); иницфмт(CF_ENHMETAFILE, "EnhancedMetafile"); иницфмт(CF_HDROP, "FileDrop"); иницфмт(CF_LOCALE, "Locale"); иницфмт(CF_METAFILEPICT, "MetaFilePict"); иницфмт(CF_OEMTEXT, "OEMText"); иницфмт(CF_PALETTE, "Palette"); иницфмт(CF_PENDATA, "PenData"); иницфмт(CF_RIFF, "RiffAudio"); иницфмт(CF_SYLK, "SymbolicLink"); иницфмт(CF_TEXT, "Text"); иницфмт(CF_TIFF, "TaggedImageFileFormat"); иницфмт(CF_UNICODETEXT, "UnicodeText"); иницфмт(CF_WAVE, "WaveAudio"); fmts.rehash; } // Does not get the имя of one of the predefined constant ones. Ткст дайИмя(цел id) { Ткст результат; результат = дайИмяФорматаБуфОбмена(id); if(!результат.length) throw new ВизИскл("Не удаётся получить формат"); return результат; } package Формат дайФорматИзТипа(ИнфОТипе тип) { if(тип == typeid(ббайт[])) return дайФормат(текст); if(тип == typeid(Ткст)) return дайФормат(stringFormat); if(тип == typeid(Шткст)) return дайФормат(текстЮникод); //if(тип == typeid(Битмап)) // return дайФормат(битмап); if(cast(TypeInfo_Class)тип) throw new ВизИскл("Неизвестный формат данных"); return дайФормат(дайТкстОбъекта(тип)); // ? } private Ткст[] getHDropStrings(проц[] значение) { /+ if(значение.length != HDROP.sizeof) return пусто; HDROP hd; UINT num; Ткст[] результат; т_мера iw; hd = *cast(HDROP*)значение.ptr; num = dragQueryFile(hd); if(!num) return пусто; результат = new Ткст[num]; for(iw = 0; iw != num; iw++) { результат[iw] = dragQueryFile(hd, iw); } return результат; +/ if(значение.length <= DROPFILES.sizeof) return пусто; Ткст[] результат; DROPFILES* df; т_мера iw, стартiw; df = cast(DROPFILES*)значение.ptr; if(df.pFiles < DROPFILES.sizeof || df.pFiles >= значение.length) return пусто; if(df.fWide) // Unicode. { Шткст uni = cast(Шткст)((значение.ptr + df.pFiles)[0 .. значение.length]); for(iw = стартiw = 0;; iw++) { if(!uni[iw]) { if(стартiw == iw) break; результат ~= изЮникода(uni.ptr + стартiw, iw - стартiw); assert(результат[результат.length - 1].length); стартiw = iw + 1; } } } else // ANSI. { Ткст ansi = cast(Ткст)((значение.ptr + df.pFiles)[0 .. значение.length]); for(iw = стартiw = 0;; iw++) { if(!ansi[iw]) { if(стартiw == iw) break; результат ~= изАнзи(ansi.ptr + стартiw, iw - стартiw); assert(результат[результат.length - 1].length); стартiw = iw + 1; } } } return результат; } // Convert clipboard -значение- to Данные. Данные дайДанныеИзФормата(цел id, проц[] значение) { switch(id) { case CF_TEXT: return Данные(stopAtNull!(ббайт)(cast(ббайт[])значение)); case CF_UNICODETEXT: return Данные(stopAtNull!(Шим)(cast(Шткст)значение)); case CF_HDROP: return Данные(getHDropStrings(значение)); default: if(id == дайФормат(stringFormat).id) return Данные(stopAtNull!(Сим)(cast(Ткст)значение)); } //throw new ВизИскл("Unknown данные format"); return Данные(значение); // ? } проц[] getCbFileDrop(Ткст[] фимена) { т_мера разм = DROPFILES.sizeof; ук p; DROPFILES* df; foreach(fn; фимена) { разм += (вДлинуЮникода(fn) + 1) << 1; } разм += 2; p = (new byte[разм]).ptr; df = cast(DROPFILES*)p; df.pFiles = DROPFILES.sizeof; df.fWide = TRUE; шткст0 ws = cast(шткст0)(p + DROPFILES.sizeof); foreach(fn; фимена) { foreach(wchar wch; fn) { *ws++ = wch; } *ws++ = 0; } *ws++ = 0; return p[0 .. разм]; } // значение the clipboard wants. проц[] дайЗначениеБуфОбменаИзДанных(цел id, Данные данные) { //if(данные.инфо == typeid(ббайт[])) if(CF_TEXT == id) { // ANSI текст. const ббайт[] UBYTE_ZERO = [0]; return данные.дайТекст() ~ UBYTE_ZERO; } //else if(данные.инфо == typeid(Ткст)) //else if(дайФормат(stringFormat).id == id) else if((дайФормат(stringFormat).id == id) || (данные.инфо == typeid(Ткст))) { // UTF-8 string. Ткст str; str = данные.дайТкст(); //return toStringz(str)[0 .. str.length + 1]; //return небезопТкст0(str)[0 .. str.length + 1]; // ? return cast(проц[])небезопТкст0(str)[0 .. str.length + 1]; // ? Needed in D2. } //else if(данные.инфо == typeid(Шткст)) //else if(CF_UNICODETEXT == id) else if((CF_UNICODETEXT == id) || (данные.инфо == typeid(Шткст))) { // Unicode string. //return данные.дайТекстВЮникоде() ~ cast(Шткст)\0; //return cast(проц[])(данные.дайТекстВЮникоде() ~ cast(Шткст)\0); // Needed in D2. Not guaranteed safe. return (данные.дайТекстВЮникоде() ~ cast(Шткст)\0).dup; // Needed in D2. } else if(данные.инфо == typeid(Дткст)) { //return (*cast(Дткст*)данные.значение) ~ \0; //return cast(проц[])((*cast(Дткст*)данные.значение) ~ \0); // Needed in D2. Not guaranteed safe. return ((*cast(Дткст*)данные.значение) ~ \0).dup; // Needed in D2. } else if(CF_HDROP == id) { return getCbFileDrop(данные.дайТксты()); } else if(данные.инфо == typeid(проц[]) || данные.инфо == typeid(Ткст) || данные.инфо == typeid(ббайт[]) || данные.инфо == typeid(byte[])) // Hack ? { return *cast(проц[]*)данные.значение; // Save the массив elements, not the reference. } else { return данные.значение; // ? } } this() { } } private template stopAtNull(T) { T[] stopAtNull(T[] массив) { цел i; for(i = 0; i != массив.length; i++) { if(!массив[i]) return массив[0 .. i]; } //return пусто; throw new ВизИскл("Повреждённые данные"); // ? } } /// Данные structure for holding данные in а raw format with тип информация. /*export*/ struct Данные // docmain { /*export*/ /// Information about the данные тип. ИнфОТипе инфо() // getter { return _info; } /// The данные's raw значение. проц[] значение() // getter { return _value[0 .. _info.tsize()]; } /// Construct а new Данные structure. static Данные opCall(...) in { assert(_arguments.length == 1); } body { Данные результат; результат._info = _arguments[0]; результат._value = _argptr[0 .. результат._info.tsize()].dup.ptr; return результат; } T дайЗначение(T)() { assert(_info.tsize == T.sizeof); return *cast(T*)_value; } // UTF-8. Ткст дайТкст() { assert(_info == typeid(Ткст) || _info == typeid(проц[])); return *cast(Ткст*)_value; } alias дайТкст дайЮ8; // ANSI текст. ббайт[] дайТекст() { assert(_info == typeid(ббайт[]) || _info == typeid(byte[]) || _info == typeid(проц[])); return *cast(ббайт[]*)_value; } Шткст дайТекстВЮникоде() { assert(_info == typeid(Шткст) || _info == typeid(проц[])); return *cast(Шткст*)_value; } цел дайЦел() { return дайЗначение!(цел)(); } цел дайБцел() { return дайЗначение!(бцел)(); } Ткст[] дайТксты() { assert(_info == typeid(Ткст[])); return *cast(Ткст[]*)_value; } Объект дайОбъект() { assert(!(cast(TypeInfo_Class)_info is пусто)); return cast(Объект)*cast(Объект**)_value; } private: ИнфОТипе _info; ук _value; } /+ interface IDataFormat { } +/ /*export*/ class ОбъектДанных: ИОбъектДанных // docmain { /*export*/ Данные получитьДанные(Ткст фмт) { return получитьДанные(фмт, да); } Данные получитьДанные(ИнфОТипе тип) { return получитьДанные(ФорматыДанных.дайФормат(тип).имя); } Данные получитьДанные(Ткст фмт, бул doConvert) { // doConvert ... //скажиф("Looking for format '%.*s'.\n", фмт); цел i; i = найди(фмт); if(i == -1) throw new ВизИскл("Формат данных отсутствует"); return все[i].объ; } бул дайИмеющиесяДанные(Ткст фмт) { return дайИмеющиесяДанные(фмт, да); } бул дайИмеющиесяДанные(ИнфОТипе тип) { return дайИмеющиесяДанные(ФорматыДанных.дайФормат(тип).имя); } бул дайИмеющиесяДанные(Ткст фмт, бул можноПреобразовать) { // можноПреобразовать ... return найди(фмт) != -1; } Ткст[] дайФорматы() { Ткст[] результат; результат = new Ткст[все.length]; foreach(цел i, inout Ткст фмт; результат) { фмт = все[i].фмт; } return результат; } // TO-DO: удали... deprecated final Ткст[] дайФорматы(бул onlyNative) { return дайФорматы(); } package final проц _setData(Ткст фмт, Данные объ, бул replace = да) { цел i; i = найди(фмт, нет); if(i != -1) { if(replace) все[i].объ = объ; } else { Пара pair; pair.фмт = фмт; pair.объ = объ; все ~= pair; } } проц установиДанные(Данные объ) { установиДанные(ФорматыДанных.дайФормат(объ.инфо).имя, объ); } проц установиДанные(Ткст фмт, Данные объ) { установиДанные(фмт, да, объ); } проц установиДанные(ИнфОТипе тип, Данные объ) { установиДанные(ФорматыДанных.дайФорматИзТипа(тип).имя, да, объ); } проц установиДанные(Ткст фмт, бул можноПреобразовать, Данные объ) { /+ if(объ.инфо == typeid(Данные)) { проц[] objv; objv = объ.значение; assert(objv.length == Данные.sizeof); объ = *(cast(Данные*)objv.ptr); } +/ _setData(фмт, объ); if(можноПреобразовать) { Данные cdat; cdat = Данные(*(cast(_DataConvert*)&объ)); _canConvertFormats(фмт, (Ткст cfmt) { _setData(cfmt, cdat, нет); }); } } private: struct Пара { Ткст фмт; Данные объ; } Пара[] все; проц исправьЗаписьПары(inout Пара pr) { assert(pr.объ.инфо == typeid(_DataConvert)); Данные объ; проц[] objv; objv = pr.объ.значение; assert(objv.length == Данные.sizeof); объ = *(cast(Данные*)objv.ptr); pr.объ = _doConvertFormat(объ, pr.фмт); } цел найди(Ткст фмт, бул fix = да) { цел i; for(i = 0; i != все.length; i++) { if(!сравнлюб(все[i].фмт, фмт)) { if(fix && все[i].объ.инфо == typeid(_DataConvert)) исправьЗаписьПары(все[i]); return i; } } return -1; } } private struct _DataConvert { Данные данные; } package проц _canConvertFormats(Ткст фмт, проц delegate(Ткст cfmt) обрвыз) { //if(!сравнлюб(фмт, ФорматыДанных.utf8)) if(!сравнлюб(фмт, "UTF-8")) { обрвыз(ФорматыДанных.текстЮникод); обрвыз(ФорматыДанных.текст); } else if(!сравнлюб(фмт, ФорматыДанных.текстЮникод)) { //обрвыз(ФорматыДанных.utf8); обрвыз("UTF-8"); обрвыз(ФорматыДанных.текст); } else if(!сравнлюб(фмт, ФорматыДанных.текст)) { //обрвыз(ФорматыДанных.utf8); обрвыз("UTF-8"); обрвыз(ФорматыДанных.текстЮникод); } } package Данные _doConvertFormat(Данные dat, Ткст toFmt) { Данные результат; //if(!сравнлюб(toFmt, ФорматыДанных.utf8)) if(!сравнлюб(toFmt, "UTF-8")) { if(typeid(Шткст) == dat.инфо) { результат = Данные(вЮ8(dat.дайТекстВЮникоде())); } else if(typeid(ббайт[]) == dat.инфо) { ббайт[] ubs; ubs = dat.дайТекст(); результат = Данные(изАнзи(cast(Ткст0)ubs.ptr, ubs.length)); } } else if(!сравнлюб(toFmt, ФорматыДанных.текстЮникод)) { if(typeid(Ткст) == dat.инфо) { результат = Данные(вЮ16(dat.дайТкст())); } else if(typeid(ббайт[]) == dat.инфо) { ббайт[] ubs; ubs = dat.дайТекст(); результат = Данные(анзиВЮникод(cast(Ткст0)ubs.ptr, ubs.length)); } } else if(!сравнлюб(toFmt, ФорматыДанных.текст)) { if(typeid(Ткст) == dat.инфо) { результат = Данные(cast(ббайт[])вАнзи(dat.дайТкст())); } else if(typeid(Шткст) == dat.инфо) { Шткст wcs; wcs = dat.дайТекстВЮникоде(); результат = Данные(cast(ббайт[])юникодВАнзи(wcs.ptr, wcs.length)); } } return результат; } /*export*/ class КомВОбъектДанных: ИОбъектДанных // package { /*export*/ this(winapi.IDataObject объДанных) { this.объДанных = объДанных; объДанных.AddRef(); } ~this() { объДанных.Release(); // Must get called... } private Данные _getData(цел id) { FORMATETC fmte; STGMEDIUM stgm; проц[] mem; ук plock; fmte.cfFormat = id; fmte.ptd = пусто; fmte.dwAspect = DVASPECT_CONTENT; // ? fmte.lindex = -1; fmte.tymed = TYMED_HGLOBAL; // ? if(S_OK != объДанных.GetData(&fmte, &stgm)) throw new ВизИскл("Не удаётся получить данные"); проц release() { //ReleaseStgMedium(&stgm); if(stgm.pUnkForRelease) stgm.pUnkForRelease.Release(); else GlobalFree(stgm.hGlobal); } plock = GlobalLock(stgm.hGlobal); if(!plock) { release(); throw new ВизИскл("Ошибка при получении данных"); } mem = new ббайт[GlobalSize(stgm.hGlobal)]; mem[] = plock[0 .. mem.length]; GlobalUnlock(stgm.hGlobal); release(); return ФорматыДанных.дайДанныеИзФормата(id, mem); } Данные получитьДанные(Ткст фмт) { return _getData(ФорматыДанных.дайФормат(фмт).id); } Данные получитьДанные(ИнфОТипе тип) { return _getData(ФорматыДанных.дайФорматИзТипа(тип).id); } Данные получитьДанные(Ткст фмт, бул doConvert) { return получитьДанные(фмт); // ? } private бул _getDataPresent(цел id) { FORMATETC fmte; fmte.cfFormat = id; fmte.ptd = пусто; fmte.dwAspect = DVASPECT_CONTENT; // ? fmte.lindex = -1; fmte.tymed = TYMED_HGLOBAL; // ? return S_OK == объДанных.QueryGetData(&fmte); } бул дайИмеющиесяДанные(Ткст фмт) { return _getDataPresent(ФорматыДанных.дайФормат(фмт).id); } бул дайИмеющиесяДанные(ИнфОТипе тип) { return _getDataPresent(ФорматыДанных.дайФорматИзТипа(тип).id); } бул дайИмеющиесяДанные(Ткст фмт, бул можноПреобразовать) { return дайИмеющиесяДанные(фмт); // ? } Ткст[] дайФорматы() { winapi.IEnumFORMATETC fenum; FORMATETC fmte; Ткст[] результат; ULONG nfetched = 1; // ? if(S_OK != объДанных.EnumFormatEtc(1, &fenum)) throw new ВизИскл("Не удаётся получить форматы"); fenum.AddRef(); // ? for(;;) { if(S_OK != fenum.Next(1, &fmte, &nfetched)) break; if(!nfetched) break; //скажиф("\t\t{дайФорматы:%d}\n", fmte.cfFormat); результат ~= ФорматыДанных.дайФормат(fmte.cfFormat).имя; } fenum.Release(); // ? return результат; } // TO-DO: удали... deprecated final Ткст[] дайФорматы(бул onlyNative) { return дайФорматы(); } private проц _setData(цел id, Данные объ) { /+ FORMATETC fmte; STGMEDIUM stgm; HANDLE hmem; проц[] mem; ук pmem; mem = ФорматыДанных.дайЗначениеБуфОбменаИзДанных(id, объ); hmem = GlobalAlloc(GMEM_SHARE, mem.length); if(!hmem) { //скажиф("Unable to GlobalAlloc().\n"); err_set: throw new ВизИскл("Unable to установи данные"); } pmem = GlobalLock(hmem); if(!pmem) { //скажиф("Unable to GlobalLock().\n"); GlobalFree(hmem); goto err_set; } pmem[0 .. mem.length] = mem; GlobalUnlock(hmem); fmte.cfFormat = id; fmte.ptd = пусто; fmte.dwAspect = DVASPECT_CONTENT; // ? fmte.lindex = -1; fmte.tymed = TYMED_HGLOBAL; stgm.tymed = TYMED_HGLOBAL; stgm.hGlobal = hmem; stgm.pUnkForRelease = пусто; // -объДанных- now owns the указатель. HRESULT hr = объДанных.SetData(&fmte, &stgm, да); if(S_OK != hr) { //скажиф("Unable to ИОбъектДанных::SetData() = %d (0x%X).\n", hr, hr); // Failed, need to free it.. GlobalFree(hmem); goto err_set; } +/ // Don't установи stuff in someone else's данные object. } проц установиДанные(Данные объ) { _setData(ФорматыДанных.дайФорматИзТипа(объ.инфо).id, объ); } проц установиДанные(Ткст фмт, Данные объ) { _setData(ФорматыДанных.дайФормат(фмт).id, объ); } проц установиДанные(ИнфОТипе тип, Данные объ) { _setData(ФорматыДанных.дайФорматИзТипа(тип).id, объ); } проц установиДанные(Ткст фмт, бул можноПреобразовать, Данные объ) { установиДанные(фмт, объ); // ? } final бул такойЖеОбъектДанных_ли(winapi.IDataObject объДанных) { return объДанных is this.объДанных; } private: winapi.IDataObject объДанных; } package class EnumDataObjectFORMATETC: ВизКомОбъект, winapi.IEnumFORMATETC { this(ИОбъектДанных объДанных, Ткст[] fmts, ULONG старт) { this.объДанных = объДанных; this.fmts = fmts; idx = старт; } this(ИОбъектДанных объДанных) { this(объДанных, объДанных.дайФорматы(), 0); } extern(Windows): HRESULT QueryInterface(ИИД* riid, проц** ppv) { if(*riid == _IID_IEnumFORMATETC) { *ppv = cast(проц*)cast(winapi.IEnumFORMATETC)this; AddRef(); return S_OK; } else if(*riid == _IID_IUnknown) { *ppv = cast(проц*)cast(winapi.IUnknown)this; AddRef(); return S_OK; } else { *ppv = пусто; return E_NOINTERFACE; } } HRESULT Next(ULONG celt, FORMATETC* rgelt, ULONG* pceltFetched) { HRESULT результат; try { if(idx < fmts.length) { ULONG end; end = idx + celt; if(end > fmts.length) { результат = S_FALSE; // ? end = fmts.length; if(pceltFetched) *pceltFetched = end - idx; } else { результат = S_OK; if(pceltFetched) *pceltFetched = celt; } for(; idx != end; idx++) { rgelt.cfFormat = ФорматыДанных.дайФормат(fmts[idx]).id; rgelt.ptd = пусто; rgelt.dwAspect = DVASPECT_CONTENT; // ? rgelt.lindex = -1; //rgelt.tymed = TYMED_NULL; rgelt.tymed = TYMED_HGLOBAL; rgelt++; } } else { if(pceltFetched) *pceltFetched = 0; результат = S_FALSE; } } catch(Объект e) { Приложение.приИсклНити(e); результат = E_UNEXPECTED; } return результат; } HRESULT Skip(ULONG celt) { idx += celt; return (idx > fmts.length) ? S_FALSE : S_OK; } HRESULT Reset() { HRESULT результат; try { idx = 0; fmts = объДанных.дайФорматы(); результат = S_OK; } catch(Объект e) { Приложение.приИсклНити(e); результат = E_UNEXPECTED; } return результат; } HRESULT Clone(winapi.IEnumFORMATETC* ppenum) { HRESULT результат; try { *ppenum = new EnumDataObjectFORMATETC(объДанных, fmts, idx); результат = S_OK; } catch(Объект e) { Приложение.приИсклНити(e); результат = E_UNEXPECTED; } return результат; } extern(D): private: ИОбъектДанных объДанных; Ткст[] fmts; ULONG idx; } /*export*/ class DtoComDataObject: ВизКомОбъект, winapi.IDataObject // package { private ИОбъектДанных объДанных; /*export*/ public: this(ИОбъектДанных объДанных) { this.объДанных = объДанных; } /*export*/ extern(Windows): HRESULT QueryInterface(ИИД* riid, проц** ppv) { if(*riid == _IID_IDataObject) { *ppv = cast(проц*)cast(winapi.IDataObject)this; AddRef(); return S_OK; } else if(*riid == _IID_IUnknown) { *ppv = cast(проц*)cast(winapi.IUnknown)this; AddRef(); return S_OK; } else { *ppv = пусто; return E_NOINTERFACE; } } HRESULT GetData(FORMATETC* pFormatetc, STGMEDIUM* pmedium) { Ткст фмт; HRESULT результат = S_OK; Данные данные; try { if(pFormatetc.lindex != -1) { результат = DV_E_LINDEX; } else if(!(pFormatetc.tymed & TYMED_HGLOBAL)) { // Unsupported medium тип. результат = DV_E_TYMED; } else if(!(pFormatetc.dwAspect & DVASPECT_CONTENT)) { // What about the other aspects? результат = DV_E_DVASPECT; } else { ФорматыДанных.Формат dfmt; dfmt = ФорматыДанных.дайФормат(pFormatetc.cfFormat); фмт = dfmt.имя; данные = объДанных.получитьДанные(фмт, да); // Should this be convertable? HGLOBAL hg; ук pmem; проц[] src; //src = данные.значение; src = ФорматыДанных.дайЗначениеБуфОбменаИзДанных(dfmt.id, данные); hg = GlobalAlloc(GMEM_SHARE, src.length); if(!hg) { результат = STG_E_MEDIUMFULL; } else { pmem = GlobalLock(hg); if(!hg) { результат = E_UNEXPECTED; GlobalFree(hg); } else { pmem[0 .. src.length] = src; GlobalUnlock(hg); pmedium.tymed = TYMED_HGLOBAL; pmedium.hGlobal = hg; pmedium.pUnkForRelease = пусто; // ? } } } } catch(ВизИскл e) { //Приложение.приИсклНити(e); результат = DV_E_FORMATETC; } catch(ВнеПамИскл e) { Приложение.приИсклНити(e); результат = E_OUTOFMEMORY; } catch(Объект e) { Приложение.приИсклНити(e); результат = E_UNEXPECTED; } return результат; } HRESULT GetDataHere(FORMATETC* pFormatetc, STGMEDIUM* pmedium) { return E_UNEXPECTED; // TODO: finish. } HRESULT QueryGetData(FORMATETC* pFormatetc) { Ткст фмт; HRESULT результат = S_OK; try { if(pFormatetc.lindex != -1) { результат = DV_E_LINDEX; } else if(!(pFormatetc.tymed & TYMED_HGLOBAL)) { // Unsupported medium тип. результат = DV_E_TYMED; } else if(!(pFormatetc.dwAspect & DVASPECT_CONTENT)) { // What about the other aspects? результат = DV_E_DVASPECT; } else { фмт = ФорматыДанных.дайФормат(pFormatetc.cfFormat).имя; if(!объДанных.дайИмеющиесяДанные(фмт)) результат = S_FALSE; // ? } } catch(ВизИскл e) { //Приложение.приИсклНити(e); результат = DV_E_FORMATETC; } catch(ВнеПамИскл e) { Приложение.приИсклНити(e); результат = E_OUTOFMEMORY; } catch(Объект e) { Приложение.приИсклНити(e); результат = E_UNEXPECTED; } return результат; } HRESULT GetCanonicalFormatEtc(FORMATETC* pFormatetcIn, FORMATETC* pFormatetcOut) { // TODO: finish. pFormatetcOut.ptd = пусто; return E_NOTIMPL; } HRESULT SetData(FORMATETC* pFormatetc, STGMEDIUM* pmedium, BOOL fRelease) { return E_UNEXPECTED; // TODO: finish. } HRESULT EnumFormatEtc(DWORD dwDirection, winapi.IEnumFORMATETC* ppenumFormatetc) { // SHCreateStdEnumFmtEtc() requires Windows 2000 + HRESULT результат; try { if(dwDirection == DATADIR_GET) { *ppenumFormatetc = new EnumDataObjectFORMATETC(объДанных); результат = S_OK; } else { результат = E_NOTIMPL; } } catch(Объект e) { Приложение.приИсклНити(e); результат = E_UNEXPECTED; } return результат; } HRESULT DAdvise(FORMATETC* pFormatetc, DWORD advf, winapi.IAdviseSink pAdvSink, DWORD* pdwConnection) { return E_UNEXPECTED; // TODO: finish. } HRESULT DUnadvise(DWORD dwConnection) { return E_UNEXPECTED; // TODO: finish. } HRESULT EnumDAdvise(winapi.IEnumSTATDATA* ppenumAdvise) { return E_UNEXPECTED; // TODO: finish. } }
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.visitor.functions.Substring; // import hunt.sql.visitor.SQLEvalVisitor.EVAL_VALUE; import hunt.collection; import hunt.sql.ast.SQLExpr; import hunt.sql.ast.expr.SQLMethodInvokeExpr; import hunt.sql.visitor.SQLEvalVisitor; import hunt.sql.visitor.functions.Function; import hunt.Number; import hunt.String; import hunt.String; import hunt.collection; import std.conv; import std.uni; import hunt.text; import std.concurrency : initOnce; public class Substring : Function { static Substring instance() { __gshared Substring inst; return initOnce!inst(new Substring()); } // public static Substring instance; // static this() // { // instance = new Substring(); // } public Object eval(SQLEvalVisitor visitor, SQLMethodInvokeExpr x) { List!(SQLExpr) params = x.getParameters(); int paramSize = params.size(); SQLExpr param0 = params.get(0); SQLExpr param1; if (paramSize == 1 && x.getFrom() !is null) { param1 = x.getFrom(); paramSize = 2; } else if (paramSize != 2 && paramSize != 3) { return cast(Object)(SQLEvalVisitor.EVAL_ERROR); } else { param1 = params.get(1); } param0.accept(visitor); param1.accept(visitor); Object param0Value = param0.getAttributes().get(SQLEvalVisitor.EVAL_VALUE); Object param1Value = param1.getAttributes().get(SQLEvalVisitor.EVAL_VALUE); if (param0Value is null || param1Value is null) { return cast(Object)(SQLEvalVisitor.EVAL_ERROR); } string str = param0Value.toString(); int index = (cast(Number) param1Value).intValue(); if (paramSize == 2 && x.getFor() is null) { if (index <= 0) { int lastIndex = cast(int)(str.length) + index; return new String(str.substring(lastIndex)); } return new String(str.substring(index - 1)); } SQLExpr param2 = x.getFor(); if (param2 is null && params.size() > 2) { param2 = params.get(2); } param2.accept(visitor); Object param2Value = param2.getAttributes().get(SQLEvalVisitor.EVAL_VALUE); if (param2Value is null) { return cast(Object)(SQLEvalVisitor.EVAL_ERROR); } int len = (cast(Number) param2Value).intValue(); string result; if (index <= 0) { int lastIndex = cast(int)(str.length) + index; result = str.substring(lastIndex); } else { result = str.substring(index - 1); } if (len > result.length) { return new String(result); } return new String(result.substring(0, len)); } }
D
module UnrealScript.Engine.SeqAct_MultiplyInt; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.Engine.SeqAct_SetSequenceVariable; extern(C++) interface SeqAct_MultiplyInt : SeqAct_SetSequenceVariable { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class Engine.SeqAct_MultiplyInt")); } private static __gshared SeqAct_MultiplyInt mDefaultProperties; @property final static SeqAct_MultiplyInt DefaultProperties() { mixin(MGDPC("SeqAct_MultiplyInt", "SeqAct_MultiplyInt Engine.Default__SeqAct_MultiplyInt")); } @property final auto ref { int IntResult() { mixin(MGPC("int", 244)); } float FloatResult() { mixin(MGPC("float", 240)); } int ValueB() { mixin(MGPC("int", 236)); } int ValueA() { mixin(MGPC("int", 232)); } } }
D
/** * Windows API header module * * Translated from MinGW Windows headers * * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Source: $(DRUNTIMESRC src/core/sys/windows/_lm.d) */ module core.sys.windows.lm; version (Windows): /* removed - now supporting only Win2k up version (WindowsVista) { version = WIN32_WINNT_ONLY; } else version (Windows2003) { version = WIN32_WINNT_ONLY; } else version (WindowsXP) { version = WIN32_WINNT_ONLY; } else version (WindowsNTonly) { version = WIN32_WINNT_ONLY; } */ public import core.sys.windows.lmcons; public import core.sys.windows.lmaccess; public import core.sys.windows.lmalert; public import core.sys.windows.lmat; public import core.sys.windows.lmerr; public import core.sys.windows.lmshare; public import core.sys.windows.lmapibuf; public import core.sys.windows.lmremutl; public import core.sys.windows.lmrepl; public import core.sys.windows.lmuse; public import core.sys.windows.lmstats; public import core.sys.windows.lmwksta; public import core.sys.windows.lmserver; version (Windows2000) { } else { public import core.sys.windows.lmmsg; } // FIXME: Everything in these next files seems to be deprecated! import core.sys.windows.lmaudit; import core.sys.windows.lmchdev; // can't find many docs for functions from this file. import core.sys.windows.lmconfig; import core.sys.windows.lmerrlog; import core.sys.windows.lmsvc; import core.sys.windows.lmsname; // in MinGW, this was publicly included by lm.lmsvc
D
# FIXED flash.obj: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/drivers/flash/src/32b/f28x/f2806x/flash.c flash.obj: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/drivers/flash/src/32b/f28x/f2806x/flash.h flash.obj: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/modules/types/src/types.h flash.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdbool.h flash.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/string.h flash.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/linkage.h flash.obj: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdint.h flash.obj: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/drivers/flash/src/32b/f28x/f2806x/flash.c: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/drivers/flash/src/32b/f28x/f2806x/flash.h: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/modules/types/src/types.h: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdbool.h: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/string.h: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/linkage.h: C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/include/stdint.h: C:/TAPAS_Fandriver/TAPAS-DSP/ti/motorware/motorware_1_01_00_18/sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h:
D
/Users/edward.wangcrypto.com/study/substrate_lesson_homework_template/node-template-benchmark/target/release/wbuild/node-template-runtime/target/release/deps/log-c476b3cdb2362c42.rmeta: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/lib.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/macros.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/serde.rs /Users/edward.wangcrypto.com/study/substrate_lesson_homework_template/node-template-benchmark/target/release/wbuild/node-template-runtime/target/release/deps/liblog-c476b3cdb2362c42.rlib: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/lib.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/macros.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/serde.rs /Users/edward.wangcrypto.com/study/substrate_lesson_homework_template/node-template-benchmark/target/release/wbuild/node-template-runtime/target/release/deps/log-c476b3cdb2362c42.d: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/lib.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/macros.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/serde.rs /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/lib.rs: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/macros.rs: /Users/edward.wangcrypto.com/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.14/src/serde.rs:
D
instance SLD_814_Sentenza(Npc_Default) { name[0] = "Сентенза"; guild = GIL_SLD; id = 814; voice = 9; flags = 0; npcType = npctype_main; aivar[AIV_MM_FollowTime] = 60; B_SetAttributesToChapter(self,5); fight_tactic = FAI_HUMAN_MASTER; EquipItem(self,itmw_sentenca_sword); B_SetNpcVisual(self,MALE,"Hum_Head_FatBald",Face_N_Tough_Okyl,BodyTex_N,ITAR_SLD_U); Mdl_SetModelFatness(self,0); Mdl_ApplyOverlayMds(self,"Humans_Militia.mds"); B_GiveNpcTalents(self); B_SetFightSkills(self,70); daily_routine = Rtn_Start_814; }; func void Rtn_Start_814() { TA_Stand_Eating(8,0,10,0,"NW_BIGFARM_ALLEE_01"); TA_Stand_Guarding(10,0,12,0,"NW_BIGFARM_ALLEE_01"); TA_Smoke_Joint(12,0,14,0,"NW_BIGFARM_ALLEE_01"); TA_Stand_Drinking(14,0,18,0,"NW_BIGFARM_ALLEE_01"); TA_Stand_ArmsCrossed(18,2,22,5,"NW_BIGFARM_ALLEE_01"); TA_Sit_Campfire(22,0,8,0,"NW_BIGFARM_VORPOSTEN1_01"); }; func void Rtn_Follow_814() { TA_Follow_Player(8,0,22,0,"NW_BIGFARM_VORPOSTEN1_02"); TA_Follow_Player(22,0,8,0,"NW_BIGFARM_VORPOSTEN1_02"); }; func void rtn_inbattle_814() { ta_bigfight(8,0,22,0,"NW_BIGFIGHT_HUM_03"); ta_bigfight(22,0,8,0,"NW_BIGFIGHT_HUM_03"); };
D
module vibeauth.router.registration.responses; import std.stdio; import std.datetime; import std.string; import std.uri; import std.file; import vibe.http.router; import vibe.data.json; import vibeauth.users; import vibeauth.configuration; import vibeauth.challenges.base; import vibeauth.mail.base; import vibeauth.router.accesscontrol; import vibeauth.router.registration.routes; import vibeauth.router.request; import vibeauth.mvc.templatedata; import vibeauth.mvc.view; class RegistrationResponses { private { IChallenge challenge; const { ServiceConfiguration configuration; } } this(IChallenge challenge, const ServiceConfiguration configuration) { this.challenge = challenge; this.configuration = configuration; } void registerForm(HTTPServerRequest req, HTTPServerResponse res) { scope view = new RegisterView(configuration); Json variables = Json.emptyObject; variables["challenge"] = challenge.getTemplate(configuration.paths.registration.challange); variables["userData"] = (const RequestUserData(req)).toJson; if(variables["userData"]["error"].type == Json.Type.string && variables["userData"]["error"] != "") { view.data.addError(variables["userData"]["error"].to!string); } view.data.add(variables); res.writeBody(view.render, "text/html"); } void confirmationForm(HTTPServerRequest, HTTPServerResponse res) { scope view = new ConfirmationView(configuration); res.statusCode = 200; res.writeBody(view.render, "text/html"); } void success(HTTPServerRequest, HTTPServerResponse res) { scope view = new SuccessView(configuration); res.statusCode = 200; res.writeBody(view.render, "text/html"); } } alias RegisterView = BasicView!( "templates.registration.formTemplate", "templates.registration.form" ); alias ConfirmationView = BasicView!( "templates.registration.confirmationTemplate", "templates.registration.confirmation" ); alias SuccessView = BasicView!( "templates.registration.successTemplate", "templates.registration.success" );
D
/** * Copyright: (c) 2009 John Chapman * * License: See $(LINK2 ..\..\licence.txt, licence.txt) for use and distribution terms. */ module os.win.base.time; static import std.string; private const long TicksPerMillisecond = 10_000; private const long TicksPerSecond = TicksPerMillisecond * 1_000; private const long TicksPerMinute = TicksPerSecond * 60; private const long TicksPerHour = TicksPerMinute * 60; private const long TicksPerDay = TicksPerHour * 24; private const int MillisPerSecond = 1_000; private const int MillisPerMinute = MillisPerSecond * 60; private const int MillisPerHour = MillisPerMinute * 60; private const int MillisPerDay = MillisPerHour * 24; private const double MillisecondsPerTick = 1.0 / TicksPerMillisecond; private const double SecondsPerTick = 1.0 / TicksPerSecond; private const double MinutesPerTick = 1.0 / TicksPerMinute; /** * Represents a time interval. */ struct TimeSpan { /// Represents the _zero TimeSpan value. static TimeSpan zero = { 0 }; /// Represents the minimum TimeSpan value. static TimeSpan min = { long.min }; /// Represents the maximum TimeSpan value. static TimeSpan max = { long.max }; private long ticks_; /** * Initializes a new instance. * Параметры: ticks = A time period expressed in 100-nanosecond units. */ static TimeSpan opCall(long ticks) { TimeSpan self; self.ticks_ = ticks; return self; } /** * Initializes a new instance. * Параметры: * hours = Number of _hours. * minutes = Number of _minutes. * seconds = Number of _seconds. */ static TimeSpan opCall(int hours, int minutes, int seconds) { TimeSpan self; self.ticks_ = (hours * 3600 + minutes * 60 + seconds) * TicksPerSecond; return self; } /** * Initializes a new instance. * Параметры: * days = Number of _days. * hours = Number of _hours. * minutes = Number of _minutes. * seconds = Number of _seconds. * milliseconds = Number of _milliseconds. */ static TimeSpan opCall(int days, int hours, int minutes, int seconds, int milliseconds = 0) { TimeSpan self; self.ticks_ = ((days * 3600 * 24 + hours * 3600 + minutes * 60 + seconds) * 1000 + milliseconds) * TicksPerMillisecond; return self; } /// Gets the _hours component. int hours() { return cast(int)((ticks_ / TicksPerHour) % 24); } /// Gets the _minutes component. int minutes() { return cast(int)((ticks_ / TicksPerMinute) % 60); } /// Gets the _seconds component. int seconds() { return cast(int)((ticks_ / TicksPerSecond) % 60); } /// Gets the _milliseconds component. int milliseconds() { return cast(int)((ticks_ / TicksPerMillisecond) % 1000); } /// Gets the value of the instance expressed in whole and fractional milliseconds. double totalMilliseconds() { return cast(double)ticks_ * MillisecondsPerTick; } /// Gets the value of the instance expressed in whole and fractional seconds. double totalSeconds() { return cast(double)ticks_ * SecondsPerTick; } double totalMinutes() { return cast(double)ticks_ * MinutesPerTick; } /// Gets the _days component. int days() { return cast(int)(ticks_ / TicksPerDay); } /// Returns a new instance whose value is the absolute value of the current instance. TimeSpan duration() { return TimeSpan((ticks_ < 0) ? -ticks_ : ticks_); } /// Gets the number of _ticks. long ticks() { return ticks_; } private static TimeSpan interval(double value, int scale) { double d = value * scale; double millis = d + (value >= 0 ? 0.5 : -0.5); return TimeSpan(cast(long)millis * TicksPerMillisecond); } /// Returns a TimeSpan representing a specified number of seconds. static TimeSpan fromSeconds(double value) { return interval(value, MillisPerSecond); } /// Returns a TimeSpan representing a specified number of milliseconds. static TimeSpan fromMilliseconds(double value) { return interval(value, 1); } /** * Compares two TimeSpan values and returns an integer indicating whether the first is shorter than, equal to, or longer than the second. * Возвращает: -1 if t1 is shorter than t2; 0 if t1 equals t2; 1 if t1 is longer than t2. */ static int compare(TimeSpan t1, TimeSpan t2) { if (t1.ticks_ > t2.ticks_) return 1; else if (t1.ticks_ < t2.ticks_) return -1; return 0; } /** * Compares this instance to a specified TimeSpan and returns an integer indicating whether the first is shorter than, equal to, or longer than the second. * Возвращает: -1 if t1 is shorter than t2; 0 if t1 equals t2; 1 if t1 is longer than t2. */ int compareTo(TimeSpan other) { if (ticks_ > other.ticks_) return 1; else if (ticks_ < other.ticks_) return -1; return 0; } /// ditto int opCmp(TimeSpan other) { version(D_Version2) { return compare(this, other); } else { return compare(*this, other); } } /** * Returns a value indicating whether two instances are equal. * Параметры: * t1 = The first TimeSpan. * t2 = The seconds TimeSpan. * Возвращает: true if the values of t1 and t2 are equal; otherwise, false. */ static bool equals(TimeSpan t1, TimeSpan t2) { return t1.ticks_ == t2.ticks_; } /** * Returns a value indicating whether this instance is equal to another. * Параметры: other = An TimeSpan to compare with this instance. * Возвращает: true if other represents the same time interval as this instance; otherwise, false. */ bool equals(TimeSpan other) { return ticks_ == other.ticks_; } /// ditto bool opEquals(TimeSpan other) { return ticks_ == other.ticks_; } uint toHash() { return cast(int)ticks_ ^ cast(int)(ticks_ >> 32); } /// Returns a string representation of the value of this instance. string toString() { string s; int day = cast(int)(ticks_ / TicksPerDay); long time = ticks_ % TicksPerDay; if (ticks_ < 0) { s ~= "-"; day = -day; time = -time; } if (day != 0) { s ~= std.string.format("%d", day); s ~= "."; } s ~= std.string.format("%0.2d", cast(int)((time / TicksPerHour) % 24)); s ~= ":"; s ~= std.string.format("%0.2d", cast(int)((time / TicksPerMinute) % 60)); s ~= ":"; s ~= std.string.format("%0.2d", cast(int)((time / TicksPerSecond) % 60)); int frac = cast(int)(time % TicksPerSecond); if (frac != 0) { s ~= "."; s ~= std.string.format("%0.7d", frac); } return s; } /// Adds the specified TimeSpan to this instance. TimeSpan add(TimeSpan ts) { return TimeSpan(ticks_ + ts.ticks_); } /// ditto TimeSpan opAdd(TimeSpan ts) { return add(ts); } /// ditto void opAddAssign(TimeSpan ts) { ticks_ += ts.ticks_; } /// Subtracts the specified TimeSpan from this instance. TimeSpan subtract(TimeSpan ts) { return TimeSpan(ticks_ - ts.ticks_); } /// ditto TimeSpan opSub(TimeSpan ts) { return subtract(ts); } /// ditto void opSubAssign(TimeSpan ts) { ticks_ -= ts.ticks_; } /// Returns a TimeSpan whose value is the negated value of this instance. TimeSpan negate() { return TimeSpan(-ticks_); } /// ditto TimeSpan opNeg() { return negate(); } TimeSpan opPos() { version(D_Version2) { return this; } else { return *this; } } }
D
/Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKSop.build/API/GetSensitiveOpSettingRequest.swift.o : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerificationCodeInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/GetSecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerifySecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSensitiveOpSettingExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSecurityTokenExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/SopClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenRequest.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKSop.build/GetSensitiveOpSettingRequest~partial.swiftmodule : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerificationCodeInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/GetSecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerifySecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSensitiveOpSettingExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSecurityTokenExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/SopClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenRequest.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKSop.build/GetSensitiveOpSettingRequest~partial.swiftdoc : /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResponse.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerificationCodeInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/GetSecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Model/VerifySecurityTokenInfo.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSensitiveOpSettingExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/GetSecurityTokenExecutor.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenResult.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/Client/SopClient.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSensitiveOpSettingRequest.swift /Users/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/Sources/JDCloudSDKSop/API/GetSecurityTokenRequest.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/lishijun1/Documents/swiftworkspace/JDCloudSDKSwift/jdcloud-sdk-swift-github/JDCloudSDKSwift/.build/x86_64-apple-macosx10.10/debug/JDCloudSDKCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
module parser; @nogc nothrow: import core.stdc.stdio; enum LexicalType { undefined, eof, space, number, // 0, 1, -1, ... leftBrace, // { rightBrace, // } executableName, // abc, hello, ... literalName, // /abc, /hello, ... } union TokenValue { int number; int onechar; string name; } struct Token { LexicalType lexType; TokenValue value; } /** Parse one token for beginning Params: result = is a parsed token Returns: last consumed character */ int parseOne(Token* result) { import cl_getc : cl_getc; auto prev = cl_getc(); return parseOne(result, prev); } /** Parse one token with state Params: result = is a parsed token prev = a previous character Returns: last consumed character */ int parseOne(Token* result, int prev) { import core.stdc.stdio : fprintf, stderr; import core.stdc.ctype : isdigit, isspace, isalpha, isgraph; import cl_getc : cl_getc, pos, input; // parse nothing if (prev == EOF) { result.lexType = LexicalType.eof; prev = cl_getc(); return prev; } // parse space else if (isspace(prev)) { result.lexType = LexicalType.space; // consume subsequent spaces while (isspace(prev)) { prev = cl_getc(); } return prev; } // parse number else if (isdigit(prev)) { result.lexType = LexicalType.number; result.value.number = 0; while (isdigit(prev)) { result.value.number = 10 * result.value.number + (prev - '0'); prev = cl_getc(); } return prev; } // parse left/right braces else if (prev == '{') { result.lexType = LexicalType.leftBrace; result.value.onechar = prev; prev = cl_getc(); return prev; } else if (prev == '}') { result.lexType = LexicalType.rightBrace; result.value.onechar = prev; prev = cl_getc(); return prev; } // parse executable/literal name else if (isalpha(prev) || prev == '/') { import core.stdc.stdlib : malloc; import core.stdc.string : strncpy; // literal name if (prev == '/') { result.lexType = LexicalType.literalName; // omit / prev = cl_getc(); } // executable name else { result.lexType = LexicalType.executableName; } const s = input + pos - 1; size_t n = 1; while (isgraph(prev)) { prev = cl_getc(); ++n; } auto p = cast(char*) malloc(char.sizeof * n); strncpy(p, s, n); p[n] = 0; result.value.name = cast(string) p[0 .. n - 1]; return prev; } fprintf(stderr, "unknown character: '%c' (at position %d of the input '%s')\n", prev, pos, input); assert(false); } /// test parse numbers unittest { import cl_getc : cl_getc_set_src; Token token; cl_getc_set_src("123 345"); auto prev = parseOne(&token); assert(prev == ' '); assert(token.lexType == LexicalType.number); assert(token.value.number == 123); prev = parseOne(&token, prev); assert(prev == '3'); assert(token.lexType == LexicalType.space); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.number); assert(token.value.number == 345); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.eof); } /// test parse an executable name unittest { import cl_getc : cl_getc_set_src; Token token; cl_getc_set_src("add_ 123"); auto prev = parseOne(&token); assert(prev == ' '); assert(token.lexType == LexicalType.executableName); assert(token.value.name == "add_"); prev = parseOne(&token, prev); assert(prev == '1'); assert(token.lexType == LexicalType.space); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.number); assert(token.value.number == 123); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.eof); } /// test parse a literal name unittest { import cl_getc : cl_getc_set_src; Token token; cl_getc_set_src("/add_ 123"); auto prev = parseOne(&token); assert(prev == ' '); assert(token.lexType == LexicalType.literalName); assert(token.value.name == "add_"); prev = parseOne(&token, prev); assert(prev == '1'); assert(token.lexType == LexicalType.space); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.number); assert(token.value.number == 123); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.eof); } /// test parse braces unittest { import cl_getc : cl_getc_set_src; Token token; cl_getc_set_src("{}"); auto prev = parseOne(&token); assert(prev == '}'); assert(token.lexType == LexicalType.leftBrace); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.rightBrace); prev = parseOne(&token, prev); assert(prev == EOF); assert(token.lexType == LexicalType.eof); } /// debug func to print parser result void parser_print_all() { int ch = EOF; Token token; do { ch = parseOne(&token, ch); if (token.lexType != LexicalType.undefined) { with (LexicalType) switch(token.lexType) { case number: printf("num: %d\n", token.value.number); break; case space: printf("space!\n"); break; case leftBrace: printf("Open curly brace '%c'\n", token.value.onechar); break; case rightBrace: printf("Close curly brace '%c'\n", token.value.onechar); break; case executableName: printf("EXECUTABLE_NAME: %s\n", token.value.name.ptr); break; case literalName: printf("LITERAL_NAME: %s\n", token.value.name.ptr); break; default: static foreach (s; __traits(allMembers, LexicalType)) { { mixin("auto b = token.lexType == " ~ s ~ ";"); if (b) printf("Unknown type %s.%s\n", LexicalType.stringof.ptr, s.ptr); } } break; } } } while(ch != EOF); }
D
module webtank.db.iface.database; import webtank.db.consts: DBLogInfoType, DBMSType; import webtank.db.iface.query_result: IDBQueryResult; struct DBLogInfo { string msg; DBLogInfoType type; } alias DBLogerMethod = void delegate(DBLogInfo logInfo); /++ $(LANG_EN Base interface for database) $(LANG_RU Базовый интерфейс для базы данных) +/ interface IDatabase { /++ $(LANG_EN Connects to database using connection string. Returns true if connection is succesful or false if not ) $(LANG_RU Подключается к базе данных, используя строку подключения. Возвращает true при успешном подключении или false в противном случае ) +/ bool connect(string connStr); /++ $(LANG_EN Property returns true if connection establised) $(LANG_RU Свойство возвращает true при установленном подключении) +/ bool isConnected() @property; /++ $(LANG_EN Method executes query to database represented by $(D_PARAM queryStr). Returns database query result $(D IDBQueryResult) ) $(LANG_RU Метод выполняет запрос к базе данных представленный строкой запроса $(D_PARAM queryStr). Возвращает результат запроса $(D IDBQueryResult) ) +/ IDBQueryResult query(const(char)[] queryStr); //DBStatus getStatus() @property; //Подробнее узнать как дела у базы IDBQueryResult queryParamsArray(const(char)[] queryStr, string[] params); /++ $(LANG_EN Property returns last error message when executing query. Returns null if there is no error ) $(LANG_RU Свойство возвращает строку с сообщением о последней ошибке. Возвращает пустое значение (null), если ошибок нет ) +/ string lastErrorMessage() @property; //Прочитать последнюю ошибку //string getVersionInfo(); /++ $(LANG_EN Property returns type of database) $(LANG_RU Свойство возвращает тип базы данных) +/ DBMSType type() @property; /++ $(LANG_EN Method disconnects from database server) $(LANG_RU Метод отключения от сервера баз данных) +/ void disconnect(); }
D
a loose-fitting robe of towelling
D
module krepel.conversion.parse_integer; import krepel : Flag, Yes, No; import krepel.string; import krepel.conversion.conversion; import Meta = krepel.meta; template ParseInteger(IntegerType) if(Meta.IsIntegral!IntegerType) { struct Result { Flag!"Success" Success; long Value; alias Value this; } Result ParseInteger(Source)(ref Source String, IntegerType ValueOnError = IntegerType.min) { String = TrimStart(String); bool Sign = false; if(String.length == 0) { return Result(No.Success, ValueOnError); } switch(String[0]) { case '+': String = String[1..$]; break; case '-': Sign = true; String = String[1..$]; break; default: break; } ulong NumericalPart = 0; bool HasNumericalPart = false; while(String.length > 0 && IsDigit(String[0])) { NumericalPart *= 10; NumericalPart += String[0] - '0'; HasNumericalPart = true; String = String[1..$]; } if (!HasNumericalPart) { return Result(No.Success, ValueOnError); } auto Value = cast(IntegerType)NumericalPart; if(Sign) { static if(Meta.IsSigned!IntegerType) { Value = -Value; // Negate } else { // Unsigned types cannot have a '-' sign. return Result(No.Success, ValueOnError); } } return Result(Yes.Success, Value); } } alias ParseSignedInteger = ParseInteger!long; alias ParseUnsignedInteger = ParseInteger!ulong; version(unittest) private void TestLong(string String, long Expected, int ExpectedRangeLength) { auto Range = String[]; auto Result = ParseInteger!long(Range); assert(Result.Success); long Value = Result; assert(Value == Expected); assert(Range.length == ExpectedRangeLength); } unittest { import krepel.math; TestLong("1", 1, 0); TestLong("-1", -1, 0); TestLong("400000000", 400000000, 0); TestLong("-400000000", -400000000, 0); TestLong("23443A", 23443, 1); TestLong(" 23443A", 23443, 1); TestLong("\n \r \t23443A", 23443, 1); TestLong("76.55.43", 76, 6); auto String = "ABC"; auto Range = String[]; auto Value = ParseInteger!long(Range); assert(!Value.Success); assert(Value == long.min); assert(Range.length == 3); }
D
100 kopecks equal 1 ruble in Russia
D
module org.serviio.restlet.ModelError; public class ModelError { public static final int ERROR_INVALID_IP_ADDRESS = 500; public static final int ERROR_INVALID_TRANSCODING_FOLDER = 501; public static final int ERROR_INVALID_URL = 503; public static final int ERROR_EMPTY_REMOTE_ACCESS_PASSWORD = 504; public static final int ERROR_INVALID_IMPORT_DATA_FORMAT = 505; public static final int ERROR_AUTH_MISSING_DATE_HEADER = 550; public static final int ERROR_AUTH_MISSING_AUTH_HEADER = 551; public static final int ERROR_AUTH_INVALID_AUTH_HEADER = 552; public static final int ERROR_AUTH_INVALID_AUTH_TOKEN = 553; public static final int ERROR_INVALID_EDITION = 554; public static final int ERROR_LICENSE_CANT_VALIDATE = 555; public static final int ERROR_AUTH_EMPTY_PASSWORD = 556; public static final int ERROR_SERVER_NOT_AVAILABLE = 557; public static final int ERROR_CANNOT_ADVERTISE_SERVICE = 602; public static final int ERROR_INVALID_LIVE_STREAM_URL = 603; public static final int ERROR_CDS_PORT_NOT_ACCESSIBLE = 604; public static final int ERROR_CDS_PORT_ACCESSIBILITY_UNKNOWN = 605; public static final int ERROR_INVALID_PARAMETER = 700; } /* Location: C:\Users\Main\Downloads\serviio.jar * Qualified Name: org.serviio.restlet.ModelError * JD-Core Version: 0.7.0.1 */
D
module UnrealScript.TribesGame.TrArmorMod_Raider; import ScriptClasses; import UnrealScript.Helpers; import UnrealScript.TribesGame.TrArmorMod; extern(C++) interface TrArmorMod_Raider : TrArmorMod { public extern(D): private static __gshared ScriptClass mStaticClass; @property final static ScriptClass StaticClass() { mixin(MGSCC("Class TribesGame.TrArmorMod_Raider")); } private static __gshared TrArmorMod_Raider mDefaultProperties; @property final static TrArmorMod_Raider DefaultProperties() { mixin(MGDPC("TrArmorMod_Raider", "TrArmorMod_Raider TribesGame.Default__TrArmorMod_Raider")); } }
D
/** * OpenBSD implementation of glibc's $(LINK2 http://www.gnu.org/software/libc/manual/html_node/Backtraces.html backtrace) facility. * * Copyright: Copyright Martin Nowak 2012. * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Authors: Martin Nowak * Source: $(DRUNTIMESRC core/sys/openbsd/_execinfo.d) */ module core.sys.openbsd.execinfo; version (OpenBSD): extern (C): nothrow: version (GNU) version = BacktraceExternal; version (BacktraceExternal) { size_t backtrace(void**, size_t); char** backtrace_symbols(const(void*)*, size_t); void backtrace_symbols_fd(const(void*)*, size_t, int); char** backtrace_symbols_fmt(const(void*)*, size_t, const char*); int backtrace_symbols_fd_fmt(const(void*)*, size_t, int, const char*); } else { import core.sys.openbsd.dlfcn; // Use extern (D) so that these functions don't collide with libexecinfo. extern (D) int backtrace(void** buffer, int size) { import core.thread : thread_stackBottom; void** p, pend=cast(void**)thread_stackBottom(); version (D_InlineAsm_X86) asm nothrow @trusted { mov p[EBP], EBP; } else version (D_InlineAsm_X86_64) asm nothrow @trusted { mov p[RBP], RBP; } else static assert(false, "Architecture not supported."); int i; for (; i < size && p < pend; ++i) { buffer[i] = *(p + 1); auto pnext = cast(void**)*p; if (pnext <= p) break; p = pnext; } return i; } extern (D) char** backtrace_symbols(const(void*)* buffer, int size) { static void* realloc(void* p, size_t len) nothrow { static import cstdlib=core.stdc.stdlib; auto res = cstdlib.realloc(p, len); if (res is null) cstdlib.free(p); return res; } if (size <= 0) return null; size_t pos = size * (char*).sizeof; char** p = cast(char**)realloc(null, pos); if (p is null) return null; Dl_info info; foreach (i, addr; buffer[0 .. size]) { if (dladdr(addr, &info) == 0) (cast(ubyte*)&info)[0 .. info.sizeof] = 0; fixupDLInfo(addr, info); immutable len = formatStackFrame(null, 0, addr, info); assert(len > 0); p = cast(char**)realloc(p, pos + len); if (p is null) return null; formatStackFrame(cast(char*)p + pos, len, addr, info) == len || assert(0); p[i] = cast(char*)pos; pos += len; } foreach (i; 0 .. size) { pos = cast(size_t)p[i]; p[i] = cast(char*)p + pos; } return p; } extern (D) void backtrace_symbols_fd(const(void*)* buffer, int size, int fd) { import core.sys.posix.unistd : write; import core.stdc.stdlib : alloca; if (size <= 0) return; Dl_info info; foreach (i, addr; buffer[0 .. size]) { if (dladdr(addr, &info) == 0) (cast(ubyte*)&info)[0 .. info.sizeof] = 0; fixupDLInfo(addr, info); enum maxAlloca = 1024; enum min = (size_t a, size_t b) => a <= b ? a : b; immutable len = min(formatStackFrame(null, 0, addr, info), maxAlloca); assert(len > 0); auto p = cast(char*)alloca(len); if (p is null) return; formatStackFrame(p, len, addr, info) >= len || assert(0); p[len - 1] = '\n'; write(fd, p, len); } } private void fixupDLInfo(const(void)* addr, ref Dl_info info) { if (info.dli_fname is null) info.dli_fname = "???"; if (info.dli_fbase is null) info.dli_fbase = null; if (info.dli_sname is null) info.dli_sname = "???"; if (info.dli_saddr is null) info.dli_saddr = cast(void*)addr; } private size_t formatStackFrame(char* p, size_t plen, const(void)* addr, const ref Dl_info info) { import core.stdc.stdio : snprintf; immutable off = addr - info.dli_saddr; immutable len = snprintf(p, plen, "%p <%s+%zd> at %s", addr, info.dli_sname, off, info.dli_fname); assert(len > 0); return cast(size_t)len + 1; // + '\0' } }
D
module gsb.coregl.glstate; import gsb.coregl.resource; import gsb.coregl.gl; import gsb.core.log; public __gshared GLState glState; struct GLState { private bool depthTestEnabled = false; private GLenum depthTestFunc = GL_LESS; private bool transparencyEnabled = false; private GLuint lastBoundBuffer = 0; private GLuint lastBoundShader = 0; private GLuint lastBoundVao = 0; private GLuint lastBoundTexture = 0; private uint lastActiveTexture = 0; void enableDepthTest (bool enabled, GLenum depthTest = GL_LESS) { if (depthTestEnabled != enabled || depthTestFunc != depthTest) { if ((depthTestEnabled = enabled) == true) { depthTestFunc = depthTest; //log.write("Enabling glDepthTest (GL_LESS)"); glchecked!glEnable(GL_DEPTH_TEST); glchecked!glDepthFunc(depthTest); } else { //log.write("Disabling glDepthTest"); glchecked!glDisable(GL_DEPTH_TEST); } } } void enableTransparency (bool enabled) { if (transparencyEnabled != enabled) { if ((transparencyEnabled = enabled) == true) { //log.write("Enabling alpha transparency blending"); glchecked!glEnable(GL_BLEND); glchecked!glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else { //log.write("Disabling alpha transparency"); glchecked!glDisable(GL_BLEND); } } } void bindShader (GLuint shader) { //log.write("glState: binding shader %s", shader); if (shader != lastBoundShader) { glchecked!glUseProgram(shader); lastBoundShader = shader; } } void bindVao (GLuint vao) { //log.write("glState: binding vao %s", vao); if (vao != lastBoundVao) { glchecked!glBindVertexArray(vao); lastBoundVao = vao; } } void bindBuffer (GLenum type, GLuint vbo) { //log.write("glState: binding vbo %s", vbo); if (vbo != lastBoundBuffer) { glchecked!glBindBuffer(type, vbo); lastBoundBuffer = vbo; } } void bindTexture (GLenum type, GLuint texture) { //log.write("glState: binding texture %s", texture); if (texture != lastBoundTexture) { glchecked!glBindTexture(type, texture); lastBoundTexture = texture; } } void activeTexture (uint textureUnit) { //log.write("glState: activating texture %d", textureUnit - GL_TEXTURE0); if (textureUnit != lastActiveTexture) glchecked!glActiveTexture(lastActiveTexture = textureUnit); } }
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_27_MobileMedia-4414986338.notation#_copSALmGEeKQQp7P9cQvNQ"/> </availablePage> </pageList> <sashModel currentSelection="//@sashModel/@windows.0/@children.0"> <windows> <children xsi:type="di:TabFolder"> <children> <emfPageIdentifier href="VAR_27_MobileMedia-4414986338.notation#_copSALmGEeKQQp7P9cQvNQ"/> </children> </children> </windows> </sashModel> </di:SashWindowsMngr>
D
// implementation of PlatformTimer with fd linux timer module dgt.platform.xcb.timer; version(linux): import core.sys.linux.timerfd; import core.sys.linux.time; import core.sys.linux.unistd; import core.time; import dgt.application; import dgt.core.signal; import dgt.platform; import dgt.platform.xcb; final class LinuxFdTimer : PlatformTimer { int _fd; Mode _mode; MonoTime _started; Duration _duration; uint _shots; bool _engaged; Slot!() _handler; uint _remShots; Mode _activeMode; this () { _fd = timerfd_create(CLOCK_MONOTONIC, 0); } override void dispose() { close(_fd); } @property Mode mode() { return _mode; } @property void mode(in Mode mode) { _mode = mode; } @property bool engaged() { return _engaged; } @property MonoTime started() { return _started; } @property Duration duration() { return _duration; } @property void duration(in Duration dur) { _duration = dur; } @property uint shots() { return _shots; } @property void shots(in uint val) { _shots = val; } @property Slot!() handler() { return _handler; } @property void handler(Slot!() slot) { _handler = slot; } void start() { auto xcbP = cast(XcbPlatform)Application.platform; xcbP.registerTimer(this); _activeMode = _mode; _remShots = _shots; _started = MonoTime.currTime; _engaged = true; immutable durSpec = durToTimespec(_duration); itimerspec spec; spec.it_value = durSpec; if (_mode != Mode.singleShot) { spec.it_interval = durSpec; } timerfd_settime(_fd, 0, &spec, null); } void stop() { itimerspec spec; timerfd_settime(_fd, 0, &spec, null); _remShots = 0; _started = MonoTime.init; _engaged = false; auto xcbP = cast(XcbPlatform)Application.platform; xcbP.unregisterTimer(this); } @property int fd() { return _fd; } void notifyShot() { switch(_activeMode) { case Mode.singleShot: stop(); break; case Mode.multipleShots: _remShots -= 1; if (!_remShots) { stop(); } break; default: break; } } } timespec durToTimespec(in Duration duration) { immutable secs = duration.total!"seconds"; immutable nsecs = (duration - dur!"seconds"(secs)).total!"nsecs"; return timespec(secs, nsecs); }
D
instance DIA_ULF_EXIT(C_INFO) { npc = nov_602_ulf; nr = 999; condition = dia_ulf_exit_condition; information = dia_ulf_exit_info; permanent = TRUE; description = DIALOG_ENDE; }; func int dia_ulf_exit_condition() { return TRUE; }; func void dia_ulf_exit_info() { AI_StopProcessInfos(self); }; instance DIA_ULF_HALLO(C_INFO) { npc = nov_602_ulf; nr = 2; condition = dia_ulf_hallo_condition; information = dia_ulf_hallo_info; permanent = FALSE; description = "Что ты делаешь здесь?"; }; func int dia_ulf_hallo_condition() { if((hero.guild != GIL_NOV) && (hero.guild != GIL_KDF) && (MIS_SCHNITZELJAGD == FALSE)) { return TRUE; }; }; func void dia_ulf_hallo_info() { AI_Output(other,self,"DIA_Ulf_Hallo_15_00"); //Что ты делаешь здесь? if(hero.guild == GIL_PAL) { AI_Output(self,other,"DIA_Ulf_Hallo_03_01"); //Если тебе интересно это знать, я выполняю задание монастыря. } else { AI_Output(self,other,"DIA_Ulf_Hallo_03_02"); //Я послушник в монастыре. Я выполняю задания магов, а также паладинов. }; AI_Output(self,other,"DIA_Ulf_Hallo_03_03"); //Я доставил трем трактирщикам города вино из монастыря. }; instance DIA_ULF_WIRTE(C_INFO) { npc = nov_602_ulf; nr = 3; condition = dia_ulf_wirte_condition; information = dia_ulf_wirte_info; permanent = FALSE; description = "Кто эти трое трактирщиков?"; }; func int dia_ulf_wirte_condition() { if(Npc_KnowsInfo(hero,dia_ulf_hallo) && (hero.guild != GIL_KDF) && (hero.guild != GIL_NOV)) { return TRUE; }; }; func void dia_ulf_wirte_info() { AI_Output(other,self,"DIA_Ulf_Wirte_15_00"); //Кто эти трое трактирщиков? AI_Output(self,other,"DIA_Ulf_Wirte_03_01"); //Один из них - вот этот добрый человек за прилавком. AI_Output(self,other,"DIA_Ulf_Wirte_03_02"); //Также еще Карагон - хозяин таверны на храмовой площади, и Кардиф - владелец бара в портовом районе. }; instance DIA_ULF_KLOSTER(C_INFO) { npc = nov_602_ulf; nr = 3; condition = dia_ulf_kloster_condition; information = dia_ulf_kloster_info; permanent = FALSE; description = "Что ты можешь рассказать мне о монастыре?"; }; func int dia_ulf_kloster_condition() { if(Npc_KnowsInfo(hero,dia_ulf_hallo) && (hero.guild != GIL_KDF) && (hero.guild != GIL_NOV)) { return TRUE; }; }; func void dia_ulf_kloster_info() { AI_Output(other,self,"DIA_Ulf_Kloster_15_00"); //Что ты можешь рассказать мне о монастыре? AI_Output(self,other,"DIA_Ulf_Kloster_03_01"); //Мы, послушники, ищем просвещение в молитвах Инносу и изучении принципов веры под руководством магов. AI_Output(self,other,"DIA_Ulf_Kloster_03_02"); //Мы служим им так же, как мы служим Инносу, и готовим себя к единению с огнем. }; instance DIA_ULF_BRINGEN(C_INFO) { npc = nov_602_ulf; nr = 4; condition = dia_ulf_bringen_condition; information = dia_ulf_bringen_info; permanent = FALSE; description = "Отведи меня в монастырь."; }; func int dia_ulf_bringen_condition() { if(Npc_KnowsInfo(hero,dia_ulf_hallo) && (hero.guild != GIL_KDF) && (hero.guild != GIL_NOV) && (hero.guild != GIL_PAL)) { return TRUE; }; }; func void dia_ulf_bringen_info() { AI_Output(other,self,"DIA_Ulf_Bringen_15_00"); //Отведи меня в монастырь. AI_Output(self,other,"DIA_Ulf_Bringen_03_01"); //Забудь об этом. Ты знаешь, сколько различных злобных тварей встретилось мне по пути? AI_Output(self,other,"DIA_Ulf_Bringen_03_02"); //Когда я думаю обо всех этих кровавых мухах, волках и гоблинах, я рад, что мне больше не нужно жить здесь. AI_Output(self,other,"DIA_Ulf_Bringen_03_03"); //Кроме того, тебя все равно не пустят в монастырь. AI_Output(other,self,"DIA_Ulf_Bringen_15_04"); //Почему? AI_Output(self,other,"DIA_Ulf_Bringen_03_05"); //Вход в монастырь разрешен только магам, паладинам и послушникам. }; instance DIA_ULF_AUFNAHME(C_INFO) { npc = nov_602_ulf; nr = 3; condition = dia_ulf_aufnahme_condition; information = dia_ulf_aufnahme_info; permanent = FALSE; description = "Как мне стать послушником?"; }; func int dia_ulf_aufnahme_condition() { if(Npc_KnowsInfo(hero,dia_ulf_bringen) && (hero.guild == GIL_NONE)) { return TRUE; }; }; func void dia_ulf_aufnahme_info() { AI_Output(other,self,"DIA_Ulf_Aufnahme_15_00"); //Как мне стать послушником? AI_Output(self,other,"DIA_Ulf_Aufnahme_03_01"); //Если человек чувствует глубокое желание... AI_Output(other,self,"DIA_Ulf_Aufnahme_15_02"); //Эй! Просто скажи мне, каковы условия. AI_Output(self,other,"DIA_Ulf_Aufnahme_03_03"); //Ты должен принести дары. Овцу и... b_say_gold(self,other,SUMME_KLOSTER); Log_CreateTopic(TOPIC_KLOSTER,LOG_MISSION); Log_SetTopicStatus(TOPIC_KLOSTER,LOG_RUNNING); b_logentry(TOPIC_KLOSTER,"Чтобы стать послушником монастыря Инноса, мне нужна овца и 1000 золотых монет."); }; instance DIA_ULF_GOLD(C_INFO) { npc = nov_602_ulf; nr = 8; condition = dia_ulf_gold_condition; information = dia_ulf_gold_info; permanent = FALSE; description = "Как мне раздобыть такую огромную сумму?"; }; func int dia_ulf_gold_condition() { if(Npc_KnowsInfo(hero,dia_ulf_aufnahme) && (hero.guild == GIL_NONE)) { return TRUE; }; }; func void dia_ulf_gold_info() { AI_Output(other,self,"DIA_Ulf_Gold_15_00"); //Как мне раздобыть такую огромную сумму? AI_Output(self,other,"DIA_Ulf_Gold_03_01"); //Так как очевидно, что ты не знаешь никого, кто мог бы заплатить за тебя, тебе просто нужно заработать ее. }; instance DIA_ULF_SCHAF(C_INFO) { npc = nov_602_ulf; nr = 9; condition = dia_ulf_schaf_condition; information = dia_ulf_schaf_info; permanent = FALSE; description = "Где я могу найти овцу?"; }; func int dia_ulf_schaf_condition() { if(Npc_KnowsInfo(hero,dia_ulf_aufnahme) && (hero.guild == GIL_NONE)) { return TRUE; }; }; func void dia_ulf_schaf_info() { AI_Output(other,self,"DIA_Ulf_Schaf_15_00"); //Где я могу найти овцу? AI_Output(self,other,"DIA_Ulf_Schaf_03_01"); //У фермеров, конечно же. Но ты не получишь ее даром. b_logentry(TOPIC_KLOSTER,"Я могу раздобыть овцу у фермеров."); }; instance DIA_ULF_SUCHE(C_INFO) { npc = nov_602_ulf; nr = 9; condition = dia_ulf_suche_condition; information = dia_ulf_suche_info; permanent = FALSE; important = TRUE; }; func int dia_ulf_suche_condition() { if((MIS_SCHNITZELJAGD == LOG_RUNNING) && (other.guild == GIL_NOV) && (Npc_GetDistToWP(self,"NW_TROLLAREA_PATH_42") <= 1000) && !Npc_KnowsInfo(other,dia_ulf_abrechnung)) { return TRUE; }; }; func void dia_ulf_suche_info() { AI_Output(self,other,"DIA_Ulf_Suche_03_00"); //Эй, ты знаешь новости? AI_Output(other,self,"DIA_Ulf_Suche_15_01"); //Ты был избран. AI_Output(self,other,"DIA_Ulf_Suche_03_02"); //Точно. Я как раз хотел посидеть, попить холодного пива, когда из-за угла вышел Дарон и сказал мне, что я был избран. AI_Output(self,other,"DIA_Ulf_Suche_03_03"); //Кто бы мог подумать? Воля Инноса непостижима. А что привело тебя сюда? AI_Output(other,self,"DIA_Ulf_Suche_15_04"); //Я потребовал прохождения Испытания Огнем. AI_Output(self,other,"DIA_Ulf_Suche_03_05"); //Это невозможно! Похоже, мужества у тебя хватит на десятерых. Это значит, что ты тоже будешь искать 'то, что верующий находит в конце пути'? AI_Output(other,self,"DIA_Ulf_Suche_15_06"); //Похоже на это. }; instance DIA_ULF_RAUSGEFUNDEN(C_INFO) { npc = nov_602_ulf; nr = 9; condition = dia_ulf_rausgefunden_condition; information = dia_ulf_rausgefunden_info; permanent = FALSE; description = "Ты еще ничего не нашел"; }; func int dia_ulf_rausgefunden_condition() { if((MIS_SCHNITZELJAGD == LOG_RUNNING) && (other.guild == GIL_NOV) && (Npc_GetDistToWP(self,"NW_TROLLAREA_PATH_42") <= 1000) && !Npc_KnowsInfo(other,dia_ulf_abrechnung)) { return TRUE; }; }; func void dia_ulf_rausgefunden_info() { AI_Output(other,self,"DIA_Ulf_Rausgefunden_15_00"); //Ты еще ничего не нашел AI_Output(self,other,"DIA_Ulf_Rausgefunden_03_01"); //Ну, я пытался идти за Агоном - но я потерял его. AI_Output(self,other,"DIA_Ulf_Rausgefunden_03_02"); //И что теперь?.. Что они говорят? Следуй знакам Инноса. Но я не понимаю эту загадку с путем... AI_Output(self,other,"DIA_Ulf_Rausgefunden_03_03"); //Так что я продолжу свои поиски. AI_StopProcessInfos(self); Npc_ExchangeRoutine(self,"FOLLOW"); }; instance DIA_ULF_FOLGEN(C_INFO) { npc = nov_602_ulf; nr = 9; condition = dia_ulf_folgen_condition; information = dia_ulf_folgen_info; permanent = FALSE; description = "Эй, ты что, идешь за мной?"; }; func int dia_ulf_folgen_condition() { if((MIS_SCHNITZELJAGD == LOG_RUNNING) && (other.guild == GIL_NOV) && Npc_KnowsInfo(other,dia_ulf_rausgefunden) && !Npc_KnowsInfo(other,dia_ulf_abrechnung)) { return TRUE; }; }; func void dia_ulf_folgen_info() { AI_Output(other,self,"DIA_Ulf_Folgen_15_00"); //Эй, ты что, идешь за мной? AI_Output(self,other,"DIA_Ulf_Folgen_03_01"); //Чушь. Просто я случайно иду в том же направлении, что и ты. AI_StopProcessInfos(self); }; instance DIA_ULF_STOP(C_INFO) { npc = nov_602_ulf; nr = 9; condition = dia_ulf_stop_condition; information = dia_ulf_stop_info; permanent = FALSE; description = "Хватит бегать за мной!"; }; func int dia_ulf_stop_condition() { if((MIS_SCHNITZELJAGD == LOG_RUNNING) && (other.guild == GIL_NOV) && Npc_KnowsInfo(other,dia_ulf_folgen) && !Npc_KnowsInfo(other,dia_ulf_abrechnung)) { return TRUE; }; }; func void dia_ulf_stop_info() { AI_Output(other,self,"DIA_Ulf_Stop_15_00"); //Хватит бегать за мной! AI_Output(self,other,"DIA_Ulf_Stop_03_01"); //Я не иду за тобой. Но, пожалуйста, если тебе так кажется - я пойду другой дорогой. AI_StopProcessInfos(self); Npc_ExchangeRoutine(self,"SUCHE"); }; instance DIA_ULF_ABRECHNUNG(C_INFO) { npc = nov_602_ulf; nr = 1; condition = dia_ulf_abrechnung_condition; information = dia_ulf_abrechnung_info; permanent = FALSE; important = TRUE; }; func int dia_ulf_abrechnung_condition() { if((MIS_SCHNITZELJAGD == LOG_RUNNING) && (other.guild == GIL_NOV) && (Npc_HasItems(other,itmi_runeblank) >= 1)) { return TRUE; }; }; func void dia_ulf_abrechnung_info() { AI_Output(self,other,"DIA_Ulf_Abrechnung_03_00"); //Мы опять встретились. Я много размышлял. Я верю, что желание стать магом сильно во мне. AI_Output(other,self,"DIA_Ulf_Abrechnung_15_01"); //Ох - не делай этого... AI_Output(self,other,"DIA_Ulf_Abrechnung_03_02"); //У меня нет выбора. Жизнь послушника не по мне. AI_Output(self,other,"DIA_Ulf_Abrechnung_03_03"); //Я должен стать магом. Тогда сразу все станет хорошо. И теперь я заберу то, что должно принадлежать мне. AI_Output(self,other,"DIA_Ulf_Abrechnung_03_04"); //Ты хочешь сказать последнее слово? Info_ClearChoices(dia_ulf_abrechnung); Info_AddChoice(dia_ulf_abrechnung,"Прекрати, я не хочу убивать тебя.",dia_ulf_abrechnung_lass); Info_AddChoice(dia_ulf_abrechnung,"Ты, возможно, что-то не понимаешь - мне нужно вернуться в монастырь.",dia_ulf_abrechnung_schnell); Info_AddChoice(dia_ulf_abrechnung,"У тебя нет ничего покурить?",dia_ulf_abrechnung_rauch); }; func void dia_ulf_abrechnung_lass() { AI_Output(other,self,"DIA_Ulf_Abrechnung_Lass_15_00"); //Прекрати, я не хочу убивать тебя. AI_Output(self,other,"DIA_Ulf_Abrechnung_Lass_03_01"); //Чушь. Ты же знаешь, что у тебя нет ни единого шанса против меня! Сражайся! AI_StopProcessInfos(self); b_attack(self,other,AR_KILL,0); }; func void dia_ulf_abrechnung_schnell() { AI_Output(other,self,"DIA_Ulf_Abrechnung_Schnell_15_00"); //Ты, возможно, что-то не понимаешь... Мне нужно вернуться в монастырь. AI_Output(self,other,"DIA_Ulf_Abrechnung_Schnell_03_01"); //Тебе больше никуда не нужно идти! AI_StopProcessInfos(self); b_attack(self,other,AR_KILL,0); }; func void dia_ulf_abrechnung_rauch() { AI_Output(other,self,"DIA_Ulf_Abrechnung_Rauch_15_00"); //У тебя нет ничего покурить? AI_Output(self,other,"DIA_Ulf_Abrechnung_Rauch_03_01"); //Тебе повезло. Как раз у меня кое-что есть. b_giveinvitems(self,other,itmi_joint,1); b_useitem(other,itmi_joint); AI_Output(self,other,"DIA_Ulf_Abrechnung_Rauch_03_02"); //Давай, закурим. AI_StopProcessInfos(self); b_attack(self,other,AR_KILL,0); }; instance DIA_ULF_TROLL(C_INFO) { npc = nov_602_ulf; nr = 9; condition = dia_ulf_troll_condition; information = dia_ulf_troll_info; permanent = FALSE; important = TRUE; }; func int dia_ulf_troll_condition() { if((MIS_SCHNITZELJAGD == LOG_RUNNING) && (other.guild == GIL_NOV) && Npc_KnowsInfo(other,dia_ulf_rausgefunden) && ((Npc_GetDistToWP(self,"NW_TROLLAREA_PATH_14") <= 1000) || (Npc_GetDistToWP(self,"NW_TROLLAREA_PATH_15") <= 1000))) { return TRUE; }; }; func void dia_ulf_troll_info() { AI_Output(self,other,"DIA_Ulf_Troll_03_00"); //Эй, ты действительно думаешь, что мы идем правильной дорогой? Тролль живет не здесь. AI_Output(self,other,"DIA_Ulf_Troll_03_01"); //Я думаю, нам нужно идти в другую сторону. AI_StopProcessInfos(self); Npc_ExchangeRoutine(self,"WAIT"); }; instance DIA_ULF_PICKPOCKET(C_INFO) { npc = nov_602_ulf; nr = 900; condition = dia_ulf_pickpocket_condition; information = dia_ulf_pickpocket_info; permanent = TRUE; description = PICKPOCKET_40; }; func int dia_ulf_pickpocket_condition() { return c_beklauen(34,50); }; func void dia_ulf_pickpocket_info() { Info_ClearChoices(dia_ulf_pickpocket); Info_AddChoice(dia_ulf_pickpocket,DIALOG_BACK,dia_ulf_pickpocket_back); Info_AddChoice(dia_ulf_pickpocket,DIALOG_PICKPOCKET,dia_ulf_pickpocket_doit); }; func void dia_ulf_pickpocket_doit() { b_beklauen(); Info_ClearChoices(dia_ulf_pickpocket); }; func void dia_ulf_pickpocket_back() { Info_ClearChoices(dia_ulf_pickpocket); };
D
// Written in the D programming language. /** A one-stop shop for converting values from one type to another. Copyright: Copyright Digital Mars 2007-. License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0). Authors: $(WEB digitalmars.com, Walter Bright), $(WEB erdani.org, Andrei Alexandrescu), Shin Fujishiro, Adam D. Ruppe, Kenji Hara Source: $(PHOBOSSRC std/_conv.d) Macros: WIKI = Phobos/StdConv */ module std.conv; import std.math : ldexp; import core.stdc.string; import std.algorithm, std.array, std.ascii, std.exception, std.math, std.range, std.string, std.traits, std.typecons, std.typetuple, std.uni, std.utf; import std.format; //debug=conv; // uncomment to turn on debugging printf's /* ************* Exceptions *************** */ /** * Thrown on conversion errors. */ class ConvException : Exception { @safe pure nothrow this(string s, string fn = __FILE__, size_t ln = __LINE__) { super(s, fn, ln); } } private string convError_unexpected(S)(S source) { return source.empty ? "end of input" : text("'", source.front, "'"); } private auto convError(S, T)(S source, string fn = __FILE__, size_t ln = __LINE__) { return new ConvException( text("Unexpected ", convError_unexpected(source), " when converting from type "~S.stringof~" to type "~T.stringof), fn, ln); } private auto convError(S, T)(S source, int radix, string fn = __FILE__, size_t ln = __LINE__) { return new ConvException( text("Unexpected ", convError_unexpected(source), " when converting from type "~S.stringof~" base ", radix, " to type "~T.stringof), fn, ln); } @safe pure/* nothrow*/ // lazy parameter bug private auto parseError(lazy string msg, string fn = __FILE__, size_t ln = __LINE__) { return new ConvException(text("Can't parse string: ", msg), fn, ln); } private void parseCheck(alias source)(dchar c, string fn = __FILE__, size_t ln = __LINE__) { if (source.empty) throw parseError(text("unexpected end of input when expecting", "\"", c, "\"")); if (source.front != c) throw parseError(text("\"", c, "\" is missing"), fn, ln); source.popFront(); } private { template isImaginary(T) { enum bool isImaginary = staticIndexOf!(Unqual!T, ifloat, idouble, ireal) >= 0; } template isComplex(T) { enum bool isComplex = staticIndexOf!(Unqual!T, cfloat, cdouble, creal) >= 0; } template isNarrowInteger(T) { enum bool isNarrowInteger = staticIndexOf!(Unqual!T, byte, ubyte, short, ushort) >= 0; } T toStr(T, S)(S src) if (isSomeString!T) { auto w = appender!T(); FormatSpec!(ElementEncodingType!T) f; formatValue(w, src, f); return w.data; } template isExactSomeString(T) { enum isExactSomeString = isSomeString!T && !is(T == enum); } template isEnumStrToStr(S, T) { enum isEnumStrToStr = isImplicitlyConvertible!(S, T) && is(S == enum) && isExactSomeString!T; } template isNullToStr(S, T) { enum isNullToStr = isImplicitlyConvertible!(S, T) && is(S == typeof(null)) && isExactSomeString!T; } template isRawStaticArray(T, A...) { enum isRawStaticArray = A.length == 0 && isStaticArray!T && !is(T == class) && !is(T == interface) && !is(T == struct) && !is(T == union); } } /** * Thrown on conversion overflow errors. */ class ConvOverflowException : ConvException { @safe pure nothrow this(string s, string fn = __FILE__, size_t ln = __LINE__) { super(s, fn, ln); } } /** The $(D_PARAM to) family of functions converts a value from type $(D_PARAM Source) to type $(D_PARAM Target). The source type is deduced and the target type must be specified, for example the expression $(D_PARAM to!int(42.0)) converts the number 42 from $(D_PARAM double) to $(D_PARAM int). The conversion is "safe", i.e., it checks for overflow; $(D_PARAM to!int(4.2e10)) would throw the $(D_PARAM ConvOverflowException) exception. Overflow checks are only inserted when necessary, e.g., $(D_PARAM to!double(42)) does not do any checking because any int fits in a double. Converting a value to its own type (useful mostly for generic code) simply returns its argument. Example: ------------------------- int a = 42; auto b = to!int(a); // b is int with value 42 auto c = to!double(3.14); // c is double with value 3.14 ------------------------- Converting among numeric types is a safe way to cast them around. Conversions from floating-point types to integral types allow loss of precision (the fractional part of a floating-point number). The conversion is truncating towards zero, the same way a cast would truncate. (To round a floating point value when casting to an integral, use $(D_PARAM roundTo).) Examples: ------------------------- int a = 420; auto b = to!long(a); // same as long b = a; auto c = to!byte(a / 10); // fine, c = 42 auto d = to!byte(a); // throw ConvOverflowException double e = 4.2e6; auto f = to!int(e); // f == 4200000 e = -3.14; auto g = to!uint(e); // fails: floating-to-integral negative overflow e = 3.14; auto h = to!uint(e); // h = 3 e = 3.99; h = to!uint(a); // h = 3 e = -3.99; f = to!int(a); // f = -3 ------------------------- Conversions from integral types to floating-point types always succeed, but might lose accuracy. The largest integers with a predecessor representable in floating-point format are 2^24-1 for float, 2^53-1 for double, and 2^64-1 for $(D_PARAM real) (when $(D_PARAM real) is 80-bit, e.g. on Intel machines). Example: ------------------------- int a = 16_777_215; // 2^24 - 1, largest proper integer representable as float assert(to!int(to!float(a)) == a); assert(to!int(to!float(-a)) == -a); a += 2; assert(to!int(to!float(a)) == a); // fails! ------------------------- Conversions from string to numeric types differ from the C equivalents $(D_PARAM atoi()) and $(D_PARAM atol()) by checking for overflow and not allowing whitespace. For conversion of strings to signed types, the grammar recognized is: <pre> $(I Integer): $(I Sign UnsignedInteger) $(I UnsignedInteger) $(I Sign): $(B +) $(B -) </pre> For conversion to unsigned types, the grammar recognized is: <pre> $(I UnsignedInteger): $(I DecimalDigit) $(I DecimalDigit) $(I UnsignedInteger) </pre> Converting an array to another array type works by converting each element in turn. Associative arrays can be converted to associative arrays as long as keys and values can in turn be converted. Example: ------------------------- int[] a = ([1, 2, 3]).dup; auto b = to!(float[])(a); assert(b == [1.0f, 2, 3]); string str = "1 2 3 4 5 6"; auto numbers = to!(double[])(split(str)); assert(numbers == [1.0, 2, 3, 4, 5, 6]); int[string] c; c["a"] = 1; c["b"] = 2; auto d = to!(double[wstring])(c); assert(d["a"w] == 1 && d["b"w] == 2); ------------------------- Conversions operate transitively, meaning that they work on arrays and associative arrays of any complexity: ------------------------- int[string][double[int[]]] a; ... auto b = to!(short[wstring][string[double[]]])(a); ------------------------- This conversion works because $(D_PARAM to!short) applies to an $(D_PARAM int), $(D_PARAM to!wstring) applies to a $(D_PARAM string), $(D_PARAM to!string) applies to a $(D_PARAM double), and $(D_PARAM to!(double[])) applies to an $(D_PARAM int[]). The conversion might throw an exception because $(D_PARAM to!short) might fail the range check. */ /** Entry point that dispatches to the appropriate conversion primitive. Client code normally calls $(D _to!TargetType(value)) (and not some variant of $(D toImpl)). */ template to(T) { T to(A...)(A args) if (!isRawStaticArray!A) { return toImpl!T(args); } // Fix issue 6175 T to(S)(ref S arg) if (isRawStaticArray!S) { return toImpl!T(arg); } } // Tests for issue 6175 @safe pure unittest { char[9] sarr = "blablabla"; auto darr = to!(char[])(sarr); assert(sarr.ptr == darr.ptr); assert(sarr.length == darr.length); } // Tests for issue 7348 @safe pure unittest { assert(to!string(null) == "null"); assert(text(null) == "null"); } // Tests for issue 8729: do NOT skip leading WS @safe pure unittest { foreach (T; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) { assertThrown!ConvException(to!T(" 0")); assertThrown!ConvException(to!T(" 0", 8)); } foreach (T; TypeTuple!(float, double, real)) { assertThrown!ConvException(to!T(" 0")); } assertThrown!ConvException(to!bool(" true")); alias NullType = typeof(null); assertThrown!ConvException(to!NullType(" null")); alias ARR = int[]; assertThrown!ConvException(to!ARR(" [1]")); alias AA = int[int]; assertThrown!ConvException(to!AA(" [1:1]")); } /** If the source type is implicitly convertible to the target type, $(D to) simply performs the implicit conversion. */ T toImpl(T, S)(S value) if (isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) { template isSignedInt(T) { enum isSignedInt = isIntegral!T && isSigned!T; } alias isUnsignedInt = isUnsigned; // Conversion from integer to integer, and changing its sign static if (isUnsignedInt!S && isSignedInt!T && S.sizeof == T.sizeof) { // unsigned to signed & same size enforce(value <= cast(S)T.max, new ConvOverflowException("Conversion positive overflow")); } else static if (isSignedInt!S && isUnsignedInt!T) { // signed to unsigned enforce(0 <= value, new ConvOverflowException("Conversion negative overflow")); } return value; } @safe pure unittest { enum E { a } // Issue 9523 - Allow identity enum conversion auto e = to!E(E.a); assert(e == E.a); } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); int a = 42; auto b = to!long(a); assert(a == b); } // Tests for issue 6377 @safe pure unittest { // Conversion between same size foreach (S; TypeTuple!(byte, short, int, long)) { alias Unsigned!S U; foreach (Sint; TypeTuple!(S, const S, immutable S)) foreach (Uint; TypeTuple!(U, const U, immutable U)) { // positive overflow Uint un = Uint.max; assertThrown!ConvOverflowException(to!Sint(un), text(Sint.stringof, ' ', Uint.stringof, ' ', un)); // negative overflow Sint sn = -1; assertThrown!ConvOverflowException(to!Uint(sn), text(Sint.stringof, ' ', Uint.stringof, ' ', un)); } } // Conversion between different size foreach (i, S1; TypeTuple!(byte, short, int, long)) foreach ( S2; TypeTuple!(byte, short, int, long)[i+1..$]) { alias Unsigned!S1 U1; alias Unsigned!S2 U2; static assert(U1.sizeof < S2.sizeof); // small unsigned to big signed foreach (Uint; TypeTuple!(U1, const U1, immutable U1)) foreach (Sint; TypeTuple!(S2, const S2, immutable S2)) { Uint un = Uint.max; assertNotThrown(to!Sint(un)); assert(to!Sint(un) == un); } // big unsigned to small signed foreach (Uint; TypeTuple!(U2, const U2, immutable U2)) foreach (Sint; TypeTuple!(S1, const S1, immutable S1)) { Uint un = Uint.max; assertThrown(to!Sint(un)); } static assert(S1.sizeof < U2.sizeof); // small signed to big unsigned foreach (Sint; TypeTuple!(S1, const S1, immutable S1)) foreach (Uint; TypeTuple!(U2, const U2, immutable U2)) { Sint sn = -1; assertThrown!ConvOverflowException(to!Uint(sn)); } // big signed to small unsigned foreach (Sint; TypeTuple!(S2, const S2, immutable S2)) foreach (Uint; TypeTuple!(U1, const U1, immutable U1)) { Sint sn = -1; assertThrown!ConvOverflowException(to!Uint(sn)); } } } /* Converting static arrays forwards to their dynamic counterparts. */ T toImpl(T, S)(ref S s) if (isRawStaticArray!S) { return toImpl!(T, typeof(s[0])[])(s); } @safe pure unittest { char[4] test = ['a', 'b', 'c', 'd']; static assert(!isInputRange!(Unqual!(char[4]))); assert(to!string(test) == test); } /** When source type supports member template function opCast, is is used. */ T toImpl(T, S)(S value) if (is(typeof(S.init.opCast!T()) : T) && !isExactSomeString!T) { return value.opCast!T(); } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); class B { T opCast(T)() { return 43; } } auto b = new B; assert(to!int(b) == 43); debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); struct S { T opCast(T)() { return 43; } } auto s = S(); assert(to!int(s) == 43); } /** When target type supports 'converting construction', it is used. $(UL $(LI If target type is struct, $(D T(value)) is used.) $(LI If target type is class, $(D new T(value)) is used.)) */ T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && is(T == struct) && is(typeof(T(value)))) { return T(value); } // Bugzilla 3961 @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); struct Int { int x; } Int i = to!Int(1); static struct Int2 { int x; this(int x) @safe pure { this.x = x; } } Int2 i2 = to!Int2(1); static struct Int3 { int x; static Int3 opCall(int x) @safe pure { Int3 i; i.x = x; return i; } } Int3 i3 = to!Int3(1); } // Bugzilla 6808 @safe pure unittest { static struct FakeBigInt { this(string s) @safe pure {} } string s = "101"; auto i3 = to!FakeBigInt(s); } /// ditto T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && is(T == class) && is(typeof(new T(value)))) { return new T(value); } @safe pure unittest { static struct S { int x; } static class C { int x; this(int x) @safe pure { this.x = x; } } static class B { int value; this(S src) @safe pure { value = src.x; } this(C src) @safe pure { value = src.x; } } S s = S(1); auto b1 = to!B(s); // == new B(s) assert(b1.value == 1); C c = new C(2); auto b2 = to!B(c); // == new B(c) assert(b2.value == 2); auto c2 = to!C(3); // == new C(3) assert(c2.x == 3); } @safe pure unittest { struct S { class A { this(B b) @safe pure {} } class B : A { this() @safe pure { super(this); } } } S.B b = new S.B(); S.A a = to!(S.A)(b); // == cast(S.A)b // (do not run construction conversion like new S.A(b)) assert(b is a); static class C : Object { this() @safe pure {} this(Object o) @safe pure {} } Object oc = new C(); C a2 = to!C(oc); // == new C(a) // Construction conversion overrides down-casting conversion assert(a2 !is a); // } /** Object-to-object conversions by dynamic casting throw exception when the source is non-null and the target is null. */ T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && (is(S == class) || is(S == interface)) && !is(typeof(value.opCast!T()) : T) && (is(T == class) || is(T == interface)) && !is(typeof(new T(value)))) { static if (is(T == immutable)) { // immutable <- immutable enum isModConvertible = is(S == immutable); } else static if (is(T == const)) { static if (is(T == shared)) { // shared const <- shared // shared const <- shared const // shared const <- immutable enum isModConvertible = is(S == shared) || is(S == immutable); } else { // const <- mutable // const <- immutable enum isModConvertible = !is(S == shared); } } else { static if (is(T == shared)) { // shared <- shared mutable enum isModConvertible = is(S == shared) && !is(S == const); } else { // (mutable) <- (mutable) enum isModConvertible = is(Unqual!S == S); } } static assert(isModConvertible, "Bad modifier conversion: "~S.stringof~" to "~T.stringof); auto result = ()@trusted{ return cast(T) value; }(); if (!result && value) { throw new ConvException("Cannot convert object of static type " ~S.classinfo.name~" and dynamic type "~value.classinfo.name ~" to type "~T.classinfo.name); } return result; } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); // Testing object conversions class A {} class B : A {} class C : A {} A a1 = new A, a2 = new B, a3 = new C; assert(to!B(a2) is a2); assert(to!C(a3) is a3); assertThrown!ConvException(to!B(a3)); } // Unittest for 6288 @safe pure unittest { template Identity(T) { alias T Identity; } template toConst(T) { alias const(T) toConst; } template toShared(T) { alias shared(T) toShared; } template toSharedConst(T) { alias shared(const(T)) toSharedConst; } template toImmutable(T) { alias immutable(T) toImmutable; } template AddModifier(int n) if (0 <= n && n < 5) { static if (n == 0) alias Identity AddModifier; else static if (n == 1) alias toConst AddModifier; else static if (n == 2) alias toShared AddModifier; else static if (n == 3) alias toSharedConst AddModifier; else static if (n == 4) alias toImmutable AddModifier; } interface I {} interface J {} class A {} class B : A {} class C : B, I, J {} class D : I {} foreach (m1; TypeTuple!(0,1,2,3,4)) // enumerate modifiers foreach (m2; TypeTuple!(0,1,2,3,4)) // ditto { alias AddModifier!m1 srcmod; alias AddModifier!m2 tgtmod; //pragma(msg, srcmod!Object, " -> ", tgtmod!Object, ", convertible = ", // isImplicitlyConvertible!(srcmod!Object, tgtmod!Object)); // Compile time convertible equals to modifier convertible. static if (isImplicitlyConvertible!(srcmod!Object, tgtmod!Object)) { // Test runtime conversions: class to class, class to interface, // interface to class, and interface to interface // Check that the runtime conversion to succeed srcmod!A ac = new srcmod!C(); srcmod!I ic = new srcmod!C(); assert(to!(tgtmod!C)(ac) !is null); // A(c) to C assert(to!(tgtmod!I)(ac) !is null); // A(c) to I assert(to!(tgtmod!C)(ic) !is null); // I(c) to C assert(to!(tgtmod!J)(ic) !is null); // I(c) to J // Check that the runtime conversion fails srcmod!A ab = new srcmod!B(); srcmod!I id = new srcmod!D(); assertThrown(to!(tgtmod!C)(ab)); // A(b) to C assertThrown(to!(tgtmod!I)(ab)); // A(b) to I assertThrown(to!(tgtmod!C)(id)); // I(d) to C assertThrown(to!(tgtmod!J)(id)); // I(d) to J } else { // Check that the conversion is rejected statically static assert(!is(typeof(to!(tgtmod!C)(srcmod!A.init)))); // A to C static assert(!is(typeof(to!(tgtmod!I)(srcmod!A.init)))); // A to I static assert(!is(typeof(to!(tgtmod!C)(srcmod!I.init)))); // I to C static assert(!is(typeof(to!(tgtmod!J)(srcmod!I.init)))); // I to J } } } /** Stringize conversion from all types is supported. $(UL $(LI String _to string conversion works for any two string types having ($(D char), $(D wchar), $(D dchar)) character widths and any combination of qualifiers (mutable, $(D const), or $(D immutable)).) $(LI Converts array (other than strings) to string. Each element is converted by calling $(D to!T).) $(LI Associative array to string conversion. Each element is printed by calling $(D to!T).) $(LI Object to string conversion calls $(D toString) against the object or returns $(D "null") if the object is null.) $(LI Struct to string conversion calls $(D toString) against the struct if it is defined.) $(LI For structs that do not define $(D toString), the conversion to string produces the list of fields.) $(LI Enumerated types are converted to strings as their symbolic names.) $(LI Boolean values are printed as $(D "true") or $(D "false").) $(LI $(D char), $(D wchar), $(D dchar) to a string type.) $(LI Unsigned or signed integers to strings. $(DL $(DT [special case]) $(DD Convert integral value to string in $(D_PARAM radix) radix. radix must be a value from 2 to 36. value is treated as a signed value only if radix is 10. The characters A through Z are used to represent values 10 through 36 and their case is determined by the $(D_PARAM letterCase) parameter.))) $(LI All floating point types to all string types.) $(LI Pointer to string conversions prints the pointer as a $(D size_t) value. If pointer is $(D char*), treat it as C-style strings. In that case, this function is $(D @system).)) */ T toImpl(T, S)(S value) if (!(isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) && isExactSomeString!T) { static if (isExactSomeString!S && value[0].sizeof == ElementEncodingType!T.sizeof) { // string-to-string with incompatible qualifier conversion static if (is(ElementEncodingType!T == immutable)) { // conversion (mutable|const) -> immutable return value.idup; } else { // conversion (immutable|const) -> mutable return value.dup; } } else static if (isExactSomeString!S) { // other string-to-string //Use Appender directly instead of toStr, which also uses a formatedWrite auto w = appender!T(); w.put(value); return w.data; } else static if (isIntegral!S && !is(S == enum)) { // other integral-to-string conversions with default radix return toImpl!(T, S)(value, 10); } else static if (is(S == void[]) || is(S == const(void)[]) || is(S == immutable(void)[])) { // Converting void array to string alias Unqual!(ElementEncodingType!T) Char; auto raw = cast(const(ubyte)[]) value; enforce(raw.length % Char.sizeof == 0, new ConvException("Alignment mismatch in converting a " ~ S.stringof ~ " to a " ~ T.stringof)); auto result = new Char[raw.length / Char.sizeof]; ()@trusted{ memcpy(result.ptr, value.ptr, value.length); }(); return cast(T) result; } else static if (isPointer!S && is(S : const(char)*)) { // It is unsafe because we cannot guarantee that the pointer is null terminated. return value ? cast(T) value[0 .. strlen(value)].dup : cast(string)null; } else static if (isSomeString!T && is(S == enum)) { static if (isSwitchable!(OriginalType!S) && EnumMembers!S.length <= 50) { switch(value) { foreach (I, member; NoDuplicates!(EnumMembers!S)) { case member: return to!T(enumRep!(immutable(T), S, I)); } default: } } else { foreach (I, member; EnumMembers!S) { if (value == member) return to!T(enumRep!(immutable(T), S, I)); } } //Default case, delegate to format //Note: we don't call toStr directly, to avoid duplicate work. auto app = appender!T(); app.put("cast("); app.put(S.stringof); app.put(')'); FormatSpec!char f; formatValue(app, cast(OriginalType!S)value, f); return app.data; } else { // other non-string values runs formatting return toStr!T(value); } } /* Check whether type $(D T) can be used in a switch statement. This is useful for compile-time generation of switch case statements. */ private template isSwitchable(E) { enum bool isSwitchable = is(typeof({ switch (E.init) { default: } })); } // unittest { static assert(isSwitchable!int); static assert(!isSwitchable!double); static assert(!isSwitchable!real); } //Static representation of the index I of the enum S, //In representation T. //T must be an immutable string (avoids un-necessary initializations). private template enumRep(T, S, size_t I) if (is (T == immutable) && isExactSomeString!T && is(S == enum)) { static T enumRep = to!T(__traits(allMembers, S)[I]); } @safe pure unittest { void dg() { // string to string conversion debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); alias TypeTuple!(char, wchar, dchar) Chars; foreach (LhsC; Chars) { alias TypeTuple!(LhsC[], const(LhsC)[], immutable(LhsC)[]) LhStrings; foreach (Lhs; LhStrings) { foreach (RhsC; Chars) { alias TypeTuple!(RhsC[], const(RhsC)[], immutable(RhsC)[]) RhStrings; foreach (Rhs; RhStrings) { Lhs s1 = to!Lhs("wyda"); Rhs s2 = to!Rhs(s1); //writeln(Lhs.stringof, " -> ", Rhs.stringof); assert(s1 == to!Lhs(s2)); } } } } foreach (T; Chars) { foreach (U; Chars) { T[] s1 = to!(T[])("Hello, world!"); auto s2 = to!(U[])(s1); assert(s1 == to!(T[])(s2)); auto s3 = to!(const(U)[])(s1); assert(s1 == to!(T[])(s3)); auto s4 = to!(immutable(U)[])(s1); assert(s1 == to!(T[])(s4)); } } } dg(); assertCTFEable!dg; } @safe pure unittest { // Conversion reinterpreting void array to string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); auto a = "abcx"w; const(void)[] b = a; assert(b.length == 8); auto c = to!(wchar[])(b); assert(c == "abcx"); } @system pure unittest { // char* to string conversion debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("string.to!string(char*).unittest\n"); assert(to!string(cast(char*) null) == ""); assert(to!string("foo\0".ptr) == "foo"); } @safe pure unittest { // Conversion representing bool value with string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); bool b; assert(to!string(b) == "false"); b = true; assert(to!string(b) == "true"); } @safe pure unittest { // Conversion representing character value with string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); alias TypeTuple!( char, const( char), immutable( char), wchar, const(wchar), immutable(wchar), dchar, const(dchar), immutable(dchar)) AllChars; foreach (Char1; AllChars) { foreach (Char2; AllChars) { Char1 c = 'a'; assert(to!(Char2[])(c)[0] == c); } uint x = 4; assert(to!(Char1[])(x) == "4"); } string s = "foo"; string s2; foreach (char c; s) { s2 ~= to!string(c); } //printf("%.*s", s2); assert(s2 == "foo"); } @safe pure unittest { // Conversion representing integer values with string foreach (Int; TypeTuple!(ubyte, ushort, uint, ulong)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("string.to!string(%.*s).unittest\n", Int.stringof.length, Int.stringof.ptr); assert(to!string(to!Int(0)) == "0"); assert(to!string(to!Int(9)) == "9"); assert(to!string(to!Int(123)) == "123"); } foreach (Int; TypeTuple!(byte, short, int, long)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("string.to!string(%.*s).unittest\n", Int.stringof.length, Int.stringof.ptr); assert(to!string(to!Int(0)) == "0"); assert(to!string(to!Int(9)) == "9"); assert(to!string(to!Int(123)) == "123"); assert(to!string(to!Int(-0)) == "0"); assert(to!string(to!Int(-9)) == "-9"); assert(to!string(to!Int(-123)) == "-123"); assert(to!string(to!(const Int)(6)) == "6"); } debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); assert(wtext(int.max) == "2147483647"w); assert(wtext(int.min) == "-2147483648"w); assert(to!string(0L) == "0"); assertCTFEable!( { assert(to!string(1uL << 62) == "4611686018427387904"); assert(to!string(0x100000000) == "4294967296"); assert(to!string(-138L) == "-138"); }); } @safe pure unittest { // Conversion representing dynamic/static array with string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); long[] b = [ 1, 3, 5 ]; auto s = to!string(b); assert(to!string(b) == "[1, 3, 5]", s); } /*@safe pure */unittest // sprintf issue { double[2] a = [ 1.5, 2.5 ]; assert(to!string(a) == "[1.5, 2.5]"); } /*@safe pure */unittest { // Conversion representing associative array with string int[string] a = ["0":1, "1":2]; assert(to!string(a) == `["0":1, "1":2]`); } unittest { // Conversion representing class object with string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); class A { override string toString() const { return "an A"; } } A a; assert(to!string(a) == "null"); a = new A; assert(to!string(a) == "an A"); // Bug 7660 class C { override string toString() const { return "C"; } } struct S { C c; alias c this; } S s; s.c = new C(); assert(to!string(s) == "C"); } unittest { // Conversion representing struct object with string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); struct S1 { string toString() { return "wyda"; } } assert(to!string(S1()) == "wyda"); struct S2 { int a = 42; float b = 43.5; } S2 s2; assert(to!string(s2) == "S2(42, 43.5)"); // Test for issue 8080 struct S8080 { short[4] data; alias data this; string toString() { return "<S>"; } } S8080 s8080; assert(to!string(s8080) == "<S>"); } unittest { // Conversion representing enum value with string debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); enum EB : bool { a = true } enum EU : uint { a = 0, b = 1, c = 2 } // base type is unsigned enum EI : int { a = -1, b = 0, c = 1 } // base type is signed (bug 7909) enum EF : real { a = 1.414, b = 1.732, c = 2.236 } enum EC : char { a = 'x', b = 'y' } enum ES : string { a = "aaa", b = "bbb" } foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES)) { assert(to! string(E.a) == "a"c); assert(to!wstring(E.a) == "a"w); assert(to!dstring(E.a) == "a"d); } // Test an value not corresponding to an enum member. auto o = cast(EU)5; assert(to! string(o) == "cast(EU)5"c); assert(to!wstring(o) == "cast(EU)5"w); assert(to!dstring(o) == "cast(EU)5"d); } unittest { enum E { foo, bar, doo = foo, // check duplicate switch statements } foreach (S; TypeTuple!(string, wstring, dstring, const(char[]), const(wchar[]), const(dchar[]))) { auto s1 = to!S(E.foo); auto s2 = to!S(E.foo); assert(s1 == s2); // ensure we don't allocate when it's unnecessary assert(s1 is s2); } foreach (S; TypeTuple!(char[], wchar[], dchar[])) { auto s1 = to!S(E.foo); auto s2 = to!S(E.foo); assert(s1 == s2); // ensure each mutable array is unique assert(s1 !is s2); } } /// ditto @trusted pure T toImpl(T, S)(S value, uint radix, LetterCase letterCase = LetterCase.upper) if (isIntegral!S && isExactSomeString!T) in { assert(radix >= 2 && radix <= 36); } body { alias EEType = Unqual!(ElementEncodingType!T); T toStringRadixConvert(size_t bufLen, uint radix = 0, bool neg = false)(uint runtimeRadix = 0) { static if (neg) ulong div = void, mValue = unsigned(-value); else Unsigned!(Unqual!S) div = void, mValue = unsigned(value); size_t index = bufLen; EEType[bufLen] buffer = void; char baseChar = letterCase == LetterCase.lower ? 'a' : 'A'; char mod = void; do { static if (radix == 0) { div = cast(S)(mValue / runtimeRadix ); mod = cast(ubyte)(mValue % runtimeRadix); mod += mod < 10 ? '0' : baseChar - 10; } else static if (radix > 10) { div = cast(S)(mValue / radix ); mod = cast(ubyte)(mValue % radix); mod += mod < 10 ? '0' : baseChar - 10; } else { div = cast(S)(mValue / radix); mod = mValue % radix + '0'; } buffer[--index] = cast(char)mod; mValue = div; } while (mValue); static if (neg) { buffer[--index] = '-'; } return cast(T)buffer[index .. $].dup; } enforce(radix >= 2 && radix <= 36, new ConvException("Radix error")); switch(radix) { case 10: if (value < 0) return toStringRadixConvert!(S.sizeof * 3 + 1, 10, true)(); else return toStringRadixConvert!(S.sizeof * 3, 10)(); case 16: return toStringRadixConvert!(S.sizeof * 2, 16)(); case 2: return toStringRadixConvert!(S.sizeof * 8, 2)(); case 8: return toStringRadixConvert!(S.sizeof * 3, 8)(); default: return toStringRadixConvert!(S.sizeof * 6)(radix); } } @safe pure unittest { foreach (Int; TypeTuple!(uint, ulong)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("string.to!string(%.*s, uint).unittest\n", Int.stringof.length, Int.stringof.ptr); assert(to!string(to!Int(16), 16) == "10"); assert(to!string(to!Int(15), 2u) == "1111"); assert(to!string(to!Int(1), 2u) == "1"); assert(to!string(to!Int(0x1234AF), 16u) == "1234AF"); assert(to!string(to!Int(0x1234BCD), 16u, LetterCase.upper) == "1234BCD"); assert(to!string(to!Int(0x1234AF), 16u, LetterCase.lower) == "1234af"); } foreach (Int; TypeTuple!(int, long)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("string.to!string(%.*s, uint).unittest\n", Int.stringof.length, Int.stringof.ptr); assert(to!string(to!Int(-10), 10u) == "-10"); } assert(to!string(cast(byte)-10, 16) == "F6"); assert(to!string(long.min) == "-9223372036854775808"); assert(to!string(long.max) == "9223372036854775807"); } // Explicitly undocumented. It will be removed in November 2013. deprecated("Please use std.format.formattedWrite instead.") T toImpl(T, S)(S s, in T leftBracket, in T separator = ", ", in T rightBracket = "]") if (!isSomeChar!(ElementType!S) && (isInputRange!S || isInputRange!(Unqual!S)) && isExactSomeString!T) { static if (!isInputRange!S) { alias toImpl!(T, Unqual!S) ti; return ti(s, leftBracket, separator, rightBracket); } else { alias Unqual!(ElementEncodingType!T) Char; // array-to-string conversion auto result = appender!(Char[])(); result.put(leftBracket); bool first = true; for (; !s.empty; s.popFront()) { if (!first) { result.put(separator); } else { first = false; } result.put(to!T(s.front)); } result.put(rightBracket); return cast(T) result.data; } } // Explicitly undocumented. It will be removed in November 2013. deprecated("Please use std.format.formattedWrite instead.") T toImpl(T, S)(ref S s, in T leftBracket, in T separator = " ", in T rightBracket = "]") if ((is(S == void[]) || is(S == const(void)[]) || is(S == immutable(void)[])) && isExactSomeString!T) { return toImpl(s); } // Explicitly undocumented. It will be removed in November 2013. deprecated("Please use std.format.formattedWrite instead.") T toImpl(T, S)(S s, in T leftBracket, in T keyval = ":", in T separator = ", ", in T rightBracket = "]") if (isAssociativeArray!S && !is(S == enum) && isExactSomeString!T) { alias Unqual!(ElementEncodingType!T) Char; auto result = appender!(Char[])(); // hash-to-string conversion result.put(leftBracket); bool first = true; foreach (k, v; s) { if (!first) result.put(separator); else first = false; result.put(to!T(k)); result.put(keyval); result.put(to!T(v)); } result.put(rightBracket); return cast(T) result.data; } // Explicitly undocumented. It will be removed in November 2013. deprecated("Please use std.format.formattedWrite instead.") T toImpl(T, S)(S s, in T nullstr) if (is(S : Object) && isExactSomeString!T) { if (!s) return nullstr; return to!T(s.toString()); } // Explicitly undocumented. It will be removed in November 2013. deprecated("Please use std.format.formattedWrite instead.") T toImpl(T, S)(S s, in T left, in T separator = ", ", in T right = ")") if (is(S == struct) && !is(typeof(&S.init.toString)) && !isInputRange!S && isExactSomeString!T) { Tuple!(FieldTypeTuple!S) * t = void; static if ((*t).sizeof == S.sizeof) { // ok, attempt to forge the tuple t = cast(typeof(t)) &s; alias Unqual!(ElementEncodingType!T) Char; auto app = appender!(Char[])(); app.put(left); foreach (i, e; t.field) { if (i > 0) app.put(to!T(separator)); app.put(to!T(e)); } app.put(right); return cast(T) app.data; } else { // struct with weird alignment return to!T(S.stringof); } } /* $(LI A $(D typedef Type Symbol) is converted to string as $(D "Type(value)").) */ deprecated T toImpl(T, S)(S s, in T left = to!T(S.stringof~"("), in T right = ")") if (is(S == typedef) && isExactSomeString!T) { static if (is(S Original == typedef)) { // typedef return left ~ to!T(cast(Original) s) ~ right; } } /** Narrowing numeric-numeric conversions throw when the value does not fit in the narrower type. */ T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && (isNumeric!S || isSomeChar!S || isBoolean!S) && (isNumeric!T || isSomeChar!T || isBoolean!T) && !is(T == enum)) { enum sSmallest = mostNegative!S; enum tSmallest = mostNegative!T; static if (sSmallest < 0) { // possible underflow converting from a signed static if (tSmallest == 0) { immutable good = value >= 0; } else { static assert(tSmallest < 0); immutable good = value >= tSmallest; } if (!good) throw new ConvOverflowException("Conversion negative overflow"); } static if (S.max > T.max) { // possible overflow if (value > T.max) throw new ConvOverflowException("Conversion positive overflow"); } return (ref value)@trusted{ return cast(T) value; }(value); } @safe pure unittest { dchar a = ' '; assert(to!char(a) == ' '); a = 300; assert(collectException(to!char(a))); dchar from0 = 'A'; char to0 = to!char(from0); wchar from1 = 'A'; char to1 = to!char(from1); char from2 = 'A'; char to2 = to!char(from2); char from3 = 'A'; wchar to3 = to!wchar(from3); char from4 = 'A'; dchar to4 = to!dchar(from4); } unittest { // Narrowing conversions from enum -> integral should be allowed, but they // should throw at runtime if the enum value doesn't fit in the target // type. enum E1 : ulong { A = 1, B = 1UL<<48, C = 0 } assert(to!int(E1.A) == 1); assert(to!bool(E1.A) == true); assertThrown!ConvOverflowException(to!int(E1.B)); // E1.B overflows int assertThrown!ConvOverflowException(to!bool(E1.B)); // E1.B overflows bool assert(to!bool(E1.C) == false); enum E2 : long { A = -1L<<48, B = -1<<31, C = 1<<31 } assertThrown!ConvOverflowException(to!int(E2.A)); // E2.A overflows int assertThrown!ConvOverflowException(to!uint(E2.B)); // E2.B overflows uint assert(to!int(E2.B) == -1<<31); // but does not overflow int assert(to!int(E2.C) == 1<<31); // E2.C does not overflow int enum E3 : int { A = -1, B = 1, C = 255, D = 0 } assertThrown!ConvOverflowException(to!ubyte(E3.A)); assertThrown!ConvOverflowException(to!bool(E3.A)); assert(to!byte(E3.A) == -1); assert(to!byte(E3.B) == 1); assert(to!ubyte(E3.C) == 255); assert(to!bool(E3.B) == true); assertThrown!ConvOverflowException(to!byte(E3.C)); assertThrown!ConvOverflowException(to!bool(E3.C)); assert(to!bool(E3.D) == false); } /** Array-to-array conversion (except when target is a string type) converts each element in turn by using $(D to). */ T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && !isSomeString!S && isDynamicArray!S && !isExactSomeString!T && isArray!T) { alias E = typeof(T.init[0]); auto w = appender!(E[])(); w.reserve(value.length); foreach (i, ref e; value) { w.put(to!E(e)); } return w.data; } @safe pure unittest { // array to array conversions debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); uint[] a = ([ 1u, 2, 3 ]).dup; auto b = to!(float[])(a); assert(b == [ 1.0f, 2, 3 ]); //auto c = to!(string[])(b); //assert(c[0] == "1" && c[1] == "2" && c[2] == "3"); immutable(int)[3] d = [ 1, 2, 3 ]; b = to!(float[])(d); assert(b == [ 1.0f, 2, 3 ]); uint[][] e = [ a, a ]; auto f = to!(float[][])(e); assert(f[0] == b && f[1] == b); // Test for bug 8264 struct Wrap { string wrap; alias wrap this; } Wrap[] warr = to!(Wrap[])(["foo", "bar"]); // should work } /*@safe pure */unittest { auto b = [ 1.0f, 2, 3 ]; auto c = to!(string[])(b); assert(c[0] == "1" && c[1] == "2" && c[2] == "3"); } /** Associative array to associative array conversion converts each key and each value in turn. */ T toImpl(T, S)(S value) if (isAssociativeArray!S && isAssociativeArray!T && !is(T == enum)) { /* This code is potentially unsafe. */ alias KeyType!T K2; alias ValueType!T V2; // While we are "building" the AA, we need to unqualify its values, and only re-qualify at the end Unqual!V2[K2] result; foreach (k1, v1; value) { // Cast values temporarily to Unqual!V2 to store them to result variable result[to!K2(k1)] = cast(Unqual!V2) to!V2(v1); } // Cast back to original type return cast(T)result; } @safe /*pure */unittest { // hash to hash conversions int[string] a; a["0"] = 1; a["1"] = 2; auto b = to!(double[dstring])(a); assert(b["0"d] == 1 && b["1"d] == 2); } @safe /*pure */unittest // Bugzilla 8705, from doc { int[string][double[int[]]] a; auto b = to!(short[wstring][string[double[]]])(a); a = [null:["hello":int.max]]; assertThrown!ConvOverflowException(to!(short[wstring][string[double[]]])(a)); } version(none) // masked by unexpected linker error in posix platforms unittest // Extra cases for AA with qualifiers conversion { int[][int[]] a;// = [[], []]; auto b = to!(immutable(short[])[immutable short[]])(a); double[dstring][int[long[]]] c; auto d = to!(immutable(short[immutable wstring])[immutable string[double[]]])(c); } private void testIntegralToFloating(Integral, Floating)() { Integral a = 42; auto b = to!Floating(a); assert(a == b); assert(a == to!Integral(b)); } private void testFloatingToIntegral(Floating, Integral)() { bool convFails(Source, Target, E)(Source src) { try auto t = to!Target(src); catch (E) return true; return false; } // convert some value Floating a = 4.2e1; auto b = to!Integral(a); assert(is(typeof(b) == Integral) && b == 42); // convert some negative value (if applicable) a = -4.2e1; static if (Integral.min < 0) { b = to!Integral(a); assert(is(typeof(b) == Integral) && b == -42); } else { // no go for unsigned types assert(convFails!(Floating, Integral, ConvOverflowException)(a)); } // convert to the smallest integral value a = 0.0 + Integral.min; static if (Integral.min < 0) { a = -a; // -Integral.min not representable as an Integral assert(convFails!(Floating, Integral, ConvOverflowException)(a) || Floating.sizeof <= Integral.sizeof); } a = 0.0 + Integral.min; assert(to!Integral(a) == Integral.min); --a; // no more representable as an Integral assert(convFails!(Floating, Integral, ConvOverflowException)(a) || Floating.sizeof <= Integral.sizeof); a = 0.0 + Integral.max; // fwritefln(stderr, "%s a=%g, %s conv=%s", Floating.stringof, a, // Integral.stringof, to!Integral(a)); assert(to!Integral(a) == Integral.max || Floating.sizeof <= Integral.sizeof); ++a; // no more representable as an Integral assert(convFails!(Floating, Integral, ConvOverflowException)(a) || Floating.sizeof <= Integral.sizeof); // convert a value with a fractional part a = 3.14; assert(to!Integral(a) == 3); a = 3.99; assert(to!Integral(a) == 3); static if (Integral.min < 0) { a = -3.14; assert(to!Integral(a) == -3); a = -3.99; assert(to!Integral(a) == -3); } } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); alias AllInts = TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong); alias AllFloats = TypeTuple!(float, double, real); alias AllNumerics = TypeTuple!(AllInts, AllFloats); // test with same type { foreach (T; AllNumerics) { T a = 42; auto b = to!T(a); assert(is(typeof(a) == typeof(b)) && a == b); } } // test that floating-point numbers convert properly to largest ints // see http://oregonstate.edu/~peterseb/mth351/docs/351s2001_fp80x87.html // look for "largest fp integer with a predecessor" { // float int a = 16_777_215; // 2^24 - 1 assert(to!int(to!float(a)) == a); assert(to!int(to!float(-a)) == -a); // double long b = 9_007_199_254_740_991; // 2^53 - 1 assert(to!long(to!double(b)) == b); assert(to!long(to!double(-b)) == -b); // real // @@@ BUG IN COMPILER @@@ // ulong c = 18_446_744_073_709_551_615UL; // 2^64 - 1 // assert(to!ulong(to!real(c)) == c); // assert(to!ulong(-to!real(c)) == c); } // test conversions floating => integral { // AllInts[0 .. $ - 1] should be AllInts // @@@ BUG IN COMPILER @@@ foreach (Integral; AllInts[0 .. $ - 1]) { foreach (Floating; AllFloats) { testFloatingToIntegral!(Floating, Integral)(); } } } // test conversion integral => floating { foreach (Integral; AllInts[0 .. $ - 1]) { foreach (Floating; AllFloats) { testIntegralToFloating!(Integral, Floating)(); } } } // test parsing { foreach (T; AllNumerics) { // from type immutable(char)[2] auto a = to!T("42"); assert(a == 42); // from type char[] char[] s1 = "42".dup; a = to!T(s1); assert(a == 42); // from type char[2] char[2] s2; s2[] = "42"; a = to!T(s2); assert(a == 42); // from type immutable(wchar)[2] a = to!T("42"w); assert(a == 42); } } } /*@safe pure */unittest { alias AllInts = TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong); alias AllFloats = TypeTuple!(float, double, real); alias AllNumerics = TypeTuple!(AllInts, AllFloats); // test conversions to string { foreach (T; AllNumerics) { T a = 42; assert(to!string(a) == "42"); //assert(to!wstring(a) == "42"w); //assert(to!dstring(a) == "42"d); // array test // T[] b = new T[2]; // b[0] = 42; // b[1] = 33; // assert(to!string(b) == "[42,33]"); } } // test array to string conversion foreach (T ; AllNumerics) { auto a = [to!T(1), 2, 3]; assert(to!string(a) == "[1, 2, 3]"); } // test enum to int conversion // enum Testing { Test1, Test2 }; // Testing t; // auto a = to!string(t); // assert(a == "0"); } /** String to non-string conversion runs parsing. $(UL $(LI When the source is a wide string, it is first converted to a narrow string and then parsed.) $(LI When the source is a narrow string, normal text parsing occurs.)) */ T toImpl(T, S)(S value) if ( isExactSomeString!S && isDynamicArray!S && !isExactSomeString!T && is(typeof(parse!T(value)))) { scope(success) { if (value.length) { throw convError!(S, T)(value); } } return parse!T(value); } /// ditto T toImpl(T, S)(S value, uint radix) if ( isExactSomeString!S && isDynamicArray!S && !isExactSomeString!T && is(typeof(parse!T(value, radix)))) { scope(success) { if (value.length) { throw convError!(S, T)(value); } } return parse!T(value, radix); } @safe pure unittest { // Issue 6668 - ensure no collaterals thrown try { to!uint("-1"); } catch (ConvException e) { assert(e.next is null); } } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); foreach (Str; TypeTuple!(string, wstring, dstring)) { Str a = "123"; assert(to!int(a) == 123); assert(to!double(a) == 123); } // 6255 auto n = to!int("FF", 16); assert(n == 255); } /** Convert a value that is implicitly convertible to the enum base type into an Enum value. If the value does not match any enum member values a ConvException is thrown. Enums with floating-point or string base types are not supported. */ T toImpl(T, S)(S value) if (is(T == enum) && !is(S == enum) && is(typeof(value == OriginalType!T.init)) && !isFloatingPoint!(OriginalType!T) && !isSomeString!(OriginalType!T)) { foreach (Member; EnumMembers!T) { if (Member == value) return Member; } throw new ConvException(format("Value (%s) does not match any member value of enum '%s'", value, T.stringof)); } @safe pure unittest { enum En8143 : int { A = 10, B = 20, C = 30, D = 20 } enum En8143[][] m3 = to!(En8143[][])([[10, 30], [30, 10]]); static assert(m3 == [[En8143.A, En8143.C], [En8143.C, En8143.A]]); En8143 en1 = to!En8143(10); assert(en1 == En8143.A); assertThrown!ConvException(to!En8143(5)); // matches none En8143[][] m1 = to!(En8143[][])([[10, 30], [30, 10]]); assert(m1 == [[En8143.A, En8143.C], [En8143.C, En8143.A]]); } /*************************************************************** Rounded conversion from floating point to integral. Example: --------------- assert(roundTo!int(3.14) == 3); assert(roundTo!int(3.49) == 3); assert(roundTo!int(3.5) == 4); assert(roundTo!int(3.999) == 4); assert(roundTo!int(-3.14) == -3); assert(roundTo!int(-3.49) == -3); assert(roundTo!int(-3.5) == -4); assert(roundTo!int(-3.999) == -4); --------------- Rounded conversions do not work with non-integral target types. */ template roundTo(Target) { Target roundTo(Source)(Source value) { static assert(isFloatingPoint!Source); static assert(isIntegral!Target); return to!Target(trunc(value + (value < 0 ? -0.5L : 0.5L))); } } unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); assert(roundTo!int(3.14) == 3); assert(roundTo!int(3.49) == 3); assert(roundTo!int(3.5) == 4); assert(roundTo!int(3.999) == 4); assert(roundTo!int(-3.14) == -3); assert(roundTo!int(-3.49) == -3); assert(roundTo!int(-3.5) == -4); assert(roundTo!int(-3.999) == -4); assert(roundTo!(const int)(to!(const double)(-3.999)) == -4); // boundary values foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint)) { assert(roundTo!Int(Int.min - 0.4L) == Int.min); assert(roundTo!Int(Int.max + 0.4L) == Int.max); assertThrown!ConvOverflowException(roundTo!Int(Int.min - 0.5L)); assertThrown!ConvOverflowException(roundTo!Int(Int.max + 0.5L)); } } /*************************************************************** * The $(D_PARAM parse) family of functions works quite like the * $(D_PARAM to) family, except that (1) it only works with character ranges * as input, (2) takes the input by reference and advances it to * the position following the conversion, and (3) does not throw if it * could not convert the entire input. It still throws if an overflow * occurred during conversion or if no character of the input * was meaningfully converted. * * Example: * -------------- * string test = "123 \t 76.14"; * auto a = parse!uint(test); * assert(a == 123); * assert(test == " \t 76.14"); // parse bumps string * munch(test, " \t\n\r"); // skip ws * assert(test == "76.14"); * auto b = parse!double(test); * assert(b == 76.14); * assert(test == ""); * -------------- */ Target parse(Target, Source)(ref Source s) if (isSomeChar!(ElementType!Source) && isIntegral!Target && !is(Target == enum)) { static if (Target.sizeof < int.sizeof) { // smaller types are handled like integers auto v = .parse!(Select!(Target.min < 0, int, uint))(s); auto result = ()@trusted{ return cast(Target) v; }(); if (result != v) goto Loverflow; return result; } else { // Larger than int types static if (Target.min < 0) int sign = 0; else enum int sign = 0; Target v = 0; bool atStart = true; enum char maxLastDigit = Target.min < 0 ? '7' : '5'; while (!s.empty) { immutable c = s.front; if (c >= '0' && c <= '9') { if (v >= Target.max/10 && (v != Target.max/10 || c + sign > maxLastDigit)) goto Loverflow; v = cast(Target) (v * 10 + (c - '0')); s.popFront(); atStart = false; } else static if (Target.min < 0) { if (c == '-' && atStart) { s.popFront(); sign = -1; } else if (c == '+' && atStart) s.popFront(); else break; } else break; } if (atStart) goto Lerr; static if (Target.min < 0) { if (sign == -1) { v = -v; } } return v; } Loverflow: throw new ConvOverflowException("Overflow in integral conversion"); Lerr: throw convError!(Source, Target)(s); } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); string s = "123"; auto a = parse!int(s); } @safe pure unittest { foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("conv.to!%.*s.unittest\n", Int.stringof.length, Int.stringof.ptr); { assert(to!Int("0") == 0); static if (isSigned!Int) { assert(to!Int("+0") == 0); assert(to!Int("-0") == 0); } } static if (Int.sizeof >= byte.sizeof) { assert(to!Int("6") == 6); assert(to!Int("23") == 23); assert(to!Int("68") == 68); assert(to!Int("127") == 0x7F); static if (isUnsigned!Int) { assert(to!Int("255") == 0xFF); } static if (isSigned!Int) { assert(to!Int("+6") == 6); assert(to!Int("+23") == 23); assert(to!Int("+68") == 68); assert(to!Int("+127") == 0x7F); assert(to!Int("-6") == -6); assert(to!Int("-23") == -23); assert(to!Int("-68") == -68); assert(to!Int("-128") == -128); } } static if (Int.sizeof >= short.sizeof) { assert(to!Int("468") == 468); assert(to!Int("32767") == 0x7FFF); static if (isUnsigned!Int) { assert(to!Int("65535") == 0xFFFF); } static if (isSigned!Int) { assert(to!Int("+468") == 468); assert(to!Int("+32767") == 0x7FFF); assert(to!Int("-468") == -468); assert(to!Int("-32768") == -32768); } } static if (Int.sizeof >= int.sizeof) { assert(to!Int("2147483647") == 0x7FFFFFFF); static if (isUnsigned!Int) { assert(to!Int("4294967295") == 0xFFFFFFFF); } static if (isSigned!Int) { assert(to!Int("+2147483647") == 0x7FFFFFFF); assert(to!Int("-2147483648") == -2147483648); } } static if (Int.sizeof >= long.sizeof) { assert(to!Int("9223372036854775807") == 0x7FFFFFFFFFFFFFFF); static if (isUnsigned!Int) { assert(to!Int("18446744073709551615") == 0xFFFFFFFFFFFFFFFF); } static if (isSigned!Int) { assert(to!Int("+9223372036854775807") == 0x7FFFFFFFFFFFFFFF); assert(to!Int("-9223372036854775808") == 0x8000000000000000); } } } } @safe pure unittest { // parsing error check foreach (Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("conv.to!%.*s.unittest (error)\n", Int.stringof.length, Int.stringof.ptr); { immutable string[] errors1 = [ "", "-", "+", "-+", " ", " 0", "0 ", "- 0", "1-", "xx", "123h", ]; foreach (j, s; errors1) assertThrown!ConvException(to!Int(s)); } // parse!SomeUnsigned cannot parse head sign. static if (isUnsigned!Int) { immutable string[] errors2 = [ "+5", "-78", ]; foreach (j, s; errors2) assertThrown!ConvException(to!Int(s)); } } // positive overflow check foreach (i, Int; TypeTuple!(byte, ubyte, short, ushort, int, uint, long, ulong)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("conv.to!%.*s.unittest (pos overflow)\n", Int.stringof.length, Int.stringof.ptr); immutable string[] errors = [ "128", // > byte.max "256", // > ubyte.max "32768", // > short.max "65536", // > ushort.max "2147483648", // > int.max "4294967296", // > uint.max "9223372036854775808", // > long.max "18446744073709551616", // > ulong.max ]; foreach (j, s; errors[i..$]) assertThrown!ConvOverflowException(to!Int(s)); } // negative overflow check foreach (i, Int; TypeTuple!(byte, short, int, long)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("conv.to!%.*s.unittest (neg overflow)\n", Int.stringof.length, Int.stringof.ptr); immutable string[] errors = [ "-129", // < byte.min "-32769", // < short.min "-2147483649", // < int.min "-9223372036854775809", // < long.min ]; foreach (j, s; errors[i..$]) assertThrown!ConvOverflowException(to!Int(s)); } } @safe pure unittest { assertCTFEable!({ string s = "1234abc"; assert(parse! int(s) == 1234 && s == "abc"); }); assertCTFEable!({ string s = "-1234abc"; assert(parse! int(s) == -1234 && s == "abc"); }); assertCTFEable!({ string s = "1234abc"; assert(parse!uint(s) == 1234 && s == "abc"); }); } /// ditto Target parse(Target, Source)(ref Source s, uint radix) if (isSomeChar!(ElementType!Source) && isIntegral!Target && !is(Target == enum)) in { assert(radix >= 2 && radix <= 36); } body { if (radix == 10) return parse!Target(s); immutable uint beyond = (radix < 10 ? '0' : 'a'-10) + radix; Target v = 0; size_t atStart = true; for (; !s.empty; s.popFront()) { uint c = s.front; if (c < '0') break; if (radix < 10) { if (c >= beyond) break; } else { if (c > '9') { c |= 0x20;//poorman's tolower if (c < 'a' || c >= beyond) break; c -= 'a'-10-'0'; } } auto blah = cast(Target) (v * radix + c - '0'); if (blah < v) goto Loverflow; v = blah; atStart = false; } if (atStart) goto Lerr; return v; Loverflow: throw new ConvOverflowException("Overflow in integral conversion"); Lerr: throw convError!(Source, Target)(s, radix); } @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); // @@@BUG@@@ the size of China // foreach (i; 2..37) // { // assert(parse!int("0",i) == 0); // assert(parse!int("1",i) == 1); // assert(parse!byte("10",i) == i); // } foreach (i; 2..37) { string s = "0"; assert(parse!int(s,i) == 0); s = "1"; assert(parse!int(s,i) == 1); s = "10"; assert(parse!byte(s,i) == i); } // Same @@@BUG@@@ as above //assert(parse!int("0011001101101", 2) == 0b0011001101101); // assert(parse!int("765",8) == 0765); // assert(parse!int("fCDe",16) == 0xfcde); auto s = "0011001101101"; assert(parse!int(s, 2) == 0b0011001101101); s = "765"; assert(parse!int(s, 8) == octal!765); s = "fCDe"; assert(parse!int(s, 16) == 0xfcde); // 6609 s = "-42"; assert(parse!int(s, 10) == -42); } @safe pure unittest // bugzilla 7302 { auto r = cycle("2A!"); auto u = parse!uint(r, 16); assert(u == 42); assert(r.front == '!'); } Target parse(Target, Source)(ref Source s) if (isExactSomeString!Source && is(Target == enum)) { Target result; size_t longest_match = 0; foreach (i, e; EnumMembers!Target) { auto ident = __traits(allMembers, Target)[i]; if (longest_match < ident.length && s.startsWith(ident)) { result = e; longest_match = ident.length ; } } if (longest_match > 0) { s = s[longest_match .. $]; return result ; } throw new ConvException( Target.stringof ~ " does not have a member named '" ~ to!string(s) ~ "'"); } unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); enum EB : bool { a = true, b = false, c = a } enum EU { a, b, c } enum EI { a = -1, b = 0, c = 1 } enum EF : real { a = 1.414, b = 1.732, c = 2.236 } enum EC : char { a = 'a', b = 'b', c = 'c' } enum ES : string { a = "aaa", b = "bbb", c = "ccc" } foreach (E; TypeTuple!(EB, EU, EI, EF, EC, ES)) { assert(to!E("a"c) == E.a); assert(to!E("b"w) == E.b); assert(to!E("c"d) == E.c); assertThrown!ConvException(to!E("d")); } } @safe pure unittest // bugzilla 4744 { enum A { member1, member11, member111 } assert(to!A("member1" ) == A.member1 ); assert(to!A("member11" ) == A.member11 ); assert(to!A("member111") == A.member111); auto s = "member1111"; assert(parse!A(s) == A.member111 && s == "1"); } Target parse(Target, Source)(ref Source p) if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) && isFloatingPoint!Target && !is(Target == enum)) { static import core.stdc.math/* : HUGE_VAL*/; static immutable real[14] negtab = [ 1e-4096L,1e-2048L,1e-1024L,1e-512L,1e-256L,1e-128L,1e-64L,1e-32L, 1e-16L,1e-8L,1e-4L,1e-2L,1e-1L,1.0L ]; static immutable real[13] postab = [ 1e+4096L,1e+2048L,1e+1024L,1e+512L,1e+256L,1e+128L,1e+64L,1e+32L, 1e+16L,1e+8L,1e+4L,1e+2L,1e+1L ]; // static immutable string infinity = "infinity"; // static immutable string nans = "nans"; ConvException bailOut()(string msg = null, string fn = __FILE__, size_t ln = __LINE__) { if (!msg) msg = "Floating point conversion error"; return new ConvException(text(msg, " for input \"", p, "\"."), fn, ln); } enforce(!p.empty, bailOut()); char sign = 0; /* indicating + */ switch (p.front) { case '-': sign++; p.popFront(); enforce(!p.empty, bailOut()); if (std.ascii.toLower(p.front) == 'i') goto case 'i'; enforce(!p.empty, bailOut()); break; case '+': p.popFront(); enforce(!p.empty, bailOut()); break; case 'i': case 'I': p.popFront(); enforce(!p.empty, bailOut()); if (std.ascii.toLower(p.front) == 'n' && (p.popFront(), enforce(!p.empty, bailOut()), std.ascii.toLower(p.front) == 'f')) { // 'inf' p.popFront(); return sign ? -Target.infinity : Target.infinity; } goto default; default: {} } bool isHex = false; bool startsWithZero = p.front == '0'; if(startsWithZero) { p.popFront(); if(p.empty) { return (sign) ? -0.0 : 0.0; } isHex = p.front == 'x' || p.front == 'X'; } real ldval = 0.0; char dot = 0; /* if decimal point has been seen */ int exp = 0; long msdec = 0, lsdec = 0; ulong msscale = 1; if (isHex) { int guard = 0; int anydigits = 0; uint ndigits = 0; p.popFront(); while (!p.empty) { int i = p.front; while (isHexDigit(i)) { anydigits = 1; i = std.ascii.isAlpha(i) ? ((i & ~0x20) - ('A' - 10)) : i - '0'; if (ndigits < 16) { msdec = msdec * 16 + i; if (msdec) ndigits++; } else if (ndigits == 16) { while (msdec >= 0) { exp--; msdec <<= 1; i <<= 1; if (i & 0x10) msdec |= 1; } guard = i << 4; ndigits++; exp += 4; } else { guard |= i; exp += 4; } exp -= dot; p.popFront(); if (p.empty) break; i = p.front; if (i == '_') { p.popFront(); if (p.empty) break; i = p.front; } } if (i == '.' && !dot) { p.popFront(); dot = 4; } else break; } // Round up if (guard && (sticky || odd)) if (guard & 0x80 && (guard & 0x7F || msdec & 1)) { msdec++; if (msdec == 0) // overflow { msdec = 0x8000000000000000L; exp++; } } enforce(anydigits, bailOut()); enforce(!p.empty && (p.front == 'p' || p.front == 'P'), bailOut("Floating point parsing: exponent is required")); char sexp; int e; sexp = 0; p.popFront(); if (!p.empty) { switch (p.front) { case '-': sexp++; goto case; case '+': p.popFront(); enforce(!p.empty, new ConvException("Error converting input" " to floating point")); break; default: {} } } ndigits = 0; e = 0; while (!p.empty && isDigit(p.front)) { if (e < 0x7FFFFFFF / 10 - 10) // prevent integer overflow { e = e * 10 + p.front - '0'; } p.popFront(); ndigits = 1; } exp += (sexp) ? -e : e; enforce(ndigits, new ConvException("Error converting input" " to floating point")); static if (real.mant_dig == 64) { if (msdec) { int e2 = 0x3FFF + 63; // left justify mantissa while (msdec >= 0) { msdec <<= 1; e2--; } // Stuff mantissa directly into real ()@trusted{ *cast(long*)&ldval = msdec; }(); ()@trusted{ (cast(ushort*)&ldval)[4] = cast(ushort) e2; }(); // Exponent is power of 2, not power of 10 ldval = ldexp(ldval,exp); } } else static if (real.mant_dig == 53) { if (msdec) { //Exponent bias + 52: //After shifting 52 times left, exp must be 1 int e2 = 0x3FF + 52; // right justify mantissa // first 11 bits must be zero, rest is implied bit + mantissa // shift one time less, do rounding, shift again while ((msdec & 0xFFC0_0000_0000_0000) != 0) { msdec = ((cast(ulong)msdec) >> 1); e2++; } //Have to shift one more time //and do rounding if((msdec & 0xFFE0_0000_0000_0000) != 0) { auto roundUp = (msdec & 0x1); msdec = ((cast(ulong)msdec) >> 1); e2++; if(roundUp) { msdec += 1; //If mantissa was 0b1111... and we added +1 //the mantissa should be 0b10000 (think of implicit bit) //and the exponent increased if((msdec & 0x0020_0000_0000_0000) != 0) { msdec = 0x0010_0000_0000_0000; e2++; } } } // left justify mantissa // bit 11 must be 1 while ((msdec & 0x0010_0000_0000_0000) == 0) { msdec <<= 1; e2--; } // Stuff mantissa directly into double // (first including implicit bit) ()@trusted{ *cast(long *)&ldval = msdec; }(); //Store exponent, now overwriting implicit bit ()@trusted{ *cast(long *)&ldval &= 0x000F_FFFF_FFFF_FFFF; }(); ()@trusted{ *cast(long *)&ldval |= ((e2 & 0xFFFUL) << 52); }(); // Exponent is power of 2, not power of 10 ldval = ldexp(ldval,exp); } } else static assert(false, "Floating point format of real type not supported"); goto L6; } else // not hex { if (std.ascii.toUpper(p.front) == 'N' && !startsWithZero) { // nan enforce((p.popFront(), !p.empty && std.ascii.toUpper(p.front) == 'A') && (p.popFront(), !p.empty && std.ascii.toUpper(p.front) == 'N'), new ConvException("error converting input to floating point")); // skip past the last 'n' p.popFront(); return typeof(return).nan; } bool sawDigits = startsWithZero; while (!p.empty) { int i = p.front; while (isDigit(i)) { sawDigits = true; /* must have at least 1 digit */ if (msdec < (0x7FFFFFFFFFFFL-10)/10) msdec = msdec * 10 + (i - '0'); else if (msscale < (0xFFFFFFFF-10)/10) { lsdec = lsdec * 10 + (i - '0'); msscale *= 10; } else { exp++; } exp -= dot; p.popFront(); if (p.empty) break; i = p.front; if (i == '_') { p.popFront(); if (p.empty) break; i = p.front; } } if (i == '.' && !dot) { p.popFront(); dot++; } else { break; } } enforce(sawDigits, new ConvException("no digits seen")); } if (!p.empty && (p.front == 'e' || p.front == 'E')) { char sexp; int e; sexp = 0; p.popFront(); enforce(!p.empty, new ConvException("Unexpected end of input")); switch (p.front) { case '-': sexp++; goto case; case '+': p.popFront(); break; default: {} } bool sawDigits = 0; e = 0; while (!p.empty && isDigit(p.front)) { if (e < 0x7FFFFFFF / 10 - 10) // prevent integer overflow { e = e * 10 + p.front - '0'; } p.popFront(); sawDigits = 1; } exp += (sexp) ? -e : e; enforce(sawDigits, new ConvException("No digits seen.")); } ldval = msdec; if (msscale != 1) /* if stuff was accumulated in lsdec */ ldval = ldval * msscale + lsdec; if (ldval) { uint u = 0; int pow = 4096; while (exp > 0) { while (exp >= pow) { ldval *= postab[u]; exp -= pow; } pow >>= 1; u++; } while (exp < 0) { while (exp <= -pow) { ldval *= negtab[u]; enforce(ldval != 0, new ConvException("Range error")); exp += pow; } pow >>= 1; u++; } } L6: // if overflow occurred enforce(ldval != core.stdc.math.HUGE_VAL, new ConvException("Range error")); L1: return (sign) ? -ldval : ldval; } unittest { // Compare reals with given precision bool feq(in real rx, in real ry, in real precision = 0.000001L) { if (rx == ry) return 1; if (isnan(rx)) return cast(bool)isnan(ry); if (isnan(ry)) return 0; return cast(bool)(fabs(rx - ry) <= precision); } // Make given typed literal F Literal(F)(F f) { return f; } foreach (Float; TypeTuple!(float, double, real)) { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("conv.to!%.*s.unittest\n", Float.stringof.length, Float.stringof.ptr); assert(to!Float("123") == Literal!Float(123)); assert(to!Float("+123") == Literal!Float(+123)); assert(to!Float("-123") == Literal!Float(-123)); assert(to!Float("123e2") == Literal!Float(123e2)); assert(to!Float("123e+2") == Literal!Float(123e+2)); assert(to!Float("123e-2") == Literal!Float(123e-2)); assert(to!Float("123.") == Literal!Float(123.0)); assert(to!Float(".375") == Literal!Float(.375)); assert(to!Float("1.23375E+2") == Literal!Float(1.23375E+2)); assert(to!Float("0") is 0.0); assert(to!Float("-0") is -0.0); assert(isnan(to!Float("nan"))); assertThrown!ConvException(to!Float("\x00")); } // min and max float f = to!float("1.17549e-38"); assert(feq(cast(real)f, cast(real)1.17549e-38)); assert(feq(cast(real)f, cast(real)float.min_normal)); f = to!float("3.40282e+38"); assert(to!string(f) == to!string(3.40282e+38)); // min and max double d = to!double("2.22508e-308"); assert(feq(cast(real)d, cast(real)2.22508e-308)); assert(feq(cast(real)d, cast(real)double.min_normal)); d = to!double("1.79769e+308"); assert(to!string(d) == to!string(1.79769e+308)); assert(to!string(d) == to!string(double.max)); assert(to!string(to!real(to!string(real.max / 2L))) == to!string(real.max / 2L)); // min and max real r = to!real(to!string(real.min_normal)); assert(to!string(r) == to!string(real.min_normal)); r = to!real(to!string(real.max)); assert(to!string(r) == to!string(real.max)); } //Tests for the double implementation unittest { import core.stdc.stdlib; static if(real.mant_dig == 53) { //Should be parsed exactly: 53 bit mantissa string s = "0x1A_BCDE_F012_3456p10"; auto x = parse!real(s); assert(x == 0x1A_BCDE_F012_3456p10L); //1 bit is implicit assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0xA_BCDE_F012_3456); assert(strtod("0x1ABCDEF0123456p10", null) == x); //Should be parsed exactly: 10 bit mantissa s = "0x3FFp10"; x = parse!real(s); assert(x == 0x03FFp10); //1 bit is implicit assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_F800_0000_0000); assert(strtod("0x3FFp10", null) == x); //60 bit mantissa, round up s = "0xFFF_FFFF_FFFF_FFFFp10"; x = parse!real(s); assert(approxEqual(x, 0xFFF_FFFF_FFFF_FFFFp10)); //1 bit is implicit assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x0000_0000_0000_0000); assert(strtod("0xFFFFFFFFFFFFFFFp10", null) == x); //60 bit mantissa, round down s = "0xFFF_FFFF_FFFF_FF90p10"; x = parse!real(s); assert(approxEqual(x, 0xFFF_FFFF_FFFF_FF90p10)); //1 bit is implicit assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_FFFF_FFFF_FFFF); assert(strtod("0xFFFFFFFFFFFFF90p10", null) == x); //61 bit mantissa, round up 2 s = "0x1F0F_FFFF_FFFF_FFFFp10"; x = parse!real(s); assert(approxEqual(x, 0x1F0F_FFFF_FFFF_FFFFp10)); //1 bit is implicit assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_1000_0000_0000); assert(strtod("0x1F0FFFFFFFFFFFFFp10", null) == x); //61 bit mantissa, round down 2 s = "0x1F0F_FFFF_FFFF_FF10p10"; x = parse!real(s); assert(approxEqual(x, 0x1F0F_FFFF_FFFF_FF10p10)); //1 bit is implicit assert(((*cast(ulong*)&x) & 0x000F_FFFF_FFFF_FFFF) == 0x000F_0FFF_FFFF_FFFF); assert(strtod("0x1F0FFFFFFFFFFF10p10", null) == x); //Huge exponent s = "0x1F_FFFF_FFFF_FFFFp900"; x = parse!real(s); assert(strtod("0x1FFFFFFFFFFFFFp900", null) == x); //exponent too big -> converror s = ""; assertThrown!ConvException(x = parse!real(s)); assert(strtod("0x1FFFFFFFFFFFFFp1024", null) == real.infinity); //-exponent too big -> 0 s = "0x1FFFFFFFFFFFFFp-2000"; x = parse!real(s); assert(x == 0); assert(strtod("0x1FFFFFFFFFFFFFp-2000", null) == x); } } unittest { import core.stdc.errno; import core.stdc.stdlib; errno = 0; // In case it was set by another unittest in a different module. debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); struct longdouble { static if(real.mant_dig == 64) { ushort value[5]; } else static if(real.mant_dig == 53) { ushort value[4]; } else static assert(false, "Not implemented"); } real ld; longdouble x; real ld1; longdouble x1; int i; static if(real.mant_dig == 64) enum s = "0x1.FFFFFFFFFFFFFFFEp-16382"; else static if(real.mant_dig == 53) enum s = "0x1.FFFFFFFFFFFFFFFEp-1000"; else static assert(false, "Floating point format for real not supported"); auto s2 = s.idup; ld = parse!real(s2); assert(s2.empty); x = *cast(longdouble *)&ld; ld1 = strtold(s.ptr, null); x1 = *cast(longdouble *)&ld1; assert(x1 == x && ld1 == ld); // for (i = 4; i >= 0; i--) // { // printf("%04x ", x.value[i]); // } // printf("\n"); assert(!errno); s2 = "1.0e5"; ld = parse!real(s2); assert(s2.empty); x = *cast(longdouble *)&ld; ld1 = strtold("1.0e5", null); x1 = *cast(longdouble *)&ld1; // for (i = 4; i >= 0; i--) // { // printf("%04x ", x.value[i]); // } // printf("\n"); } @safe pure unittest { // Bugzilla 4959 { auto s = "0 "; auto x = parse!double(s); assert(s == " "); assert(x == 0.0); } // Bugzilla 3369 assert(to!float("inf") == float.infinity); assert(to!float("-inf") == -float.infinity); // Bugzilla 6160 assert(6_5.536e3L == to!real("6_5.536e3")); // 2^16 assert(0x1000_000_000_p10 == to!real("0x1000_000_000_p10")); // 7.03687e+13 // Bugzilla 6258 assertThrown!ConvException(to!real("-")); assertThrown!ConvException(to!real("in")); // Bugzilla 7055 assertThrown!ConvException(to!float("INF2")); //extra stress testing auto ssOK = ["1.", "1.1.1", "1.e5", "2e1e", "2a", "2e1_1", "inf", "-inf", "infa", "-infa", "inf2e2", "-inf2e2"]; auto ssKO = ["", " ", "2e", "2e+", "2e-", "2ee", "2e++1", "2e--1", "2e_1", "+inf"]; foreach (s; ssOK) parse!double(s); foreach (s; ssKO) assertThrown!ConvException(parse!double(s)); } /** Parsing one character off a string returns the character and bumps the string up one position. */ Target parse(Target, Source)(ref Source s) if (isExactSomeString!Source && staticIndexOf!(Unqual!Target, dchar, Unqual!(ElementEncodingType!Source)) >= 0) { if (s.empty) throw convError!(Source, Target)(s); static if (is(Unqual!Target == dchar)) { Target result = s.front; s.popFront(); return result; } else { // Special case: okay so parse a Char off a Char[] Target result = s[0]; s = s[1 .. $]; return result; } } @safe pure unittest { foreach (Str; TypeTuple!(string, wstring, dstring)) { foreach (Char; TypeTuple!(char, wchar, dchar)) { static if (is(Unqual!Char == dchar) || Char.sizeof == ElementEncodingType!Str.sizeof) { Str s = "aaa"; assert(parse!Char(s) == 'a'); assert(s == "aa"); } } } } Target parse(Target, Source)(ref Source s) if (!isSomeString!Source && isInputRange!Source && isSomeChar!(ElementType!Source) && isSomeChar!Target && Target.sizeof >= ElementType!Source.sizeof && !is(Target == enum)) { if (s.empty) throw convError!(Source, Target)(s); Target result = s.front; s.popFront(); return result; } // string to bool conversions Target parse(Target, Source)(ref Source s) if (isExactSomeString!Source && is(Unqual!Target == bool)) { if (s.length >= 4 && icmp(s[0 .. 4], "true") == 0) { s = s[4 .. $]; return true; } if (s.length >= 5 && icmp(s[0 .. 5], "false") == 0) { s = s[5 .. $]; return false; } throw parseError("bool should be case-insensitive 'true' or 'false'"); } /* Tests for to!bool and parse!bool */ @safe pure unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); debug(conv) printf("conv.to!bool.unittest\n"); assert (to!bool("TruE") == true); assert (to!bool("faLse"d) == false); assertThrown!ConvException(to!bool("maybe")); auto t = "TrueType"; assert (parse!bool(t) == true); assert (t == "Type"); auto f = "False killer whale"d; assert (parse!bool(f) == false); assert (f == " killer whale"d); auto m = "maybe"; assertThrown!ConvException(parse!bool(m)); assert (m == "maybe"); // m shouldn't change on failure auto s = "true"; auto b = parse!(const(bool))(s); assert(b == true); } // string to null literal conversions Target parse(Target, Source)(ref Source s) if (isExactSomeString!Source && is(Unqual!Target == typeof(null))) { if (s.length >= 4 && icmp(s[0 .. 4], "null") == 0) { s = s[4 .. $]; return null; } throw parseError("null should be case-insensitive 'null'"); } @safe pure unittest { alias typeof(null) NullType; auto s1 = "null"; assert(parse!NullType(s1) is null); assert(s1 == ""); auto s2 = "NUll"d; assert(parse!NullType(s2) is null); assert(s2 == ""); auto m = "maybe"; assertThrown!ConvException(parse!NullType(m)); assert(m == "maybe"); // m shouldn't change on failure auto s = "NULL"; assert(parse!(const NullType)(s) is null); } //Used internally by parse Array/AA, to remove ascii whites package void skipWS(R)(ref R r) { static if (isSomeString!R) { //Implementation inspired from stripLeft. foreach (i, dchar c; r) { if (!std.ascii.isWhite(c)) { r = r[i .. $]; return; } } r = r[0 .. 0]; //Empty string with correct type. return; } else { for (; !r.empty && std.ascii.isWhite(r.front); r.popFront()) {} } } /** * Parses an array from a string given the left bracket (default $(D * '[')), right bracket (default $(D ']')), and element separator (by * default $(D ',')). */ Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',') if (isExactSomeString!Source && isDynamicArray!Target && !is(Target == enum)) { Target result; parseCheck!s(lbracket); skipWS(s); if (s.empty) throw convError!(Source, Target)(s); if (s.front == rbracket) { s.popFront(); return result; } for (;; s.popFront(), skipWS(s)) { result ~= parseElement!(ElementType!Target)(s); skipWS(s); if (s.empty) throw convError!(Source, Target)(s); if (s.front != comma) break; } parseCheck!s(rbracket); return result; } unittest { int[] a = [1, 2, 3, 4, 5]; auto s = to!string(a); assert(to!(int[])(s) == a); } unittest { int[][] a = [ [1, 2] , [3], [4, 5] ]; auto s = to!string(a); assert(to!(int[][])(s) == a); } unittest { int[][][] ia = [ [[1,2],[3,4],[5]] , [[6],[],[7,8,9]] , [[]] ]; char[] s = to!(char[])(ia); int[][][] ia2; ia2 = to!(typeof(ia2))(s); assert( ia == ia2); } @safe pure unittest { auto s1 = `[['h', 'e', 'l', 'l', 'o'], "world"]`; auto a1 = parse!(string[])(s1); assert(a1 == ["hello", "world"]); auto s2 = `["aaa", "bbb", "ccc"]`; auto a2 = parse!(string[])(s2); assert(a2 == ["aaa", "bbb", "ccc"]); } @safe pure unittest { //Check proper failure auto s = "[ 1 , 2 , 3 ]"; foreach (i ; 0..s.length-1) { auto ss = s[0 .. i]; assertThrown!ConvException(parse!(int[])(ss)); } int[] arr = parse!(int[])(s); } @safe pure unittest { //Checks parsing of strings with escaped characters string s1 = `[ "Contains a\0null!", "tab\there", "line\nbreak", "backslash \\ slash / question \?", "number \x35 five", "unicode \u65E5 sun", "very long \U000065E5 sun" ]`; //Note: escaped characters purposefully replaced and isolated to guarantee //there are no typos in the escape syntax string[] s2 = [ "Contains a" ~ '\0' ~ "null!", "tab" ~ '\t' ~ "here", "line" ~ '\n' ~ "break", "backslash " ~ '\\' ~ " slash / question ?", "number 5 five", "unicode 日 sun", "very long 日 sun" ]; assert(s2 == parse!(string[])(s1)); assert(s1.empty); } /// ditto Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',') if (isExactSomeString!Source && isStaticArray!Target && !is(Target == enum)) { static if (hasIndirections!Target) Target result = Target.init[0].init; else Target result = void; parseCheck!s(lbracket); skipWS(s); if (s.empty) throw convError!(Source, Target)(s); if (s.front == rbracket) { static if (result.length != 0) goto Lmanyerr; else { s.popFront(); return result; } } for (size_t i = 0; ; s.popFront(), skipWS(s)) { if (i == result.length) goto Lmanyerr; result[i++] = parseElement!(ElementType!Target)(s); skipWS(s); if (s.empty) throw convError!(Source, Target)(s); if (s.front != comma) { if (i != result.length) goto Lfewerr; break; } } parseCheck!s(rbracket); return result; Lmanyerr: throw parseError(text("Too many elements in input, ", result.length, " elements expected.")); Lfewerr: throw parseError(text("Too few elements in input, ", result.length, " elements expected.")); } @safe pure unittest { auto s1 = "[1,2,3,4]"; auto sa1 = parse!(int[4])(s1); assert(sa1 == [1,2,3,4]); auto s2 = "[[1],[2,3],[4]]"; auto sa2 = parse!(int[][3])(s2); assert(sa2 == [[1],[2,3],[4]]); auto s3 = "[1,2,3]"; assertThrown!ConvException(parse!(int[4])(s3)); auto s4 = "[1,2,3,4,5]"; assertThrown!ConvException(parse!(int[4])(s4)); } /** * Parses an associative array from a string given the left bracket (default $(D * '[')), right bracket (default $(D ']')), key-value separator (default $(D * ':')), and element seprator (by default $(D ',')). */ Target parse(Target, Source)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar keyval = ':', dchar comma = ',') if (isExactSomeString!Source && isAssociativeArray!Target && !is(Target == enum)) { alias KeyType = typeof(Target.keys[0]); alias ValType = typeof(Target.values[0]); Target result; parseCheck!s(lbracket); skipWS(s); if (s.empty) throw convError!(Source, Target)(s); if (s.front == rbracket) { s.popFront(); return result; } for (;; s.popFront(), skipWS(s)) { auto key = parseElement!KeyType(s); skipWS(s); parseCheck!s(keyval); skipWS(s); auto val = parseElement!ValType(s); skipWS(s); result[key] = val; if (s.empty) throw convError!(Source, Target)(s); if (s.front != comma) break; } parseCheck!s(rbracket); return result; } @safe pure unittest { auto s1 = "[1:10, 2:20, 3:30]"; auto aa1 = parse!(int[int])(s1); assert(aa1 == [1:10, 2:20, 3:30]); auto s2 = `["aaa":10, "bbb":20, "ccc":30]`; auto aa2 = parse!(int[string])(s2); assert(aa2 == ["aaa":10, "bbb":20, "ccc":30]); auto s3 = `["aaa":[1], "bbb":[2,3], "ccc":[4,5,6]]`; auto aa3 = parse!(int[][string])(s3); assert(aa3 == ["aaa":[1], "bbb":[2,3], "ccc":[4,5,6]]); } @safe pure unittest { //Check proper failure auto s = "[1:10, 2:20, 3:30]"; foreach (i ; 0 .. s.length-1) { auto ss = s[0 .. i]; assertThrown!ConvException(parse!(int[int])(ss)); } int[int] aa = parse!(int[int])(s); } private dchar parseEscape(Source)(ref Source s) if (isInputRange!Source && isSomeChar!(ElementType!Source)) { parseCheck!s('\\'); if (s.empty) throw parseError("Unterminated escape sequence"); dchar getHexDigit()(ref Source s_ = s) // workaround { if (s_.empty) throw parseError("Unterminated escape sequence"); s_.popFront(); if (s_.empty) throw parseError("Unterminated escape sequence"); dchar c = s_.front; if (!isHexDigit(c)) throw parseError("Hex digit is missing"); return std.ascii.isAlpha(c) ? ((c & ~0x20) - ('A' - 10)) : c - '0'; } dchar result; switch (s.front) { case '"': result = '\"'; break; case '\'': result = '\''; break; case '0': result = '\0'; break; case '?': result = '\?'; break; case '\\': result = '\\'; break; case 'a': result = '\a'; break; case 'b': result = '\b'; break; case 'f': result = '\f'; break; case 'n': result = '\n'; break; case 'r': result = '\r'; break; case 't': result = '\t'; break; case 'v': result = '\v'; break; case 'x': result = getHexDigit() << 4; result |= getHexDigit(); break; case 'u': result = getHexDigit() << 12; result |= getHexDigit() << 8; result |= getHexDigit() << 4; result |= getHexDigit(); break; case 'U': result = getHexDigit() << 28; result |= getHexDigit() << 24; result |= getHexDigit() << 20; result |= getHexDigit() << 16; result |= getHexDigit() << 12; result |= getHexDigit() << 8; result |= getHexDigit() << 4; result |= getHexDigit(); break; default: throw parseError("Unknown escape character " ~ to!string(s.front)); } if (s.empty) throw parseError("Unterminated escape sequence"); s.popFront(); return result; } @safe pure unittest { string[] s1 = [ `\"`, `\'`, `\?`, `\\`, `\a`, `\b`, `\f`, `\n`, `\r`, `\t`, `\v`, //Normal escapes //`\141`, //@@@9621@@@ Octal escapes. `\x61`, `\u65E5`, `\U00012456` //`\&amp;`, `\&quot;`, //@@@9621@@@ Named Character Entities. ]; const(dchar)[] s2 = [ '\"', '\'', '\?', '\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v', //Normal escapes //'\141', //@@@9621@@@ Octal escapes. '\x61', '\u65E5', '\U00012456' //'\&amp;', '\&quot;', //@@@9621@@@ Named Character Entities. ]; foreach (i ; 0 .. s1.length) { assert(s2[i] == parseEscape(s1[i])); assert(s1[i].empty); } } @safe pure unittest { string[] ss = [ `hello!`, //Not an escape `\`, //Premature termination `\/`, //Not an escape `\gggg`, //Not an escape `\xzz`, //Not an hex `\x0`, //Premature hex end `\XB9`, //Not legal hex syntax `\u!!`, //Not a unicode hex `\777`, //Octal is larger than a byte //Note: Throws, but simply because octals are unsupported `\u123`, //Premature hex end `\U123123` //Premature hex end ]; foreach (s ; ss) assertThrown!ConvException(parseEscape(s)); } // Undocumented Target parseElement(Target, Source)(ref Source s) if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) && isExactSomeString!Target) { auto result = appender!Target(); // parse array of chars if (s.empty) throw convError!(Source, Target)(s); if (s.front == '[') return parse!Target(s); parseCheck!s('\"'); if (s.empty) throw convError!(Source, Target)(s); if (s.front == '\"') { s.popFront(); return result.data; } while (true) { if (s.empty) throw parseError("Unterminated quoted string"); switch (s.front) { case '\"': s.popFront(); return result.data; case '\\': result.put(parseEscape(s)); break; default: result.put(s.front); s.popFront(); break; } } assert(0); } // ditto Target parseElement(Target, Source)(ref Source s) if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) && isSomeChar!Target && !is(Target == enum)) { Target c; parseCheck!s('\''); if (s.empty) throw convError!(Source, Target)(s); if (s.front != '\\') { c = s.front; s.popFront(); } else c = parseEscape(s); parseCheck!s('\''); return c; } // ditto Target parseElement(Target, Source)(ref Source s) if (isInputRange!Source && isSomeChar!(ElementType!Source) && !isSomeString!Target && !isSomeChar!Target) { return parse!Target(s); } /*************************************************************** * Convenience functions for converting any number and types of * arguments into _text (the three character widths). */ string text(T...)(T args) { return textImpl!string(args); } ///ditto wstring wtext(T...)(T args) { return textImpl!wstring(args); } ///ditto dstring dtext(T...)(T args) { return textImpl!dstring(args); } private S textImpl(S, U...)(U args) { static if (U.length == 0) { return null; } else { auto result = to!S(args[0]); foreach (arg; args[1 .. $]) result ~= to!S(arg); return result; } } /// unittest { assert( text(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"c); assert(wtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"w); assert(dtext(42, ' ', 1.5, ": xyz") == "42 1.5: xyz"d); } unittest { assert(text() is null); assert(wtext() is null); assert(dtext() is null); } /*************************************************************** The $(D octal) facility is intended as an experimental facility to replace _octal literals starting with $(D '0'), which many find confusing. Using $(D octal!177) or $(D octal!"177") instead of $(D 0177) as an _octal literal makes code clearer and the intent more visible. If use of this facility becomes preponderent, a future version of the language may deem old-style _octal literals deprecated. The rules for strings are the usual for literals: If it can fit in an $(D int), it is an $(D int). Otherwise, it is a $(D long). But, if the user specifically asks for a $(D long) with the $(D L) suffix, always give the $(D long). Give an unsigned iff it is asked for with the $(D U) or $(D u) suffix. _Octals created from integers preserve the type of the passed-in integral. Example: ---- // same as 0177 auto x = octal!177; // octal is a compile-time device enum y = octal!160; // Create an unsigned octal auto z = octal!"1_000_000u"; ---- */ @property int octal(string num)() if((octalFitsInInt!(num) && !literalIsLong!(num)) && !literalIsUnsigned!(num)) { return octal!(int, num); } /// Ditto @property long octal(string num)() if((!octalFitsInInt!(num) || literalIsLong!(num)) && !literalIsUnsigned!(num)) { return octal!(long, num); } /// Ditto @property uint octal(string num)() if((octalFitsInInt!(num) && !literalIsLong!(num)) && literalIsUnsigned!(num)) { return octal!(int, num); } /// Ditto @property ulong octal(string num)() if((!octalFitsInInt!(num) || literalIsLong!(num)) && literalIsUnsigned!(num)) { return octal!(long, num); } /// Ditto template octal(alias s) if (isIntegral!(typeof(s))) { enum auto octal = octal!(typeof(s), to!string(s)); } /* Takes a string, num, which is an octal literal, and returns its value, in the type T specified. So: int a = octal!(int, "10"); assert(a == 8); */ @property T octal(T, string num)() if (isOctalLiteral!num) { ulong pow = 1; T value = 0; for (int pos = num.length - 1; pos >= 0; pos--) { char s = num[pos]; if (s < '0' || s > '7') // we only care about digits; skip the rest // safe to skip - this is checked out in the assert so these // are just suffixes continue; value += pow * (s - '0'); pow *= 8; } return value; } /* Take a look at int.max and int.max+1 in octal and the logic for this function follows directly. */ template octalFitsInInt(string octalNum) { // note it is important to strip the literal of all // non-numbers. kill the suffix and underscores lest they mess up // the number of digits here that we depend on. enum bool octalFitsInInt = strippedOctalLiteral(octalNum).length < 11 || strippedOctalLiteral(octalNum).length == 11 && strippedOctalLiteral(octalNum)[0] == '1'; } string strippedOctalLiteral(string original) { string stripped = ""; foreach (c; original) if (c >= '0' && c <= '7') stripped ~= c; return stripped; } template literalIsLong(string num) { static if (num.length > 1) // can be xxL or xxLu according to spec enum literalIsLong = (num[$-1] == 'L' || num[$-2] == 'L'); else enum literalIsLong = false; } template literalIsUnsigned(string num) { static if (num.length > 1) // can be xxU or xxUL according to spec enum literalIsUnsigned = (num[$-1] == 'u' || num[$-2] == 'u') // both cases are allowed too || (num[$-1] == 'U' || num[$-2] == 'U'); else enum literalIsUnsigned = false; } /* Returns if the given string is a correctly formatted octal literal. The format is specified in lex.html. The leading zero is allowed, but not required. */ bool isOctalLiteralString(string num) { if (num.length == 0) return false; // Must start with a number. To avoid confusion, literals that // start with a '0' are not allowed if (num[0] == '0' && num.length > 1) return false; if (num[0] < '0' || num[0] > '7') return false; foreach (i, c; num) { if ((c < '0' || c > '7') && c != '_') // not a legal character { if (i < num.length - 2) return false; else // gotta check for those suffixes { if (c != 'U' && c != 'u' && c != 'L') return false; if (i != num.length - 1) { // if we're not the last one, the next one must // also be a suffix to be valid char c2 = num[$-1]; if (c2 != 'U' && c2 != 'u' && c2 != 'L') return false; // spam at the end of the string if (c2 == c) return false; // repeats are disallowed } } } } return true; } /* Returns true if the given compile time string is an octal literal. */ template isOctalLiteral(string num) { enum bool isOctalLiteral = isOctalLiteralString(num); } unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); // ensure that you get the right types, even with embedded underscores auto w = octal!"100_000_000_000"; static assert(!is(typeof(w) == int)); auto w2 = octal!"1_000_000_000"; static assert(is(typeof(w2) == int)); static assert(octal!"45" == 37); static assert(octal!"0" == 0); static assert(octal!"7" == 7); static assert(octal!"10" == 8); static assert(octal!"666" == 438); static assert(octal!45 == 37); static assert(octal!0 == 0); static assert(octal!7 == 7); static assert(octal!10 == 8); static assert(octal!666 == 438); static assert(octal!"66_6" == 438); static assert(octal!2520046213 == 356535435); static assert(octal!"2520046213" == 356535435); static assert(octal!17777777777 == int.max); static assert(!__traits(compiles, octal!823)); static assert(!__traits(compiles, octal!"823")); static assert(!__traits(compiles, octal!"_823")); static assert(!__traits(compiles, octal!"spam")); static assert(!__traits(compiles, octal!"77%")); int a; long b; // biggest value that should fit in an it static assert(__traits(compiles, a = octal!"17777777777")); // should not fit in the int static assert(!__traits(compiles, a = octal!"20000000000")); // ... but should fit in a long static assert(__traits(compiles, b = octal!"20000000000")); static assert(!__traits(compiles, a = octal!"1L")); // this should pass, but it doesn't, since the int converter // doesn't pass along its suffix to helper templates //static assert(!__traits(compiles, a = octal!1L)); static assert(__traits(compiles, b = octal!"1L")); static assert(__traits(compiles, b = octal!1L)); } // emplace /** Given a pointer $(D chunk) to uninitialized memory (but already typed as $(D T)), constructs an object of non-$(D class) type $(D T) at that address. Returns: A pointer to the newly constructed object (which is the same as $(D chunk)). */ T* emplace(T)(T* chunk) @safe nothrow pure { static assert (is(T* : void*), format("Cannot emplace a %s because it is qualified.", T.stringof)); static assert (is(typeof({static T i;})), format("Cannot emplace a %1$s because %1$s.this() is annotated with @disable.", T.stringof)); return emplaceInitializer(chunk); } version(unittest) private struct __conv_EmplaceTest { int i = 3; this(int i) { assert(this.i == 3 && i == 5); this.i = i; } this(int i, ref int j) { assert(i == 5 && j == 6); this.i = i; ++j; } @disable: this(); this(this); void opAssign(); } version(unittest) private class __conv_EmplaceTestClass { int i = 3; this(int i) { assert(this.i == 3 && i == 5); this.i = i; } this(int i, ref int j) { assert(i == 5 && j == 6); this.i = i; ++j; } } unittest { struct S { @disable this(); } S s = void; static assert(!__traits(compiles, emplace(&s))); static assert( __traits(compiles, emplace(&s, S.init))); } unittest { interface I {} class K : I {} K k = void; emplace(&k); assert(k is null); I i = void; emplace(&i); assert(i is null); } unittest { static struct S {int i = 5;} S[2] s2 = void; emplace(&s2); assert(s2[0].i == 5 && s2[1].i == 5); } unittest { struct S1 {} struct S2 { void opAssign(S2); } S1 s1 = void; S2 s2 = void; S1[2] as1 = void; S2[2] as2 = void; emplace(&s1); emplace(&s2); emplace(&as1); emplace(&as2); } unittest { static struct S1 { this(this) @disable; } static struct S2 { this() @disable; } S1[2] ss1 = void; S2[2] ss2 = void; static assert( __traits(compiles, emplace(&ss1))); static assert(!__traits(compiles, emplace(&ss2))); S1 s1 = S1.init; S2 s2 = S2.init; static assert(!__traits(compiles, emplace(&ss1, s1))); static assert( __traits(compiles, emplace(&ss2, s2))); } unittest { struct S { immutable int i; } S s = void; S[2] ss1 = void; S[2] ss2 = void; emplace(&s, 5); emplace(&ss1, s); emplace(&ss2, ss1); } /** Given a pointer $(D chunk) to uninitialized memory (but already typed as a non-class type $(D T)), constructs an object of type $(D T) at that address from arguments $(D args). This function can be $(D @trusted) if the corresponding constructor of $(D T) is $(D @safe). Returns: A pointer to the newly constructed object (which is the same as $(D chunk)). */ T* emplace(T, Args...)(T* chunk, auto ref Args args) if (!is(T == struct) && Args.length == 1) { alias Arg = Args[0]; alias arg = args[0]; static assert (is(T* : void*), format("Cannot emplace a %s because it is qualified.", T.stringof)); static assert(is(typeof({T t = args[0];})), format("%s cannot be emplaced from a %s.", T.stringof, Arg.stringof)); static if (isStaticArray!T) { alias UArg = Unqual!Arg; alias E = typeof(chunk.ptr[0]); enum N = T.length; static if (is(Arg : T)) { //Matching static array static if (isAssignable!(T, Arg) && !hasElaborateAssign!T) *chunk = arg; else static if (is(UArg == T)) { memcpy(chunk, &arg, T.sizeof); static if (hasElaborateCopyConstructor!T) typeid(T).postblit(cast(void*)&chunk); } else emplace(chunk, cast(T)arg); } else static if (is(Arg : E[])) { //Matching dynamic array static if (is(typeof((*chunk)[] = arg[])) && !hasElaborateAssign!T) (*chunk)[] = arg[]; else static if (is(UArg == E[])) { assert(N == chunk.length, "Array length missmatch in emplace"); memcpy(cast(void*)chunk, arg.ptr, T.sizeof); static if (hasElaborateCopyConstructor!T) typeid(T).postblit(cast(void*)&chunk); } else emplace(chunk, cast(E[])arg); } else static if (is(Arg : E)) { //Case matching single element to array. static if (is(typeof((*chunk)[] = arg)) && !hasElaborateAssign!T) (*chunk)[] = arg; else static if (is(UArg == E)) { //Note: We copy everything, and then postblit just once. //This is as exception safe as what druntime can provide us. foreach(i; 0 .. N) memcpy(cast(void*)(chunk.ptr + i), &arg, E.sizeof); static if (hasElaborateCopyConstructor!T) typeid(T).postblit(chunk); } else //Alias this. Coerce. emplace(chunk, cast(E)arg); } else static if (is(typeof(emplace(chunk.ptr, arg)))) { //Final case for everything else: //Types that don't match (int to uint[2]) //Recursion for multidimensions static if (is(typeof((*chunk)[] = arg)) && !hasElaborateAssign!T) (*chunk)[] = arg; foreach(i; 0 .. N) emplace(chunk.ptr + i, arg); } else static assert(0, format("Sorry, this implementation doesn't know how to emplace a %s with a %s", T.stringof, Arg.stringof)); return chunk; } else { *chunk = arg; return chunk; } } unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); int a; int b = 42; assert(*emplace!int(&a, b) == 42); } unittest { interface I {} class K : I {} K k = null, k2 = new K; assert(k !is k2); emplace!K(&k, k2); assert(k is k2); I i = null; assert(i !is k); emplace!I(&i, k); assert(i is k); } unittest { static struct S { int i = 5; void opAssign(S){assert(0);} } S[2] sa = void; S[2] sb; emplace(&sa, sb); assert(sa[0].i == 5 && sa[1].i == 5); } /// ditto T* emplace(T, Args...)(T* chunk, auto ref Args args) if (is(T == struct)) { static assert (is(T* : void*), format("Cannot emplace a %s because it is qualified.", T.stringof)); static if (Args.length == 1 && is(Args[0] : T) && is (typeof({T t = args[0];})) //Check for legal postblit ) { static if (is(T == Unqual!(Args[0]))) { //Types match exactly: we postblit static if (isAssignable!T && !hasElaborateAssign!T) *chunk = args[0]; else { memcpy(chunk, &args[0], T.sizeof); static if (hasElaborateCopyConstructor!T) typeid(T).postblit(chunk); } } else //Alias this. Coerce to type T. emplace(chunk, cast(T)args[0]); } else static if (is(typeof(chunk.__ctor(args)))) { // T defines a genuine constructor accepting args // Go the classic route: write .init first, then call ctor emplaceInitializer(chunk); chunk.__ctor(args); } else static if (is(typeof(T.opCall(args)))) { //Can be built calling opCall emplaceOpCaller(chunk, args); //emplaceOpCaller is deprecated } else static if (is(typeof(T(args)))) { // Struct without constructor that has one matching field for // each argument. Individually emplace each field emplaceInitializer(chunk); foreach (i, ref field; chunk.tupleof[0 .. Args.length]) emplace(emplaceGetAddr(field), args[i]); } else { //We can't emplace. Try to diagnose a disabled postblit. static assert(!(Args.length == 1 && is(Args[0] : T)), format("Cannot emplace a %1$s because %1$s.this(this) is annotated with @disable.", T.stringof)); //We can't emplace. static assert(false, format("%s cannot be emplaced from %s.", T.stringof, Args[].stringof)); } return chunk; } //emplace helper functions private T* emplaceInitializer(T)(T* chunk) @trusted pure nothrow { static if (isAssignable!T && !hasElaborateAssign!T) *chunk = T.init; else { static immutable T init = T.init; memcpy(chunk, &init, T.sizeof); } return chunk; } private deprecated("Using static opCall for emplace is deprecated. Plase use emplace(chunk, T(args)) instead.") T* emplaceOpCaller(T, Args...)(T* chunk, auto ref Args args) { static assert (is(typeof({T t = T.opCall(args);})), format("%s.opCall does not return adequate data for construction.", T.stringof)); return emplace(chunk, chunk.opCall(args)); } private { //Helper to keep simple aggregate emplace safe. auto emplaceGetAddr(T)(ref T t) @trusted if (is(T == Unqual!T)) { return &t; } auto emplaceGetAddr(T)(ref T t) if (!is(T == Unqual!T)) { return cast(Unqual!T*)&t; } } // Test constructor branch unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); struct S { double x = 5, y = 6; this(int a, int b) { assert(x == 5 && y == 6); x = a; y = b; } } auto s1 = new void[S.sizeof]; auto s2 = S(42, 43); assert(*emplace!S(cast(S*) s1.ptr, s2) == s2); assert(*emplace!S(cast(S*) s1, 44, 45) == S(44, 45)); } unittest { __conv_EmplaceTest k = void; emplace(&k, 5); assert(k.i == 5); } unittest { int var = 6; __conv_EmplaceTest k = void; emplace(&k, 5, var); assert(k.i == 5); assert(var == 7); } // Test matching fields branch unittest { struct S { uint n; } S s; emplace!S(&s, 2U); assert(s.n == 2); } unittest { struct S { int a, b; this(int){} } S s; static assert(!__traits(compiles, emplace!S(&s, 2, 3))); } unittest { struct S { int a, b = 7; } S s1 = void, s2 = void; emplace!S(&s1, 2); assert(s1.a == 2 && s1.b == 7); emplace!S(&s2, 2, 3); assert(s2.a == 2 && s2.b == 3); } //opAssign unittest { static struct S { int i = 5; void opAssign(int){assert(0);} void opAssign(S){assert(0);} } S sa1 = void; S sa2 = void; S sb1 = S(1); emplace(&sa1, sb1); emplace(&sa2, 2); assert(sa1.i == 1); assert(sa2.i == 2); } //postblit precedence unittest { //Works, but breaks in "-w -O" because of @@@9332@@@. //Uncomment test when 9332 is fixed. static struct S { int i; this(S other){assert(false);} this(int i){this.i = i;} this(this){} } S a = void; assert(is(typeof({S b = a;}))); //Postblit assert(is(typeof({S b = S(a);}))); //Constructor auto b = S(5); emplace(&a, b); assert(a.i == 5); static struct S2 { int* p; this(const S2){}; } static assert(!is(immutable S2 : S2)); S2 s2 = void; immutable is2 = (immutable S2).init; emplace(&s2, is2); } //nested structs and postblit unittest { static struct S { int* p; this(int i){p = [i].ptr;} this(this) { if (p) p = [*p].ptr; } } static struct SS { S s; void opAssign(const SS) { assert(0); } } SS ssa = void; SS ssb = SS(S(5)); emplace(&ssa, ssb); assert(*ssa.s.p == 5); assert(ssa.s.p != ssb.s.p); } //disabled postblit unittest { static struct S1 { int i; @disable this(this); } S1 s1 = void; static assert( __traits(compiles, emplace(&s1, 1))); static assert(!__traits(compiles, emplace(&s1, S1.init))); static struct S2 { int i; @disable this(this); this(ref S2){} } S2 s2 = void; static assert(!__traits(compiles, emplace(&s2, 1))); static assert( __traits(compiles, emplace(&s2, S2.init))); static struct SS1 { S1 s; } SS1 ss1 = void; static assert( __traits(compiles, emplace(&ss1))); static assert(!__traits(compiles, emplace(&ss1, SS1.init))); static struct SS2 { S2 s; } SS2 ss2 = void; static assert( __traits(compiles, emplace(&ss2))); static assert(!__traits(compiles, emplace(&ss2, SS2.init))); // SS1 sss1 = s1; //This doesn't compile // SS1 sss1 = SS1(s1); //This doesn't compile // So emplace shouldn't compile either static assert(!__traits(compiles, emplace(&sss1, s1))); static assert(!__traits(compiles, emplace(&sss2, s2))); } //Imutability unittest { //Castable immutability { static struct S1 { int i; } static assert(is( immutable(S1) : S1)); S1 sa = void; auto sb = immutable(S1)(5); emplace(&sa, sb); assert(sa.i == 5); } //Un-castable immutability { static struct S2 { int* p; } static assert(!is(immutable(S2) : S2)); S2 sa = void; auto sb = immutable(S2)(null); assert(!__traits(compiles, emplace(&sa, sb))); } } unittest { static struct S { immutable int i; immutable(int)* j; } S s = void; emplace(&s, 1, null); emplace(&s, 2, &s.i); assert(s is S(2, &s.i)); } //Context pointer unittest { int i = 0; { struct S1 { void foo(){++i;} } S1 sa = void; S1 sb; emplace(&sa, sb); sa.foo(); assert(i == 1); } { struct S2 { void foo(){++i;} this(this){} } S2 sa = void; S2 sb; emplace(&sa, sb); sa.foo(); assert(i == 2); } ////NOTE: THESE WILL COMPILE ////But will not correctly emplace the context pointer ////The problem lies with voldemort, and not emplace. //{ // struct S3 // { // int k; // void foo(){++i;} // } //} //S3 s3 = void; //emplace(&s3); //S3.init has no context pointer information //emplace(&s3, 1); //No way to obtain context pointer once inside emplace } //Alias this unittest { static struct S { int i; } //By Ref { static struct SS1 { int j; S s; alias s this; } S s = void; SS1 ss = SS1(1, S(2)); emplace(&s, ss); assert(s.i == 2); } //By Value { static struct SS2 { int j; S s; S foo() @property{return s;} alias foo this; } S s = void; SS2 ss = SS2(1, S(2)); emplace(&s, ss); assert(s.i == 2); } } version(unittest) { //Ambiguity struct __std_conv_S { int i; this(__std_conv_SS ss) {assert(0);} static opCall(__std_conv_SS ss) { __std_conv_S s; s.i = ss.j; return s; } } struct __std_conv_SS { int j; __std_conv_S s; ref __std_conv_S foo() @property {s.i = j; return s;} alias foo this; } static assert(is(__std_conv_SS : __std_conv_S)); unittest { __std_conv_S s = void; __std_conv_SS ss = __std_conv_SS(1); __std_conv_S sTest1 = ss; //this calls "SS alias this" (and not "S.this(SS)") emplace(&s, ss); //"alias this" should take precedence in emplace over "opCall" assert(s.i == 1); } } //Nested classes unittest { class A{} static struct S { A a; } S s1 = void; S s2 = S(new A); emplace(&s1, s2); assert(s1.a is s2.a); } //safety & nothrow & CTFE unittest { //emplace should be safe for anything with no elaborate opassign static struct S1 { int i; } static struct S2 { int i; this(int j)@safe nothrow{i = j;} } int i; S1 s1 = void; S2 s2 = void; auto pi = &i; auto ps1 = &s1; auto ps2 = &s2; void foo() @safe nothrow { emplace(pi); emplace(pi, 5); emplace(ps1); emplace(ps1, 5); emplace(ps1, S1.init); emplace(ps2); emplace(ps2, 5); emplace(ps2, S2.init); } T bar(T)() @property { T t/+ = void+/; //CTFE void illegal emplace(&t, 5); return t; } enum a = bar!int; enum b = bar!S1; enum c = bar!S2; } unittest { struct S { int[2] get(){return [1, 2];} alias get this; } struct SS { int[2] ii; } struct ISS { int[2] ii; } S s; SS ss = void; ISS iss = void; emplace(&ss, s); emplace(&iss, s); assert(ss.ii == [1, 2]); assert(iss.ii == [1, 2]); } //disable opAssign unittest { static struct S { @disable void opAssign(S); } S s; emplace(&s, S.init); } //opCall unittest { int i; //Without constructor { static struct S1 { int i; static S1 opCall(int*){assert(0);} } S1 s = void; static assert(!__traits(compiles, emplace(&s, 1))); static assert( __traits(compiles, emplace(&s, &i))); //(works, but deprected) } //With constructor { static struct S2 { int i = 0; static S2 opCall(int*){assert(0);} static S2 opCall(int){assert(0);} this(int i){this.i = i;} } S2 s = void; static assert( __traits(compiles, emplace(&s, 1))); //(works, but deprected) static assert( __traits(compiles, emplace(&s, &i))); //(works, but deprected) emplace(&s, 1); assert(s.i == 1); } //With postblit ambiguity { static struct S3 { int i = 0; static S3 opCall(ref S3){assert(0);} } S3 s = void; static assert( __traits(compiles, emplace(&s, S3.init))); } } unittest //@@@9559@@@ { alias Nullable!int I; auto ints = [0, 1, 2].map!(i => i & 1 ? I.init : I(i))(); auto asArray = std.array.array(ints); } unittest //http://forum.dlang.org/thread/nxbdgtdlmwscocbiypjs@forum.dlang.org { import std.datetime; static struct A { double i; } static struct B { invariant() { if(j == 0) assert(a.i.isNaN, "why is 'j' zero?? and i is not NaN?"); else assert(!a.i.isNaN); } SysTime when; // comment this line avoid the breakage int j; A a; } B b1 = B.init; assert(&b1); // verify that default eyes invariants are ok; auto b2 = B(SysTime(0, UTC()), 1, A(1)); assert(&b2); auto b3 = B(SysTime(0, UTC()), 1, A(1)); assert(&b3); import std.array; auto arr = [b2, b3]; assert(arr[0].j == 1); assert(arr[1].j == 1); auto a2 = arr.array(); // << bang, invariant is raised, also if b2 and b3 are good } //static arrays unittest { static struct S { int[2] ii; } static struct IS { immutable int[2] ii; } int[2] ii; S s = void; IS ims = void; ubyte ub = 2; emplace(&s, ub); emplace(&s, ii); emplace(&ims, ub); emplace(&ims, ii); uint[2] uu; static assert(!__traits(compiles, {S ss = S(uu);})); static assert(!__traits(compiles, emplace(&s, uu))); } unittest { int[2] sii; int[2] sii2; uint[2] uii; uint[2] uii2; emplace(&sii, 1); emplace(&sii, 1U); emplace(&uii, 1); emplace(&uii, 1U); emplace(&sii, sii2); //emplace(&sii, uii2); //Sorry, this implementation doesn't know how to... //emplace(&uii, sii2); //Sorry, this implementation doesn't know how to... emplace(&uii, uii2); emplace(&sii, sii2[]); //emplace(&sii, uii2[]); //Sorry, this implementation doesn't know how to... //emplace(&uii, sii2[]); //Sorry, this implementation doesn't know how to... emplace(&uii, uii2[]); } unittest { bool allowDestruction = false; struct S { int i; this(this){} ~this(){assert(allowDestruction);} } S s = S(1); S[2] ss1 = void; S[2] ss2 = void; S[2] ss3 = void; emplace(&ss1, s); emplace(&ss2, ss1); emplace(&ss3, ss2[]); assert(ss1[1] == s); assert(ss2[1] == s); assert(ss3[1] == s); allowDestruction = true; } unittest { //Checks postblit, construction, and context pointer int count = 0; struct S { this(this) { ++count; } ~this() { --count; } } S s; { S[4] ss = void; emplace(&ss, s); assert(count == 4); } assert(count == 0); } unittest { struct S { int i; } S s; S[2][2][2] sss = void; emplace(&sss, s); } private void testEmplaceChunk(void[] chunk, size_t typeSize, size_t typeAlignment, string typeName) { enforceEx!ConvException(chunk.length >= typeSize, format("emplace: Chunk size too small: %s < %s size = %s", chunk.length, typeName, typeSize)); enforceEx!ConvException((cast(size_t) chunk.ptr) % typeAlignment == 0, format("emplace: Misaligned memory block (0x%X): it must be %s-byte aligned for type %s", chunk.ptr, typeAlignment, typeName)); } /** Given a raw memory area $(D chunk), constructs an object of $(D class) type $(D T) at that address. The constructor is passed the arguments $(D Args). The $(D chunk) must be as least as large as $(D T) needs and should have an alignment multiple of $(D T)'s alignment. (The size of a $(D class) instance is obtained by using $(D __traits(classInstanceSize, T))). This function can be $(D @trusted) if the corresponding constructor of $(D T) is $(D @safe). Returns: A pointer to the newly constructed object. */ T emplace(T, Args...)(void[] chunk, auto ref Args args) if (is(T == class)) { enum classSize = __traits(classInstanceSize, T); testEmplaceChunk(chunk, classSize, classInstanceAlignment!T, T.stringof); auto result = cast(T) chunk.ptr; // Initialize the object in its pre-ctor state (cast(byte[]) chunk)[0 .. classSize] = typeid(T).init[]; // Call the ctor if any static if (is(typeof(result.__ctor(args)))) { // T defines a genuine constructor accepting args // Go the classic route: write .init first, then call ctor result.__ctor(args); } else { static assert(args.length == 0 && !is(typeof(&T.__ctor)), "Don't know how to initialize an object of type " ~ T.stringof ~ " with arguments " ~ Args.stringof); } return result; } unittest { int var = 6; auto k = emplace!__conv_EmplaceTestClass(new void[__traits(classInstanceSize, __conv_EmplaceTestClass)], 5, var); assert(k.i == 5); assert(var == 7); } /** Given a raw memory area $(D chunk), constructs an object of non-$(D class) type $(D T) at that address. The constructor is passed the arguments $(D args), if any. The $(D chunk) must be as least as large as $(D T) needs and should have an alignment multiple of $(D T)'s alignment. This function can be $(D @trusted) if the corresponding constructor of $(D T) is $(D @safe). Returns: A pointer to the newly constructed object. */ T* emplace(T, Args...)(void[] chunk, auto ref Args args) if (!is(T == class)) { testEmplaceChunk(chunk, T.sizeof, T.alignof, T.stringof); return emplace(cast(T*) chunk.ptr, args); } unittest { struct S { int a, b; } auto p = new void[S.sizeof]; S s; s.a = 42; s.b = 43; auto s1 = emplace!S(p, s); assert(s1.a == 42 && s1.b == 43); } unittest { int var = 6; auto k = emplace!__conv_EmplaceTest(new void[__conv_EmplaceTest.sizeof], 5, var); assert(k.i == 5); assert(var == 7); } unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); class A { int x = 5; int y = 42; this(int z) { assert(x == 5 && y == 42); x = y = z; } } void[] buf; static byte[__traits(classInstanceSize, A)] sbuf; buf = sbuf[]; auto a = emplace!A(buf, 55); assert(a.x == 55 && a.y == 55); // emplace in bigger buffer buf = new byte[](__traits(classInstanceSize, A) + 10); a = emplace!A(buf, 55); assert(a.x == 55 && a.y == 55); // need ctor args static assert(!is(typeof(emplace!A(buf)))); } unittest { debug(conv) scope(success) writeln("unittest @", __FILE__, ":", __LINE__, " succeeded."); // Check fix for http://d.puremagic.com/issues/show_bug.cgi?id=2971 assert(equal(map!(to!int)(["42", "34", "345"]), [42, 34, 345])); } // Undocumented for the time being void toTextRange(T, W)(T value, W writer) if (isIntegral!T && isOutputRange!(W, char)) { char[value.sizeof * 4] buffer = void; uint i = cast(uint) (buffer.length - 1); bool negative = value < 0; Unqual!(Unsigned!T) v = negative ? -value : value; while (v >= 10) { auto c = cast(uint) (v % 10); v /= 10; buffer[i--] = cast(char) (c + '0'); } buffer[i] = cast(char) (v + '0'); //hexDigits[cast(uint) v]; if (negative) buffer[--i] = '-'; put(writer, buffer[i .. $]); } unittest { auto result = appender!(char[])(); toTextRange(-1, result); assert(result.data == "-1"); } /** Returns the corresponding unsigned value for $(D x) (e.g. if $(D x) has type $(D int), it returns $(D cast(uint) x)). The advantage compared to the cast is that you do not need to rewrite the cast if $(D x) later changes type (e.g from $(D int) to $(D long)). Note that the result is always mutable even if the original type was const or immutable. In order to retain the constness, use $(XREF traits, Unsigned). */ auto unsigned(T)(T x) if (isIntegral!T) { return cast(Unqual!(Unsigned!T))x; } /// unittest { uint s = 42; auto u1 = unsigned(s); //not qualified Unsigned!(typeof(s)) u2 = unsigned(s); //same qualification immutable u3 = unsigned(s); //totally qualified } unittest { foreach(T; TypeTuple!(byte, ubyte)) { static assert(is(typeof(unsigned(cast(T)1)) == ubyte)); static assert(is(typeof(unsigned(cast(const T)1)) == ubyte)); static assert(is(typeof(unsigned(cast(immutable T)1)) == ubyte)); } foreach(T; TypeTuple!(short, ushort)) { static assert(is(typeof(unsigned(cast(T)1)) == ushort)); static assert(is(typeof(unsigned(cast(const T)1)) == ushort)); static assert(is(typeof(unsigned(cast(immutable T)1)) == ushort)); } foreach(T; TypeTuple!(int, uint)) { static assert(is(typeof(unsigned(cast(T)1)) == uint)); static assert(is(typeof(unsigned(cast(const T)1)) == uint)); static assert(is(typeof(unsigned(cast(immutable T)1)) == uint)); } foreach(T; TypeTuple!(long, ulong)) { static assert(is(typeof(unsigned(cast(T)1)) == ulong)); static assert(is(typeof(unsigned(cast(const T)1)) == ulong)); static assert(is(typeof(unsigned(cast(immutable T)1)) == ulong)); } } auto unsigned(T)(T x) if (isSomeChar!T) { // All characters are unsigned static assert(T.min == 0); return cast(Unqual!T) x; } unittest { foreach(T; TypeTuple!(char, wchar, dchar)) { static assert(is(typeof(unsigned(cast(T)'A')) == T)); static assert(is(typeof(unsigned(cast(const T)'A')) == T)); static assert(is(typeof(unsigned(cast(immutable T)'A')) == T)); } } /** Returns the corresponding signed value for $(D x) (e.g. if $(D x) has type $(D uint), it returns $(D cast(int) x)). The advantage compared to the cast is that you do not need to rewrite the cast if $(D x) later changes type (e.g from $(D uint) to $(D ulong)). Note that the result is always mutable even if the original type was const or immutable. In order to retain the constness, use $(XREF traits, Signed). */ auto signed(T)(T x) if (isIntegral!T) { return cast(Unqual!(Signed!T))x; } /// unittest { uint u = 42; auto s1 = unsigned(u); //not qualified Unsigned!(typeof(u)) s2 = unsigned(u); //same qualification immutable s3 = unsigned(u); //totally qualified } unittest { foreach(T; TypeTuple!(byte, ubyte)) { static assert(is(typeof(signed(cast(T)1)) == byte)); static assert(is(typeof(signed(cast(const T)1)) == byte)); static assert(is(typeof(signed(cast(immutable T)1)) == byte)); } foreach(T; TypeTuple!(short, ushort)) { static assert(is(typeof(signed(cast(T)1)) == short)); static assert(is(typeof(signed(cast(const T)1)) == short)); static assert(is(typeof(signed(cast(immutable T)1)) == short)); } foreach(T; TypeTuple!(int, uint)) { static assert(is(typeof(signed(cast(T)1)) == int)); static assert(is(typeof(signed(cast(const T)1)) == int)); static assert(is(typeof(signed(cast(immutable T)1)) == int)); } foreach(T; TypeTuple!(long, ulong)) { static assert(is(typeof(signed(cast(T)1)) == long)); static assert(is(typeof(signed(cast(const T)1)) == long)); static assert(is(typeof(signed(cast(immutable T)1)) == long)); } } unittest { // issue 10874 enum Test { a = 0 } ulong l = 0; auto t = l.to!Test; }
D
/* * Copyright Andrej Mitrovic 2013 - 2020. * 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 dtk.tests.test_radiobutton; import core.thread; import std.range; import std.stdio; import std.string; import dtk; unittest { auto app = new App; auto testWindow = new Window(app.mainWindow, 200, 200); testWindow.position = Point(500, 500); // todo: radiogroup should take a list of radio buttons instead of passing it like this auto radioGroup = new RadioGroup(testWindow); auto radio1 = new RadioButton(radioGroup, "Set On", "on"); auto radio2 = new RadioButton(radioGroup, "Set Off", "off"); auto radio3 = new RadioButton(radioGroup, "Set No", "invalid"); radio1.value = "on_value"; radio2.value = "off_value"; radioGroup.pack(); radio1.pack(); radio2.pack(); radio3.pack(); assert(radioGroup.selectedValue == radio1.value, format("%s != %s", radioGroup.selectedValue, radio1.value)); assert(radioGroup.selectedButton is radio1); radioGroup.selectedValue = radio2.value; assert(radioGroup.selectedValue == radio2.value); assert(radioGroup.selectedButton is radio2); radio1.select(); assert(radioGroup.selectedValue == radio1.value); assert(radioGroup.selectedButton is radio1); radio2.select(); assert(radioGroup.selectedValue == radio2.value); assert(radioGroup.selectedButton is radio2); radio2.value = "changed value"; assert(radioGroup.selectedValue == radio2.value); assert(radioGroup.selectedButton is radio2); assert(radio1.textWidth == 0); // natural width radio1.textWidth = -50; // set minimum 50 units assert(radio1.textWidth == -50); radio1.textWidth = 0; assert(radio1.textWidth == 0); radio1.textWidth = 50; // set maximum 50 units assert(radio1.textWidth == 50); RadioButton selectedButton; size_t callCount; size_t expectedCallCount; radioGroup.onRadioButtonEvent ~= (scope RadioButtonEvent event) { assert(event.radioGroup.selectedButton == selectedButton); assert(event.radioGroup.selectedValue == selectedButton.value); if (event.radioGroup.selectedButton is radio1) radio3.disable(); else radio3.enable(); ++callCount; }; selectedButton = radio1; radioGroup.selectedButton = selectedButton; ++expectedCallCount; selectedButton = radio3; radioGroup.selectedButton = selectedButton; ++expectedCallCount; assert(callCount == expectedCallCount, format("%s != %s", callCount, expectedCallCount)); app.run(); } void main() { }
D
// no debug info (adds stack frame), no optimizations (might remove truncation) // PERMUTE_ARGS: enum M_PI_L = 0x1.921fb54442d1846ap+1L; // 3.14159 fldpi enum M_LOG2T_L = 0x1.a934f0979a3715fcp+1L; // 3.32193 fldl2t enum M_LOG2E_L = 0x1.71547652b82fe178p+0L; // 1.4427 fldl2e enum M_LOG2_L = 0x1.34413509f79fef32p-2L; // 0.30103 fldlg2 enum M_LN2_L = 0x1.62e42fefa39ef358p-1L; // 0.693147 fldln2 // verify the first instruction in function fun is the correct opcode void verify(T, T v, ubyte op)(T x) { static T fun() { return v; } T f = fun(); assert(f == x); // to!string(x) ~ " " ~ to!string(f - x)); static assert(fun() == v); auto fn = &fun; auto s = *cast(ushort*) fn; ushort expected = (op << 8) | 0xd9; assert(s == expected); //, T.stringof ~ " " ~ to!string(v) ~ " " ~ to!string(s, 16) ~ " " ~ to!string(expected, 16)); } immutable ubyte[7] opcode = [ /* FLDZ,FLD1,FLDPI,FLDL2T,FLDL2E,FLDLG2,FLDLN2 */ 0xEE,0xE8,0xEB,0xE9,0xEA,0xEC,0xED ]; void verifyType(T)() { static immutable T[7] ldval = [0.0,1.0,M_PI_L,M_LOG2T_L,M_LOG2E_L,M_LOG2_L,M_LN2_L]; static foreach(i, v; ldval) verify!(T, ldval[i], opcode[i])(ldval[i]); } void main() { version(OSX) {} // always has a stack frame else version(DigitalMars) version(X86) { verifyType!(float); verifyType!(double); verifyType!(real); } }
D
/* * Licensed under the GNU Lesser General Public License Version 3 * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the license, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ // generated automatically - do not change module glib.Source; private import gi.glib; public import gi.glibtypes; private import glib.ConstructionException; private import glib.MainContext; private import glib.Str; private import glib.TimeVal; /** * The `GSource` struct is an opaque data type * representing an event source. */ public class Source { /** the main GObject struct */ protected GSource* gSource; /** Get the main GObject struct */ public GSource* getSourceStruct() { return gSource; } /** the main GObject struct as a void* */ protected void* getStruct() { return cast(void*)gSource; } /** * Sets our main struct and passes it to the parent class. */ public this (GSource* gSource) { this.gSource = gSource; } /** * Creates a new #GSource structure. The size is specified to * allow creating structures derived from #GSource that contain * additional data. The size passed in must be at least * `sizeof (GSource)`. * * The source will not initially be associated with any #GMainContext * and must be added to one with g_source_attach() before it will be * executed. * * Params: * sourceFuncs = structure containing functions that implement * the sources behavior. * structSize = size of the #GSource structure to create. * * Return: the newly-created #GSource. * * Throws: ConstructionException Failure to create GObject. */ public this(GSourceFuncs* sourceFuncs, uint structSize) { auto p = g_source_new(sourceFuncs, structSize); if(p is null) { throw new ConstructionException("null returned by new"); } this(cast(GSource*) p); } /** * Adds @child_source to @source as a "polled" source; when @source is * added to a #GMainContext, @child_source will be automatically added * with the same priority, when @child_source is triggered, it will * cause @source to dispatch (in addition to calling its own * callback), and when @source is destroyed, it will destroy * @child_source as well. (@source will also still be dispatched if * its own prepare/check functions indicate that it is ready.) * * If you don't need @child_source to do anything on its own when it * triggers, you can call g_source_set_dummy_callback() on it to set a * callback that does nothing (except return %TRUE if appropriate). * * @source will hold a reference on @child_source while @child_source * is attached to it. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * Params: * childSource = a second #GSource that @source should "poll" * * Since: 2.28 */ public void addChildSource(Source childSource) { g_source_add_child_source(gSource, (childSource is null) ? null : childSource.getSourceStruct()); } /** * Adds a file descriptor to the set of file descriptors polled for * this source. This is usually combined with g_source_new() to add an * event source. The event source's check function will typically test * the @revents field in the #GPollFD struct and return %TRUE if events need * to be processed. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * Using this API forces the linear scanning of event sources on each * main loop iteration. Newly-written event sources should try to use * g_source_add_unix_fd() instead of this API. * * Params: * fd = a #GPollFD structure holding information about a file * descriptor to watch. */ public void addPoll(GPollFD* fd) { g_source_add_poll(gSource, fd); } /** * Monitors @fd for the IO events in @events. * * The tag returned by this function can be used to remove or modify the * monitoring of the fd using g_source_remove_unix_fd() or * g_source_modify_unix_fd(). * * It is not necessary to remove the fd before destroying the source; it * will be cleaned up automatically. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * As the name suggests, this function is not available on Windows. * * Params: * fd = the fd to monitor * events = an event mask * * Return: an opaque tag * * Since: 2.36 */ public void* addUnixFd(int fd, GIOCondition events) { return g_source_add_unix_fd(gSource, fd, events); } /** * Adds a #GSource to a @context so that it will be executed within * that context. Remove it by calling g_source_destroy(). * * Params: * context = a #GMainContext (if %NULL, the default context will be used) * * Return: the ID (greater than 0) for the source within the * #GMainContext. */ public uint attach(MainContext context) { return g_source_attach(gSource, (context is null) ? null : context.getMainContextStruct()); } /** * Removes a source from its #GMainContext, if any, and mark it as * destroyed. The source cannot be subsequently added to another * context. It is safe to call this on sources which have already been * removed from their context. */ public void destroy() { g_source_destroy(gSource); } /** * Checks whether a source is allowed to be called recursively. * see g_source_set_can_recurse(). * * Return: whether recursion is allowed. */ public bool getCanRecurse() { return g_source_get_can_recurse(gSource) != 0; } /** * Gets the #GMainContext with which the source is associated. * * You can call this on a source that has been destroyed, provided * that the #GMainContext it was attached to still exists (in which * case it will return that #GMainContext). In particular, you can * always call this function on the source returned from * g_main_current_source(). But calling this function on a source * whose #GMainContext has been destroyed is an error. * * Return: the #GMainContext with which the * source is associated, or %NULL if the context has not * yet been added to a source. */ public MainContext getContext() { auto p = g_source_get_context(gSource); if(p is null) { return null; } return new MainContext(cast(GMainContext*) p); } /** * This function ignores @source and is otherwise the same as * g_get_current_time(). * * Deprecated: use g_source_get_time() instead * * Params: * timeval = #GTimeVal structure in which to store current time. */ public void getCurrentTime(TimeVal timeval) { g_source_get_current_time(gSource, (timeval is null) ? null : timeval.getTimeValStruct()); } /** * Returns the numeric ID for a particular source. The ID of a source * is a positive integer which is unique within a particular main loop * context. The reverse * mapping from ID to source is done by g_main_context_find_source_by_id(). * * Return: the ID (greater than 0) for the source */ public uint getId() { return g_source_get_id(gSource); } /** * Gets a name for the source, used in debugging and profiling. The * name may be #NULL if it has never been set with g_source_set_name(). * * Return: the name of the source * * Since: 2.26 */ public string getName() { return Str.toString(g_source_get_name(gSource)); } /** * Gets the priority of a source. * * Return: the priority of the source */ public int getPriority() { return g_source_get_priority(gSource); } /** * Gets the "ready time" of @source, as set by * g_source_set_ready_time(). * * Any time before the current monotonic time (including 0) is an * indication that the source will fire immediately. * * Return: the monotonic ready time, -1 for "never" */ public long getReadyTime() { return g_source_get_ready_time(gSource); } /** * Gets the time to be used when checking this source. The advantage of * calling this function over calling g_get_monotonic_time() directly is * that when checking multiple sources, GLib can cache a single value * instead of having to repeatedly get the system monotonic time. * * The time here is the system monotonic time, if available, or some * other reasonable alternative otherwise. See g_get_monotonic_time(). * * Return: the monotonic time in microseconds * * Since: 2.28 */ public long getTime() { return g_source_get_time(gSource); } /** * Returns whether @source has been destroyed. * * This is important when you operate upon your objects * from within idle handlers, but may have freed the object * before the dispatch of your idle handler. * * |[<!-- language="C" --> * static gboolean * idle_callback (gpointer data) * { * SomeWidget *self = data; * * GDK_THREADS_ENTER (); * // do stuff with self * self->idle_id = 0; * GDK_THREADS_LEAVE (); * * return G_SOURCE_REMOVE; * } * * static void * some_widget_do_stuff_later (SomeWidget *self) * { * self->idle_id = g_idle_add (idle_callback, self); * } * * static void * some_widget_finalize (GObject *object) * { * SomeWidget *self = SOME_WIDGET (object); * * if (self->idle_id) * g_source_remove (self->idle_id); * * G_OBJECT_CLASS (parent_class)->finalize (object); * } * ]| * * This will fail in a multi-threaded application if the * widget is destroyed before the idle handler fires due * to the use after free in the callback. A solution, to * this particular problem, is to check to if the source * has already been destroy within the callback. * * |[<!-- language="C" --> * static gboolean * idle_callback (gpointer data) * { * SomeWidget *self = data; * * GDK_THREADS_ENTER (); * if (!g_source_is_destroyed (g_main_current_source ())) * { * // do stuff with self * } * GDK_THREADS_LEAVE (); * * return FALSE; * } * ]| * * Return: %TRUE if the source has been destroyed * * Since: 2.12 */ public bool isDestroyed() { return g_source_is_destroyed(gSource) != 0; } /** * Updates the event mask to watch for the fd identified by @tag. * * @tag is the tag returned from g_source_add_unix_fd(). * * If you want to remove a fd, don't set its event mask to zero. * Instead, call g_source_remove_unix_fd(). * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * As the name suggests, this function is not available on Windows. * * Params: * tag = the tag from g_source_add_unix_fd() * newEvents = the new event mask to watch * * Since: 2.36 */ public void modifyUnixFd(void* tag, GIOCondition newEvents) { g_source_modify_unix_fd(gSource, tag, newEvents); } /** * Queries the events reported for the fd corresponding to @tag on * @source during the last poll. * * The return value of this function is only defined when the function * is called from the check or dispatch functions for @source. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * As the name suggests, this function is not available on Windows. * * Params: * tag = the tag from g_source_add_unix_fd() * * Return: the conditions reported on the fd * * Since: 2.36 */ public GIOCondition queryUnixFd(void* tag) { return g_source_query_unix_fd(gSource, tag); } /** * Increases the reference count on a source by one. * * Return: @source */ public Source doref() { auto p = g_source_ref(gSource); if(p is null) { return null; } return new Source(cast(GSource*) p); } /** * Detaches @child_source from @source and destroys it. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * Params: * childSource = a #GSource previously passed to * g_source_add_child_source(). * * Since: 2.28 */ public void removeChildSource(Source childSource) { g_source_remove_child_source(gSource, (childSource is null) ? null : childSource.getSourceStruct()); } /** * Removes a file descriptor from the set of file descriptors polled for * this source. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * Params: * fd = a #GPollFD structure previously passed to g_source_add_poll(). */ public void removePoll(GPollFD* fd) { g_source_remove_poll(gSource, fd); } /** * Reverses the effect of a previous call to g_source_add_unix_fd(). * * You only need to call this if you want to remove an fd from being * watched while keeping the same source around. In the normal case you * will just want to destroy the source. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * As the name suggests, this function is not available on Windows. * * Params: * tag = the tag from g_source_add_unix_fd() * * Since: 2.36 */ public void removeUnixFd(void* tag) { g_source_remove_unix_fd(gSource, tag); } /** * Sets the callback function for a source. The callback for a source is * called from the source's dispatch function. * * The exact type of @func depends on the type of source; ie. you * should not count on @func being called with @data as its first * parameter. * * See [memory management of sources][mainloop-memory-management] for details * on how to handle memory management of @data. * * Typically, you won't use this function. Instead use functions specific * to the type of source you are using. * * Params: * func = a callback function * data = the data to pass to callback function * notify = a function to call when @data is no longer in use, or %NULL. */ public void setCallback(GSourceFunc func, void* data, GDestroyNotify notify) { g_source_set_callback(gSource, func, data, notify); } /** * Sets the callback function storing the data as a refcounted callback * "object". This is used internally. Note that calling * g_source_set_callback_indirect() assumes * an initial reference count on @callback_data, and thus * @callback_funcs->unref will eventually be called once more * than @callback_funcs->ref. * * Params: * callbackData = pointer to callback data "object" * callbackFuncs = functions for reference counting @callback_data * and getting the callback and data */ public void setCallbackIndirect(void* callbackData, GSourceCallbackFuncs* callbackFuncs) { g_source_set_callback_indirect(gSource, callbackData, callbackFuncs); } /** * Sets whether a source can be called recursively. If @can_recurse is * %TRUE, then while the source is being dispatched then this source * will be processed normally. Otherwise, all processing of this * source is blocked until the dispatch function returns. * * Params: * canRecurse = whether recursion is allowed for this source */ public void setCanRecurse(bool canRecurse) { g_source_set_can_recurse(gSource, canRecurse); } /** * Sets the source functions (can be used to override * default implementations) of an unattached source. * * Params: * funcs = the new #GSourceFuncs * * Since: 2.12 */ public void setFuncs(GSourceFuncs* funcs) { g_source_set_funcs(gSource, funcs); } /** * Sets a name for the source, used in debugging and profiling. * The name defaults to #NULL. * * The source name should describe in a human-readable way * what the source does. For example, "X11 event queue" * or "GTK+ repaint idle handler" or whatever it is. * * It is permitted to call this function multiple times, but is not * recommended due to the potential performance impact. For example, * one could change the name in the "check" function of a #GSourceFuncs * to include details like the event type in the source name. * * Use caution if changing the name while another thread may be * accessing it with g_source_get_name(); that function does not copy * the value, and changing the value will free it while the other thread * may be attempting to use it. * * Params: * name = debug name for the source * * Since: 2.26 */ public void setName(string name) { g_source_set_name(gSource, Str.toStringz(name)); } /** * Sets the priority of a source. While the main loop is being run, a * source will be dispatched if it is ready to be dispatched and no * sources at a higher (numerically smaller) priority are ready to be * dispatched. * * A child source always has the same priority as its parent. It is not * permitted to change the priority of a source once it has been added * as a child of another source. * * Params: * priority = the new priority. */ public void setPriority(int priority) { g_source_set_priority(gSource, priority); } /** * Sets a #GSource to be dispatched when the given monotonic time is * reached (or passed). If the monotonic time is in the past (as it * always will be if @ready_time is 0) then the source will be * dispatched immediately. * * If @ready_time is -1 then the source is never woken up on the basis * of the passage of time. * * Dispatching the source does not reset the ready time. You should do * so yourself, from the source dispatch function. * * Note that if you have a pair of sources where the ready time of one * suggests that it will be delivered first but the priority for the * other suggests that it would be delivered first, and the ready time * for both sources is reached during the same main context iteration * then the order of dispatch is undefined. * * This API is only intended to be used by implementations of #GSource. * Do not call this API on a #GSource that you did not create. * * Params: * readyTime = the monotonic time at which the source will be ready, * 0 for "immediately", -1 for "never" * * Since: 2.36 */ public void setReadyTime(long readyTime) { g_source_set_ready_time(gSource, readyTime); } /** * Decreases the reference count of a source by one. If the * resulting reference count is zero the source and associated * memory will be destroyed. */ public void unref() { g_source_unref(gSource); } /** * Removes the source with the given id from the default main context. * * The id of a #GSource is given by g_source_get_id(), or will be * returned by the functions g_source_attach(), g_idle_add(), * g_idle_add_full(), g_timeout_add(), g_timeout_add_full(), * g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and * g_io_add_watch_full(). * * See also g_source_destroy(). You must use g_source_destroy() for sources * added to a non-default main context. * * It is a programmer error to attempt to remove a non-existent source. * * More specifically: source IDs can be reissued after a source has been * destroyed and therefore it is never valid to use this function with a * source ID which may have already been removed. An example is when * scheduling an idle to run in another thread with g_idle_add(): the * idle may already have run and been removed by the time this function * is called on its (now invalid) source ID. This source ID may have * been reissued, leading to the operation being performed against the * wrong source. * * Params: * tag = the ID of the source to remove. * * Return: For historical reasons, this function always returns %TRUE */ public static bool remove(uint tag) { return g_source_remove(tag) != 0; } /** * Removes a source from the default main loop context given the * source functions and user data. If multiple sources exist with the * same source functions and user data, only one will be destroyed. * * Params: * funcs = The @source_funcs passed to g_source_new() * userData = the user data for the callback * * Return: %TRUE if a source was found and removed. */ public static bool removeByFuncsUserData(GSourceFuncs* funcs, void* userData) { return g_source_remove_by_funcs_user_data(funcs, userData) != 0; } /** * Removes a source from the default main loop context given the user * data for the callback. If multiple sources exist with the same user * data, only one will be destroyed. * * Params: * userData = the user_data for the callback. * * Return: %TRUE if a source was found and removed. */ public static bool removeByUserData(void* userData) { return g_source_remove_by_user_data(userData) != 0; } /** * Sets the name of a source using its ID. * * This is a convenience utility to set source names from the return * value of g_idle_add(), g_timeout_add(), etc. * * It is a programmer error to attempt to set the name of a non-existent * source. * * More specifically: source IDs can be reissued after a source has been * destroyed and therefore it is never valid to use this function with a * source ID which may have already been removed. An example is when * scheduling an idle to run in another thread with g_idle_add(): the * idle may already have run and been removed by the time this function * is called on its (now invalid) source ID. This source ID may have * been reissued, leading to the operation being performed against the * wrong source. * * Params: * tag = a #GSource ID * name = debug name for the source * * Since: 2.26 */ public static void setNameById(uint tag, string name) { g_source_set_name_by_id(tag, Str.toStringz(name)); } }
D
import std.stdio; import std.range; import std.algorithm; import libasync; shared static ~this() { destroyAsyncThreads(); } EventLoop event_loop() { static EventLoop thread_local_event_loop; if (thread_local_event_loop is null) { thread_local_event_loop = new EventLoop; } return thread_local_event_loop; } bool should_keep_running_event_loop; void stop_event_loop() { should_keep_running_event_loop = false; } void run_event_loop_forever() { should_keep_running_event_loop = true; while (should_keep_running_event_loop) { event_loop().loop(); } } final class TcpConnection { AsyncTCPConnection connection; void delegate(const(ubyte)[]) on_read; this(AsyncTCPConnection c) { connection = c; } this(string host, size_t port) { this(new AsyncTCPConnection(event_loop())); if (!connection.host(host, port).run(&on_tcp_event)) writeln(connection.status); } void write(const ubyte[] data) { connection.send(data); } private void on_tcp_event(TCPEvent ev) { try final switch (ev) { case TCPEvent.CONNECT: break; case TCPEvent.READ: receive_entire_message(); break; case TCPEvent.WRITE: break; case TCPEvent.CLOSE: break; case TCPEvent.ERROR: break; } catch (Throwable t) { writeln(t); } } private void receive_entire_message() { ubyte[] buf; while (true) { ubyte[128] mini_buf; ubyte[] ffs = mini_buf[]; auto count = connection.recv(ffs); buf ~= mini_buf[0 .. count]; if (count < 128) { on_read(buf); break; } } } } class TcpServer { AsyncTCPListener listener; void delegate(TcpConnection) on_connect; this() { listener = new AsyncTCPListener(event_loop()); on_connect = (a) { writeln("FKIN HELL M8"); }; } void listen_on(string address, size_t port) { auto ok = listener.host(address, port).run((AsyncTCPConnection a) { auto conn = new TcpConnection(a); on_connect(conn); return &conn.on_tcp_event; }); } } TcpConnection connect(string host, size_t port) { return new TcpConnection(host, port); } void call_every(Duration dur, void delegate() dg) { auto timer = new AsyncTimer(event_loop()); timer.periodic(true); timer.duration(dur); timer.run(dg); } void call_soon(Duration dur, void delegate() dg) { auto timer = new AsyncTimer(event_loop()); timer.periodic(false); timer.duration(dur); timer.run(dg); }
D
/++ Prerequisites: ------------------------- A working dmd installation to compile this script (also requires libcurl). Install Vagrant (https://learnchef.opscode.com/screencasts/install-vagrant/) Install VirtualBox (https://learnchef.opscode.com/screencasts/install-virtual-box/) +/ import std.algorithm, std.conv, std.exception, std.file, std.path, std.process, std.stdio, std.string, std.range; import common; version (Posix) {} else { static assert(0, "This must be run on a Posix machine."); } static assert(__VERSION__ >= 2067, "Requires dmd >= 2.067 with a fix for Bugzilla 8269."); /// Open Source OS boxes are from http://www.vagrantbox.es/ /// For each box additional setup steps were performed, afterwards the boxes were repackaged. /// Name: create_dmd_release-freebsd-64 /// VagrantBox.es: FreeBSD 8.4 i386 (minimal, No Guest Additions, UFS) /// URL: http://dlang.dawg.eu/vagrant/FreeBSD-8.4-i386.box /// Setup: sudo pkg_add -r curl git gmake rsync enum freebsd_32 = Platform(OS.freebsd, Model._32); /// Name: create_dmd_release-freebsd-64 /// VagrantBox.es: FreeBSD 8.4 amd64 (minimal, No Guest Additions, UFS) /// URL: http://dlang.dawg.eu/vagrant/FreeBSD-8.4-amd64.box /// Setup: sudo pkg_add -r curl git gmake rsync enum freebsd_64 = Platform(OS.freebsd, Model._64); /// Name: create_dmd_release-linux /// VagrantBox.es: Opscode debian-7.4 /// URL: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.4_chef-provisionerless.box /// Setup: sudo apt-get -y update; sudo apt-get -y install git g++-multilib dpkg-dev rpm unzip; enum linux_both = Platform(OS.linux, Model._both); /// OSes that require licenses must be setup manually /// Name: create_dmd_release-osx /// Setup: Preparing OSX-10.8 box, https://gist.github.com/MartinNowak/8156507 enum osx_both = Platform(OS.osx, Model._both); /// Name: create_dmd_release-windows /// Setup: Preparing Win7x64 box, https://gist.github.com/MartinNowak/8270666 enum windows_both = Platform(OS.windows, Model._both); enum platforms = [linux_both, windows_both, osx_both, freebsd_32, freebsd_64]; enum OS { freebsd, linux, osx, windows, } enum Model { _both = 0, _32 = 32, _64 = 64 } struct Platform { @property string osS() { return to!string(os); } @property string modelS() { return model == Model._both ? "" : to!string(cast(uint)model); } string toString() { return model == Model._both ? osS : osS ~ "-" ~ modelS; } OS os; Model model; } struct Shell { @disable this(this); this(string[] args) { _pipes = pipeProcess(args, Redirect.stdin); } void cmd(string s) { writeln("\033[33m", s, "\033[0m"); _pipes.stdin.writeln(s); } ~this() { _pipes.stdin.close(); // TODO: capture stderr and attach it to enforce enforce(wait(_pipes.pid) == 0); } ProcessPipes _pipes; } struct Box { @disable this(this); this(Platform platform) { _platform = platform; _tmpdir = mkdtemp(); std.file.write(buildPath(_tmpdir, "Vagrantfile"), vagrantFile); // bring up the virtual box (downloads missing images) run("cd "~_tmpdir~"; vagrant up"); _isUp = true; // save the ssh config file run("cd "~_tmpdir~"; vagrant ssh-config > ssh.cfg;"); if (os == OS.windows) run("cd "~_tmpdir~"; echo ' HostKeyAlgorithms ssh-dss' >> ssh.cfg;"); } Shell shell() { if (os == OS.windows) return Shell(["ssh", "-F", sshcfg, "default", "powershell", "-Command", "-"]); else return Shell(["ssh", "-F", sshcfg, "default", "bash", "-e"]); } void scp(string src, string tgt) { if (os == OS.windows) run("scp -rq -F "~sshcfg~" "~src~" "~tgt); else run("rsync -a -e 'ssh -F "~sshcfg~"' "~src~" "~tgt); } private: @property string vagrantFile() { auto res = ` VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "create_dmd_release-`~platform~`" # disable shared folders, because the guest additions are missing config.vm.synced_folder ".", "/vagrant", :disabled => true # use insecure ssh keys config.ssh.insert_key = false config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", "4096"] vb.customize ["modifyvm", :id, "--cpus", "4"] vb.customize ["modifyvm", :id, "--accelerate3d", "off"] vb.customize ["modifyvm", :id, "--audio", "none"] vb.customize ["modifyvm", :id, "--usb", "off"] end `; if (os == OS.windows) res ~= ` config.ssh.shell = 'powershell -Command -' config.vm.guest = :windows `; res ~= ` end `; return res.outdent(); } auto build(string ver, bool isBranch, bool skipDocs) { return runBuild(this, ver, isBranch, skipDocs); } ~this() { destroy(); } void destroy() { try { if (_isUp) run("cd "~_tmpdir~"; vagrant destroy -f"); if (_tmpdir.length) rmdirRecurse(_tmpdir); } finally { _isUp = false; _tmpdir = null; } } void halt() { try if (_isUp) run("cd "~_tmpdir~"; vagrant halt"); finally _isUp = false; } @property string platform() { return _platform.toString; } @property string sshcfg() { return buildPath(_tmpdir, "ssh.cfg"); } Platform _platform; alias _platform this; string _tmpdir; bool _isUp; } string runCapture(string cmd) { writeln("\033[36m", cmd, "\033[0m"); auto result = executeShell(cmd); enforce(result.status == 0); return result.output.strip; } void run(string cmd) { writeln("\033[36m", cmd, "\033[0m"); enforce(wait(spawnShell(cmd)) == 0); } //------------------------------------------------------------------------------ auto addPrefix(R)(R rng, string prefix) { import std.algorithm : map; return rng.map!(a => prefix ~ a)(); } //------------------------------------------------------------------------------ // Copy additional release binaries from the previous release void prepareExtraBins(string workDir) { auto winBins = [ "windbg.hlp", "ddemangle.exe", "lib.exe", "link.exe", "make.exe", "replace.exe", "shell.exe", "windbg.exe", "dm.dll", "eecxxx86.dll", "emx86.dll", "mspdb41.dll", "shcv.dll", "tlloc.dll", "libcurl.dll", ].addPrefix("bin/"); auto winBins64 = ["libcurl.dll"].addPrefix("bin64/"); auto winLibs = [ "advapi32.lib", "COMCTL32.LIB", "comdlg32.lib", "CTL3D32.LIB", "gdi32.lib", "kernel32.lib", "ODBC32.LIB", "ole32.lib", "OLEAUT32.LIB", "rpcrt4.lib", "shell32.lib", "snn.lib", "user32.lib", "uuid.lib", "winmm.lib", "winspool.lib", "WS2_32.LIB", "wsock32.lib", "curl.lib", ].addPrefix("lib/"); auto winLibs64 = ["curl.lib"].addPrefix("lib64/"); auto winFiles = chain(winBins, winBins64, winLibs, winLibs64).array(); auto extraBins = [ windows_both : winFiles, linux_both : ["bin32/dumpobj", "bin64/dumpobj", "bin32/obj2asm", "bin64/obj2asm"], freebsd_32 : ["bin32/dumpobj", "bin32/obj2asm", "bin32/shell"], osx_both : ["bin/dumpobj", "bin/obj2asm", "bin/shell"], ]; foreach (platform, files; extraBins) copyFiles(files.addPrefix("dmd2/"~platform.osS~"/").array(), workDir~"/"~platform.toString~"/old-dmd", workDir~"/"~platform.osS~"/extraBins"); } //------------------------------------------------------------------------------ // builds a dmd.VERSION.OS.MODEL.zip on the vanilla VirtualBox image void runBuild(ref Box box, string ver, bool isBranch, bool skipDocs) { with (box.shell()) { string dmd, rdmd; final switch (box.os) { case OS.freebsd: dmd = "old-dmd/dmd2/freebsd/bin"~box.modelS~"/dmd"; rdmd = "old-dmd/dmd2/freebsd/bin"~box.modelS~"/rdmd"~" --compiler="~dmd; break; case OS.linux: dmd = "old-dmd/dmd2/linux/bin64/dmd"; rdmd = "old-dmd/dmd2/linux/bin64/rdmd --compiler="~dmd; break; case OS.windows: // update DMC's snn.lib and link.exe cmd(`copy old-dmd\dmd2\windows\bin\link.exe C:\dm\bin\link.exe`); cmd(`copy old-dmd\dmd2\windows\lib\snn.lib C:\dm\lib\snn.lib`); // copy libcurl needed for create_dmd_release and dlang.org cmd(`copy old-dmd\dmd2\windows\bin\libcurl.dll .`); cmd(`copy old-dmd\dmd2\windows\bin\libcurl.dll clones\dlang.org`); cmd(`copy old-dmd\dmd2\windows\lib\curl.lib clones\dlang.org`); dmd = `old-dmd\dmd2\windows\bin\dmd.exe`; rdmd = `old-dmd\dmd2\windows\bin\rdmd.exe --compiler=`~dmd; break; case OS.osx: dmd = "old-dmd/dmd2/osx/bin/dmd"; rdmd = "old-dmd/dmd2/osx/bin/rdmd --compiler="~dmd; break; } auto build = rdmd~" create_dmd_release --extras=extraBins --use-clone=clones --host-dmd="~dmd; if (box.model != Model._both) build ~= " --only-" ~ box.modelS; if (skipDocs) build ~= " --skip-docs"; build ~= " " ~ ver; cmd(build); } // copy out created zip files box.scp("default:dmd."~ver~"."~box.platform~".zip", "build/"); // Build package installers if (!isBranch && !skipDocs) final switch (box.os) { case OS.freebsd: break; case OS.linux: with (box.shell()) { cmd(`cp dmd.`~ver~`.linux.zip clones/installer/linux`); cmd(`cd clones/installer/linux`); cmd(`./build_all.sh -v`~ver); cmd(`ls *.deb`); } box.scp("'default:clones/installer/linux/*.{rpm,deb}'", "build/"); break; case OS.windows: with (box.shell()) { cmd(`cd clones\installer\windows`); cmd(`&'C:\Program Files (x86)\NSIS\makensis'`~ ` '/DEmbedD2Dir=C:\Users\vagrant\dmd.`~ver~`.windows\dmd2'`~ ` '/DVersion2=`~ver~`' d2-installer.nsi`); cmd(`copy dmd-`~ver~`.exe C:\Users\vagrant\dmd-`~ver~`.exe`); } box.scp("default:dmd-"~ver~".exe", "build/"); break; case OS.osx: with (box.shell()) { cmd(`cp dmd.`~ver~`.osx.zip clones/installer/osx`); cmd(`cd clones/installer/osx`); cmd(`make dmd.`~ver~`.dmg VERSION=`~ver); } box.scp("'default:clones/installer/osx/*.dmg'", "build/"); break; } } void cloneSources(string gitTag, string tgtDir) { auto prefix = "https://github.com/D-Programming-Language/"; auto fmt = "git clone --depth 1 -b "~gitTag~" "~prefix~"%1$s.git "~tgtDir~"/%1$s"; foreach (proj; allProjects) run(fmt.format(proj)); } void applyPatches(string gitTag, string tgtDir) { import std.file; write(tgtDir~"/dmd/VERSION", gitTag.chompPrefix("v")); auto fmt = "git -C "~tgtDir~"/%1$s apply -3 < patches/%1$s.patch"; foreach (proj; ["dlang.org", "tools"]) run(fmt.format(proj)); } auto lzmaExt = (OS os) => os == OS.windows ? ".7z" : ".tar.xz"; void lzmaArchives(string gitTag) { auto baseName = "build/dmd."~gitTag~"."; foreach (platform; platforms) { auto workDir = mkdtemp(); scope (success) if (workDir.exists) rmdirRecurse(workDir); auto name = baseName ~ platform.toString; writeln("Building LZMA archive '", name~lzmaExt(platform.os), "'."); extractZip(name ~ ".zip", workDir); archiveLZMA(workDir~"/dmd2", name~lzmaExt(platform.os)); } } int error(Args...)(string fmt, Args args) { stderr.write("\033[031m"); scope (exit) stderr.write("\033[0m"); stderr.writefln(fmt, args); import core.stdc.stdlib : EXIT_FAILURE; return EXIT_FAILURE; } int main(string[] args) { if (args.length < 3 || args.length == 4 && args[$-1] != "--skip-docs" || args.length > 4) return error("Expected <old-dmd-version> <git-branch-or-tag> [--skip-docs] as arguments, e.g. 'rdmd build_all v2.066.0 v2.066.1'."); immutable skipDocs = args[$-1] == "--skip-docs"; import std.regex; enum verRE = regex(`^v(\d+)\.(\d+)\.(\d+)(-.*)?$`); auto workDir = mkdtemp(); scope (success) if (workDir.exists) rmdirRecurse(workDir); // Cache huge downloads enum cacheDir = "cached_downloads"; auto oldVer = args[1]; if (!oldVer.match(verRE)) return error("Expected a version tag like 'v2.066.0' not '%s'", oldVer); oldVer = oldVer.chompPrefix("v"); immutable gitTag = args[2]; immutable isBranch = !gitTag.match(verRE); enum optlink = "optlink.zip"; enum libC = "snn.lib"; enum libCurl = "libcurl-7.45.0-WinSSL-zlib-x86-x64.zip"; auto oldCompilers = platforms .map!(p => "dmd.%1$s.%2$s.%3$s".format(oldVer, p, p.os == OS.windows ? "7z" : "tar.xz")); foreach (url; oldCompilers.map!(s => "http://downloads.dlang.org/releases/2.x/"~oldVer~"/"~s)) fetchFile(url, cacheDir~"/"~baseName(url), true); fetchFile("http://ftp.digitalmars.com/"~optlink, cacheDir~"/"~optlink); fetchFile("http://ftp.digitalmars.com/"~libC, cacheDir~"/"~libC); fetchFile("http://downloads.dlang.org/other/"~libCurl, cacheDir~"/"~libCurl, true); // Unpack previous dmd release foreach (platform, oldCompiler; platforms.zip(oldCompilers)) extract(cacheDir~"/"~oldCompiler, workDir~"/"~platform.toString~"/old-dmd"); if (platforms.canFind!(p => p.os == OS.windows)) { // Use latest optlink remove(workDir~"/windows/old-dmd/dmd2/windows/bin/link.exe"); extract(cacheDir~"/"~optlink, workDir~"/windows/old-dmd/dmd2/windows/bin/"); // Use latest libC (snn.lib) remove(workDir~"/windows/old-dmd/dmd2/windows/lib/snn.lib"); copyFile(cacheDir~"/"~libC, workDir~"/windows/old-dmd/dmd2/windows/lib/"~libC); // Get libcurl for windows extract(cacheDir~"/"~libCurl, workDir~"/windows/old-dmd/"); } cloneSources(gitTag, workDir~"/clones"); applyPatches(gitTag, workDir~"/clones"); prepareExtraBins(workDir); immutable ver = gitTag.chompPrefix("v"); mkdirRecurse("build"); foreach (p; platforms) { with (Box(p)) { auto toCopy = [platform~"/old-dmd", "clones", osS~"/extraBins"].addPrefix(workDir~"/").join(" "); scp(toCopy, "default:"); if (os != OS.linux && !skipDocs) scp(workDir~"/docs", "default:"); // copy create_dmd_release.d and dependencies scp("create_dmd_release.d common.d", "default:"); build(ver, isBranch, skipDocs); if (os == OS.linux && !skipDocs) scp("default:docs", workDir); } } lzmaArchives(ver); return 0; }
D
/Users/gbs/Xcode/souless/DerivedData/souless/Build/Intermediates.noindex/souless.build/Debug-iphonesimulator/souless.build/Objects-normal/x86_64/Config.o : /Users/gbs/Xcode/souless/souless/Data/UserMassageData.swift /Users/gbs/Xcode/souless/souless/Data/PostsData.swift /Users/gbs/Xcode/souless/souless/AuthService.swift /Users/gbs/Xcode/souless/souless/ViewController/NewMessage.swift /Users/gbs/Xcode/souless/souless/AppDelegate.swift /Users/gbs/Xcode/souless/souless/Config.swift /Users/gbs/Xcode/souless/souless/Cell/UsersCell.swift /Users/gbs/Xcode/souless/souless/Cell/PostViewCell.swift /Users/gbs/Xcode/souless/souless/ViewController/MessageController.swift /Users/gbs/Xcode/souless/souless/ViewController/ChatLogController.swift /Users/gbs/Xcode/souless/souless/ViewController/HomeViewController.swift /Users/gbs/Xcode/souless/souless/ViewController/CameraView.swift /Users/gbs/Xcode/souless/souless/ViewController/ProfileView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignInView.swift /Users/gbs/Xcode/souless/souless/ViewController/MainView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignUpView.swift /Users/gbs/Xcode/souless/souless/ViewController/Activity.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/os.apinotesc /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.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/Accelerate.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/os.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/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/ProgressHUD.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/Firebase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/souless-Bridging-Header.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUser.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthTokenResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/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/CoreData.framework/Headers/CoreData.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/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/gbs/Xcode/souless/DerivedData/souless/Build/Intermediates.noindex/souless.build/Debug-iphonesimulator/souless.build/Objects-normal/x86_64/Config~partial.swiftmodule : /Users/gbs/Xcode/souless/souless/Data/UserMassageData.swift /Users/gbs/Xcode/souless/souless/Data/PostsData.swift /Users/gbs/Xcode/souless/souless/AuthService.swift /Users/gbs/Xcode/souless/souless/ViewController/NewMessage.swift /Users/gbs/Xcode/souless/souless/AppDelegate.swift /Users/gbs/Xcode/souless/souless/Config.swift /Users/gbs/Xcode/souless/souless/Cell/UsersCell.swift /Users/gbs/Xcode/souless/souless/Cell/PostViewCell.swift /Users/gbs/Xcode/souless/souless/ViewController/MessageController.swift /Users/gbs/Xcode/souless/souless/ViewController/ChatLogController.swift /Users/gbs/Xcode/souless/souless/ViewController/HomeViewController.swift /Users/gbs/Xcode/souless/souless/ViewController/CameraView.swift /Users/gbs/Xcode/souless/souless/ViewController/ProfileView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignInView.swift /Users/gbs/Xcode/souless/souless/ViewController/MainView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignUpView.swift /Users/gbs/Xcode/souless/souless/ViewController/Activity.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/os.apinotesc /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.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/Accelerate.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/os.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/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/ProgressHUD.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/Firebase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/souless-Bridging-Header.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUser.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthTokenResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/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/CoreData.framework/Headers/CoreData.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/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/gbs/Xcode/souless/DerivedData/souless/Build/Intermediates.noindex/souless.build/Debug-iphonesimulator/souless.build/Objects-normal/x86_64/Config~partial.swiftdoc : /Users/gbs/Xcode/souless/souless/Data/UserMassageData.swift /Users/gbs/Xcode/souless/souless/Data/PostsData.swift /Users/gbs/Xcode/souless/souless/AuthService.swift /Users/gbs/Xcode/souless/souless/ViewController/NewMessage.swift /Users/gbs/Xcode/souless/souless/AppDelegate.swift /Users/gbs/Xcode/souless/souless/Config.swift /Users/gbs/Xcode/souless/souless/Cell/UsersCell.swift /Users/gbs/Xcode/souless/souless/Cell/PostViewCell.swift /Users/gbs/Xcode/souless/souless/ViewController/MessageController.swift /Users/gbs/Xcode/souless/souless/ViewController/ChatLogController.swift /Users/gbs/Xcode/souless/souless/ViewController/HomeViewController.swift /Users/gbs/Xcode/souless/souless/ViewController/CameraView.swift /Users/gbs/Xcode/souless/souless/ViewController/ProfileView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignInView.swift /Users/gbs/Xcode/souless/souless/ViewController/MainView.swift /Users/gbs/Xcode/souless/souless/ViewController/SignUpView.swift /Users/gbs/Xcode/souless/souless/ViewController/Activity.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/os.apinotesc /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/Kingfisher.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreData.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/Accelerate.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/os.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/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/ProgressHUD.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-umbrella.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRMutableData.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserMetadata.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseReference.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataEventType.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FirebaseCore.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FirebaseDatabase.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/Firebase.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthUIDelegate.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRServerValue.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuth.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageDownloadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageUploadTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageObservableTask.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRLoggerLevel.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIRApp.h /Users/gbs/Xcode/souless/souless/ProgreesHUD/souless-Bridging-Header.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIROAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRUser.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRActionCodeSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthSettings.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Headers/FIROptions.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthErrors.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageConstants.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Headers/Kingfisher-Swift.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Headers/FIRAuthTokenResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRTransactionResult.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDataSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FIRStorageTaskSnapshot.h /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Headers/FIRDatabaseQuery.h /Users/gbs/Xcode/souless/Pods/Firebase/CoreOnly/Sources/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseDatabase/FirebaseDatabase.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/DerivedData/souless/Build/Products/Debug-iphonesimulator/Kingfisher/Kingfisher.framework/Modules/module.modulemap /Users/gbs/Xcode/souless/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/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/CoreData.framework/Headers/CoreData.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/Accelerate.framework/Headers/Accelerate.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
/Users/student/Documents/Marketplace/DerivedData/Build/Intermediates/Marketplace.build/Debug-iphonesimulator/Marketplace.build/Objects-normal/x86_64/UserModel.o : /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/Download.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/Upload.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/ItemDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/FunctionDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/UserDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/TagsDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/InboxDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Sale.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/CoreDataStore.swift /Users/student/Documents/Marketplace/Marketplace/Misc/AppDelegate.swift /Users/student/Documents/Marketplace/Marketplace/Models/ItemModel.swift /Users/student/Documents/Marketplace/Marketplace/Models/UserModel.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxMsgTableCell.swift /Users/student/Documents/Marketplace/Marketplace/Views/ItemTableViewCell.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Item.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/User.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/TagSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/ItemSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/FunctionSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/UserSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/InboxSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/CoreDataCommonMethods.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Sale+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Item+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/User+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Pictures+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Tags+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Inbox+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Pictures.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Tags.swift /Users/student/Documents/Marketplace/Marketplace/Views/ForgotPasswordView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UploadImageView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SendMessageView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SearchTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UploadItemTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SignInTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/RegisterTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SearchParametersTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/MenuTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UserProfileView.swift /Users/student/Documents/Marketplace/Marketplace/Views/EditProfileView.swift /Users/student/Documents/Marketplace/Marketplace/Views/HomeView.swift /Users/student/Documents/Marketplace/Marketplace/Views/RatingView.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxDetailView.swift /Users/student/Documents/Marketplace/Marketplace/Views/ItemView.swift /Users/student/Documents/Marketplace/Marketplace/Views/CheckoutView.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Inbox.swift /Users/student/Documents/Marketplace/Marketplace/Misc/Handy.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/CoreMedia.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/simd.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/CoreLocation.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/AVFoundation.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/CoreAudio.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/Photos.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/student/Documents/Marketplace/Marketplace-Bridging-Header.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Users/student/Documents/Marketplace/DerivedData/Build/Intermediates/Marketplace.build/Debug-iphonesimulator/Marketplace.build/Objects-normal/x86_64/UserModel~partial.swiftmodule : /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/Download.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/Upload.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/ItemDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/FunctionDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/UserDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/TagsDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/InboxDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Sale.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/CoreDataStore.swift /Users/student/Documents/Marketplace/Marketplace/Misc/AppDelegate.swift /Users/student/Documents/Marketplace/Marketplace/Models/ItemModel.swift /Users/student/Documents/Marketplace/Marketplace/Models/UserModel.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxMsgTableCell.swift /Users/student/Documents/Marketplace/Marketplace/Views/ItemTableViewCell.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Item.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/User.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/TagSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/ItemSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/FunctionSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/UserSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/InboxSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/CoreDataCommonMethods.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Sale+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Item+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/User+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Pictures+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Tags+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Inbox+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Pictures.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Tags.swift /Users/student/Documents/Marketplace/Marketplace/Views/ForgotPasswordView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UploadImageView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SendMessageView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SearchTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UploadItemTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SignInTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/RegisterTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SearchParametersTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/MenuTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UserProfileView.swift /Users/student/Documents/Marketplace/Marketplace/Views/EditProfileView.swift /Users/student/Documents/Marketplace/Marketplace/Views/HomeView.swift /Users/student/Documents/Marketplace/Marketplace/Views/RatingView.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxDetailView.swift /Users/student/Documents/Marketplace/Marketplace/Views/ItemView.swift /Users/student/Documents/Marketplace/Marketplace/Views/CheckoutView.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Inbox.swift /Users/student/Documents/Marketplace/Marketplace/Misc/Handy.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/CoreMedia.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/simd.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/CoreLocation.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/AVFoundation.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/CoreAudio.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/Photos.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/student/Documents/Marketplace/Marketplace-Bridging-Header.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes /Users/student/Documents/Marketplace/DerivedData/Build/Intermediates/Marketplace.build/Debug-iphonesimulator/Marketplace.build/Objects-normal/x86_64/UserModel~partial.swiftdoc : /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/Download.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/Upload.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/ItemDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/FunctionDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/UserDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/TagsDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/InboxDataSource.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Sale.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/CoreDataStore.swift /Users/student/Documents/Marketplace/Marketplace/Misc/AppDelegate.swift /Users/student/Documents/Marketplace/Marketplace/Models/ItemModel.swift /Users/student/Documents/Marketplace/Marketplace/Models/UserModel.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxMsgTableCell.swift /Users/student/Documents/Marketplace/Marketplace/Views/ItemTableViewCell.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Item.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/User.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/TagSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/ItemSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/FunctionSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/UserSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/ObjectAdapters/InboxSchemaProcessor.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/Network/CoreDataCommonMethods.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Sale+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Item+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/User+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Pictures+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Tags+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Inbox+CoreDataProperties.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Pictures.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Tags.swift /Users/student/Documents/Marketplace/Marketplace/Views/ForgotPasswordView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UploadImageView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SendMessageView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SearchTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UploadItemTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SignInTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/RegisterTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/SearchParametersTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/MenuTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxTableView.swift /Users/student/Documents/Marketplace/Marketplace/Views/UserProfileView.swift /Users/student/Documents/Marketplace/Marketplace/Views/EditProfileView.swift /Users/student/Documents/Marketplace/Marketplace/Views/HomeView.swift /Users/student/Documents/Marketplace/Marketplace/Views/RatingView.swift /Users/student/Documents/Marketplace/Marketplace/Views/Inbox/InboxDetailView.swift /Users/student/Documents/Marketplace/Marketplace/Views/ItemView.swift /Users/student/Documents/Marketplace/Marketplace/Views/CheckoutView.swift /Users/student/Documents/Marketplace/Marketplace/CoreDataComponents/DataModels/Inbox.swift /Users/student/Documents/Marketplace/Marketplace/Misc/Handy.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/CoreMedia.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/simd.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/CoreLocation.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/AVFoundation.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/CoreAudio.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/Photos.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/student/Documents/Marketplace/Marketplace-Bridging-Header.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.apinotes
D
/** * drawMesh.d * dockwork * July 21, 2013 * Brandon Surmanski */ module dw.draw.drawMesh; import dw.draw.drawDevice; import dw.resource.mesh; abstract class DrawMesh { protected: uint _nverts; uint _nfaces; DrawDevice _device; this(DrawDevice device, uint nverts, uint nfaces) { _device = device; _nverts = nverts; _nfaces = nfaces; } public: @property uint nVerts() { return _nverts; } @property uint nFaces() { return _nfaces; } this(Mesh mesh); Mesh toMesh(); void writeToMesh(Mesh mesh); }
D
/Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/Objects-normal/x86_64/ObjectiveCSupport.o : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Schema.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Sync.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Optional.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Util.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Realm.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Migration.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Error.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Results.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Object.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/List.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Property.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/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/Target\ Support\ Files/RealmSwift/RealmSwift-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/NSError+RLMSync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMThreadSafeReference.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMOptionalBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMListBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUtil.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/Realm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMPlatform.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSession.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncPermission.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMMigration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMCollection.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSubscription.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncManager.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUser.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncCredentials.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMResults.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMConstants.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObject.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMArray.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMProperty.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/unextended-module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/Objects-normal/x86_64/ObjectiveCSupport~partial.swiftmodule : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Schema.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Sync.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Optional.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Util.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Realm.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Migration.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Error.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Results.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Object.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/List.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Property.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/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/Target\ Support\ Files/RealmSwift/RealmSwift-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/NSError+RLMSync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMThreadSafeReference.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMOptionalBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMListBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUtil.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/Realm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMPlatform.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSession.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncPermission.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMMigration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMCollection.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSubscription.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncManager.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUser.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncCredentials.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMResults.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMConstants.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObject.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMArray.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMProperty.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/unextended-module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/Objects-normal/x86_64/ObjectiveCSupport~partial.swiftdoc : /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Schema.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Sync.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Optional.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Util.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Realm.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Migration.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Error.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Aliases.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/LinkingObjects.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Results.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Object.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/List.swift /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/RealmSwift/RealmSwift/Property.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/yamaguchiMacPro/Documents/work/ChousainPlus/Pods/Target\ Support\ Files/RealmSwift/RealmSwift-umbrella.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectSchema.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/NSError+RLMSync.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMThreadSafeReference.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMOptionalBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObjectBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMListBase.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUtil.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/Realm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealm.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMPlatform.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSession.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncPermission.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMMigration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMRealmConfiguration.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMCollection.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncSubscription.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncManager.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncUser.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMSyncCredentials.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMResults.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMConstants.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMObject.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMArray.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Products/Debug-iphonesimulator/Realm/Realm.framework/Headers/RLMProperty.h /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift.build/unextended-module.modulemap /Users/yamaguchiMacPro/Documents/work/ChousainPlus/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Realm.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes
D
spoken with emphasis sudden and strong forceful and definite in expression or action
D
module vfg.grid; import vfg.cell; /// class Grid(V3) { public{ this(in Vi3 indices){ import std.conv:to; cells = new Cell!V3[](indices.x*indices.y*indices.z); this.indices= indices; } ref auto index(in Vi3 iv){ size_t i = iv.x + iv.y*indices.x + iv.z*indices.x*indices.y; return cells[i]; } Vi3 indices; alias cells this; } Cell!V3[] cells; import armos.math:Vector; private alias Vi3 = Vector!(size_t, 3); } unittest{ import armos.math; alias V3 = Vector3d; alias Vi3 = Vector!(size_t, 3); immutable size = Vi3(2, 2, 2); auto grid = new Grid!V3(size); assert(grid.length == size.x*size.y*size.z); }
D
module startup; version(GNU) { static import gcc.attribute; // we need this to get the section, weak and alias attributes void wfi(){ version(ALLOW_WFI){ asm{ "wfi"; } } } } else version(LDC) { import ldc.llvmasm; void wfi(){ version(ALLOW_WFI){ __asm("wfi"); } } } import core.stdc.config; // we need this for c_ulong, so we can get symbols from the linker-script import core.stdc.stdint; // these are the types normally used on microcontrollers // Create convenience enums and aliases for the weak and alias attributes: enum isr_vector = gcc.attribute.attribute("section",".isr_vector.ro"); enum naked = gcc.attribute.attribute("naked"); enum weak = gcc.attribute.attribute("weak"); alias Tuple(A...) = A; alias rst = Tuple!(weak, gcc.attribute.attribute("alias", "defaultResetHandler")); alias exc = Tuple!(weak, gcc.attribute.attribute("alias", "defaultExceptionHandler")); // The following symbols are provided by our linker-script: extern(C) extern __gshared c_ulong _stack; // initial stack address extern(C) extern __gshared c_ulong _siccmram; // pointer to read-only data that needs to be copied to CCMRAM extern(C) extern __gshared c_ulong _sccmram; // start address of .ccmram section (somewhere within CCMRAM) extern(C) extern __gshared c_ulong _eccmram; // end address of .ccmram section (somewhere within CCMRAM) extern(C) extern __gshared c_ulong _sirelocated; // pointer to read-only data that needs to be copied to normal SRAM extern(C) extern __gshared c_ulong _srelocated; // start address of .relocated section (somewhere within SRAM) extern(C) extern __gshared c_ulong _erelocated; // end address of .relocated section (somewhere within SRAM) extern(C) extern __gshared c_ulong _szeroed; // start address of .zeroed section (somewhere within SRAM or CCMRAM) extern(C) extern __gshared c_ulong _ezeroed; // end address of .zeroed section (somewhere within SRAM or CCMRAM) // Create a convenience alias for our vector functions: //alias extern(C) const void function() VectorFunc; // currently, this won't work for me alias extern(C) const void *VectorFunc; // so I'm using a void* instead. BootRAM = 0xF108F85F; @rst extern(C) void Reset_Handler(); @exc extern(C) void NMI_Handler(); @exc extern(C) void HardFault_Handler(); @exc extern(C) void MemManage_Handler(); @exc extern(C) void BusFault_Handler(); @exc extern(C) void UsageFault_Handler(); @exc extern(C) void SVC_Handler(); @exc extern(C) void DebugMon_Handler(); @exc extern(C) void PendSV_Handler(); @exc extern(C) void SysTick_Handler(); @exc extern(C) void WWDG_IRQHandler(); @exc extern(C) void PVD_IRQHandler(); @exc extern(C) void TAMPER_STAMP_IRQHandler(); @exc extern(C) void RTC_WKUP_IRQHandler(); @exc extern(C) void FLASH_IRQHandler(); @exc extern(C) void RCC_IRQHandler(); @exc extern(C) void EXTI0_IRQHandler(); @exc extern(C) void EXTI1_IRQHandler(); @exc extern(C) void EXTI2_IRQHandler(); @exc extern(C) void EXTI3_IRQHandler(); @exc extern(C) void EXTI4_IRQHandler(); @exc extern(C) void DMA1_Channel1_IRQHandler(); @exc extern(C) void DMA1_Channel2_IRQHandler(); @exc extern(C) void DMA1_Channel3_IRQHandler(); @exc extern(C) void DMA1_Channel4_IRQHandler(); @exc extern(C) void DMA1_Channel5_IRQHandler(); @exc extern(C) void DMA1_Channel6_IRQHandler(); @exc extern(C) void DMA1_Channel7_IRQHandler(); @exc extern(C) void ADC1_IRQHandler(); @exc extern(C) void USB_HP_IRQHandler(); @exc extern(C) void USB_LP_IRQHandler(); @exc extern(C) void DAC_IRQHandler(); @exc extern(C) void COMP_IRQHandler(); @exc extern(C) void EXTI9_5_IRQHandler(); @exc extern(C) void LCD_IRQHandler(); @exc extern(C) void TIM9_IRQHandler(); @exc extern(C) void TIM10_IRQHandler(); @exc extern(C) void TIM11_IRQHandler(); @exc extern(C) void TIM2_IRQHandler(); @exc extern(C) void TIM3_IRQHandler(); @exc extern(C) void TIM4_IRQHandler(); @exc extern(C) void I2C1_EV_IRQHandler(); @exc extern(C) void I2C1_ER_IRQHandler(); @exc extern(C) void I2C2_EV_IRQHandler(); @exc extern(C) void I2C2_ER_IRQHandler(); @exc extern(C) void SPI1_IRQHandler(); @exc extern(C) void SPI2_IRQHandler(); @exc extern(C) void USART1_IRQHandler(); @exc extern(C) void USART2_IRQHandler(); @exc extern(C) void USART3_IRQHandler(); @exc extern(C) void EXTI15_10_IRQHandler(); @exc extern(C) void RTC_Alarm_IRQHandler(); @exc extern(C) void USB_FS_WKUP_IRQHandler(); @exc extern(C) void TIM6_IRQHandler(); @exc extern(C) void TIM7_IRQHandler(); @exc extern(C) void SPI3_IRQHandler(); @exc extern(C) void DMA2_Channel1_IRQHandler(); @exc extern(C) void DMA2_Channel2_IRQHandler(); @exc extern(C) void DMA2_Channel3_IRQHandler(); @exc extern(C) void DMA2_Channel4_IRQHandler(); @exc extern(C) void DMA2_Channel5_IRQHandler(); @exc extern(C) void COMP_ACQ_IRQHandler(); @isr_vector VectorFunc[79] g_pfnVectors = [ cast(VectorFunc)&_stack, /* -16 $0000 Initial Stack Pointer */ &Reset_Handler, /* -15 $0004 Reset Vector */ &NMI_Handler, /* -14 $0008 Non Maskable Interrupt Vector */ &HardFault_Handler, /* -13 $000c Hard Fault Vector */ &MemManage_Handler, /* -12 $0010 Memory Protection Unit Fault Vector */ &BusFault_Handler, /* -11 $0014 Bus Fault Vector */ &UsageFault_Handler, /* -10 $0018 Usage Fault Vector */ cast(VectorFunc)0, /* -9 $001c Reserved */ cast(VectorFunc)0, /* -8 $0020 Reserved */ cast(VectorFunc)0, /* -7 $0024 Reserved */ cast(VectorFunc)0, /* -6 $0028 Reserved */ &SVC_Handler, /* -5 $002c SuperVisor Call Vector */ &DebugMon_Handler, /* -4 $0030 Debug Monitor Vector */ cast(VectorFunc)0, /* -3 $0034 Reserved */ &PendSV_Handler, /* -2 $0038 Pending SuperVisor Vector */ &SysTick_Handler, /* -1 $003c System Tick Vector */ &WWDG_IRQHandler, /* 0 $0040 Windowed WatchDog */ &PVD_IRQHandler, /* 1 $0044 PVD through EXTI Line detection */ &TAMPER_STAMP_IRQHandler, /* 2 $0048 TAMPER STAMP */ &RTC_WKUP_IRQHandler, /* 3 $004c RTC Wakeup through the EXTI line */ &FLASH_IRQHandler, /* 4 $0050 FLASH */ &RCC_IRQHandler, /* 5 $0054 Reset and Clock Configuration */ &EXTI0_IRQHandler, /* 6 $0058 External Interrupt Line 0 */ &EXTI1_IRQHandler, /* 7 $005c External Interrupt Line 1 */ &EXTI2_IRQHandler, /* 8 $0060 External Interrupt Line 2 */ &EXTI3_IRQHandler, /* 9 $0064 External Interrupt Line 3 */ &EXTI4_IRQHandler, /* 10 $0068 EXTI Line4 */ &DMA1_Channel1_IRQHandler, /* 11 $006c DMA1 Channel 1 */ &DMA1_Channel2_IRQHandler, /* 12 $0070 DMA1 Channel 2 */ &DMA1_Channel3_IRQHandler, /* 13 $0074 DMA1 Channel 3 */ &DMA1_Channel4_IRQHandler, /* 14 $0078 DMA1 Channel 4 */ &DMA1_Channel5_IRQHandler, /* 15 $007c DMA1 Channel 5 */ &DMA1_Channel6_IRQHandler, /* 16 $0080 DMA1 Channel 6 */ &DMA1_Channel7_IRQHandler, /* 17 $0084 DMA1 Channel 7 */ &ADC1_IRQHandler, /* 18 $0088 ADC1 */ &USB_HP_IRQHandler, /* 19 $008c USB High Priority */ &USB_LP_IRQHandler, /* 20 $0090 USB Low Priority */ &DAC_IRQHandler, /* 21 $0094 DAC */ &COMP_IRQHandler, /* 22 $0098 COMP */ &EXTI9_5_IRQHandler, /* 23 $009c External Line[9:5]s */ &LCD_IRQHandler, /* 24 $00a0 LCD */ &TIM9_IRQHandler, /* 25 $00a4 TIM9 */ &TIM10_IRQHandler, /* 26 $00a8 TIM10 */ &TIM11_IRQHandler, /* 27 $00ac TIM11 */ &TIM2_IRQHandler, /* 28 $00b0 TIM2 */ &TIM3_IRQHandler, /* 29 $00b4 TIM3 */ &TIM4_IRQHandler, /* 30 $00b8 TIM4 */ &I2C1_EV_IRQHandler, /* 31 $00bc I2C1 Event */ &I2C1_ER_IRQHandler, /* 32 $00c0 I2C1 Error */ &I2C2_EV_IRQHandler, /* 33 $00c4 I2C2 Event */ &I2C2_ER_IRQHandler, /* 34 $00c8 I2C2 Error */ &SPI1_IRQHandler, /* 35 $00cc SPI1 */ &SPI2_IRQHandler, /* 36 $00d0 SPI2 */ &USART1_IRQHandler, /* 37 $00d4 USART1 */ &USART2_IRQHandler, /* 38 $00d8 USART2 */ &USART3_IRQHandler, /* 39 $00dc USART3 */ &EXTI15_10_IRQHandler, /* 40 $00e0 External Interrupt Lines[15:10] */ &RTC_Alarm_IRQHandler, /* 41 $00e4 RTC Alarm (A and B) through EXTI Line */ &USB_FS_WKUP_IRQHandler, /* 42 $00e8 USB FS WKUP */ &TIM6_IRQHandler, /* 43 $00ec TIM6 */ &TIM7_IRQHandler, /* 44 $00f0 TIM7 */ cast(VectorFunc)0, /* 45 $00f4 Reserved */ cast(VectorFunc)0, /* 46 $00f8 Reserved */ &SPI3_IRQHandler, /* 47 $00fc SPI3 */ cast(VectorFunc)0, /* 48 $0100 Reserved */ cast(VectorFunc)0, /* 49 $0104 Reserved */ &DMA2_Channel1_IRQHandler, /* 50 $0108 DMA2 Channel 1 */ &DMA2_Channel2_IRQHandler, /* 51 $010c DMA2 Channel 2 */ &DMA2_Channel3_IRQHandler, /* 52 $0110 DMA2 Channel 3 */ &DMA2_Channel4_IRQHandler, /* 53 $0114 DMA2 Channel 4 */ &DMA2_Channel5_IRQHandler, /* 54 $0118 DMA2 Channel 5 */ cast(VectorFunc)0, /* 55 $011c Reserved */ &COMP_ACQ_IRQHandler, /* 56 $0120 COMP ACQ */ cast(VectorFunc)0, /* 57 $0124 Reserved */ cast(VectorFunc)0, /* 58 $0128 Reserved */ cast(VectorFunc)0, /* 59 $012c Reserved */ cast(VectorFunc)0, /* 60 $0130 Reserved */ cast(VectorFunc)0, /* 61 $0134 Reserved */ cast(VectorFunc)BootRAM, /* 62 $0138 */ ]; @weak extern(C) void LowLevelInit(); @weak extern(C) void SystemInit(); @weak extern(C) void __libc_init_array(); @weak extern(C) extern __gshared c_ulong SystemCoreClock; extern(C) void main(); void copyBlock(const(void) *aSource, void *aDestination, void *aDestinationEnd) { const(uint32_t) *s = cast(const(uint32_t) *)aSource; uint32_t *d = cast(uint32_t *)aDestination; uint32_t *e = cast(uint32_t *)aDestinationEnd; while(d < e) { *d++ = *s++; } } void zeroBlock(void *aDestination, void *aDestinationEnd) { uint32_t *d = cast(uint32_t *)aDestination; uint32_t *e = cast(uint32_t *)aDestinationEnd; while(d < e) { *d++ = 0; } } @naked extern(C) void defaultResetHandler() /* we can mark this naked, as it never returns and should never save any registers on the stack */ { uint32_t saveFreq; LowLevelInit(); SystemInit(); saveFreq = SystemCoreClock; copyBlock(&_siccmram, &_sccmram, &_eccmram); copyBlock(&_sirelocated, &_srelocated, &_erelocated); zeroBlock(&_szeroed, &_ezeroed); __libc_init_array(); if(&SystemCoreClock) SystemCoreClock = saveFreq; main(); defaultExceptionHandler(); } @naked extern(C) void defaultExceptionHandler() { while(true) { wfi(); } }
D
/Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/x86_64-apple-macosx/debug/TemplateKit.build/Deprecated.swift.o : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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/TemplateKit.build/Deprecated~partial.swiftmodule : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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/TemplateKit.build/Deprecated~partial.swiftdoc : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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/TemplateKit.build/Deprecated~partial.swiftsourceinfo : /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateData.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateEmbed.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Deprecated.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSource.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataStorage.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/ASTCache.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataRepresentable.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntaxType.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Uppercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Lowercase.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Capitalize.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateTag.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConditional.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateCustom.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateExpression.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Var.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Data/TemplateDataEncoder.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIdentifier.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateByteScanner.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/PlaintextRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/ViewRenderer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateParser.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Pipeline/TemplateSerializer.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/TemplateError.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateIterator.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Contains.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/Exports.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/DateFormat.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateConstant.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Comment.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Print.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Count.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateDataContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/TagContext.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/Tag/Raw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateRaw.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/View.swift /Users/panartem/Developer/Study/Microservices-vapor/TILAppAcronyms/.build/checkouts/template-kit/Sources/TemplateKit/AST/TemplateSyntax.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/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
/* ----------------------------------------------- to compile: ldc2 -O -release -mcpu=native main.d gdc -O3 -o main main.d ----------------------------------------------- */ static immutable n = 10; static immutable iterations = 15; static immutable executions = 30; void main() { import std.stdio; import std.datetime.stopwatch; Points points = readPoints("../points.json"); Point[n] centroids; StopWatch sw; sw.start(); foreach (_; 0 .. executions) run(centroids, points); sw.stop(); writefln("Average Time: %s ms. ", sw.peek.total!"msecs" / executions); foreach (ix, pt; centroids) writefln("%s : %s", ix, pt); } Points readPoints(in string filename) { import std.json; import std.file; import std.algorithm.iteration: map; import std.array : array; return parseJSON(cast(char[])read(filename)) .array() .map!(v => v.array()) .map!(e => Point(e[0].floating, e[1].floating)) .array(); } void run(ref Point[n] centroids, in Points points) { import std.algorithm.iteration : map; import std.array : array; centroids[] = points[0 .. n]; foreach (_; 0 .. iterations) centroids[] = points.cluster(centroids) .map!(average).array()[]; } Points[] cluster(in Points points, in Points centroids) { import std.array : Appender, appender, array; import std.algorithm.iteration: map; Appender!(Points)[Point] clusters; foreach (c; centroids) clusters[c] = appender!(Points)(); foreach (pt; points) clusters[pt.closest(centroids)] ~= pt; return clusters.values() .map!(a => a.data).array(); } pure Point average(in Points pnts) { import std.algorithm.iteration : reduce; return pnts.reduce!"a+b" / pnts.length; } // ----------------------------------------------- alias Points = Point[]; struct Point { double x; double y; pure @nogc double norm() const { import core.math : sqrt; return sqrt(x^^2 + y^^2); } pure @nogc double distance(in Point p) const { return (this - p).norm(); } pure @nogc double squareDistance(in Point p) const { double dx = this.x - p.x; double dy = this.y - p.y; return dy^^2 + dy^^2; } pure @nogc Point opBinary(string op)(in Point pt) const { return mixin( "Point(x " ~op~ " pt.x, y " ~op~ " pt.y)"); } pure @nogc Point opBinary(string op)(in ulong v) const { return mixin( "Point(x " ~op~ " v, y " ~op~ " v)"); } pure @nogc Point closest(in Points choices) const { // import std.algorithm: minElement; // auto dist = &this.distance; // return choices.minElement!dist; size_t minIx; double minDist = double.max; foreach (ix, choice; choices) { double dist = this.squareDistance(choice); if (dist < minDist) { minIx = ix; minDist = dist; } } return choices[minIx]; } } // -----------------------------------------------
D
module primitives; import std.range: chunks; version(WebAssembly){ import opengl.gl4; }else{ import bindbc.opengl; } import core.stdc.math: cos, sin; import core.stdc.stdlib: malloc, free, exit; import core.stdc.stdio: printf; import dvector; import bettercmath; alias Mat4 = Matrix!(float, 4); import gamemath; import globals; @nogc nothrow: enum PI = 3.14159265359f; struct GLLine{ Dvector!float vertices; GLuint shaderProgram; GLuint vbo; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; vertices = [0.0f, 0.0f, 0.0f, 0.0f]; glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); } void set(Point point1, Point point2, Color color){ vertices[0] = float(point1.x); vertices[1] = float(point1.y); vertices[2] = float(point2.x); vertices[3] = float(point2.y); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); glUseProgram(shaderProgram); GLint posAttrib = glGetAttribLocation(shaderProgram, "position"); glEnableVertexAttribArray(posAttrib); auto vertexSize =float.sizeof*2; glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, cast(uint)vertexSize, null); auto pmAtt = glGetUniformLocation(shaderProgram, "projectionMat"); glUniformMatrix4fv(pmAtt, 1, GL_FALSE, ortho.elements.ptr); // set color auto cAtt = glGetUniformLocation(shaderProgram, "ucolor"); glUniform4fv(cAtt, 1, color.ptr); } void draw() { glUseProgram(shaderProgram); glDrawArrays(GL_LINES, 0, 2); glDisableVertexAttribArray(0); glUseProgram(0); } ~this(){ vertices.free(); } } struct GLCircle { Dvector!float vertices; GLuint shaderProgram; GLuint vbo; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; enum numVertices = 1000; float increment = 2.0f * PI / float(numVertices); for (float currAngle = 0.0f; currAngle <= 2.0f * PI; currAngle += increment) { vertices ~= 0.0f; vertices ~= 0.0f; } glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); } void set(int x, int y, float radius, Color color){ enum numVertices = 1000; float increment = 2.0f * PI / float(numVertices); size_t i; for (float currAngle = 0.0f; currAngle <= 2.0f * PI; currAngle += increment) { vertices[i] = radius * cos(currAngle) + float(x); vertices[i+1] = radius * sin(currAngle) + float(y); i += 2; } glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); glUseProgram(shaderProgram); GLint posAttrib = glGetAttribLocation(shaderProgram, "position"); auto vertexSize =float.sizeof*2; glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, cast(uint)vertexSize, null); glEnableVertexAttribArray(posAttrib); auto pmAtt = glGetUniformLocation(shaderProgram, "projectionMat"); glUniformMatrix4fv(pmAtt, 1, GL_FALSE, ortho.elements.ptr); // set color auto cAtt = glGetUniformLocation(shaderProgram, "ucolor"); glUniform4fv(cAtt, 1, color.ptr); } void draw() { glUseProgram(shaderProgram); glDrawArrays(GL_LINE_LOOP, 0, cast(int)vertices.length/2); glDisableVertexAttribArray(0); glUseProgram(0); } ~this(){ vertices.free(); } } struct GLSolidCircle { Dvector!float vertices; GLuint shaderProgram; GLuint vbo; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; enum quality = 0.125; int triangleAmount = cast(int)(SCREEN_WIDTH * quality); foreach(i; 0..triangleAmount) { vertices ~= 0; vertices ~= 0; } glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STREAM_DRAW); } void set(int x, int y, float radius, Color color){ enum quality = 0.125; int triangleAmount = cast(int)(SCREEN_WIDTH * quality); int i; foreach(ref c; chunks(vertices[], 2)) { c[0] = x + (radius * cos(i * 2*PI / float(triangleAmount))); c[1] = y + (radius * sin(i * 2*PI / float(triangleAmount))); ++i; } glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STREAM_DRAW); glUseProgram(shaderProgram); GLint posAttrib = glGetAttribLocation(shaderProgram, "position"); glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, uint(0), null); glEnableVertexAttribArray(posAttrib); auto pmAtt = glGetUniformLocation(shaderProgram, "projectionMat"); glUniformMatrix4fv(pmAtt, 1, GL_FALSE, ortho.elements.ptr); // set color auto cAtt = glGetUniformLocation(shaderProgram, "ucolor"); glUniform4fv(cAtt, 1, color.ptr); } void draw() { glUseProgram(shaderProgram); glDrawArrays(GL_TRIANGLE_FAN, 0, cast(int)vertices.length/2); glDisableVertexAttribArray(0); glUseProgram(0); } ~this(){ vertices.free(); } } struct GLPoly { Dvector!float vertices; GLuint shaderProgram; GLuint vbo; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; //foreach(i; 0 .. triangles.length / 3){ vertices ~= 0; vertices ~= 0; vertices ~= 0; vertices ~= 0; vertices ~= 0; vertices ~= 0; //} glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); } void set(Color color){ vertices.free; foreach(i; 0 .. triangles.length / 3){ vertices ~= float(rail[triangles[i*3]].x); vertices ~= float(rail[triangles[i*3]].y); vertices ~= float(rail[triangles[i*3 + 1]].x); vertices ~= float(rail[triangles[i*3 + 1]].y); vertices ~= float(rail[triangles[i*3 + 2]].x); vertices ~= float(rail[triangles[i*3 + 2]].y); } glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); glUseProgram(shaderProgram); GLint posAttrib = glGetAttribLocation(shaderProgram, "position"); glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, uint(0), null); glEnableVertexAttribArray(posAttrib); auto pmAtt = glGetUniformLocation(shaderProgram, "projectionMat"); glUniformMatrix4fv(pmAtt, 1, GL_FALSE, ortho.elements.ptr); // set color auto cAtt = glGetUniformLocation(shaderProgram, "ucolor"); glUniform4fv(cAtt, 1, color.ptr); } void draw() { glUseProgram(shaderProgram); glDrawArrays(GL_TRIANGLES, 0, cast(int)vertices.length/2); glDisableVertexAttribArray(0); glUseProgram(0); } ~this(){ vertices.free; } } struct GLRect { Dvector!float vertices; GLuint shaderProgram; GLuint vbo; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; vertices = [ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f ]; glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); } void set(Rect r, Color color){ vertices ~= r.x; vertices ~= r.y; vertices ~= r.x + r.w; vertices ~= r.y; vertices ~= r.x; vertices ~= r.y+r.h; vertices ~= r.x+r.w; vertices ~= r.y; vertices ~= r.x+r.w; vertices ~= r.y+r.h; vertices ~= r.x; vertices ~= r.y+r.h; glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STATIC_DRAW); glUseProgram(shaderProgram); GLint posAttrib = glGetAttribLocation(shaderProgram, "position"); glEnableVertexAttribArray(posAttrib); glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, uint(0), null); auto pmAtt = glGetUniformLocation(shaderProgram, "projectionMat"); glUniformMatrix4fv(pmAtt, 1, GL_FALSE, ortho.elements.ptr); // set color auto cAtt = glGetUniformLocation(shaderProgram, "ucolor"); glUniform4fv(cAtt, 1, color.ptr); } void draw() { glUseProgram(shaderProgram); glDrawArrays(GL_TRIANGLES, 0, cast(int)vertices.length/2); vertices.free(); glDisableVertexAttribArray(0); glUseProgram(0); } } struct GLTexturedRect { GLuint shaderProgram; GLuint vao = 0; GLuint vbo = 0; GLuint textureId; float[24] vertices; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; glGenVertexArrays(1, &vao); glGenBuffers(1, &vbo); } void set(Rect r, GLuint textureId, float angle){ this.textureId = textureId; vertices = [ r.x, r.y+r.h, 0.0f, 1.0f, r.x+r.w, r.y, 1.0f, 0.0f, r.x, r.y, 0.0f, 0.0f, r.x, r.y+r.h, 0.0f, 1.0f, r.x+r.w, r.y+r.h, 1.0f, 1.0f, r.x+r.w, r.y, 1.0f, 0.0f ]; alias Transform3D = Transform!(float, 3); alias Vec3 = Vector!(float, 3); auto zeroTranslation = Vec3(-r.x - r.w*0.5, -r.y - r.h*0.5); auto model = Transform3D() .translate(zeroTranslation) .rotateZ(angle) .translate(-zeroTranslation); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices.ptr, GL_STATIC_DRAW); glBindVertexArray(vao); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * float.sizeof, cast(void*)0); glBindBuffer(GL_ARRAY_BUFFER, 0); glUseProgram(shaderProgram); glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "projectionMat"), 1, GL_FALSE, ortho.elements.ptr); glUniform1i(glGetUniformLocation(shaderProgram, "userTexture"), 0); glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "modelMat"), 1, GL_FALSE, model.elements.ptr); glBindVertexArray(0); } void draw(){ glBindTexture(GL_TEXTURE_2D, textureId); glBindVertexArray(vao); glDrawArrays(GL_TRIANGLES, 0, 6); glBindVertexArray(0); } } struct GLText { GLuint shaderProgram; GLuint vao = 0; GLuint vbo = 0; GLuint textureId; float[24] vertices; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; glGenVertexArrays(1, &vao); glGenBuffers(1, &vbo); } void set(Rect r, GLuint textureId, float angle){ this.textureId = textureId; vertices = [ r.x, r.y+r.h, 0.0f, 1.0f, r.x+r.w, r.y, 1.0f, 0.0f, r.x, r.y, 0.0f, 0.0f, r.x, r.y+r.h, 0.0f, 1.0f, r.x+r.w, r.y+r.h, 1.0f, 1.0f, r.x+r.w, r.y, 1.0f, 0.0f ]; alias Transform3D = Transform!(float, 3); alias Vec3 = Vector!(float, 3); auto zeroTranslation = Vec3(-r.x - r.w*0.5, -r.y - r.h*0.5); auto model = Transform3D() .translate(zeroTranslation) .rotateZ(angle) .translate(-zeroTranslation); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices.ptr, GL_STATIC_DRAW); glBindVertexArray(vao); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * float.sizeof, cast(void*)0); glBindBuffer(GL_ARRAY_BUFFER, 0); glUseProgram(shaderProgram); glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "projectionMat"), 1, GL_FALSE, ortho.elements.ptr); glUniform1i(glGetUniformLocation(shaderProgram, "userTexture"), 0); glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "modelMat"), 1, GL_FALSE, model.elements.ptr); glBindVertexArray(0); } void draw(){ glBindTexture(GL_TEXTURE_2D, textureId); glBindVertexArray(vao); glDrawArrays(GL_TRIANGLES, 0, 6); glBindVertexArray(0); } } /+ struct GLTexturedCircle { Dvector!float vertices; Dvector!float texcoords; uint[6] indices; GLuint shaderProgram; GLuint vao = 0; GLuint vbo = 0; GLuint tbo = 0; GLuint eao = 0; GLuint textureId; @nogc nothrow: this(GLuint shaderProgram){ this.shaderProgram = shaderProgram; glGenBuffers(1, &vbo); glGenBuffers(1, &tbo); glGenBuffers(1, &eao); glGenVertexArrays(1, &vao); enum quality = 0.125; int triangleAmount = cast(int)(SCREEN_WIDTH * quality); vertices ~= 0; vertices ~= 0; foreach(i; 0..triangleAmount) { vertices ~= 0; vertices ~= 0; texcoords ~= 0; texcoords ~= 0; } glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STREAM_DRAW); } void set(int x, int y, float radius, GLuint textureId){ this.textureId = textureId; indices = [ 0, 1, 3, // first triangle 1, 2, 3 // second triangle ]; enum quality = 0.125; int triangleAmount = cast(int)(SCREEN_WIDTH * quality); int i; foreach(ref c; chunks(vertices[], 2)) { c[0] = x + (radius * cos(i * 2*PI / float(triangleAmount))); c[1] = y + (radius * sin(i * 2*PI / float(triangleAmount))); texcoords[2*i] = (c[0]/radius + 1)*0.5; texcoords[2*i+1] = (c[1]/radius + 1)*0.5; ++i; } glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, vertices.length * float.sizeof, vertices[].ptr, GL_STREAM_DRAW); glBindBuffer(GL_ARRAY_BUFFER, tbo); glBufferData(GL_ARRAY_BUFFER, texcoords.length * float.sizeof * 2, texcoords[].ptr, GL_STATIC_DRAW); glUseProgram(shaderProgram); /* glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, eao); glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.length * uint.sizeof * 3, indices.ptr, GL_STATIC_DRAW); glBindVertexArray(vao); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, eao); */ glEnableVertexAttribArray(VertexAttrib.Vertices); glBindBuffer(GL_ARRAY_BUFFER, vbo); glVertexAttribPointer(VertexAttrib.Vertices, 2, GL_FLOAT, GL_FALSE, 0, null); glEnableVertexAttribArray(VertexAttrib.Texcoords); glBindBuffer(GL_ARRAY_BUFFER, tbo); glVertexAttribPointer(VertexAttrib.Texcoords, 2, GL_FLOAT, GL_FALSE, 0, null); GLint posAttrib = glGetAttribLocation(shaderProgram, "position"); glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, uint(0), null); glEnableVertexAttribArray(posAttrib); auto pmAtt = glGetUniformLocation(shaderProgram, "projectionMat"); glUniformMatrix4fv(pmAtt, 1, GL_FALSE, ortho.elements.ptr); } void draw() { glBindVertexArray(vao); glBindTexture(GL_TEXTURE_2D, textureId); glDrawArrays(GL_TRIANGLE_FAN, 0, cast(int)vertices.length/2); //glDisableVertexAttribArray(0); glUseProgram(0); } ~this(){ vertices.free(); } } +/ /+ Shaders +/ GLuint initShader(const char* vShader, const char* fShader, const char* outputAttributeName) { struct Shader { GLenum type; const char* source; } Shader[2] shaders = [ Shader(GL_VERTEX_SHADER, vShader), Shader(GL_FRAGMENT_SHADER, fShader) ]; GLuint program = glCreateProgram(); for ( int i = 0; i < 2; ++i ) { Shader s = shaders[i]; GLuint shader = glCreateShader( s.type ); glShaderSource( shader, 1, &s.source, null ); glCompileShader( shader ); GLint compiled; glGetShaderiv( shader, GL_COMPILE_STATUS, &compiled ); if ( !compiled ) { printf(" failed to compile: "); GLint logSize; glGetShaderiv( shader, GL_INFO_LOG_LENGTH, &logSize ); char* logMsg = cast(char*)malloc(char.sizeof*logSize); glGetShaderInfoLog( shader, logSize, null, logMsg ); printf("%s \n", logMsg); free(logMsg); exit( -1 ); } glAttachShader( program, shader ); } /* link and error check */ glLinkProgram(program); GLint linked; glGetProgramiv( program, GL_LINK_STATUS, &linked ); if ( !linked ) { printf("Shader program failed to link"); GLint logSize; glGetProgramiv( program, GL_INFO_LOG_LENGTH, &logSize); char* logMsg = cast(char*)malloc(char.sizeof*logSize); glGetProgramInfoLog( program, logSize, null, logMsg ); printf("%s \n", logMsg); free(logMsg); exit( -1 ); } /* use program object */ glUseProgram(program); return program; } version(WebAssembly){ enum verth = "#version 300 es\n "; enum fragh = "#version 300 es\n precision mediump float;\n "; }else{ enum verth = "#version 410 core\n "; enum fragh = "#version 410 core\n"; } GLuint loadShaderHero(){ enum vert = verth ~ q{ layout (location = 0) in vec4 position; uniform mat4 projectionMat; void main() { gl_Position = projectionMat * vec4(position.xyz, 1.0); } }; enum frag = fragh ~ ` uniform vec4 ucolor; out vec4 FragColor; void main() { FragColor = ucolor; } `; return initShader(vert, frag, "ucolor"); } GLuint loadShaderEnemy(){ enum vert = verth ~ ` layout (location = 0) in vec4 position; uniform mat4 projectionMat; void main() { gl_Position = projectionMat * vec4(position.xyz, 1.0); } `; enum frag = fragh ~ ` uniform vec4 ucolor; out vec4 FragColor; void main() { FragColor = ucolor; } `; return initShader(vert, frag, "fragColor"); } GLuint loadShaderPoly(){ enum vert = verth ~ q{ layout (location = 0) in vec4 position; uniform mat4 projectionMat; void main() { gl_Position = projectionMat * vec4(position.xyz, 1.0); } }; enum frag = fragh ~ ` uniform vec4 ucolor; out vec4 FragColor; void main() { FragColor = ucolor; } `; return initShader(vert, frag, "fragColor"); } GLuint loadShaderGreen(){ enum vert = verth ~ q{ layout (location = 0) in vec4 position; uniform mat4 projectionMat; void main() { gl_Position = projectionMat * vec4(position.xyz, 1.0); } }; enum frag = fragh ~ ` uniform vec4 ucolor; out vec4 FragColor; void main() { FragColor = ucolor; } `; return initShader(vert, frag, "fragColor"); } GLuint loadShaderRed(){ enum vert = verth ~ q{ layout (location = 0) in vec4 position; uniform mat4 projectionMat; void main() { gl_Position = projectionMat * vec4(position.xyz, 1.0); } }; enum frag = fragh ~ ` uniform vec4 ucolor; out vec4 FragColor; void main() { FragColor = ucolor; } `; return initShader(vert, frag, "fragColor"); } GLuint loadShaderFG(){ enum vert = verth ~ q{ layout (location = 0) in vec4 aPos; layout (location = 1) in vec2 aTexCoord; out vec2 TexCoord; uniform mat4 projectionMat; uniform mat4 modelMat; void main() { gl_Position = projectionMat * modelMat * vec4(aPos.xy, 0.0, 1.0); TexCoord = aTexCoord; } }; enum frag = fragh ~ ` in vec2 TexCoord; out vec4 FragColor; uniform sampler2D userTexture; void main() { FragColor = texture(userTexture, TexCoord.xy); } `; return initShader(vert, frag, "fragColor"); } GLuint loadShaderEn(){ enum vert = verth ~ q{ layout (location = 0) in vec4 vertex; out vec2 TexCoords; uniform mat4 projectionMat; uniform mat4 modelMat; void main() { TexCoords = vertex.zw; gl_Position = projectionMat * modelMat * vec4(vertex.xy, 0.0, 1.0); } }; enum frag = fragh ~ ` in vec2 TexCoords; out vec4 FragColor; uniform sampler2D userTexture; void main() { FragColor = texture(userTexture, TexCoords.xy); } `; return initShader(vert, frag, "fragColor"); } GLuint loadShaderText(){ enum vert = verth ~ q{ layout (location = 0) in vec4 vertex; out vec2 TexCoords; uniform mat4 projectionMat; uniform mat4 modelMat; void main() { TexCoords = vertex.zw; gl_Position = projectionMat * modelMat * vec4(vertex.xy, 0.0, 1.0); } }; enum frag = fragh ~ ` in vec2 TexCoords; out vec4 FragColor; uniform sampler2D userTexture; void main() { FragColor = texture(userTexture, TexCoords.xy); } `; return initShader(vert, frag, "fragColor"); }
D
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module dwtx.jface.text.rules.RuleBasedDamagerRepairer; import dwtx.jface.text.rules.FastPartitioner; // packageimport import dwtx.jface.text.rules.ITokenScanner; // packageimport import dwtx.jface.text.rules.Token; // packageimport import dwtx.jface.text.rules.RuleBasedScanner; // packageimport import dwtx.jface.text.rules.EndOfLineRule; // packageimport import dwtx.jface.text.rules.WordRule; // packageimport import dwtx.jface.text.rules.WhitespaceRule; // packageimport import dwtx.jface.text.rules.WordPatternRule; // packageimport import dwtx.jface.text.rules.IPredicateRule; // packageimport import dwtx.jface.text.rules.DefaultPartitioner; // packageimport import dwtx.jface.text.rules.NumberRule; // packageimport import dwtx.jface.text.rules.SingleLineRule; // packageimport import dwtx.jface.text.rules.PatternRule; // packageimport import dwtx.jface.text.rules.ICharacterScanner; // packageimport import dwtx.jface.text.rules.IRule; // packageimport import dwtx.jface.text.rules.DefaultDamagerRepairer; // packageimport import dwtx.jface.text.rules.IToken; // packageimport import dwtx.jface.text.rules.IPartitionTokenScanner; // packageimport import dwtx.jface.text.rules.MultiLineRule; // packageimport import dwtx.jface.text.rules.RuleBasedPartitioner; // packageimport import dwtx.jface.text.rules.RuleBasedPartitionScanner; // packageimport import dwtx.jface.text.rules.BufferedRuleBasedScanner; // packageimport import dwtx.jface.text.rules.IWhitespaceDetector; // packageimport import dwt.dwthelper.utils; import dwtx.jface.text.TextAttribute; /** * @deprecated use <code>DefaultDamagerRepairer</code> */ public class RuleBasedDamagerRepairer : DefaultDamagerRepairer { /** * Creates a damager/repairer that uses the given scanner and returns the given default * text attribute if the current token does not carry a text attribute. * * @param scanner the rule based scanner to be used * @param defaultTextAttribute the text attribute to be returned if none is specified by the current token, * may not be <code>null</code> * * @deprecated use RuleBasedDamagerRepairer(RuleBasedScanner) instead */ public this(RuleBasedScanner scanner, TextAttribute defaultTextAttribute) { super(scanner, defaultTextAttribute); } /** * Creates a damager/repairer that uses the given scanner. The scanner may not be <code>null</code> * and is assumed to return only token that carry text attributes. * * @param scanner the rule based scanner to be used, may not be <code>null</code> * @since 2.0 */ public this(RuleBasedScanner scanner) { super(scanner); } }
D
/Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactiveSwift.build/Objects-normal/x86_64/Event.o : /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Atomic.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Disposable.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Lifetime.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Reactive.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Bag.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/UnidirectionalBinding.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Signal.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Optional.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Flatten.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Action.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/SignalProducer.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/EventLogger.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Scheduler.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Observer.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/UninhabitedTypeGuards.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Deprecations+Removals.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/FoundationExtensions.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/ResultExtensions.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Event.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Property.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/ValidatingProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Products/Debug-iphonesimulator/Result/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/Target\ Support\ Files/ReactiveSwift/ReactiveSwift-umbrella.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/Target\ Support\ Files/Result/Result-umbrella.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Products/Debug-iphonesimulator/Result/Result.framework/Headers/Result-Swift.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactiveSwift.build/unextended-module.modulemap /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Result.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactiveSwift.build/Objects-normal/x86_64/Event~partial.swiftmodule : /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Atomic.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Disposable.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Lifetime.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Reactive.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Bag.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/UnidirectionalBinding.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Signal.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Optional.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Flatten.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Action.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/SignalProducer.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/EventLogger.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Scheduler.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Observer.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/UninhabitedTypeGuards.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Deprecations+Removals.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/FoundationExtensions.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/ResultExtensions.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Event.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Property.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/ValidatingProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Products/Debug-iphonesimulator/Result/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/Target\ Support\ Files/ReactiveSwift/ReactiveSwift-umbrella.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/Target\ Support\ Files/Result/Result-umbrella.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Products/Debug-iphonesimulator/Result/Result.framework/Headers/Result-Swift.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactiveSwift.build/unextended-module.modulemap /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Result.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactiveSwift.build/Objects-normal/x86_64/Event~partial.swiftdoc : /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Atomic.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Disposable.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Lifetime.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Reactive.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Bag.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/UnidirectionalBinding.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Signal.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Optional.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Flatten.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Action.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/SignalProducer.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/EventLogger.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Scheduler.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Observer.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/UninhabitedTypeGuards.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Deprecations+Removals.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/FoundationExtensions.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/ResultExtensions.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Event.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/Property.swift /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/ReactiveSwift/Sources/ValidatingProperty.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotesc /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Products/Debug-iphonesimulator/Result/Result.framework/Modules/Result.swiftmodule/x86_64.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreImage.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/QuartzCore.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Metal.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/UIKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/SwiftOnoneSupport.swiftmodule /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/Target\ Support\ Files/ReactiveSwift/ReactiveSwift-umbrella.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/Pods/Target\ Support\ Files/Result/Result-umbrella.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Products/Debug-iphonesimulator/Result/Result.framework/Headers/Result-Swift.h /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactiveSwift.build/unextended-module.modulemap /Users/linjianguo/Desktop/ReactiveCoCoDemo/DerivedData/ReactiveCoCoDemo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Result.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/OpenGLES.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
<?xml version="1.0" encoding="ASCII" standalone="no"?> <di:SashWindowsMngr xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0"> <pageList> <availablePage> <emfPageIdentifier href="VAR_1_agm-6672268734.notation#_copSALmGEeKQQp7P9cQvNQ"/> </availablePage> </pageList> <sashModel currentSelection="//@sashModel/@windows.0/@children.0"> <windows> <children xsi:type="di:TabFolder"> <children> <emfPageIdentifier href="VAR_1_agm-6672268734.notation#_copSALmGEeKQQp7P9cQvNQ"/> </children> </children> </windows> </sashModel> </di:SashWindowsMngr>
D
position 90 in a countable series of things the ordinal number of ninety in counting order
D
/* * $Id: sound.d,v 1.2 2006/12/04 16:04:27 kenta Exp $ * * Copyright 2006 Kenta Cho. Some rights reserved. */ module src.util.sdl.sound; private import std.string; private import core.stdc.string; private import derelict.sdl.sdl; private import derelict.sdl.mixer; private import src.util.sdl.sdlexception; string fromStringz(char* str) { return (str[0..strlen(str)]).idup; } /** * Initialize and close SDL_mixer. */ public class Sound { public: static bool noSound = false; static int bgmVol = 100; static int seVol = 100; private: public static void init() { if (noSound) return; //derelict specific DerelictSDLMixer.load(); int audio_rate; Uint16 audio_format; int audio_channels; int audio_buffers; if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { noSound = true; throw new SDLInitFailedException ("Unable to initialize SDL_AUDIO: " ~ fromStringz(SDL_GetError())); } audio_rate = 44100; audio_format = AUDIO_S16; audio_channels = 1; audio_buffers = 4096; if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0) { noSound = true; throw new SDLInitFailedException ("Couldn't open audio: " ~ fromStringz(SDL_GetError())); } Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); Mix_VolumeMusic(bgmVol); Mix_Volume(-1, seVol); } public static void close() { if (noSound) return; if (Mix_PlayingMusic()) Mix_HaltMusic(); Mix_CloseAudio(); } } /** * Music. */ public class Music { public: static int fadeOutSpeed = 1280; static string dir = "sounds/musics"; private: Mix_Music* music; public void load(string name) { if (Sound.noSound) return; string fileName = dir ~ "/" ~ name; music = Mix_LoadMUS(toStringz(fileName)); if (!music) { Sound.noSound = true; throw new SDLException("Couldn't load: " ~ fileName ~ " (" ~ fromStringz(Mix_GetError()) ~ ")"); } } public void free() { if (music) { halt(); Mix_FreeMusic(music); } } public void play() { if (Sound.noSound) return; Mix_PlayMusic(music, -1); } public void playOnce() { if (Sound.noSound) return; Mix_PlayMusic(music, 1); } public static void fade() { if (Sound.noSound) return; Mix_FadeOutMusic(fadeOutSpeed); } public static void halt() { if (Sound.noSound) return; if (Mix_PlayingMusic()) Mix_HaltMusic(); } } /** * Sound chunk. */ public class Chunk { public: static string dir = "sounds/chunks"; private: Mix_Chunk* chunk; int chunkChannel; public void load(string name, int ch) { if (Sound.noSound) return; string fileName = dir ~ "/" ~ name; chunk = Mix_LoadWAV(fileName); if (!chunk) { Sound.noSound = true; throw new SDLException("Couldn't load: " ~ fileName ~ " (" ~ fromStringz(Mix_GetError()) ~ ")"); } chunkChannel = ch; } public void free() { if (chunk) { halt(); Mix_FreeChunk(chunk); } } public void play() { if (Sound.noSound) return; Mix_PlayChannel(chunkChannel, chunk, 0); } public void halt() { if (Sound.noSound) return; Mix_HaltChannel(chunkChannel); } }
D
// ************************** // AIVAR-Kennungen für Humans // ************************** // ------ NEWS und MEMORY Aivars ------ // - NUR Augenzeugen // - NUR persönliches News-Gedächtnis, geregelt über die folgenden Aivars // - schwere Tat überschreibt leichte Tat // - KEINE automatische News-Verbreitung, AIV-Check bei aNSCs in Dialogen = Ersatz für News-Verbreitung // - News-Vergabe über Dialog-Module const int AIV_LastFightAgainstPlayer = 0; const int FIGHT_NONE = 0; const int FIGHT_LOST = 1; //in ZS_Unconscious const int FIGHT_WON = 2; //in ZS_Unconscious (player) const int FIGHT_CANCEL = 3; //in B_Attack, wenn other = Player const int AIV_NpcSawPlayerCommit = 1; const int CRIME_NONE = 0; const int CRIME_SHEEPKILLER = 1; const int CRIME_ATTACK = 2; //Kampf self-SC --> feinere Analys in DIA-Modul über AIV_LastFightAgainstPlayer const int CRIME_THEFT = 3; const int CRIME_MURDER = 4; const int AIV_NpcSawPlayerCommitDay = 2; // ------ B_AssessTalk ------------------------- const int AIV_NpcStartedTalk = 3; //wenn der NSC mit Important Info den SC anquatscht // ------ ZS_Talk ------------------------------ const int AIV_INVINCIBLE = 4; //ist TRUE für beide Teilnehmer eines Dialogs const int AIV_TalkedToPlayer = 5; // ------ Pickpocket --------------------------- const int AIV_PlayerHasPickedMyPocket = 6; // ------ ZS_Attack ---------------------------- const int AIV_LASTTARGET = 7; //damit other erhalten bleibt const int AIV_PursuitEnd = 8; //wenn Verfolgung abgebrochen // ------ B_SayAttackReason -------------------- const int AIV_ATTACKREASON = 9; //Grund des Angriffs - Reihenfolge PRIORISIERT const int AR_NONE = 0; const int AR_LeftPortalRoom = 1; //Spieler hat (unbefugten) Portalraum verlassen const int AR_ClearRoom = 2; //Spieler ist unbefugt in meinem Raum const int AR_GuardCalledToRoom = 3; const int AR_MonsterVsHuman = 4; //Monster kämpft gegen Human - ich helfe Human const int AR_MonsterMurderedHuman = 5; //Monster hat Human getötet const int AR_SheepKiller = 6; //Schaf wurde angegriffen oder getötet (von Mensch oder Monster) const int AR_Theft = 7; //Spieler hat Item geklaut const int AR_UseMob = 8; //Spieler hat an Mob mit Besitzflag rumgefummelt (kann JEDES Mob sein) const int AR_GuardCalledToThief = 9; const int AR_ReactToWeapon = 10; //Täter hat trotz zweimaliger Warnung Waffe nicht weggesteckt ODER ich fliehe direkt const int AR_ReactToDamage = 11; //Täter hat mich verletzt const int AR_GuardStopsFight = 12; //Wache beendet Kampf, greift Täter an const int AR_GuardCalledToKill = 13; //Wache durch WARN zum Mit-Töten gerufen const int AR_GuildEnemy = 14; //Gilden-Feind = Mensch oder Monster const int AR_HumanMurderedHuman = 15; //other hat gemordet const int AR_MonsterCloseToGate = 16; //GateGuards halten nicht-feindliches Monster auf const int AR_GuardStopsIntruder = 17; //GateGuards attackieren Eindringling const int AR_SuddenEnemyInferno = 18; //EnemyOverride Blockierung für mich selbst und alle NPCs im Umkreis aufheben. const int AR_KILL = 19; //Spieler aus Dialog heraus töten (SC hat keine Chance) // ------ ZS_RansackBody ------------------------ const int AIV_RANSACKED = 10; //damit nur EIN NSC einen Body plündert // ------ ZS_Dead ------------------------------- const int AIV_DeathInvGiven = 11; // Für Mensch und Monster! // ------ TA_GuardPassage ----------------------- const int AIV_Guardpassage_Status = 12; // Enthält den Status einer Durchgangswache const int GP_NONE = 0; // ...Anfang; SC noch nicht in der Nähe const int GP_FirstWarnGiven = 1; // ...nach der ersten Warnung an den SC const int GP_SecondWarnGiven = 2; // ...nach der zweiten Warnung an den SC const int AIV_LastDistToWP = 13; // enthält die letzte ermittelte Distanz zum Referenz-Waypoint (Checkpoint) (wird beim SPIELER gesetzt!) const int AIV_PASSGATE = 14; // TRUE = Spieler kann durch, FALSE = Spieler wird aufgehalten // ------ XP-Vergabe ---------------------------- const int AIV_PARTYMEMBER = 15; //für XP-Vergabe, AUCH für Monster const int AIV_VictoryXPGiven = 16; //wenn NSC schonmal besiegt, gibts keine XP mehr für den Spieler (z.B. bei unconscious Humans) // ------ Geschlecht ---------------------------- const int AIV_Gender = 17; //wird zusammen mit Visual über B_SetVisual gesetzt const int MALE = 0; const int FEMALE = 1; // ------ TA_Stand_Eating ----------------------- const int AIV_Food = 18; const int FOOD_Apple = 0; const int FOOD_Cheese = 1; const int FOOD_Bacon = 2; const int FOOD_Bread = 3; // ------ TA Hilfsvariable ----------------------- //notwendig da lokale Hilfsvariablen anscheinend nicht immer neu initialisiert werden bitte nur für TAs verwenden! const int AIV_TAPOSITION = 19; const int ISINPOS = 0; const int NOTINPOS = 1; const int NOTINPOS_WALK = 2; // ------ Finger weg! const int AIV_SelectSpell = 20; // ------ ZS_ObservePlayer --------------------- const int AIV_SeenLeftRoom = 21; //ist Player-aus-Raum-raus-Kommentar schon abgelassen worden? //////////////////////////////////// var int Player_SneakerComment; var int Player_LeftRoomComment; var int Player_DrawWeaponComment; var int Player_GetOutOfMyBedComment; //////////////////////////////////// // ------ ZS_Attack ---------------------------- const int AIV_HitByOtherNpc = 22; //ANDERER GEGNER - zweiter Treffer const int AIV_WaitBeforeAttack = 23; const int AIV_LastAbsolutionLevel = 24; // ---------------------------------------------- const int AIV_ToughGuyNewsOverride = 25; // *************************** // AIVAR-Kennungen für Monster // *************************** const int AIV_MM_ThreatenBeforeAttack = 26; const int AIV_MM_FollowTime = 27; //wie lange verfolgt einen das Monster const int FOLLOWTIME_SHORT = 5; const int FOLLOWTIME_MEDIUM = 10; const int FOLLOWTIME_LONG = 20; const int AIV_MM_FollowInWater = 28; //AUCH für HUMANS! - folgt einem der NSC auch in Wasser? // ---------------------------------------------- const int AIV_MM_PRIORITY = 29; //ist meine Priorität gerade FRESSEN oder KÄMPFEN (immer fressen, es sei denn ich werde getroffen) const int PRIO_EAT = 0; const int PRIO_ATTACK = 1; // ---------------------------------------------- const int AIV_MM_SleepStart = 30; const int AIV_MM_SleepEnd = 31; const int AIV_MM_RestStart = 32; const int AIV_MM_RestEnd = 33; const int AIV_MM_RoamStart = 34; const int AIV_MM_RoamEnd = 35; const int AIV_MM_EatGroundStart = 36; const int AIV_MM_EatGroundEnd = 37; const int AIV_MM_WuselStart = 38; const int AIV_MM_WuselEnd = 39; const int AIV_MM_OrcSitStart = 40; const int AIV_MM_OrcSitEnd = 41; const int OnlyRoutine = -1; // ---------------------------------------------- const int AIV_MM_ShrinkState = 42; //merkt sich das Schrumpf-Stadium des Monsters, wenn es von einem Shrink-Zauber getroffen wird // ---------------------------------------------- const int AIV_MM_REAL_ID = 43; const int ID_MEATBUG = 1; const int ID_SHEEP = 2; const int ID_GOBBO_GREEN = 3; const int ID_GOBBO_BLACK = 4; const int ID_GOBBO_SKELETON = 5; const int ID_SUMMONED_GOBBO_SKELETON = 6; const int ID_SCAVENGER = 7; const int ID_SCAVENGER_DEMON = 8; const int ID_GIANT_RAT = 8; const int ID_GIANT_BUG = 9; const int ID_BLOODFLY = 10; const int ID_WARAN = 11; const int ID_FIREWARAN = 12; const int ID_WOLF = 13; const int ID_WARG = 14; const int ID_SUMMONED_WOLF = 15; const int ID_MINECRAWLER = 16; const int ID_MINECRAWLERWARRIOR = 17; const int ID_LURKER = 18; const int ID_SKELETON = 19; const int ID_SUMMONED_SKELETON = 20; const int ID_SKELETON_MAGE = 21; const int ID_ZOMBIE = 22; const int ID_SNAPPER = 23; const int ID_DRAGONSNAPPER = 24; const int ID_SHADOWBEAST = 25; const int ID_SHADOWBEAST_SKELETON = 26; const int ID_HARPY = 27; const int ID_STONEGOLEM = 28; const int ID_FIREGOLEM = 29; const int ID_ICEGOLEM = 30; const int ID_SUMMONED_GOLEM = 31; const int ID_DEMON = 32; const int ID_SUMMONED_DEMON = 33; const int ID_DEMON_LORD = 34; const int ID_TROLL = 35; const int ID_TROLL_BLACK = 36; const int ID_SWAMPSHARK = 37; const int ID_DRAGON_FIRE = 38; const int ID_DRAGON_ICE = 39; const int ID_DRAGON_ROCK = 40; const int ID_DRAGON_SWAMP = 41; const int ID_DRAGON_UNDEAD = 42; const int ID_MOLERAT = 43; const int ID_ORCWARRIOR = 44; const int ID_ORCSHAMAN = 45; const int ID_ORCELITE = 46; const int ID_UNDEADORCWARRIOR = 47; const int ID_DRACONIAN = 48; const int ID_WISP = 49; //----- Addon ------ const int ID_Alligator = 50; const int ID_Swampgolem = 51; const int ID_Stoneguardian = 52; const int ID_Gargoyle = 53; const int ID_Bloodhound = 54; const int ID_Icewolf = 55; const int ID_OrcBiter = 56; const int ID_Razor = 57; const int ID_Swarm = 58; const int ID_Swamprat = 59; const int ID_BLATTCRAWLER = 60; const int ID_SummonedGuardian = 61; const int ID_SummonedZombie = 62; const int ID_Keiler = 63; const int ID_SWAMPDRONE = 64; // ---------------------------------------------- const int AIV_LASTBODY = 44; //der Body, an dem ich zuletzt gefressen habe // ********************** // Weitere Human - AIVARs // ********************** // ------ Petzen -------------------------------- const int AIV_ArenaFight = 45; const int AF_NONE = 0; const int AF_RUNNING = 1; const int AF_AFTER = 2; const int AF_AFTER_PLUS_DAMAGE = 3; // ------ zusätzlich zur CRIME merken ----------- const int AIV_CrimeAbsolutionLevel = 46; // ------ ZS_Attack ---------------------------- const int AIV_LastPlayerAR = 47; // ------ ZS_Unconscious ------------------------ const int AIV_DuelLost = 48; // ------ Trade AIV ----------------------------- const int AIV_ChapterInv = 49; // ------ Monster: Rudeltier (reagiert auf WARN) ------ const int AIV_MM_Packhunter = 50; // ------ MAGIE ----- const int AIV_MagicUser = 51; const int MAGIC_NEVER = 0; const int MAGIC_ALWAYS = 1; // ------ C_DropUnconscious ------ const int AIV_DropDeadAndKill = 52; // ------ ZS_MagicFreeze ------ const int AIV_FreezeStateTime = 53; // ------ IGNORE Crime ------ const int AIV_IGNORE_Murder = 54; const int AIV_IGNORE_Theft = 55; const int AIV_IGNORE_Sheepkiller = 56; // ------ ToughGuy IGNORIERT Attack-Crime ------ const int AIV_ToughGuy = 57; //Jubelt beim Kampf, hat keine News bei Attack (kann über AIV_LastFightAgainstPlayer reagieren) // ------ News Override (petzen aber nicht labern) ------ const int AIV_NewsOverride = 58; // ------ ZS_MM_Attack ------ const int AIV_MaxDistToWp = 59; const int AIV_OriginalFightTactic = 60; // ------ B_AssessEnemy ------ const int AIV_EnemyOverride = 61; // ------ für beschworene Monster ------ const int AIV_SummonTime = 62; // ------ ZS_Attack ------ const int AIV_FightDistCancel = 63; const int AIV_LastFightComment = 64; //Hat der NSC den letzten Kampf kommentiert? // ----------------------- const int AIV_LOADGAME = 65; //frag nicht // ------ ZS_Unconscious ------- const int AIV_DefeatedByPlayer = 66; // ------ ZS_Dead ------ const int AIV_KilledByPlayer = 67; // ------ diverse ZS ------- const int AIV_StateTime = 68; //um mit zwei StateTime-Triggern arbeiten zu können. // ------------------------- const int AIV_Dist = 69; const int AIV_IgnoresFakeGuild = 70; const int AIV_NoFightParker = 71; //wird von NSCs weder angegriffen, noch greift er selber welche an. (Archetyp: Gefangener) const int AIV_NPCIsRanger = 72; //Der Typ gehört zum 'Ring des Wassers' const int AIV_IgnoresArmor = 73; //Keine Reaktion oder Konsequenzen auf die Rüstung des SC const int AIV_StoryBandit = 74; //Banditen, mit denen gekämpft werden darf const int AIV_StoryBandit_Esteban = 75; //Estebans Dreigestirn // ------ ZS_Whirlwind -------- const int AIV_WhirlwindStateTime = 76; //added by kairo // ------ ZS_Inflate -------- const int AIV_InflateStateTime = 77; //added by kairo // ------ ZS_Swarm -------- const int AIV_SwarmStateTime = 78; //added by kairo // ------ ZS_SuckEnergy -------- const int AIV_SuckEnergyStateTime = 79; //added by kairo // ------ Party of Pirates ------ const int AIV_FollowDist = 80; // ------ REAL Attributes ------ const int REAL_STRENGTH = 81; const int REAL_DEXTERITY = 82; const int REAL_MANA_MAX = 83; const int REAL_TALENT_1H = 84; const int REAL_TALENT_2H = 85; const int REAL_TALENT_BOW = 86; const int REAL_TALENT_CROSSBOW = 87; const int AIV_SpellLevel = 88; // *************************************************** // Globalvariablen für Petzen/Absolution/News - System // *************************************************** var int ABSOLUTIONLEVEL_OldCamp; var int ABSOLUTIONLEVEL_City; var int ABSOLUTIONLEVEL_Monastery; var int ABSOLUTIONLEVEL_Farm; var int ABSOLUTIONLEVEL_BL;//ADDON var int PETZCOUNTER_OldCamp_Murder; var int PETZCOUNTER_OldCamp_Theft; var int PETZCOUNTER_OldCamp_Attack; var int PETZCOUNTER_OldCamp_Sheepkiller; var int PETZCOUNTER_City_Murder; var int PETZCOUNTER_City_Theft; var int PETZCOUNTER_City_Attack; var int PETZCOUNTER_City_Sheepkiller; var int PETZCOUNTER_Monastery_Murder; var int PETZCOUNTER_Monastery_Theft; var int PETZCOUNTER_Monastery_Attack; var int PETZCOUNTER_Monastery_Sheepkiller; var int PETZCOUNTER_Farm_Murder; var int PETZCOUNTER_Farm_Theft; var int PETZCOUNTER_Farm_Attack; var int PETZCOUNTER_Farm_Sheepkiller; var int PETZCOUNTER_BL_Murder; var int PETZCOUNTER_BL_Theft; var int PETZCOUNTER_BL_Attack; // *************************************************** // Location Konstanten // *************************************************** const int LOC_NONE = 0; const int LOC_OLDCAMP = 1; const int LOC_CITY = 2; const int LOC_MONASTERY = 3; const int LOC_FARM = 4; const int LOC_BL = 5; //Addon Banditenlager const int LOC_ALL = 6; //ALLE Locations // *************************************************** // Stadtviertel Konstanten // *************************************************** const int Q_KASERNE = 1; const int Q_GALGEN = 2; const int Q_MARKT = 3; const int Q_TEMPEL = 4; const int Q_UNTERSTADT = 5; const int Q_HAFEN = 6; const int Q_OBERSTADT = 7; // ****************************** // Aktive Wahrnehmung der MONSTER // ****************************** //--------------------------------------------- const int PERC_DIST_SUMMONED_ACTIVE_MAX = 2000; // Maximale Reichweite der aktiven Wahrnehmung aller beschworenen Monster const int PERC_DIST_MONSTER_ACTIVE_MAX = 1500; // Maximale Reichweite der aktiven Wahrnehmung ALLER anderen Monster const int PERC_DIST_ORC_ACTIVE_MAX = 2500; // const int PERC_DIST_DRAGON_ACTIVE_MAX = 3500; //Damit das Vlippern endlich ein Ende hat //--------------------------------------------- const int FIGHT_DIST_MONSTER_ATTACKRANGE = 700; // Wann greifen Monster an bzw. ab welcher Distanz vertreiben sie dich vom Fressen const int FIGHT_DIST_MONSTER_FLEE = 300; // Ab wann fliehe ich vor einem Feind const int FIGHT_DIST_DRAGON_MAGIC = 700; //--------------------------------------------- const int MONSTER_THREATEN_TIME = 4; // Sekunden, die Monster drohen, bevor sie angreifen (wenn Gegner nicht zu weit und nicht zu nah) const int MONSTER_SUMMON_TIME = 60; /******************************************************************** ** Konstanten für Distanzen ** ** der Menschen-AI ** ********************************************************************/ // -------------------------------------------- const int TA_DIST_SELFWP_MAX = 500; // 500 // -------------------------------------------- const int PERC_DIST_ACTIVE_MAX = 2000; // Maximal-Reichweite der AKTIVEN Wahrnehmungen - angegeben in Npc_Default.d //--------------------------------------------- const int PERC_DIST_INTERMEDIAT = 1000; // Mittlere Passive Wahrnehmung const int PERC_DIST_DIALOG = 500; // Dialogreichweite const int PERC_DIST_HEIGHT = 1000; // ab welchem Höhenunterschied wird Wn ignoriert const int PERC_DIST_INDOOR_HEIGHT = 250; // dasselbe für Indoor (zum Ignorieren von anderen Stockwerken wenn ganzes Haus (Höhlensystem) EIN Portalraum ist) //--------------------------------------------- const int FIGHT_DIST_MELEE = 600; // Bis zu welcher Entfernung Bedrohung durch SC-Waffe const int FIGHT_DIST_RANGED_INNER = 900; // Ab welcher Entfernung NK wählen, wenn NSC im FK ist const int FIGHT_DIST_RANGED_OUTER = 1000; // Ab welcher Entfernung FK wählen, wenn NSC im NK ist oder Waffe zum ersten Mal gezogen wird const int FIGHT_DIST_CANCEL = 3500; // Bis wann hinterherschiessen, ab welcher Distanz Kampf abbrechen ODER Flucht abbrechen //--------------------------------------------- const int WATCHFIGHT_DIST_MIN = 300; const int WATCHFIGHT_DIST_MAX = 2000; //--------------------------------------------- const int ZivilAnquatschDist = 400; // Distanz, ab der dich ein NSC zivil anspricht (Maximum ist PERC_DIST_ACTIVE_MAX --> B_AssessPlayer) //--------------------------------------------- const float RANGED_CHANCE_MINDIST = 1500; // Unterhalb dieser Distanz steigt die Trefferchance linear bis 100% an. (Default sind 10m) const float RANGED_CHANCE_MAXDIST = 4500; // Ab RANGED_CHANCE_MINDIST bis RANGED_CHANCE_MAXDIST sinkt die Trefferchance bis auf 0% ab (default sind 100m) /******************************************************************** ** Zeit-Konstanten * ********************************************************************/ CONST INT NPC_ANGRY_TIME = 120; // MUSS SO HEISSEN, ist vom Programm ausgelagert - Spielsekunden, die die Temp_Att aufrechterhalten wird, bevor sie wieder auf Perm_Att gesetzt wird (gilt für alle At, nicht nur für angry) // ------------------------------------------- const int HAI_TIME_UNCONSCIOUS = 20; // MUSS SO HEISSEN, ist vom Programm ausgelagert (Default = 20) - Zeit in Sekunden, die der SC und NSCs bewußtlos bleiben // ------------------------------------------- const int NPC_TIME_FOLLOW = 10; // Zeit, die sich das Opfer des NSCs maximal in BS_RUN befinden darf, um noch weiter verfolgt zu werden /******************************************************************** ** Mindestschaden ** ********************************************************************/ const int NPC_MINIMAL_DAMAGE = 5; //MUSS SO HEISSEN, ist vom Programm ausgelagert - Untere Genze des Mindestschadens für Menschen (*** und Monster ??? ***) const int NPC_MINIMAL_PERCENT = 10; //MUSS SO HEISSEN, ist vom Programm ausgelagert - Mindestschaden wird ermittelt durch X% vom normalen Gesamtschaden (NACH Abzug der Rüstung), wobei NPC_MINIMAL_DAMAGE genommen wird, falls Mindestschaden NACH %-Berechnung kleiner als NPC_MINIMAL_DAMAGE! /******************************************************************** ** Fight AI-Constanten * ********************************************************************/ const int FAI_HUMAN_COWARD = 2 ; const int FAI_HUMAN_NORMAL = 42 ; const int FAI_HUMAN_STRONG = 3 ; const int FAI_HUMAN_MASTER = 4 ; //----------------------------------------------- const int FAI_MONSTER_COWARD = 10 ; // Spielanfang //----------------------------------------------- const int FAI_NAILED = 1 ; //----------------------------------------------- const int FAI_GOBBO = 7 ; // Green Goblin / Black Goblin const int FAI_SCAVENGER = 15 ; // (bei Bedarf) Scavenger / Evil Scavenger const int FAI_GIANT_RAT = 11 ; const int FAI_GIANT_BUG = 31 ; const int FAI_BLOODFLY = 24 ; const int FAI_WARAN = 21 ; // Waren / Feuerwaran const int FAI_WOLF = 22 ; const int FAI_MINECRAWLER = 5 ; // Minecrawler / Minecrawler Warrior const int FAI_LURKER = 9 ; const int FAI_ZOMBIE = 23 ; const int FAI_SNAPPER = 18 ; // Snapper / Dragon Snapper const int FAI_SHADOWBEAST = 16 ; const int FAI_HARPY = 36 ; const int FAI_STONEGOLEM = 8 ; const int FAI_DEMON = 6 ; const int FAI_TROLL = 20 ; // Troll / Schwarzer Troll const int FAI_SWAMPSHARK = 19 ; // (bei Bedarf) const int FAI_DRAGON = 39 ; // Feuerdrache / Eisdrache / Felsdrache / Sumpfdrache / Untoter Drache const int FAI_MOLERAT = 40 ; // Molerat //----------------------------------------------- const int FAI_ORC = 12 ; // Ork-Krieger / Ork-Shamane / Ork-Elite const int FAI_DRACONIAN = 41 ; //Alles Addon const int FAI_Alligator = 43 ; //Alligator Addon const int FAI_Gargoyle = 44 ; //Steinpuma const int FAI_Bear = 45 ; //Bär const int FAI_Stoneguardian = 46 ; //Steinwächter /******************************************************************** ** Allgemeine Konstanten ** ********************************************************************/ const int TRUE = 1; const int FALSE = 0; const INT LOOP_CONTINUE = 0; CONST INT LOOP_END = 1; const int DEFAULT = 0; //wird in Monster-Instanzen (SetVisual) verwendet // *************************** // Spieler Constants // *************************** const int LP_PER_LEVEL = 10; // Lernpunkte pro Spieler-Stufe const int HP_PER_LEVEL = 12; // Lebenspunkte pro Spieler-Stufe const int XP_PER_VICTORY = 10; // Erfahrungspunkte pro Level des Gegners /******************************************************************** ** NPC-Typ * ********************************************************************/ const int NPCTYPE_AMBIENT = 0; const int NPCTYPE_MAIN = 1; const int NPCTYPE_FRIEND = 2; const int NPCTYPE_OCAMBIENT = 3; const int NPCTYPE_OCMAIN = 4; const int NPCTYPE_BL_AMBIENT = 5;//Addon const int NPCTYPE_TAL_AMBIENT = 6;//Addon const int NPCTYPE_BL_MAIN = 7;//Addon //**************************************************** // Produktions-Mobsis //**************************************************** //werden benötigt um eine Unterscheidung der Mobsi beim PC_Hero Dialog vorzunehmen. const int MOBSI_NONE = 0; const int MOBSI_SmithWeapon = 1; const int MOBSI_SleepAbit = 2; const int MOBSI_MakeRune = 3; const int MOBSI_PotionAlchemy = 4; const int MOBSI_PRAYSHRINE = 5; const int MOBSI_GOLDHACKEN = 6; const int MOBSI_PRAYIDOL = 7; var int PLAYER_MOBSI_PRODUCTION; // ***************************** // Konstanten für B_SetNpcVisual // ***************************** // ------ Nacktmesh-Texturen für Männer und Frauen (je 4) ------ const int BodyTex_P = 0; //Pale const int BodyTex_N = 1; //Normal const int BodyTex_L = 2; //Latino const int BodyTex_B = 3; //Black - die gleichen Kennungen haben auch die Gesichter (zum direkten Vergleich) const int BodyTexBabe_P = 4; //Pale Babe const int BodyTexBabe_N = 5; //Normal Babe const int BodyTexBabe_L = 6; //Latino Babe const int BodyTexBabe_B = 7; //Black Babe //Frauen werden auch mit den "Männer"-Konstanten angegeben, dann vom Script +4 addiert, d.h. diese Konstanten werden nicht gebraucht const int BodyTex_Player = 8; //---------ADD ON---------------------- const int BodyTex_T = 10; //tätowierte psionikerhaut const int BodyTexBabe_F = 11; //Fellkragen Babe const int BodyTexBabe_S = 12;//das kleine Schwarze // ------ Keine Rüstung ------ const int NO_ARMOR = -1; // ------- Gesichter für Männer ------ const int Face_N_Gomez = 0 ; const int Face_N_Scar = 1 ; const int Face_N_Raven = 2 ; const int Face_N_Bullit = 3 ; //zu lieb! const int Face_B_Thorus = 4 ; const int Face_N_Corristo = 5 ; const int Face_N_Milten = 6 ; const int Face_N_Bloodwyn = 7 ; //zu lieb! const int Face_L_Scatty = 8 ; const int Face_N_YBerion = 9 ; const int Face_N_CoolPock = 10 ; const int Face_B_CorAngar = 11 ; const int Face_B_Saturas = 12 ; const int Face_N_Xardas = 13 ; const int Face_N_Lares = 14 ; const int Face_L_Ratford = 15 ; const int Face_N_Drax = 16 ; //Buster const int Face_B_Gorn = 17 ; const int Face_N_Player = 18 ; const int Face_P_Lester = 19 ; const int Face_N_Lee = 20 ; const int Face_N_Torlof = 21 ; const int Face_N_Mud = 22 ; const int Face_N_Ricelord = 23 ; const int Face_N_Horatio = 24 ; const int Face_N_Richter = 25 ; const int Face_N_Cipher_neu = 26 ; const int Face_N_Homer = 27 ; //Headmesh thief const int Face_B_Cavalorn = 28 ; const int Face_L_Ian = 29 ; const int Face_L_Diego = 30 ; const int Face_N_MadPsi = 31 ; const int Face_N_Bartholo = 32 ; const int Face_N_Snaf = 33 ; const int Face_N_Mordrag = 34 ; const int Face_N_Lefty = 35 ; const int Face_N_Wolf = 36 ; const int Face_N_Fingers = 37 ; const int Face_N_Whistler = 38 ; const int Face_P_Gilbert = 39 ; const int Face_L_Jackal = 40 ; //Pale const int Face_P_ToughBald = 41 ; const int Face_P_Tough_Drago = 42 ; const int Face_P_Tough_Torrez = 43 ; const int Face_P_Tough_Rodriguez = 44 ; const int Face_P_ToughBald_Nek = 45 ; const int Face_P_NormalBald = 46 ; const int Face_P_Normal01 = 47 ; const int Face_P_Normal02 = 48 ; const int Face_P_Normal_Fletcher = 49 ; const int Face_P_Normal03 = 50 ; const int Face_P_NormalBart01 = 51 ; const int Face_P_NormalBart_Cronos = 52 ; const int Face_P_NormalBart_Nefarius= 53 ; const int Face_P_NormalBart_Riordian= 54 ; const int Face_P_OldMan_Gravo = 55 ; const int Face_P_Weak_Cutter = 56 ; const int Face_P_Weak_Ulf_Wohlers = 57 ; //Normal const int Face_N_Important_Arto = 58 ; const int Face_N_ImportantGrey = 59 ; const int Face_N_ImportantOld = 60 ; const int Face_N_Tough_Lee_ähnlich = 61 ; const int Face_N_Tough_Skip = 62 ; const int Face_N_ToughBart01 = 63 ; const int Face_N_Tough_Okyl = 64 ; const int Face_N_Normal01 = 65 ; const int Face_N_Normal_Cord = 66 ; const int Face_N_Normal_Olli_Kahn = 67 ; const int Face_N_Normal02 = 68 ; const int Face_N_Normal_Spassvogel = 69 ; const int Face_N_Normal03 = 70 ; const int Face_N_Normal04 = 71 ; const int Face_N_Normal05 = 72 ; const int Face_N_Normal_Stone = 73 ; const int Face_N_Normal06 = 74 ; const int Face_N_Normal_Erpresser = 75 ; const int Face_N_Normal07 = 76 ; const int Face_N_Normal_Blade = 77 ; const int Face_N_Normal08 = 78 ; const int Face_N_Normal14 = 79 ; const int Face_N_Normal_Sly = 80 ; const int Face_N_Normal16 = 81 ; const int Face_N_Normal17 = 82 ; const int Face_N_Normal18 = 83 ; const int Face_N_Normal19 = 84 ; const int Face_N_Normal20 = 85 ; const int Face_N_NormalBart01 = 86 ; const int Face_N_NormalBart02 = 87 ; const int Face_N_NormalBart03 = 88 ; const int Face_N_NormalBart04 = 89 ; const int Face_N_NormalBart05 = 90 ; const int Face_N_NormalBart06 = 91 ; const int Face_N_NormalBart_Senyan = 92 ; const int Face_N_NormalBart08 = 93 ; const int Face_N_NormalBart09 = 94 ; const int Face_N_NormalBart10 = 95 ; const int Face_N_NormalBart11 = 96 ; const int Face_N_NormalBart12 = 97 ; const int Face_N_NormalBart_Dexter = 98 ; const int Face_N_NormalBart_Graham = 99 ; const int Face_N_NormalBart_Dusty = 100 ; const int Face_N_NormalBart16 = 101 ; const int Face_N_NormalBart17 = 102 ; const int Face_N_NormalBart_Huno = 103 ; const int Face_N_NormalBart_Grim = 104 ; const int Face_N_NormalBart20 = 105 ; const int Face_N_NormalBart21 = 106 ; const int Face_N_NormalBart22 = 107 ; const int Face_N_OldBald_Jeremiah = 108 ; const int Face_N_Weak_Ulbert = 109 ; const int Face_N_Weak_BaalNetbek = 110 ; const int Face_N_Weak_Herek = 111 ; const int Face_N_Weak04 = 112 ; const int Face_N_Weak05 = 113 ; const int Face_N_Weak_Orry = 114 ; const int Face_N_Weak_Asghan = 115 ; const int Face_N_Weak_Markus_Kark = 116 ; const int Face_N_Weak_Cipher_alt = 117 ; const int Face_N_NormalBart_Swiney = 118 ; const int Face_N_Weak12 = 119 ; //Latinos const int Face_L_ToughBald01 = 120 ; const int Face_L_Tough01 = 121 ; const int Face_L_Tough02 = 122 ; const int Face_L_Tough_Santino = 123 ; const int Face_L_ToughBart_Quentin = 124 ; const int Face_L_Normal_GorNaBar = 125 ; const int Face_L_NormalBart01 = 126 ; const int Face_L_NormalBart02 = 127 ; const int Face_L_NormalBart_Rufus = 128 ; //Black const int Face_B_ToughBald = 129 ; const int Face_B_Tough_Pacho = 130 ; const int Face_B_Tough_Silas = 131 ; const int Face_B_Normal01 = 132 ; const int Face_B_Normal_Kirgo = 133 ; const int Face_B_Normal_Sharky = 134 ; const int Face_B_Normal_Orik = 135 ; const int Face_B_Normal_Kharim = 136 ; // ------ Gesichter für Frauen ------ const int FaceBabe_N_BlackHair = 137 ; const int FaceBabe_N_Blondie = 138 ; const int FaceBabe_N_BlondTattoo = 139 ; const int FaceBabe_N_PinkHair = 140 ; const int FaceBabe_L_Charlotte = 141 ; const int FaceBabe_B_RedLocks = 142 ; const int FaceBabe_N_HairAndCloth = 143 ; // const int FaceBabe_N_WhiteCloth = 144 ; const int FaceBabe_N_GreyCloth = 145 ; const int FaceBabe_N_Brown = 146 ; const int FaceBabe_N_VlkBlonde = 147 ; const int FaceBabe_N_BauBlonde = 148 ; const int FaceBabe_N_YoungBlonde = 149 ; const int FaceBabe_N_OldBlonde = 150 ; const int FaceBabe_P_MidBlonde = 151 ; const int FaceBabe_N_MidBauBlonde = 152 ; const int FaceBabe_N_OldBrown = 153 ; const int FaceBabe_N_Lilo = 154 ; const int FaceBabe_N_Hure = 155 ; const int FaceBabe_N_Anne = 156 ; const int FaceBabe_B_RedLocks2 = 157 ; const int FaceBabe_L_Charlotte2 = 158 ; //-----------------ADD ON--------------------------------- const int Face_N_Fortuno = 159; //Piraten const int Face_P_Greg = 160; const int Face_N_Pirat01 = 161; const int Face_N_ZombieMud = 162;
D
/homes/e18charr/Documents/A3/Rust/Projet_IOT/nkeys/target/debug/deps/libproc_macro_error_attr-912aa147a18712d0.so: /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/lib.rs /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/parse.rs /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/settings.rs /homes/e18charr/Documents/A3/Rust/Projet_IOT/nkeys/target/debug/deps/proc_macro_error_attr-912aa147a18712d0.d: /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/lib.rs /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/parse.rs /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/settings.rs /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/lib.rs: /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/parse.rs: /homes/e18charr/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro-error-attr-1.0.4/src/settings.rs:
D
module renderer.factory; import base.renderer; import renderer.renderer; import renderer.freetype.ft; import renderer.sdl.main; import renderer.sdl.image; import renderer.opengl; import renderer.freetype.ft; import std.c.string; version(Windows) { import core.sys.windows.windows; extern(System) { BOOL SetWindowPos( HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags ); } } class RendererFactory : IRendererFactory { private: static IRenderer m_Renderer = null; public: ~this() { Delete(m_Renderer); } void Init(int screenWidth, int screenHeight, bool fullScreen, bool vsync, bool noBorder, bool grabInput, int antiAliasing){ //Load dlls version(X86){ ft.Load("freetype.dll","libfreetype.so.6"); SDL.LoadDll("SDL.dll","libSDL-1.2.so.0"); SDLImage.LoadDll("SDL_image.dll","libSDL_image-1.2.so.0"); } version(X86_64){ ft.Load("freetype.dll","libfreetype.so.6"); SDL.LoadDll("SDL64.dll","libSDL-1.2.so.0"); SDLImage.LoadDll("SDL_image64.dll","libSDL_image-1.2.so.0"); } if(SDL.Init(SDL.INIT_VIDEO) != 0){ throw new Exception("Failed initialzing SDL"); } if(SDL.GL.LoadLibrary(null) != 0){ throw new Exception("Error loading opengl"); } //initialize OpenGL window SDL.GL.SetAttribute(SDL.GLattr.GL_DOUBLEBUFFER,1); //SDL.GL.SetAttribute(SDL.GLattr.GL_ACCELERATED_VISUAL,1); SDL.GL.SetAttribute(SDL.GLattr.GL_SWAP_CONTROL, vsync ? 1 : 0); if(antiAliasing > 0){ SDL.GL.SetAttribute(SDL.GLattr.GL_MULTISAMPLEBUFFERS, 1); SDL.GL.SetAttribute(SDL.GLattr.GL_MULTISAMPLESAMPLES, antiAliasing); } int flags = SDL.OPENGL | SDL.HWSURFACE; if(noBorder){ flags |= SDL.NOFRAME; } if(fullScreen){ flags |= SDL.FULLSCREEN; } SDL.Surface *screen = SDL.SetVideoMode(screenWidth, screenHeight, 24, flags ); if(screen is null){ char* error = SDL.GetError(); string message = "Error initializing screen: "; if(error !is null){ message ~= error[0..strlen(error)]; } throw new Exception(message); } if(screen.flags && SDL.OPENGL == 0){ throw new Exception("No OpenGL Window created"); } version(Windows) { if(!fullScreen) { SDL.SysWMinfo info; SDL.VERSION(&info._version); SDL.GetWMInfo(&info); RECT r; SetWindowPos(info.window, null, 0, 0, 0, 0, 0x0001 /*SWP_NOSIZE*/); } } //load OpenGL API gl.load_dll(); gl.SetContextAlive(true); // Set the window attributes if (grabInput){ SDL.WM_GrabInput(SDL.GrabMode.ON); SDL.ShowCursor(SDL.DISABLE); } } IRenderer GetRenderer(){ if(m_Renderer is null){ m_Renderer = New!Renderer(); } return m_Renderer; } } IRendererFactory GetRendererFactory(){ return New!RendererFactory(); } void DeleteRendererFactory(IRendererFactory factory) { Delete(factory); }
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 A, B; get(A, B); int[] res; foreach (i; 1..A + 1) res ~= i; foreach (i; 1..B + 1) res ~= -i; auto d = abs(A - B); if (A > B) { res[$ - 1] -= A * (A + 1) / 2 - B * (B + 1) / 2; } else if (A < B) { res[A - 1] += B * (B + 1) / 2 - A * (A + 1) / 2; } writefln!"%(%d %)"(res); }
D
/Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Validation.build/Validatable.swift.o : /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validatable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidatorType.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidationError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/URLValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/AndValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/RangeValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilIgnoringValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmailValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/InValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/OrValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CharacterSetValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CountValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NotValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmptyValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Validation.build/Validatable~partial.swiftmodule : /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validatable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidatorType.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidationError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/URLValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/AndValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/RangeValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilIgnoringValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmailValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/InValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/OrValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CharacterSetValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CountValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NotValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmptyValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Validation.build/Validatable~partial.swiftdoc : /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validatable.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidatorType.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/ValidationError.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/URLValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/AndValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/RangeValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilIgnoringValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NilValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmailValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/InValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/OrValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CharacterSetValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/CountValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/NotValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validators/EmptyValidator.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Validations.swift /Users/Khanh/vapor/TILApp/.build/checkouts/validation.git--4403154650041669468/Sources/Validation/Exports.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.apinotesc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/ObjectiveC.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIO.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Async.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Core.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Debugging.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Dispatch.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/COperatingSystem.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/CoreGraphics.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOConcurrencyHelpers.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/Bits.swiftmodule /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/NIOFoundationCompat.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/Swift.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/IOKit.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/x86_64/SwiftOnoneSupport.swiftmodule /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/cpp_magic.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIODarwin/include/c_nio_darwin.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOAtomics/include/c-atomics.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio.git-3108475404973543938/Sources/CNIOLinux/include/c_nio_linux.h /Users/Khanh/vapor/TILApp/.build/checkouts/swift-nio-zlib-support.git--1071467962839356487/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOSHA1.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOOpenSSL.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOZlib.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIODarwin.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOHTTPParser.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOAtomics.build/module.modulemap /Users/Khanh/vapor/TILApp/.build/x86_64-apple-macosx10.10/debug/CNIOLinux.build/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes
D
/home/chen/moocos/os/target/debug/build/bare-metal-96bac1f7b3c9cffb/build_script_build-96bac1f7b3c9cffb: /home/chen/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.5/build.rs /home/chen/moocos/os/target/debug/build/bare-metal-96bac1f7b3c9cffb/build_script_build-96bac1f7b3c9cffb.d: /home/chen/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.5/build.rs /home/chen/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.5/build.rs:
D
/** Copyright (c) 2018 Clipsey (clipseypone@gmail.com) 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 ppc.types; public import ppc.types.audio; public import ppc.types.font; public import ppc.types.image; public import ppc.types.model; public import ppc.types.script; public import ppc.types.shader; import ppc.backend.cfile; import ppc.backend.signatures; /// The types available to ppc public enum Types : ubyte { Audio, Font, Image, Model, Script, Shader, Raw, Undecisive = 255 } public Types fileSigToType(MemFile mf) { if (mf.hasSignature(FileSignature.AudioOGG) || mf.hasSignature(FileSignature.AudioWAV)) return Types.Audio; if (mf.hasSignature(FileSignature.ImageBMP) || mf.hasSignature(FileSignature.ImagePNG) || mf.hasSignature(FileSignature.ImagePTI)) return Types.Image; if (mf.hasSignature(FileSignature.ShaderPSGL)) return Types.Shader; return Types.Undecisive; } public Types fileExtToType(string filename) { import std.path : extension; switch(filename.extension) { case ".wav": case ".ogg": case ".pcm": return Types.Audio; case ".png": case ".tga": case ".pti": case ".bmp": return Types.Image; // Vertex shaders case ".vsh": case ".vert": // Fragment shaders case ".fsh": case ".frag": // Geometry shaders case ".gsh": case ".geom": // Tesselation shaders case ".tsh": case ".tesc": case ".tese": // Compute shaders case ".csh": case ".comp": // SPIR-V compiled shaders case ".spv": case ".sprv": return Types.Shader; case ".fbx": case ".obj": return Types.Model; default: return Types.Raw; } } public Types getTypeOf(string filename) { import std.stdio; import std.conv; MemFile mf = loadFile(filename); Types ts = fileSigToType(mf); scope(exit) destroy(mf); return (ts == Types.Undecisive) ? fileExtToType(filename) : ts; }
D
# DO NOT DELETE .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/Riostream.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RConfig.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RVersion.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/work/z/zdemirag/work/Diphoton/Oct24/exost/workdir/Nspectra/.wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsReal.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsArg.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TNamed.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TObject.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/Rtypes.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/DllImport.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/Rtypeinfo.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/snprintf.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/strlcpy.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TGenericClassInfo.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TSchemaHelper.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TStorage.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TVersionCheck.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/Riosfwd.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TBuffer.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TString.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TMathBase.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/THashList.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TList.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TSeqCollection.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TCollection.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TIterator.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TRefArray.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TProcessID.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TObjArray.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooPrintable.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooRefCountList.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooLinkedList.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooLinkedListElem.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooHashTable.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsCache.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooLinkedListIter.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooNameReg.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TClass.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TDictionary.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/Property.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TObjString.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooCmdArg.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooCurve.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TGraph.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TAttLine.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TAttFill.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TAttMarker.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TVectorFfwd.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TVectorDfwd.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TFitResultPtr.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooPlotable.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TMatrixDfwd.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooArgSet.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsCollection.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooErrorHandler.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooArgList.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooGlobalFunc.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooRealProxy.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooArgProxy.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsProxy.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsRealLValue.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooNumber.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsLValue.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsBinning.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooCategoryProxy.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsCategory.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooCatType.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RooAbsCategoryLValue.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TMath.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/TError.h .wscode.4585017a-8463-11e4-9717-fa358a89beef.myWS/RooCFAuto010Func_cxx.so: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/cintdictversion.h /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05/x86_64-slc5-gcc43-opt/root/include/RVersion.h RooCFAuto010Func_cxx__ROOTBUILDVERSION= 5.34/05
D
/Users/gauth/Desktop/rust/calamine/target/debug/build/backtrace-b6b18053fb1973a3/build_script_build-b6b18053fb1973a3: /Users/gauth/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.14/build.rs /Users/gauth/Desktop/rust/calamine/target/debug/build/backtrace-b6b18053fb1973a3/build_script_build-b6b18053fb1973a3.d: /Users/gauth/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.14/build.rs /Users/gauth/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.14/build.rs:
D
instance DIA_Dobar_EXIT(C_Info) { npc = VLK_4106_Dobar; nr = 999; condition = DIA_Dobar_EXIT_Condition; information = DIA_Dobar_EXIT_Info; permanent = TRUE; description = Dialog_Ende; }; func int DIA_Dobar_EXIT_Condition() { return TRUE; }; func void DIA_Dobar_EXIT_Info() { AI_StopProcessInfos(self); }; instance DIA_Dobar_HALLO(C_Info) { npc = VLK_4106_Dobar; nr = 2; condition = DIA_Dobar_HALLO_Condition; information = DIA_Dobar_HALLO_Info; permanent = FALSE; important = TRUE; }; func int DIA_Dobar_HALLO_Condition() { if(Npc_IsInState(self,ZS_Talk)) { return TRUE; }; }; func void DIA_Dobar_HALLO_Info() { AI_Output(self,other,"DIA_Dobar_HALLO_08_00"); //Что тебе нужно? }; instance DIA_Dobar_Talent(C_Info) { npc = VLK_4106_Dobar; nr = 3; condition = DIA_Dobar_Talent_Condition; information = DIA_Dobar_Talent_Info; permanent = FALSE; description = "Я немного знаю кузнечное дело."; }; func int DIA_Dobar_Talent_Condition() { if(Npc_GetTalentSkill(other,NPC_TALENT_SMITH) > 0) { return TRUE; }; }; func void DIA_Dobar_Talent_Info() { AI_Output(other,self,"DIA_Dobar_Talent_15_00"); //Я немного знаю кузнечное дело. AI_Output(self,other,"DIA_Dobar_Talent_08_01"); //Хорошо... и что? }; instance DIA_Dobar_Schmiede(C_Info) { npc = VLK_4106_Dobar; nr = 3; condition = DIA_Dobar_Schmiede_Condition; information = DIA_Dobar_Schmiede_Info; permanent = FALSE; description = "Могу я воспользоваться твоей кузницей?"; }; func int DIA_Dobar_Schmiede_Condition() { if(Npc_KnowsInfo(other,DIA_Dobar_Talent)) { return TRUE; }; }; func void DIA_Dobar_Schmiede_Info() { AI_Output(other,self,"DIA_Dobar_Schmiede_15_00"); //Могу я воспользоваться твоей кузницей? AI_Output(self,other,"DIA_Dobar_Schmiede_08_01"); //У меня много работы. Мы будем только мешать друг другу. Лучше дождись темноты. AI_Output(self,other,"DIA_Dobar_Schmiede_08_02"); //Тогда Парлаф и я пойдем спать, и ты сможешь спокойно поработать. }; instance DIA_Dobar_beibringen(C_Info) { npc = VLK_4106_Dobar; nr = 2; condition = DIA_Dobar_beibringen_Condition; information = DIA_Dobar_beibringen_Info; permanent = FALSE; description = "Ты можешь научить меня чему-нибудь?"; }; func int DIA_Dobar_beibringen_Condition() { if(Npc_KnowsInfo(other,DIA_Dobar_Talent)) { return TRUE; }; }; func void DIA_Dobar_beibringen_Info() { AI_Output(other,self,"DIA_Dobar_beibringen_15_00"); //Ты можешь научить меня чему-нибудь? AI_Output(self,other,"DIA_Dobar_beibringen_08_01"); //Ты уже знаешь основы. Я могу показать тебе, как улучшить твою работу. AI_Output(self,other,"DIA_Dobar_beibringen_08_02"); //И ты сможешь ковать более совершенное оружие. Dobar_Learnsmith = TRUE; Log_CreateTopic(TOPIC_Teacher_OC,LOG_NOTE); B_LogEntry(TOPIC_Teacher_OC,"Добар может обучить меня ковать хорошее оружие."); }; instance DIA_Dobar_Teach(C_Info) { npc = VLK_4106_Dobar; nr = 3; condition = DIA_Dobar_Teach_Condition; information = DIA_Dobar_Teach_Info; description = B_BuildLearnString("Покажи мне, как выковать хороший меч!",B_GetLearnCostTalent(other,NPC_TALENT_SMITH,WEAPON_1H_Special_01)); permanent = TRUE; }; func int DIA_Dobar_Teach_Condition() { if((Dobar_Learnsmith == TRUE) && (PLAYER_TALENT_SMITH[WEAPON_1H_Special_01] == FALSE)) { return TRUE; }; }; func void DIA_Dobar_Teach_Info() { AI_Output(other,self,"DIA_Dobar_Teach_15_00"); //Покажи мне, как выковать хороший меч! if(B_TeachPlayerTalentSmith(self,hero,WEAPON_1H_Special_01)) { AI_Output(self,other,"DIA_Dobar_Teach_08_01"); //Разогрей сталь, чтобы она равномерно светилась по всей длине, без этого хороший меч не выковать. AI_Output(self,other,"DIA_Dobar_Teach_08_02"); //Если ты будешь помнить это, сделанные тобой клинки будут прочнее и острее. AI_Output(self,other,"DIA_Dobar_Teach_08_03"); //Это все, что тебе нужно знать. Если тебе нужна сырая сталь, поговори с Энгором. }; }; instance DIA_Dobar_Waffe(C_Info) { npc = VLK_4106_Dobar; nr = 80; condition = DIA_Dobar_Waffe_Condition; information = DIA_Dobar_Waffe_Info; permanent = FALSE; description = "Ты можешь сделать оружие для меня?"; }; func int DIA_Dobar_Waffe_Condition() { return TRUE; }; func void DIA_Dobar_Waffe_Info() { AI_Output(other,self,"DIA_Dobar_Waffe_15_00"); //Ты можешь сделать оружие для меня? AI_Output(self,other,"DIA_Dobar_Waffe_08_01"); //У меня нет времени на это. Тандор распоряжается всем оружием - я только кую его, а Парлаф затачивает. Log_CreateTopic(TOPIC_Trader_OC,LOG_NOTE); B_LogEntry(TOPIC_Trader_OC,"Тандор продает оружие в замке."); }; instance DIA_Dobar_NEWS(C_Info) { npc = VLK_4106_Dobar; nr = 900; condition = DIA_Dobar_NEWS_Condition; information = DIA_Dobar_NEWS_Info; permanent = TRUE; description = "Как работа?"; }; func int DIA_Dobar_NEWS_Condition() { return TRUE; }; func void DIA_Dobar_NEWS_Info() { AI_Output(other,self,"DIA_Dobar_NEWS_15_00"); //Как работа? if(Dobar_einmalig == FALSE) { AI_Output(self,other,"DIA_Dobar_NEWS_08_01"); //Я кую оружие для рыцарей замка. С тех пор, как мы прибыли сюда, я не отхожу от кузницы. AI_Output(self,other,"DIA_Dobar_NEWS_08_02"); //Это оружие нам очень пригодится. Мы еще покажем этим проклятым оркам! if(Npc_IsDead(Parlaf) == FALSE) { B_TurnToNpc(self,Parlaf); AI_Output(self,other,"DIA_Dobar_NEWS_08_03"); //Эй, Парлаф - затачивай эти мечи получше - орки чертовски сильные противники! B_TurnToNpc(self,other); }; Dobar_einmalig = TRUE; } else { AI_Output(self,other,"DIA_Dobar_NEWS_08_04"); //Могло бы быть и лучше. Если бы ты постоянно не отвлекал меня, работа продвигалась бы быстрее. }; }; instance DIA_Dobar_PICKPOCKET(C_Info) { npc = VLK_4106_Dobar; nr = 900; condition = DIA_Dobar_PICKPOCKET_Condition; information = DIA_Dobar_PICKPOCKET_Info; permanent = TRUE; description = "(Украсть его кусок руды будет сложно)"; }; func int DIA_Dobar_PICKPOCKET_Condition() { if((Npc_GetTalentSkill(other,NPC_TALENT_PICKPOCKET) == 1) && (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE) && (Npc_HasItems(self,ItMi_Nugget) >= 1) && (other.attribute[ATR_DEXTERITY] >= (79 - Theftdiff))) { return TRUE; }; }; func void DIA_Dobar_PICKPOCKET_Info() { Info_ClearChoices(DIA_Dobar_PICKPOCKET); Info_AddChoice(DIA_Dobar_PICKPOCKET,Dialog_Back,DIA_Dobar_PICKPOCKET_BACK); Info_AddChoice(DIA_Dobar_PICKPOCKET,DIALOG_PICKPOCKET,DIA_Dobar_PICKPOCKET_DoIt); }; func void DIA_Dobar_PICKPOCKET_DoIt() { if(other.attribute[ATR_DEXTERITY] >= 79) { B_GiveInvItems(self,other,ItMi_Nugget,1); self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE; B_GivePlayerXP(XP_Ambient); Info_ClearChoices(DIA_Dobar_PICKPOCKET); } else { AI_StopProcessInfos(self); B_Attack(self,other,AR_Theft,1); }; }; func void DIA_Dobar_PICKPOCKET_BACK() { Info_ClearChoices(DIA_Dobar_PICKPOCKET); };
D
import std.stdio; import std.string; void main(string[] args) { File file = File(args[1], "r"); int line_num = 0; while (!file.eof()) { string line = chomp(file.readln()); if ( line_num % 4 == 0) { // remove this line if (line.length > 0) { writeln(">", line[1..$]); } line_num = 0; } if ( line_num == 1 ) { writeln(line); } line_num++; } }
D
/+ logo + (c) 2007 John Ohno + XANA logo licensed under the Creative Commons ShareAlike/Attribution + license. + Part of Project XANA +/ module logo; static const char[] LOGO= `XXX XXX XXX XXXXXX XXXXX (c) 2007 Project XANA XXX XXX XXX XXX XX X XXX XXX XXX XXX XXXXXXXX XX X XXXXXXXX XXXX XX XX XX X XX XX XXX XXX X XX XX X XX XX ={XANA}= XXX XXX X XX XX X XX XX "Xanalogical Amorphoid Network XXX XXXXXXXXX XXXXX XXXX XXX Articulator" -==============================================================- OCD/XANA v 0.01a Licensed under open source licenses -==============================================================- `;/+ |\iiiiii/| _____ ( \ _________ / ) / (|) (|) \---------/ ___ \ \/ \/ ( <> ) |_/ | | ( ) ( ) | \___/ \___/ | | /_\ | ------- ___________ | |\ /| | |--| | | | | _/\ ------- /\_ | | | | | | | (_/ \_______/ \_) (___| (___| (___(_____| Experimental Version `;+/
D
mapup (2) --- fold character to upper case 03/23/80 _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n character function mapup (c) character c Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n 'Mapup' is the inverse of 'mapdn'. If the character 'c' is a lower case letter, the function return is the correspond- ing upper case letter; otherwise, the function return is the same as 'c'. _I_m_p_l_e_m_e_n_t_a_t_i_o_n In 'mapup', as in 'mapdn', considerable use is made of the internal ASCII character code. If 'c' is between 'a'c and 'z'c, 'c' - 'a'c + 'A'c is returned; otherwise, 'c' is returned. _B_u_g_s Inordinate dependence on properties of character code. _S_e_e _A_l_s_o mapdn (2), mapstr (2) mapup (2) - 1 - mapup (2)
D