Adobe.com
Contents Suites Classes Class Index Member Index

IAIGlobalUnicodeString.hpp

Go to the documentation of this file.
00001 /*************************************************************************
00002 *
00003 * ADOBE CONFIDENTIAL
00004 * 
00005 * Copyright 2017 Adobe
00006 * 
00007 * All Rights Reserved.
00008 *
00009 * NOTICE: Adobe permits you to use, modify, and distribute this file in
00010 * accordance with the terms of the Adobe license agreement accompanying
00011 * it. If you have received this file from a source other than Adobe,
00012 * then your use, modification, or distribution of it requires the prior
00013 * written permission of Adobe.
00014 *
00015 **************************************************************************/
00016 
00017 #pragma once
00018 
00019 #include "IAIUnicodeString.h"
00020 #include "IAILiteralString.h"
00021 
00053 namespace ai
00054 {
00055         class GlobalUnicodeString
00056         {
00057         public:
00063                 template<std::size_t N>
00064                 constexpr GlobalUnicodeString(const char(&str)[N], 
00065                                                                                 AICharacterEncoding encoding) AINOEXCEPT : 
00066                         mStr{ str }, mSize{ N - 1 }, mEncoding(encoding)
00067                 {}
00068 
00073                 constexpr GlobalUnicodeString(const ai::LiteralString& str, 
00074                                                                                 AICharacterEncoding encoding) AINOEXCEPT:
00075                         mStr(str.c_str()), mSize(str.size()), mEncoding(encoding)
00076                 {}
00077 
00081                 GlobalUnicodeString(const ZRef key) :mStr((const char*)key), mIsZRef(true) {}
00082 
00087                 GlobalUnicodeString(ai::UnicodeString str);
00088                 
00092                 const ai::UnicodeString& Get() const;
00093 
00097                 void Set(ai::UnicodeString newStr);
00098 
00102                 operator const ai::UnicodeString&() const
00103                 {
00104                         return Get();
00105                 }
00106         private:
00107                 const char* mStr = nullptr;
00108                 size_t mSize = 0;
00109                 bool mIsZRef = false;
00110                 mutable ai::UnicodeString* mStringPtr = nullptr;
00111                 AICharacterEncoding mEncoding = kAIRomanCharacterEncoding;
00112         };
00113 }
00114 


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks