1
0
forked from 0ad/0ad

Fix lineendings of new files and the ones in source/ that didn't receive the eol property yet.

To confirm, use svn diff -r 20355:20356 -x "-w --ignore-eol-style"
--ignore-properties  | less

This was SVN commit r20356.
This commit is contained in:
elexis 2017-10-26 17:03:29 +00:00
parent f6c2ea6b0e
commit c136848b74
39 changed files with 2293 additions and 2293 deletions

View File

@ -1,19 +1,19 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
element Textures {
element File {
attribute pattern { text }? &
attribute format { "dxt1" | "dxt3" | "dxt5" | "rgba" | "alpha" }? &
attribute mipmap { "true" | "false" }? &
attribute normal { "true" | "false" }? &
attribute alpha { "none" | "player" | "transparency" }? &
attribute filter { "box" | "triangle" | "kaiser" }? &
attribute kaiserwidth { xsd:float }? &
attribute kaiseralpha { xsd:float }? &
attribute kaiserstretch { xsd:float }?
}*
}
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
element Textures {
element File {
attribute pattern { text }? &
attribute format { "dxt1" | "dxt3" | "dxt5" | "rgba" | "alpha" }? &
attribute mipmap { "true" | "false" }? &
attribute normal { "true" | "false" }? &
attribute alpha { "none" | "player" | "transparency" }? &
attribute filter { "box" | "triangle" | "kaiser" }? &
attribute kaiserwidth { xsd:float }? &
attribute kaiseralpha { xsd:float }? &
attribute kaiserstretch { xsd:float }?
}*
}

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SoundGroup>
<Gain>1</Gain>
<Priority>100</Priority>
<ConeGain>1</ConeGain>
<Looping>0</Looping>
<RandOrder>1</RandOrder>
<RandGain>1</RandGain>
<RandPitch>1</RandPitch>
<Threshold>1</Threshold>
<Path>audio/interface/ui</Path>
<Sound>ui_button_click.ogg</Sound>
<Sound>ui_button_longclick.ogg</Sound>
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SoundGroup>
<Gain>1</Gain>
<Priority>100</Priority>
<ConeGain>1</ConeGain>
<Looping>0</Looping>
<RandOrder>1</RandOrder>
<RandGain>1</RandGain>
<RandPitch>1</RandPitch>
<Threshold>1</Threshold>
<Path>audio/interface/ui</Path>
<Sound>ui_button_click.ogg</Sound>
<Sound>ui_button_longclick.ogg</Sound>
</SoundGroup>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SoundGroup>
<Gain>1</Gain>
<Priority>100</Priority>
<ConeGain>1</ConeGain>
<Looping>0</Looping>
<RandOrder>1</RandOrder>
<RandGain>1</RandGain>
<RandPitch>1</RandPitch>
<Threshold>1</Threshold>
<Path>audio/interface/ui</Path>
<Sound>ui_button_longclick.ogg</Sound>
</SoundGroup>
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SoundGroup>
<Gain>1</Gain>
<Priority>100</Priority>
<ConeGain>1</ConeGain>
<Looping>0</Looping>
<RandOrder>1</RandOrder>
<RandGain>1</RandGain>
<RandPitch>1</RandPitch>
<Threshold>1</Threshold>
<Path>audio/interface/ui</Path>
<Sound>ui_button_longclick.ogg</Sound>
</SoundGroup>

View File

