00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "xrb_ntuple.hpp"
00012
00013 namespace Xrb
00014 {
00015
00016
00017
00018 void Fprint (
00019 FILE *const fptr,
00020 Bool2 const &ntuple,
00021 bool const add_newline)
00022 {
00023 fprintf(
00024 fptr,
00025 "2Tuple = (%s, %s)%c",
00026 BOOL_TO_STRING(ntuple[0]),
00027 BOOL_TO_STRING(ntuple[1]),
00028 add_newline ? '\n' : '\0');
00029 }
00030
00031
00032
00033 void Fprint (
00034 FILE *const fptr,
00035 Alignment2 const &ntuple,
00036 bool const add_newline)
00037 {
00038 char const *stringified0, *stringified1;
00039
00040 switch (ntuple[0])
00041 {
00042 case TOP: stringified0 = STRINGIFY(TOP); break;
00043 case LEFT: stringified0 = STRINGIFY(LEFT); break;
00044 case CENTER: stringified0 = STRINGIFY(CENTER); break;
00045 case BOTTOM: stringified0 = STRINGIFY(BOTTOM); break;
00046 case RIGHT: stringified0 = STRINGIFY(RIGHT); break;
00047 case SPACED: stringified0 = STRINGIFY(SPACED); break;
00048 default: ASSERT1(false && "Invalid Alignment"); return;
00049 }
00050 switch (ntuple[1])
00051 {
00052 case TOP: stringified1 = STRINGIFY(TOP); break;
00053 case LEFT: stringified1 = STRINGIFY(LEFT); break;
00054 case CENTER: stringified1 = STRINGIFY(CENTER); break;
00055 case BOTTOM: stringified1 = STRINGIFY(BOTTOM); break;
00056 case RIGHT: stringified1 = STRINGIFY(RIGHT); break;
00057 case SPACED: stringified1 = STRINGIFY(SPACED); break;
00058 default: ASSERT1(false && "Invalid Alignment"); return;
00059 }
00060
00061 fprintf(
00062 fptr,
00063 "2Tuple = (%s, %s)%c",
00064 stringified0,
00065 stringified1,
00066 add_newline ? '\n' : '\0');
00067 }
00068
00069 }
00070