• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision200 (tree)
Time2019-03-09 09:07:26
Authorquiret

Log Message

- changed conversion methods in eir::MultiString to need specification of allocatorType because exposing directMSAllocator is not a good idea
- various fixes across the board

Change Summary

Incremental Difference

--- common/sdk/ABIHelpers.h (revision 199)
+++ common/sdk/ABIHelpers.h (revision 200)
@@ -82,7 +82,7 @@
8282 abstractVirtualContainer *container;
8383
8484 template <typename allocatorType, typename... Args>
85- AINLINE void allocateContainer( const charType *str, size_t strLen, Args... theArgs )
85+ AINLINE void allocateContainer( const charType *str, size_t strLen, Args&&... theArgs )
8686 {
8787 using charVirtualContainer = virtualContainer <allocatorType>;
8888
@@ -153,7 +153,7 @@
153153
154154 public:
155155 template <typename allocatorType, typename... Args>
156- static AINLINE abiVirtualString Make( const charType *str, size_t strLen, Args... allocArgs )
156+ static AINLINE abiVirtualString Make( const charType *str, size_t strLen, Args&&... allocArgs )
157157 {
158158 abiVirtualString string;
159159 string.template allocateContainer <allocatorType, Args...> ( str, strLen, std::forward <Args> ( allocArgs )... );
@@ -160,7 +160,7 @@
160160 return string;
161161 }
162162
163- inline abiVirtualString( abiVirtualString&& right )
163+ inline abiVirtualString( abiVirtualString&& right ) noexcept
164164 {
165165 this->container = right.container;
166166
@@ -194,7 +194,7 @@
194194 return *this;
195195 }
196196
197- inline abiVirtualString& operator = ( abiVirtualString&& right )
197+ inline abiVirtualString& operator = ( abiVirtualString&& right ) noexcept
198198 {
199199 if ( abstractVirtualContainer *container = this->container )
200200 {
@@ -208,7 +208,7 @@
208208 return *this;
209209 }
210210
211- inline const charType* c_str( void ) const
211+ inline const charType* c_str( void ) const noexcept
212212 {
213213 abstractVirtualContainer *container = this->container;
214214
@@ -222,7 +222,7 @@
222222 return (charType*)( (char*)container + charbuf_off );
223223 }
224224
225- inline size_t size( void ) const
225+ inline size_t size( void ) const noexcept
226226 {
227227 size_t len = 0;
228228
@@ -234,7 +234,7 @@
234234 return len;
235235 }
236236
237- inline size_t length( void ) const
237+ inline size_t length( void ) const noexcept
238238 { return size(); }
239239 };
240240
--- common/sdk/MultiString.h (revision 199)
+++ common/sdk/MultiString.h (revision 200)
@@ -1631,9 +1631,10 @@
16311631 }
16321632
16331633 // More advanced functions.
1634- inline eir::String <char, directMSAllocator> convert_ansi( void ) const
1634+ template <typename subAllocatorType, typename... Args>
1635+ inline eir::String <char, subAllocatorType> convert_ansi( Args&&... allocArgs ) const
16351636 {
1636- eir::String <char, directMSAllocator> ansiOut( nullptr, 0, const_cast <MultiString*> ( this ) );
1637+ eir::String <char, subAllocatorType> ansiOut( nullptr, 0, std::forward <Args> ( allocArgs )... );
16371638
16381639 if ( stringProvider *provider = this->data.strData )
16391640 {
@@ -1645,9 +1646,10 @@
16451646 return ansiOut;
16461647 }
16471648
1648- inline eir::String <wchar_t, directMSAllocator> convert_unicode( void ) const
1649+ template <typename subAllocatorType, typename... Args>
1650+ inline eir::String <wchar_t, subAllocatorType> convert_unicode( Args&&... allocArgs ) const
16491651 {
1650- eir::String <wchar_t, directMSAllocator> unicodeOut( nullptr, 0, const_cast <MultiString*> ( this ) );
1652+ eir::String <wchar_t, subAllocatorType> unicodeOut( nullptr, 0, std::forward <Args> ( allocArgs )... );
16511653
16521654 if ( stringProvider *provider = this->data.strData )
16531655 {
--- common/sdk/String.h (revision 199)
+++ common/sdk/String.h (revision 200)
@@ -609,6 +609,7 @@
609609 private:
610610 // The actual members of the String object.
611611 // Only time will tell if they'll include static_if.
612+ // Maybe we will have a nice time with C++ concepts?
612613 struct fields
613614 {
614615 charType *char_data;
--- common/sdk/UniChar.h (revision 199)
+++ common/sdk/UniChar.h (revision 200)
@@ -1096,7 +1096,7 @@
10961096 }
10971097
10981098 template <typename inputCharType, typename outputCharType, typename allocatorType, typename... Args>
1099- inline eir::String <outputCharType, allocatorType> ConvertStrings( const inputCharType *inputChars, Args... allocArgs )
1099+ inline eir::String <outputCharType, allocatorType> ConvertStrings( const inputCharType *inputChars, Args&&... allocArgs )
11001100 {
11011101 try
11021102 {
@@ -1119,7 +1119,7 @@
11191119 }
11201120
11211121 template <typename inputCharType, typename outputCharType, typename allocatorType, bool optimizeEqual = true, typename... Args>
1122- inline eir::String <outputCharType, allocatorType> ConvertStringsLength( const inputCharType *inputChars, size_t inputLen, Args... allocArgs )
1122+ inline eir::String <outputCharType, allocatorType> ConvertStringsLength( const inputCharType *inputChars, size_t inputLen, Args&&... allocArgs )
11231123 {
11241124 if constexpr ( optimizeEqual && std::is_same <inputCharType, outputCharType>::value )
11251125 {
@@ -1150,7 +1150,7 @@
11501150 }
11511151
11521152 template <typename inputCharType, typename outputCharType, typename allocatorType, bool optimizeEqual = true, typename... Args>
1153- inline eir::String <outputCharType, allocatorType> ConvertStrings( const eir::String <inputCharType, allocatorType>& inputStr, Args... allocArgs )
1153+ inline eir::String <outputCharType, allocatorType> ConvertStrings( const eir::String <inputCharType, allocatorType>& inputStr, Args&&... allocArgs )
11541154 {
11551155 if constexpr ( optimizeEqual && std::is_same <inputCharType, outputCharType>::value )
11561156 {
Show on old repository browser