12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485(**************************************************************************)(* ocaml-gettext: a library to translate messages *)(* *)(* Copyright (C) 2003-2008 Sylvain Le Gall <sylvain@le-gall.net> *)(* *)(* 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.1 of the License, or (at your option) any later version; *)(* with the OCaml static compilation exception. *)(* *)(* 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 *)(**************************************************************************)(** Functions to manipulate category.
@author Sylvain Le Gall
*)typecategory=|LC_CTYPE|LC_NUMERIC|LC_TIME|LC_COLLATE|LC_MONETARY|LC_MESSAGES|LC_ALLletstring_of_categorycat=matchcatwith|LC_CTYPE->"LC_CTYPE"|LC_NUMERIC->"LC_NUMERIC"|LC_TIME->"LC_TIME"|LC_COLLATE->"LC_COLLATE"|LC_MONETARY->"LC_MONETARY"|LC_MESSAGES->"LC_MESSAGES"|LC_ALL->"LC_ALL"letcategory_of_stringstr=matchstrwith|"LC_CTYPE"->LC_CTYPE|"LC_NUMERIC"->LC_NUMERIC|"LC_TIME"->LC_TIME|"LC_COLLATE"->LC_COLLATE|"LC_MONETARY"->LC_MONETARY|"LC_MESSAGES"->LC_MESSAGES|"LC_ALL"->LC_ALL|_->raise(Invalid_argument"category_of_string")letcategories=[LC_CTYPE;LC_NUMERIC;LC_TIME;LC_COLLATE;LC_MONETARY;LC_MESSAGES;LC_ALL;]letcomparec1c2=letval_categoryx=matchxwith|LC_CTYPE->0|LC_NUMERIC->1|LC_TIME->2|LC_COLLATE->3|LC_MONETARY->4|LC_MESSAGES->5|LC_ALL->6incompare(val_categoryc1)(val_categoryc2)moduleMapCategory=Map.Make(structtypet=categoryletcompare=compareend)