简体   繁体   中英

ANSI Color extraction library in C/Objective-C

I'm seeking a library, or bit of code I can incorporate into a Cocoa project where I can turn a stream of text with ansi color control codes into an attributed string. There are many projects that do this, but having examined their code they're either messy or overly complex. Has anyone an idea of a simple piece of code, or library, or framework I can use to do this simple task?

I've written a class (called ANSIEscapeHelper ) to translate between NSStrings that contain ANSI escape sequences and similarly formatted NSAttributedStrings . It's released under the MIT License.

I'm not aware of a library or framework. I'd think doing so wouldn't be too hard — I'm new to Cocoa, but I'd probably go the regexen processing path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM