Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/io/manipulatorsOutput1.cfa

    rb19b362 r0effb6a  
    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 : Sat Apr 10 08:42:15 2021
     10// Update Count     : 18
    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));
    105         printf( "%hho %#hho %8hho %#-8hho %hhx %#hhx %8hhx %#-8hhx\n", c, c, c, c, c, c, c, c );
    106         sout | nobase(oct(c)) | upcase(oct(c)) | nobase(wd(8,oct(c))) | left(wd(-8,oct(c))) | nonl;
    107         sout | nobase(hex(c)) | upcase(hex(c)) | nobase(wd(8,hex(c))) | left(wd(-8,hex(c))) | nonl;
    108         sout | nobase(bin(c)) | upcase(bin(c)) | nobase(wd(12,bin(c))) | left(wd(-12,bin(c)));
     102        char c = 'a';
     103        printf( "%c %2c %5c %-5c %hho %#hho %hhx %#hhx %#8hhx %#8hhX %-8c %8c\n", c, c, c, c, c, c, c, c, c, c, c, c );
     104        sout | c | ' ' | wd(2,c) | wd(5,c) | left(wd(5,c)) | nobase(oct(c)) | oct(c) | nonl;
     105        sout | nobase(hex(c)) | hex(c) | wd(8,hex(c)) | upcase(wd(8,hex(c))) | left(wd(8,c)) | wd(8,c);
    109106
    110         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)));
     107        sout | nl | "string";
     108        const char * s = "abcd";
     109        printf( "%s %8s %6.8s %-8s\n", s, s, s, s );
     110        sout | s | wd(8,s) | wd(6,8,s) | left(wd(8,s));
     111
     112        sout | nl | "binary string";
     113        sout | bin("0") | bin(s) | oct(s) | hex(s);
     114        sout | nobase(bin("0")) | nobase(bin(s)) | nobase(oct(s)) | nobase(hex(s));
     115        sout | nobase(wd(8,bin("0"))) | nobase(wd(8,bin(s))) | nobase(wd(4,oct(s))) | nobase(wd(3,hex(s)));
    117116}
    118117
Note: See TracChangeset for help on using the changeset viewer.