Changeset 101:8ffe936eef5b in rrlib_util


Ignore:
Timestamp:
25.10.2013 03:37:06 (6 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Parents:
97:693e3b37d37f (diff), 99:f488dabb5efa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merged default

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sFileIOUtils.cpp

    r94 r101  
    55// Copyright (C) Finroc GbR (finroc.org) 
    66// 
    7 // This program is free software; you can redistribute it and/or 
    8 // modify it under the terms of the GNU General Public License 
    9 // as published by the Free Software Foundation; either version 2 
    10 // of the License, or (at your option) any later version. 
     7// This program is free software; you can redistribute it and/or modify 
     8// it under the terms of the GNU General Public License as published by 
     9// the Free Software Foundation; either version 2 of the License, or 
     10// (at your option) any later version. 
    1111// 
    1212// This program is distributed in the hope that it will be useful, 
     
    1515// GNU General Public License for more details. 
    1616// 
    17 // You should have received a copy of the GNU General Public License 
    18 // along with this program; if not, write to the Free Software 
    19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     17// You should have received a copy of the GNU General Public License along 
     18// with this program; if not, write to the Free Software Foundation, Inc., 
     19// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
    2020// 
    2121//---------------------------------------------------------------------- 
  • sFileIOUtils.cpp

    r98 r101  
    237237// class sFileIOUtils::ShellExpandFilename() 
    238238//---------------------------------------------------------------------- 
     239std::string sFileIOUtils::ShellExpandFilename(const std::string &file_name) 
     240{ 
     241  std::string result(""); 
     242  if (ShellExpandFilename(result, file_name)) 
     243    return result; 
     244  else 
     245    return ""; 
     246} // ShellExpandFilename() 
     247 
     248 
     249//---------------------------------------------------------------------- 
     250// class sFileIOUtils::ShellExpandFilename() 
     251//---------------------------------------------------------------------- 
    239252bool sFileIOUtils::ShellExpandFilename(std::string &result, const std::string &file_name) 
    240253{ 
     
    461474  RRLIB_LOG_PRINTF(DEBUG_VERBOSE_1, "sFileIOUtils::HostToIpViaHost() >>> got %d tokens:\n", tokens.size()); 
    462475  RRLIB_LOG_PRINT(DEBUG_VERBOSE_1, Join(tokens, "\n")); 
     476  if (tokens.size() != 4) 
     477  { 
     478    RRLIB_LOG_PRINT(WARNING, "Could not determine IP for host name ", name); 
     479    return address; 
     480  } 
    463481 
    464482  assert(tokens.size() == 4); 
  • sFileIOUtils.h

    r93 r101  
    55// Copyright (C) Finroc GbR (finroc.org) 
    66// 
    7 // This program is free software; you can redistribute it and/or 
    8 // modify it under the terms of the GNU General Public License 
    9 // as published by the Free Software Foundation; either version 2 
    10 // of the License, or (at your option) any later version. 
     7// This program is free software; you can redistribute it and/or modify 
     8// it under the terms of the GNU General Public License as published by 
     9// the Free Software Foundation; either version 2 of the License, or 
     10// (at your option) any later version. 
    1111// 
    1212// This program is distributed in the hope that it will be useful, 
     
    1515// GNU General Public License for more details. 
    1616// 
    17 // You should have received a copy of the GNU General Public License 
    18 // along with this program; if not, write to the Free Software 
    19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     17// You should have received a copy of the GNU General Public License along 
     18// with this program; if not, write to the Free Software Foundation, Inc., 
     19// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
    2020// 
    2121//---------------------------------------------------------------------- 
  • sFileIOUtils.h

    r98 r101  
    228228 
    229229  /*! Expands the given filename via a pipe and echo command in order to replace all contained environment variables with their actual value. 
     230   * 
     231   * \param file_name   file name to be expanded 
     232   * 
     233   * \returns Expanded file name 
     234   */ 
     235  static std::string ShellExpandFilename(const std::string &file_name)  __attribute__((__warn_unused_result__)); 
     236 
     237  /*! Expands the given filename via a pipe and echo command in order to replace all contained environment variables with their actual value. 
    230238  * 
    231239  * Thus variables as e.g. $MCAPROJECTHOME can be used for specifying OIV files in scene description files. 
  • variadic_templates.h

    r92 r101  
    55// Copyright (C) Finroc GbR (finroc.org) 
    66// 
    7 // This program is free software; you can redistribute it and/or 
    8 // modify it under the terms of the GNU General Public License 
    9 // as published by the Free Software Foundation; either version 2 
    10 // of the License, or (at your option) any later version. 
     7// This program is free software; you can redistribute it and/or modify 
     8// it under the terms of the GNU General Public License as published by 
     9// the Free Software Foundation; either version 2 of the License, or 
     10// (at your option) any later version. 
    1111// 
    1212// This program is distributed in the hope that it will be useful, 
     
    1515// GNU General Public License for more details. 
    1616// 
    17 // You should have received a copy of the GNU General Public License 
    18 // along with this program; if not, write to the Free Software 
    19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     17// You should have received a copy of the GNU General Public License along 
     18// with this program; if not, write to the Free Software Foundation, Inc., 
     19// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
    2020// 
    2121//---------------------------------------------------------------------- 
  • variadic_templates.h

    r98 r101  
    6464//---------------------------------------------------------------------- 
    6565 
    66 template <typename TElement> 
    67 inline void ProcessVariadicValues(std::function<void(const TElement &)> process_value) 
     66template <typename TProcessor> 
     67inline void ProcessVariadicValues(const TProcessor &process_value) 
    6868{} 
    6969 
    70 template <typename TElement, typename THead, typename ... TTail> 
    71 //inline void ProcessVariadicValues(const THead &head, const TTail &... tail, std::function<void(const THead &)> process_value) FIXME: will probably be valid with gcc 4.6 and does not need hints at instantiation 
    72 inline void ProcessVariadicValues(std::function<void(const TElement &)> process_value, const THead &head, const TTail &... tail) 
     70template <typename TProcessor, typename THead, typename ... TTail> 
     71inline void ProcessVariadicValues(const TProcessor &process_value, const THead &head, const TTail &... tail) 
    7372{ 
    7473  process_value(head); 
Note: See TracChangeset for help on using the changeset viewer.