BRL-CAD

Routines for generally (i.e., non-mathematically) handling numbers, strings, and other data for tabular printing. More...

Collaboration diagram for Tabular Printing:

Files

file  tbl.h
 

Macros

#define BU_TBL_INIT_ZERO   {0}
 

Enumerations

enum  bu_tbl_style {
  BU_TBL_STYLE_NONE , BU_TBL_STYLE_LIST , BU_TBL_STYLE_BASIC , BU_TBL_STYLE_SINGLE ,
  BU_TBL_STYLE_DOUBLE , BU_TBL_ALIGN_LEFT , BU_TBL_ALIGN_CENTER , BU_TBL_ALIGN_RIGHT ,
  BU_TBL_ROW_HEADER , BU_TBL_ROW_SEPARATOR , BU_TBL_ROW_ALIGN_LEFT , BU_TBL_ROW_ALIGN_CENTER ,
  BU_TBL_ROW_ALIGN_RIGHT , BU_TBL_COL_ALIGN_LEFT , BU_TBL_COL_ALIGN_CENTER , BU_TBL_COL_ALIGN_RIGHT ,
  BU_TBL_ROW_END
}
 

Functions

struct bu_tbl * bu_tbl_create (void)
 
void bu_tbl_destroy (struct bu_tbl *)
 
int bu_tbl_clear (struct bu_tbl *)
 
struct bu_tbl * bu_tbl_style (struct bu_tbl *, enum bu_tbl_style)
 
struct bu_tbl * bu_tbl_is_at (struct bu_tbl *, size_t *row, size_t *col)
 
struct bu_tbl * bu_tbl_go_to (struct bu_tbl *, size_t row, size_t col)
 
struct bu_tbl * bu_tbl_printf (struct bu_tbl *, const char *fmt,...)
 
void bu_tbl_vls (struct bu_vls *str, const struct bu_tbl *t)
 

Detailed Description

Routines for generally (i.e., non-mathematically) handling numbers, strings, and other data for tabular printing.

Macro Definition Documentation

◆ BU_TBL_INIT_ZERO

#define BU_TBL_INIT_ZERO   {0}

static-initializer for bu_tbl objects on the stack

Definition at line 120 of file tbl.h.

Enumeration Type Documentation

◆ bu_tbl_style

Table styles:

NONE 1 ---— — +----—+—+ ╭────────┬───╮ ╔════════╦═══╗ 2 3 LIST 1 | BASIC | 1 | │ SINGLE │ 1 │ ║ DOUBLE ║ 1 ║ 4 5 ---— — +----—+—+ ├────────┼───┤ ╠════════╬═══╣ 2 3 | 2 | 3 | │ 2 │ 3 │ ║ 2 ║ 3 ║ 4 5 | 4 | 5 | │ 4 │ 5 │ ║ 4 ║ 5 ║ +----—+—+ ╰────────┴───╯ ╚════════╩═══╝

Enumerator
BU_TBL_STYLE_NONE 
BU_TBL_STYLE_LIST 
BU_TBL_STYLE_BASIC 
BU_TBL_STYLE_SINGLE 
BU_TBL_STYLE_DOUBLE 
BU_TBL_ALIGN_LEFT 
BU_TBL_ALIGN_CENTER 
BU_TBL_ALIGN_RIGHT 
BU_TBL_ROW_HEADER 
BU_TBL_ROW_SEPARATOR 
BU_TBL_ROW_ALIGN_LEFT 
BU_TBL_ROW_ALIGN_CENTER 
BU_TBL_ROW_ALIGN_RIGHT 
BU_TBL_COL_ALIGN_LEFT 
BU_TBL_COL_ALIGN_CENTER 
BU_TBL_COL_ALIGN_RIGHT 
BU_TBL_ROW_END 

Definition at line 153 of file tbl.h.

Function Documentation

◆ bu_tbl_create()

struct bu_tbl* bu_tbl_create ( void  )

always returns a pointer to a newly allocated table

◆ bu_tbl_destroy()

void bu_tbl_destroy ( struct bu_tbl *  )

releases all dynamic memory associated with the specified table

◆ bu_tbl_clear()

int bu_tbl_clear ( struct bu_tbl *  )

erases all cells in a table, but doesn't erase the table itself

◆ bu_tbl_style()

struct bu_tbl* bu_tbl_style ( struct bu_tbl *  ,
enum  bu_tbl_style 
)

sets table styling or formatting on cells printed next.

◆ bu_tbl_is_at()

struct bu_tbl* bu_tbl_is_at ( struct bu_tbl *  ,
size_t *  row,
size_t *  col 
)

get cell position for the current table insertion point.

◆ bu_tbl_go_to()

struct bu_tbl* bu_tbl_go_to ( struct bu_tbl *  ,
size_t  row,
size_t  col 
)

set cell position of the current table insertion point.

◆ bu_tbl_printf()

struct bu_tbl* bu_tbl_printf ( struct bu_tbl *  ,
const char *  fmt,
  ... 
)

print values into the table at the current insertion point.

each column of the 'fmt' printf-style format specfier must be delimited by a '|' character.

any existing values will be overwritten.

◆ bu_tbl_vls()

void bu_tbl_vls ( struct bu_vls str,
const struct bu_tbl *  t 
)

print a table into a vls