Remove typedef decl errors
[hiphop-php.git] / hphp / util / text-art.cpp
blobf936d9e0823c08c32652ceba9702b0a56b900f7a
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #include "hphp/util/text-art.h"
18 #include <cassert>
20 namespace HPHP { namespace TextArt {
21 ///////////////////////////////////////////////////////////////////////////////
23 bool s_use_utf8 = true;
25 const char *get_box_drawing_char(BoxDrawing name) {
26 if (s_use_utf8) {
27 switch (name) {
28 case LightDownAndRight: return "\xe2\x94\x8c";
29 case LightHorizontal: return "\xe2\x94\x80";
30 case LightDownAndLeft: return "\xe2\x94\x90";
31 case LightVerticalAndRight: return "\xe2\x94\x9c";
32 case LightVertical: return "\xe2\x94\x82";
33 case LightVerticalAndLeft: return "\xe2\x94\xa4";
34 case LightUpAndRight: return "\xe2\x94\x94";
35 case LightUpAndLeft: return "\xe2\x94\x98";
37 } else {
38 switch (name) {
39 case LightDownAndRight: return "+";
40 case LightHorizontal: return "-";
41 case LightDownAndLeft: return "+";
42 case LightVerticalAndRight: return "+";
43 case LightVertical: return "|";
44 case LightVerticalAndLeft: return "+";
45 case LightUpAndRight: return "+";
46 case LightUpAndLeft: return "+";
49 assert(false);
50 return "";
53 ///////////////////////////////////////////////////////////////////////////////