blob: b292540446a2fa2de7879e3a6762f341ceb27683 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function r = stringToProtocolVersion(s)
% stringToProtocolVersion Converts a string to a protocol version.
%
% Parameters:
% s (char) - The string to convert.
%
% Returns (Ice.ProtocolVersion) - The converted protocol version.
% Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
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.ProtocolVersion(str2num(tokens{1}{1}), str2num(tokens{1}{2}));
end
|