当前位置: 首页>>代码示例>>C++>>正文


C++ dom_tree_to_guid函数代码示例

本文整理汇总了C++中dom_tree_to_guid函数的典型用法代码示例。如果您正苦于以下问题:C++ dom_tree_to_guid函数的具体用法?C++ dom_tree_to_guid怎么用?C++ dom_tree_to_guid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dom_tree_to_guid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: taxtable_guid_handler

static gboolean
taxtable_guid_handler (xmlNodePtr node, gpointer taxtable_pdata)
{
    struct taxtable_pdata *pdata = taxtable_pdata;
    GncGUID *guid;
    GncTaxTable *table;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail (guid, FALSE);
    table = gncTaxTableLookup (pdata->book, guid);
    if (table)
    {
        gncTaxTableDestroy (pdata->table);
        pdata->table = table;
        gncTaxTableBeginEdit (table);
    }
    else
    {
        gncTaxTableSetGUID(pdata->table, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:JohannesKlug,项目名称:gnucash,代码行数:25,代码来源:gnc-tax-table-xml-v2.c

示例2: invoice_guid_handler

static gboolean
invoice_guid_handler (xmlNodePtr node, gpointer invoice_pdata)
{
    struct invoice_pdata* pdata = static_cast<decltype (pdata)> (invoice_pdata);
    GncGUID* guid;
    GncInvoice* invoice;

    guid = dom_tree_to_guid (node);
    g_return_val_if_fail (guid, FALSE);
    invoice = gncInvoiceLookup (pdata->book, guid);
    if (invoice)
    {
        gncInvoiceDestroy (pdata->invoice);
        pdata->invoice = invoice;
        gncInvoiceBeginEdit (invoice);
    }
    else
    {
        gncInvoiceSetGUID (pdata->invoice, guid);
    }

    g_free (guid);

    return TRUE;
}
开发者ID:Bob-IT,项目名称:gnucash,代码行数:25,代码来源:gnc-invoice-xml-v2.cpp

示例3: employee_guid_handler

static gboolean
employee_guid_handler (xmlNodePtr node, gpointer employee_pdata)
{
    struct employee_pdata *pdata = employee_pdata;
    GncGUID *guid;
    GncEmployee *employee;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail(guid, FALSE);

    /* See if we've already created this one */
    employee = gncEmployeeLookup (pdata->book, guid);
    if (employee)
    {
        gncEmployeeDestroy (pdata->employee);
        pdata->employee = employee;
        gncEmployeeBeginEdit (employee);
    }
    else
    {
        gncEmployeeSetGUID(pdata->employee, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:kleopatra999,项目名称:gnucash-2,代码行数:27,代码来源:gnc-employee-xml-v2.c

示例4: customer_guid_handler

static gboolean
customer_guid_handler (xmlNodePtr node, gpointer cust_pdata)
{
    struct customer_pdata *pdata = cust_pdata;
    GncGUID *guid;
    GncCustomer *cust;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail(guid, FALSE);
    cust = gncCustomerLookup (pdata->book, guid);
    if (cust)
    {
        gncCustomerDestroy (pdata->customer);
        pdata->customer = cust;
        gncCustomerBeginEdit (cust);
    }
    else
    {
        gncCustomerSetGUID(pdata->customer, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:573,项目名称:gnucash,代码行数:25,代码来源:gnc-customer-xml-v2.c

示例5: billterm_guid_handler

static gboolean
billterm_guid_handler (xmlNodePtr node, gpointer billterm_pdata)
{
    struct billterm_pdata *pdata = billterm_pdata;
    GncGUID *guid;
    GncBillTerm *term;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail (guid, FALSE);
    term = gncBillTermLookup (pdata->book, guid);
    if (term)
    {
        gncBillTermDestroy (pdata->term);
        pdata->term = term;
        gncBillTermBeginEdit (term);
    }
    else
    {
        gncBillTermSetGUID(pdata->term, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:frenzypony,项目名称:gnucash,代码行数:25,代码来源:gnc-bill-term-xml-v2.c

示例6: entry_guid_handler

static gboolean
entry_guid_handler (xmlNodePtr node, gpointer entry_pdata)
{
    struct entry_pdata *pdata = entry_pdata;
    GncGUID *guid;
    GncEntry *entry;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail (guid, FALSE);
    entry = gncEntryLookup (pdata->book, guid);
    if (entry)
    {
        gncEntryDestroy (pdata->entry);
        pdata->entry = entry;
        gncEntryBeginEdit (entry);
    }
    else
    {
        gncEntrySetGUID(pdata->entry, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:Danvil,项目名称:gnucash,代码行数:25,代码来源:gnc-entry-xml-v2.c

示例7: job_guid_handler

static gboolean
job_guid_handler (xmlNodePtr node, gpointer job_pdata)
{
    struct job_pdata *pdata = job_pdata;
    GncGUID *guid;
    GncJob *job;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail(guid, FALSE);
    job = gncJobLookup (pdata->book, guid);
    if (job)
    {
        gncJobDestroy (pdata->job);
        pdata->job = job;
        gncJobBeginEdit (job);
    }
    else
    {
        gncJobSetGUID(pdata->job, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:nizarklai,项目名称:gnucash-1,代码行数:25,代码来源:gnc-job-xml-v2.c

示例8: spl_account_handler

static gboolean
spl_account_handler(xmlNodePtr node, gpointer data)
{
    struct split_pdata *pdata = data;
    GncGUID *id = dom_tree_to_guid(node);
    Account *account;

    g_return_val_if_fail(id, FALSE);

    account = xaccAccountLookup (id, pdata->book);
    if (!account && gnc_transaction_xml_v2_testing &&
            !guid_equal (id, guid_null ()))
    {
        account = xaccMallocAccount (pdata->book);
        xaccAccountSetGUID (account, id);
        xaccAccountSetCommoditySCU (account,
                                    xaccSplitGetAmount (pdata->split).denom);
    }

    xaccAccountInsertSplit (account, pdata->split);

    g_free(id);

    return TRUE;
}
开发者ID:573,项目名称:gnucash,代码行数:25,代码来源:gnc-transaction-xml-v2.c

示例9: order_guid_handler

static gboolean
order_guid_handler (xmlNodePtr node, gpointer order_pdata)
{
    struct order_pdata *pdata = order_pdata;
    GncGUID *guid;
    GncOrder *order;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail (guid, FALSE);
    order = gncOrderLookup (pdata->book, guid);
    if (order)
    {
        gncOrderDestroy (pdata->order);
        pdata->order = order;
        gncOrderBeginEdit (order);
    }
    else
    {
        gncOrderSetGUID(pdata->order, guid);
    }

    g_free(guid);

    return TRUE;
}
开发者ID:mlq,项目名称:gnucash,代码行数:25,代码来源:gnc-order-xml-v2.c

示例10: vendor_guid_handler

static gboolean
vendor_guid_handler (xmlNodePtr node, gpointer vendor_pdata)
{
    struct vendor_pdata* pdata = static_cast<decltype (pdata)> (vendor_pdata);
    GncGUID* guid;
    GncVendor* vendor;

    guid = dom_tree_to_guid (node);
    g_return_val_if_fail (guid, FALSE);
    vendor = gncVendorLookup (pdata->book, guid);
    if (vendor)
    {
        gncVendorDestroy (pdata->vendor);
        pdata->vendor = vendor;
        gncVendorBeginEdit (vendor);
    }
    else
    {
        gncVendorSetGUID (pdata->vendor, guid);
    }

    g_free (guid);

    return TRUE;
}
开发者ID:CAARNICL,项目名称:gnucash,代码行数:25,代码来源:gnc-vendor-xml-v2.cpp

示例11: set_parent_child

static gboolean
set_parent_child (xmlNodePtr node, struct taxtable_pdata *pdata,
                  void (*func)(GncTaxTable *, GncTaxTable *))
{
    GncGUID *guid;
    GncTaxTable *table;

    guid = dom_tree_to_guid(node);
    g_return_val_if_fail (guid, FALSE);
    table = gncTaxTableLookup (pdata->book, guid);

    /* Ignore pointers to self */
    if (table == pdata->table)
    {
        PINFO ("found a self-referential parent/child; ignoring.\n");
        return TRUE;
    }

    if (!table)
    {
        table = gncTaxTableCreate (pdata->book);
        gncTaxTableBeginEdit (table);
        gncTaxTableSetGUID (table, guid);
        gncTaxTableCommitEdit (table);
    }
    g_free (guid);
    g_return_val_if_fail (table, FALSE);
    func (pdata->table, table);

    return TRUE;
}
开发者ID:JohannesKlug,项目名称:gnucash,代码行数:31,代码来源:gnc-tax-table-xml-v2.c

示例12: test_dom_tree_to_guid

static void
test_dom_tree_to_guid(void)
{
    int i;
    for (i = 0; i < 20; i++)
    {
        GncGUID *test_guid1;
        GncGUID *test_guid2;
        xmlNodePtr test_node;

        test_guid1 = get_random_guid();

        if (!(test_node = guid_to_dom_tree("test-guid", test_guid1)))
        {
            failure_args("guid_to_dom_tree", __FILE__, __LINE__,
                         "conversion to dom tree failed");
        }

        test_guid2 = dom_tree_to_guid(test_node);

        do_test(guid_equal(test_guid1, test_guid2),
                "dom_tree_to_guid" );

        xmlFreeNode(test_node);
        g_free(test_guid1);
        g_free(test_guid2);
    }
}
开发者ID:BenBergman,项目名称:gnucash,代码行数:28,代码来源:test-dom-converters1.c

示例13: price_parse_xml_sub_node

static gboolean
price_parse_xml_sub_node(GNCPrice *p, xmlNodePtr sub_node, QofBook *book)
{
    if (!p || !sub_node) return FALSE;

    gnc_price_begin_edit (p);
    if (g_strcmp0("price:id", (char*)sub_node->name) == 0)
    {
        GncGUID *c = dom_tree_to_guid(sub_node);
        if (!c) return FALSE;
        gnc_price_set_guid(p, c);
        g_free(c);
    }
    else if (g_strcmp0("price:commodity", (char*)sub_node->name) == 0)
    {
        gnc_commodity *c = dom_tree_to_commodity_ref(sub_node, book);
        if (!c) return FALSE;
        gnc_price_set_commodity(p, c);
    }
    else if (g_strcmp0("price:currency", (char*)sub_node->name) == 0)
    {
        gnc_commodity *c = dom_tree_to_commodity_ref(sub_node, book);
        if (!c) return FALSE;
        gnc_price_set_currency(p, c);
    }
    else if (g_strcmp0("price:time", (char*)sub_node->name) == 0)
    {
        Timespec t = dom_tree_to_timespec(sub_node);
        if (!dom_tree_valid_timespec(&t, sub_node->name)) return FALSE;
        gnc_price_set_time(p, t);
    }
    else if (g_strcmp0("price:source", (char*)sub_node->name) == 0)
    {
        char *text = dom_tree_to_text(sub_node);
        if (!text) return FALSE;
        gnc_price_set_source(p, text);
        g_free(text);
    }
    else if (g_strcmp0("price:type", (char*)sub_node->name) == 0)
    {
        char *text = dom_tree_to_text(sub_node);
        if (!text) return FALSE;
        gnc_price_set_typestr(p, text);
        g_free(text);
    }
    else if (g_strcmp0("price:value", (char*)sub_node->name) == 0)
    {
        gnc_numeric *value = dom_tree_to_gnc_numeric(sub_node);
        if (!value) return FALSE;
        gnc_price_set_value(p, *value);
        g_free(value);
    }
    gnc_price_commit_edit (p);
    return TRUE;
}
开发者ID:iulianu,项目名称:gnucash-butchered,代码行数:55,代码来源:gnc-pricedb-xml-v2.cpp

示例14: budget_id_handler

static gboolean
budget_id_handler (xmlNodePtr node, gpointer bgt)
{
    GncGUID* guid;

    guid = dom_tree_to_guid (node);
    g_return_val_if_fail (guid, FALSE);
    qof_instance_set_guid (QOF_INSTANCE (bgt), guid);
    g_free (guid);
    return TRUE;
}
开发者ID:Mechtilde,项目名称:gnucash,代码行数:11,代码来源:gnc-budget-xml-v2.cpp

示例15: book_id_handler

static gboolean
book_id_handler(xmlNodePtr node, gpointer book_pdata)
{
    QofBook *book = book_pdata;
    GncGUID *guid;

    guid = dom_tree_to_guid(node);
    qof_instance_set_guid(QOF_INSTANCE(book), guid);
    g_free(guid);

    return TRUE;
}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:12,代码来源:gnc-book-xml-v2.c


注:本文中的dom_tree_to_guid函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。