Branch: Tag:

2000-05-18

2000-05-18 08:27:50 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

first checkin; some geographical support

Rev: lib/modules/Geography.pmod/Countries.pmod:1.1
Rev: lib/modules/Geography.pmod/Position.pike:1.1

1838:   </docgroup>   </class>   </module> + <module name='Geographical'> + <module name='Countries'> + <doc> + <text> + <p>subclass Country</p> + </text> +  + </doc> + <docgroup homogen-type='method'> + <method name='`[]'> +  <returntype> +  <object>mixed </object></returntype> +  <arguments><argument name='what'><type><string/></type></argument> +  +  </arguments> + </method><method name='`-&gt;'> +  <returntype> +  <object>mixed </object></returntype> +  <arguments><argument name='what'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p> Convenience function for getting a country +  the name-space way; it looks up whatever it +  is in the name- and domain-space and +  <pre> + &gt; Geographical.Countries.se; + Result: Country(Sweden) + &gt; Geographical.Countries.djibouti; + Result: Country(Djibouti) + &gt; Geographical.Countries.com; + Result: Country(United States) + &gt; Geographical.Countries.wallis_and_futuna_islands-&gt;iso2; + Result: "WF" +  </pre></p> + </text> + <group><returns/><text> + <p>that country if possible:</p> + </text></group> +  + </doc> + </docgroup> + <docgroup homogen-name='aka' homogen-type='variable'> + <variable name='aka'><type> +  <array><valuetype><string/></valuetype></array></type> + </variable><doc> + <text> + <p>Country name and as-known-as, if any</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='cast' homogen-type='method'> + <method name='cast'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument><value>"string"</value></argument> +  </arguments> + </method><doc> + <text> + <p>It is possible to cast a country to a string, + which will be the same as performing + <tt>country-&gt;name;</tt>.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='countries' homogen-type='constant'> + <constant name='countries'><typevalue> +  <array><valuetype> +  <object>Country</object></valuetype></array></typevalue> + </constant><doc> + <text> + <p>All known countries.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='former' homogen-type='variable'> + <variable name='former'><type> +  <object>int </object></type> + </variable><doc> + <text> + <p>Flag that is set if this isn't a country anymore + (Like USSR.)</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='from_domain' homogen-type='method'> + <method name='from_domain'> +  <returntype> +  <object>Country </object></returntype> +  <arguments><argument name='domain'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Look up a country from a domain name. + Returns zero if the domain doesn't map + to a country. Note that there are some + valid domains that doesn't: + <dl compact='compact'> + <dt>INT </dt><dd>International + </dd><dt>MIL </dt><dd>US Military + </dd><dt>NET </dt><dd>Network + </dd><dt>ORG </dt><dd>Non-Profit Organization + </dd><dt>ARPA </dt><dd>Old style Arpanet + </dd><dt>NATO </dt><dd>Nato field + </dd></dl></p> +  + <p>And that USA has three domains, Great Britain two: + <dl compact='compact'> + <dt>COM </dt><dd>US Commercial + </dd><dt>EDU </dt><dd>US Educational + </dd><dt>GOV </dt><dd>US Government + </dd><dt>GB </dt><dd>Great Britain (UK) + </dd><dt>UK </dt><dd>United Kingdom + </dd></dl></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='from_domain' homogen-type='method'> + <method name='from_domain'> +  <returntype> +  <object>Country </object></returntype> +  <arguments><argument name='name'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Look up a country from its name or aka. + The search is case-insensitive but + regards whitespace and interpunctation.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='iso2' homogen-type='variable'> + <variable name='iso2'><type> +  <object>string </object></type> + </variable><doc> + <text> + <p>ISO 2-character code aka domain name</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='name' homogen-type='variable'> + <variable name='name'><type> +  <object>string </object></type> + </variable></docgroup> + </module> + <class name='Position'> + <doc> + <text> + <p>This class contains a geographical position, + ie a point on the earths surface. + </p> + </text> +  + </doc> + <docgroup homogen-type='method'> + <method name='__hash'> +  <returntype> +  <object>int </object></returntype> +  <arguments> +  </arguments> + </method><method name='`=='> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='pos'><type> +  <object resolved='predef::Geographical.Position'>Position</object></type></argument> +  +  </arguments> + </method><method name='`&lt;'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='pos'><type> +  <object resolved='predef::Geographical.Position'>Position</object></type></argument> +  +  </arguments> + </method><method name='`&gt;'> +  <returntype> +  <object>int </object></returntype> +  <arguments><argument name='pos'><type> +  <object resolved='predef::Geographical.Position'>Position</object></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>These exist solely for purpose of detecting + equal positions, for instance when used as keys in mappings.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='cast' homogen-type='method'> + <method name='cast'> +  <returntype> +  <object>array </object></returntype> +  <arguments><argument><value>"array"</value></argument> +  </arguments> + </method><doc> + <text> + <p>It is possible to cast the position to an array, + <tt>({float lat,float long})</tt>.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='create' homogen-type='method'> + <method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='lat'><type><float/></type></argument> + <argument name='long'><type><float/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='lat'><type><string/></type></argument> + <argument name='long'><type><string/></type></argument> +  +  </arguments> + </method><method name='create'> +  <returntype> +  <object>void </object></returntype> +  <arguments><argument name='both'><type><string/></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Constructor for this class. + If feeded with strings, it will perform + a dwim scan on the strings. If they + fails to be understood, there will be an exception.</p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='lat' homogen-type='variable'> + <variable name='lat'><type> +  <object>float </object></type> + </variable></docgroup> + <docgroup homogen-type='method'> + <method name='latitude'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='n'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><method name='longitude'> +  <returntype> +  <object>string </object></returntype> +  <arguments><argument name='n'><type> +  <or><void/><int/></or></type></argument> +  +  </arguments> + </method><doc> + <text> + <p>Returns the nicely formatted latitude + or longitude. + <pre> + n format + - 17°42.19'N 42°22.2'W + 1 17.703°N 42.37°W + 2 17°42.18'N 42°22.2'W + 3 17°42'10.4"N 42°22'12"W + -1 17.703 -42.37 + </pre></p> + </text> +  + </doc> + </docgroup> + <docgroup homogen-name='long' homogen-type='variable'> + <variable name='long'><type> +  <object>float </object></type> + </variable><doc> + <text> + <p>Longitude (W--E) and latitude (N--S) of the position, + float value in degrees. + Positive number is north and east, respectively. + Negative number is south and west, respectively.</p> + </text> +  + </doc> + </docgroup> + </class> + </module>   <module name='Gettext'>   <doc>   <text>