terminal/src/cascadia/TerminalApp
Michael Kitzan e9a3fe5578 FindGuid helper function (#3762)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Adds a simple helper function to look up the GUID associated with a profile name.

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes #3680
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [x] Tests added/passed. Yes, new test group in `SettingsTests`!
* [ ] Requires documentation to be updated
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #3680

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
Very simple function, for-each through profiles checking for a match. Returns the associated GUID if found, else returns the null GUID.

This function is marked as `noexcept` to comply with assumption made by other `CascadiaSettings` functions that [`Profiles::GetGuid`](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/Profile.cpp#L141) does not throw, despite it throwing.

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
The new function is simple and can be visually validated, but added tests regardless. A new test group was added in `SettingsTests` called `TestHelperFunctions` to validate the new function `FindGuid` and older function `FindProfile`. This test group could be used to validate more helper functions in `CascadiaSettings` as they're added. The new test group passes after running `te.exe TerminalApp.LocalTests.dll`. 


--------------------------------------------

* Added FindGuid helper function

* Style change

* Tests for FindGuid and FindProfile

* Fixed code format?

* Code format guess

No feedback from the Azure pipeline

* optional<GUID> fix

* Updated function desc
2019-12-02 08:24:21 -06:00
..
lib Encapsulate dispatching ShortcutActions in it's own class (#3658) 2019-11-27 15:51:38 -06:00
Resources/en-US OK (#3675) 2019-11-25 08:01:33 -06:00
ActionAndArgs.cpp Add support for arbitrary args in keybindings (#3391) 2019-11-14 16:23:40 -06:00
ActionAndArgs.h Add support for arbitrary args in keybindings (#3391) 2019-11-14 16:23:40 -06:00
ActionArgs.cpp Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
ActionArgs.h Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
ActionArgs.idl Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
App.base.h Apply a GDI region to the top level Island window to allow dragging with a single Island (#929) 2019-06-25 13:06:11 -07:00
App.cpp Introduce a Universal package for Windows Terminal (#3236) 2019-11-25 16:30:45 -08:00
App.h Break everything out of App except Xaml platform init (#3465) 2019-11-07 13:10:58 -08:00
App.idl Break everything out of App except Xaml platform init (#3465) 2019-11-07 13:10:58 -08:00
App.xaml Increase left padding around tabs (#3513) 2019-11-12 11:19:37 -08:00
AppActionHandlers.cpp Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
AppKeyBindings.cpp Encapsulate dispatching ShortcutActions in it's own class (#3658) 2019-11-27 15:51:38 -06:00
AppKeyBindings.h Encapsulate dispatching ShortcutActions in it's own class (#3658) 2019-11-27 15:51:38 -06:00
AppKeyBindings.idl Encapsulate dispatching ShortcutActions in it's own class (#3658) 2019-11-27 15:51:38 -06:00
AppKeyBindingsSerialization.cpp Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
AppLogic.cpp Introduce a Universal package for Windows Terminal (#3236) 2019-11-25 16:30:45 -08:00
AppLogic.h Introduce a Universal package for Windows Terminal (#3236) 2019-11-25 16:30:45 -08:00
AppLogic.idl Introduce a Universal package for Windows Terminal (#3236) 2019-11-25 16:30:45 -08:00
AzureCloudShellGenerator.cpp Implement ConnectionState and closeOnExit=graceful/always/never (#3623) 2019-11-25 14:22:29 -08:00
AzureCloudShellGenerator.h Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
CascadiaSettings.cpp FindGuid helper function (#3762) 2019-12-02 08:24:21 -06:00
CascadiaSettings.h FindGuid helper function (#3762) 2019-12-02 08:24:21 -06:00
CascadiaSettingsSerialization.cpp CascadiaSettings: Use map to find matching color scheme (#3288) 2019-10-31 10:11:54 -05:00
ColorScheme.cpp Add Selection Background Color as a setting to Profiles and Col… (#3471) 2019-11-13 12:17:39 -06:00
ColorScheme.h Add Selection Background Color as a setting to Profiles and Col… (#3471) 2019-11-13 12:17:39 -06:00
DefaultProfileUtils.cpp Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
DefaultProfileUtils.h Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
defaults.json Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
FixVisualStudioBug.targets Fix the ut_app build for VS 16.2, 16.3 (#2347) 2019-08-09 13:21:45 -07:00
GlobalAppSettings.cpp Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
GlobalAppSettings.h Enable setting an initial position and maximized launch (#2817) 2019-10-16 21:51:50 -07:00
IDynamicProfileGenerator.h Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
init.cpp Introduce a WinRT utils library and "checked resources" (#3350) 2019-11-01 15:47:05 -07:00
JsonUtils.cpp Add Cascading User + Default Settings (#2515) 2019-09-16 12:57:10 -07:00
JsonUtils.h Add Cascading User + Default Settings (#2515) 2019-09-16 12:57:10 -07:00
KeyChordSerialization.cpp Allow the mapping of OEM keys ({}|\<>/_-=+) in key bindings (#2067) 2019-07-23 14:05:07 -07:00
KeyChordSerialization.h Support remapping keybindings (#748) 2019-05-21 09:26:04 -05:00
LegacyProfileGeneratorNamespaces.h Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
MinMaxCloseControl.cpp Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
MinMaxCloseControl.h Propagate window style changes to the titlebar and minmax (#3025) 2019-10-02 10:27:07 -07:00
MinMaxCloseControl.idl Propagate window style changes to the titlebar and minmax (#3025) 2019-10-02 10:27:07 -07:00
MinMaxCloseControl.xaml Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
packages.config Introduce a Universal package for Windows Terminal (#3236) 2019-11-25 16:30:45 -08:00
Pane.cpp Implement ConnectionState and closeOnExit=graceful/always/never (#3623) 2019-11-25 14:22:29 -08:00
Pane.h Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
pch.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
pch.h Refactor TerminalApp and Add Tests for Xaml Content (#1164) 2019-07-15 14:27:56 -05:00
PowershellCoreProfileGenerator.cpp Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
PowershellCoreProfileGenerator.h Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
Profile.cpp Implement ConnectionState and closeOnExit=graceful/always/never (#3623) 2019-11-25 14:22:29 -08:00
Profile.h Implement ConnectionState and closeOnExit=graceful/always/never (#3623) 2019-11-25 14:22:29 -08:00
ShortcutActionDispatch.cpp Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
ShortcutActionDispatch.h Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
ShortcutActionDispatch.idl Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
Tab.cpp Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
Tab.h Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
TabRowControl.cpp Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
TabRowControl.h Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
TabRowControl.idl Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
TabRowControl.xaml Add support for tab drag and drop (#3478) 2019-11-08 09:27:20 -08:00
TerminalApp.def Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
TerminalApp.vcxproj Introduce a Universal package for Windows Terminal (#3236) 2019-11-25 16:30:45 -08:00
TerminalPage.cpp Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
TerminalPage.h Add a 'splitPane' ShortcutAction (#3722) 2019-11-28 07:42:15 -06:00
TerminalPage.idl Enable fullscreen mode (#3408) 2019-11-05 13:40:29 -06:00
TerminalPage.xaml Enable dragging with the entire titlebar (#1948) 2019-07-18 17:21:33 -05:00
TerminalWarnings.h Add a warning when a profile has an unknown color scheme (#3033) 2019-10-14 22:02:52 -07:00
TitlebarControl.cpp Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
TitlebarControl.h Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
TitlebarControl.idl Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
TitlebarControl.xaml Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
userDefaults.json Add a schema reference to the userDefaults and patch one into user data (#2803) 2019-09-18 18:37:23 -07:00
Utils.cpp Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
Utils.h Upgrade to Microsoft.UI.Xaml 2.2 (#3027) 2019-10-14 22:41:43 -07:00
WslDistroGenerator.cpp Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00
WslDistroGenerator.h Add Dynamic Profile Generators (#2603) 2019-09-16 13:34:27 -07:00