Ignore:
Timestamp:
May 4, 2026, 7:26:38 AM (10 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
244335b
Parents:
8403b32
Message:

harmonize output quote manipulator with input quote manipulator, adding left/right quote parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/io/manipulatorsOutput1.cfa

    r8403b32 rbb1eabc  
    77// Created On       : Sat Jun  8 18:04:11 2019
    88// Last Modified By : Peter A. Buhr
    9 // Last Modified On : Sat May  2 18:50:48 2026
    10 // Update Count     : 65
     9// Last Modified On : Sun May  3 23:31:09 2026
     10// Update Count     : 76
    1111//
    1212
     
    100100
    101101        sout | nl | "char";
    102         char c = 'a', * qc = "'a'";
    103         printf( "%c%s%c'%c'%8c%8s%5c%-5c\n", c, qc, ' ', ' ', c, qc, c, c );
    104         sout | c | quote(c) | ' ' | quote(' ') | wd(8,c) | quote( wd(8,c) ) | wd(5,c) | left(wd(5,c));
     102        char c = 'a';
     103        printf( "%c'%c'%c'%c'\"%c\"<%c>%8c%8s%8s%8s%5c%-5c\n", c, c, ' ', ' ', c, c, c, "'a'", "\"a\"", "{a}", c, c );
     104        sout | c | quote(c) | ' ' | quote(' ') | quote( c, '"' ) | quote( c, '<', '>' )
     105                 | wd(8,c) | quote( wd(8,c) ) | quote( wd(8,c), '"' ) | quote( wd(8,c), '{', '}' ) | wd(5,c) | left(wd(5,c));
    105106        printf( "%hho %#hho %8hho %#-8hho %hhx %#hhx %8hhx %#-8hhx\n", c, c, c, c, c, c, c, c );
    106107        sout | nobase(oct(c)) | upcase(oct(c)) | nobase(wd(8,oct(c))) | left(wd(-8,oct(c))) | nonl;
     
    109110
    110111        sout | nl | "char *";
    111         const char * s = "abcd", * qs = "\"abcd\"";
    112         printf( "%s %s %8s %8s %6.8s %-8s %-8s\n", s, qs, s, qs, s, s, qs );
    113         sout | s | quote( s ) | wd(8,s) | quote(wd(8,s)) | wd(6,8,s) | left(wd(8,s)) | quote(left(wd(8,s)));
    114         sout | nobase(oct(s)) | upcase(oct(s)) | nobase(wd(8,oct(s))) | left(wd(-8,oct(s)));
    115         sout | nobase(hex(s)) | upcase(hex(s)) | nobase(wd(8,hex(s))) | left(wd(-8,hex(s)));
    116         sout | nobase(bin(s)) | upcase(bin(s)) | nobase(wd(12,bin(s))) | left(wd(-12,bin(s)));
     112        const char * cs = "abcd";
     113        printf( "%s %s %8s %8s %8s %8s %6.8s %-8s %-8s\n", cs, "\"abcd\"", cs, "\"abcd\"", "'abcd'", "<abcd>", cs, cs, "\"abcd\"" );
     114        sout | cs | quote(cs) | wd(8,cs) | quote(wd(8,cs)) | quote(wd(8,cs), '\'')| quote(wd(8,cs), '<', '>')
     115                 | wd(6,8,cs) | left(wd(8,cs)) | quote(left(wd(8,cs)));
     116        sout | nobase(oct(cs)) | upcase(oct(cs)) | nobase(wd(8,oct(cs))) | left(wd(-8,oct(cs)));
     117        sout | nobase(hex(cs)) | upcase(hex(cs)) | nobase(wd(8,hex(cs))) | left(wd(-8,hex(cs)));
     118        sout | nobase(bin(cs)) | upcase(bin(cs)) | nobase(wd(12,bin(cs))) | left(wd(-12,bin(cs)));
    117119}
    118120
Note: See TracChangeset for help on using the changeset viewer.