diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-09-15 17:21:38 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-09-15 17:21:38 -0700 |
commit | 1c1bff5336eb239ea19622dcbde3d47553b55907 (patch) | |
tree | 2d02cbe24bd2d99783546063d23207ce99b5e2aa /matlab/lib/+Ice/stringToEncodingVersion.m | |
parent | changes for compatibility with MATLAB R2016a (diff) | |
download | ice-1c1bff5336eb239ea19622dcbde3d47553b55907.tar.bz2 ice-1c1bff5336eb239ea19622dcbde3d47553b55907.tar.xz ice-1c1bff5336eb239ea19622dcbde3d47553b55907.zip |
Adding support for Slice classes and optional values; Adding more tests
Diffstat (limited to 'matlab/lib/+Ice/stringToEncodingVersion.m')
-rw-r--r-- | matlab/lib/+Ice/stringToEncodingVersion.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/matlab/lib/+Ice/stringToEncodingVersion.m b/matlab/lib/+Ice/stringToEncodingVersion.m new file mode 100644 index 00000000000..d0c61f5bf72 --- /dev/null +++ b/matlab/lib/+Ice/stringToEncodingVersion.m @@ -0,0 +1,18 @@ +%{ +********************************************************************** + +Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. + +This copy of Ice is licensed to you under the terms described in the +ICE_LICENSE file included in this distribution. + +********************************************************************** +%} + +function r = stringToEncodingVersion(s) + tokens = regexp(s, '^([0-9]+)\.([0-9]+)$', 'tokens'); + if isempty(tokens) + throw(MException('Ice:ArgumentException', 'expecting a version in X.Y format')); + end + r = Ice.EncodingVersion(str2num(tokens{1}{1}), str2num(tokens{1}{2})); +end |