• <bdo id='hNbRY'></bdo><ul id='hNbRY'></ul>

    <legend id='hNbRY'><style id='hNbRY'><dir id='hNbRY'><q id='hNbRY'></q></dir></style></legend>
      1. <tfoot id='hNbRY'></tfoot>

        <small id='hNbRY'></small><noframes id='hNbRY'>

      2. <i id='hNbRY'><tr id='hNbRY'><dt id='hNbRY'><q id='hNbRY'><span id='hNbRY'><b id='hNbRY'><form id='hNbRY'><ins id='hNbRY'></ins><ul id='hNbRY'></ul><sub id='hNbRY'></sub></form><legend id='hNbRY'></legend><bdo id='hNbRY'><pre id='hNbRY'><center id='hNbRY'></center></pre></bdo></b><th id='hNbRY'></th></span></q></dt></tr></i><div id='hNbRY'><tfoot id='hNbRY'></tfoot><dl id='hNbRY'><fieldset id='hNbRY'></fieldset></dl></div>

        现成的 C++ 十六进制转储代码

        时间:2023-09-18
      3. <small id='0Wc3N'></small><noframes id='0Wc3N'>

        • <bdo id='0Wc3N'></bdo><ul id='0Wc3N'></ul>
                  <tbody id='0Wc3N'></tbody>

                  <i id='0Wc3N'><tr id='0Wc3N'><dt id='0Wc3N'><q id='0Wc3N'><span id='0Wc3N'><b id='0Wc3N'><form id='0Wc3N'><ins id='0Wc3N'></ins><ul id='0Wc3N'></ul><sub id='0Wc3N'></sub></form><legend id='0Wc3N'></legend><bdo id='0Wc3N'><pre id='0Wc3N'><center id='0Wc3N'></center></pre></bdo></b><th id='0Wc3N'></th></span></q></dt></tr></i><div id='0Wc3N'><tfoot id='0Wc3N'></tfoot><dl id='0Wc3N'><fieldset id='0Wc3N'></fieldset></dl></div>
                  <legend id='0Wc3N'><style id='0Wc3N'><dir id='0Wc3N'><q id='0Wc3N'></q></dir></style></legend>
                  <tfoot id='0Wc3N'></tfoot>
                • 本文介绍了现成的 C++ 十六进制转储代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我经常使用网络和串行通信软件,所以我经常需要代码来显示或记录数据包的十六进制转储.

                  I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets.

                  每次我这样做时,我都会从头开始编写另一个十六进制转储例程.我正要再次这样做,但我想我会在这里问:在某处有没有好的免费的 C++ 十六进制转储代码?

                  Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dump code for C++ out there somewhere?

                  我想要的功能:

                  • 每行 N 个字节(其中 N 以某种方式可配置)
                  • 可选的 ASCII/UTF8 转储与十六进制一起
                  • 可配置缩进、每行前缀、每行后缀等
                  • 最小的依赖(理想情况下,我希望代码都在头文件中,或者是我可以粘贴的片段)

                  说明:我正在寻找可以轻松放入我自己的程序以写入 stderr、stdout、日志文件或其他此类输出流的代码.我不是在寻找命令行十六进制转储实用程序.

                  Clarification: I am looking for code that I can easily drop in to my own programs to write to stderr, stdout, log files, or other such output streams. I'm not looking for a command-line hex dump utility.

                  推荐答案

                  unix 工具 xxd 作为 vim,并根据 http://www.vmunix.com/vim/util.html#xxd,xxd 的来源是 ftp://ftp.uni-erlangen.de:21/pub/utilities/etc/xxd-1.10.tar.gz.它是用 C 编写的,大约有 721 行.为其提供的唯一许可信息如下:

                  The unix tool xxd is distributed as part of vim, and according to http://www.vmunix.com/vim/util.html#xxd, the source for xxd is ftp://ftp.uni-erlangen.de:21/pub/utilities/etc/xxd-1.10.tar.gz. It was written in C and is about 721 lines. The only licensing information given for it is this:

                  * Distribute freely and credit me,
                  * make money and share with me,
                  * lose money and don't ask me.
                  

                  unix 工具 hexdump 可从 http://gd.tuwien.ac.at/softeng/Aegis/hexdump.html.它是用 C 编写的,可以从源代码编译.它比 xxd 大很多,并且是在 GPL 下分发的.

                  The unix tool hexdump is available from http://gd.tuwien.ac.at/softeng/Aegis/hexdump.html. It was written in C and can be compiled from source. It's quite a bit bigger than xxd, and is distributed under the GPL.

                  这篇关于现成的 C++ 十六进制转储代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:无论如何将以下内容编写为 C++ 宏? 下一篇:法线贴图严重错误

                  相关文章

                  最新文章

                • <tfoot id='UYraK'></tfoot>
                • <legend id='UYraK'><style id='UYraK'><dir id='UYraK'><q id='UYraK'></q></dir></style></legend>

                    • <bdo id='UYraK'></bdo><ul id='UYraK'></ul>

                    <i id='UYraK'><tr id='UYraK'><dt id='UYraK'><q id='UYraK'><span id='UYraK'><b id='UYraK'><form id='UYraK'><ins id='UYraK'></ins><ul id='UYraK'></ul><sub id='UYraK'></sub></form><legend id='UYraK'></legend><bdo id='UYraK'><pre id='UYraK'><center id='UYraK'></center></pre></bdo></b><th id='UYraK'></th></span></q></dt></tr></i><div id='UYraK'><tfoot id='UYraK'></tfoot><dl id='UYraK'><fieldset id='UYraK'></fieldset></dl></div>

                    <small id='UYraK'></small><noframes id='UYraK'>