Platform :: string Functions in Windows 8 / RT C ++

Possible duplicate:
Platform :: A string seems to be useless

I'm new to Windows development, and the new Visual C ++ APIs are teasing me. Recently, I came across an apparent lack of string functions. Are there any basic features such as:

  • substring
  • strpos or similar
  • regular expressions

My ultimate goal is to take a path to a file such as "C: \ foo \ bar \ baz.jpg" and extract the deepest directory. In this example, I am looking for a bar.

Perhaps due to more concern, I found it incredibly difficult to find the current documentation for the Win 8 API. What is the best place to find such questions?

+4
source share
2 answers

WinRT C ++ / CX classes, such as Platform::String , should only be used on the border of your applications / components. Inside your applications / components, you should simply use the regular C ++ ISO classes.

That way you can just use std::wstring (since Platform::String is Unicode) with its Boost methods and helpers, and then convert from / to std::wstring to / from Platform::String on the border.

+3
source
Substring

is part of the C ++ standard library.

 string x = "abc"; string y = x.substr(1, 2); 

Not quite sure that I know what strpos does, but on the condition that it finds the position of the character in a string or similar, and then standard.

 string x = "abc"; string::size_type p = x.find('b'); 

Regular expressions can be found in the cross-platform acceleration library, http://boost.org .

+3
source

Source: https://habr.com/ru/post/1440494/


All Articles