Program Listing for File cxxname.hpp

Return to documentation for file (include/flamegpu/detail/cxxname.hpp)

#ifndef INCLUDE_FLAMEGPU_DETAIL_CXXNAME_HPP_
#define INCLUDE_FLAMEGPU_DETAIL_CXXNAME_HPP_

#include <string>

namespace flamegpu {
namespace detail {
namespace cxxname {

inline std::string getUnqualifiedName(std::string qualified) {
    const char * SCOPE_RESOLUTION_OPERATIOR = "::";
    size_t lastOccurence = qualified.find_last_of(SCOPE_RESOLUTION_OPERATIOR);
    if (lastOccurence == std::string::npos) {
        return qualified;
    } else {
        return qualified.substr(lastOccurence + 1);
    }
}

}  // namespace cxxname
}  // namespace detail
}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_DETAIL_CXXNAME_HPP_