@ -1,36 +1,36 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
##
# Types #
##
flag = "0" | "1"
start = SoundGroup
SoundGroup = element SoundGroup {
element Gain { xsd:float }? &
element Looping { flag }? &
element Omnipresent { flag }? &
element HeardBy { "owner" }? &
element Distanceless { flag }? &
element Pitch { xsd:float }? &
element Priority { xsd:float }? &
element RandOrder { flag }? &
element RandGain { flag }? &
element GainUpper { xsd:float }? &
element GainLower { xsd:float }? &
element RandPitch { flag }? &
element PitchUpper { xsd:float }? &
element PitchLower { xsd:float }? &
element ConeGain { xsd:float }? &
element ConeInner { xsd:float }? &
element ConeOuter { xsd:float }? &
element Threshold { xsd:float }? &
element Decay { xsd:float }? &
element Sound { text }+ &
element Path { text }
}
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
##
# Types #
##
flag = "0" | "1"
start = SoundGroup
SoundGroup = element SoundGroup {
element Gain { xsd:float }? &
element Looping { flag }? &
element Omnipresent { flag }? &
element HeardBy { "owner" }? &
element Distanceless { flag }? &
element Pitch { xsd:float }? &
element Priority { xsd:float }? &
element RandOrder { flag }? &
element RandGain { flag }? &
element GainUpper { xsd:float }? &
element GainLower { xsd:float }? &
element RandPitch { flag }? &
element PitchUpper { xsd:float }? &
element PitchLower { xsd:float }? &
element ConeGain { xsd:float }? &
element ConeInner { xsd:float }? &
element ConeOuter { xsd:float }? &
element Threshold { xsd:float }? &
element Decay { xsd:float }? &
element Sound { text }+ &
element Path { text }
}

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>cart</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/carthaginians/stable.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>cart</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/carthaginians/stable.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="25.0" depth="22.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>iber</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="24.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="25.0" depth="22.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>iber</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="24.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>iber</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/stables.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>iber</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/stables.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>iber</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>iber</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,59 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_special">
<Cost>
<BuildTime>300</BuildTime>
<Resources>
<food>0</food>
<wood>0</wood>
<stone>200</stone>
<metal>200</metal>
</Resources>
</Cost>
<Footprint>
<Square width="29.0" depth="27.0"/>
<Height>8.0</Height>
</Footprint>
<GarrisonHolder>
<List datatype="tokens">Elephant</List>
</GarrisonHolder>
<Health>
<Max>3000</Max>
</Health>
<Identity>
<Civ>pers</Civ>
<GenericName>Elephant Stables</GenericName>
<SpecificName>?</SpecificName>
<RequiredTechnology>phase_city</RequiredTechnology>
<Icon>structures/elephant_stables.png</Icon>
<Tooltip>Train elephant units.</Tooltip>
</Identity>
<Loot>
<wood>0</wood>
<stone>50</stone>
<metal>50</metal>
</Loot>
<Obstruction>
<Static width="30.0" depth="29.0"/>
</Obstruction>
<ProductionQueue>
<BatchTimeModifier>0.7</BatchTimeModifier>
<Entities datatype="tokens">
units/{civ}_support_elephant
units/{civ}_elephant_archer_b
units/{civ}_champion_elephant
</Entities>
</ProductionQueue>
<Sound>
<SoundGroups>
<select>interface/select/building/sel_elephant_stables.xml</select>
<constructed>interface/complete/building/complete_elephant_stables.xml</constructed>
<death>attack/destruction/building_collapse_large.xml</death>
</SoundGroups>
</Sound>
<TerritoryInfluence>
<Radius>38</Radius>
</TerritoryInfluence>
<VisualActor>
<Actor>structures/persians/stables_elephant.xml</Actor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_special">
<Cost>
<BuildTime>300</BuildTime>
<Resources>
<food>0</food>
<wood>0</wood>
<stone>200</stone>
<metal>200</metal>
</Resources>
</Cost>
<Footprint>
<Square width="29.0" depth="27.0"/>
<Height>8.0</Height>
</Footprint>
<GarrisonHolder>
<List datatype="tokens">Elephant</List>
</GarrisonHolder>
<Health>
<Max>3000</Max>
</Health>
<Identity>
<Civ>pers</Civ>
<GenericName>Elephant Stables</GenericName>
<SpecificName>?</SpecificName>
<RequiredTechnology>phase_city</RequiredTechnology>
<Icon>structures/elephant_stables.png</Icon>
<Tooltip>Train elephant units.</Tooltip>
</Identity>
<Loot>
<wood>0</wood>
<stone>50</stone>
<metal>50</metal>
</Loot>
<Obstruction>
<Static width="30.0" depth="29.0"/>
</Obstruction>
<ProductionQueue>
<BatchTimeModifier>0.7</BatchTimeModifier>
<Entities datatype="tokens">
units/{civ}_support_elephant
units/{civ}_elephant_archer_b
units/{civ}_champion_elephant
</Entities>
</ProductionQueue>
<Sound>
<SoundGroups>
<select>interface/select/building/sel_elephant_stables.xml</select>
<constructed>interface/complete/building/complete_elephant_stables.xml</constructed>
<death>attack/destruction/building_collapse_large.xml</death>
</SoundGroups>
</Sound>
<TerritoryInfluence>
<Radius>38</Radius>
</TerritoryInfluence>
<VisualActor>
<Actor>structures/persians/stables_elephant.xml</Actor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>pers</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="24.0" depth="24.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/persians/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>pers</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="24.0" depth="24.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/persians/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>pers</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/persians/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>pers</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/persians/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,59 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_special">
<Cost>
<BuildTime>300</BuildTime>
<Resources>
<food>0</food>
<wood>0</wood>
<stone>200</stone>
<metal>200</metal>
</Resources>
</Cost>
<Footprint>
<Square width="29.0" depth="27.0"/>
<Height>8.0</Height>
</Footprint>
<GarrisonHolder>
<List datatype="tokens">Elephant</List>
</GarrisonHolder>
<Health>
<Max>3000</Max>
</Health>
<Identity>
<Civ>sele</Civ>
<GenericName>Elephant Stables</GenericName>
<SpecificName>?</SpecificName>
<RequiredTechnology>phase_city</RequiredTechnology>
<Icon>structures/elephant_stables.png</Icon>
<Tooltip>Train elephant units.</Tooltip>
</Identity>
<Loot>
<wood>0</wood>
<stone>50</stone>
<metal>50</metal>
</Loot>
<Obstruction>
<Static width="30.0" depth="29.0"/>
</Obstruction>
<ProductionQueue>
<BatchTimeModifier>0.7</BatchTimeModifier>
<Entities datatype="tokens">
units/{civ}_support_elephant
units/{civ}_elephant_archer_b
units/{civ}_champion_elephant
</Entities>
</ProductionQueue>
<Sound>
<SoundGroups>
<select>interface/select/building/sel_elephant_stables.xml</select>
<constructed>interface/complete/building/complete_elephant_stables.xml</constructed>
<death>attack/destruction/building_collapse_large.xml</death>
</SoundGroups>
</Sound>
<TerritoryInfluence>
<Radius>38</Radius>
</TerritoryInfluence>
<VisualActor>
<Actor>structures/seleucids/stable_elephant.xml</Actor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_special">
<Cost>
<BuildTime>300</BuildTime>
<Resources>
<food>0</food>
<wood>0</wood>
<stone>200</stone>
<metal>200</metal>
</Resources>
</Cost>
<Footprint>
<Square width="29.0" depth="27.0"/>
<Height>8.0</Height>
</Footprint>
<GarrisonHolder>
<List datatype="tokens">Elephant</List>
</GarrisonHolder>
<Health>
<Max>3000</Max>
</Health>
<Identity>
<Civ>sele</Civ>
<GenericName>Elephant Stables</GenericName>
<SpecificName>?</SpecificName>
<RequiredTechnology>phase_city</RequiredTechnology>
<Icon>structures/elephant_stables.png</Icon>
<Tooltip>Train elephant units.</Tooltip>
</Identity>
<Loot>
<wood>0</wood>
<stone>50</stone>
<metal>50</metal>
</Loot>
<Obstruction>
<Static width="30.0" depth="29.0"/>
</Obstruction>
<ProductionQueue>
<BatchTimeModifier>0.7</BatchTimeModifier>
<Entities datatype="tokens">
units/{civ}_support_elephant
units/{civ}_elephant_archer_b
units/{civ}_champion_elephant
</Entities>
</ProductionQueue>
<Sound>
<SoundGroups>
<select>interface/select/building/sel_elephant_stables.xml</select>
<constructed>interface/complete/building/complete_elephant_stables.xml</constructed>
<death>attack/destruction/building_collapse_large.xml</death>
</SoundGroups>
</Sound>
<TerritoryInfluence>
<Radius>38</Radius>
</TerritoryInfluence>
<VisualActor>
<Actor>structures/seleucids/stable_elephant.xml</Actor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="26.5" depth="26.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>sele</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="25.0" depth="25.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/seleucids/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="26.5" depth="26.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>sele</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="25.0" depth="25.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/seleucids/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>sele</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/seleucids/stable.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>sele</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/seleucids/stable.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>sele</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/seleucids/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>sele</Civ>
<SpecificName>?</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/seleucids/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_blacksmith">
<Identity>
<Civ>spart</Civ>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_civic_civil_centre">
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_hele_cc</SpawnEntityOnDeath>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_resource_corral">
<Identity>
<Civ>spart</Civ>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_defense_defense_tower">
<Footprint>
<Square width="10.0" depth="10.5"/>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_economic_farmstead">
<Footprint>
<Square width="18.0" depth="13.0"/>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_fortress">
<Footprint>
<Square width="26.0" depth="28.0"/>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_special">
<Cost>
<BuildTime>200</BuildTime>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_civic_house_big">
<Identity>
<Civ>spart</Civ>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_economic_market">
<Identity>
<Civ>spart</Civ>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>spart</Civ>
<SpecificName>Stratēgeîon</SpecificName>
</Identity>
<Obstruction>
<Static width="24.0" depth="24.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/spartans/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_range">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>spart</Civ>
<SpecificName>Stratēgeîon</SpecificName>
</Identity>
<Obstruction>
<Static width="24.0" depth="24.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/spartans/range.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>spart</Civ>
<SpecificName>Stratēgeîon</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/spartans/stable.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_stables">
<Footprint>
<Square width="25.0" depth="25.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>spart</Civ>
<SpecificName>Stratēgeîon</SpecificName>
</Identity>
<Obstruction>
<Static width="20.0" depth="20.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/spartans/stable.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_economic_storehouse">
<Footprint>
<Square width="15.0" depth="16.0"/>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_civic_temple">
<Footprint>
<Square width="19.0" depth="37.0"/>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_wonder">
<Auras datatype="tokens">
structures/epic_temple_heal

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>spart</Civ>
<SpecificName>Stratēgeîon</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/spartans/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks_workshop">
<Footprint>
<Square width="30.0" depth="30.0"/>
<Height>12.0</Height>
</Footprint>
<Health>
<SpawnEntityOnDeath>decay|rubble/rubble_stone_5x5</SpawnEntityOnDeath>
</Health>
<Identity>
<Civ>spart</Civ>
<SpecificName>Stratēgeîon</SpecificName>
</Identity>
<Obstruction>
<Static width="29.0" depth="29.0"/>
</Obstruction>
<VisualActor>
<Actor>structures/spartans/workshop.xml</Actor>
<FoundationActor>structures/fndn_5x5.xml</FoundationActor>
</VisualActor>
</Entity>

