Exemple #1
0
        private static FbDatabasesInfo ParseDatabasesInfo(byte[] buffer, ref int pos)
        {
            FbDatabasesInfo dbInfo = new FbDatabasesInfo();
            int             type   = 0;
            int             length = 0;

            pos = 1;

            while ((type = buffer[pos++]) != IscCodes.isc_info_end)
            {
                switch (type)
                {
                case IscCodes.isc_spb_num_att:
                    dbInfo.ConnectionCount = IscHelper.VaxInteger(buffer, pos, 4);
                    pos += 4;
                    break;

                case IscCodes.isc_spb_num_db:
                    pos += 4;
                    break;

                case IscCodes.isc_spb_dbname:
                    length = IscHelper.VaxInteger(buffer, pos, 2);
                    pos   += 2;
                    dbInfo.Databases.Add(Encoding.Default.GetString(buffer, pos, length));
                    pos += length;
                    break;
                }
            }

            pos--;

            return(dbInfo);
        }
		private static FbDatabasesInfo ParseDatabasesInfo(byte[] buffer, ref int pos)
		{
			FbDatabasesInfo dbInfo = new FbDatabasesInfo();
			int type = 0;
			int length = 0;

			pos = 1;

			while ((type = buffer[pos++]) != IscCodes.isc_info_end)
			{
				switch (type)
				{
					case IscCodes.isc_spb_num_att:
						dbInfo.ConnectionCount = IscHelper.VaxInteger(buffer, pos, 4);
						pos += 4;
						break;

					case IscCodes.isc_spb_num_db:
						pos += 4;
						break;

					case IscCodes.isc_spb_dbname:
						length = IscHelper.VaxInteger(buffer, pos, 2);
						pos += 2;
						dbInfo.Databases.Add(Encoding.Default.GetString(buffer, pos, length));
						pos += length;
						break;
				}
			}

			pos--;

			return dbInfo;
		}