Sierra Toolkit  Version of the Day
ci_string.cpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #include <iostream>
10 
11 #include <stk_util/util/ci_string.hpp>
12 
13 std::ostream &
15  std::ostream & os,
16  const ci_string & s)
17 {
18  return os << std::string(s.data(),s.length());
19 }
20 
21 
22 std::istream &
23 operator>>(
24  std::istream & is,
25  ci_string & s)
26 {
27  std::string t;
28  is >> t;
29  s = ci_string(t.begin(), t.end());
30 
31  return is;
32 }
33 
34 std::string
35 operator+(
36  const std::string & s1,
37  const ci_string & s2)
38 {
39  std::string s(s1);
40 
41  return s.append(s2.begin(), s2.end());
42 }
43 
44 
45 ci_string
46 operator+(
47  const char * s1,
48  const ci_string & s2)
49 {
50  ci_string s(s1);
51 
52  return s.append(s2.begin(), s2.end());
53 }
54 
55 
56 ci_string
57 operator+(
58  const ci_string & s1,
59  const std::string & s2)
60 {
61  ci_string s(s1);
62 
63  return s.append(s2.begin(), s2.end());
64 }
65 
66 
67 // namespace boost {
68 
69 // std::size_t
70 // hash<ci_string>::operator()(
71 // const ci_string & s) const
72 // {
73 // std::size_t seed = 0;
74 
75 // for(ci_string::const_iterator first = s.begin(); first != s.end(); ++first) {
76 // std::tr1::hash<char> hasher;
77 // seed ^= hasher(std::tolower(*first)) + 0x9e3779b9 + (seed<<6) + (seed>>2);
78 // }
79 
80 // return seed;
81 // }
82 
83 // } // namespace boost
std::ostream & operator<<(std::ostream &s, const Bucket &k)
Print the part names for which this bucket is a subset.
Definition: Bucket.cpp:239