View File

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
<GarrisonHolder>
<List datatype="tokens">Infantry -Cavalry</List>
</GarrisonHolder>
<Identity>
<GenericName>Archery Range</GenericName>
<Tooltip>Train citizen-soldier ranged infantry. Research training improvements.</Tooltip>
<Icon>structures/barracks.png</Icon>
</Identity>
<ProductionQueue>
<BatchTimeModifier>0.8</BatchTimeModifier>
<Entities datatype="tokens">
-units/{civ}_infantry_spearman_b
-units/{civ}_infantry_pikeman_b
-units/{civ}_infantry_swordsman_b
units/{civ}_infantry_javelinist_b
units/{civ}_infantry_slinger_b
units/{civ}_infantry_archer_b
</Entities>
</ProductionQueue>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
<GarrisonHolder>
<List datatype="tokens">Infantry -Cavalry</List>
</GarrisonHolder>
<Identity>
<GenericName>Archery Range</GenericName>
<Tooltip>Train citizen-soldier ranged infantry. Research training improvements.</Tooltip>
<Icon>structures/barracks.png</Icon>
</Identity>
<ProductionQueue>
<BatchTimeModifier>0.8</BatchTimeModifier>
<Entities datatype="tokens">
-units/{civ}_infantry_spearman_b
-units/{civ}_infantry_pikeman_b
-units/{civ}_infantry_swordsman_b
units/{civ}_infantry_javelinist_b
units/{civ}_infantry_slinger_b
units/{civ}_infantry_archer_b
</Entities>
</ProductionQueue>
</Entity>

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
<GarrisonHolder>
<List datatype="tokens">Cavalry -Infantry</List>
</GarrisonHolder>
<Identity>
<GenericName>Stables</GenericName>
<Tooltip>Train citizen-soldier cavalry. Research training improvements.</Tooltip>
<Icon>structures/barracks.png</Icon>
</Identity>
<ProductionQueue>
<BatchTimeModifier>0.8</BatchTimeModifier>
<Entities datatype="tokens">
-units/{civ}_infantry_spearman_b
-units/{civ}_infantry_pikeman_b
-units/{civ}_infantry_swordsman_b
units/{civ}_cavalry_swordsman_b
units/{civ}_cavalry_spearman_b
units/{civ}_cavalry_javelinist_b
units/{civ}_cavalry_archer_b
</Entities>
</ProductionQueue>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
<GarrisonHolder>
<List datatype="tokens">Cavalry -Infantry</List>
</GarrisonHolder>
<Identity>
<GenericName>Stables</GenericName>
<Tooltip>Train citizen-soldier cavalry. Research training improvements.</Tooltip>
<Icon>structures/barracks.png</Icon>
</Identity>
<ProductionQueue>
<BatchTimeModifier>0.8</BatchTimeModifier>
<Entities datatype="tokens">
-units/{civ}_infantry_spearman_b
-units/{civ}_infantry_pikeman_b
-units/{civ}_infantry_swordsman_b
units/{civ}_cavalry_swordsman_b
units/{civ}_cavalry_spearman_b
units/{civ}_cavalry_javelinist_b
units/{civ}_cavalry_archer_b
</Entities>
</ProductionQueue>
</Entity>

