bump product version to 6.3.0.0.beta1
[LibreOffice.git] / connectivity / source / drivers / mork / mork_helper.cxx
blob4cb11864fee5f2f44f284df79d8eb1c87e07155b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 #include "MorkParser.hxx"
4 #include <iostream>
5 #include <sal/log.hxx>
7 static bool openAddressBook(const std::string& path)
9 MorkParser mork;
10 // Open and parse mork file
11 if (!mork.open(path))
13 return false;
16 const int defaultScope = 0x80;
17 MorkTableMap *Tables = mork.getTables( defaultScope );
18 if ( Tables )
20 // Iterate all tables
21 for (auto const& table : Tables->map)
23 if ( 0 == table.first ) continue;
24 SAL_INFO("connectivity.mork", "table->first : " << table.first);
25 std::string column = mork.getColumn( table.first );
26 std::string value = mork.getValue( table.first );
27 SAL_INFO("connectivity.mork", "table.column : " << column);
28 SAL_INFO("connectivity.mork", "table.value : " << value);
32 mork.dump();
34 return true;
37 int main(int argc, char* argv[])
39 if (argc < 2)
41 std::cerr << "Usage: " << argv[0] << " <path-to>/abook.mab" << std::endl;
42 std::cerr << "Example: " << argv[0] << " /home/johndoe/.thunderbird/m0tpqlky.default/abook.mab" << std::endl;
44 return 1;
47 OString aOString(argv[1]);
48 SAL_INFO("connectivity.mork", "abook.mab: " << aOString);
49 openAddressBook(aOString.getStr());
51 return 0;
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */