Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: util/mac/mac_util.h

Issue 473023002: Add mac_util, including MacOSXMinorVersion(), MacOSXVersion(), and MacModelAndBoard() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Improve documentation Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | util/mac/mac_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CRASHPAD_UTIL_MAC_MAC_UTIL_H_
16 #define CRASHPAD_UTIL_MAC_MAC_UTIL_H_
17
18 #include <string>
19
20 namespace crashpad {
21
22 //! \brief Returns the version of the running operating system.
23 //!
24 //! \return The minor version of the operating system, such as `9` for Mac OS X
25 //! 10.9.2.
26 //!
27 //! \note This is similar to the base::mac::IsOS*() family of functions, but
28 //! is provided for situations where the caller needs to obtain version
29 //! information beyond what is provided by Chromium’s base, or for when the
30 //! caller needs the actual minor version value.
31 int MacOSXMinorVersion();
32
33 //! \brief Returns the version of the running operating system.
34 //!
35 //! All parameters are required. No parameter may be `NULL`.
36 //!
37 //! \param[out] major The major version of the operating system, such as `10`
38 //! for Mac OS X 10.9.2.
39 //! \param[out] minor The major version of the operating system, such as `9` for
40 //! Mac OS X 10.9.2.
41 //! \param[out] bugfix The bugfix version of the operating system, such as `2`
42 //! for Mac OS X 10.9.2.
43 //! \param[out] build The operating system’s build string, such as "13C64" for
44 //! Mac OS X 10.9.2.
45 //! \param[out] server `true` for a Mac OS X Server installation, `false`
46 //! otherwise (for a desktop/laptop, client, or workstation system).
47 //! \param[out] version_string A string representing the full operating system
48 //! version, such as `"Mac OS X 10.9.2 (13C64)"`.
49 //!
50 //! \return `true` on success, `false` on failure, with an error message logged.
51 //! A failure is considered to have occurred if any element could not be
52 //! determined. When this happens, their values will be untouched, but other
53 //! values that could be determined will still be set properly.
54 bool MacOSXVersion(int* major,
55 int* minor,
56 int* bugfix,
57 std::string* build,
58 bool* server,
59 std::string* version_string);
60
61 //! \brief Returns the model name and board ID of the running system.
62 //!
63 //! \param[out] model The system’s model name. A mid-2012 15" MacBook Pro would
64 //! report “MacBookPro10,1”.
65 //! \param[out] board_id The system’s board ID. A mid-2012 15" MacBook Pro would
66 //! report “Mac-C3EC7CD22292981F”.
67 //!
68 //! If a value cannot be determined, its string is cleared.
69 void MacModelAndBoard(std::string* model, std::string* board_id);
70
71 } // namespace crashpad
72
73 #endif // CRASHPAD_UTIL_MAC_MAC_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | util/mac/mac_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698