chillerlan-QRCode-Common-BitBuffer.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/search.js"></script>
  22. <script defer src="js/searchIndex.js"></script>
  23. </head>
  24. <body id="top">
  25. <header class="phpdocumentor-header phpdocumentor-section">
  26. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  27. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  28. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  29. <i class="fas fa-bars"></i>
  30. </label>
  31. <section data-search-form class="phpdocumentor-search">
  32. <label>
  33. <span class="visually-hidden">Search for</span>
  34. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  35. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  36. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  37. </svg>
  38. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  39. </label>
  40. </section>
  41. <nav class="phpdocumentor-topnav">
  42. <ul class="phpdocumentor-topnav__menu">
  43. </ul>
  44. </nav>
  45. </header>
  46. <main class="phpdocumentor">
  47. <div class="phpdocumentor-section">
  48. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  49. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  50. Menu
  51. </label>
  52. <aside class="phpdocumentor-column -four phpdocumentor-sidebar">
  53. <section class="phpdocumentor-sidebar__category">
  54. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  55. <h4 class="phpdocumentor-sidebar__root-namespace">
  56. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  57. </h4>
  58. <ul class="phpdocumentor-list">
  59. <li>
  60. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  61. </li>
  62. <li>
  63. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  64. </li>
  65. </ul>
  66. </section>
  67. <section class="phpdocumentor-sidebar__category">
  68. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  69. <h4 class="phpdocumentor-sidebar__root-namespace">
  70. <a href="packages/Application.html" class="">Application</a>
  71. </h4>
  72. </section>
  73. <section class="phpdocumentor-sidebar__category">
  74. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  75. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  76. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  77. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  78. </section>
  79. <section class="phpdocumentor-sidebar__category">
  80. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  81. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  82. </section>
  83. </aside>
  84. <div class="phpdocumentor-column -eight phpdocumentor-content">
  85. <ul class="phpdocumentor-breadcrumbs">
  86. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  87. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  88. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  89. </ul>
  90. <article class="phpdocumentor-element -class">
  91. <h2 class="phpdocumentor-content__title">
  92. BitBuffer
  93. <div class="phpdocumentor-element__package">
  94. in package
  95. <ul class="phpdocumentor-breadcrumbs">
  96. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  97. </ul>
  98. </div>
  99. </h2>
  100. <aside class="phpdocumentor-element-found-in">
  101. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  102. :
  103. <span class="phpdocumentor-element-found-in__line">19</span>
  104. </aside>
  105. <p class="phpdocumentor-summary">Holds the raw binary data</p>
  106. <h3 id="toc">
  107. Table of Contents
  108. <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
  109. </h3>
  110. <dl class="phpdocumentor-table-of-contents">
  111. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  112. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead">$bitsRead</a>
  113. <span>
  114. &nbsp;: int </span>
  115. </dt>
  116. <dd>Read count (bits)</dd>
  117. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  118. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer">$buffer</a>
  119. <span>
  120. &nbsp;: array&lt;string|int, mixed&gt; </span>
  121. </dt>
  122. <dd>The buffer content</dd>
  123. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  124. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead">$bytesRead</a>
  125. <span>
  126. &nbsp;: int </span>
  127. </dt>
  128. <dd>Read count (bytes)</dd>
  129. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  130. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length">$length</a>
  131. <span>
  132. &nbsp;: int </span>
  133. </dt>
  134. <dd>Length of the content (bits)</dd>
  135. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  136. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct">__construct()</a>
  137. <span>
  138. &nbsp;: mixed </span>
  139. </dt>
  140. <dd>BitBuffer constructor.</dd>
  141. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  142. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available">available()</a>
  143. <span>
  144. &nbsp;: int </span>
  145. </dt>
  146. <dd></dd>
  147. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  148. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear">clear()</a>
  149. <span>
  150. &nbsp;: self </span>
  151. </dt>
  152. <dd>Clears the buffer and resets the stats</dd>
  153. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  154. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer">getBuffer()</a>
  155. <span>
  156. &nbsp;: array&lt;string|int, mixed&gt; </span>
  157. </dt>
  158. <dd>returns the buffer content</dd>
  159. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  160. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength">getLength()</a>
  161. <span>
  162. &nbsp;: int </span>
  163. </dt>
  164. <dd>returns the current buffer length</dd>
  165. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  166. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put">put()</a>
  167. <span>
  168. &nbsp;: self </span>
  169. </dt>
  170. <dd>appends a sequence of bits</dd>
  171. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  172. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit">putBit()</a>
  173. <span>
  174. &nbsp;: self </span>
  175. </dt>
  176. <dd>appends a single bit</dd>
  177. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  178. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read">read()</a>
  179. <span>
  180. &nbsp;: int </span>
  181. </dt>
  182. <dd></dd>
  183. </dl>
  184. <section class="phpdocumentor-properties">
  185. <h3 class="phpdocumentor-elements__header" id="properties">
  186. Properties
  187. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  188. </h3>
  189. <article
  190. class="
  191. phpdocumentor-element
  192. -property
  193. -private
  194. "
  195. >
  196. <h4 class="phpdocumentor-element__name" id="property_bitsRead">
  197. $bitsRead
  198. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead" class="headerlink"><i class="fas fa-link"></i></a>
  199. <span class="phpdocumentor-element__modifiers">
  200. </span>
  201. </h4>
  202. <aside class="phpdocumentor-element-found-in">
  203. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  204. :
  205. <span class="phpdocumentor-element-found-in__line">41</span>
  206. </aside>
  207. <p class="phpdocumentor-summary">Read count (bits)</p>
  208. <code class="phpdocumentor-code phpdocumentor-signature ">
  209. <span class="phpdocumentor-signature__visibility">private</span>
  210. <span class="phpdocumentor-signature__type">int</span>
  211. <span class="phpdocumentor-signature__name">$bitsRead</span>
  212. = <span class="phpdocumentor-signature__default-value">0</span></code>
  213. <section class="phpdocumentor-description"></section>
  214. </article>
  215. <article
  216. class="
  217. phpdocumentor-element
  218. -property
  219. -private
  220. "
  221. >
  222. <h4 class="phpdocumentor-element__name" id="property_buffer">
  223. $buffer
  224. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer" class="headerlink"><i class="fas fa-link"></i></a>
  225. <span class="phpdocumentor-element__modifiers">
  226. </span>
  227. </h4>
  228. <aside class="phpdocumentor-element-found-in">
  229. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  230. :
  231. <span class="phpdocumentor-element-found-in__line">26</span>
  232. </aside>
  233. <p class="phpdocumentor-summary">The buffer content</p>
  234. <code class="phpdocumentor-code phpdocumentor-signature ">
  235. <span class="phpdocumentor-signature__visibility">private</span>
  236. <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
  237. <span class="phpdocumentor-signature__name">$buffer</span>
  238. </code>
  239. </article>
  240. <article
  241. class="
  242. phpdocumentor-element
  243. -property
  244. -private
  245. "
  246. >
  247. <h4 class="phpdocumentor-element__name" id="property_bytesRead">
  248. $bytesRead
  249. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead" class="headerlink"><i class="fas fa-link"></i></a>
  250. <span class="phpdocumentor-element__modifiers">
  251. </span>
  252. </h4>
  253. <aside class="phpdocumentor-element-found-in">
  254. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  255. :
  256. <span class="phpdocumentor-element-found-in__line">36</span>
  257. </aside>
  258. <p class="phpdocumentor-summary">Read count (bytes)</p>
  259. <code class="phpdocumentor-code phpdocumentor-signature ">
  260. <span class="phpdocumentor-signature__visibility">private</span>
  261. <span class="phpdocumentor-signature__type">int</span>
  262. <span class="phpdocumentor-signature__name">$bytesRead</span>
  263. = <span class="phpdocumentor-signature__default-value">0</span></code>
  264. <section class="phpdocumentor-description"></section>
  265. </article>
  266. <article
  267. class="
  268. phpdocumentor-element
  269. -property
  270. -private
  271. "
  272. >
  273. <h4 class="phpdocumentor-element__name" id="property_length">
  274. $length
  275. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length" class="headerlink"><i class="fas fa-link"></i></a>
  276. <span class="phpdocumentor-element__modifiers">
  277. </span>
  278. </h4>
  279. <aside class="phpdocumentor-element-found-in">
  280. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  281. :
  282. <span class="phpdocumentor-element-found-in__line">31</span>
  283. </aside>
  284. <p class="phpdocumentor-summary">Length of the content (bits)</p>
  285. <code class="phpdocumentor-code phpdocumentor-signature ">
  286. <span class="phpdocumentor-signature__visibility">private</span>
  287. <span class="phpdocumentor-signature__type">int</span>
  288. <span class="phpdocumentor-signature__name">$length</span>
  289. </code>
  290. <section class="phpdocumentor-description"></section>
  291. </article>
  292. </section>
  293. <section class="phpdocumentor-methods">
  294. <h3 class="phpdocumentor-elements__header" id="methods">
  295. Methods
  296. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  297. </h3>
  298. <article
  299. class="phpdocumentor-element
  300. -method
  301. -public
  302. "
  303. >
  304. <h4 class="phpdocumentor-element__name" id="method___construct">
  305. __construct()
  306. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  307. </h4>
  308. <aside class="phpdocumentor-element-found-in">
  309. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  310. :
  311. <span class="phpdocumentor-element-found-in__line">48</span>
  312. </aside>
  313. <p class="phpdocumentor-summary">BitBuffer constructor.</p>
  314. <code class="phpdocumentor-code phpdocumentor-signature ">
  315. <span class="phpdocumentor-signature__visibility">public</span>
  316. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, int&gt;|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  317. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  318. <dl class="phpdocumentor-argument-list">
  319. <dt class="phpdocumentor-argument-list__entry">
  320. <span class="phpdocumentor-signature__argument__name">$bytes</span>
  321. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, int&gt;|null</span>
  322. = <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
  323. <dd class="phpdocumentor-argument-list__definition">
  324. </dd>
  325. </dl>
  326. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  327. <span class="phpdocumentor-signature__response_type">mixed</span>
  328. &mdash;
  329. </article>
  330. <article
  331. class="phpdocumentor-element
  332. -method
  333. -public
  334. "
  335. >
  336. <h4 class="phpdocumentor-element__name" id="method_available">
  337. available()
  338. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available" class="headerlink"><i class="fas fa-link"></i></a>
  339. </h4>
  340. <aside class="phpdocumentor-element-found-in">
  341. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  342. :
  343. <span class="phpdocumentor-element-found-in__line">101</span>
  344. </aside>
  345. <code class="phpdocumentor-code phpdocumentor-signature ">
  346. <span class="phpdocumentor-signature__visibility">public</span>
  347. <span class="phpdocumentor-signature__name">available</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  348. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  349. <span class="phpdocumentor-signature__response_type">int</span>
  350. &mdash;
  351. <section class="phpdocumentor-description"><p>number of bits that can be read successfully</p>
  352. </section>
  353. </article>
  354. <article
  355. class="phpdocumentor-element
  356. -method
  357. -public
  358. "
  359. >
  360. <h4 class="phpdocumentor-element__name" id="method_clear">
  361. clear()
  362. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear" class="headerlink"><i class="fas fa-link"></i></a>
  363. </h4>
  364. <aside class="phpdocumentor-element-found-in">
  365. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  366. :
  367. <span class="phpdocumentor-element-found-in__line">161</span>
  368. </aside>
  369. <p class="phpdocumentor-summary">Clears the buffer and resets the stats</p>
  370. <code class="phpdocumentor-code phpdocumentor-signature ">
  371. <span class="phpdocumentor-signature__visibility">public</span>
  372. <span class="phpdocumentor-signature__name">clear</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  373. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  374. <span class="phpdocumentor-signature__response_type">self</span>
  375. &mdash;
  376. </article>
  377. <article
  378. class="phpdocumentor-element
  379. -method
  380. -public
  381. "
  382. >
  383. <h4 class="phpdocumentor-element__name" id="method_getBuffer">
  384. getBuffer()
  385. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer" class="headerlink"><i class="fas fa-link"></i></a>
  386. </h4>
  387. <aside class="phpdocumentor-element-found-in">
  388. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  389. :
  390. <span class="phpdocumentor-element-found-in__line">94</span>
  391. </aside>
  392. <p class="phpdocumentor-summary">returns the buffer content</p>
  393. <code class="phpdocumentor-code phpdocumentor-signature ">
  394. <span class="phpdocumentor-signature__visibility">public</span>
  395. <span class="phpdocumentor-signature__name">getBuffer</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
  396. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  397. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  398. &mdash;
  399. </article>
  400. <article
  401. class="phpdocumentor-element
  402. -method
  403. -public
  404. "
  405. >
  406. <h4 class="phpdocumentor-element__name" id="method_getLength">
  407. getLength()
  408. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength" class="headerlink"><i class="fas fa-link"></i></a>
  409. </h4>
  410. <aside class="phpdocumentor-element-found-in">
  411. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  412. :
  413. <span class="phpdocumentor-element-found-in__line">87</span>
  414. </aside>
  415. <p class="phpdocumentor-summary">returns the current buffer length</p>
  416. <code class="phpdocumentor-code phpdocumentor-signature ">
  417. <span class="phpdocumentor-signature__visibility">public</span>
  418. <span class="phpdocumentor-signature__name">getLength</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  419. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  420. <span class="phpdocumentor-signature__response_type">int</span>
  421. &mdash;
  422. </article>
  423. <article
  424. class="phpdocumentor-element
  425. -method
  426. -public
  427. "
  428. >
  429. <h4 class="phpdocumentor-element__name" id="method_put">
  430. put()
  431. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put" class="headerlink"><i class="fas fa-link"></i></a>
  432. </h4>
  433. <aside class="phpdocumentor-element-found-in">
  434. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  435. :
  436. <span class="phpdocumentor-element-found-in__line">56</span>
  437. </aside>
  438. <p class="phpdocumentor-summary">appends a sequence of bits</p>
  439. <code class="phpdocumentor-code phpdocumentor-signature ">
  440. <span class="phpdocumentor-signature__visibility">public</span>
  441. <span class="phpdocumentor-signature__name">put</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bits</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$length</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  442. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  443. <dl class="phpdocumentor-argument-list">
  444. <dt class="phpdocumentor-argument-list__entry">
  445. <span class="phpdocumentor-signature__argument__name">$bits</span>
  446. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  447. </dt>
  448. <dd class="phpdocumentor-argument-list__definition">
  449. <section class="phpdocumentor-description"></section>
  450. </dd>
  451. <dt class="phpdocumentor-argument-list__entry">
  452. <span class="phpdocumentor-signature__argument__name">$length</span>
  453. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  454. </dt>
  455. <dd class="phpdocumentor-argument-list__definition">
  456. <section class="phpdocumentor-description"></section>
  457. </dd>
  458. </dl>
  459. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  460. <span class="phpdocumentor-signature__response_type">self</span>
  461. &mdash;
  462. </article>
  463. <article
  464. class="phpdocumentor-element
  465. -method
  466. -public
  467. "
  468. >
  469. <h4 class="phpdocumentor-element__name" id="method_putBit">
  470. putBit()
  471. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit" class="headerlink"><i class="fas fa-link"></i></a>
  472. </h4>
  473. <aside class="phpdocumentor-element-found-in">
  474. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  475. :
  476. <span class="phpdocumentor-element-found-in__line">68</span>
  477. </aside>
  478. <p class="phpdocumentor-summary">appends a single bit</p>
  479. <code class="phpdocumentor-code phpdocumentor-signature ">
  480. <span class="phpdocumentor-signature__visibility">public</span>
  481. <span class="phpdocumentor-signature__name">putBit</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">bool&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bit</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  482. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  483. <dl class="phpdocumentor-argument-list">
  484. <dt class="phpdocumentor-argument-list__entry">
  485. <span class="phpdocumentor-signature__argument__name">$bit</span>
  486. : <span class="phpdocumentor-signature__argument__return-type">bool</span>
  487. </dt>
  488. <dd class="phpdocumentor-argument-list__definition">
  489. <section class="phpdocumentor-description"></section>
  490. </dd>
  491. </dl>
  492. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  493. <span class="phpdocumentor-signature__response_type">self</span>
  494. &mdash;
  495. </article>
  496. <article
  497. class="phpdocumentor-element
  498. -method
  499. -public
  500. "
  501. >
  502. <h4 class="phpdocumentor-element__name" id="method_read">
  503. read()
  504. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read" class="headerlink"><i class="fas fa-link"></i></a>
  505. </h4>
  506. <aside class="phpdocumentor-element-found-in">
  507. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/BitBuffer.php"><a href="files/src-common-bitbuffer.html"><abbr title="src/Common/BitBuffer.php">BitBuffer.php</abbr></a></abbr>
  508. :
  509. <span class="phpdocumentor-element-found-in__line">113</span>
  510. </aside>
  511. <code class="phpdocumentor-code phpdocumentor-signature ">
  512. <span class="phpdocumentor-signature__visibility">public</span>
  513. <span class="phpdocumentor-signature__name">read</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$numBits</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  514. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  515. <dl class="phpdocumentor-argument-list">
  516. <dt class="phpdocumentor-argument-list__entry">
  517. <span class="phpdocumentor-signature__argument__name">$numBits</span>
  518. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  519. </dt>
  520. <dd class="phpdocumentor-argument-list__definition">
  521. <section class="phpdocumentor-description"><p>number of bits to read</p>
  522. </section>
  523. </dd>
  524. </dl>
  525. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  526. Tags
  527. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  528. </h5>
  529. <dl class="phpdocumentor-tag-list">
  530. <dt class="phpdocumentor-tag-list__entry">
  531. <span class="phpdocumentor-tag__name">author</span>
  532. </dt>
  533. <dd class="phpdocumentor-tag-list__definition">
  534. <section class="phpdocumentor-description"><p>Sean Owen, ZXing</p>
  535. </section>
  536. </dd>
  537. <dt class="phpdocumentor-tag-list__entry">
  538. <span class="phpdocumentor-tag__name">throws</span>
  539. </dt>
  540. <dd class="phpdocumentor-tag-list__definition">
  541. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  542. <section class="phpdocumentor-description"><p>if numBits isn't in [1,32] or more than is available</p>
  543. </section>
  544. </dd>
  545. </dl>
  546. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  547. <span class="phpdocumentor-signature__response_type">int</span>
  548. &mdash;
  549. <section class="phpdocumentor-description"><p>representing the bits read. The bits will appear as the least-significant bits of the int</p>
  550. </section>
  551. </article>
  552. </section>
  553. <script type="text/javascript">
  554. function loadExternalCodeSnippets(line) {
  555. Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
  556. var src = pre.getAttribute('data-src').replace( /\\/g, '/');
  557. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  558. var language = 'php';
  559. var code = document.createElement('code');
  560. code.className = 'language-' + language;
  561. pre.textContent = '';
  562. pre.setAttribute('data-line', line)
  563. code.textContent = 'Loading…';
  564. pre.appendChild(code);
  565. var xhr = new XMLHttpRequest();
  566. xhr.open('GET', src, true);
  567. xhr.onreadystatechange = function () {
  568. if (xhr.readyState == 4) {
  569. if (xhr.status < 400 && xhr.responseText) {
  570. code.textContent = xhr.responseText;
  571. Prism.highlightElement(code);
  572. }
  573. else if (xhr.status >= 400) {
  574. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  575. }
  576. else {
  577. code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
  578. }
  579. }
  580. };
  581. xhr.send(null);
  582. });
  583. }
  584. var modals = document.querySelectorAll("[data-modal]");
  585. modals.forEach(function (trigger) {
  586. trigger.addEventListener("click", function (event) {
  587. //event.preventDefault();
  588. const modal = document.getElementById(trigger.dataset.modal);
  589. modal.classList.add("phpdocumentor-modal__open");
  590. loadExternalCodeSnippets(trigger.dataset.line)
  591. const exits = modal.querySelectorAll("[data-exit-button]");
  592. exits.forEach(function (exit) {
  593. exit.addEventListener("click", function (event) {
  594. event.preventDefault();
  595. modal.classList.remove("phpdocumentor-modal__open");
  596. });
  597. });
  598. });
  599. });
  600. </script>
  601. </article>
  602. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  603. <section class="phpdocumentor-search-results__dialog">
  604. <header class="phpdocumentor-search-results__header">
  605. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  606. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  607. </header>
  608. <section class="phpdocumentor-search-results__body">
  609. <ul class="phpdocumentor-search-results__entries"></ul>
  610. </section>
  611. </section>
  612. </section>
  613. </div>
  614. </div>
  615. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  616. </main>
  617. <script>
  618. cssVars({});
  619. </script>
  620. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  621. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  622. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  623. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  624. </body>
  625. </html>