b9042fad7c
Change-Id: I6c145e984c885c7e06caa1c27bfb354ea49ad9ce
88 lines
2.5 KiB
C++
88 lines
2.5 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* This file incorporates work covered by the following license notice:
|
|
*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
* with this work for additional information regarding copyright
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
* except in compliance with the License. You may obtain a copy of
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
*/
|
|
|
|
#include <iostream>
|
|
|
|
#include "dependy.hxx"
|
|
|
|
|
|
int
|
|
#ifdef WNT
|
|
_cdecl
|
|
#endif
|
|
main( int argc,
|
|
char * argv[] )
|
|
{
|
|
if (argc < 2 || *argv[1] == '?')
|
|
{
|
|
std::cout << "\nUse:\n"
|
|
<< "srvdepy.exe <xml-component-descriptions-root-directory>\n"
|
|
<< std::endl;
|
|
return 0;
|
|
}
|
|
|
|
|
|
DependencyFinder aDependencies;
|
|
|
|
aDependencies.GatherData(argv[1]);
|
|
char sInput[500] = "";
|
|
std::vector<Simstr> aLibs;
|
|
std::vector<Simstr> aServs;
|
|
|
|
|
|
std::cout
|
|
<< "\nNow you can start to put in Service names.\n"
|
|
<< "Please use correct case, but don't use namespaces.\n"
|
|
<< "Just the Service's own name.\n\n"
|
|
<< "To stop the program, put in a hashmark \"#\" + ENTER.\n"
|
|
<< std::endl;
|
|
|
|
|
|
|
|
do {
|
|
|
|
sInput[0] = 0;
|
|
std::cin >> sInput;
|
|
Simstr sImplService(sInput);
|
|
if (*sInput != '#')
|
|
{
|
|
aLibs.erase( aLibs.begin(), aLibs.end() );
|
|
aServs.erase( aServs.begin(), aServs.end() );
|
|
|
|
aDependencies.FindNeededServices( aLibs, aServs, sImplService );
|
|
|
|
std::cout << "\n\n\nNeeded libraries: " << std::endl;
|
|
for ( unsigned i = 0; i < aLibs.size(); ++i )
|
|
{
|
|
std::cout << " " << aLibs[i].str() << std::endl;
|
|
}
|
|
std::cout << "\nNeeded services: " << std::endl;
|
|
for ( unsigned s= 0; s < aServs.size(); ++s )
|
|
{
|
|
std::cout << " " << aServs[s].str() << std::endl;
|
|
}
|
|
std::cout << "\n\n" << std::endl;
|
|
}
|
|
} while (*sInput != '#');
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|