IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 19, 2006, 2:55:43 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION to 0.30
add psTime support to the psdb templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/templates/psdb/createtable.tt

    r9658 r9668  
    11bool [% table.namespace %]CreateTable(psDB *dbh)
    22{
    3     psMetadata *md = psMetadataAlloc();
    4 [% FOREACH item = table.columns -%]
    5 [% IF item.comment;
    6     SET item.comment = "\"$item.comment\"";
    7 ELSE;
    8     SET item.comment = 'NULL';
    9 END;
    10 -%]
    11 [% IF item.type == "STR" -%]
    12     if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", [% item.mtype %], [% item.comment %], "[% item.value %]")) {
    13 [% ELSIF item.mtype == "PS_DATA_TIME" -%]
    14     [% item.ctype %] [% item.name %] = psTimeFromISO("[% item.value %]", [% item.timetype %]);
    15     if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", [% item.mtype %], [% item.comment %], [% item.name %])) {
    16         psFree([% item.name %]);
    17 [% ELSE -%]
    18     if (!psMetadataAdd(md, PS_LIST_TAIL, "[% item.name %]", [% item.mtype %], [% item.comment %], [% item.value %])) {
    19 [% END -%]
    20         psError(PS_ERR_UNKNOWN, false, "failed to add item [% item.name %]");
    21         psFree(md);
    22         return false;
    23     }
    24 [% END -%]
     3[% INCLUDE metadata -%]
    254
    265    bool status = psDBCreateTable(dbh, [% table.namespace FILTER upper %]_TABLE_NAME, md);
Note: See TracChangeset for help on using the changeset viewer.