chillerlan-QRCode-Common-BitBuffer.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999
  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=Open+Sans:wght@100;200;300;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/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. </ul>
  59. </nav>
  60. </header>
  61. <main class="phpdocumentor">
  62. <div class="phpdocumentor-section">
  63. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  64. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  65. Menu
  66. </label>
  67. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  68. <section class="phpdocumentor-sidebar__category">
  69. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  70. <h4 class="phpdocumentor-sidebar__root-namespace">
  71. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  72. </h4>
  73. <ul class="phpdocumentor-list">
  74. <li>
  75. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  76. </li>
  77. <li>
  78. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  79. </li>
  80. </ul>
  81. <h4 class="phpdocumentor-sidebar__root-namespace">
  82. <a href="namespaces/output.html" class="">Output</a>
  83. </h4>
  84. </section>
  85. <section class="phpdocumentor-sidebar__category">
  86. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  87. <h4 class="phpdocumentor-sidebar__root-namespace">
  88. <a href="packages/Application.html" class="">Application</a>
  89. </h4>
  90. </section>
  91. <section class="phpdocumentor-sidebar__category">
  92. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  93. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  94. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  95. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  96. </section>
  97. <section class="phpdocumentor-sidebar__category">
  98. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  99. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  100. </section>
  101. </aside>
  102. <div class="phpdocumentor-column -nine phpdocumentor-content">
  103. <section>
  104. <ul class="phpdocumentor-breadcrumbs">
  105. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  106. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  107. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  108. </ul>
  109. <article class="phpdocumentor-element -class">
  110. <h2 class="phpdocumentor-content__title">
  111. BitBuffer
  112. <div class="phpdocumentor-element__package">
  113. in package
  114. <ul class="phpdocumentor-breadcrumbs">
  115. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  116. </ul>
  117. </div>
  118. </h2>
  119. <div class="phpdocumentor-label-line">
  120. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  121. </div>
  122. <aside class="phpdocumentor-element-found-in">
  123. <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>
  124. :
  125. <span class="phpdocumentor-element-found-in__line">19</span>
  126. </aside>
  127. <p class="phpdocumentor-summary">Holds the raw binary data</p>
  128. <h3 id="toc">
  129. Table of Contents
  130. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  131. </h3>
  132. <h4 id="toc-properties">
  133. Properties
  134. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  135. </h4>
  136. <dl class="phpdocumentor-table-of-contents">
  137. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  138. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead">$bitsRead</a>
  139. <span>
  140. &nbsp;: int </span>
  141. </dt>
  142. <dd>Read count (bits)</dd>
  143. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  144. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer">$buffer</a>
  145. <span>
  146. &nbsp;: array&lt;string|int, int&gt; </span>
  147. </dt>
  148. <dd>The buffer content</dd>
  149. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  150. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead">$bytesRead</a>
  151. <span>
  152. &nbsp;: int </span>
  153. </dt>
  154. <dd>Read count (bytes)</dd>
  155. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  156. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length">$length</a>
  157. <span>
  158. &nbsp;: int </span>
  159. </dt>
  160. <dd>Length of the content (bits)</dd>
  161. </dl>
  162. <h4 id="toc-methods">
  163. Methods
  164. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  165. </h4>
  166. <dl class="phpdocumentor-table-of-contents">
  167. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  168. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct">__construct()</a>
  169. <span>
  170. &nbsp;: mixed </span>
  171. </dt>
  172. <dd>BitBuffer constructor.</dd>
  173. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  174. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available">available()</a>
  175. <span>
  176. &nbsp;: int </span>
  177. </dt>
  178. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  179. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear">clear()</a>
  180. <span>
  181. &nbsp;: self </span>
  182. </dt>
  183. <dd>Clears the buffer and resets the stats</dd>
  184. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  185. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer">getBuffer()</a>
  186. <span>
  187. &nbsp;: array&lt;string|int, mixed&gt; </span>
  188. </dt>
  189. <dd>returns the buffer content</dd>
  190. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  191. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength">getLength()</a>
  192. <span>
  193. &nbsp;: int </span>
  194. </dt>
  195. <dd>returns the current buffer length</dd>
  196. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  197. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put">put()</a>
  198. <span>
  199. &nbsp;: self </span>
  200. </dt>
  201. <dd>appends a sequence of bits</dd>
  202. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  203. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit">putBit()</a>
  204. <span>
  205. &nbsp;: self </span>
  206. </dt>
  207. <dd>appends a single bit</dd>
  208. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  209. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read">read()</a>
  210. <span>
  211. &nbsp;: int </span>
  212. </dt>
  213. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  214. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_rewind">rewind()</a>
  215. <span>
  216. &nbsp;: self </span>
  217. </dt>
  218. <dd>Resets the read-counters</dd>
  219. </dl>
  220. <section class="phpdocumentor-properties">
  221. <h3 class="phpdocumentor-elements__header" id="properties">
  222. Properties
  223. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  224. </h3>
  225. <article
  226. class="
  227. phpdocumentor-element
  228. -property
  229. -private
  230. "
  231. >
  232. <h4 class="phpdocumentor-element__name" id="property_bitsRead">
  233. $bitsRead
  234. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead" class="headerlink"><i class="fas fa-link"></i></a>
  235. <span class="phpdocumentor-element__modifiers">
  236. </span>
  237. </h4>
  238. <aside class="phpdocumentor-element-found-in">
  239. <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>
  240. :
  241. <span class="phpdocumentor-element-found-in__line">41</span>
  242. </aside>
  243. <p class="phpdocumentor-summary">Read count (bits)</p>
  244. <code class="phpdocumentor-code phpdocumentor-signature ">
  245. <span class="phpdocumentor-signature__visibility">private</span>
  246. <span class="phpdocumentor-signature__type">int</span>
  247. <span class="phpdocumentor-signature__name">$bitsRead</span>
  248. = <span class="phpdocumentor-signature__default-value">0</span></code>
  249. </article>
  250. <article
  251. class="
  252. phpdocumentor-element
  253. -property
  254. -private
  255. "
  256. >
  257. <h4 class="phpdocumentor-element__name" id="property_buffer">
  258. $buffer
  259. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer" class="headerlink"><i class="fas fa-link"></i></a>
  260. <span class="phpdocumentor-element__modifiers">
  261. </span>
  262. </h4>
  263. <aside class="phpdocumentor-element-found-in">
  264. <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>
  265. :
  266. <span class="phpdocumentor-element-found-in__line">26</span>
  267. </aside>
  268. <p class="phpdocumentor-summary">The buffer content</p>
  269. <code class="phpdocumentor-code phpdocumentor-signature ">
  270. <span class="phpdocumentor-signature__visibility">private</span>
  271. <span class="phpdocumentor-signature__type">array&lt;string|int, int&gt;</span>
  272. <span class="phpdocumentor-signature__name">$buffer</span>
  273. </code>
  274. </article>
  275. <article
  276. class="
  277. phpdocumentor-element
  278. -property
  279. -private
  280. "
  281. >
  282. <h4 class="phpdocumentor-element__name" id="property_bytesRead">
  283. $bytesRead
  284. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead" class="headerlink"><i class="fas fa-link"></i></a>
  285. <span class="phpdocumentor-element__modifiers">
  286. </span>
  287. </h4>
  288. <aside class="phpdocumentor-element-found-in">
  289. <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>
  290. :
  291. <span class="phpdocumentor-element-found-in__line">36</span>
  292. </aside>
  293. <p class="phpdocumentor-summary">Read count (bytes)</p>
  294. <code class="phpdocumentor-code phpdocumentor-signature ">
  295. <span class="phpdocumentor-signature__visibility">private</span>
  296. <span class="phpdocumentor-signature__type">int</span>
  297. <span class="phpdocumentor-signature__name">$bytesRead</span>
  298. = <span class="phpdocumentor-signature__default-value">0</span></code>
  299. </article>
  300. <article
  301. class="
  302. phpdocumentor-element
  303. -property
  304. -private
  305. "
  306. >
  307. <h4 class="phpdocumentor-element__name" id="property_length">
  308. $length
  309. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length" class="headerlink"><i class="fas fa-link"></i></a>
  310. <span class="phpdocumentor-element__modifiers">
  311. </span>
  312. </h4>
  313. <aside class="phpdocumentor-element-found-in">
  314. <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>
  315. :
  316. <span class="phpdocumentor-element-found-in__line">31</span>
  317. </aside>
  318. <p class="phpdocumentor-summary">Length of the content (bits)</p>
  319. <code class="phpdocumentor-code phpdocumentor-signature ">
  320. <span class="phpdocumentor-signature__visibility">private</span>
  321. <span class="phpdocumentor-signature__type">int</span>
  322. <span class="phpdocumentor-signature__name">$length</span>
  323. </code>
  324. </article>
  325. </section>
  326. <section class="phpdocumentor-methods">
  327. <h3 class="phpdocumentor-elements__header" id="methods">
  328. Methods
  329. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  330. </h3>
  331. <article
  332. class="phpdocumentor-element
  333. -method
  334. -public
  335. "
  336. >
  337. <h4 class="phpdocumentor-element__name" id="method___construct">
  338. __construct()
  339. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  340. </h4>
  341. <aside class="phpdocumentor-element-found-in">
  342. <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>
  343. :
  344. <span class="phpdocumentor-element-found-in__line">46</span>
  345. </aside>
  346. <p class="phpdocumentor-summary">BitBuffer constructor.</p>
  347. <code class="phpdocumentor-code phpdocumentor-signature ">
  348. <span class="phpdocumentor-signature__visibility">public</span>
  349. <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, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">[]</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  350. <div class="phpdocumentor-label-line">
  351. </div>
  352. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  353. <dl class="phpdocumentor-argument-list">
  354. <dt class="phpdocumentor-argument-list__entry">
  355. <span class="phpdocumentor-signature__argument__name">$bytes</span>
  356. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  357. = <span class="phpdocumentor-signature__argument__default-value">[]</span> </dt>
  358. <dd class="phpdocumentor-argument-list__definition">
  359. </dd>
  360. </dl>
  361. </article>
  362. <article
  363. class="phpdocumentor-element
  364. -method
  365. -public
  366. "
  367. >
  368. <h4 class="phpdocumentor-element__name" id="method_available">
  369. available()
  370. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available" class="headerlink"><i class="fas fa-link"></i></a>
  371. </h4>
  372. <aside class="phpdocumentor-element-found-in">
  373. <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>
  374. :
  375. <span class="phpdocumentor-element-found-in__line">101</span>
  376. </aside>
  377. <code class="phpdocumentor-code phpdocumentor-signature ">
  378. <span class="phpdocumentor-signature__visibility">public</span>
  379. <span class="phpdocumentor-signature__name">available</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  380. <div class="phpdocumentor-label-line">
  381. </div>
  382. <section>
  383. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  384. <span class="phpdocumentor-signature__response_type">int</span>
  385. &mdash;
  386. <section class="phpdocumentor-description"><p>number of bits that can be read successfully</p>
  387. </section>
  388. </section>
  389. </article>
  390. <article
  391. class="phpdocumentor-element
  392. -method
  393. -public
  394. "
  395. >
  396. <h4 class="phpdocumentor-element__name" id="method_clear">
  397. clear()
  398. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear" 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">161</span>
  404. </aside>
  405. <p class="phpdocumentor-summary">Clears the buffer and resets the stats</p>
  406. <code class="phpdocumentor-code phpdocumentor-signature ">
  407. <span class="phpdocumentor-signature__visibility">public</span>
  408. <span class="phpdocumentor-signature__name">clear</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  409. <div class="phpdocumentor-label-line">
  410. </div>
  411. <section>
  412. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  413. <span class="phpdocumentor-signature__response_type">self</span>
  414. </section>
  415. </article>
  416. <article
  417. class="phpdocumentor-element
  418. -method
  419. -public
  420. "
  421. >
  422. <h4 class="phpdocumentor-element__name" id="method_getBuffer">
  423. getBuffer()
  424. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer" class="headerlink"><i class="fas fa-link"></i></a>
  425. </h4>
  426. <aside class="phpdocumentor-element-found-in">
  427. <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>
  428. :
  429. <span class="phpdocumentor-element-found-in__line">94</span>
  430. </aside>
  431. <p class="phpdocumentor-summary">returns the buffer content</p>
  432. <code class="phpdocumentor-code phpdocumentor-signature ">
  433. <span class="phpdocumentor-signature__visibility">public</span>
  434. <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>
  435. <div class="phpdocumentor-label-line">
  436. </div>
  437. <section class="phpdocumentor-description"><p>to debug: array_map(fn($v) =&gt; sprintf('%08b', $v), $bitBuffer-&gt;getBuffer())</p>
  438. </section>
  439. <section>
  440. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  441. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  442. </section>
  443. </article>
  444. <article
  445. class="phpdocumentor-element
  446. -method
  447. -public
  448. "
  449. >
  450. <h4 class="phpdocumentor-element__name" id="method_getLength">
  451. getLength()
  452. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength" class="headerlink"><i class="fas fa-link"></i></a>
  453. </h4>
  454. <aside class="phpdocumentor-element-found-in">
  455. <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>
  456. :
  457. <span class="phpdocumentor-element-found-in__line">85</span>
  458. </aside>
  459. <p class="phpdocumentor-summary">returns the current buffer length</p>
  460. <code class="phpdocumentor-code phpdocumentor-signature ">
  461. <span class="phpdocumentor-signature__visibility">public</span>
  462. <span class="phpdocumentor-signature__name">getLength</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  463. <div class="phpdocumentor-label-line">
  464. </div>
  465. <section>
  466. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  467. <span class="phpdocumentor-signature__response_type">int</span>
  468. </section>
  469. </article>
  470. <article
  471. class="phpdocumentor-element
  472. -method
  473. -public
  474. "
  475. >
  476. <h4 class="phpdocumentor-element__name" id="method_put">
  477. put()
  478. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put" class="headerlink"><i class="fas fa-link"></i></a>
  479. </h4>
  480. <aside class="phpdocumentor-element-found-in">
  481. <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>
  482. :
  483. <span class="phpdocumentor-element-found-in__line">54</span>
  484. </aside>
  485. <p class="phpdocumentor-summary">appends a sequence of bits</p>
  486. <code class="phpdocumentor-code phpdocumentor-signature ">
  487. <span class="phpdocumentor-signature__visibility">public</span>
  488. <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>
  489. <div class="phpdocumentor-label-line">
  490. </div>
  491. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  492. <dl class="phpdocumentor-argument-list">
  493. <dt class="phpdocumentor-argument-list__entry">
  494. <span class="phpdocumentor-signature__argument__name">$bits</span>
  495. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  496. </dt>
  497. <dd class="phpdocumentor-argument-list__definition">
  498. </dd>
  499. <dt class="phpdocumentor-argument-list__entry">
  500. <span class="phpdocumentor-signature__argument__name">$length</span>
  501. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  502. </dt>
  503. <dd class="phpdocumentor-argument-list__definition">
  504. </dd>
  505. </dl>
  506. <section>
  507. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  508. <span class="phpdocumentor-signature__response_type">self</span>
  509. </section>
  510. </article>
  511. <article
  512. class="phpdocumentor-element
  513. -method
  514. -public
  515. "
  516. >
  517. <h4 class="phpdocumentor-element__name" id="method_putBit">
  518. putBit()
  519. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit" class="headerlink"><i class="fas fa-link"></i></a>
  520. </h4>
  521. <aside class="phpdocumentor-element-found-in">
  522. <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>
  523. :
  524. <span class="phpdocumentor-element-found-in__line">66</span>
  525. </aside>
  526. <p class="phpdocumentor-summary">appends a single bit</p>
  527. <code class="phpdocumentor-code phpdocumentor-signature ">
  528. <span class="phpdocumentor-signature__visibility">public</span>
  529. <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>
  530. <div class="phpdocumentor-label-line">
  531. </div>
  532. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  533. <dl class="phpdocumentor-argument-list">
  534. <dt class="phpdocumentor-argument-list__entry">
  535. <span class="phpdocumentor-signature__argument__name">$bit</span>
  536. : <span class="phpdocumentor-signature__argument__return-type">bool</span>
  537. </dt>
  538. <dd class="phpdocumentor-argument-list__definition">
  539. </dd>
  540. </dl>
  541. <section>
  542. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  543. <span class="phpdocumentor-signature__response_type">self</span>
  544. </section>
  545. </article>
  546. <article
  547. class="phpdocumentor-element
  548. -method
  549. -public
  550. "
  551. >
  552. <h4 class="phpdocumentor-element__name" id="method_read">
  553. read()
  554. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read" class="headerlink"><i class="fas fa-link"></i></a>
  555. </h4>
  556. <aside class="phpdocumentor-element-found-in">
  557. <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>
  558. :
  559. <span class="phpdocumentor-element-found-in__line">113</span>
  560. </aside>
  561. <code class="phpdocumentor-code phpdocumentor-signature ">
  562. <span class="phpdocumentor-signature__visibility">public</span>
  563. <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>
  564. <div class="phpdocumentor-label-line">
  565. </div>
  566. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  567. <dl class="phpdocumentor-argument-list">
  568. <dt class="phpdocumentor-argument-list__entry">
  569. <span class="phpdocumentor-signature__argument__name">$numBits</span>
  570. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  571. </dt>
  572. <dd class="phpdocumentor-argument-list__definition">
  573. <section class="phpdocumentor-description"><p>number of bits to read</p>
  574. </section>
  575. </dd>
  576. </dl>
  577. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  578. Tags
  579. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read#tags" class="headerlink"><i class="fas fa-link"></i></a>
  580. </h5>
  581. <dl class="phpdocumentor-tag-list">
  582. <dt class="phpdocumentor-tag-list__entry">
  583. <span class="phpdocumentor-tag__name">author</span>
  584. </dt>
  585. <dd class="phpdocumentor-tag-list__definition">
  586. <section class="phpdocumentor-description"><p>Sean Owen, ZXing</p>
  587. </section>
  588. </dd>
  589. <dt class="phpdocumentor-tag-list__entry">
  590. <span class="phpdocumentor-tag__name">throws</span>
  591. </dt>
  592. <dd class="phpdocumentor-tag-list__definition">
  593. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  594. <section class="phpdocumentor-description"><p>if numBits isn't in [1,32] or more than is available</p>
  595. </section>
  596. </dd>
  597. </dl>
  598. <section>
  599. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  600. <span class="phpdocumentor-signature__response_type">int</span>
  601. &mdash;
  602. <section class="phpdocumentor-description"><p>representing the bits read. The bits will appear as the least-significant bits of the int</p>
  603. </section>
  604. </section>
  605. </article>
  606. <article
  607. class="phpdocumentor-element
  608. -method
  609. -public
  610. "
  611. >
  612. <h4 class="phpdocumentor-element__name" id="method_rewind">
  613. rewind()
  614. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_rewind" class="headerlink"><i class="fas fa-link"></i></a>
  615. </h4>
  616. <aside class="phpdocumentor-element-found-in">
  617. <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>
  618. :
  619. <span class="phpdocumentor-element-found-in__line">171</span>
  620. </aside>
  621. <p class="phpdocumentor-summary">Resets the read-counters</p>
  622. <code class="phpdocumentor-code phpdocumentor-signature ">
  623. <span class="phpdocumentor-signature__visibility">public</span>
  624. <span class="phpdocumentor-signature__name">rewind</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  625. <div class="phpdocumentor-label-line">
  626. </div>
  627. <section>
  628. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  629. <span class="phpdocumentor-signature__response_type">self</span>
  630. </section>
  631. </article>
  632. </section>
  633. <div class="phpdocumentor-modal" id="source-view">
  634. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  635. <div class="phpdocumentor-modal-container">
  636. <div class="phpdocumentor-modal-content">
  637. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Common/BitBuffer.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  638. </div>
  639. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  640. </div>
  641. </div>
  642. <script type="text/javascript">
  643. (function () {
  644. function loadExternalCodeSnippet(el, url, line) {
  645. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  646. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  647. const language = 'php';
  648. const code = document.createElement('code');
  649. code.className = 'language-' + language;
  650. pre.textContent = '';
  651. pre.setAttribute('data-line', line)
  652. code.textContent = 'Loading…';
  653. pre.appendChild(code);
  654. var xhr = new XMLHttpRequest();
  655. xhr.open('GET', src, true);
  656. xhr.onreadystatechange = function () {
  657. if (xhr.readyState !== 4) {
  658. return;
  659. }
  660. if (xhr.status < 400 && xhr.responseText) {
  661. code.textContent = xhr.responseText;
  662. Prism.highlightElement(code);
  663. return;
  664. }
  665. if (xhr.status === 404) {
  666. code.textContent = '✖ Error: File could not be found';
  667. return;
  668. }
  669. if (xhr.status >= 400) {
  670. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  671. return;
  672. }
  673. code.textContent = '✖ Error: An unknown error occurred';
  674. };
  675. xhr.send(null);
  676. });
  677. }
  678. const modalButtons = document.querySelectorAll("[data-modal]");
  679. const openedAsLocalFile = window.location.protocol === 'file:';
  680. if (modalButtons.length > 0 && openedAsLocalFile) {
  681. console.warn(
  682. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  683. 'browsers block XHR requests when a page is opened this way'
  684. );
  685. }
  686. modalButtons.forEach(function (trigger) {
  687. if (openedAsLocalFile) {
  688. trigger.setAttribute("hidden", "hidden");
  689. }
  690. trigger.addEventListener("click", function (event) {
  691. event.preventDefault();
  692. const modal = document.getElementById(trigger.dataset.modal);
  693. if (!modal) {
  694. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  695. return;
  696. }
  697. modal.classList.add("phpdocumentor-modal__open");
  698. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  699. const exits = modal.querySelectorAll("[data-exit-button]");
  700. exits.forEach(function (exit) {
  701. exit.addEventListener("click", function (event) {
  702. event.preventDefault();
  703. modal.classList.remove("phpdocumentor-modal__open");
  704. });
  705. });
  706. });
  707. });
  708. })();
  709. </script>
  710. </article>
  711. </section>
  712. <section class="phpdocumentor-on-this-page__sidebar">
  713. <section class="phpdocumentor-on-this-page__content">
  714. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  715. <ul class="phpdocumentor-list -clean">
  716. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  717. <li>
  718. <ul class="phpdocumentor-list -clean">
  719. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc-properties">Properties</a></li>
  720. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc-methods">Methods</a></li>
  721. </ul>
  722. </li>
  723. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  724. <li>
  725. <ul class="phpdocumentor-list -clean">
  726. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead">$bitsRead<a href="classes/chillerlan-QRCode-Common-BitBuffer.html"></li>
  727. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer">$buffer<a href="classes/chillerlan-QRCode-Common-BitBuffer.html"></li>
  728. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead">$bytesRead<a href="classes/chillerlan-QRCode-Common-BitBuffer.html"></li>
  729. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length">$length<a href="classes/chillerlan-QRCode-Common-BitBuffer.html"></li>
  730. </ul>
  731. </li>
  732. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  733. <li>
  734. <ul class="phpdocumentor-list -clean">
  735. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct">__construct()</a></li>
  736. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available">available()</a></li>
  737. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear">clear()</a></li>
  738. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer">getBuffer()</a></li>
  739. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength">getLength()</a></li>
  740. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put">put()</a></li>
  741. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit">putBit()</a></li>
  742. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read">read()</a></li>
  743. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_rewind">rewind()</a></li>
  744. </ul>
  745. </li>
  746. </ul>
  747. </section>
  748. </section>
  749. </div>
  750. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  751. <section class="phpdocumentor-search-results__dialog">
  752. <header class="phpdocumentor-search-results__header">
  753. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  754. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  755. </header>
  756. <section class="phpdocumentor-search-results__body">
  757. <ul class="phpdocumentor-search-results__entries"></ul>
  758. </section>
  759. </section>
  760. </section>
  761. </div>
  762. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  763. </main>
  764. <script>
  765. cssVars({});
  766. </script>
  767. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  768. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  769. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  770. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  771. </body>
  772. </html>