summaryrefslogtreecommitdiff
path: root/matlab/lib/+Ice/identityToString.m
blob: 5af3b0ad13d28d12034416dd3ee95d1df2d3f1c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function r = identityToString(id, varargin)
    % identityToString  Converts an object identity to a string.
    %
    % Parameters:
    %   id (Ice.Identity) - The object identity to convert.
    %   mode (Ice.ToStringMode) - Optional argument specifying if and how
    %     non-printable ASCII characters are escaped in the result.
    %
    % Returns (char) - The string representation of the object identity.

    % Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.

    if length(varargin) == 1
        mode = varargin{1};
    elseif length(varargin) == 0
        mode = Ice.ToStringMode.Unicode;
    elseif length(varargin) > 2
        throw(MException('Ice:ArgumentException', 'too many arguments'));
    end
    r = IceInternal.Util.callWithResult('Ice_identityToString', id, int32(mode));
end