You.i Engine
YiPropertiesSource.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_PROPERTIES_SOURCE_H_
3 #define _YI_PROPERTIES_SOURCE_H_
4 
5 #include "utility/YiOptional.h"
6 
7 #include <functional>
8 #include <map>
9 
10 class CYIString;
11 class CYIStringView;
12 
22 {
23 public:
24  virtual ~IYIPropertiesSource() = default;
25 
31  virtual CYIOptional<CYIStringView> GetProperty(CYIStringView propertyName) const = 0;
32 
38  bool GetProperty(CYIStringView propertyName, CYIString *pValue) const;
39 
43  virtual std::map<CYIString, CYIString> GetProperties() const = 0;
44 
48  virtual void ForEachProperty(const std::function<void(const CYIString & /* propertyName */, const CYIString & /* propertyValue */)> &action) const = 0;
49 
53  virtual bool HasProperties() const = 0;
54 };
55 
58 #endif // _YI_PROPERTIES_SOURCE_H_
virtual ~IYIPropertiesSource()=default
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:32
virtual CYIOptional< CYIStringView > GetProperty(CYIStringView propertyName) const =0
virtual std::map< CYIString, CYIString > GetProperties() const =0
A container class that either contains a value or &#39;nothing&#39;.
Definition: YiOptional.h:64
An interface to a class that provides key-value properties.
Definition: YiPropertiesSource.h:21
virtual void ForEachProperty(const std::function< void(const CYIString &, const CYIString &)> &action) const =0
virtual bool HasProperties() const =0
A lightweight wrapper around a sequence of Unicode characters.
Definition: YiStringView.h:61