showansi.doc
来自「国外网站上的一些精典的C程序」· DOC 代码 · 共 45 行
DOC
45 行
About a year or so ago I published an ANSI viewer here called "showansi", thepurpose of which was to view ANSI files compatible with the DOS ANSI.SYS.These files are used not only for artwork of various types, but are used fordisplaying screens with various BBS packages.What follows is a reworked version of that viewer, again in a class implementation and adds the following features: o Bugs in the ANSI interpreter have been fixed; namely, an '8' is no longer misinterpreted as a backspace (whoops!) and the ansi sequence parser has been fixed and simplified. A minor bug in the video class was also corrected and the scroll() member was enhanced to allow scrolling downwards. o Wildcard expansion has been added, thanks to the DIRPORT package in Bob Stout's SNIPPETS. Since these were modified for 32-bit OS/2 support, I have included them here also. You can now say: "showansi *.ans", for example. o The "ansisys" class was broken up into two classes for allowing the system to be extended to other types of screen interpreters. A base class "scrinterp" was defined with all the basic 'get' and standard put functions implemented, leaving interpretation of special characters to derived classes. o In view of the previous item, an AVATAR level 0+ (well, almost :-)) was added, allowing avatar/mecca/oansi files to be viewed as well. A special switch was added (-a) to allow the input file type to be toggled.This was tested and ported for Watcom C++ under OS/2 and MSDOS in both 16 and32 bit modes (although a DOS4G executable is probably going a wee bit far:-)), and OS/2 emx 32-bit. The resulting emx executable will not run underDOS since the video calls the OS/2 API directly - this could probably bechanged by changing those calls to emx's 'portable' video interface; perhapssomeone interested will port it and send diffs or whatever. For Watcom,compile in large model for the 16-bit executable under OS/2, and you willneed a copy of the 16-bit OS/2 toolkit (OS/2 toolkit 1.3).Enjoy! David Nugent
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?