View File

@ -1,32 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
<Cost>
<BuildTime>175</BuildTime>
<Resources>
<wood>450</wood>
</Resources>
</Cost>
<GarrisonHolder>
<List datatype="tokens">Siege -Infantry -Cavalry</List>
</GarrisonHolder>
<Identity>
<GenericName>Siege Workshop</GenericName>
<Tooltip>Train siege weapons. Research training improvements.</Tooltip>
<Icon>structures/barracks.png</Icon>
</Identity>
<ProductionQueue>
<BatchTimeModifier>0.8</BatchTimeModifier>
<Entities datatype="tokens">
-units/{civ}_infantry_spearman_b
-units/{civ}_infantry_pikeman_b
-units/{civ}_infantry_swordsman_b
units/{civ}_mechanical_siege_ballista_packed
units/{civ}_mechanical_siege_scorpio_packed
units/{civ}_mechanical_siege_oxybeles_packed
units/{civ}_mechanical_siege_lithobolos_packed
units/{civ}_mechanical_siege_polybolos_packed
units/{civ}_mechanical_siege_ram
units/{civ}_mechanical_siege_tower
</Entities>
</ProductionQueue>
</Entity>
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_structure_military_barracks">
<Cost>
<BuildTime>175</BuildTime>
<Resources>
<wood>450</wood>
</Resources>
</Cost>
<GarrisonHolder>
<List datatype="tokens">Siege -Infantry -Cavalry</List>
</GarrisonHolder>
<Identity>
<GenericName>Siege Workshop</GenericName>
<Tooltip>Train siege weapons. Research training improvements.</Tooltip>
<Icon>structures/barracks.png</Icon>
</Identity>
<ProductionQueue>
<BatchTimeModifier>0.8</BatchTimeModifier>
<Entities datatype="tokens">
-units/{civ}_infantry_spearman_b
-units/{civ}_infantry_pikeman_b
-units/{civ}_infantry_swordsman_b
units/{civ}_mechanical_siege_ballista_packed
units/{civ}_mechanical_siege_scorpio_packed
units/{civ}_mechanical_siege_oxybeles_packed
units/{civ}_mechanical_siege_lithobolos_packed
units/{civ}_mechanical_siege_polybolos_packed
units/{civ}_mechanical_siege_ram
units/{civ}_mechanical_siege_tower
</Entities>
</ProductionQueue>
</Entity>

