chillerlan-QRCode-Common-BitBuffer.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  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"><a href="namespaces/chillerlan.html">chillerlan</a></h4>
  56. <ul class="phpdocumentor-list">
  57. <li>
  58. <a href="namespaces/chillerlan-qrcode.html">QRCode</a>
  59. </li>
  60. <li>
  61. <a href="namespaces/chillerlan-qrcodetest.html">QRCodeTest</a>
  62. </li>
  63. </ul>
  64. </section>
  65. <section class="phpdocumentor-sidebar__category">
  66. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  67. <h4 class="phpdocumentor-sidebar__root-namespace"><a href="packages/Application.html">Application</a></h4>
  68. </section>
  69. <section class="phpdocumentor-sidebar__category">
  70. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  71. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  72. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  73. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  74. </section>
  75. <section class="phpdocumentor-sidebar__category">
  76. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  77. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  78. </section>
  79. </aside>
  80. <div class="phpdocumentor-column -eight phpdocumentor-content">
  81. <ul class="phpdocumentor-breadcrumbs">
  82. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  83. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  84. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  85. </ul>
  86. <article class="phpdocumentor-element -class">
  87. <h2 class="phpdocumentor-content__title">
  88. BitBuffer
  89. <div class="phpdocumentor-element__package">
  90. in package
  91. <ul class="phpdocumentor-breadcrumbs">
  92. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  93. </ul>
  94. </div>
  95. </h2>
  96. <aside class="phpdocumentor-element-found-in">
  97. <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>
  98. :
  99. <span class="phpdocumentor-element-found-in__line">19</span>
  100. </aside>
  101. <p class="phpdocumentor-summary">Holds the raw binary data</p>
  102. <h3 id="toc">
  103. Table of Contents
  104. <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
  105. </h3>
  106. <dl class="phpdocumentor-table-of-contents">
  107. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  108. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead">$bitsRead</a>
  109. <span>
  110. &nbsp;: int </span>
  111. </dt>
  112. <dd>Read count (bits)</dd>
  113. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  114. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer">$buffer</a>
  115. <span>
  116. &nbsp;: array&lt;string|int, mixed&gt; </span>
  117. </dt>
  118. <dd>The buffer content</dd>
  119. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  120. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead">$bytesRead</a>
  121. <span>
  122. &nbsp;: int </span>
  123. </dt>
  124. <dd>Read count (bytes)</dd>
  125. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  126. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length">$length</a>
  127. <span>
  128. &nbsp;: int </span>
  129. </dt>
  130. <dd>Length of the content (bits)</dd>
  131. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  132. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct">__construct()</a>
  133. <span>
  134. &nbsp;: mixed </span>
  135. </dt>
  136. <dd>BitBuffer constructor.</dd>
  137. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  138. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available">available()</a>
  139. <span>
  140. &nbsp;: int </span>
  141. </dt>
  142. <dd></dd>
  143. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  144. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer">getBuffer()</a>
  145. <span>
  146. &nbsp;: array&lt;string|int, mixed&gt; </span>
  147. </dt>
  148. <dd>returns the buffer content</dd>
  149. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  150. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength">getLength()</a>
  151. <span>
  152. &nbsp;: int </span>
  153. </dt>
  154. <dd>returns the current buffer length</dd>
  155. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  156. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put">put()</a>
  157. <span>
  158. &nbsp;: self </span>
  159. </dt>
  160. <dd>appends a sequence of bits</dd>
  161. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  162. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit">putBit()</a>
  163. <span>
  164. &nbsp;: self </span>
  165. </dt>
  166. <dd>appends a single bit</dd>
  167. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  168. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read">read()</a>
  169. <span>
  170. &nbsp;: int </span>
  171. </dt>
  172. <dd></dd>
  173. </dl>
  174. <section class="phpdocumentor-properties">
  175. <h3 class="phpdocumentor-elements__header" id="properties">
  176. Properties
  177. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  178. </h3>
  179. <article
  180. class="
  181. phpdocumentor-element
  182. -property
  183. -private
  184. "
  185. >
  186. <h4 class="phpdocumentor-element__name" id="property_bitsRead">
  187. $bitsRead
  188. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead" class="headerlink"><i class="fas fa-link"></i></a>
  189. <span class="phpdocumentor-element__modifiers">
  190. </span>
  191. </h4>
  192. <aside class="phpdocumentor-element-found-in">
  193. <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>
  194. :
  195. <span class="phpdocumentor-element-found-in__line">41</span>
  196. </aside>
  197. <p class="phpdocumentor-summary">Read count (bits)</p>
  198. <code class="phpdocumentor-code phpdocumentor-signature ">
  199. <span class="phpdocumentor-signature__visibility">private</span>
  200. <span class="phpdocumentor-signature__type">int</span>
  201. <span class="phpdocumentor-signature__name">$bitsRead</span>
  202. = <span class="phpdocumentor-signature__default-value">0</span></code>
  203. <section class="phpdocumentor-description"></section>
  204. </article>
  205. <article
  206. class="
  207. phpdocumentor-element
  208. -property
  209. -private
  210. "
  211. >
  212. <h4 class="phpdocumentor-element__name" id="property_buffer">
  213. $buffer
  214. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer" class="headerlink"><i class="fas fa-link"></i></a>
  215. <span class="phpdocumentor-element__modifiers">
  216. </span>
  217. </h4>
  218. <aside class="phpdocumentor-element-found-in">
  219. <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>
  220. :
  221. <span class="phpdocumentor-element-found-in__line">26</span>
  222. </aside>
  223. <p class="phpdocumentor-summary">The buffer content</p>
  224. <code class="phpdocumentor-code phpdocumentor-signature ">
  225. <span class="phpdocumentor-signature__visibility">private</span>
  226. <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
  227. <span class="phpdocumentor-signature__name">$buffer</span>
  228. </code>
  229. </article>
  230. <article
  231. class="
  232. phpdocumentor-element
  233. -property
  234. -private
  235. "
  236. >
  237. <h4 class="phpdocumentor-element__name" id="property_bytesRead">
  238. $bytesRead
  239. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead" class="headerlink"><i class="fas fa-link"></i></a>
  240. <span class="phpdocumentor-element__modifiers">
  241. </span>
  242. </h4>
  243. <aside class="phpdocumentor-element-found-in">
  244. <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>
  245. :
  246. <span class="phpdocumentor-element-found-in__line">36</span>
  247. </aside>
  248. <p class="phpdocumentor-summary">Read count (bytes)</p>
  249. <code class="phpdocumentor-code phpdocumentor-signature ">
  250. <span class="phpdocumentor-signature__visibility">private</span>
  251. <span class="phpdocumentor-signature__type">int</span>
  252. <span class="phpdocumentor-signature__name">$bytesRead</span>
  253. = <span class="phpdocumentor-signature__default-value">0</span></code>
  254. <section class="phpdocumentor-description"></section>
  255. </article>
  256. <article
  257. class="
  258. phpdocumentor-element
  259. -property
  260. -private
  261. "
  262. >
  263. <h4 class="phpdocumentor-element__name" id="property_length">
  264. $length
  265. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length" class="headerlink"><i class="fas fa-link"></i></a>
  266. <span class="phpdocumentor-element__modifiers">
  267. </span>
  268. </h4>
  269. <aside class="phpdocumentor-element-found-in">
  270. <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>
  271. :
  272. <span class="phpdocumentor-element-found-in__line">31</span>
  273. </aside>
  274. <p class="phpdocumentor-summary">Length of the content (bits)</p>
  275. <code class="phpdocumentor-code phpdocumentor-signature ">
  276. <span class="phpdocumentor-signature__visibility">private</span>
  277. <span class="phpdocumentor-signature__type">int</span>
  278. <span class="phpdocumentor-signature__name">$length</span>
  279. </code>
  280. <section class="phpdocumentor-description"></section>
  281. </article>
  282. </section>
  283. <section class="phpdocumentor-methods">
  284. <h3 class="phpdocumentor-elements__header" id="methods">
  285. Methods
  286. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  287. </h3>
  288. <article
  289. class="phpdocumentor-element
  290. -method
  291. -public
  292. "
  293. >
  294. <h4 class="phpdocumentor-element__name" id="method___construct">
  295. __construct()
  296. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  297. </h4>
  298. <aside class="phpdocumentor-element-found-in">
  299. <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>
  300. :
  301. <span class="phpdocumentor-element-found-in__line">48</span>
  302. </aside>
  303. <p class="phpdocumentor-summary">BitBuffer constructor.</p>
  304. <code class="phpdocumentor-code phpdocumentor-signature ">
  305. <span class="phpdocumentor-signature__visibility">public</span>
  306. <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>
  307. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  308. <dl class="phpdocumentor-argument-list">
  309. <dt class="phpdocumentor-argument-list__entry">
  310. <span class="phpdocumentor-signature__argument__name">$bytes</span>
  311. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, int&gt;|null</span>
  312. = <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
  313. <dd class="phpdocumentor-argument-list__definition">
  314. </dd>
  315. </dl>
  316. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  317. <span class="phpdocumentor-signature__response_type">mixed</span>
  318. &mdash;
  319. </article>
  320. <article
  321. class="phpdocumentor-element
  322. -method
  323. -public
  324. "
  325. >
  326. <h4 class="phpdocumentor-element__name" id="method_available">
  327. available()
  328. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available" class="headerlink"><i class="fas fa-link"></i></a>
  329. </h4>
  330. <aside class="phpdocumentor-element-found-in">
  331. <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>
  332. :
  333. <span class="phpdocumentor-element-found-in__line">101</span>
  334. </aside>
  335. <code class="phpdocumentor-code phpdocumentor-signature ">
  336. <span class="phpdocumentor-signature__visibility">public</span>
  337. <span class="phpdocumentor-signature__name">available</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  338. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  339. <span class="phpdocumentor-signature__response_type">int</span>
  340. &mdash;
  341. <section class="phpdocumentor-description"><p>number of bits that can be read successfully</p>
  342. </section>
  343. </article>
  344. <article
  345. class="phpdocumentor-element
  346. -method
  347. -public
  348. "
  349. >
  350. <h4 class="phpdocumentor-element__name" id="method_getBuffer">
  351. getBuffer()
  352. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer" class="headerlink"><i class="fas fa-link"></i></a>
  353. </h4>
  354. <aside class="phpdocumentor-element-found-in">
  355. <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>
  356. :
  357. <span class="phpdocumentor-element-found-in__line">94</span>
  358. </aside>
  359. <p class="phpdocumentor-summary">returns the buffer content</p>
  360. <code class="phpdocumentor-code phpdocumentor-signature ">
  361. <span class="phpdocumentor-signature__visibility">public</span>
  362. <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>
  363. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  364. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  365. &mdash;
  366. </article>
  367. <article
  368. class="phpdocumentor-element
  369. -method
  370. -public
  371. "
  372. >
  373. <h4 class="phpdocumentor-element__name" id="method_getLength">
  374. getLength()
  375. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength" class="headerlink"><i class="fas fa-link"></i></a>
  376. </h4>
  377. <aside class="phpdocumentor-element-found-in">
  378. <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>
  379. :
  380. <span class="phpdocumentor-element-found-in__line">87</span>
  381. </aside>
  382. <p class="phpdocumentor-summary">returns the current buffer length</p>
  383. <code class="phpdocumentor-code phpdocumentor-signature ">
  384. <span class="phpdocumentor-signature__visibility">public</span>
  385. <span class="phpdocumentor-signature__name">getLength</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  386. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  387. <span class="phpdocumentor-signature__response_type">int</span>
  388. &mdash;
  389. </article>
  390. <article
  391. class="phpdocumentor-element
  392. -method
  393. -public
  394. "
  395. >
  396. <h4 class="phpdocumentor-element__name" id="method_put">
  397. put()
  398. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put" class="headerlink"><i class="fas fa-link"></i></a>
  399. </h4>
  400. <aside class="phpdocumentor-element-found-in">
  401. <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>
  402. :
  403. <span class="phpdocumentor-element-found-in__line">56</span>
  404. </aside>
  405. <p class="phpdocumentor-summary">appends a sequence of bits</p>
  406. <code class="phpdocumentor-code phpdocumentor-signature ">
  407. <span class="phpdocumentor-signature__visibility">public</span>
  408. <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>
  409. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  410. <dl class="phpdocumentor-argument-list">
  411. <dt class="phpdocumentor-argument-list__entry">
  412. <span class="phpdocumentor-signature__argument__name">$bits</span>
  413. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  414. </dt>
  415. <dd class="phpdocumentor-argument-list__definition">
  416. <section class="phpdocumentor-description"></section>
  417. </dd>
  418. <dt class="phpdocumentor-argument-list__entry">
  419. <span class="phpdocumentor-signature__argument__name">$length</span>
  420. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  421. </dt>
  422. <dd class="phpdocumentor-argument-list__definition">
  423. <section class="phpdocumentor-description"></section>
  424. </dd>
  425. </dl>
  426. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  427. <span class="phpdocumentor-signature__response_type">self</span>
  428. &mdash;
  429. </article>
  430. <article
  431. class="phpdocumentor-element
  432. -method
  433. -public
  434. "
  435. >
  436. <h4 class="phpdocumentor-element__name" id="method_putBit">
  437. putBit()
  438. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit" class="headerlink"><i class="fas fa-link"></i></a>
  439. </h4>
  440. <aside class="phpdocumentor-element-found-in">
  441. <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>
  442. :
  443. <span class="phpdocumentor-element-found-in__line">68</span>
  444. </aside>
  445. <p class="phpdocumentor-summary">appends a single bit</p>
  446. <code class="phpdocumentor-code phpdocumentor-signature ">
  447. <span class="phpdocumentor-signature__visibility">public</span>
  448. <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>
  449. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  450. <dl class="phpdocumentor-argument-list">
  451. <dt class="phpdocumentor-argument-list__entry">
  452. <span class="phpdocumentor-signature__argument__name">$bit</span>
  453. : <span class="phpdocumentor-signature__argument__return-type">bool</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_read">
  470. read()
  471. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read" 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">113</span>
  477. </aside>
  478. <code class="phpdocumentor-code phpdocumentor-signature ">
  479. <span class="phpdocumentor-signature__visibility">public</span>
  480. <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>
  481. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  482. <dl class="phpdocumentor-argument-list">
  483. <dt class="phpdocumentor-argument-list__entry">
  484. <span class="phpdocumentor-signature__argument__name">$numBits</span>
  485. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  486. </dt>
  487. <dd class="phpdocumentor-argument-list__definition">
  488. <section class="phpdocumentor-description"><p>number of bits to read</p>
  489. </section>
  490. </dd>
  491. </dl>
  492. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  493. Tags
  494. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  495. </h5>
  496. <dl class="phpdocumentor-tag-list">
  497. <dt class="phpdocumentor-tag-list__entry">
  498. <span class="phpdocumentor-tag__name">author</span>
  499. </dt>
  500. <dd class="phpdocumentor-tag-list__definition">
  501. <section class="phpdocumentor-description"><p>Sean Owen, ZXing</p>
  502. </section>
  503. </dd>
  504. <dt class="phpdocumentor-tag-list__entry">
  505. <span class="phpdocumentor-tag__name">throws</span>
  506. </dt>
  507. <dd class="phpdocumentor-tag-list__definition">
  508. <span class="phpdocumentor-tag-link"><abbr title="\InvalidArgumentException">InvalidArgumentException</abbr></span>
  509. <section class="phpdocumentor-description"><p>if numBits isn't in [1,32] or more than is available</p>
  510. </section>
  511. </dd>
  512. </dl>
  513. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  514. <span class="phpdocumentor-signature__response_type">int</span>
  515. &mdash;
  516. <section class="phpdocumentor-description"><p>representing the bits read. The bits will appear as the least-significant bits of the int</p>
  517. </section>
  518. </article>
  519. </section>
  520. <script type="text/javascript">
  521. function loadExternalCodeSnippets(line) {
  522. Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
  523. var src = pre.getAttribute('data-src').replace( /\\/g, '/');
  524. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  525. var language = 'php';
  526. var code = document.createElement('code');
  527. code.className = 'language-' + language;
  528. pre.textContent = '';
  529. pre.setAttribute('data-line', line)
  530. code.textContent = 'Loading…';
  531. pre.appendChild(code);
  532. var xhr = new XMLHttpRequest();
  533. xhr.open('GET', src, true);
  534. xhr.onreadystatechange = function () {
  535. if (xhr.readyState == 4) {
  536. if (xhr.status < 400 && xhr.responseText) {
  537. code.textContent = xhr.responseText;
  538. Prism.highlightElement(code);
  539. }
  540. else if (xhr.status >= 400) {
  541. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  542. }
  543. else {
  544. code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
  545. }
  546. }
  547. };
  548. xhr.send(null);
  549. });
  550. }
  551. var modals = document.querySelectorAll("[data-modal]");
  552. modals.forEach(function (trigger) {
  553. trigger.addEventListener("click", function (event) {
  554. //event.preventDefault();
  555. const modal = document.getElementById(trigger.dataset.modal);
  556. modal.classList.add("phpdocumentor-modal__open");
  557. loadExternalCodeSnippets(trigger.dataset.line)
  558. const exits = modal.querySelectorAll("[data-exit-button]");
  559. exits.forEach(function (exit) {
  560. exit.addEventListener("click", function (event) {
  561. event.preventDefault();
  562. modal.classList.remove("phpdocumentor-modal__open");
  563. });
  564. });
  565. });
  566. });
  567. </script>
  568. </article>
  569. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  570. <section class="phpdocumentor-search-results__dialog">
  571. <header class="phpdocumentor-search-results__header">
  572. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  573. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  574. </header>
  575. <section class="phpdocumentor-search-results__body">
  576. <ul class="phpdocumentor-search-results__entries"></ul>
  577. </section>
  578. </section>
  579. </section>
  580. </div>
  581. </div>
  582. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  583. </main>
  584. <script>
  585. cssVars({});
  586. </script>
  587. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  588. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  589. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  590. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  591. </body>
  592. </html>