Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Text / Table / Decorator / Unicode.php
blob93e4d6e7e348910a8f08b85684e1bc9a7b534f77
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Text\Table\Decorator;
12 use Zend\Text\Table\Decorator\DecoratorInterface as Decorator;
14 /**
15 * Unicode Decorator for Zend\Text\Table
17 class Unicode implements Decorator
19 /**
20 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
22 * @return string
24 public function getTopLeft()
26 return $this->_uniChar(0x250C);
29 /**
30 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
32 * @return string
34 public function getTopRight()
36 return $this->_uniChar(0x2510);
39 /**
40 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
42 * @return string
44 public function getBottomLeft()
46 return $this->_uniChar(0x2514);
49 /**
50 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
52 * @return string
54 public function getBottomRight()
56 return $this->_uniChar(0x2518);
59 /**
60 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
62 * @return string
64 public function getVertical()
66 return $this->_uniChar(0x2502);
69 /**
70 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
72 * @return string
74 public function getHorizontal()
76 return $this->_uniChar(0x2500);
79 /**
80 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
82 * @return string
84 public function getCross()
86 return $this->_uniChar(0x253C);
89 /**
90 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
92 * @return string
94 public function getVerticalRight()
96 return $this->_uniChar(0x251C);
99 /**
100 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
102 * @return string
104 public function getVerticalLeft()
106 return $this->_uniChar(0x2524);
110 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
112 * @return string
114 public function getHorizontalDown()
116 return $this->_uniChar(0x252C);
120 * Defined by Zend\Text\Table\Decorator\DecoratorInterface
122 * @return string
124 public function getHorizontalUp()
126 return $this->_uniChar(0x2534);
130 * Convert am unicode character code to a character
132 * @param int $code
133 * @return string|false
135 protected function _uniChar($code)
137 if ($code <= 0x7F) {
138 $char = chr($code);
139 } elseif ($code <= 0x7FF) {
140 $char = chr(0xC0 | $code >> 6)
141 . chr(0x80 | $code & 0x3F);
142 } elseif ($code <= 0xFFFF) {
143 $char = chr(0xE0 | $code >> 12)
144 . chr(0x80 | $code >> 6 & 0x3F)
145 . chr(0x80 | $code & 0x3F);
146 } elseif ($code <= 0x10FFFF) {
147 $char = chr(0xF0 | $code >> 18)
148 . chr(0x80 | $code >> 12 & 0x3F)
149 . chr(0x80 | $code >> 6 & 0x3F)
150 . chr(0x80 | $code & 0x3F);
151 } else {
152 return false;
155 return $char;