View File

@ -1,24 +1,24 @@
The MIT License
Copyright (c) 2007 - 2010 John W. Wilkinson
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The MIT License
Copyright (c) 2007 - 2010 John W. Wilkinson
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,54 +1,54 @@
#ifndef JSON_SPIRIT_ERROR_POSITION
#define JSON_SPIRIT_ERROR_POSITION
// Copyright John W. Wilkinson 2007 - 2013
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.06
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <string>
namespace json_spirit
{
// An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
// Note the "read_or_throw" functions are around 3 times slower than the standard functions "read"
// functions that return a bool.
//
struct Error_position
{
Error_position();
Error_position( unsigned int line, unsigned int column, const std::string& reason );
bool operator==( const Error_position& lhs ) const;
unsigned int line_;
unsigned int column_;
std::string reason_;
};
inline Error_position::Error_position()
: line_( 0 )
, column_( 0 )
{
}
inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
: line_( line )
, column_( column )
, reason_( reason )
{
}
inline bool Error_position::operator==( const Error_position& lhs ) const
{
if( this == &lhs ) return true;
return ( reason_ == lhs.reason_ ) &&
( line_ == lhs.line_ ) &&
( column_ == lhs.column_ );
}
}
#endif
#ifndef JSON_SPIRIT_ERROR_POSITION
#define JSON_SPIRIT_ERROR_POSITION
// Copyright John W. Wilkinson 2007 - 2013
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.06
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <string>
namespace json_spirit
{
// An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
// Note the "read_or_throw" functions are around 3 times slower than the standard functions "read"
// functions that return a bool.
//
struct Error_position
{
Error_position();
Error_position( unsigned int line, unsigned int column, const std::string& reason );
bool operator==( const Error_position& lhs ) const;
unsigned int line_;
unsigned int column_;
std::string reason_;
};
inline Error_position::Error_position()
: line_( 0 )
, column_( 0 )
{
}
inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
: line_( line )
, column_( column )
, reason_( reason )
{
}
inline bool Error_position::operator==( const Error_position& lhs ) const
{
if( this == &lhs ) return true;
return ( reason_ == lhs.reason_ ) &&
( line_ == lhs.line_ ) &&
( column_ == lhs.column_ );
}
}
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +1,33 @@
#ifndef JSON_SPIRIT_WRITER_OPTIONS
#define JSON_SPIRIT_WRITER_OPTIONS
// Copyright John W. Wilkinson 2007 - 2013
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.06
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
namespace json_spirit
{
enum Output_options{ pretty_print = 0x01, // Add whitespace to format the output nicely.
raw_utf8 = 0x02, // This prevents non-printable characters from being escapted using "\uNNNN" notation.
// Note, this is an extension to the JSON standard. It disables the escaping of
// non-printable characters allowing UTF-8 sequences held in 8 bit char strings
// to pass through unaltered.
remove_trailing_zeros = 0x04,
// outputs e.g. "1.200000000000000" as "1.2"
single_line_arrays = 0x08,
// pretty printing except that arrays printed on single lines unless they contain
// composite elements, i.e. objects or arrays
always_escape_nonascii = 0x10,
// all unicode wide characters are escaped, i.e. outputed as "\uXXXX", even if they are
// printable under the current locale, ascii printable chars are not escaped
};
}
#endif
#ifndef JSON_SPIRIT_WRITER_OPTIONS
#define JSON_SPIRIT_WRITER_OPTIONS
// Copyright John W. Wilkinson 2007 - 2013
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.06
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
namespace json_spirit
{
enum Output_options{ pretty_print = 0x01, // Add whitespace to format the output nicely.
raw_utf8 = 0x02, // This prevents non-printable characters from being escapted using "\uNNNN" notation.
// Note, this is an extension to the JSON standard. It disables the escaping of
// non-printable characters allowing UTF-8 sequences held in 8 bit char strings
// to pass through unaltered.
remove_trailing_zeros = 0x04,
// outputs e.g. "1.200000000000000" as "1.2"
single_line_arrays = 0x08,
// pretty printing except that arrays printed on single lines unless they contain
// composite elements, i.e. objects or arrays
always_escape_nonascii = 0x10,
// all unicode wide characters are escaped, i.e. outputed as "\uXXXX", even if they are
// printable under the current locale, ascii printable chars are not escaped
};
}
#endif

View File

