chillerlan-QRCode-Common-BitBuffer.html 43 KB

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