LCOV - code coverage report
Current view: top level - libreoffice/l10ntools/source - treex.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 9 25 36.0 %
Date: 2012-12-27 Functions: 4 5 80.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #include <iostream>
      11             : #include "sal/main.h"
      12             : 
      13             : #include "export.hxx"
      14             : #include "treemerge.hxx"
      15             : 
      16           0 : void WriteUsage()
      17             : {
      18             :     std::cout
      19           0 :         << "Syntax: Treex [-p Prj] [-r Root] -i FileIn -o FileOut"
      20           0 :         << " [-m DataBase] [-l l1,l2,...]\n"
      21           0 :         << " Prj:      Project\n"
      22           0 :         << " Root:  Path to project root (../.. etc.)\n"
      23           0 :         << " or path to root of localized xhp files\n"
      24           0 :         << " FileIn:   Source files (*.tree)\n"
      25           0 :         << " FileOut:  Destination file (*.*)\n"
      26           0 :         << " DataBase: Mergedata (*.po)\n"
      27           0 :         << " -l: Restrict the handled languages; l1, l2, ... are elements of"
      28           0 :         << " (de, en-US, ...)\n";
      29           0 : }
      30             : 
      31             : 
      32          14 : SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
      33             : {
      34           7 :     HandledArgs aArgs;
      35           7 :     if( !Export::handleArguments(argc, argv, aArgs) )
      36             :     {
      37           0 :         WriteUsage();
      38           0 :         return 1;
      39             :     }
      40             : 
      41           7 :         TreeParser aParser(aArgs.m_sInputFile, Export::sLanguages);
      42           7 :         if( !aParser.isInitialized() )
      43             :         {
      44           0 :             return 1;
      45             :         }
      46             : 
      47           7 :         if( aArgs.m_bMergeMode || aArgs.m_sPrj.isEmpty() )
      48             :         {
      49             :             aParser.Merge(
      50           7 :                 aArgs.m_sMergeSrc, aArgs.m_sOutputFile, aArgs.m_sPrjRoot );
      51             :         }
      52             :         else
      53             :         {
      54             :             aParser.Extract(
      55           0 :                 aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot );
      56             :         }
      57           7 :     return 0;
      58          21 : }
      59             : 
      60             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10