@ -1,387 +1,387 @@
#ifndef JSON_SPIRIT_WRITER_TEMPLATE
#define JSON_SPIRIT_WRITER_TEMPLATE
// Copyright John W. Wilkinson 2007 - 2013
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.06
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include "json_spirit_writer_options.h"
#include <cassert>
#include <sstream>
#include <iomanip>
#include <boost/io/ios_state.hpp>
namespace json_spirit
{
inline char to_hex_char( unsigned int c )
{
assert( c <= 0xF );
const char ch = static_cast< char >( c );
if( ch < 10 ) return '0' + ch;
return 'A' - 10 + ch;
}
template< class String_type >
String_type non_printable_to_string( unsigned int c )
{
typedef typename String_type::value_type Char_type;
String_type result( 6, '\\' );
result[1] = 'u';
result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 2 ] = to_hex_char( c & 0x000F );
return result;
}
template< typename Char_type, class String_type >
bool add_esc_char( Char_type c, String_type& s )
{
switch( c )
{
case '"': s += to_str< String_type >( "\\\"" ); return true;
case '\\': s += to_str< String_type >( "\\\\" ); return true;
case '\b': s += to_str< String_type >( "\\b" ); return true;
case '\f': s += to_str< String_type >( "\\f" ); return true;
case '\n': s += to_str< String_type >( "\\n" ); return true;
case '\r': s += to_str< String_type >( "\\r" ); return true;
case '\t': s += to_str< String_type >( "\\t" ); return true;
}
return false;
}
template< class String_type >
String_type add_esc_chars( const String_type& s, bool raw_utf8, bool esc_nonascii )
{
typedef typename String_type::const_iterator Iter_type;
typedef typename String_type::value_type Char_type;
String_type result;
const Iter_type end( s.end() );
for( Iter_type i = s.begin(); i != end; ++i )
{
const Char_type c( *i );
if( add_esc_char( c, result ) ) continue;
if( raw_utf8 )
{
result += c;
}
else
{
const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );
if( !esc_nonascii && iswprint( unsigned_c ) )
{
result += c;
}
else
{
result += non_printable_to_string< String_type >( unsigned_c );
}
}
}
return result;
}
template< class Ostream >
void append_double( Ostream& os, const double d, const int precision )
{
os << std::showpoint << std::setprecision( precision ) << d;
}
template< class String_type >
void erase_and_extract_exponent( String_type& str, String_type& exp )
{
const typename String_type::size_type exp_start= str.find( 'e' );
if( exp_start != String_type::npos )
{
exp = str.substr( exp_start );
str.erase( exp_start );
}
}
template< class String_type >
typename String_type::size_type find_first_non_zero( const String_type& str )
{
typename String_type::size_type result = str.size() - 1;
for( ; result != 0; --result )
{
if( str[ result ] != '0' )
{
break;
}
}
return result;
}
template< class String_type >
void remove_trailing( String_type& str )
{
String_type exp;
erase_and_extract_exponent( str, exp );
const typename String_type::size_type first_non_zero = find_first_non_zero( str );
if( first_non_zero != 0 )
{
const int offset = str[first_non_zero] == '.' ? 2 : 1; // note zero digits following a decimal point is non standard
str.erase( first_non_zero + offset );
}
str += exp;
}
// this class generates the JSON text,
// it keeps track of the indentation level etc.
//
template< class Value_type, class Ostream_type >
class Generator
{
typedef typename Value_type::Config_type Config_type;
typedef typename Config_type::String_type String_type;
typedef typename Config_type::Object_type Object_type;
typedef typename Config_type::Array_type Array_type;
typedef typename String_type::value_type Char_type;
typedef typename Object_type::value_type Obj_member_type;
public:
Generator( const Value_type& value, Ostream_type& os, unsigned int options )
: os_( os )
, indentation_level_( 0 )
, pretty_( ( options & pretty_print ) != 0 || ( options & single_line_arrays ) != 0 )
, raw_utf8_( ( options & raw_utf8 ) != 0 )
, esc_nonascii_( ( options & always_escape_nonascii ) != 0 )
, remove_trailing_zeros_( ( options & remove_trailing_zeros ) != 0 )
, single_line_arrays_( ( options & single_line_arrays ) != 0 )
, ios_saver_( os )
{
output( value );
}
private:
void output( const Value_type& value )
{
switch( value.type() )
{
case obj_type: output( value.get_obj() ); break;
case array_type: output( value.get_array() ); break;
case str_type: output( value.get_str() ); break;
case bool_type: output( value.get_bool() ); break;
case real_type: output( value.get_real() ); break;
case int_type: output_int( value ); break;
case null_type: os_ << "null"; break;
default: assert( false );
}
}
void output( const Object_type& obj )
{
output_array_or_obj( obj, '{', '}' );
}
void output( const Obj_member_type& member )
{
output( Config_type::get_name( member ) ); space();
os_ << ':'; space();
output( Config_type::get_value( member ) );
}
void output_int( const Value_type& value )
{
if( value.is_uint64() )
{
os_ << value.get_uint64();
}
else
{
os_ << value.get_int64();
}
}
void output( const String_type& s )
{
os_ << '"' << add_esc_chars( s, raw_utf8_, esc_nonascii_ ) << '"';
}
void output( bool b )
{
os_ << to_str< String_type >( b ? "true" : "false" );
}
void output( double d )
{
if( remove_trailing_zeros_ )
{
std::basic_ostringstream< Char_type > os;
append_double( os, d, 16 ); // note precision is 16 so that we get some trailing space that we can remove,
// otherwise, 0.1234 gets converted to "0.12399999..."
String_type str = os.str();
remove_trailing( str );
os_ << str;
}
else
{
append_double( os_, d, 17 );
}
}
static bool contains_composite_elements( const Array_type& arr )
{
for( typename Array_type::const_iterator i = arr.begin(); i != arr.end(); ++i )
{
const Value_type& val = *i;
if( val.type() == obj_type ||
val.type() == array_type )
{
return true;
}
}
return false;
}
template< class Iter >
void output_composite_item( Iter i, Iter last )
{
output( *i );
if( ++i != last )
{
os_ << ',';
}
}
void output( const Array_type& arr )
{
if( single_line_arrays_ && !contains_composite_elements( arr ) )
{
os_ << '['; space();
for( typename Array_type::const_iterator i = arr.begin(); i != arr.end(); ++i )
{
output_composite_item( i, arr.end() );
space();
}
os_ << ']';
}
else
{
output_array_or_obj( arr, '[', ']' );
}
}
template< class T >
void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char )
{
os_ << start_char; new_line();
++indentation_level_;
for( typename T::const_iterator i = t.begin(); i != t.end(); ++i )
{
indent();
output_composite_item( i, t.end() );
new_line();
}
--indentation_level_;
indent(); os_ << end_char;
}
void indent()
{
if( !pretty_ ) return;
for( int i = 0; i < indentation_level_; ++i )
{
os_ << " ";
}
}
void space()
{
if( pretty_ ) os_ << ' ';
}
void new_line()
{
if( pretty_ ) os_ << '\n';
}
Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning
Ostream_type& os_;
int indentation_level_;
bool pretty_;
bool raw_utf8_;
bool esc_nonascii_;
bool remove_trailing_zeros_;
bool single_line_arrays_;
boost::io::basic_ios_all_saver< Char_type > ios_saver_; // so that ostream state is reset after control is returned to the caller
};
// writes JSON Value to a stream, e.g.
//
// write_stream( value, os, pretty_print );
//
template< class Value_type, class Ostream_type >
void write_stream( const Value_type& value, Ostream_type& os, unsigned int options = 0 )
{
os << std::dec;
Generator< Value_type, Ostream_type >( value, os, options );
}
// writes JSON Value to a stream, e.g.
//
// const string json_str = write( value, pretty_print );
//
template< class Value_type >
typename Value_type::String_type write_string( const Value_type& value, unsigned int options = 0 )
{
typedef typename Value_type::String_type::value_type Char_type;
std::basic_ostringstream< Char_type > os;
write_stream( value, os, options );
return os.str();
}
}
#endif
#ifndef JSON_SPIRIT_WRITER_TEMPLATE
#define JSON_SPIRIT_WRITER_TEMPLATE
// Copyright John W. Wilkinson 2007 - 2013
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.06
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include "json_spirit_writer_options.h"
#include <cassert>
#include <sstream>
#include <iomanip>
#include <boost/io/ios_state.hpp>
namespace json_spirit
{
inline char to_hex_char( unsigned int c )
{
assert( c <= 0xF );
const char ch = static_cast< char >( c );
if( ch < 10 ) return '0' + ch;
return 'A' - 10 + ch;
}
template< class String_type >
String_type non_printable_to_string( unsigned int c )
{
typedef typename String_type::value_type Char_type;
String_type result( 6, '\\' );
result[1] = 'u';
result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 2 ] = to_hex_char( c & 0x000F );
return result;
}
template< typename Char_type, class String_type >
bool add_esc_char( Char_type c, String_type& s )
{
switch( c )
{
case '"': s += to_str< String_type >( "\\\"" ); return true;
case '\\': s += to_str< String_type >( "\\\\" ); return true;
case '\b': s += to_str< String_type >( "\\b" ); return true;
case '\f': s += to_str< String_type >( "\\f" ); return true;
case '\n': s += to_str< String_type >( "\\n" ); return true;
case '\r': s += to_str< String_type >( "\\r" ); return true;
case '\t': s += to_str< String_type >( "\\t" ); return true;
}
return false;
}
template< class String_type >
String_type add_esc_chars( const String_type& s, bool raw_utf8, bool esc_nonascii )
{
typedef typename String_type::const_iterator Iter_type;
typedef typename String_type::value_type Char_type;
String_type result;
const Iter_type end( s.end() );
for( Iter_type i = s.begin(); i != end; ++i )
{
const Char_type c( *i );
if( add_esc_char( c, result ) ) continue;
if( raw_utf8 )
{
result += c;
}
else
{
const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );
if( !esc_nonascii && iswprint( unsigned_c ) )
{
result += c;
}
else
{
result += non_printable_to_string< String_type >( unsigned_c );
}
}
}
return result;
}
template< class Ostream >
void append_double( Ostream& os, const double d, const int precision )
{
os << std::showpoint << std::setprecision( precision ) << d;
}
template< class String_type >
void erase_and_extract_exponent( String_type& str, String_type& exp )
{
const typename String_type::size_type exp_start= str.find( 'e' );
if( exp_start != String_type::npos )
{
exp = str.substr( exp_start );
str.erase( exp_start );
}
}
template< class String_type >
typename String_type::size_type find_first_non_zero( const String_type& str )
{
typename String_type::size_type result = str.size() - 1;
for( ; result != 0; --result )
{
if( str[ result ] != '0' )
{
break;
}
}
return result;
}
template< class String_type >
void remove_trailing( String_type& str )
{
String_type exp;
erase_and_extract_exponent( str, exp );
const typename String_type::size_type first_non_zero = find_first_non_zero( str );
if( first_non_zero != 0 )
{
const int offset = str[first_non_zero] == '.' ? 2 : 1; // note zero digits following a decimal point is non standard
str.erase( first_non_zero + offset );
}
str += exp;
}
// this class generates the JSON text,
// it keeps track of the indentation level etc.
//
template< class Value_type, class Ostream_type >
class Generator
{
typedef typename Value_type::Config_type Config_type;
typedef typename Config_type::String_type String_type;
typedef typename Config_type::Object_type Object_type;
typedef typename Config_type::Array_type Array_type;
typedef typename String_type::value_type Char_type;
typedef typename Object_type::value_type Obj_member_type;
public:
Generator( const Value_type& value, Ostream_type& os, unsigned int options )
: os_( os )
, indentation_level_( 0 )
, pretty_( ( options & pretty_print ) != 0 || ( options & single_line_arrays ) != 0 )
, raw_utf8_( ( options & raw_utf8 ) != 0 )
, esc_nonascii_( ( options & always_escape_nonascii ) != 0 )
, remove_trailing_zeros_( ( options & remove_trailing_zeros ) != 0 )
, single_line_arrays_( ( options & single_line_arrays ) != 0 )
, ios_saver_( os )
{
output( value );
}
private:
void output( const Value_type& value )
{
switch( value.type() )
{
case obj_type: output( value.get_obj() ); break;
case array_type: output( value.get_array() ); break;
case str_type: output( value.get_str() ); break;
case bool_type: output( value.get_bool() ); break;
case real_type: output( value.get_real() ); break;
case int_type: output_int( value ); break;
case null_type: os_ << "null"; break;
default: assert( false );
}
}
void output( const Object_type& obj )
{
output_array_or_obj( obj, '{', '}' );
}
void output( const Obj_member_type& member )
{
output( Config_type::get_name( member ) ); space();
os_ << ':'; space();
output( Config_type::get_value( member ) );
}
void output_int( const Value_type& value )
{
if( value.is_uint64() )
{
os_ << value.get_uint64();
}
else
{
os_ << value.get_int64();
}
}
void output( const String_type& s )
{
os_ << '"' << add_esc_chars( s, raw_utf8_, esc_nonascii_ ) << '"';
}
void output( bool b )
{
os_ << to_str< String_type >( b ? "true" : "false" );
}
void output( double d )
{
if( remove_trailing_zeros_ )
{
std::basic_ostringstream< Char_type > os;
append_double( os, d, 16 ); // note precision is 16 so that we get some trailing space that we can remove,
// otherwise, 0.1234 gets converted to "0.12399999..."
String_type str = os.str();
remove_trailing( str );
os_ << str;
}
else
{
append_double( os_, d, 17 );
}
}
static bool contains_composite_elements( const Array_type& arr )
{
for( typename Array_type::const_iterator i = arr.begin(); i != arr.end(); ++i )
{
const Value_type& val = *i;
if( val.type() == obj_type ||
val.type() == array_type )
{
return true;
}
}
return false;
}
template< class Iter >
void output_composite_item( Iter i, Iter last )
{
output( *i );
if( ++i != last )
{
os_ << ',';
}
}
void output( const Array_type& arr )
{
if( single_line_arrays_ && !contains_composite_elements( arr ) )
{
os_ << '['; space();
for( typename Array_type::const_iterator i = arr.begin(); i != arr.end(); ++i )
{
output_composite_item( i, arr.end() );
space();
}
os_ << ']';
}
else
{
output_array_or_obj( arr, '[', ']' );
}
}
template< class T >
void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char )
{
os_ << start_char; new_line();
++indentation_level_;
for( typename T::const_iterator i = t.begin(); i != t.end(); ++i )
{
indent();
output_composite_item( i, t.end() );
new_line();
}
--indentation_level_;
indent(); os_ << end_char;
}
void indent()
{
if( !pretty_ ) return;
for( int i = 0; i < indentation_level_; ++i )
{
os_ << " ";
}
}
void space()
{
if( pretty_ ) os_ << ' ';
}
void new_line()
{
if( pretty_ ) os_ << '\n';
}
Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning
Ostream_type& os_;
int indentation_level_;
bool pretty_;
bool raw_utf8_;
bool esc_nonascii_;
bool remove_trailing_zeros_;
bool single_line_arrays_;
boost::io::basic_ios_all_saver< Char_type > ios_saver_; // so that ostream state is reset after control is returned to the caller
};
// writes JSON Value to a stream, e.g.
//
// write_stream( value, os, pretty_print );
//
template< class Value_type, class Ostream_type >
void write_stream( const Value_type& value, Ostream_type& os, unsigned int options = 0 )
{
os << std::dec;
Generator< Value_type, Ostream_type >( value, os, options );
}
// writes JSON Value to a stream, e.g.
//
// const string json_str = write( value, pretty_print );
//
template< class Value_type >
typename Value_type::String_type write_string( const Value_type& value, unsigned int options = 0 )
{
typedef typename Value_type::String_type::value_type Char_type;
std::basic_ostringstream< Char_type > os;
write_stream( value, os, options );
return os.str();
}
}
#endif