LCOV - code coverage report
Current view: top level - framework/source/jobs - joburl.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 68 1.5 %
Date: 2014-11-03 Functions: 2 8 25.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             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <jobs/joburl.hxx>
      21             : #include <general.h>
      22             : 
      23             : #include <rtl/ustrbuf.hxx>
      24             : #include <vcl/svapp.hxx>
      25             : 
      26             : namespace framework{
      27             : 
      28             : /**
      29             :     @short      special ctor
      30             :     @descr      It initialize this new instance with a (hopyfully) valid job URL.
      31             :                 This URL will be parsed. After that we set our members right,
      32             :                 so other interface methods of this class can be used to get
      33             :                 all items of this URL. Of course it will be possible to know,
      34             :                 if this URL was valid too.
      35             : 
      36             :     @param      sURL
      37             :                     the job URL for parsing
      38             : */
      39           0 : JobURL::JobURL( /*IN*/ const OUString& sURL )
      40             : {
      41             :     #ifdef ENABLE_COMPONENT_SELF_CHECK
      42             :     JobURL::impldbg_checkIt();
      43             :     #endif
      44             : 
      45           0 :     m_eRequest = E_UNKNOWN;
      46             : 
      47             :     // syntax: vnd.sun.star.job:{[event=<name>],[alias=<name>],[service=<name>]}
      48             : 
      49             :     // check for "vnd.sun.star.job:"
      50           0 :     if (sURL.matchIgnoreAsciiCaseAsciiL(JOBURL_PROTOCOL_STR,JOBURL_PROTOCOL_LEN,0))
      51             :     {
      52           0 :         sal_Int32 t = JOBURL_PROTOCOL_LEN;
      53           0 :         do
      54             :         {
      55             :             // separate all token of "{[event=<name>],[alias=<name>],[service=<name>]}"
      56           0 :             OUString sToken = sURL.getToken(0, JOBURL_PART_SEPARATOR, t);
      57           0 :             OUString sPartValue;
      58           0 :             OUString sPartArguments;
      59             : 
      60             :             // check for "event="
      61           0 :             if (
      62           0 :                 (JobURL::implst_split(sToken,JOBURL_EVENT_STR,JOBURL_EVENT_LEN,sPartValue,sPartArguments)) &&
      63           0 :                 (!sPartValue.isEmpty())
      64             :                )
      65             :             {
      66             :                 // set the part value
      67           0 :                 m_sEvent     = sPartValue;
      68           0 :                 m_sEventArgs = sPartArguments;
      69           0 :                 m_eRequest  |= E_EVENT;
      70             :             }
      71             :             else
      72             :             // check for "alias="
      73           0 :             if (
      74           0 :                 (JobURL::implst_split(sToken,JOBURL_ALIAS_STR,JOBURL_ALIAS_LEN,sPartValue,sPartArguments)) &&
      75           0 :                 (!sPartValue.isEmpty())
      76             :                )
      77             :             {
      78             :                 // set the part value
      79           0 :                 m_sAlias     = sPartValue;
      80           0 :                 m_sAliasArgs = sPartArguments;
      81           0 :                 m_eRequest  |= E_ALIAS;
      82             :             }
      83             :             else
      84             :             // check for "service="
      85           0 :             if (
      86           0 :                 (JobURL::implst_split(sToken,JOBURL_SERVICE_STR,JOBURL_SERVICE_LEN,sPartValue,sPartArguments)) &&
      87           0 :                 (!sPartValue.isEmpty())
      88             :                )
      89             :             {
      90             :                 // set the part value
      91           0 :                 m_sService     = sPartValue;
      92           0 :                 m_sServiceArgs = sPartArguments;
      93           0 :                 m_eRequest    |= E_SERVICE;
      94           0 :             }
      95             :         }
      96           0 :         while(t!=-1);
      97             :     }
      98           0 : }
      99             : 
     100             : /**
     101             :     @short      knows, if this job URL object hold a valid URL inside
     102             : 
     103             :     @return     <TRUE/> if it represent a valid job URL.
     104             : */
     105           0 : bool JobURL::isValid() const
     106             : {
     107           0 :     SolarMutexGuard g;
     108           0 :     return (m_eRequest!=E_UNKNOWN);
     109             : }
     110             : 
     111             : /**
     112             :     @short      get the event item of this job URL
     113             :     @descr      Because the three possible parts of such URL (event, alias, service)
     114             :                 can't be combined, this method can(!) return a valid value - but it's
     115             :                 not a must. Thats why the return value must be used too, to detect a missing
     116             :                 event value.
     117             : 
     118             :     @param      sEvent
     119             :                     returns the possible existing event value
     120             :                     e.g. "vnd.sun.star.job:event=myEvent" returns "myEvent"
     121             : 
     122             :     @return     <TRUE/> if an event part of the job URL exist and the out parameter
     123             :                 sEvent was filled.
     124             : 
     125             :     @attention  The out parameter will be reseted every time. Don't use it if method returns <FALSE/>!
     126             : */
     127           0 : bool JobURL::getEvent( /*OUT*/ OUString& sEvent ) const
     128             : {
     129           0 :     SolarMutexGuard g;
     130             : 
     131           0 :              sEvent = OUString();
     132           0 :     bool bSet   = ((m_eRequest & E_EVENT) == E_EVENT);
     133           0 :     if (bSet)
     134           0 :         sEvent = m_sEvent;
     135             : 
     136           0 :     return bSet;
     137             : }
     138             : 
     139             : /**
     140             :     @short      get the alias item of this job URL
     141             :     @descr      Because the three possible parts of such URL (event, alias, service)
     142             :                 can't be combined, this method can(!) return a valid value - but it's
     143             :                 not a must. Thats why the return value must be used too, to detect a missing
     144             :                 alias value.
     145             : 
     146             :     @param      sAlias
     147             :                     returns the possible existing alias value
     148             :                     e.g. "vnd.sun.star.job:alias=myAlias" returns "myAlias"
     149             : 
     150             :     @return     <TRUE/> if an alias part of the job URL exist and the out parameter
     151             :                 sAlias was filled.
     152             : 
     153             :     @attention  The out parameter will be reseted every time. Don't use it if method returns <FALSE/>!
     154             : */
     155           0 : bool JobURL::getAlias( /*OUT*/ OUString& sAlias ) const
     156             : {
     157           0 :     SolarMutexGuard g;
     158             : 
     159           0 :              sAlias = OUString();
     160           0 :     bool bSet   = ((m_eRequest & E_ALIAS) == E_ALIAS);
     161           0 :     if (bSet)
     162           0 :         sAlias = m_sAlias;
     163             : 
     164           0 :     return bSet;
     165             : }
     166             : 
     167             : /**
     168             :     @short      get the service item of this job URL
     169             :     @descr      Because the three possible parts of such URL (event, service, service)
     170             :                 can't be combined, this method can(!) return a valid value - but it's
     171             :                 not a must. Thats why the return value must be used too, to detect a missing
     172             :                 service value.
     173             : 
     174             :     @param      sAlias
     175             :                     returns the possible existing service value
     176             :                     e.g. "vnd.sun.star.job:service=com.sun.star.Service" returns "com.sun.star.Service"
     177             : 
     178             :     @return     <TRUE/> if an service part of the job URL exist and the out parameter
     179             :                 sService was filled.
     180             : 
     181             :     @attention  The out parameter will be reseted every time. Don't use it if method returns <FALSE/>!
     182             : */
     183           0 : bool JobURL::getService( /*OUT*/ OUString& sService ) const
     184             : {
     185           0 :     SolarMutexGuard g;
     186             : 
     187           0 :              sService = OUString();
     188           0 :     bool bSet     = ((m_eRequest & E_SERVICE) == E_SERVICE);
     189           0 :     if (bSet)
     190           0 :         sService = m_sService;
     191             : 
     192           0 :     return bSet;
     193             : }
     194             : 
     195             : /**
     196             :     @short      searches for a special identifier in the given string and split it
     197             :     @descr      If the given identifier could be found at the beginning of the given string,
     198             :                 this method split it into different parts and return it.
     199             :                 Following schema is used: <partidentifier>=<partvalue>[?<partarguments>]
     200             : 
     201             :     @param      sPart
     202             :                     the string, which should be analyzed
     203             : 
     204             :     @param      pPartIdentifier
     205             :                     the part identifier value, which must be found at the beginning of the
     206             :                     parameter <var>sPart</var>
     207             : 
     208             :     @param      nPartLength
     209             :                     the length of the ascii value <var>pPartIdentifier</var>
     210             : 
     211             :     @param      rPartValue
     212             :                     returns the part value if <var>sPart</var> was splitted successfully
     213             : 
     214             :     @param      rPartArguments
     215             :                     returns the part arguments if <var>sPart</var> was splitted successfully
     216             : 
     217             :     @return     <TRUE/> if the identifier could be found and the string was splitted.
     218             :                 <FALSE/> otherwise.
     219             : */
     220           0 : bool JobURL::implst_split( /*IN*/  const OUString& sPart           ,
     221             :                                /*IN*/  const sal_Char*        pPartIdentifier ,
     222             :                                /*IN*/        sal_Int32        nPartLength     ,
     223             :                                /*OUT*/       OUString& rPartValue      ,
     224             :                                /*OUT*/       OUString& rPartArguments  )
     225             : {
     226             :     // first search for the given identifier
     227           0 :     bool bPartFound = (sPart.matchIgnoreAsciiCaseAsciiL(pPartIdentifier,nPartLength,0));
     228             : 
     229             :     // If it exist - we can split the part and return sal_True.
     230             :     // Otherwhise we do nothing and return sal_False.
     231           0 :     if (bPartFound)
     232             :     {
     233             :         // But may the part has optional arguments - separated by a "?".
     234             :         // Do so - we set the return value with the whole part string.
     235             :         // Arguments will be set to an empty string as default.
     236             :         // If we detect the right sign - we split the arguments and overwrite the default.
     237           0 :         OUString sValueAndArguments = sPart.copy(nPartLength);
     238           0 :         OUString sValue             = sValueAndArguments;
     239           0 :         OUString sArguments;
     240             : 
     241           0 :         sal_Int32 nArgStart = sValueAndArguments.indexOf('?',0);
     242           0 :         if (nArgStart!=-1)
     243             :         {
     244           0 :             sValue     = sValueAndArguments.copy(0,nArgStart);
     245           0 :             ++nArgStart; // ignore '?'!
     246           0 :             sArguments = sValueAndArguments.copy(nArgStart);
     247             :         }
     248             : 
     249           0 :         rPartValue     = sValue;
     250           0 :         rPartArguments = sArguments;
     251             :     }
     252             : 
     253           0 :     return bPartFound;
     254             : }
     255             : 
     256             : /**
     257             :     @short      special debug method
     258             :     @descr      It's the entry point method to start a self component check for this class.
     259             :                 It's used for internal purposes only and never a part of a legal product.
     260             :                 Use it for testing and debug only!
     261             : */
     262             : #ifdef ENABLE_COMPONENT_SELF_CHECK
     263             : 
     264             : #define LOGFILE_JOBURL  "joburl.log"
     265             : 
     266             : void JobURL::impldbg_checkIt()
     267             : {
     268             :     // check simple URL's
     269             :     JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent"    , E_EVENT  , "onMyEvent", ""       , ""           , NULL, NULL, NULL);
     270             :     JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias"      , E_ALIAS  , ""         , "myAlias", ""           , NULL, NULL, NULL);
     271             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service", E_SERVICE, ""         , ""       , "css.Service", NULL, NULL, NULL);
     272             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=;"          , E_UNKNOWN, ""         , ""       , ""           , NULL, NULL, NULL);
     273             : 
     274             :     // check combinations
     275             :     // Note: No additional spaces or tabs are allowed after a separator occurred.
     276             :     // Tab and spaces before a separator will be used as value!
     277             :     JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;alias=myAlias;service=css.Service"  , E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL);
     278             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service;alias=myAlias"                  , E_ALIAS | E_SERVICE           , ""         , "myAlias", "css.Service" , NULL, NULL, NULL);
     279             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service;alias=myAlias"                 , E_ALIAS | E_SERVICE           , ""         , "myAlias", "css.Service ", NULL, NULL, NULL);
     280             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service; alias=myAlias"                 , E_UNKNOWN                     , ""         , ""       , ""            , NULL, NULL, NULL);
     281             :     JobURL::impldbg_checkURL("vnd.sun.star.job : event=onMyEvent"                                  , E_UNKNOWN                     , ""         , ""       , ""            , NULL, NULL, NULL);
     282             :     JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;event=onMyEvent;service=css.Service", E_UNKNOWN                     , ""         , ""       , ""            , NULL, NULL, NULL);
     283             : 
     284             :     // check upper/lower case
     285             :     // fix parts of the URL are case insensitive (e.g. "vnd.SUN.star.job:eVEnt=")
     286             :     // values are case sensitive                 (e.g. "myAlias"                )
     287             :     JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEvent;aliAs=myAlias;serVice=css.Service", E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL);
     288             :     JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEVENT;aliAs=myALIAS;serVice=css.SERVICE", E_EVENT | E_ALIAS | E_SERVICE , "onMyEVENT", "myALIAS", "css.SERVICE" , NULL, NULL, NULL);
     289             : 
     290             :     // check stupid URLs
     291             :     JobURL::impldbg_checkURL("vnd.sun.star.jobs:service=css.Service"    , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
     292             :     JobURL::impldbg_checkURL("vnd.sun.star.job service=css.Service"     , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
     293             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service;css.Service"     , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
     294             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service;"                , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
     295             :     JobURL::impldbg_checkURL("vnd.sun.star.job:;alias;service;event="   , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
     296             :     JobURL::impldbg_checkURL("vnd.sun.star.job:alias=a;service=s;event=", E_UNKNOWN, "", "", "", NULL, NULL, NULL);
     297             : 
     298             :     // check argument handling
     299             :     JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent?eventArg1,eventArg2=3,eventArg4,"            , E_EVENT          , "onMyEvent", ""       , ""             , "eventArg1,eventArg2=3,eventArg4,", NULL                 , NULL          );
     300             :     JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias?aliasArg1,aliasarg2"                           , E_EVENT          , ""         , "myAlias", ""             , NULL                              , "aliasArg1,aliasarg2", NULL          );
     301             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1"                           , E_EVENT          , ""         , ""       , "css.myService", NULL                              , NULL                 , "serviceArg1" );
     302             :     JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1;alias=myAlias?aliasArg=564", E_EVENT | E_ALIAS, ""         , "myAlias", "css.myService", NULL                              , "aliasArg=564"       , "serviceArg1" );
     303             : }
     304             : 
     305             : /**
     306             :     @short      helper debug method
     307             :     @descr      It uses the given parameter to create a new instance of a JobURL.
     308             :                 They results will be compared with the exepected ones.
     309             :                 The a log will be written, which contains some detailed information
     310             :                 for this sub test.
     311             : 
     312             :     @param      pURL
     313             :                     the job URL, which should be checked
     314             : 
     315             :     @param      eExpectedPart
     316             :                     the expected result
     317             : 
     318             :     @param      pExpectedEvent
     319             :                     the expected event value
     320             : 
     321             :     @param      pExpectedAlias
     322             :                     the expected alias value
     323             : 
     324             :     @param      pExpectedService
     325             :                     the expected service value
     326             : 
     327             :     @param      pExpectedEventArgs
     328             :                     the expected event arguments
     329             : 
     330             :     @param      pExpectedAliasArgs
     331             :                     the expected alias arguments
     332             : 
     333             :     @param      pExpectedServiceArgs
     334             :                     the expected service arguments
     335             : */
     336             : void JobURL::impldbg_checkURL( /*IN*/ const sal_Char*  pURL                 ,
     337             :                                /*IN*/       sal_uInt32 eExpectedPart        ,
     338             :                                /*IN*/ const sal_Char*  pExpectedEvent       ,
     339             :                                /*IN*/ const sal_Char*  pExpectedAlias       ,
     340             :                                /*IN*/ const sal_Char*  pExpectedService     ,
     341             :                                /*IN*/ const sal_Char*  pExpectedEventArgs   ,
     342             :                                /*IN*/ const sal_Char*  pExpectedAliasArgs   ,
     343             :                                /*IN*/ const sal_Char*  pExpectedServiceArgs )
     344             : {
     345             :     OUString sEvent;
     346             :     OUString sAlias;
     347             :     OUString sService;
     348             :     OUString sEventArgs;
     349             :     OUString sAliasArgs;
     350             :     OUString sServiceArgs;
     351             :     OUString sURL    (OUString::createFromAscii(pURL));
     352             :     sal_Bool        bOK     = sal_True;
     353             : 
     354             :     JobURL aURL(sURL);
     355             : 
     356             :     // check if URL is invalid
     357             :     if (eExpectedPart==E_UNKNOWN)
     358             :         bOK = !aURL.isValid();
     359             : 
     360             :     // check if URL has the expected event part
     361             :     if (
     362             :         (bOK                                 ) &&
     363             :         ((eExpectedPart & E_EVENT) == E_EVENT)
     364             :        )
     365             :     {
     366             :         bOK = (
     367             :                 (aURL.isValid()                          ) &&
     368             :                 (aURL.getEvent(sEvent)                   ) &&
     369             :                 (!sEvent.isEmpty()                       ) &&
     370             :                 (sEvent.equalsAscii(pExpectedEvent))
     371             :               );
     372             : 
     373             :         if (bOK && pExpectedEventArgs!=NULL)
     374             :         {
     375             :             bOK = (
     376             :                     (aURL.getEventArgs(sEventArgs)                   ) &&
     377             :                     (sEventArgs.equalsAscii(pExpectedEventArgs))
     378             :                   );
     379             :         }
     380             :     }
     381             : 
     382             :     // check if URL has no event part
     383             :     if (
     384             :         (bOK                                 ) &&
     385             :         ((eExpectedPart & E_EVENT) != E_EVENT)
     386             :        )
     387             :     {
     388             :         bOK = (
     389             :                 (!aURL.getEvent(sEvent)        ) &&
     390             :                 (sEvent.isEmpty()              ) &&
     391             :                 (!aURL.getEventArgs(sEventArgs)) &&
     392             :                 (sEventArgs.isEmpty()          )
     393             :               );
     394             :     }
     395             : 
     396             :     // check if URL has the expected alias part
     397             :     if (
     398             :         (bOK                                 ) &&
     399             :         ((eExpectedPart & E_ALIAS) == E_ALIAS)
     400             :        )
     401             :     {
     402             :         bOK = (
     403             :                 (aURL.isValid()                          ) &&
     404             :                 (aURL.getAlias(sAlias)                   ) &&
     405             :                 (!sAlias.isEmpty()                       ) &&
     406             :                 (sAlias.equalsAscii(pExpectedAlias))
     407             :               );
     408             : 
     409             :         if (bOK && pExpectedAliasArgs!=NULL)
     410             :         {
     411             :             bOK = (
     412             :                     (aURL.getAliasArgs(sAliasArgs)                   ) &&
     413             :                     (sAliasArgs.equalsAscii(pExpectedAliasArgs))
     414             :                   );
     415             :         }
     416             :     }
     417             : 
     418             :     // check if URL has the no alias part
     419             :     if (
     420             :         (bOK                                 ) &&
     421             :         ((eExpectedPart & E_ALIAS) != E_ALIAS)
     422             :        )
     423             :     {
     424             :         bOK = (
     425             :                 (!aURL.getAlias(sAlias)        ) &&
     426             :                 (sAlias.isEmpty()              ) &&
     427             :                 (!aURL.getAliasArgs(sAliasArgs)) &&
     428             :                 (sAliasArgs.isEmpty()          )
     429             :               );
     430             :     }
     431             : 
     432             :     // check if URL has the expected service part
     433             :     if (
     434             :         (bOK                                     ) &&
     435             :         ((eExpectedPart & E_SERVICE) == E_SERVICE)
     436             :        )
     437             :     {
     438             :         bOK = (
     439             :                 (aURL.isValid()                              ) &&
     440             :                 (aURL.getService(sService)                   ) &&
     441             :                 (!sService.isEmpty()                         ) &&
     442             :                 (sService.equalsAscii(pExpectedService))
     443             :               );
     444             : 
     445             :         if (bOK && pExpectedServiceArgs!=NULL)
     446             :         {
     447             :             bOK = (
     448             :                     (aURL.getServiceArgs(sServiceArgs)                   ) &&
     449             :                     (sServiceArgs.equalsAscii(pExpectedServiceArgs))
     450             :                   );
     451             :         }
     452             :     }
     453             : 
     454             :     // check if URL has the no service part
     455             :     if (
     456             :         (bOK                                     ) &&
     457             :         ((eExpectedPart & E_SERVICE) != E_SERVICE)
     458             :        )
     459             :     {
     460             :         bOK = (
     461             :                 (!aURL.getService(sService)        ) &&
     462             :                 (sService.isEmpty()                ) &&
     463             :                 (!aURL.getServiceArgs(sServiceArgs)) &&
     464             :                 (sServiceArgs.isEmpty()            )
     465             :               );
     466             :     }
     467             : 
     468             :     OUStringBuffer sMsg(256);
     469             : 
     470             :     sMsg.append(sURL);
     471             :     sMsg.appendAscii("\" ");
     472             : 
     473             :     if (bOK)
     474             :     {
     475             :         sMsg.appendAscii("... OK\n");
     476             :     }
     477             :     else
     478             :     {
     479             :         sMsg.appendAscii("... failed. ");
     480             :         sMsg.appendAscii("Expected: ");
     481             :         if (eExpectedPart==E_UNKNOWN)
     482             :             sMsg.appendAscii("E_UNKNOWN");
     483             :         if ((eExpectedPart & E_EVENT) == E_EVENT)
     484             :         {
     485             :             sMsg.appendAscii("| E_EVENT e=\"");
     486             :             sMsg.appendAscii(pExpectedEvent  );
     487             :             sMsg.appendAscii("\""            );
     488             :         }
     489             :         if ((eExpectedPart & E_ALIAS) == E_ALIAS)
     490             :         {
     491             :             sMsg.appendAscii("| E_ALIAS a=\"");
     492             :             sMsg.appendAscii(pExpectedAlias  );
     493             :             sMsg.appendAscii("\""            );
     494             :         }
     495             :         if ((eExpectedPart & E_SERVICE) == E_SERVICE)
     496             :         {
     497             :             sMsg.appendAscii("| E_SERVICE s=\"");
     498             :             sMsg.appendAscii(pExpectedService  );
     499             :             sMsg.appendAscii("\""              );
     500             :         }
     501             :         sMsg.appendAscii(", Actual: "     );
     502             :         sMsg.append     (aURL.impldbg_toString());
     503             :     }
     504             : 
     505             :     SAL_INFO("fwk.joburl", OUString(sMsg));
     506             : }
     507             : 
     508             : /**
     509             :     @short      helper debug method
     510             :     @descr      It returns a representation of the internal object state
     511             :                 as string notation.
     512             : 
     513             :     @returns    The formated string representation.
     514             : */
     515             : OUString JobURL::impldbg_toString() const
     516             : {
     517             :     SolarMutexGuard g;
     518             : 
     519             :     OUStringBuffer sBuffer(256);
     520             : 
     521             :     if (m_eRequest==E_UNKNOWN)
     522             :         sBuffer.appendAscii("E_UNKNOWN");
     523             :     if ((m_eRequest & E_EVENT) == E_EVENT)
     524             :         sBuffer.appendAscii("| E_EVENT");
     525             :     if ((m_eRequest & E_ALIAS) == E_ALIAS)
     526             :         sBuffer.appendAscii("| E_ALIAS");
     527             :     if ((m_eRequest & E_SERVICE) == E_SERVICE)
     528             :         sBuffer.appendAscii("| E_SERVICE");
     529             :     sBuffer.appendAscii("{ e=\""   );
     530             :     sBuffer.append     (m_sEvent   );
     531             :     sBuffer.appendAscii("\" - a=\"");
     532             :     sBuffer.append     (m_sAlias   );
     533             :     sBuffer.appendAscii("\" - s=\"");
     534             :     sBuffer.append     (m_sService );
     535             :     sBuffer.appendAscii("\" }"     );
     536             : 
     537             :     return sBuffer.makeStringAndClear();
     538             : }
     539             : 
     540             : sal_Bool JobURL::getServiceArgs( /*OUT*/ OUString& sServiceArgs ) const
     541             : {
     542             :     SolarMutexGuard g;
     543             : 
     544             :              sServiceArgs = OUString();
     545             :     sal_Bool bSet         = ((m_eRequest & E_SERVICE) == E_SERVICE);
     546             :     if (bSet)
     547             :         sServiceArgs = m_sServiceArgs;
     548             : 
     549             :     return bSet;
     550             : }
     551             : 
     552             : sal_Bool JobURL::getEventArgs( /*OUT*/ OUString& sEventArgs ) const
     553             : {
     554             :     SolarMutexGuard g;
     555             : 
     556             :              sEventArgs = OUString();
     557             :     sal_Bool bSet       = ((m_eRequest & E_EVENT) == E_EVENT);
     558             :     if (bSet)
     559             :         sEventArgs = m_sEventArgs;
     560             : 
     561             :     return bSet;
     562             : }
     563             : 
     564             : sal_Bool JobURL::getAliasArgs( /*OUT*/ OUString& sAliasArgs ) const
     565             : {
     566             :     SolarMutexGuard g;
     567             : 
     568             :              sAliasArgs = OUString();
     569             :     sal_Bool bSet       = ((m_eRequest & E_ALIAS) == E_ALIAS);
     570             :     if (bSet)
     571             :         sAliasArgs = m_sAliasArgs;
     572             : 
     573             :     return bSet;
     574             : }
     575             : 
     576             : #endif // ENABLE_COMPONENT_SELF_CHECK
     577             : 
     578         951 : } // namespace framework
     579             : 
     580             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10