Project

General

Profile

fhiclcpp-v3_12_08.patch

Patrick Gartung, 01/25/2016 09:36 PM

View differences:

fhiclcpp/ParameterSet.cc
59 59

  
60 60
}
61 61

  
62

  
62 63
// ======================================================================
63 64

  
64 65
string
fhiclcpp/ParameterSet.h
11 11
#include "boost/lexical_cast.hpp"
12 12
#include "boost/numeric/conversion/cast.hpp"
13 13
#include "cetlib/demangle.h"
14
#include "cetlib/split_by_regex.h"
15 14
#include "fhiclcpp/ParameterSetID.h"
16 15
#include "fhiclcpp/coding.h"
17 16
#include "fhiclcpp/detail/ParameterSetImplHelpers.h"
......
25 24
#include "fhiclcpp/fwd.h"
26 25

  
27 26
#include <cctype>
28
#include <regex>
29 27
#include <map>
30 28
#include <sstream>
31 29
#include <string>
fhiclcpp/types/Name.cc
1
#include <regex>
2
#include <string>
3
#include "fhiclcpp/types/Name.h"
4

  
5
namespace fhicl {
6

  
7
    std::string const get_regex_replace_str(std::string const& istr)
8
    {
9
      static std::regex const r("\\[|\\]");
10
      auto ostr = std::regex_replace( istr , r , "\\$&" );
11
      return ostr;
12
    }
13

  
14
}
15

  
16
// Local variables:
17
// mode: c++
18
// End:
fhiclcpp/types/Name.h
6 6

  
7 7
namespace fhicl {
8 8

  
9
  std::string const get_regex_replace_str(std::string const& str);
10

  
9 11
  struct Name {
10 12

  
11 13
    explicit Name(std::string const& name = "") : value(name) {}
......
26 28
      padded with an escape character so the regex library doesn't
27 29
      think we're trying to specify a character set.
28 30
    */
29
    static std::string regex_safe(std::string const& key)
31
    static const std::string regex_safe(std::string const& key)
30 32
    {
31
      return std::regex_replace( key, std::regex("\\[|\\]"), "\\$&" );
33
      std::string const skey = fhicl::get_regex_replace_str( key );
34
      return skey;
32 35
    }
33 36

  
34 37
  private:
fhiclcpp/types/detail/MaybeDisplayParent.cc
1

  
2
#include "cetlib/exempt_ptr.h"
3
#include "cetlib/split_by_regex.h"
4
#include "fhiclcpp/types/detail/ParameterBase.h"
5
#include "fhiclcpp/types/detail/MaybeDisplayParent.h"
6

  
7
#include <cctype>
8
#include <sstream>
9
#include <regex>
10
#include <vector>
11

  
12
//===================================================================================
13
namespace fhicl {
14
  namespace detail {
15

  
16
      std::vector<std::string> MaybeDisplayParent::get_parents(std::string const& k){
17
        std::regex const r_index {"\\[(\\d+)\\]"};
18
        std::vector<std::string> parents;
19
        for ( auto const& key : cet::split_by_regex( k, "\\." ) )
20
          for ( auto const& token : cet::split_by_regex( std::regex_replace(key, r_index, ",$1" ), ",") )
21
            parents.push_back( token );
22

  
23
        // Skip first key, which is something like "<0>" in the context
24
        // whenever this function is called.
25
        return std::vector<std::string>( parents.begin()+1, parents.end() );
26
      }
27

  
28
  }
29
}
30

  
31
// Local variables:
32
// mode: c++
33
// End:
fhiclcpp/types/detail/MaybeDisplayParent.h
2 2
#define fhiclcpp_types_detail_MaybeDisplayParent_h
3 3

  
4 4
#include "cetlib/exempt_ptr.h"
5
#include "cetlib/split_by_regex.h"
6 5
#include "fhiclcpp/types/detail/ParameterBase.h"
6
#include "fhiclcpp/detail/Indentation.h"
7 7

  
8 8
#include <cctype>
9 9
#include <sstream>
10
#include <regex>
11 10
#include <vector>
12 11

  
13 12
//===================================================================================
......
93 92
      std::vector<std::string> closingBraces_;
94 93
      Indentation& indent_;
95 94

  
96
      std::vector<std::string> get_parents(std::string const& k){
97
        std::regex const r_index {"\\[(\\d+)\\]"};
98
        std::vector<std::string> parents;
99
        for ( auto const& key : cet::split_by_regex( k, "\\." ) )
100
          for ( auto const& token : cet::split_by_regex( std::regex_replace(key, r_index, ",$1" ), ",") )
101
            parents.push_back( token );
102

  
103
        // Skip first key, which is something like "<0>" in the context
104
        // whenever this function is called.
105
        return std::vector<std::string>( parents.begin()+1, parents.end() );
106
      }
95
      std::vector<std::string> get_parents(std::string const& k);
107 96

  
108 97
      bool is_sequence_element(ParameterBase const& p)
109 98
      {
fhiclcpp/types/detail/NameStackRegistry.cc
1
#include "fhiclcpp/exception.h"
2
#include "fhiclcpp/types/detail/NameStackRegistry.h"
3
#include <iostream>
4
#include <regex>
5
#include <string>
6
#include <vector>
7

  
8
namespace fhicl {
9

  
10
    std::string NameStackRegistry::full_key(std::string const & key)
11
    {
12
      if ( names_.empty() ||
13
           std::regex_match(key,std::regex{R"(\[(\d+)\])"})) // Sequence elements
14
        names_.emplace_back(key);
15
      else
16
        names_.emplace_back("."+key);
17
      return full_key_();
18
    }
19

  
20

  
21
}
22

  
23
// Local variables:
24
// mode: c++
25
// End:
fhiclcpp/types/detail/NameStackRegistry.h
38 38
*/
39 39

  
40 40
#include "fhiclcpp/exception.h"
41

  
41
#include <numeric>
42 42
#include <iostream>
43
#include <regex>
44 43
#include <string>
45 44
#include <vector>
46 45

  
......
49 48
  class NameStackRegistry {
50 49
  public:
51 50

  
52
    std::string full_key(std::string const & key)
53
    {
54
      if ( names_.empty() ||
55
           std::regex_match(key,std::regex{R"(\[(\d+)\])"})) // Sequence elements
56
        names_.emplace_back(key);
57
      else
58
        names_.emplace_back("."+key);
59
      return full_key_();
60
    }
51
    std::string full_key(std::string const & key);
61 52

  
62 53
    bool empty() const {
63 54
      return names_.empty();
fhiclcpp/types/detail/ostream_helpers.cc
1

  
2
#include "cetlib/demangle.h"
3

  
4
#include <ostream>
5
#include <regex>
6
#include <string>
7

  
8
namespace fhicl {
9
  namespace detail {
10
    namespace no_defaults {
11

  
12
      std::string stripped_typename( std::string const& fullName )
13
      {
14
        // Remove 'std::' from fullName
15
        std::string const strippedName = std::regex_replace(fullName, std::regex("std::"), "" );
16
        return strippedName;
17
      }
18

  
19
    } } } // fhicl::detail::no_defaults
20

  
21

  
22
// Local variables:
23
// mode : c++
24
// End:
fhiclcpp/types/detail/ostream_helpers.h
4 4
#include "cetlib/demangle.h"
5 5

  
6 6
#include <ostream>
7
#include <regex>
8 7
#include <string>
9 8

  
10 9
namespace fhicl {
......
44 43
  namespace detail {
45 44
    namespace no_defaults {
46 45

  
47
      inline std::string stripped_typename( std::string const& fullName )
48
      {
49
        // Remove 'std::' from fullName
50
        std::string const strippedName = std::regex_replace(fullName, std::regex("std::"), "" );
51
        return strippedName;
52
      }
46
      std::string stripped_typename( std::string const& fullName );
53 47

  
54 48
      inline std::string padded_string( std::string const& tnToPad )
55 49
      {
ups/product_deps
1
parent fhiclcpp v3_12_08
1
parent fhiclcpp v3_12_08m
2 2
defaultqual e9
3 3
#
4 4
fcldir -
5 5
#
6 6
# define product/version pairs
7 7
product		version
8
cetlib		v1_15_03
8
cetlib		v1_15_03m
9 9
sqlite		v3_08_10_02
10 10

  
11 11
cetbuildtools	v4_18_01	-	only_for_build