Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::codecvt<InternT,ExternT,StateT>::unshift, do_unshift

      From cppreference.com
      <cpp‎ |locale‎ |codecvt
       
       
       
      Localization library
       
       
      Defined in header<locale>
      public:

      result unshift( StateT& state, ExternT* to, ExternT* to_end,

                      ExternT*& to_next)const;
      (1)
      protected:

      virtual result do_unshift( StateT& state, ExternT* to, ExternT* to_end,

                                 ExternT*& to_next)const;
      (2)
      1) Public member function, calls the member functiondo_unshift of the most derived class.
      2) If the encoding represented by thiscodecvt facet is state-dependent, andstate represents a conversion state that is not the initial shift state, writes the characters necessary to return to the initial shift state. The characters are written to a character array whose first element is pointed to byto. No more thanto_end- to characters are written. The parameterto_next is updated to point one past the last character written.

      Contents

      [edit]Return value

      A value of typestd::codecvt_base::result, indicating the success status as follows:

      ok all necessary characters were written.state now represents initial shift state
      partial not enough space in the output buffer.to_next== to_end
      error an unspecified error has occurred
      noconv the encoding is not state-dependent, no termination sequence necessary

      [edit]Notes

      This function is called bystd::basic_filebuf::close() and in other situations when finalizing a state-dependent multibyte character sequence.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 305C++98std::codecvt<wchar_t,char,std::mbstate_t>::do_unshift
      was required not to write any character
      not required
      LWG 380C++98the meaning of returningpartial was 'more characters need to
      be supplied to complete termination', but no character is supplied
      corrected to indicating
      insufficient buffer space
      LWG 381C++98state was not required to be valid, and
      error is returned ifstate is invalid
      state is required to be valid, and
      returningerror indicates an error
      LWG 664C++98std::codecvt<char,char,std::mbstate_t>::do_unshift
      was required not to write any character
      not required
      LWG 665C++98std::codecvt<char,char,std::mbstate_t>::do_unshift
      was required to returnnoconv
      not required

      [edit]See also

      converts a wide character to its multibyte representation, given state
      (function)[edit]
      [virtual]
      converts a string fromInternT toExternT, such as when writing to file
      (virtual protected member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/locale/codecvt/unshift&oldid=147380"

      [8]ページ先頭

      ©2009-2025 Movatter.jp