Merge pull request #1423 from technic/fmt-refactor
move Glib ustring format helper to utils
This commit is contained in:
		
						commit
						074b559da5
					
				| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <fmt/format.h>
 | 
					#include <fmt/format.h>
 | 
				
			||||||
 | 
					#include <glibmm/ustring.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class pow_format {
 | 
					class pow_format {
 | 
				
			||||||
  public:
 | 
					  public:
 | 
				
			||||||
| 
						 | 
					@ -84,5 +85,15 @@ namespace fmt {
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Glib ustirng support
 | 
				
			||||||
 | 
					    template <>
 | 
				
			||||||
 | 
					    struct formatter<Glib::ustring> : formatter<std::string> {
 | 
				
			||||||
 | 
					      template <typename FormatContext>
 | 
				
			||||||
 | 
					      auto format(const Glib::ustring& value, FormatContext& ctx) {
 | 
				
			||||||
 | 
					        return formatter<std::string>::format(value, ctx);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,13 +8,7 @@
 | 
				
			||||||
#include <fstream>
 | 
					#include <fstream>
 | 
				
			||||||
#include <map>
 | 
					#include <map>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
template <>
 | 
					#include "util/format.hpp"
 | 
				
			||||||
struct fmt::formatter<Glib::ustring> : formatter<std::string> {
 | 
					 | 
				
			||||||
  template <typename FormatContext>
 | 
					 | 
				
			||||||
  auto format(const Glib::ustring& value, FormatContext& ctx) {
 | 
					 | 
				
			||||||
    return formatter<std::string>::format(value, ctx);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
template <>
 | 
					template <>
 | 
				
			||||||
struct fmt::formatter<Glib::VariantBase> : formatter<std::string> {
 | 
					struct fmt::formatter<Glib::VariantBase> : formatter<std::string> {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue