Ignore:
Timestamp:
1999-10-31T11:23:11+13:00 (25 years ago)
Author:
sjboddie
Message:

moved table functions from browsetools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/formattools.cpp

    r670 r749  
    2828/*
    2929   $Log$
     30   Revision 1.14  1999/10/30 22:23:11  sjboddie
     31   moved table functions from browsetools
     32
    3033   Revision 1.13  1999/10/14 23:01:24  sjboddie
    3134   changes for new browsing support
     
    9396  parentcommand = pNone;
    9497  parentoptions.clear();
    95 };
     98}
    9699
    97100void decision_t::clear() {
    98101  command = dMeta;
    99102  meta.clear();
    100 };
     103}
    101104
    102105void format_t::clear() {
     
    109112  elseptr = NULL;
    110113  orptr = NULL;
    111 };
     114}
    112115
    113116void formatinfo_t::clear() {
     
    126129}
    127130
     131// simply checks to see if formatstring begins with a <td> tag
     132bool is_table_content (const text_t &formatstring) {
     133  text_t::const_iterator here = formatstring.begin();
     134  text_t::const_iterator end = formatstring.end();
     135 
     136  while (here != end) {
     137    if (*here != ' ') {
     138      if (*here == '<') {
     139    if ((*(here+1) == 't' || *(here+1) == 'T') &&
     140        (*(here+2) == 'd' || *(here+2) == 'D') &&
     141        (*(here+3) == '>' || *(here+3) == ' '))
     142      return true;
     143      } else return false;
     144    }
     145    here ++;
     146  }
     147  return false;
     148}
     149
     150bool is_table_content (const format_t *formatlistptr) {
     151
     152  if (formatlistptr == NULL) return false;
     153 
     154  if (formatlistptr->command == comText)
     155    return is_table_content (formatlistptr->text);
     156   
     157  return false;
     158}
     159
    128160// returns false if key isn't in formatstringmap
    129161bool get_formatstring (const text_t &key, const text_tmap &formatstringmap,
     
    136168  return true;
    137169}
     170
    138171// tries to find "key1key2" then "key1" then "key2"
    139172bool get_formatstring (const text_t &key1, const text_t &key2, 
Note: See TracChangeset for help on using the changeset viewer.