Revision 202b47e9 include/NebulaUtil.h

View differences:

include/NebulaUtil.h
96 96
     * @param st string to split
97 97
     * @param delim delimiter character
98 98
     * @param result where the result will be saved
99
     * @param clean_empty true to clean empty split parts.
100
     *  Example for st "a::b:c"
101
     *      clean_empty true will return ["a", "b", "c"]
102
     *      clean_empty fase will return ["a", "", "b", "c"]
103 99
     */
104 100
    template <class T>
105
    void split_unique(
106
            const std::string& st,
107
            char delim,
108
            std::set<T>& result,
109
            bool clean_empty=true)
101
    void split_unique(const std::string& st, char delim, std::set<T>& result)
110 102
    {
111 103
        T elem;
112 104
        std::vector<std::string>::const_iterator it;
113 105

  
114
        std::vector<std::string> strings = split(st, delim, clean_empty);
106
        std::vector<std::string> strings = split(st, delim, true);
115 107

  
116 108
        for (it = strings.begin(); it != strings.end(); it++)
117 109
        {
......
128 120
    }
129 121

  
130 122
    /**
123
     * Explicit specialization for strings
124
     */
125
    template <>
126
    void split_unique(const std::string& st, char delim,
127
            std::set<std::string>& result);
128

  
129
    /**
131 130
     * Joins the given element with the delimiter
132 131
     *
133 132
     * @param first iterator

Also available in: Unified diff